Skip to content

Commit eaed2c6

Browse files
Try #1450:
2 parents e00ff65 + 16e164d commit eaed2c6

File tree

382 files changed

+53531
-1066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

382 files changed

+53531
-1066
lines changed

builder/comp-builder.nix

+13-11
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,14 @@ let
346346
frameworks # Frameworks will be needed at link time
347347
# Not sure why pkgconfig needs to be propagatedBuildInputs but
348348
# for gi-gtk-hs it seems to help.
349-
++ builtins.concatLists pkgconfig;
349+
++ builtins.concatLists pkgconfig
350+
++ lib.optionals (stdenv.hostPlatform.isWindows)
351+
(lib.flatten component.libs
352+
++ map haskellLib.dependToLib component.depends);
350353

351-
buildInputs = component.libs
352-
++ map haskellLib.dependToLib component.depends;
354+
buildInputs = lib.optionals (!stdenv.hostPlatform.isWindows)
355+
(lib.flatten component.libs
356+
++ map haskellLib.dependToLib component.depends);
353357

354358
nativeBuildInputs =
355359
[shellWrappers buildPackages.removeReferencesTo]
@@ -482,22 +486,20 @@ let
482486
fi
483487
'')
484488
# In case `setup copy` did not create this
485-
+ (lib.optionalString enableSeparateDataOutput "mkdir -p $data")
489+
+ (lib.optionalString enableSeparateDataOutput ''
490+
mkdir -p $data
491+
'')
486492
+ (lib.optionalString (stdenv.hostPlatform.isWindows && (haskellLib.mayHaveExecutable componentId)) (''
487493
echo "Symlink libffi and gmp .dlls ..."
488494
for p in ${lib.concatStringsSep " " [ libffi gmp ]}; do
489495
find "$p" -iname '*.dll' -exec ln -s {} $out/bin \;
490496
done
491497
''
492498
# symlink all .dlls into the local directory.
493-
# we ask ghc-pkg for *all* dynamic-library-dirs and then iterate over the unique set
494-
# to symlink over dlls as needed.
495499
+ ''
496-
echo "Symlink library dependencies..."
497-
for libdir in $(${stdenv.hostPlatform.config}-ghc-pkg field "*" dynamic-library-dirs --simple-output|xargs|sed 's/ /\n/g'|sort -u); do
498-
if [ -d "$libdir" ]; then
499-
find "$libdir" -iname '*.dll' -exec ln -s {} $out/bin \;
500-
fi
500+
for p in $pkgsHostTargetAsString; do
501+
find "$p" -iname '*.dll' -exec ln -s {} $out/bin \;
502+
find "$p" -iname '*.dll.a' -exec ln -s {} $out/bin \;
501503
done
502504
''))
503505
+ (lib.optionalString doCoverage ''

builder/make-config-files.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ let
8585
${target-pkg} init $out/${packageCfgDir}
8686
8787
${lib.concatStringsSep "\n" (lib.mapAttrsToList flagsAndConfig {
88-
"extra-lib-dirs" = map (p: "${lib.getLib p}/lib") component.libs
88+
"extra-lib-dirs" = map (p: "${lib.getLib p}/lib") (lib.flatten component.libs)
8989
# On windows also include `bin` directories that may contain DLLs
9090
++ lib.optionals (stdenv.hostPlatform.isWindows)
9191
(map (p: "${lib.getBin p}/bin")
92-
(component.libs ++ lib.concatLists component.pkgconfig));
93-
"extra-include-dirs" = map (p: "${lib.getDev p}/include") component.libs;
92+
(lib.flatten component.libs ++ lib.concatLists component.pkgconfig));
93+
"extra-include-dirs" = map (p: "${lib.getDev p}/include") (lib.flatten component.libs);
9494
"extra-framework-dirs" = map (p: "${p}/Library/Frameworks") component.frameworks;
9595
})}
9696

ci.nix

+8-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@
5353
# aarch64-darwin requires ghc 8.10.7 and does not work on older nixpkgs
5454
(v != "aarch64-darwin" || (
5555
!__elem compiler-nix-name ["ghc865" "ghc884" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921"]
56-
&& !__elem nixpkgsName ["R2105"]))) supportedSystems) (v: v);
56+
&& !__elem nixpkgsName ["R2105"]))
57+
&&
58+
# aarch64-linux requires ghc 8.8.4
59+
(v != "aarch64-linux" || (
60+
!__elem compiler-nix-name ["ghc865" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921"]
61+
))) supportedSystems) (v: v);
5762
crossSystems = nixpkgsName: nixpkgs: compiler-nix-name: system:
5863
# We need to use the actual nixpkgs version we're working with here, since the values
5964
# of 'lib.systems.examples' are not understood between all versions
@@ -63,10 +68,10 @@
6368
|| (system == "x86_64-darwin" && __elem compiler-nix-name ["ghc8107"]))) {
6469
inherit (lib.systems.examples) ghcjs;
6570
} // lib.optionalAttrs (system == "x86_64-linux" &&
66-
nixpkgsName == "unstable" && (__elem compiler-nix-name ["ghc810420210212" "ghc8107"])) {
71+
nixpkgsName == "unstable" && (__elem compiler-nix-name ["ghc810420210212" "ghc8107" "ghc902" "ghc922"])) {
6772
# Windows cross compilation is currently broken on macOS
6873
inherit (lib.systems.examples) mingwW64;
69-
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && compiler-nix-name == "ghc8107") {
74+
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922"]) {
7075
# Musl cross only works on linux
7176
# aarch64 cross only works on linux
7277
inherit (lib.systems.examples) musl64 aarch64-multiplatform;

compiler/ghc/configured-src.nix

-132
This file was deleted.

0 commit comments

Comments
 (0)