philter: reimplement using mkDerivation
This commit is contained in:
parent
9d7c387d26
commit
931eaa341c
|
@ -1,57 +1,30 @@
|
||||||
x@{builderDefsPackage
|
{ stdenv, fetchurl, python }:
|
||||||
, python, makeWrapper
|
|
||||||
, ...}:
|
|
||||||
builderDefsPackage
|
|
||||||
(a :
|
|
||||||
let
|
|
||||||
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
|
|
||||||
[];
|
|
||||||
|
|
||||||
buildInputs = map (n: builtins.getAttr n x)
|
stdenv.mkDerivation rec {
|
||||||
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
|
name = "philter-${version}";
|
||||||
sourceInfo = rec {
|
version = "1.1";
|
||||||
baseName="philter";
|
src = fetchurl {
|
||||||
version="1.1";
|
url = "mirror://sourceforge/philter/${name}.tar.gz";
|
||||||
name="${baseName}-${version}";
|
sha256 = "177pqfflhdn2mw9lc1wv9ik32ji69rjqr6dw83hfndwlsva5151l";
|
||||||
url="mirror://sourceforge/${baseName}/${name}.tar.gz";
|
|
||||||
hash="177pqfflhdn2mw9lc1wv9ik32ji69rjqr6dw83hfndwlsva5151l";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
src = a.fetchurl {
|
|
||||||
url = sourceInfo.url;
|
|
||||||
sha256 = sourceInfo.hash;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit (sourceInfo) name version;
|
installPhase = ''
|
||||||
inherit buildInputs;
|
mkdir -p "$out"/{bin,share/philter}
|
||||||
|
cp .philterrc "$out"/share/philter/philterrc
|
||||||
|
sed -i 's@/usr/local/bin@${python}/bin@' src/philter.py
|
||||||
|
cp src/philter.py "$out"/bin/philter
|
||||||
|
chmod +x "$out"/bin/philter
|
||||||
|
'';
|
||||||
|
|
||||||
/* doConfigure should be removed if not needed */
|
meta = with stdenv.lib; {
|
||||||
phaseNames = ["installProgram" "patchShebangs" "wrapBinContentsPython"];
|
|
||||||
patchShebangs = (a.doPatchShebangs "$out/bin");
|
|
||||||
|
|
||||||
installProgram = a.fullDepEntry(''
|
|
||||||
mv "$out/share/philter/".*rc "$out/share/philter/philterrc"
|
|
||||||
mkdir -p "$out/bin"
|
|
||||||
cp "$out/share/philter/src/philter.py" "$out/bin/philter"
|
|
||||||
chmod a+x "$out/bin/philter"
|
|
||||||
'') ["addInputs" "copyToShare" "minInit"];
|
|
||||||
|
|
||||||
copyToShare = (a.simplyShare "philter");
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Mail sorter for Maildirs";
|
description = "Mail sorter for Maildirs";
|
||||||
maintainers = with a.lib.maintainers;
|
maintainers = with maintainers; [ raskin ];
|
||||||
[
|
platforms = with platforms; linux;
|
||||||
raskin
|
|
||||||
];
|
|
||||||
platforms = with a.lib.platforms;
|
|
||||||
linux;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
updateInfo = {
|
updateInfo = {
|
||||||
downloadPage = "http://philter.sourceforge.net/";
|
downloadPage = "http://philter.sourceforge.net/";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}) x
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue