diff options
author | annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> | 2024-03-29 00:12:10 +0000 |
---|---|---|
committer | annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> | 2024-03-29 00:12:10 +0000 |
commit | 7f0e8fc4f9c7682f18e76c2689dbf6b6f73480ab (patch) | |
tree | f4d20fd6224bbb9aa8ec9baeca285bbe7fb13a28 /pkgs/development/compilers/elm/packages | |
parent | 6d070b44ac028eaafa5252b5f8f60355b0810e9d (diff) | |
parent | 20c720272ecd261b8fc394172f7828175cb63a02 (diff) |
Merge remote-tracking branch 'upstream/staging-next' into staging
Conflicts: pkgs/development/python-modules/langchain-core/default.nix
Diffstat (limited to 'pkgs/development/compilers/elm/packages')
-rw-r--r-- | pkgs/development/compilers/elm/packages/bimap.nix | 15 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/elm-json/default.nix (renamed from pkgs/development/compilers/elm/packages/elm-json.nix) | 5 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/elm-json/use-system-ssl.patch (renamed from pkgs/development/compilers/elm/packages/elm-json.patch) | 0 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/elm-test-rs/default.nix (renamed from pkgs/development/compilers/elm/packages/elm-test-rs.nix) | 0 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/elm-test/default.nix (renamed from pkgs/development/compilers/elm/packages/elm-test.nix) | 0 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc8_10/default.nix | 79 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc8_10/elm-instrument/default.nix (renamed from pkgs/development/compilers/elm/packages/elm-instrument.nix) | 22 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc8_10/elmi-to-json/default.nix (renamed from pkgs/development/compilers/elm/packages/elmi-to-json.nix) | 11 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc8_10/indents/default.nix (renamed from pkgs/development/compilers/elm/packages/indents.nix) | 0 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc9_2/default.nix | 53 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix (renamed from pkgs/development/compilers/elm/packages/avh4-lib.nix) | 2 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-lib.nix (renamed from pkgs/development/compilers/elm/packages/elm-format-lib.nix) | 1 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-markdown.nix (renamed from pkgs/development/compilers/elm/packages/elm-format-markdown.nix) | 1 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-test-lib.nix (renamed from pkgs/development/compilers/elm/packages/elm-format-test-lib.nix) | 1 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format.nix (renamed from pkgs/development/compilers/elm/packages/elm-format.nix) | 12 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc9_6/ansi-wl-pprint/default.nix (renamed from pkgs/development/compilers/elm/packages/ansi-wl-pprint.nix) | 0 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc9_6/default.nix | 42 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/ghc9_6/elm/default.nix (renamed from pkgs/development/compilers/elm/packages/elm.nix) | 0 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/lamdera/default.nix (renamed from pkgs/development/compilers/elm/packages/lamdera.nix) | 3 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/lib.nix | 43 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/node/default.nix | 139 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/node/elm-pages/default.nix | 28 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/node/elm-pages/fix-init-read-only.patch (renamed from pkgs/development/compilers/elm/packages/elm-pages-fix-init-read-only.patch) | 0 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/node/elm-pages/fix-read-only.patch (renamed from pkgs/development/compilers/elm/packages/elm-pages-fix-read-only.patch) | 0 | ||||
-rwxr-xr-x | pkgs/development/compilers/elm/packages/node/generate-node-packages.sh (renamed from pkgs/development/compilers/elm/packages/generate-node-packages.sh) | 5 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/node/node-composition.nix (renamed from pkgs/development/compilers/elm/packages/node-composition.nix) | 2 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/node/node-packages.json (renamed from pkgs/development/compilers/elm/packages/node-packages.json) | 0 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/node/node-packages.nix (renamed from pkgs/development/compilers/elm/packages/node-packages.nix) | 0 |
28 files changed, 363 insertions, 101 deletions
diff --git a/pkgs/development/compilers/elm/packages/bimap.nix b/pkgs/development/compilers/elm/packages/bimap.nix deleted file mode 100644 index 41412d1639c7f..0000000000000 --- a/pkgs/development/compilers/elm/packages/bimap.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ mkDerivation, base, containers, exceptions, lib, QuickCheck -, template-haskell -}: -mkDerivation { - pname = "bimap"; - version = "0.3.3"; - sha256 = "73829355c7bcbd3eedba22a382a04a3ab641702b00828790ec082ec2db3a8ad1"; - libraryHaskellDepends = [ base containers exceptions ]; - testHaskellDepends = [ - base containers exceptions QuickCheck template-haskell - ]; - homepage = "https://github.com/joelwilliamson/bimap"; - description = "Bidirectional mapping between two key types"; - license = lib.licenses.bsd3; -} diff --git a/pkgs/development/compilers/elm/packages/elm-json.nix b/pkgs/development/compilers/elm/packages/elm-json/default.nix index 5b988244cc97b..16cd7f972ce45 100644 --- a/pkgs/development/compilers/elm/packages/elm-json.nix +++ b/pkgs/development/compilers/elm/packages/elm-json/default.nix @@ -17,12 +17,13 @@ rustPlatform.buildRustPackage rec { sha256 = "sha256:nlpxlPzWk3wwDgczuMI9T6DFY1YtQpQ1R4BhdPbzZBs="; }; - cargoPatches = [ ./elm-json.patch ]; + cargoPatches = [ ./use-system-ssl.patch ]; nativeBuildInputs = [ pkg-config ]; buildInputs = [ - curl openssl + curl + openssl ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; cargoSha256 = "sha256:8SOpL8nfhYen9vza0LYpB/5fgVmBwG7vGMmFOaJskIc="; diff --git a/pkgs/development/compilers/elm/packages/elm-json.patch b/pkgs/development/compilers/elm/packages/elm-json/use-system-ssl.patch index 54df030192312..54df030192312 100644 --- a/pkgs/development/compilers/elm/packages/elm-json.patch +++ b/pkgs/development/compilers/elm/packages/elm-json/use-system-ssl.patch diff --git a/pkgs/development/compilers/elm/packages/elm-test-rs.nix b/pkgs/development/compilers/elm/packages/elm-test-rs/default.nix index 02f69c2d2f03f..02f69c2d2f03f 100644 --- a/pkgs/development/compilers/elm/packages/elm-test-rs.nix +++ b/pkgs/development/compilers/elm/packages/elm-test-rs/default.nix diff --git a/pkgs/development/compilers/elm/packages/elm-test.nix b/pkgs/development/compilers/elm/packages/elm-test/default.nix index eca45395c3df2..eca45395c3df2 100644 --- a/pkgs/development/compilers/elm/packages/elm-test.nix +++ b/pkgs/development/compilers/elm/packages/elm-test/default.nix diff --git a/pkgs/development/compilers/elm/packages/ghc8_10/default.nix b/pkgs/development/compilers/elm/packages/ghc8_10/default.nix new file mode 100644 index 0000000000000..f68e582b3d0b9 --- /dev/null +++ b/pkgs/development/compilers/elm/packages/ghc8_10/default.nix @@ -0,0 +1,79 @@ +{ pkgs, lib }: + +self: pkgs.haskell.packages.ghc810.override { + overrides = self: super: with pkgs.haskell.lib.compose; with lib; + let + elmPkgs = rec { + elmi-to-json = justStaticExecutables (overrideCabal + (drv: { + version = "unstable-2021-07-19"; + src = pkgs.fetchgit { + url = "https://github.com/stoeffel/elmi-to-json"; + sha256 = "0vy678k15rzpsn0aly90fb01pxsbqkgf86pa86w0gd94lka8acwl"; + rev = "6a42376ef4b6877e130971faf964578cc096e29b"; + fetchSubmodules = true; + }; + + prePatch = '' + substituteInPlace package.yaml --replace "- -Werror" "" + hpack + ''; + jailbreak = true; + + description = "Tool that reads .elmi files (Elm interface file) generated by the elm compiler"; + homepage = "https://github.com/stoeffel/elmi-to-json"; + license = licenses.bsd3; + maintainers = [ maintainers.turbomack ]; + }) + (self.callPackage ./elmi-to-json { })); + + elm-instrument = justStaticExecutables (overrideCabal + (drv: { + version = "unstable-2020-03-16"; + src = pkgs.fetchgit { + url = "https://github.com/zwilias/elm-instrument"; + sha256 = "167d7l2547zxdj7i60r6vazznd9ichwc0bqckh3vrh46glkz06jv"; + rev = "63e15bb5ec5f812e248e61b6944189fa4a0aee4e"; + fetchSubmodules = true; + }; + patches = [ + # Update code after breaking change in optparse-applicative + # https://github.com/zwilias/elm-instrument/pull/5 + (pkgs.fetchpatch { + name = "update-optparse-applicative.patch"; + url = "https://github.com/mdevlamynck/elm-instrument/commit/c548709d4818aeef315528e842eaf4c5b34b59b4.patch"; + sha256 = "0ln7ik09n3r3hk7jmwwm46kz660mvxfa71120rkbbaib2falfhsc"; + }) + ]; + + prePatch = '' + sed "s/desc <-.*/let desc = \"${drv.version}\"/g" Setup.hs --in-place + ''; + jailbreak = true; + # Tests are failing because of missing instances for Eq and Show type classes + doCheck = false; + + description = "Instrument Elm code as a preprocessing step for elm-coverage"; + homepage = "https://github.com/zwilias/elm-instrument"; + license = licenses.bsd3; + maintainers = [ maintainers.turbomack ]; + }) + (self.callPackage ./elm-instrument { })); + }; + in + elmPkgs // { + inherit elmPkgs; + + # We need attoparsec < 0.14 to build elm for now + attoparsec = self.attoparsec_0_13_2_5; + + # aeson 2.0.3.0 does not build with attoparsec_0_13_2_5 + aeson = doJailbreak self.aeson_1_5_6_0; + + # elm-instrument needs this + indents = self.callPackage ./indents { }; + + # elm-instrument's tests depend on an old version of elm-format, but we set doCheck to false for other reasons above + elm-format = null; + }; +} diff --git a/pkgs/development/compilers/elm/packages/elm-instrument.nix b/pkgs/development/compilers/elm/packages/ghc8_10/elm-instrument/default.nix index 02593b8550777..7f6a25905e36f 100644 --- a/pkgs/development/compilers/elm/packages/elm-instrument.nix +++ b/pkgs/development/compilers/elm/packages/ghc8_10/elm-instrument/default.nix @@ -1,28 +1,18 @@ -{ mkDerivation, fetchpatch, ansi-terminal, ansi-wl-pprint, base, binary +{ mkDerivation, ansi-terminal, ansi-wl-pprint, base, binary , bytestring, Cabal, cmark, containers, directory, elm-format -, fetchgit, filepath, free, HUnit, indents, json, mtl +, fetchgit, filepath, free, HUnit, indents, json, lib, mtl , optparse-applicative, parsec, process, QuickCheck, quickcheck-io -, split, lib, tasty, tasty-golden, tasty-hunit, tasty-quickcheck -, text +, split, tasty, tasty-golden, tasty-hunit, tasty-quickcheck, text }: mkDerivation { pname = "elm-instrument"; version = "0.0.7"; src = fetchgit { url = "https://github.com/zwilias/elm-instrument"; - sha256 = "167d7l2547zxdj7i60r6vazznd9ichwc0bqckh3vrh46glkz06jv"; - rev = "63e15bb5ec5f812e248e61b6944189fa4a0aee4e"; + sha256 = "14yfzwsyvgc6rzn19sdmwk2mc1vma9hcljnmjnmlig8mp0271v56"; + rev = "31b527e405a6afdb25bb87ad7bd14f979e65cff7"; fetchSubmodules = true; }; - patches = [ - # Update code after breaking change in optparse-applicative - # https://github.com/zwilias/elm-instrument/pull/5 - (fetchpatch { - name = "update-optparse-applicative.patch"; - url = "https://github.com/mdevlamynck/elm-instrument/commit/c548709d4818aeef315528e842eaf4c5b34b59b4.patch"; - sha256 = "0ln7ik09n3r3hk7jmwwm46kz660mvxfa71120rkbbaib2falfhsc"; - }) - ]; isLibrary = true; isExecutable = true; setupHaskellDepends = [ base Cabal directory filepath process ]; @@ -37,7 +27,7 @@ mkDerivation { quickcheck-io split tasty tasty-golden tasty-hunit tasty-quickcheck text ]; - homepage = "https://elm-lang.org"; + homepage = "http://elm-lang.org"; description = "Instrumentation library for Elm"; license = lib.licenses.bsd3; mainProgram = "elm-instrument"; diff --git a/pkgs/development/compilers/elm/packages/elmi-to-json.nix b/pkgs/development/compilers/elm/packages/ghc8_10/elmi-to-json/default.nix index f82f3e5179ac8..fc2c76149a1a5 100644 --- a/pkgs/development/compilers/elm/packages/elmi-to-json.nix +++ b/pkgs/development/compilers/elm/packages/ghc8_10/elmi-to-json/default.nix @@ -1,15 +1,15 @@ { mkDerivation, aeson, base, binary, bytestring, containers -, directory, fetchgit, filepath, ghc-prim, hpack -, optparse-applicative, lib, text, unliftio -, unordered-containers +, directory, fetchgit, filepath, ghc-prim, hpack, lib +, optparse-applicative, text, unliftio, unordered-containers }: mkDerivation { pname = "elmi-to-json"; version = "1.3.0"; src = fetchgit { url = "https://github.com/stoeffel/elmi-to-json"; - rev = "bd18efb59d247439b362272b480e67a16a4e424e"; - sha256 = "sha256-9fScXRSyTkqzeXwh/Jjza6mnENCThlU6KI366CLFcgY="; + sha256 = "0vy678k15rzpsn0aly90fb01pxsbqkgf86pa86w0gd94lka8acwl"; + rev = "6a42376ef4b6877e130971faf964578cc096e29b"; + fetchSubmodules = true; }; isLibrary = true; isExecutable = true; @@ -23,4 +23,5 @@ mkDerivation { prePatch = "hpack"; homepage = "https://github.com/stoeffel/elmi-to-json#readme"; license = lib.licenses.bsd3; + mainProgram = "elmi-to-json"; } diff --git a/pkgs/development/compilers/elm/packages/indents.nix b/pkgs/development/compilers/elm/packages/ghc8_10/indents/default.nix index 85e765db3e50b..85e765db3e50b 100644 --- a/pkgs/development/compilers/elm/packages/indents.nix +++ b/pkgs/development/compilers/elm/packages/ghc8_10/indents/default.nix diff --git a/pkgs/development/compilers/elm/packages/ghc9_2/default.nix b/pkgs/development/compilers/elm/packages/ghc9_2/default.nix new file mode 100644 index 0000000000000..5ef5eff3bef17 --- /dev/null +++ b/pkgs/development/compilers/elm/packages/ghc9_2/default.nix @@ -0,0 +1,53 @@ +{ pkgs, lib }: + +self: pkgs.haskell.packages.ghc92.override { + overrides = self: super: with pkgs.haskell.lib.compose; with lib; + let + elmPkgs = rec { + /* + The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo: + `package/nix/build.sh` + */ + elm-format = justStaticExecutables (overrideCabal + (drv: { + jailbreak = true; + doHaddock = false; + postPatch = '' + mkdir -p ./generated + cat <<EOHS > ./generated/Build_elm_format.hs + module Build_elm_format where + gitDescribe :: String + gitDescribe = "${drv.version}" + EOHS + ''; + + description = "Formats Elm source code according to a standard set of rules based on the official Elm Style Guide"; + homepage = "https://github.com/avh4/elm-format"; + license = licenses.bsd3; + maintainers = with maintainers; [ avh4 turbomack ]; + }) + (self.callPackage ./elm-format/elm-format.nix { })); + }; + + fixHaddock = overrideCabal (_: { + configureFlags = [ "--ghc-option=-Wno-error=unused-packages" ]; + doHaddock = false; + }); + in + elmPkgs // { + inherit elmPkgs; + + # Needed for elm-format + avh4-lib = fixHaddock (doJailbreak (self.callPackage ./elm-format/avh4-lib.nix { })); + elm-format-lib = fixHaddock (doJailbreak (self.callPackage ./elm-format/elm-format-lib.nix { })); + elm-format-test-lib = fixHaddock (self.callPackage ./elm-format/elm-format-test-lib.nix { }); + elm-format-markdown = fixHaddock (self.callPackage ./elm-format/elm-format-markdown.nix { }); + + # elm-format requires text >= 2.0 + text = self.text_2_0_2; + # unorderd-container's tests indirectly depend on text < 2.0 + unordered-containers = overrideCabal (drv: { doCheck = false; }) super.unordered-containers; + # relude-1.1.0.0's tests depend on hedgehog < 1.2, which indirectly depends on text < 2.0 + relude = overrideCabal (drv: { doCheck = false; }) super.relude; + }; +} diff --git a/pkgs/development/compilers/elm/packages/avh4-lib.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix index f7f9381703c6f..e320edfd11623 100644 --- a/pkgs/development/compilers/elm/packages/avh4-lib.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix @@ -12,7 +12,6 @@ mkDerivation { fetchSubmodules = true; }; postUnpack = "sourceRoot+=/avh4-lib; echo source root reset to $sourceRoot"; - configureFlags = [ "--ghc-option=-Wno-error=unused-packages" ]; libraryHaskellDepends = [ array base bytestring directory filepath mtl pooled-io process relude text @@ -22,7 +21,6 @@ mkDerivation { relude tasty tasty-hspec tasty-hunit text ]; testToolDepends = [ tasty-discover ]; - doHaddock = false; description = "Common code for haskell projects"; license = lib.licenses.bsd3; } diff --git a/pkgs/development/compilers/elm/packages/elm-format-lib.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-lib.nix index a6b70414143f1..290534bbea9a5 100644 --- a/pkgs/development/compilers/elm/packages/elm-format-lib.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-lib.nix @@ -24,7 +24,6 @@ mkDerivation { text ]; testToolDepends = [ tasty-discover ]; - doHaddock = false; description = "Common code used by elm-format and elm-refactor"; license = lib.licenses.bsd3; } diff --git a/pkgs/development/compilers/elm/packages/elm-format-markdown.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-markdown.nix index fdeb2e88d384a..e57d2127822e7 100644 --- a/pkgs/development/compilers/elm/packages/elm-format-markdown.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-markdown.nix @@ -10,7 +10,6 @@ mkDerivation { }; postUnpack = "sourceRoot+=/elm-format-markdown; echo source root reset to $sourceRoot"; libraryHaskellDepends = [ base containers mtl text ]; - doHaddock = false; description = "Markdown parsing for Elm documentation comments"; license = lib.licenses.bsd3; } diff --git a/pkgs/development/compilers/elm/packages/elm-format-test-lib.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-test-lib.nix index ccd6264d6c163..43090abbeae49 100644 --- a/pkgs/development/compilers/elm/packages/elm-format-test-lib.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-test-lib.nix @@ -21,7 +21,6 @@ mkDerivation { split tasty tasty-hspec tasty-hunit text ]; testToolDepends = [ tasty-discover ]; - doHaddock = false; description = "Test helpers used by elm-format-tests and elm-refactor-tests"; license = lib.licenses.bsd3; } diff --git a/pkgs/development/compilers/elm/packages/elm-format.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format.nix index c4448f2464254..82ec995e1ecc2 100644 --- a/pkgs/development/compilers/elm/packages/elm-format.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format.nix @@ -3,7 +3,7 @@ , optparse-applicative, QuickCheck, quickcheck-io, relude, tasty , tasty-hspec, tasty-hunit, tasty-quickcheck, text }: -mkDerivation rec { +mkDerivation { pname = "elm-format"; version = "0.8.7"; src = fetchgit { @@ -24,18 +24,8 @@ mkDerivation rec { quickcheck-io relude tasty tasty-hspec tasty-hunit tasty-quickcheck text ]; - doHaddock = false; homepage = "https://elm-lang.org"; description = "A source code formatter for Elm"; license = lib.licenses.bsd3; mainProgram = "elm-format"; - postPatch = '' - mkdir -p ./generated - cat <<EOHS > ./generated/Build_elm_format.hs - module Build_elm_format where - - gitDescribe :: String - gitDescribe = "${version}" - EOHS - ''; } diff --git a/pkgs/development/compilers/elm/packages/ansi-wl-pprint.nix b/pkgs/development/compilers/elm/packages/ghc9_6/ansi-wl-pprint/default.nix index 392ca5ab31b1b..392ca5ab31b1b 100644 --- a/pkgs/development/compilers/elm/packages/ansi-wl-pprint.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_6/ansi-wl-pprint/default.nix diff --git a/pkgs/development/compilers/elm/packages/ghc9_6/default.nix b/pkgs/development/compilers/elm/packages/ghc9_6/default.nix new file mode 100644 index 0000000000000..13ba7faa03088 --- /dev/null +++ b/pkgs/development/compilers/elm/packages/ghc9_6/default.nix @@ -0,0 +1,42 @@ +{ pkgs, lib, makeWrapper, nodejs, fetchElmDeps }: + +self: pkgs.haskell.packages.ghc96.override { + overrides = self: super: with pkgs.haskell.lib.compose; with lib; + let + elmPkgs = rec { + elm = overrideCabal + (drv: { + # sadly with parallelism most of the time breaks compilation + enableParallelBuilding = false; + preConfigure = fetchElmDeps { + elmPackages = (import ../elm-srcs.nix); + elmVersion = drv.version; + registryDat = ../../registry.dat; + }; + buildTools = drv.buildTools or [ ] ++ [ makeWrapper ]; + postInstall = '' + wrapProgram $out/bin/elm \ + --prefix PATH ':' ${lib.makeBinPath [ nodejs ]} + ''; + + description = "A delightful language for reliable webapps"; + homepage = "https://elm-lang.org/"; + license = licenses.bsd3; + maintainers = with maintainers; [ domenkozar turbomack ]; + }) + (self.callPackage ./elm { }); + + inherit fetchElmDeps; + elmVersion = elmPkgs.elm.version; + }; + in + elmPkgs // { + inherit elmPkgs; + + ansi-wl-pprint = overrideCabal + (drv: { + jailbreak = true; + }) + (self.callPackage ./ansi-wl-pprint { }); + }; +} diff --git a/pkgs/development/compilers/elm/packages/elm.nix b/pkgs/development/compilers/elm/packages/ghc9_6/elm/default.nix index 1071d50a84c95..1071d50a84c95 100644 --- a/pkgs/development/compilers/elm/packages/elm.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_6/elm/default.nix diff --git a/pkgs/development/compilers/elm/packages/lamdera.nix b/pkgs/development/compilers/elm/packages/lamdera/default.nix index e3dda4c31a524..c92d2d144d4b8 100644 --- a/pkgs/development/compilers/elm/packages/lamdera.nix +++ b/pkgs/development/compilers/elm/packages/lamdera/default.nix @@ -1,4 +1,5 @@ -{ stdenv, lib +{ stdenv +, lib , fetchurl }: diff --git a/pkgs/development/compilers/elm/packages/lib.nix b/pkgs/development/compilers/elm/packages/lib.nix deleted file mode 100644 index 12e0600dc2310..0000000000000 --- a/pkgs/development/compilers/elm/packages/lib.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ writeScriptBin, stdenv, lib, elm }: -let - patchBinwrap = - let - # Patching binwrap by NoOp script - binwrap = writeScriptBin "binwrap" '' - #! ${stdenv.shell} - echo "binwrap called: Returning 0" - return 0 - ''; - binwrap-install = writeScriptBin "binwrap-install" '' - #! ${stdenv.shell} - echo "binwrap-install called: Doing nothing" - ''; - in targets: pkg: - pkg.override (old: { - nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ binwrap binwrap-install ]; - - # Manually install targets - # by symlinking binaries into `node_modules` - postInstall = let - binFile = module: lib.strings.removeSuffix ("-" + module.version) module.name; - in (old.postInstall or "") + '' - ${lib.concatStrings (map (module: '' - echo "linking ${binFile module}" - ln -sf ${module}/bin/${binFile module} \ - node_modules/${binFile module}/bin/${binFile module} - '') targets)} - ''; - }); - - patchNpmElm = pkg: - pkg.override (old: { - preRebuild = (old.preRebuild or "") + '' - rm node_modules/elm/install.js - echo "console.log('Nixpkgs\' version of Elm will be used');" > node_modules/elm/install.js - ''; - postInstall = (old.postInstall or "") + '' - ln -sf ${elm}/bin/elm node_modules/elm/bin/elm - ''; - }); -in -{ inherit patchBinwrap patchNpmElm; } diff --git a/pkgs/development/compilers/elm/packages/node/default.nix b/pkgs/development/compilers/elm/packages/node/default.nix new file mode 100644 index 0000000000000..6d4d38a6d199c --- /dev/null +++ b/pkgs/development/compilers/elm/packages/node/default.nix @@ -0,0 +1,139 @@ +{ pkgs, lib, nodejs, makeWrapper }: self: + +let + # Untouched npm-downloaded packages + nodePkgs = pkgs.callPackage ./node-composition.nix { + inherit pkgs nodejs; + inherit (pkgs.stdenv.hostPlatform) system; + }; +in +with self; with elmLib; { + inherit (nodePkgs) elm-live elm-upgrade elm-xref elm-analyse elm-git-install; + + elm-verify-examples = + let + patched = patchBinwrap [ elmi-to-json ] nodePkgs.elm-verify-examples // { + meta = with lib; nodePkgs.elm-verify-examples.meta // { + description = "Verify examples in your docs"; + homepage = "https://github.com/stoeffel/elm-verify-examples"; + license = licenses.bsd3; + maintainers = [ maintainers.turbomack ]; + }; + }; + in + patched.override (old: { + preRebuild = (old.preRebuild or "") + '' + # This should not be needed (thanks to binwrap* being nooped) but for some reason it still needs to be done + # in case of just this package + # TODO: investigate, same as for elm-coverage below + sed 's/\"install\".*/\"install\":\"echo no-op\",/g' --in-place node_modules/elmi-to-json/package.json + ''; + }); + + elm-coverage = + let + patched = patchNpmElm (patchBinwrap [ elmi-to-json ] nodePkgs.elm-coverage); + in + patched.override (old: { + # Symlink Elm instrument binary + preRebuild = (old.preRebuild or "") + '' + # Noop custom installation script + sed 's/\"install\".*/\"install\":\"echo no-op\"/g' --in-place package.json + + # This should not be needed (thanks to binwrap* being nooped) but for some reason it still needs to be done + # in case of just this package + # TODO: investigate + sed 's/\"install\".*/\"install\":\"echo no-op\",/g' --in-place node_modules/elmi-to-json/package.json + ''; + postInstall = (old.postInstall or "") + '' + mkdir -p unpacked_bin + ln -sf ${elm-instrument}/bin/elm-instrument unpacked_bin/elm-instrument + ''; + meta = with lib; nodePkgs.elm-coverage.meta // { + description = "Work in progress - Code coverage tooling for Elm"; + homepage = "https://github.com/zwilias/elm-coverage"; + license = licenses.bsd3; + maintainers = [ maintainers.turbomack ]; + }; + }); + + create-elm-app = patchNpmElm + nodePkgs.create-elm-app // { + meta = with lib; nodePkgs.create-elm-app.meta // { + description = "Create Elm apps with no build configuration"; + homepage = "https://github.com/halfzebra/create-elm-app"; + license = licenses.mit; + maintainers = [ maintainers.turbomack ]; + }; + }; + + elm-graphql = + nodePkgs."@dillonkearns/elm-graphql" // { + meta = with lib; nodePkgs."@dillonkearns/elm-graphql".meta // { + description = " Autogenerate type-safe GraphQL queries in Elm."; + license = licenses.bsd3; + maintainers = [ maintainers.pedrohlc ]; + }; + }; + + elm-review = + nodePkgs.elm-review // { + meta = with lib; nodePkgs.elm-review.meta // { + description = "Analyzes Elm projects, to help find mistakes before your users find them"; + homepage = "https://package.elm-lang.org/packages/jfmengels/elm-review/${nodePkgs.elm-review.version}"; + license = licenses.bsd3; + maintainers = [ maintainers.turbomack ]; + }; + }; + + elm-language-server = nodePkgs."@elm-tooling/elm-language-server" // { + meta = with lib; nodePkgs."@elm-tooling/elm-language-server".meta // { + description = "Language server implementation for Elm"; + homepage = "https://github.com/elm-tooling/elm-language-server"; + license = licenses.mit; + maintainers = [ maintainers.turbomack ]; + }; + }; + + elm-spa = nodePkgs."elm-spa".overrideAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ makeWrapper old.nodejs.pkgs.node-gyp-build ]; + + meta = with lib; nodePkgs."elm-spa".meta // { + description = "A tool for building single page apps in Elm"; + homepage = "https://www.elm-spa.dev/"; + license = licenses.bsd3; + maintainers = [ maintainers.ilyakooo0 ]; + }; + } + ); + + elm-optimize-level-2 = nodePkgs."elm-optimize-level-2" // { + meta = with lib; nodePkgs."elm-optimize-level-2".meta // { + description = "A second level of optimization for the Javascript that the Elm Compiler produces"; + homepage = "https://github.com/mdgriffith/elm-optimize-level-2"; + license = licenses.bsd3; + maintainers = [ maintainers.turbomack ]; + }; + }; + + elm-pages = import ./elm-pages { inherit nodePkgs pkgs lib makeWrapper; }; + + elm-land = + let + patched = patchNpmElm nodePkgs.elm-land; + in + patched.override (old: { + meta = with lib; nodePkgs."elm-land".meta // { + description = "A production-ready framework for building Elm applications."; + homepage = "https://elm.land/"; + license = licenses.bsd3; + maintainers = [ maintainers.zupo ]; + }; + } + ); + + elm-doc-preview = nodePkgs."elm-doc-preview".overrideAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ old.nodejs.pkgs.node-gyp-build ]; + }); +} diff --git a/pkgs/development/compilers/elm/packages/node/elm-pages/default.nix b/pkgs/development/compilers/elm/packages/node/elm-pages/default.nix new file mode 100644 index 0000000000000..5502e26b415dd --- /dev/null +++ b/pkgs/development/compilers/elm/packages/node/elm-pages/default.nix @@ -0,0 +1,28 @@ +{ nodePkgs, pkgs, lib, makeWrapper }: + +nodePkgs."elm-pages".overrideAttrs ( + old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ makeWrapper old.nodejs.pkgs.node-gyp-build ]; + + # can't use `patches = [ <patch_file> ]` with a nodePkgs derivation; + # need to patch in one of the build phases instead. + # see upstream issue https://github.com/dillonkearns/elm-pages/issues/305 for dealing with the read-only problem + preFixup = '' + patch $out/lib/node_modules/elm-pages/generator/src/codegen.js ${./fix-read-only.patch} + patch $out/lib/node_modules/elm-pages/generator/src/init.js ${./fix-init-read-only.patch} + ''; + + postFixup = '' + wrapProgram $out/bin/elm-pages --prefix PATH : ${ + with pkgs.elmPackages; lib.makeBinPath [ elm elm-review elm-optimize-level-2 ] + } + ''; + + meta = with lib; nodePkgs."elm-pages".meta // { + description = "A statically typed site generator for Elm."; + homepage = "https://github.com/dillonkearns/elm-pages"; + license = licenses.bsd3; + maintainers = [ maintainers.turbomack maintainers.jali-clarke ]; + }; + } +) diff --git a/pkgs/development/compilers/elm/packages/elm-pages-fix-init-read-only.patch b/pkgs/development/compilers/elm/packages/node/elm-pages/fix-init-read-only.patch index 9704ef9f7c088..9704ef9f7c088 100644 --- a/pkgs/development/compilers/elm/packages/elm-pages-fix-init-read-only.patch +++ b/pkgs/development/compilers/elm/packages/node/elm-pages/fix-init-read-only.patch diff --git a/pkgs/development/compilers/elm/packages/elm-pages-fix-read-only.patch b/pkgs/development/compilers/elm/packages/node/elm-pages/fix-read-only.patch index 547f89f86f69c..547f89f86f69c 100644 --- a/pkgs/development/compilers/elm/packages/elm-pages-fix-read-only.patch +++ b/pkgs/development/compilers/elm/packages/node/elm-pages/fix-read-only.patch diff --git a/pkgs/development/compilers/elm/packages/generate-node-packages.sh b/pkgs/development/compilers/elm/packages/node/generate-node-packages.sh index 49e697e43e88a..66cc71ca32bb2 100755 --- a/pkgs/development/compilers/elm/packages/generate-node-packages.sh +++ b/pkgs/development/compilers/elm/packages/node/generate-node-packages.sh @@ -1,11 +1,12 @@ #!/usr/bin/env bash -ROOT="$(realpath "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"/../../../../..)" +ROOT="$(realpath "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"/../../../../../..)" set -eu -o pipefail $(nix-build $ROOT -A nodePackages.node2nix --no-out-link)/bin/node2nix \ + --nodejs-18 \ -i node-packages.json \ -o node-packages.nix \ -c node-composition.nix \ - --no-copy-node-env -e ../../../node-packages/node-env.nix + --no-copy-node-env -e ../../../../node-packages/node-env.nix diff --git a/pkgs/development/compilers/elm/packages/node-composition.nix b/pkgs/development/compilers/elm/packages/node/node-composition.nix index c825c6c663495..1f86de75e3578 100644 --- a/pkgs/development/compilers/elm/packages/node-composition.nix +++ b/pkgs/development/compilers/elm/packages/node/node-composition.nix @@ -5,7 +5,7 @@ }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs_18"}: let - nodeEnv = import ../../../node-packages/node-env.nix { + nodeEnv = import ../../../../node-packages/node-env.nix { inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; diff --git a/pkgs/development/compilers/elm/packages/node-packages.json b/pkgs/development/compilers/elm/packages/node/node-packages.json index 8112b01bc9e81..8112b01bc9e81 100644 --- a/pkgs/development/compilers/elm/packages/node-packages.json +++ b/pkgs/development/compilers/elm/packages/node/node-packages.json diff --git a/pkgs/development/compilers/elm/packages/node-packages.nix b/pkgs/development/compilers/elm/packages/node/node-packages.nix index 0efccbb5ff90a..0efccbb5ff90a 100644 --- a/pkgs/development/compilers/elm/packages/node-packages.nix +++ b/pkgs/development/compilers/elm/packages/node/node-packages.nix |