xtreemfs: repackage and update
This commit is contained in:
parent
f46fe7b909
commit
346c744530
@ -1,80 +1,65 @@
|
|||||||
x@{builderDefsPackage
|
{ stdenv, boost, fuse, openssl, cmake, attr, jdk, ant, which, file, python
|
||||||
, boost, fuse, openssl, cmake, attr, jdk, ant, which, python, file
|
, fetchurl, lib, valgrind, makeWrapper, fetchFromGitHub }:
|
||||||
, ...}:
|
|
||||||
builderDefsPackage
|
|
||||||
(a :
|
|
||||||
let
|
|
||||||
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
|
|
||||||
[];
|
|
||||||
|
|
||||||
buildInputs = map (n: builtins.getAttr n x)
|
stdenv.mkDerivation rec {
|
||||||
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
|
src = fetchFromGitHub {
|
||||||
sourceInfo = rec {
|
# using unstable release because stable (v1.5.1) has broken repl java plugin
|
||||||
baseName="XtreemFS";
|
rev = "7ddcb081aa125b0cfb008dc98addd260b8353ab3";
|
||||||
version="1.4";
|
owner = "xtreemfs";
|
||||||
name="${baseName}-${version}";
|
repo = "xtreemfs";
|
||||||
url="http://xtreemfs.googlecode.com/files/${name}.tar.gz";
|
sha256 = "1hjmd32pla27zf98ghzz6r5ml8ry86m9dsryv1z01kxv5l95b3m0";
|
||||||
hash="1hzd6anplxdcl4cg6xwriqk9b34541r7ah1ab2xavv149a2ll25s";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
src = a.fetchurl {
|
|
||||||
url = sourceInfo.url;
|
|
||||||
sha256 = sourceInfo.hash;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit (sourceInfo) name version;
|
name = "XtreemFS-${version}";
|
||||||
inherit buildInputs;
|
version = "1.5.1.81";
|
||||||
|
|
||||||
/* doConfigure should be removed if not needed */
|
buildInputs = [ which attr makeWrapper python ];
|
||||||
phaseNames = ["setVars" "fixMakefile" "doMakeInstall" "fixInterpreterBin"
|
|
||||||
"fixInterpreterEtc"
|
|
||||||
"usrIsOut"];
|
|
||||||
|
|
||||||
setVars = a.noDepEntry ''
|
preConfigure = ''
|
||||||
export JAVA_HOME="${jdk}"
|
export JAVA_HOME=${jdk}
|
||||||
export ANT_HOME="${ant}"
|
export ANT_HOME=${ant}
|
||||||
export CMAKE_HOME=${cmake}
|
|
||||||
|
export BOOST_INCLUDEDIR=${boost.dev}/include
|
||||||
|
export BOOST_LIBRARYDIR=${boost.lib}/lib
|
||||||
|
export OPENSSL_ROOT_DIR=${openssl}
|
||||||
|
|
||||||
|
substituteInPlace cpp/cmake/FindValgrind.cmake \
|
||||||
|
--replace "/usr/local" "${valgrind}"
|
||||||
|
|
||||||
|
substituteInPlace cpp/CMakeLists.txt \
|
||||||
|
--replace '"/lib64" "/usr/lib64"' '"${attr}/lib" "${fuse}/lib"'
|
||||||
|
|
||||||
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${fuse}/include"
|
||||||
|
export NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L${fuse}/lib"
|
||||||
|
|
||||||
|
export DESTDIR=$out
|
||||||
|
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace "/usr/share/" "/share/" \
|
||||||
|
--replace 'BIN_DIR=$(DESTDIR)/usr/bin' "BIN_DIR=$out/bin"
|
||||||
|
|
||||||
|
substituteInPlace etc/init.d/generate_initd_scripts.sh \
|
||||||
|
--replace "/bin/bash" "${stdenv.shell}"
|
||||||
|
|
||||||
|
# do not put cmake into buildInputs
|
||||||
|
export PATH="$PATH:${cmake}/bin"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
fixMakefile = a.fullDepEntry ''
|
preBuild = ''
|
||||||
sed -e 's@DESTDIR)/usr@DESTDIR)@g' -i Makefile
|
substituteInPlace configure \
|
||||||
|
--replace "/usr/bin/file" "${file}/bin/file"
|
||||||
|
'';
|
||||||
|
|
||||||
sed -e 's@/usr/bin/@@g' -i cpp/thirdparty/protobuf-*/configure
|
doCheck = false;
|
||||||
sed -e 's@/usr/bin/@@g' -i cpp/thirdparty/protobuf-*/gtest/configure
|
|
||||||
sed -e 's@/usr/bin/@@g' -i cpp/thirdparty/gtest-*/configure
|
|
||||||
'' ["doUnpack" "minInit"];
|
|
||||||
|
|
||||||
fixInterpreterBin = a.doPatchShebangs "$out/bin";
|
postInstall = ''
|
||||||
fixInterpreterEtc = a.doPatchShebangs "$out/etc/xos/xtreemfs";
|
rm -r $out/sbin
|
||||||
|
'';
|
||||||
|
|
||||||
usrIsOut = a.fullDepEntry ''
|
|
||||||
sed -e "s@/usr/@$out/@g" -i \
|
|
||||||
"$out"/{bin/xtfs_*,etc/xos/xtreemfs/*.*,etc/xos/xtreemfs/*/*,etc/init.d/*}
|
|
||||||
sed -e "s@JAVA_HOME=/usr@JAVA_HOME=${jdk}@g" -i \
|
|
||||||
"$out"/{bin/xtfs_*,etc/init.d/*}
|
|
||||||
'' ["minInit"];
|
|
||||||
|
|
||||||
makeFlags = [
|
|
||||||
''DESTDIR="$out"''
|
|
||||||
''SHELL="${a.stdenv.shell}"''
|
|
||||||
];
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A distributed filesystem";
|
description = "A distributed filesystem";
|
||||||
maintainers = with a.lib.maintainers;
|
maintainers = with lib.maintainers; [ raskin matejc ];
|
||||||
[
|
platforms = lib.platforms.linux;
|
||||||
raskin
|
license = lib.licenses.bsd3;
|
||||||
];
|
|
||||||
platforms = with a.lib.platforms;
|
|
||||||
linux;
|
|
||||||
license = a.lib.licenses.bsd3;
|
|
||||||
broken = true;
|
|
||||||
};
|
};
|
||||||
passthru = {
|
}
|
||||||
updateInfo = {
|
|
||||||
downloadPage = "http://xtreemfs.org/download_sources.php";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}) x
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user