11final : 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
211{
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 ;
423 defaultModules = prev . haskell-nix . defaultModules ++ [
524 ( { pkgs , buildModules , config , lib , ... } :
625 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 } ;
2727 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+
2839 packages = {
2940 # clock 0.7.2 needs to be patched to support cross compilation.
3041 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 ];
4042
4143 # Set all of these to [], as these form the
4244 # dependency graph of the libiserv, iserv-proxy, and iserv-remote
@@ -59,7 +61,7 @@ final: prev:
5961 network . setupBuildFlags = [ ] ;
6062 unix . setupBuildFlags = [ ] ;
6163 } ;
62- } // withTH
64+ }
6365 )
6466 ] ;
6567 } ) ;
0 commit comments