tptp: replace use of builderDefsPackage

This commit is contained in:
Gabriel Ebner 2016-01-29 10:11:38 +01:00
parent 462958b3b7
commit 73468cf4d4

View File

@ -1,90 +1,48 @@
x@{builderDefsPackage { stdenv, fetchurl, yap, tcsh, perl, patchelf }:
, yap, tcsh, perl, patchelf, pkgsi686Linux
, ...}:
builderDefsPackage
(a :
let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
["pkgsi686Linux"];
buildInputs = map (n: builtins.getAttr n x) stdenv.mkDerivation rec {
(builtins.attrNames (builtins.removeAttrs x helperArgNames)); name = "TPTP-${version}";
sourceInfo = rec { version = "6.3.0";
baseName="TPTP";
version="6.3.0"; src = fetchurl {
name="${baseName}-${version}"; url = [
urls=
[
"http://www.cs.miami.edu/~tptp/TPTP/Distribution/TPTP-v${version}.tgz" "http://www.cs.miami.edu/~tptp/TPTP/Distribution/TPTP-v${version}.tgz"
"http://www.cs.miami.edu/~tptp/TPTP/Archive/TPTP-v${version}/TPTP-v${version}.tgz" "http://www.cs.miami.edu/~tptp/TPTP/Archive/TPTP-v${version}/TPTP-v${version}.tgz"
]; ];
hash="17wl80mnm91jp3npdjzfbb8ds45f2gni250jlfw0d91i1476wcl3"; sha256 = "17wl80mnm91jp3npdjzfbb8ds45f2gni250jlfw0d91i1476wcl3";
};
in
rec {
src = a.fetchurl {
urls = sourceInfo.urls;
sha256 = sourceInfo.hash;
}; };
inherit (sourceInfo) name version; buildInputs = [ tcsh yap perl patchelf ];
inherit buildInputs;
/* doConfigure should be removed if not needed */ installPhase = ''
phaseNames = ["goTarget" "doUnpack" "fixPlace" "setVars" "installScripts" sharedir=$out/share/tptp
"patchBinaries" "makeLinks"];
goTarget = a.fullDepEntry '' mkdir -p $sharedir
mkdir -p "$out"/share/ cp -r ./ $sharedir
cd "$out"/share/
'' ["defEnsureDir" "minInit"];
fixPlace = a.fullDepEntry '' export TPTP=$sharedir
cd ..
mv TPTP-* tptp
cd tptp
'' ["minInit" "doUnpack"];
setVars = a.noDepEntry '' tcsh $sharedir/Scripts/tptp2T_install -default
export TPTP="$PWD"
substituteInPlace $sharedir/TPTP2X/tptp2X_install --replace /bin/mv mv
tcsh $sharedir/TPTP2X/tptp2X_install -default
patchelf --interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $sharedir/Scripts/tptp4X
mkdir -p $out/bin
ln -s $sharedir/TPTP2X/tptp2X $out/bin
ln -s $sharedir/Scripts/tptp2T $out/bin
ln -s $sharedir/Scripts/tptp4X $out/bin
''; '';
installScripts = a.fullDepEntry '' meta = with stdenv.lib; {
tcsh "$out/share/tptp/Scripts/tptp2T_install" -default
sed -e 's@^ */bin/@@' -i TPTP2X/*
tcsh "$out/share/tptp/TPTP2X/tptp2X_install" -default
'' ["addInputs"];
makeLinks = a.fullDepEntry ''
mkdir -p "$out/bin"
ln -s "../share/tptp/TPTP2X/tptp2X" "$out/bin"
ln -s "../share/tptp/Scripts/tptp2T" "$out/bin"
ln -s "../share/tptp/Scripts/tptp4X" "$out/bin"
'' ["defEnsureDir" "minInit"];
patchBinaries = a.fullDepEntry ''
patchelf --set-interpreter "${pkgsi686Linux.glibc}"/lib/ld-linux.so.* \
"Scripts/tptp4X"
'' ["addInputs"];
meta = {
description = "Thousands of problems for theorem provers and tools"; description = "Thousands of problems for theorem provers and tools";
maintainers = with a.lib.maintainers; maintainers = with maintainers; [ raskin gebner ];
[ # 6.3 GiB of data. Installation is unpacking and editing a few files.
raskin
];
# A GiB of data. Installation is unpacking and editing a few files.
# No sense in letting Hydra build it. # No sense in letting Hydra build it.
# Also, it is unclear what is covered by "verbatim" - we will edit configs # Also, it is unclear what is covered by "verbatim" - we will edit configs
hydraPlatforms = []; hydraPlatforms = [];
license = "verbatim-redistribution"; platforms = platforms.all;
license = licenses.unfreeRedistributable;
}; };
passthru = { }
updateInfo = {
downloadPage = "http://tptp.org/";
};
};
}) x