1
1
final : prev :
2
+ let
3
+ isLinuxCross =
4
+ prev . haskell-nix . haskellLib . isCrossHost
5
+ && prev . hostPlatform . isLinux
6
+ && ( prev . hostPlatform . isAarch32
7
+ || prev . hostPlatform . isAarch64
8
+ || prev . hostPlatform . isi686 ) ;
9
+
10
+ in
2
11
{
3
- haskell-nix = prev . haskell-nix // ( {
12
+ haskell-nix = prev . haskell-nix // final . lib . optionalAttrs isLinuxCross ( {
13
+ templateHaskell = builtins . mapAttrs ( compiler-nix-name : iserv-proxy-exes :
14
+ import ./linux-cross.nix {
15
+ inherit ( final . stdenv ) hostPlatform buildPlatform ;
16
+ inherit ( final ) stdenv lib ;
17
+ inherit ( final . pkgsBuildBuild ) writeShellScriptBin symlinkJoin ;
18
+ inherit ( final . haskell-nix ) haskellLib ;
19
+ qemu = final . pkgsBuildBuild . qemu ;
20
+ inherit ( final ) gmp ;
21
+ inherit ( iserv-proxy-exes ) iserv-proxy iserv-proxy-interpreter iserv-proxy-interpreter-prof ;
22
+ } ) final . haskell-nix . iserv-proxy-exes ;
4
23
defaultModules = prev . haskell-nix . defaultModules ++ [
5
24
( { pkgs , buildModules , config , lib , ... } :
6
25
let
7
- withTH = import ./linux-cross.nix {
8
- inherit ( pkgs . stdenv ) hostPlatform buildPlatform ;
9
- inherit ( pkgs ) stdenv lib ;
10
- inherit ( pkgs . pkgsBuildBuild ) writeShellScriptBin symlinkJoin ;
11
- inherit ( pkgs . haskell-nix ) haskellLib ;
12
- # qemu for linux
13
- # Using `buildPackages.buildPackages` here fixes `python3Packages.pygobject3` issue.
14
- qemu = pkgs . buildPackages . buildPackages . qemu ;
15
-
16
- # wine = pkgs.buildPackages.winePackages.minimal;
17
- # inherit (pkgs.windows) mingw_w64_pthreads;
18
- inherit ( pkgs ) gmp ;
19
- # iserv-proxy needs to come from the buildPackages, as it needs to run on the
20
- # build host.
21
- inherit ( final . haskell-nix . iserv-proxy-exes . ${ config . compiler . nix-name } ) iserv-proxy iserv-proxy-interpreter iserv-proxy-interpreter-prof ;
22
- } // {
23
- # we can perform testing of cross compiled test-suites by using wine.
24
- # Therefore let's enable doCrossCheck here!
25
- doCrossCheck = pkgs . stdenv . hostPlatform . isWindows ;
26
- } ;
26
+ withTH = final . haskell-nix . templateHaskell . ${ config . compiler . nix-name } ;
27
27
in prev . haskell-nix . haskellLib . addPackageKeys {
28
+ inherit ( withTH ) configureFlags testWrapper ;
29
+
30
+ setupBuildFlags = map ( opt : "--ghc-option=" + opt ) withTH . ghcOptions
31
+ ++ lib . optionals pkgs . stdenv . hostPlatform . isAarch32 ( map ( opt : "--gcc-option=" + opt ) [ "-fno-pic" "-fno-plt" ] )
32
+ # Also for GHC #15275
33
+ ++ lib . optionals pkgs . stdenv . hostPlatform . isAarch64 [ "--gcc-option=-fPIC" ] ;
34
+
35
+ enableShared = lib . mkDefault false ;
36
+
37
+ doCrossCheck = true ;
38
+
28
39
packages = {
29
40
# clock 0.7.2 needs to be patched to support cross compilation.
30
41
clock . patches = pkgs . lib . optionals pkgs . stdenv . hostPlatform . isAarch32 [ ( { version } : ( if version == "0.7.2" then ./patches/clock-0.7.2.patch else null ) ) ] ;
31
- # nix calls this package crypto
32
- # cryptonite-openssl.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version }: if version == "0.7" then ./patches/cryptonite-openssl-0.7.patch else null) ];
33
-
34
- # http-client.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version }: if version == "0.5.14" then ./patches/http-client-0.5.14.patch else null) ];
35
-
36
- # conduit.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ({ version }: if builtins.compareVersions version "1.3.1.1" < 0 then ./patches/conduit-1.3.0.2.patch else null) ];
37
- # streaming-commons.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/streaming-commons-0.2.0.0.patch ];
38
- # x509-system.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/x509-system-1.6.6.patch ];
39
- # file-embed-lzma.patches = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isWindows [ ./patches/file-embed-lzma-0.patch ];
40
42
41
43
# Set all of these to [], as these form the
42
44
# dependency graph of the libiserv, iserv-proxy, and iserv-remote
@@ -59,7 +61,7 @@ final: prev:
59
61
network . setupBuildFlags = [ ] ;
60
62
unix . setupBuildFlags = [ ] ;
61
63
} ;
62
- } // withTH
64
+ }
63
65
)
64
66
] ;
65
67
} ) ;
0 commit comments