2019-05-04 18:28:51 +02:00
|
|
|
{ stdenv, fetchFromGitHub,
|
2019-01-16 22:51:19 +01:00
|
|
|
fetchHex, erlang,
|
2018-07-21 02:44:44 +02:00
|
|
|
tree, hexRegistrySnapshot }:
|
2015-12-06 20:36:05 +01:00
|
|
|
|
|
|
|
let
|
2019-09-29 03:26:32 +02:00
|
|
|
version = "3.12.0";
|
2016-01-10 23:48:44 +01:00
|
|
|
|
2016-04-15 20:06:57 +02:00
|
|
|
bootstrapper = ./rebar3-nix-bootstrap;
|
|
|
|
|
2017-09-10 23:26:00 +02:00
|
|
|
erlware_commons = fetchHex {
|
|
|
|
pkg = "erlware_commons";
|
2019-01-16 22:51:19 +01:00
|
|
|
version = "1.3.1";
|
|
|
|
sha256 = "7aada93f368d0a0430122e39931b7fb4ac9e94dbf043cdc980ad4330fd9cd166";
|
2017-09-10 23:26:00 +02:00
|
|
|
};
|
|
|
|
ssl_verify_fun = fetchHex {
|
|
|
|
pkg = "ssl_verify_fun";
|
2018-07-12 21:48:43 +02:00
|
|
|
version = "1.1.3";
|
2019-01-16 22:51:19 +01:00
|
|
|
sha256 = "2e120e6505d6e9ededb2836611dfe2f7028432dc280957998e154307b5ea92fe";
|
2017-09-10 23:26:00 +02:00
|
|
|
};
|
|
|
|
certifi = fetchHex {
|
|
|
|
pkg = "certifi";
|
2019-01-16 22:51:19 +01:00
|
|
|
version = "2.3.1";
|
|
|
|
sha256 = "e12d667d042c11d130594bae2b0097e63836fe8b1e6d6b2cc48f8bb7a2cf7d68";
|
2017-09-10 23:26:00 +02:00
|
|
|
};
|
|
|
|
providers = fetchHex {
|
|
|
|
pkg = "providers";
|
2018-07-12 21:48:43 +02:00
|
|
|
version = "1.7.0";
|
2019-01-16 22:51:19 +01:00
|
|
|
sha256 = "8be66129ca85c2fa74efd8737cdaedd31c1c1af51dd2fd601495a6def4cae4a6";
|
2017-09-10 23:26:00 +02:00
|
|
|
};
|
|
|
|
getopt = fetchHex {
|
|
|
|
pkg = "getopt";
|
2018-07-12 21:48:43 +02:00
|
|
|
version = "1.0.1";
|
2019-01-16 22:51:19 +01:00
|
|
|
sha256 = "53e1ab83b9ceb65c9672d3e7a35b8092e9bdc9b3ee80721471a161c10c59959c";
|
2017-09-10 23:26:00 +02:00
|
|
|
};
|
2016-11-23 22:06:15 +01:00
|
|
|
bbmustache = fetchHex {
|
|
|
|
pkg = "bbmustache";
|
2019-01-16 22:51:19 +01:00
|
|
|
version = "1.6.0";
|
|
|
|
sha256 = "53e02d296512a57be03a98c91541b34d2ca64930268030b2d12364a0332015df";
|
2015-12-15 00:03:05 +01:00
|
|
|
};
|
2017-09-10 23:26:00 +02:00
|
|
|
relx = fetchHex {
|
|
|
|
pkg = "relx";
|
2019-01-16 22:51:19 +01:00
|
|
|
version = "3.28.0";
|
|
|
|
sha256 = "8afb871c0a2a27f0063d973903fc64d2207bc705ecc3607462920683d24ac7b5";
|
2015-12-15 00:03:05 +01:00
|
|
|
};
|
|
|
|
cf = fetchHex {
|
|
|
|
pkg = "cf";
|
2017-09-10 23:26:00 +02:00
|
|
|
version = "0.2.2";
|
|
|
|
sha256 = "08cvy7skn5d2k4manlx5k3anqgjdvajjhc5jwxbaszxw34q3na28";
|
2015-12-15 00:03:05 +01:00
|
|
|
};
|
|
|
|
cth_readable = fetchHex {
|
|
|
|
pkg = "cth_readable";
|
2019-01-16 22:51:19 +01:00
|
|
|
version = "1.4.3";
|
|
|
|
sha256 = "0wr0hba6ka74s3628jrrd7ynjdh7syxigkh7ildg8fgi20ab88fd";
|
2015-12-15 00:03:05 +01:00
|
|
|
};
|
|
|
|
eunit_formatters = fetchHex {
|
|
|
|
pkg = "eunit_formatters";
|
2018-07-12 21:48:43 +02:00
|
|
|
version = "0.5.0";
|
|
|
|
sha256 = "1jb3hzb216r29x2h4pcjwfmx1k81431rgh5v0mp4x5146hhvmj6n";
|
2015-12-15 00:03:05 +01:00
|
|
|
};
|
2019-01-16 22:51:19 +01:00
|
|
|
hex_core = fetchHex {
|
|
|
|
pkg = "hex_core";
|
|
|
|
version = "0.4.0";
|
|
|
|
sha256 = "8ace8c6cfa10df4cb8be876f42f7446890e124203c094cc7b4e7616fb8de5d7f";
|
|
|
|
};
|
|
|
|
parse_trans = fetchHex {
|
|
|
|
pkg = "parse_trans";
|
|
|
|
version = "3.3.0";
|
2019-05-04 18:28:51 +02:00
|
|
|
sha256 = "0q5r871bzx1a8fa06yyxdi3xkkp7v5yqazzah03d6yl3vsmn7vqp";
|
2016-01-16 22:47:21 +01:00
|
|
|
};
|
2015-12-15 00:03:05 +01:00
|
|
|
|
2015-12-06 20:36:05 +01:00
|
|
|
in
|
2019-05-04 18:28:51 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rebar3";
|
2019-01-16 22:51:19 +01:00
|
|
|
inherit version erlang;
|
2015-12-06 20:36:05 +01:00
|
|
|
|
2019-05-04 18:28:51 +02:00
|
|
|
src = fetchFromGitHub {
|
2019-06-03 19:53:30 +02:00
|
|
|
owner = "erlang";
|
2019-05-04 18:28:51 +02:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2019-09-29 03:26:32 +02:00
|
|
|
sha256 = "0936ix7lfwsamssap58b265zid7x2m97azrr2qpjcln3xysd16lg";
|
2015-12-06 20:36:05 +01:00
|
|
|
};
|
|
|
|
|
2016-04-15 20:06:57 +02:00
|
|
|
inherit bootstrapper;
|
|
|
|
|
2019-01-16 22:51:19 +01:00
|
|
|
buildInputs = [ erlang tree ];
|
2015-12-13 14:07:53 +01:00
|
|
|
|
2019-01-16 22:51:19 +01:00
|
|
|
# TODO: Remove registry snapshot
|
2016-04-15 20:06:57 +02:00
|
|
|
propagatedBuildInputs = [ hexRegistrySnapshot ];
|
2015-12-13 14:06:35 +01:00
|
|
|
|
2015-12-15 00:03:05 +01:00
|
|
|
postPatch = ''
|
2016-04-15 20:06:57 +02:00
|
|
|
${erlang}/bin/escript ${bootstrapper} registry-only
|
2019-01-16 22:51:19 +01:00
|
|
|
mkdir -p _checkouts
|
2015-12-15 00:03:05 +01:00
|
|
|
mkdir -p _build/default/lib/
|
2019-01-16 22:51:19 +01:00
|
|
|
|
|
|
|
cp --no-preserve=mode -R ${erlware_commons} _checkouts/erlware_commons
|
|
|
|
cp --no-preserve=mode -R ${providers} _checkouts/providers
|
|
|
|
cp --no-preserve=mode -R ${getopt} _checkouts/getopt
|
|
|
|
cp --no-preserve=mode -R ${bbmustache} _checkouts/bbmustache
|
|
|
|
cp --no-preserve=mode -R ${certifi} _checkouts/certifi
|
|
|
|
cp --no-preserve=mode -R ${cf} _checkouts/cf
|
|
|
|
cp --no-preserve=mode -R ${cth_readable} _checkouts/cth_readable
|
|
|
|
cp --no-preserve=mode -R ${eunit_formatters} _checkouts/eunit_formatters
|
|
|
|
cp --no-preserve=mode -R ${relx} _checkouts/relx
|
|
|
|
cp --no-preserve=mode -R ${ssl_verify_fun} _checkouts/ssl_verify_fun
|
|
|
|
cp --no-preserve=mode -R ${hex_core} _checkouts/hex_core
|
|
|
|
cp --no-preserve=mode -R ${parse_trans} _checkouts/parse_trans
|
|
|
|
|
|
|
|
# Bootstrap script expects the dependencies in _build/default/lib
|
|
|
|
# TODO: Make it accept checkouts?
|
|
|
|
for i in _checkouts/* ; do
|
|
|
|
ln -s $(pwd)/$i $(pwd)/_build/default/lib/
|
|
|
|
done
|
2015-12-15 00:03:05 +01:00
|
|
|
'';
|
2015-12-06 20:36:05 +01:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
HOME=. escript bootstrap
|
|
|
|
'';
|
2019-01-16 22:51:19 +01:00
|
|
|
|
2015-12-06 20:36:05 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp rebar3 $out/bin/rebar3
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = https://github.com/rebar/rebar3;
|
2019-05-04 18:28:51 +02:00
|
|
|
description = "Erlang build tool that makes it easy to compile and test Erlang applications, port drivers and releases";
|
2015-12-06 20:36:05 +01:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
rebar is a self-contained Erlang script, so it's easy to distribute or
|
|
|
|
even embed directly in a project. Where possible, rebar uses standard
|
|
|
|
Erlang/OTP conventions for project structures, thus minimizing the amount
|
|
|
|
of build configuration work. rebar also provides dependency management,
|
|
|
|
enabling application writers to easily re-use common libraries from a
|
|
|
|
variety of locations (hex.pm, git, hg, and so on).
|
|
|
|
'';
|
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2018-07-12 21:48:43 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ gleber tazjin ];
|
2018-08-06 12:24:38 +02:00
|
|
|
license = stdenv.lib.licenses.asl20;
|
2015-12-06 20:36:05 +01:00
|
|
|
};
|
|
|
|
}
|