2021-01-23 18:15:07 +01:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2015-12-13 23:12:08 +01:00
|
|
|
|
|
|
|
{ pkg, version, sha256
|
|
|
|
, meta ? {}
|
|
|
|
}:
|
|
|
|
|
2021-01-23 18:15:07 +01:00
|
|
|
with lib;
|
2015-12-13 23:12:08 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
name = "hex-source-${pkg}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2016-06-15 16:14:59 +02:00
|
|
|
url = "https://repo.hex.pm/tarballs/${pkg}-${version}.tar";
|
2015-12-13 23:12:08 +01: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;
|
|
|
|
})
|