2015-12-14 01:12:08 +03:00
|
|
|
{ stdenv, fetchurl }:
|
|
|
|
|
|
|
|
{ pkg, version, sha256
|
|
|
|
, meta ? {}
|
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
name = "hex-source-${pkg}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2016-06-15 17:14:59 +03:00
|
|
|
url = "https://repo.hex.pm/tarballs/${pkg}-${version}.tar";
|
2015-12-14 01:12:08 +03:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
|
|
|
|
|
|
unpackCmd = ''
|
|
|
|
tar -xf $curSrc contents.tar.gz
|
|
|
|
mkdir contents
|
|
|
|
tar -C contents -xzf contents.tar.gz
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir "$out"
|
|
|
|
cp -Hrt "$out" .
|
|
|
|
success=1
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit meta;
|
|
|
|
})
|