Refactor and fix fdm build. Moved makeFlags definition because non-builderDefs packages cannot use $out in direct variable definitions like makeFlags.

This commit is contained in:
Michael Raskin 2014-11-07 12:05:07 +03:00
parent 647f58bfaf
commit 3e118edf3a

View File

@ -1,54 +1,45 @@
x@{builderDefsPackage { stdenv, fetchurl
, openssl, tdb, zlib, flex, bison , openssl, tdb, zlib, flex, bison
, ...}: }:
builderDefsPackage
(a :
let let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ buildInputs = [ openssl tdb zlib flex bison ];
[];
buildInputs = map (n: builtins.getAttr n x)
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
sourceInfo = rec { sourceInfo = rec {
baseName="fdm"; baseName="fdm";
version = "1.7"; version = "1.7";
name="${baseName}-${version}"; name="${baseName}-${version}";
url="mirror://sourceforge/${baseName}/${baseName}/${name}.tar.gz"; url="mirror://sourceforge/${baseName}/${baseName}/${name}.tar.gz";
hash="0apg1jasn4m5j3vh0v9lr2l3lyzy35av1ylxr0wf8k0j9w4p8i28"; sha256 = "0apg1jasn4m5j3vh0v9lr2l3lyzy35av1ylxr0wf8k0j9w4p8i28";
}; };
in in
rec { stdenv.mkDerivation {
src = a.fetchurl { src = fetchurl {
url = sourceInfo.url; inherit (sourceInfo) url sha256;
sha256 = sourceInfo.hash;
}; };
inherit (sourceInfo) name version; inherit (sourceInfo) name version;
inherit buildInputs; inherit buildInputs;
phaseNames = ["doConfigure" "fixInstall" "doMakeInstall"]; preBuild = ''
makeFlags = ["PREFIX=$out"]; export makeFlags="$makeFlags PREFIX=$out"
fixInstall = a.fullDepEntry ('' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Dbool=int"
sed -i */Makefile -i Makefile -e 's@ -g bin @ @' sed -i */Makefile -i Makefile -e 's@ -g bin @ @'
sed -i */Makefile -i Makefile -e 's@ -o root @ @' sed -i */Makefile -i Makefile -e 's@ -o root @ @'
sed -i GNUmakefile -e 's@ -g $(BIN_OWNER) @ @' sed -i GNUmakefile -e 's@ -g $(BIN_OWNER) @ @'
sed -i GNUmakefile -e 's@ -o $(BIN_GROUP) @ @' sed -i GNUmakefile -e 's@ -o $(BIN_GROUP) @ @'
sed -i */Makefile -i Makefile -i GNUmakefile -e 's@-I-@@g' sed -i */Makefile -i Makefile -i GNUmakefile -e 's@-I-@@g'
'') ["minInit" "doUnpack"]; '';
meta = { meta = {
description = "Mail fetching and delivery tool - should do the job of getmail and procmail"; description = "Mail fetching and delivery tool - should do the job of getmail and procmail";
maintainers = with a.lib.maintainers; maintainers = with stdenv.lib.maintainers;
[ [
raskin raskin
]; ];
platforms = with a.lib.platforms; platforms = with stdenv.lib.platforms;
linux; linux;
homepage = "http://fdm.sourceforge.net/";
inherit (sourceInfo) version;
updateWalker = true;
}; };
passthru = { }
updateInfo = {
downloadPage = "http://fdm.sourceforge.net/";
};
};
}) x