tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
xtreemfs: repackage and update
Matej Cotman
10 years ago
346c7445
f46fe7b9
+52
-67
1 changed file
expand all
collapse all
unified
split
pkgs
tools
filesystems
xtreemfs
default.nix
+52
-67
pkgs/tools/filesystems/xtreemfs/default.nix
···
1
1
-
x@{builderDefsPackage
2
2
-
, boost, fuse, openssl, cmake, attr, jdk, ant, which, python, file
3
3
-
, ...}:
4
4
-
builderDefsPackage
5
5
-
(a :
6
6
-
let
7
7
-
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
8
8
-
[];
1
1
+
{ stdenv, boost, fuse, openssl, cmake, attr, jdk, ant, which, file, python
2
2
+
, fetchurl, lib, valgrind, makeWrapper, fetchFromGitHub }:
9
3
10
10
-
buildInputs = map (n: builtins.getAttr n x)
11
11
-
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
12
12
-
sourceInfo = rec {
13
13
-
baseName="XtreemFS";
14
14
-
version="1.4";
15
15
-
name="${baseName}-${version}";
16
16
-
url="http://xtreemfs.googlecode.com/files/${name}.tar.gz";
17
17
-
hash="1hzd6anplxdcl4cg6xwriqk9b34541r7ah1ab2xavv149a2ll25s";
18
18
-
};
19
19
-
in
20
20
-
rec {
21
21
-
src = a.fetchurl {
22
22
-
url = sourceInfo.url;
23
23
-
sha256 = sourceInfo.hash;
4
4
+
stdenv.mkDerivation rec {
5
5
+
src = fetchFromGitHub {
6
6
+
# using unstable release because stable (v1.5.1) has broken repl java plugin
7
7
+
rev = "7ddcb081aa125b0cfb008dc98addd260b8353ab3";
8
8
+
owner = "xtreemfs";
9
9
+
repo = "xtreemfs";
10
10
+
sha256 = "1hjmd32pla27zf98ghzz6r5ml8ry86m9dsryv1z01kxv5l95b3m0";
24
11
};
25
12
26
26
-
inherit (sourceInfo) name version;
27
27
-
inherit buildInputs;
13
13
+
name = "XtreemFS-${version}";
14
14
+
version = "1.5.1.81";
15
15
+
16
16
+
buildInputs = [ which attr makeWrapper python ];
17
17
+
18
18
+
preConfigure = ''
19
19
+
export JAVA_HOME=${jdk}
20
20
+
export ANT_HOME=${ant}
21
21
+
22
22
+
export BOOST_INCLUDEDIR=${boost.dev}/include
23
23
+
export BOOST_LIBRARYDIR=${boost.lib}/lib
24
24
+
export OPENSSL_ROOT_DIR=${openssl}
25
25
+
26
26
+
substituteInPlace cpp/cmake/FindValgrind.cmake \
27
27
+
--replace "/usr/local" "${valgrind}"
28
28
+
29
29
+
substituteInPlace cpp/CMakeLists.txt \
30
30
+
--replace '"/lib64" "/usr/lib64"' '"${attr}/lib" "${fuse}/lib"'
31
31
+
32
32
+
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${fuse}/include"
33
33
+
export NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L${fuse}/lib"
34
34
+
35
35
+
export DESTDIR=$out
36
36
+
37
37
+
substituteInPlace Makefile \
38
38
+
--replace "/usr/share/" "/share/" \
39
39
+
--replace 'BIN_DIR=$(DESTDIR)/usr/bin' "BIN_DIR=$out/bin"
28
40
29
29
-
/* doConfigure should be removed if not needed */
30
30
-
phaseNames = ["setVars" "fixMakefile" "doMakeInstall" "fixInterpreterBin"
31
31
-
"fixInterpreterEtc"
32
32
-
"usrIsOut"];
41
41
+
substituteInPlace etc/init.d/generate_initd_scripts.sh \
42
42
+
--replace "/bin/bash" "${stdenv.shell}"
33
43
34
34
-
setVars = a.noDepEntry ''
35
35
-
export JAVA_HOME="${jdk}"
36
36
-
export ANT_HOME="${ant}"
37
37
-
export CMAKE_HOME=${cmake}
44
44
+
# do not put cmake into buildInputs
45
45
+
export PATH="$PATH:${cmake}/bin"
38
46
'';
39
47
40
40
-
fixMakefile = a.fullDepEntry ''
41
41
-
sed -e 's@DESTDIR)/usr@DESTDIR)@g' -i Makefile
48
48
+
preBuild = ''
49
49
+
substituteInPlace configure \
50
50
+
--replace "/usr/bin/file" "${file}/bin/file"
51
51
+
'';
42
52
43
43
-
sed -e 's@/usr/bin/@@g' -i cpp/thirdparty/protobuf-*/configure
44
44
-
sed -e 's@/usr/bin/@@g' -i cpp/thirdparty/protobuf-*/gtest/configure
45
45
-
sed -e 's@/usr/bin/@@g' -i cpp/thirdparty/gtest-*/configure
46
46
-
'' ["doUnpack" "minInit"];
53
53
+
doCheck = false;
47
54
48
48
-
fixInterpreterBin = a.doPatchShebangs "$out/bin";
49
49
-
fixInterpreterEtc = a.doPatchShebangs "$out/etc/xos/xtreemfs";
55
55
+
postInstall = ''
56
56
+
rm -r $out/sbin
57
57
+
'';
50
58
51
51
-
usrIsOut = a.fullDepEntry ''
52
52
-
sed -e "s@/usr/@$out/@g" -i \
53
53
-
"$out"/{bin/xtfs_*,etc/xos/xtreemfs/*.*,etc/xos/xtreemfs/*/*,etc/init.d/*}
54
54
-
sed -e "s@JAVA_HOME=/usr@JAVA_HOME=${jdk}@g" -i \
55
55
-
"$out"/{bin/xtfs_*,etc/init.d/*}
56
56
-
'' ["minInit"];
57
57
-
58
58
-
makeFlags = [
59
59
-
''DESTDIR="$out"''
60
60
-
''SHELL="${a.stdenv.shell}"''
61
61
-
];
62
62
-
63
59
meta = {
64
60
description = "A distributed filesystem";
65
65
-
maintainers = with a.lib.maintainers;
66
66
-
[
67
67
-
raskin
68
68
-
];
69
69
-
platforms = with a.lib.platforms;
70
70
-
linux;
71
71
-
license = a.lib.licenses.bsd3;
72
72
-
broken = true;
61
61
+
maintainers = with lib.maintainers; [ raskin matejc ];
62
62
+
platforms = lib.platforms.linux;
63
63
+
license = lib.licenses.bsd3;
73
64
};
74
74
-
passthru = {
75
75
-
updateInfo = {
76
76
-
downloadPage = "http://xtreemfs.org/download_sources.php";
77
77
-
};
78
78
-
};
79
79
-
}) x
80
80
-
65
65
+
}