mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-11 15:08:33 +01:00
Add "compilePorts" enabling rebar3 "pc" plugin
If compilePorts is enabled plugin "pc" is added to the rebar.config during postPatch. This makes rebar3 compile download the plugin, hence added TODO.
This commit is contained in:
parent
2251a942fc
commit
406b974420
|
@ -4,6 +4,7 @@
|
|||
, hexPkg ? name
|
||||
, buildInputs ? [], erlangDeps ? []
|
||||
, postPatch ? ""
|
||||
, compilePorts ? false
|
||||
, ... }@attrs:
|
||||
|
||||
with stdenv.lib;
|
||||
|
@ -18,6 +19,16 @@ stdenv.mkDerivation (attrs // {
|
|||
if [ -e "src/${name}.app.src" ]; then
|
||||
sed -i -e 's/{ *vsn *,[^}]*}/{vsn, "${version}"}/' "src/${name}.app.src"
|
||||
fi
|
||||
|
||||
# TODO: figure out how to provide 'pc' plugin hermetically
|
||||
${if compilePorts then ''
|
||||
echo "{plugins, [pc]}.
|
||||
{provider_hooks,
|
||||
[{post,
|
||||
[{compile, {pc, compile}},
|
||||
{clean, {pc, clean}}]}]}." >> rebar.config
|
||||
'' else ''''}
|
||||
|
||||
${postPatch}
|
||||
'';
|
||||
|
||||
|
@ -43,6 +54,8 @@ stdenv.mkDerivation (attrs // {
|
|||
runHook postConfigure
|
||||
'';
|
||||
|
||||
# TODO: figure out how to provide rebar3 a static registry snapshot to make
|
||||
# this hermetic
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
HOME=. rebar3 update
|
||||
|
|
|
@ -7,6 +7,7 @@ let
|
|||
buildErlang = callPackage ./build-erlang.nix {};
|
||||
buildHex = callPackage ./build-hex.nix {};
|
||||
|
||||
esqlite = callPackage ./hex/esqlite.nix {};
|
||||
goldrush = callPackage ./hex/goldrush.nix {};
|
||||
ibrowse = callPackage ./hex/ibrowse.nix {};
|
||||
jiffy = callPackage ./hex/jiffy.nix {};
|
||||
|
|
8
pkgs/development/erlang-modules/hex/esqlite.nix
Normal file
8
pkgs/development/erlang-modules/hex/esqlite.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ buildHex }:
|
||||
|
||||
buildHex {
|
||||
name = "esqlite";
|
||||
version = "0.2.1";
|
||||
sha256 = "1296fn1lz4lz4zqzn4dwc3flgkh0i6n4sydg501faabfbv8d3wkr";
|
||||
compilePorts = true;
|
||||
}
|
Loading…
Reference in a new issue