-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #352 from Kranzes/improvements
Get rid of no longer needed workarounds, improve cross compilation support, filter src for all nix versions
- Loading branch information
Showing
9 changed files
with
46 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -439,7 +439,7 @@ rec { | |
{ | ||
name = "libc"; | ||
packageId = "libc"; | ||
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "aarch64-linux-android"); | ||
target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "aarch64-linux-android"); | ||
} | ||
{ | ||
name = "libc"; | ||
|
@@ -470,11 +470,7 @@ rec { | |
requiredFeatures = [ ]; | ||
} | ||
]; | ||
# We can't filter paths with references in Nix 2.4 | ||
# See https://github.com/NixOS/nix/issues/5410 | ||
src = if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion )) | ||
then lib.cleanSourceWith { filter = sourceFilter; src = ./.; } | ||
else ./.; | ||
src = lib.cleanSourceWith { filter = sourceFilter; src = ./.; }; | ||
authors = [ | ||
"Peter Kolloch <[email protected]>" | ||
]; | ||
|
@@ -2695,12 +2691,12 @@ rec { | |
{ | ||
name = "winapi-i686-pc-windows-gnu"; | ||
packageId = "winapi-i686-pc-windows-gnu"; | ||
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "i686-pc-windows-gnu"); | ||
target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "i686-pc-windows-gnu"); | ||
} | ||
{ | ||
name = "winapi-x86_64-pc-windows-gnu"; | ||
packageId = "winapi-x86_64-pc-windows-gnu"; | ||
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "x86_64-pc-windows-gnu"); | ||
target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "x86_64-pc-windows-gnu"); | ||
} | ||
]; | ||
features = { | ||
|
@@ -2783,14 +2779,11 @@ rec { | |
fuchsia = true; | ||
test = false; | ||
|
||
/* We are choosing an arbitrary rust version to grab `lib` from, | ||
which is unfortunate, but `lib` has been version-agnostic the | ||
whole time so this is good enough for now. | ||
*/ | ||
os = pkgs.rust.lib.toTargetOs platform; | ||
arch = pkgs.rust.lib.toTargetArch platform; | ||
family = pkgs.rust.lib.toTargetFamily platform; | ||
vendor = pkgs.rust.lib.toTargetVendor platform; | ||
inherit (platform.rust.platform) | ||
arch | ||
os | ||
vendor; | ||
family = platform.rust.platform.target-family; | ||
env = "gnu"; | ||
endian = | ||
if platform.parsed.cpu.significantByte.name == "littleEndian" | ||
|
@@ -3033,7 +3026,7 @@ rec { | |
let | ||
self = { | ||
crates = lib.mapAttrs (packageId: value: buildByPackageIdForPkgsImpl self pkgs packageId) crateConfigs; | ||
target = makeTarget pkgs.stdenv.hostPlatform; | ||
target = makeTarget stdenv.hostPlatform; | ||
build = mkBuiltByPackageIdByPkgs pkgs.buildPackages; | ||
}; | ||
in | ||
|
@@ -3108,8 +3101,6 @@ rec { | |
buildRustCrateForPkgsFunc pkgs | ||
( | ||
crateConfig // { | ||
# https://github.com/NixOS/nixpkgs/issues/218712 | ||
dontStrip = stdenv.hostPlatform.isDarwin; | ||
src = crateConfig.src or ( | ||
pkgs.fetchurl rec { | ||
name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,11 +121,7 @@ rec { | |
requiredFeatures = [ ]; | ||
} | ||
]; | ||
# We can't filter paths with references in Nix 2.4 | ||
# See https://github.com/NixOS/nix/issues/5410 | ||
src = if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion )) | ||
then lib.cleanSourceWith { filter = sourceFilter; src = ./.; } | ||
else ./.; | ||
src = lib.cleanSourceWith { filter = sourceFilter; src = ./.; }; | ||
authors = [ | ||
"Phillip Cloud <[email protected]>" | ||
]; | ||
|
@@ -1257,7 +1253,7 @@ rec { | |
{ | ||
name = "windows_aarch64_gnullvm"; | ||
packageId = "windows_aarch64_gnullvm"; | ||
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "aarch64-pc-windows-gnullvm"); | ||
target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "aarch64-pc-windows-gnullvm"); | ||
} | ||
{ | ||
name = "windows_aarch64_msvc"; | ||
|
@@ -1282,7 +1278,7 @@ rec { | |
{ | ||
name = "windows_x86_64_gnullvm"; | ||
packageId = "windows_x86_64_gnullvm"; | ||
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "x86_64-pc-windows-gnullvm"); | ||
target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "x86_64-pc-windows-gnullvm"); | ||
} | ||
{ | ||
name = "windows_x86_64_msvc"; | ||
|
@@ -1377,14 +1373,11 @@ rec { | |
fuchsia = true; | ||
test = false; | ||
|
||
/* We are choosing an arbitrary rust version to grab `lib` from, | ||
which is unfortunate, but `lib` has been version-agnostic the | ||
whole time so this is good enough for now. | ||
*/ | ||
os = pkgs.rust.lib.toTargetOs platform; | ||
arch = pkgs.rust.lib.toTargetArch platform; | ||
family = pkgs.rust.lib.toTargetFamily platform; | ||
vendor = pkgs.rust.lib.toTargetVendor platform; | ||
inherit (platform.rust.platform) | ||
arch | ||
os | ||
vendor; | ||
family = platform.rust.platform.target-family; | ||
env = "gnu"; | ||
endian = | ||
if platform.parsed.cpu.significantByte.name == "littleEndian" | ||
|
@@ -1627,7 +1620,7 @@ rec { | |
let | ||
self = { | ||
crates = lib.mapAttrs (packageId: value: buildByPackageIdForPkgsImpl self pkgs packageId) crateConfigs; | ||
target = makeTarget pkgs.stdenv.hostPlatform; | ||
target = makeTarget stdenv.hostPlatform; | ||
build = mkBuiltByPackageIdByPkgs pkgs.buildPackages; | ||
}; | ||
in | ||
|
@@ -1702,8 +1695,6 @@ rec { | |
buildRustCrateForPkgsFunc pkgs | ||
( | ||
crateConfig // { | ||
# https://github.com/NixOS/nixpkgs/issues/218712 | ||
dontStrip = stdenv.hostPlatform.isDarwin; | ||
src = crateConfig.src or ( | ||
pkgs.fetchurl rec { | ||
name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,11 +223,7 @@ rec { | |
requiredFeatures = [ ]; | ||
} | ||
]; | ||
# We can't filter paths with references in Nix 2.4 | ||
# See https://github.com/NixOS/nix/issues/5410 | ||
src = if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion )) | ||
then lib.cleanSourceWith { filter = sourceFilter; src = ./.; } | ||
else ./.; | ||
src = lib.cleanSourceWith { filter = sourceFilter; src = ./.; }; | ||
authors = [ | ||
"Peter Kolloch <[email protected]>" | ||
]; | ||
|
@@ -492,12 +488,12 @@ rec { | |
{ | ||
name = "winapi-i686-pc-windows-gnu"; | ||
packageId = "winapi-i686-pc-windows-gnu"; | ||
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "i686-pc-windows-gnu"); | ||
target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "i686-pc-windows-gnu"); | ||
} | ||
{ | ||
name = "winapi-x86_64-pc-windows-gnu"; | ||
packageId = "winapi-x86_64-pc-windows-gnu"; | ||
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "x86_64-pc-windows-gnu"); | ||
target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "x86_64-pc-windows-gnu"); | ||
} | ||
]; | ||
features = { | ||
|
@@ -552,14 +548,11 @@ rec { | |
fuchsia = true; | ||
test = false; | ||
|
||
/* We are choosing an arbitrary rust version to grab `lib` from, | ||
which is unfortunate, but `lib` has been version-agnostic the | ||
whole time so this is good enough for now. | ||
*/ | ||
os = pkgs.rust.lib.toTargetOs platform; | ||
arch = pkgs.rust.lib.toTargetArch platform; | ||
family = pkgs.rust.lib.toTargetFamily platform; | ||
vendor = pkgs.rust.lib.toTargetVendor platform; | ||
inherit (platform.rust.platform) | ||
arch | ||
os | ||
vendor; | ||
family = platform.rust.platform.target-family; | ||
env = "gnu"; | ||
endian = | ||
if platform.parsed.cpu.significantByte.name == "littleEndian" | ||
|
@@ -802,7 +795,7 @@ rec { | |
let | ||
self = { | ||
crates = lib.mapAttrs (packageId: value: buildByPackageIdForPkgsImpl self pkgs packageId) crateConfigs; | ||
target = makeTarget pkgs.stdenv.hostPlatform; | ||
target = makeTarget stdenv.hostPlatform; | ||
build = mkBuiltByPackageIdByPkgs pkgs.buildPackages; | ||
}; | ||
in | ||
|
@@ -877,8 +870,6 @@ rec { | |
buildRustCrateForPkgsFunc pkgs | ||
( | ||
crateConfig // { | ||
# https://github.com/NixOS/nixpkgs/issues/218712 | ||
dontStrip = stdenv.hostPlatform.isDarwin; | ||
src = crateConfig.src or ( | ||
pkgs.fetchurl rec { | ||
name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,11 +126,7 @@ rec { | |
requiredFeatures = [ ]; | ||
} | ||
]; | ||
# We can't filter paths with references in Nix 2.4 | ||
# See https://github.com/NixOS/nix/issues/5410 | ||
src = if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion )) | ||
then lib.cleanSourceWith { filter = sourceFilter; src = ./.; } | ||
else ./.; | ||
src = lib.cleanSourceWith { filter = sourceFilter; src = ./.; }; | ||
authors = [ | ||
"Peter Kolloch <[email protected]>" | ||
]; | ||
|
@@ -161,14 +157,11 @@ rec { | |
fuchsia = true; | ||
test = false; | ||
|
||
/* We are choosing an arbitrary rust version to grab `lib` from, | ||
which is unfortunate, but `lib` has been version-agnostic the | ||
whole time so this is good enough for now. | ||
*/ | ||
os = pkgs.rust.lib.toTargetOs platform; | ||
arch = pkgs.rust.lib.toTargetArch platform; | ||
family = pkgs.rust.lib.toTargetFamily platform; | ||
vendor = pkgs.rust.lib.toTargetVendor platform; | ||
inherit (platform.rust.platform) | ||
arch | ||
os | ||
vendor; | ||
family = platform.rust.platform.target-family; | ||
env = "gnu"; | ||
endian = | ||
if platform.parsed.cpu.significantByte.name == "littleEndian" | ||
|
@@ -411,7 +404,7 @@ rec { | |
let | ||
self = { | ||
crates = lib.mapAttrs (packageId: value: buildByPackageIdForPkgsImpl self pkgs packageId) crateConfigs; | ||
target = makeTarget pkgs.stdenv.hostPlatform; | ||
target = makeTarget stdenv.hostPlatform; | ||
build = mkBuiltByPackageIdByPkgs pkgs.buildPackages; | ||
}; | ||
in | ||
|
@@ -486,8 +479,6 @@ rec { | |
buildRustCrateForPkgsFunc pkgs | ||
( | ||
crateConfig // { | ||
# https://github.com/NixOS/nixpkgs/issues/218712 | ||
dontStrip = stdenv.hostPlatform.isDarwin; | ||
src = crateConfig.src or ( | ||
pkgs.fetchurl rec { | ||
name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters