2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv, fetchurl, python3, runtimeShell }:
|
2018-12-06 07:10:30 +00:00
|
|
|
|
2017-05-20 23:20:03 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mozlz4a";
|
2018-12-21 11:33:05 +00:00
|
|
|
version = "2018-08-23";
|
2017-05-20 23:20:03 +01:00
|
|
|
# or fetchFromGitHub(owner,repo,rev) or fetchgit(rev)
|
|
|
|
src = fetchurl {
|
2018-12-21 11:33:05 +00:00
|
|
|
url = "https://gist.githubusercontent.com/kaefer3000/73febe1eec898cd50ce4de1af79a332a/raw/a266410033455d6b4af515d7a9d34f5afd35beec/mozlz4a.py";
|
|
|
|
sha256 = "1d1ai062kdms34bya9dlykkx011rj8d8nh5l7d76xj8k9kv4ssq6";
|
2017-05-20 23:20:03 +01:00
|
|
|
};
|
|
|
|
|
2019-06-19 16:45:34 +01:00
|
|
|
dontUnpack = true;
|
2017-05-20 23:20:03 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/bin" "$out/${python3.sitePackages}/"
|
|
|
|
cp "${src}" "$out/${python3.sitePackages}/mozlz4a.py"
|
|
|
|
|
2019-02-26 11:45:54 +00:00
|
|
|
echo "#!${runtimeShell}" >> "$out/bin/mozlz4a"
|
2017-05-20 23:20:03 +01:00
|
|
|
echo "export PYTHONPATH='$PYTHONPATH'" >> "$out/bin/mozlz4a"
|
|
|
|
echo "'${python3}/bin/python' '$out/${python3.sitePackages}/mozlz4a.py' \"\$@\"" >> "$out/bin/mozlz4a"
|
|
|
|
chmod a+x "$out/bin/mozlz4a"
|
|
|
|
'';
|
|
|
|
|
2018-12-06 07:10:30 +00:00
|
|
|
buildInputs = [ python3 python3.pkgs.python-lz4 ];
|
2017-05-20 23:20:03 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
inherit version;
|
|
|
|
description = "A script to handle Mozilla's mozlz4 files";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.bsd2;
|
|
|
|
maintainers = [lib.maintainers.raskin];
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://gist.githubusercontent.com/Tblue/62ff47bef7f894e92ed5";
|
2017-05-20 23:20:03 +01:00
|
|
|
};
|
|
|
|
}
|