-
Notifications
You must be signed in to change notification settings - Fork 244
/
Copy pathdefault.nix
38 lines (32 loc) · 1.71 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Test building TH code that needs DLLs when cross compiling for windows
{ stdenv, lib, util, project', haskellLib, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }:
with lib;
let
project = externalInterpreter: project' {
inherit compiler-nix-name evalPackages;
src = testSrc "th-dlls";
modules = [({pkgs, ...}: lib.optionalAttrs externalInterpreter {
packages.th-dlls.components.library.ghcOptions = [ "-fexternal-interpreter" ];
# Static openssl seems to fail to load in iserv for musl
packages.HsOpenSSL.components.library.libs = lib.optional pkgs.stdenv.hostPlatform.isMusl (pkgs.openssl.override { static = false; });
})];
};
packages = (project false).hsPkgs;
packages-ei = (project true).hsPkgs;
in recurseIntoAttrs {
meta.disabled = stdenv.hostPlatform.isGhcjs ||
# TH breaks for ghc 9.4.3 cross compile for windows if the library even
# just depends on the `text` package (this may be related to the C++ dependency).
(stdenv.hostPlatform.isWindows && __elem compiler-nix-name ["ghc941" "ghc942" "ghc943" "ghc944" "ghc96020230302" "ghc961"]) ||
# Similar problem on macOS
(stdenv.hostPlatform.isDarwin && __elem compiler-nix-name ["ghc941" "ghc942" "ghc943" "ghc944" "ghc96020230302" "ghc961"]);
ifdInputs = {
inherit (project true) plan-nix;
};
build = packages.th-dlls.components.library;
build-profiled = packages.th-dlls.components.library.profiled;
just-template-haskell = packages.th-dlls.components.exes.just-template-haskell;
build-ei = packages-ei.th-dlls.components.library;
build-profiled-ei = packages-ei.th-dlls.components.library.profiled;
just-template-haskell-ei = packages-ei.th-dlls.components.exes.just-template-haskell;
}