depot/third_party/nixpkgs/pkgs/development/beam-modules/fetch-hex.nix
Default email b6f2ab0a42 Project import generated by Copybara.
GitOrigin-RevId: 253aecf69ed7595aaefabde779aa6449195bebb7
2021-08-18 15:19:15 +02:00

38 lines
593 B
Nix

{ lib, stdenv, fetchurl }:
{ pkg
, version
, sha256
, meta ? { }
}:
with lib;
stdenv.mkDerivation ({
pname = "hex-source-${pkg}";
inherit version;
dontBuild = true;
dontConfigure = true;
dontFixup = true;
src = fetchurl {
url = "https://repo.hex.pm/tarballs/${pkg}-${version}.tar";
inherit sha256;
};
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;
})