diff options
author | Alexandre Esteves <alexfmpe@proton.me> | 2024-06-14 20:13:43 +0100 |
---|---|---|
committer | sternenseemann <sternenseemann@systemli.org> | 2024-06-14 23:02:10 +0200 |
commit | cadb3d1df5cc2a98cc62a98a1622ab13af6fb9eb (patch) | |
tree | 74af3287f2e767dc11c52eb47d95422af1605f8b /pkgs/development/haskell-modules | |
parent | 85a9715838227a367e8921fafad2befd7e6f3bfe (diff) |
haskellPackages.ghcjs-dom: build on js backend of ghc 9.8
Diffstat (limited to 'pkgs/development/haskell-modules')
-rw-r--r-- | pkgs/development/haskell-modules/configuration-common.nix | 6 | ||||
-rw-r--r-- | pkgs/development/haskell-modules/configuration-ghcjs-8.x.nix (renamed from pkgs/development/haskell-modules/configuration-ghcjs.nix) | 0 | ||||
-rw-r--r-- | pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix | 22 | ||||
-rw-r--r-- | pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml | 1 | ||||
-rw-r--r-- | pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml | 2 | ||||
-rw-r--r-- | pkgs/development/haskell-modules/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/haskell-modules/generic-builder.nix | 17 | ||||
-rw-r--r-- | pkgs/development/haskell-modules/hackage-packages.nix | 4 |
8 files changed, 41 insertions, 17 deletions
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index b73d72d99a3ae..3d402d3d1be64 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -274,12 +274,6 @@ self: super: { sha256 = "1c7knpvxr7p8c159jkyk6w29653z5yzgjjqj11130bbb8mk9qhq7"; }) super.c2hsc; - # Some Hackage packages reference this attribute, which exists only in the - # GHCJS package set. We provide a dummy version here to fix potential - # evaluation errors. - ghcjs-base = null; - ghcjs-prim = null; - ghc-debug-client = doJailbreak super.ghc-debug-client; # Test failure. Tests also disabled in Stackage: diff --git a/pkgs/development/haskell-modules/configuration-ghcjs.nix b/pkgs/development/haskell-modules/configuration-ghcjs-8.x.nix index c74fdb09232c2..c74fdb09232c2 100644 --- a/pkgs/development/haskell-modules/configuration-ghcjs.nix +++ b/pkgs/development/haskell-modules/configuration-ghcjs-8.x.nix diff --git a/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix b/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix new file mode 100644 index 0000000000000..3b1f8dc4558e1 --- /dev/null +++ b/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix @@ -0,0 +1,22 @@ +{ pkgs, haskellLib }: + +with haskellLib; + +# cabal2nix doesn't properly add dependencies conditional on arch(javascript) +(self: super: { + ghcjs-base = addBuildDepends (with self; [ + aeson + attoparsec + dlist + hashable + primitive + scientific + unordered-containers + vector + ]) super.ghcjs-base; + + ghcjs-dom = addBuildDepend self.ghcjs-dom-javascript super.ghcjs-dom; + ghcjs-dom-javascript = addBuildDepend self.ghcjs-base super.ghcjs-dom-javascript; + jsaddle = addBuildDepend self.ghcjs-base super.jsaddle; + jsaddle-dom = addBuildDepend self.ghcjs-base super.jsaddle-dom; +}) diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml index 02729804ac97b..04a308f33d73c 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml @@ -1995,7 +1995,6 @@ broken-packages: - ghc-internal # failure in job https://hydra.nixos.org/build/260723678 at 2024-05-25 - ghcitui # failure in job https://hydra.nixos.org/build/252737339 at 2024-03-16 - ghcjs-base-stub # timeout - - ghcjs-dom-javascript # failure in job https://hydra.nixos.org/build/255688382 at 2024-04-16 - ghcjs-dom-jsffi # failure in job https://hydra.nixos.org/build/233215225 at 2023-09-02 - ghcjs-fetch # timeout - ghcjs-promise # failure in job https://hydra.nixos.org/build/233243985 at 2023-09-02 diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml index 93eebf297e8e8..1a734a348afa6 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml @@ -152,6 +152,7 @@ package-maintainers: - ghcjs-dom - ghcjs-dom-hello - ghcjs-dom-javascript + - ghcjs-dom-jsaddle - haveibeenpwned - jsaddle - jsaddle-clib @@ -792,6 +793,7 @@ supported-platforms: geomancy: [ platforms.x86 ] # x86 intrinsics geomancy-layout: [ platforms.x86 ] # x86 intrinsics gi-gtkosxapplication: [ platforms.darwin ] + ghcjs-dom-javascript: [ javascript-ghcjs ] gtk-mac-integration: [ platforms.darwin ] gtk3-mac-integration: [ platforms.darwin ] halide-haskell: [ platforms.linux ] diff --git a/pkgs/development/haskell-modules/default.nix b/pkgs/development/haskell-modules/default.nix index 3f8a0bb750c71..73ce1af7735a0 100644 --- a/pkgs/development/haskell-modules/default.nix +++ b/pkgs/development/haskell-modules/default.nix @@ -9,6 +9,7 @@ , configurationNix ? import ./configuration-nix.nix , configurationArm ? import ./configuration-arm.nix , configurationDarwin ? import ./configuration-darwin.nix +, configurationJS ? import ./configuration-ghcjs-9.x.nix }: let @@ -26,7 +27,10 @@ let (configurationArm { inherit pkgs haskellLib; }) ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ (configurationDarwin { inherit pkgs haskellLib; }) - ]; + ] ++ lib.optionals stdenv.hostPlatform.isGhcjs [ + (configurationJS { inherit pkgs haskellLib; }) + ] + ; extensions = lib.composeManyExtensions ([ (nonHackagePackages { inherit pkgs haskellLib; }) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index e32bef104de6c..6c60efe1bce50 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -7,6 +7,13 @@ let isCross = stdenv.buildPlatform != stdenv.hostPlatform; + # Note that ghc.isGhcjs != stdenv.hostPlatform.isGhcjs. + # ghc.isGhcjs implies that we are using ghcjs, a project separate from GHC. + # (mere) stdenv.hostPlatform.isGhcjs means that we are using GHC's JavaScript + # backend. The latter is a normal cross compilation backend and needs little + # special accommodation. + outputsJS = ghc.isGhcjs or false || stdenv.hostPlatform.isGhcjs; + # Pass the "wrong" C compiler rather than none at all so packages that just # use the C preproccessor still work, see # https://github.com/haskell/cabal/issues/6466 for details. @@ -19,15 +26,11 @@ let fetchurl removeReferencesTo pkg-config coreutils gnugrep glibcLocales emscripten; + in { pname -# Note that ghc.isGhcjs != stdenv.hostPlatform.isGhcjs. -# ghc.isGhcjs implies that we are using ghcjs, a project separate from GHC. -# (mere) stdenv.hostPlatform.isGhcjs means that we are using GHC's JavaScript -# backend. The latter is a normal cross compilation backend and needs little -# special accommodation. -, dontStrip ? (ghc.isGhcjs or false || stdenv.hostPlatform.isGhcjs) +, dontStrip ? outputsJS , version, revision ? null , sha256 ? null , src ? fetchurl { url = "mirror://hackage/${pname}-${version}.tar.gz"; inherit sha256; } @@ -44,7 +47,7 @@ in , doHaddockQuickjump ? doHoogle , doInstallIntermediates ? false , editedCabalFile ? null -, enableLibraryProfiling ? !(ghc.isGhcjs or false) +, enableLibraryProfiling ? !outputsJS , enableExecutableProfiling ? false , profilingDetail ? "exported-functions" # TODO enable shared libs for cross-compiling diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix index 1b67efe86b389..1c281355e688b 100644 --- a/pkgs/development/haskell-modules/hackage-packages.nix +++ b/pkgs/development/haskell-modules/hackage-packages.nix @@ -121427,9 +121427,8 @@ self: { sha256 = "0im7wn7bn43rhkblh0wn9angadbdvywsalfz0adr9pkwv6hvc8qs"; description = "DOM library using JSFFI and GHCJS"; license = lib.licenses.mit; - hydraPlatforms = lib.platforms.none; + platforms = [ "javascript-ghcjs" ]; maintainers = [ lib.maintainers.alexfmpe ]; - broken = true; }) {}; "ghcjs-dom-jsaddle" = callPackage @@ -121442,6 +121441,7 @@ self: { doHaddock = false; description = "DOM library that supports both GHCJS and GHC using jsaddle"; license = lib.licenses.mit; + maintainers = [ lib.maintainers.alexfmpe ]; }) {}; "ghcjs-dom-jsffi" = callPackage |