haskellPackages.ghcjs-dom: build on js backend of ghc 9.8

This commit is contained in:
Alexandre Esteves 2024-06-14 20:13:43 +01:00 committed by sternenseemann
parent 85a9715838
commit cadb3d1df5
9 changed files with 42 additions and 18 deletions

View File

@ -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:

View File

@ -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;
})

View File

@ -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

View File

@ -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 ]

View File

@ -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; })

View File

@ -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

View File

@ -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

View File

@ -568,7 +568,7 @@ in {
buildHaskellPackages = ghc.bootPkgs;
ghc = bh.compiler.ghcjs810;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { };
packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs-8.x.nix { };
};
# The integer-simple attribute set contains package sets for all the GHC compilers