2019-06-25 14:13:08 +00:00
|
|
|
{ lib, stdenv, pkgs
|
2021-03-12 20:23:15 +00:00
|
|
|
, haskell, haskellPackages, nodejs
|
2020-08-10 18:25:06 +00:00
|
|
|
, fetchurl, fetchpatch, makeWrapper, writeScriptBin
|
|
|
|
# Rust dependecies
|
2021-05-06 09:21:40 +00:00
|
|
|
, curl, rustPlatform, openssl, pkg-config, Security
|
2021-01-23 13:28:08 +00:00
|
|
|
}:
|
2015-08-13 11:50:59 +00:00
|
|
|
let
|
2018-11-18 20:07:31 +00:00
|
|
|
fetchElmDeps = import ./fetchElmDeps.nix { inherit stdenv lib fetchurl; };
|
2019-06-09 14:25:00 +00:00
|
|
|
|
2021-03-12 20:23:15 +00:00
|
|
|
hsPkgs = haskellPackages.override {
|
2021-01-16 17:46:39 +00:00
|
|
|
overrides = self: super: with haskell.lib; with lib;
|
2019-06-09 14:25:00 +00:00
|
|
|
let elmPkgs = rec {
|
2018-08-25 11:01:52 +00:00
|
|
|
elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: {
|
2018-08-25 10:52:48 +00:00
|
|
|
# sadly with parallelism most of the time breaks compilation
|
|
|
|
enableParallelBuilding = false;
|
2019-01-03 16:31:00 +00:00
|
|
|
preConfigure = self.fetchElmDeps {
|
|
|
|
elmPackages = (import ./packages/elm-srcs.nix);
|
2019-10-21 14:31:02 +00:00
|
|
|
elmVersion = drv.version;
|
|
|
|
registryDat = ./registry.dat;
|
2018-11-18 20:07:31 +00:00
|
|
|
};
|
2018-08-25 11:01:52 +00:00
|
|
|
buildTools = drv.buildTools or [] ++ [ makeWrapper ];
|
2019-01-04 13:03:24 +00:00
|
|
|
jailbreak = true;
|
2018-08-25 11:01:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/elm \
|
|
|
|
--prefix PATH ':' ${lib.makeBinPath [ nodejs ]}
|
|
|
|
'';
|
2021-01-16 17:46:39 +00:00
|
|
|
|
|
|
|
description = "A delightful language for reliable webapps";
|
|
|
|
homepage = "https://elm-lang.org/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ domenkozar turbomack ];
|
2018-08-25 10:52:48 +00:00
|
|
|
});
|
|
|
|
|
2016-05-29 21:34:23 +00:00
|
|
|
/*
|
2018-10-03 18:41:58 +00:00
|
|
|
The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo:
|
2019-06-09 14:25:00 +00:00
|
|
|
`package/nix/build.sh`
|
2016-05-29 21:34:23 +00:00
|
|
|
*/
|
2019-10-21 20:41:29 +00:00
|
|
|
elm-format = justStaticExecutables (overrideCabal (self.callPackage ./packages/elm-format.nix {}) (drv: {
|
|
|
|
jailbreak = true;
|
2021-01-16 17:46:39 +00:00
|
|
|
|
|
|
|
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;
|
2021-02-09 08:21:28 +00:00
|
|
|
maintainers = with maintainers; [ avh4 turbomack ];
|
2019-10-21 20:41:29 +00:00
|
|
|
}));
|
2020-03-16 19:10:34 +00:00
|
|
|
|
2019-10-21 14:31:02 +00:00
|
|
|
elmi-to-json = justStaticExecutables (overrideCabal (self.callPackage ./packages/elmi-to-json.nix {}) (drv: {
|
2019-10-21 20:41:29 +00:00
|
|
|
prePatch = ''
|
2019-10-21 14:31:02 +00:00
|
|
|
substituteInPlace package.yaml --replace "- -Werror" ""
|
|
|
|
hpack
|
|
|
|
'';
|
|
|
|
jailbreak = true;
|
2021-01-16 17:46:39 +00:00
|
|
|
|
|
|
|
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 ];
|
2019-10-21 14:31:02 +00:00
|
|
|
}));
|
2019-06-09 14:25:00 +00:00
|
|
|
|
2020-03-16 19:10:34 +00:00
|
|
|
elm-instrument = justStaticExecutables (overrideCabal (self.callPackage ./packages/elm-instrument.nix {}) (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;
|
2021-01-16 17:46:39 +00:00
|
|
|
|
|
|
|
description = "Instrument Elm code as a preprocessing step for elm-coverage";
|
|
|
|
homepage = "https://github.com/zwilias/elm-instrument";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.turbomack ];
|
2020-03-16 19:10:34 +00:00
|
|
|
}));
|
|
|
|
|
2018-11-18 20:07:31 +00:00
|
|
|
inherit fetchElmDeps;
|
2019-01-04 13:03:24 +00:00
|
|
|
elmVersion = elmPkgs.elm.version;
|
2015-08-13 11:50:59 +00:00
|
|
|
};
|
|
|
|
in elmPkgs // {
|
|
|
|
inherit elmPkgs;
|
2018-08-25 10:52:48 +00:00
|
|
|
|
|
|
|
# Needed for elm-format
|
|
|
|
indents = self.callPackage ./packages/indents.nix {};
|
2021-02-09 03:48:09 +00:00
|
|
|
bimap = self.callPackage ./packages/bimap.nix {};
|
2021-03-23 10:41:04 +00:00
|
|
|
avh4-lib = doJailbreak (self.callPackage ./packages/avh4-lib.nix {});
|
|
|
|
elm-format-lib = doJailbreak (self.callPackage ./packages/elm-format-lib.nix {});
|
2021-02-09 03:48:09 +00:00
|
|
|
elm-format-test-lib = self.callPackage ./packages/elm-format-test-lib.nix {};
|
|
|
|
elm-format-markdown = self.callPackage ./packages/elm-format-markdown.nix {};
|
2015-08-13 11:50:59 +00:00
|
|
|
};
|
|
|
|
};
|
2019-09-29 10:57:55 +00:00
|
|
|
|
2020-04-15 19:29:52 +00:00
|
|
|
/* 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`.
|
2019-09-29 10:57:55 +00:00
|
|
|
*/
|
2020-04-15 19:29:52 +00:00
|
|
|
elmLib = import ./packages/lib.nix {
|
|
|
|
inherit lib writeScriptBin stdenv;
|
|
|
|
inherit (hsPkgs.elmPkgs) elm;
|
|
|
|
};
|
|
|
|
|
2021-01-16 17:46:39 +00:00
|
|
|
elmRustPackages = {
|
2020-11-29 15:23:10 +00:00
|
|
|
elm-json = import ./packages/elm-json.nix {
|
2021-05-06 09:21:40 +00:00
|
|
|
inherit curl lib rustPlatform fetchurl openssl stdenv pkg-config Security;
|
2021-01-16 17:46:39 +00:00
|
|
|
} // {
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Install, upgrade and uninstall Elm dependencies";
|
|
|
|
homepage = "https://github.com/zwilias/elm-json";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.turbomack ];
|
|
|
|
};
|
2020-11-29 15:23:10 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-15 19:29:52 +00:00
|
|
|
elmNodePackages = with elmLib;
|
2019-09-29 10:57:55 +00:00
|
|
|
let
|
|
|
|
nodePkgs = import ./packages/node-composition.nix {
|
|
|
|
inherit nodejs pkgs;
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
};
|
2020-03-18 19:36:36 +00:00
|
|
|
in with hsPkgs.elmPkgs; {
|
2020-04-15 19:29:52 +00:00
|
|
|
|
2021-02-06 15:51:21 +00:00
|
|
|
elm-test =
|
2021-01-16 17:46:39 +00:00
|
|
|
nodePkgs.elm-test // {
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-01-16 17:46:39 +00:00
|
|
|
description = "Runs elm-test suites from Node.js";
|
|
|
|
homepage = "https://github.com/rtfeldman/node-test-runner";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.turbomack ];
|
|
|
|
};
|
|
|
|
};
|
2020-04-15 19:29:52 +00:00
|
|
|
|
|
|
|
elm-verify-examples = patchBinwrap [elmi-to-json]
|
2021-01-16 17:46:39 +00:00
|
|
|
nodePkgs.elm-verify-examples // {
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-01-16 17:46:39 +00:00
|
|
|
description = "Verify examples in your docs";
|
|
|
|
homepage = "https://github.com/stoeffel/elm-verify-examples";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.turbomack ];
|
|
|
|
};
|
|
|
|
};
|
2020-04-15 19:29:52 +00:00
|
|
|
|
2020-03-17 12:56:14 +00:00
|
|
|
elm-coverage =
|
2020-04-15 19:29:52 +00:00
|
|
|
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
|
2020-03-17 12:56:14 +00:00
|
|
|
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
|
2020-04-15 19:29:52 +00:00
|
|
|
# TODO: investigate
|
2020-03-17 12:56:14 +00:00
|
|
|
sed 's/\"install\".*/\"install\":\"echo no-op\",/g' --in-place node_modules/elmi-to-json/package.json
|
|
|
|
'';
|
2020-04-15 19:29:52 +00:00
|
|
|
postInstall = (old.postInstall or "") + ''
|
2020-03-17 12:56:14 +00:00
|
|
|
mkdir -p unpacked_bin
|
|
|
|
ln -sf ${elm-instrument}/bin/elm-instrument unpacked_bin/elm-instrument
|
|
|
|
'';
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-01-16 17:46:39 +00:00
|
|
|
description = "Work in progress - Code coverage tooling for Elm";
|
|
|
|
homepage = "https://github.com/zwilias/elm-coverage";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.turbomack ];
|
|
|
|
};
|
2020-04-15 19:29:52 +00:00
|
|
|
});
|
2020-04-04 20:21:46 +00:00
|
|
|
|
2021-02-06 15:51:21 +00:00
|
|
|
create-elm-app = patchNpmElm
|
|
|
|
nodePkgs.create-elm-app // {
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-01-16 17:46:39 +00:00
|
|
|
description = "Create Elm apps with no build configuration";
|
|
|
|
homepage = "https://github.com/halfzebra/create-elm-app";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.turbomack ];
|
|
|
|
};
|
|
|
|
};
|
2020-04-04 20:21:46 +00:00
|
|
|
|
2021-02-06 15:51:21 +00:00
|
|
|
elm-review =
|
2021-01-16 17:46:39 +00:00
|
|
|
nodePkgs.elm-review // {
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-01-16 17:46:39 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
};
|
2020-11-29 15:23:10 +00:00
|
|
|
|
2021-01-16 17:46:39 +00:00
|
|
|
elm-language-server = nodePkgs."@elm-tooling/elm-language-server" // {
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-01-16 17:46:39 +00:00
|
|
|
description = "Language server implementation for Elm";
|
|
|
|
homepage = "https://github.com/elm-tooling/elm-language-server";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.turbomack ];
|
|
|
|
};
|
|
|
|
};
|
2019-09-29 10:57:55 +00:00
|
|
|
|
2021-01-16 17:46:39 +00:00
|
|
|
elm-optimize-level-2 = nodePkgs."elm-optimize-level-2" // {
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-01-16 17:46:39 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
};
|
2020-08-29 09:59:03 +00:00
|
|
|
|
2019-10-22 17:03:58 +00:00
|
|
|
inherit (nodePkgs) elm-doc-preview elm-live elm-upgrade elm-xref elm-analyse;
|
2019-09-29 10:57:55 +00:00
|
|
|
};
|
|
|
|
|
2020-11-29 15:23:10 +00:00
|
|
|
in hsPkgs.elmPkgs // elmNodePackages // elmRustPackages // {
|
2020-04-15 19:29:52 +00:00
|
|
|
lib = elmLib;
|
2019-09-29 10:57:55 +00:00
|
|
|
}
|