uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
24
pkgs/development/compilers/elm/README.md
Normal file
24
pkgs/development/compilers/elm/README.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# To update Elm:
|
||||
|
||||
Modify revision in ./update.sh and run it
|
||||
|
||||
# Notes about the build process:
|
||||
|
||||
The elm binary embeds a piece of pre-compiled elm code, used by 'elm
|
||||
reactor'. This means that the build process for 'elm' effectively
|
||||
executes 'elm make'. that in turn expects to retrieve the elm
|
||||
dependencies of that code (elm/core, etc.) from
|
||||
package.elm-lang.org, as well as a cached bit of metadata
|
||||
(versions.dat).
|
||||
|
||||
The makeDotElm function lets us retrieve these dependencies in the
|
||||
standard nix way. we have to copy them in (rather than symlink) and
|
||||
make them writable because the elm compiler writes other .dat files
|
||||
alongside the source code. versions.dat was produced during an
|
||||
impure build of this same code; the build complains that it can't
|
||||
update this cache, but continues past that warning.
|
||||
|
||||
Finally, we set ELM_HOME to point to these pre-fetched artifacts so
|
||||
that the default of ~/.elm isn't used.
|
||||
|
||||
More: https://blog.hercules-ci.com/elm/2019/01/03/elm2nix-0.1/
|
||||
243
pkgs/development/compilers/elm/default.nix
Normal file
243
pkgs/development/compilers/elm/default.nix
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
{ pkgs, lib }:
|
||||
|
||||
let
|
||||
|
||||
# To controll nodejs version we pass down
|
||||
nodejs = pkgs.nodejs-14_x;
|
||||
|
||||
fetchElmDeps = pkgs.callPackage ./fetchElmDeps.nix { };
|
||||
|
||||
hsPkgs = self: pkgs.haskell.packages.ghc8107.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 ./packages/elm-srcs.nix);
|
||||
elmVersion = drv.version;
|
||||
registryDat = ./registry.dat;
|
||||
};
|
||||
buildTools = drv.buildTools or [] ++ [ pkgs.makeWrapper ];
|
||||
jailbreak = true;
|
||||
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 ./packages/elm.nix { });
|
||||
|
||||
/*
|
||||
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;
|
||||
|
||||
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 ./packages/elm-format.nix {}));
|
||||
|
||||
elmi-to-json = justStaticExecutables (overrideCabal (drv: {
|
||||
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 ./packages/elmi-to-json.nix {}));
|
||||
|
||||
elm-instrument = justStaticExecutables (overrideCabal (drv: {
|
||||
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 ./packages/elm-instrument.nix {}));
|
||||
|
||||
inherit fetchElmDeps;
|
||||
elmVersion = elmPkgs.elm.version;
|
||||
};
|
||||
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 = self.aeson_1_5_6_0;
|
||||
|
||||
# Needed for elm-format
|
||||
indents = self.callPackage ./packages/indents.nix {};
|
||||
bimap = self.callPackage ./packages/bimap.nix {};
|
||||
avh4-lib = doJailbreak (self.callPackage ./packages/avh4-lib.nix {});
|
||||
elm-format-lib = doJailbreak (self.callPackage ./packages/elm-format-lib.nix {});
|
||||
# We need tasty-hspec < 1.1.7 and hspec-golden < 0.2 to build elm-format-lib
|
||||
tasty-hspec = self.tasty-hspec_1_1_6;
|
||||
hspec-golden = self.hspec-golden_0_1_0_3;
|
||||
|
||||
# We need hspec hspec_core, hspec_discover < 2.8 for tasty-hspec == 1.1.6
|
||||
hspec = self.hspec_2_7_10;
|
||||
hspec-core = self.hspec-core_2_7_10;
|
||||
hspec-discover = self.hspec-discover_2_7_10;
|
||||
|
||||
elm-format-test-lib = self.callPackage ./packages/elm-format-test-lib.nix {};
|
||||
elm-format-markdown = self.callPackage ./packages/elm-format-markdown.nix {};
|
||||
};
|
||||
};
|
||||
|
||||
nodePkgs = pkgs.callPackage ./packages/node-composition.nix {
|
||||
inherit pkgs;
|
||||
nodejs = pkgs.nodejs-14_x;
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
};
|
||||
|
||||
in lib.makeScope pkgs.newScope (self: with self; {
|
||||
inherit fetchElmDeps nodejs;
|
||||
|
||||
/* Node/NPM based dependecies can be upgraded using script `packages/generate-node-packages.sh`.
|
||||
|
||||
* Packages which rely on `bin-wrap` will fail by default
|
||||
and can be patched using `patchBinwrap` function defined in `packages/lib.nix`.
|
||||
|
||||
* Packages which depend on npm installation of elm can be patched using
|
||||
`patchNpmElm` function also defined in `packages/lib.nix`.
|
||||
*/
|
||||
elmLib = let
|
||||
hsElmPkgs = hsPkgs self;
|
||||
in import ./packages/lib.nix {
|
||||
inherit lib;
|
||||
inherit (pkgs) writeScriptBin stdenv;
|
||||
inherit (hsElmPkgs.elmPkgs) elm;
|
||||
};
|
||||
|
||||
elm-json = callPackage ./packages/elm-json.nix { };
|
||||
|
||||
elm-test-rs = callPackage ./packages/elm-test-rs.nix { };
|
||||
|
||||
elm-test = nodePkgs.elm-test // {
|
||||
meta = with lib; nodePkgs.elm-test.meta // {
|
||||
description = "Runs elm-test suites from Node.js";
|
||||
homepage = "https://github.com/rtfeldman/node-test-runner";
|
||||
license = licenses.bsd3;
|
||||
maintainers = [ maintainers.turbomack ];
|
||||
};
|
||||
};
|
||||
} // (hsPkgs self).elmPkgs // (with elmLib; with (hsPkgs self).elmPkgs; {
|
||||
elm-verify-examples = 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 ];
|
||||
};
|
||||
};
|
||||
|
||||
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-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-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 = nodePkgs."elm-pages".overrideAttrs (
|
||||
old: {
|
||||
buildInputs = old.buildInputs ++ [ pkgs.makeWrapper ];
|
||||
|
||||
# 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 ${./packages/elm-pages-fix-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 ];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
inherit (nodePkgs) elm-doc-preview elm-live elm-upgrade elm-xref elm-analyse elm-git-install;
|
||||
})
|
||||
)
|
||||
11
pkgs/development/compilers/elm/fetchElmDeps.nix
Normal file
11
pkgs/development/compilers/elm/fetchElmDeps.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{stdenv, lib, fetchurl}:
|
||||
|
||||
{elmPackages, registryDat, elmVersion}:
|
||||
|
||||
let
|
||||
makeDotElm = import ./makeDotElm.nix {inherit stdenv lib fetchurl registryDat;};
|
||||
|
||||
in
|
||||
''
|
||||
export ELM_HOME=`pwd`/.elm
|
||||
'' + (makeDotElm elmVersion elmPackages)
|
||||
35
pkgs/development/compilers/elm/makeDotElm.nix
Normal file
35
pkgs/development/compilers/elm/makeDotElm.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{stdenv, lib, fetchurl, registryDat}:
|
||||
|
||||
ver: deps:
|
||||
let cmds = lib.mapAttrsToList (name: info: let
|
||||
pkg = stdenv.mkDerivation {
|
||||
name = lib.replaceChars ["/"] ["-"] name + "-${info.version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/${name}/archive/${info.version}.tar.gz";
|
||||
meta.homepage = "https://github.com/${name}/";
|
||||
inherit (info) sha256;
|
||||
};
|
||||
|
||||
configurePhase = ''
|
||||
true
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
true
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r * $out
|
||||
'';
|
||||
};
|
||||
in ''
|
||||
mkdir -p .elm/${ver}/packages/${name}
|
||||
cp -R ${pkg} .elm/${ver}/packages/${name}/${info.version}
|
||||
'') deps;
|
||||
in (lib.concatStrings cmds) + ''
|
||||
mkdir -p .elm/${ver}/packages;
|
||||
cp ${registryDat} .elm/${ver}/packages/registry.dat;
|
||||
chmod -R +w .elm
|
||||
''
|
||||
25
pkgs/development/compilers/elm/packages/README.md
Normal file
25
pkgs/development/compilers/elm/packages/README.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Elm packages
|
||||
|
||||
Mixtures of useful Elm lang tooling containing both Haskell and Node.js based utilities.
|
||||
|
||||
## Upgrades
|
||||
|
||||
Haskell parts of the ecosystem are using [cabal2nix](https://github.com/NixOS/cabal2nix).
|
||||
Please refer to [nix documentation](https://nixos.org/nixpkgs/manual/#how-to-create-nix-builds-for-your-own-private-haskell-packages)
|
||||
and [cabal2nix readme](https://github.com/NixOS/cabal2nix#readme) for more information. Elm-format [update scripts](https://github.com/avh4/elm-format/tree/master/package/nix)
|
||||
is part of its repository.
|
||||
|
||||
Node dependencies are defined in [node-packages.json](node-packages.json).
|
||||
[Node2nix](https://github.com/svanderburg/node2nix) is used for generating nix expression
|
||||
from this file. Use [generate-node-packages.sh](generate-node-packages.sh) for updates of nix expressions.
|
||||
|
||||
## Binwrap Patch
|
||||
|
||||
Some node packages might use [binwrap](https://github.com/avh4/binwrap) typically for installing
|
||||
[elmi-to-json](https://github.com/stoeffel/elmi-to-json). Binwrap is not compatible with nix.
|
||||
To overcome issues with those packages apply [patch-binwrap.nix](patch-binwrap.nix) which essentially does 2 things.
|
||||
|
||||
1. It replaces binwrap scripts with noop shell scripts
|
||||
2. It uses nix for installing the binaries to expected location in `node_modules`
|
||||
|
||||
Example usage be found in `elm/default.nix`.
|
||||
29
pkgs/development/compilers/elm/packages/avh4-lib.nix
Normal file
29
pkgs/development/compilers/elm/packages/avh4-lib.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ mkDerivation, ansi-terminal, ansi-wl-pprint, array, base, bimap
|
||||
, binary, bytestring, containers, directory, fetchgit, filepath
|
||||
, lib, mtl, process, relude, tasty, tasty-discover, tasty-hspec
|
||||
, tasty-hunit, text
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "avh4-lib";
|
||||
version = "0.0.0.1";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/avh4/elm-format";
|
||||
sha256 = "0bcjkcs1dy1csz0mpk7d4b5wf93fsj9p86x8fp42mb0pipdd0bh6";
|
||||
rev = "80f15d85ee71e1663c9b53903f2b5b2aa444a3be";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
postUnpack = "sourceRoot+=/avh4-lib; echo source root reset to $sourceRoot";
|
||||
libraryHaskellDepends = [
|
||||
ansi-terminal ansi-wl-pprint array base bimap binary bytestring
|
||||
containers directory filepath mtl process relude text
|
||||
];
|
||||
testHaskellDepends = [
|
||||
ansi-terminal ansi-wl-pprint array base bimap binary bytestring
|
||||
containers directory filepath mtl process relude tasty tasty-hspec
|
||||
tasty-hunit text
|
||||
];
|
||||
testToolDepends = [ tasty-discover ];
|
||||
doHaddock = false;
|
||||
description = "Common code for haskell projects";
|
||||
license = lib.licenses.bsd3;
|
||||
}
|
||||
15
pkgs/development/compilers/elm/packages/bimap.nix
Normal file
15
pkgs/development/compilers/elm/packages/bimap.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ 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;
|
||||
}
|
||||
33
pkgs/development/compilers/elm/packages/elm-format-lib.nix
Normal file
33
pkgs/development/compilers/elm/packages/elm-format-lib.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ mkDerivation, ansi-terminal, ansi-wl-pprint, array, avh4-lib
|
||||
, base, bimap, binary, bytestring, containers, directory
|
||||
, elm-format-markdown, elm-format-test-lib, fetchgit, filepath
|
||||
, indents, json, lib, mtl, optparse-applicative, parsec, process
|
||||
, relude, split, tasty, tasty-discover, tasty-hspec, tasty-hunit
|
||||
, text
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "elm-format-lib";
|
||||
version = "0.0.0.1";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/avh4/elm-format";
|
||||
sha256 = "0bcjkcs1dy1csz0mpk7d4b5wf93fsj9p86x8fp42mb0pipdd0bh6";
|
||||
rev = "80f15d85ee71e1663c9b53903f2b5b2aa444a3be";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
postUnpack = "sourceRoot+=/elm-format-lib; echo source root reset to $sourceRoot";
|
||||
libraryHaskellDepends = [
|
||||
ansi-terminal ansi-wl-pprint array avh4-lib base bimap binary
|
||||
bytestring containers directory elm-format-markdown filepath
|
||||
indents json mtl optparse-applicative parsec process relude text
|
||||
];
|
||||
testHaskellDepends = [
|
||||
ansi-terminal ansi-wl-pprint array avh4-lib base bimap binary
|
||||
bytestring containers directory elm-format-markdown
|
||||
elm-format-test-lib filepath indents json mtl optparse-applicative
|
||||
parsec process relude split tasty tasty-hspec tasty-hunit text
|
||||
];
|
||||
testToolDepends = [ tasty-discover ];
|
||||
doHaddock = false;
|
||||
description = "Common code used by elm-format and elm-refactor";
|
||||
license = lib.licenses.bsd3;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{ mkDerivation, base, containers, fetchgit, lib, mtl, text }:
|
||||
mkDerivation {
|
||||
pname = "elm-format-markdown";
|
||||
version = "0.0.0.1";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/avh4/elm-format";
|
||||
sha256 = "0bcjkcs1dy1csz0mpk7d4b5wf93fsj9p86x8fp42mb0pipdd0bh6";
|
||||
rev = "80f15d85ee71e1663c9b53903f2b5b2aa444a3be";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
{ mkDerivation, avh4-lib, base, containers, fetchgit, filepath
|
||||
, hspec-core, hspec-golden, lib, mtl, split, tasty, tasty-discover
|
||||
, tasty-hspec, tasty-hunit, text
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "elm-format-test-lib";
|
||||
version = "0.0.0.1";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/avh4/elm-format";
|
||||
sha256 = "0bcjkcs1dy1csz0mpk7d4b5wf93fsj9p86x8fp42mb0pipdd0bh6";
|
||||
rev = "80f15d85ee71e1663c9b53903f2b5b2aa444a3be";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
postUnpack = "sourceRoot+=/elm-format-test-lib; echo source root reset to $sourceRoot";
|
||||
libraryHaskellDepends = [
|
||||
avh4-lib base containers filepath hspec-core hspec-golden mtl split
|
||||
tasty tasty-hspec tasty-hunit text
|
||||
];
|
||||
testHaskellDepends = [
|
||||
avh4-lib base containers filepath hspec-core hspec-golden mtl 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;
|
||||
}
|
||||
40
pkgs/development/compilers/elm/packages/elm-format.nix
Normal file
40
pkgs/development/compilers/elm/packages/elm-format.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ mkDerivation, ansi-wl-pprint, avh4-lib, base, bimap, cmark
|
||||
, containers, elm-format-lib, elm-format-test-lib, fetchgit, json
|
||||
, lib, mtl, optparse-applicative, parsec, QuickCheck, quickcheck-io
|
||||
, relude, tasty, tasty-hspec, tasty-hunit, tasty-quickcheck, text
|
||||
}:
|
||||
mkDerivation rec {
|
||||
pname = "elm-format";
|
||||
version = "0.8.5";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/avh4/elm-format";
|
||||
sha256 = "0bcjkcs1dy1csz0mpk7d4b5wf93fsj9p86x8fp42mb0pipdd0bh6";
|
||||
rev = "80f15d85ee71e1663c9b53903f2b5b2aa444a3be";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
isLibrary = false;
|
||||
isExecutable = true;
|
||||
executableHaskellDepends = [
|
||||
ansi-wl-pprint avh4-lib base containers elm-format-lib json
|
||||
optparse-applicative relude text
|
||||
];
|
||||
testHaskellDepends = [
|
||||
ansi-wl-pprint avh4-lib base bimap cmark containers elm-format-lib
|
||||
elm-format-test-lib json mtl optparse-applicative parsec QuickCheck
|
||||
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;
|
||||
postPatch = ''
|
||||
mkdir -p ./generated
|
||||
cat <<EOHS > ./generated/Build_elm_format.hs
|
||||
module Build_elm_format where
|
||||
|
||||
gitDescribe :: String
|
||||
gitDescribe = "${version}"
|
||||
EOHS
|
||||
'';
|
||||
}
|
||||
43
pkgs/development/compilers/elm/packages/elm-instrument.nix
Normal file
43
pkgs/development/compilers/elm/packages/elm-instrument.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ mkDerivation, fetchpatch, ansi-terminal, ansi-wl-pprint, base, binary
|
||||
, bytestring, Cabal, cmark, containers, directory, elm-format
|
||||
, fetchgit, filepath, free, HUnit, indents, json, mtl
|
||||
, optparse-applicative, parsec, process, QuickCheck, quickcheck-io
|
||||
, split, lib, 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";
|
||||
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 ];
|
||||
libraryHaskellDepends = [
|
||||
ansi-terminal ansi-wl-pprint base binary bytestring containers
|
||||
directory filepath free indents json mtl optparse-applicative
|
||||
parsec process split text
|
||||
];
|
||||
executableHaskellDepends = [ base ];
|
||||
testHaskellDepends = [
|
||||
base cmark containers elm-format HUnit mtl parsec QuickCheck
|
||||
quickcheck-io split tasty tasty-golden tasty-hunit tasty-quickcheck
|
||||
text
|
||||
];
|
||||
homepage = "https://elm-lang.org";
|
||||
description = "Instrumentation library for Elm";
|
||||
license = lib.licenses.bsd3;
|
||||
}
|
||||
39
pkgs/development/compilers/elm/packages/elm-json.nix
Normal file
39
pkgs/development/compilers/elm/packages/elm-json.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib
|
||||
, curl
|
||||
, rustPlatform
|
||||
, fetchurl
|
||||
, openssl
|
||||
, stdenv
|
||||
, pkg-config
|
||||
, darwin
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "elm-json";
|
||||
version = "0.2.10";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/zwilias/elm-json/archive/v${version}.tar.gz";
|
||||
sha256 = "sha256:03azh7wvl60h6w7ffpvl49s7jr7bxpladcm4fzcasakg26i5a71x";
|
||||
};
|
||||
|
||||
cargoPatches = [ ./elm-json.patch ];
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
buildInputs = [
|
||||
curl openssl
|
||||
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
|
||||
|
||||
cargoSha256 = "sha256:01zasrqf1va58i52s3kwdkj1rnwy80gv00xi6npfshjirj3ix07f";
|
||||
|
||||
# Tests perform networking and therefore can't work in sandbox
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Install, upgrade and uninstall Elm dependencies";
|
||||
homepage = "https://github.com/zwilias/elm-json";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.turbomack ];
|
||||
};
|
||||
}
|
||||
43
pkgs/development/compilers/elm/packages/elm-json.patch
Normal file
43
pkgs/development/compilers/elm/packages/elm-json.patch
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
diff --git a/Cargo.lock b/Cargo.lock
|
||||
index 5440d72..6e173fa 100644
|
||||
--- a/Cargo.lock
|
||||
+++ b/Cargo.lock
|
||||
@@ -774,15 +774,6 @@ version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
|
||||
|
||||
-[[package]]
|
||||
-name = "openssl-src"
|
||||
-version = "111.11.0+1.1.1h"
|
||||
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
-checksum = "380fe324132bea01f45239fadfec9343adb044615f29930d039bec1ae7b9fa5b"
|
||||
-dependencies = [
|
||||
- "cc",
|
||||
-]
|
||||
-
|
||||
[[package]]
|
||||
name = "openssl-sys"
|
||||
version = "0.9.58"
|
||||
@@ -792,7 +783,6 @@ dependencies = [
|
||||
"autocfg",
|
||||
"cc",
|
||||
"libc",
|
||||
- "openssl-src",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
diff --git a/Cargo.toml b/Cargo.toml
|
||||
index 4d319f2..6f4d0e5 100644
|
||||
--- a/Cargo.toml
|
||||
+++ b/Cargo.toml
|
||||
@@ -21,8 +21,8 @@ colored = "2.0"
|
||||
dialoguer = "0.6"
|
||||
dirs = "3.0"
|
||||
fs2 = "0.4"
|
||||
-isahc = { version = "0.9", features = ["static-ssl"] }
|
||||
-curl = {version = "0.4", features = ["static-curl", "static-ssl", "force-system-lib-on-osx", "http2"]}
|
||||
+isahc = "0.9"
|
||||
+curl = {version = "0.4", features = ["force-system-lib-on-osx", "http2"]}
|
||||
ctrlc = "3.1"
|
||||
console = "0.12"
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
diff --git a/generator/src/codegen.js b/generator/src/codegen.js
|
||||
index a0ef8806e..fe00ac904 100644
|
||||
--- a/generator/src/codegen.js
|
||||
+++ b/generator/src/codegen.js
|
||||
@@ -20,33 +20,33 @@ async function generate(basePath) {
|
||||
|
||||
const uiFileContent = elmPagesUiFile();
|
||||
await Promise.all([
|
||||
- fs.promises.copyFile(
|
||||
- path.join(__dirname, `./Page.elm`),
|
||||
- `./.elm-pages/Page.elm`
|
||||
+ fs.promises.writeFile(
|
||||
+ `./.elm-pages/Page.elm`,
|
||||
+ fs.readFileSync(path.join(__dirname, `./Page.elm`))
|
||||
),
|
||||
- fs.promises.copyFile(
|
||||
- path.join(__dirname, `./elm-application.json`),
|
||||
- `./elm-stuff/elm-pages/elm-application.json`
|
||||
+ fs.promises.writeFile(
|
||||
+ `./elm-stuff/elm-pages/elm-application.json`,
|
||||
+ fs.readFileSync(path.join(__dirname, `./elm-application.json`))
|
||||
),
|
||||
- fs.promises.copyFile(
|
||||
- path.join(__dirname, `./Page.elm`),
|
||||
- `./elm-stuff/elm-pages/.elm-pages/Page.elm`
|
||||
+ fs.promises.writeFile(
|
||||
+ `./elm-stuff/elm-pages/.elm-pages/Page.elm`,
|
||||
+ fs.readFileSync(path.join(__dirname, `./Page.elm`))
|
||||
),
|
||||
- fs.promises.copyFile(
|
||||
- path.join(__dirname, `./SharedTemplate.elm`),
|
||||
- `./.elm-pages/SharedTemplate.elm`
|
||||
+ fs.promises.writeFile(
|
||||
+ `./.elm-pages/SharedTemplate.elm`,
|
||||
+ fs.readFileSync(path.join(__dirname, `./SharedTemplate.elm`))
|
||||
),
|
||||
- fs.promises.copyFile(
|
||||
- path.join(__dirname, `./SharedTemplate.elm`),
|
||||
- `./elm-stuff/elm-pages/.elm-pages/SharedTemplate.elm`
|
||||
+ fs.promises.writeFile(
|
||||
+ `./elm-stuff/elm-pages/.elm-pages/SharedTemplate.elm`,
|
||||
+ fs.readFileSync(path.join(__dirname, `./SharedTemplate.elm`))
|
||||
),
|
||||
- fs.promises.copyFile(
|
||||
- path.join(__dirname, `./SiteConfig.elm`),
|
||||
- `./.elm-pages/SiteConfig.elm`
|
||||
+ fs.promises.writeFile(
|
||||
+ `./.elm-pages/SiteConfig.elm`,
|
||||
+ fs.readFileSync(path.join(__dirname, `./SiteConfig.elm`))
|
||||
),
|
||||
- fs.promises.copyFile(
|
||||
- path.join(__dirname, `./SiteConfig.elm`),
|
||||
- `./elm-stuff/elm-pages/.elm-pages/SiteConfig.elm`
|
||||
+ fs.promises.writeFile(
|
||||
+ `./elm-stuff/elm-pages/.elm-pages/SiteConfig.elm`,
|
||||
+ fs.readFileSync(path.join(__dirname, `./SiteConfig.elm`))
|
||||
),
|
||||
fs.promises.writeFile("./.elm-pages/Pages.elm", uiFileContent),
|
||||
// write `Pages.elm` with cli interface
|
||||
72
pkgs/development/compilers/elm/packages/elm-srcs.nix
Normal file
72
pkgs/development/compilers/elm/packages/elm-srcs.nix
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
|
||||
"elm-explorations/markdown" = {
|
||||
sha256 = "0k3110ixa4wwf3vkkdplagwah9ypr965qxr1y147rnsc1xsxmr6y";
|
||||
version = "1.0.0";
|
||||
};
|
||||
|
||||
"elm/json" = {
|
||||
sha256 = "1a107nmm905dih4w4mjjkkpdcjbgaf5qjvr7fl30kkpkckfjjnrw";
|
||||
version = "1.1.2";
|
||||
};
|
||||
|
||||
"elm/html" = {
|
||||
sha256 = "1n3gpzmpqqdsldys4ipgyl1zacn0kbpc3g4v3hdpiyfjlgh8bf3k";
|
||||
version = "1.0.0";
|
||||
};
|
||||
|
||||
"elm/svg" = {
|
||||
sha256 = "1cwcj73p61q45wqwgqvrvz3aypjyy3fw732xyxdyj6s256hwkn0k";
|
||||
version = "1.0.1";
|
||||
};
|
||||
|
||||
"elm/project-metadata-utils" = {
|
||||
sha256 = "1d4rd4grrnbdvj9gf00h7dr6hbkjzawgkzpizfrkp1z1pyr3mvq9";
|
||||
version = "1.0.0";
|
||||
};
|
||||
|
||||
"elm/browser" = {
|
||||
sha256 = "1zlmx672glg7fdgkvh5jm47y85pv7pdfr5mkhg6x7ar6k000vyka";
|
||||
version = "1.0.1";
|
||||
};
|
||||
|
||||
"elm/core" = {
|
||||
sha256 = "1l0qdbczw91kzz8sx5d5zwz9x662bspy7p21dsr3f2rigxiix2as";
|
||||
version = "1.0.2";
|
||||
};
|
||||
|
||||
"elm/http" = {
|
||||
sha256 = "008bs76mnp48b4dw8qwjj4fyvzbxvlrl4xpa2qh1gg2kfwyw56v1";
|
||||
version = "2.0.0";
|
||||
};
|
||||
|
||||
"elm/bytes" = {
|
||||
sha256 = "040d7irrawcbnq9jxhzx8p9qacdlw5bncy6lgndd6inm53rvvwbp";
|
||||
version = "1.0.7";
|
||||
};
|
||||
|
||||
"elm/file" = {
|
||||
sha256 = "15vw1ilbg0msimq2k9magwigp8lwqrgvz3vk6qia6b3ldahvw8jr";
|
||||
version = "1.0.1";
|
||||
};
|
||||
|
||||
"elm/parser" = {
|
||||
sha256 = "0a3cxrvbm7mwg9ykynhp7vjid58zsw03r63qxipxp3z09qks7512";
|
||||
version = "1.1.0";
|
||||
};
|
||||
|
||||
"elm/url" = {
|
||||
sha256 = "0av8x5syid40sgpl5vd7pry2rq0q4pga28b4yykn9gd9v12rs3l4";
|
||||
version = "1.0.0";
|
||||
};
|
||||
|
||||
"elm/time" = {
|
||||
sha256 = "0vch7i86vn0x8b850w1p69vplll1bnbkp8s383z7pinyg94cm2z1";
|
||||
version = "1.0.0";
|
||||
};
|
||||
|
||||
"elm/virtual-dom" = {
|
||||
sha256 = "0q1v5gi4g336bzz1lgwpn5b1639lrn63d8y6k6pimcyismp2i1yg";
|
||||
version = "1.0.2";
|
||||
};
|
||||
}
|
||||
31
pkgs/development/compilers/elm/packages/elm-test-rs.nix
Normal file
31
pkgs/development/compilers/elm/packages/elm-test-rs.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ lib, rustPlatform, fetchurl, openssl, stdenv, darwin }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "elm-test-rs";
|
||||
version = "2.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/mpizenberg/elm-test-rs/archive/v${version}.tar.gz";
|
||||
sha256 = "sha256:1manr42w613r9vyji7pxx5gb08jcgkdxv29qqylrqlwxa8d5dcid";
|
||||
};
|
||||
|
||||
buildInputs = lib.optionals (!stdenv.isDarwin) [
|
||||
openssl
|
||||
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
||||
Security
|
||||
CoreServices
|
||||
]);
|
||||
|
||||
cargoSha256 = "sha256:1dpdlzv96kpc25yf5jgsz9qldghyw35x382qpxhkadkn5dryzjvd";
|
||||
verifyCargoDeps = true;
|
||||
|
||||
# Tests perform networking and therefore can't work in sandbox
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Fast and portable executable to run your Elm tests";
|
||||
homepage = "https://github.com/mpizenberg/elm-test-rs";
|
||||
license = licenses.bsd3;
|
||||
maintainers = [ maintainers.jpagex ];
|
||||
};
|
||||
}
|
||||
32
pkgs/development/compilers/elm/packages/elm.nix
Normal file
32
pkgs/development/compilers/elm/packages/elm.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ mkDerivation, ansi-terminal, ansi-wl-pprint, base, binary
|
||||
, bytestring, containers, directory, edit-distance, fetchgit
|
||||
, file-embed, filelock, filepath, ghc-prim, haskeline, HTTP
|
||||
, http-client, http-client-tls, http-types, language-glsl, mtl
|
||||
, network, parsec, process, raw-strings-qq, scientific, SHA
|
||||
, snap-core, snap-server, lib, template-haskell, time
|
||||
, unordered-containers, utf8-string, vector, zip-archive
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
pname = "elm";
|
||||
version = "0.19.1";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/elm/compiler";
|
||||
sha256 = "1rdg3xp3js9xadclk3cdypkscm5wahgsfmm4ldcw3xswzhw6ri8w";
|
||||
rev = "c9aefb6230f5e0bda03205ab0499f6e4af924495";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
isLibrary = false;
|
||||
isExecutable = true;
|
||||
executableHaskellDepends = [
|
||||
ansi-terminal ansi-wl-pprint base binary bytestring containers
|
||||
directory edit-distance file-embed filelock filepath ghc-prim
|
||||
haskeline HTTP http-client http-client-tls http-types language-glsl
|
||||
mtl network parsec process raw-strings-qq scientific SHA snap-core
|
||||
snap-server template-haskell time unordered-containers utf8-string
|
||||
vector zip-archive
|
||||
];
|
||||
homepage = "https://elm-lang.org";
|
||||
description = "The `elm` command line interface";
|
||||
license = lib.licenses.bsd3;
|
||||
}
|
||||
27
pkgs/development/compilers/elm/packages/elmi-to-json.nix
Normal file
27
pkgs/development/compilers/elm/packages/elmi-to-json.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ mkDerivation, aeson, base, binary, bytestring, containers
|
||||
, directory, fetchgit, filepath, ghc-prim, hpack
|
||||
, optparse-applicative, lib, text, unliftio
|
||||
, unordered-containers
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "elmi-to-json";
|
||||
version = "1.3.0";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/stoeffel/elmi-to-json";
|
||||
sha256 = "11j56vcyhijkwi9hzggkwwmxlhzhgm67ab2m7kxkhcbbqgpasa8n";
|
||||
rev = "ae40d1aa1e3d6878f2af514e611d44890e7abc1e";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
libraryHaskellDepends = [
|
||||
aeson base binary bytestring containers directory filepath ghc-prim
|
||||
optparse-applicative text unliftio unordered-containers
|
||||
];
|
||||
libraryToolDepends = [ hpack ];
|
||||
executableHaskellDepends = [ base ];
|
||||
testHaskellDepends = [ base ];
|
||||
prePatch = "hpack";
|
||||
homepage = "https://github.com/stoeffel/elmi-to-json#readme";
|
||||
license = lib.licenses.bsd3;
|
||||
}
|
||||
11
pkgs/development/compilers/elm/packages/generate-node-packages.sh
Executable file
11
pkgs/development/compilers/elm/packages/generate-node-packages.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
ROOT="$(realpath "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"/../../../../..)"
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
$(nix-build $ROOT -A nodePackages.node2nix --no-out-link)/bin/node2nix \
|
||||
-i node-packages.json \
|
||||
-o node-packages.nix \
|
||||
-c node-composition.nix \
|
||||
--no-copy-node-env -e ../../../node-packages/node-env.nix
|
||||
11
pkgs/development/compilers/elm/packages/indents.nix
Normal file
11
pkgs/development/compilers/elm/packages/indents.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ mkDerivation, base, concatenative, lib, mtl, parsec }:
|
||||
mkDerivation {
|
||||
pname = "indents";
|
||||
version = "0.3.3";
|
||||
sha256 = "b61f51ac894609cb5571cc3ded12db5de97185a8de236c69ec24c87457109f9a";
|
||||
libraryHaskellDepends = [ base concatenative mtl parsec ];
|
||||
doCheck = false;
|
||||
homepage = "http://patch-tag.com/r/salazar/indents";
|
||||
description = "indentation sensitive parser-combinators for parsec";
|
||||
license = lib.licenses.bsd3;
|
||||
}
|
||||
43
pkgs/development/compilers/elm/packages/lib.nix
Normal file
43
pkgs/development/compilers/elm/packages/lib.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ 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; }
|
||||
17
pkgs/development/compilers/elm/packages/node-composition.nix
Normal file
17
pkgs/development/compilers/elm/packages/node-composition.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# This file has been generated by node2nix 1.11.1. Do not edit!
|
||||
|
||||
{pkgs ? import <nixpkgs> {
|
||||
inherit system;
|
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:
|
||||
|
||||
let
|
||||
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;
|
||||
};
|
||||
in
|
||||
import ./node-packages.nix {
|
||||
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
|
||||
inherit nodeEnv;
|
||||
}
|
||||
16
pkgs/development/compilers/elm/packages/node-packages.json
Normal file
16
pkgs/development/compilers/elm/packages/node-packages.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
[
|
||||
"elm-analyse",
|
||||
"elm-coverage",
|
||||
"elm-doc-preview",
|
||||
"@elm-tooling/elm-language-server",
|
||||
"elm-live",
|
||||
"elm-test",
|
||||
"elm-upgrade",
|
||||
"elm-verify-examples",
|
||||
"elm-xref",
|
||||
"create-elm-app",
|
||||
"elm-optimize-level-2",
|
||||
"elm-pages",
|
||||
"elm-review",
|
||||
"elm-git-install"
|
||||
]
|
||||
16644
pkgs/development/compilers/elm/packages/node-packages.nix
generated
Normal file
16644
pkgs/development/compilers/elm/packages/node-packages.nix
generated
Normal file
File diff suppressed because it is too large
Load diff
BIN
pkgs/development/compilers/elm/registry.dat
Normal file
BIN
pkgs/development/compilers/elm/registry.dat
Normal file
Binary file not shown.
9
pkgs/development/compilers/elm/update.sh
Executable file
9
pkgs/development/compilers/elm/update.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -p cabal2nix elm2nix -i bash ../../..
|
||||
|
||||
cabal2nix https://github.com/elm/compiler --revision c9aefb6230f5e0bda03205ab0499f6e4af924495 > packages/elm.nix
|
||||
echo "need to manually copy registry.dat from an existing elm project"
|
||||
#elm2nix snapshot > registry.dat
|
||||
pushd "$(nix-build -A elmPackages.elm.src --no-out-link ../../../..)/reactor"
|
||||
elm2nix convert > $OLDPWD/packages/elm-srcs.nix
|
||||
popd
|
||||
Loading…
Add table
Add a link
Reference in a new issue