From 3c8ae01a45196759cd01de639f0d200fdfcb6d77 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 20 Mar 2018 11:46:12 -0400 Subject: [PATCH 1/4] lib: Make `platforms.all` actually match all platforms Otherwise obscure cross-compilations are hampered. `all` breaks all but the initial derivation (which we can't even write yet) in an open world setting however, so we really shouldn't have it. --- lib/systems/for-meta.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/systems/for-meta.nix b/lib/systems/for-meta.nix index fa713b1e613..3402fa0ca19 100644 --- a/lib/systems/for-meta.nix +++ b/lib/systems/for-meta.nix @@ -4,8 +4,8 @@ let inherit (lib.systems.inspect) patterns; in rec { - inherit (lib.systems.doubles) all mesaPlatforms; - none = []; + all = [ {} ]; # `{}` matches anything + none = []; arm = [ patterns.isArm ]; aarch64 = [ patterns.isAarch64 ]; @@ -24,4 +24,6 @@ in rec { netbsd = [ patterns.isNetBSD ]; openbsd = [ patterns.isOpenBSD ]; unix = patterns.isUnix; # Actually a list + + inherit (lib.systems.doubles) mesaPlatforms; } From d9a1800239620425ef3608487f87002b1a4d1437 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 20 Mar 2018 12:31:07 -0400 Subject: [PATCH 2/4] lib: Add `lib.platforms.windows` --- lib/systems/for-meta.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/systems/for-meta.nix b/lib/systems/for-meta.nix index 3402fa0ca19..63f24b46535 100644 --- a/lib/systems/for-meta.nix +++ b/lib/systems/for-meta.nix @@ -24,6 +24,7 @@ in rec { netbsd = [ patterns.isNetBSD ]; openbsd = [ patterns.isOpenBSD ]; unix = patterns.isUnix; # Actually a list + windows = [ patterns.isWindows ]; inherit (lib.systems.doubles) mesaPlatforms; } From e49c14c35b73d464d0b3070de7802ca309f7bb6b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 20 Mar 2018 12:31:43 -0400 Subject: [PATCH 3/4] libatomic_ops: Allow Building on Windows too --- pkgs/development/libraries/libatomic_ops/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libatomic_ops/default.nix b/pkgs/development/libraries/libatomic_ops/default.nix index fe4cd3ca0a9..04cf1c1e696 100644 --- a/pkgs/development/libraries/libatomic_ops/default.nix +++ b/pkgs/development/libraries/libatomic_ops/default.nix @@ -28,6 +28,6 @@ stdenv.mkDerivation rec { description = ''A library for semi-portable access to hardware-provided atomic memory update operations''; license = stdenv.lib.licenses.gpl2Plus ; maintainers = [stdenv.lib.maintainers.raskin]; - platforms = stdenv.lib.platforms.unix; + platforms = with stdenv.lib.platforms; unix ++ windows; }; } From 65e24f22e69ea18b5ec638f89a87e070d4e2154a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 20 Mar 2018 11:51:37 -0400 Subject: [PATCH 4/4] haskell-generic-builder: Default to window + unix platforms, Since GHC is a cross compiler, it's perfectly possible to make haskell binaries on platforms without GHCs. `windows ++ unix` seems good enough for now. Also don't default `hydraPlatforms` to `platforms`. The former must be a list of systems (strings), but the latter is a list of systems or patterns. --- pkgs/development/haskell-modules/generic-builder.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 1a788ae642e..3cdf2e2252b 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -34,8 +34,8 @@ in , enableStaticLibraries ? true , extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? [] , homepage ? "http://hackage.haskell.org/package/${pname}" -, platforms ? ghc.meta.platforms -, hydraPlatforms ? platforms +, platforms ? with stdenv.lib.platforms; unix ++ windows # GHC can cross-compile +, hydraPlatforms ? null , hyperlinkSource ? true , isExecutable ? false, isLibrary ? !isExecutable , jailbreak ? false @@ -404,7 +404,7 @@ stdenv.mkDerivation ({ // optionalAttrs broken { inherit broken; } // optionalAttrs (description != "") { inherit description; } // optionalAttrs (maintainers != []) { inherit maintainers; } - // optionalAttrs (hydraPlatforms != platforms) { inherit hydraPlatforms; } + // optionalAttrs (hydraPlatforms != null) { inherit hydraPlatforms; } ; }