This repository has been archived by the owner on Jun 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.nix
68 lines (52 loc) · 1.67 KB
/
build.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{ pkgs, rocksdb-src, src, version }:
with pkgs;
let
lz4 = pkgs.lz4.override { enableStatic = true; };
self = stdenv.mkDerivation rec {
inherit src version;
pname = "foundationdb";
nativeBuildInputs = [
pkg-config
bash
cmake
ninja
openjdk
python3
mono4
];
buildInputs = [ boost172 makeWrapper bzip2 lz4 snappy zlib zstd jemalloc ];
separateDebugInfo = true;
enableParallelBuilding = true;
dontFixCmake = true;
cmakeFlags =
[
"-DCMAKE_BUILD_TYPE=Release"
"-DFDB_RELEASE=TRUE"
"-DRocksDB_ROOT=${rocksdb-src}"
"-DDISABLE_TLS=off"
"-DUSE_LD=GOLD"
];
prePatch = ''
substituteInPlace build/get_version.sh --replace "/usr/bin/env bash" "${bash}/bin/bash"
substituteInPlace build/get_package_name.sh --replace "/usr/bin/env bash" "${bash}/bin/bash"
sed -e 's;PORTABLE_ROCKSDB 1;PORTABLE_ROCKSDB 0;g' -i fdbserver/CMakeLists.txt
'';
postInstall = ''
mkdir -p $dev $lib $bin/libexec
mv $out/bin $bin/
mv $out/usr/lib/foundationdb/*.py $bin/libexec/
ln -s $bin/bin/fdbbackup $bin/libexec/backup_agent
mv $out/sbin/* $bin/bin/
# java bindings
mkdir -p $lib/share/java
mv ./packages/fdb-java-${version}.jar $lib/share/java/fdb-java.jar
rm -rf $out/lib/systemd $out/usr $out/bin $out/sbin $out/var $out/log $out/etc $out/lib/foundationdb $out/lib/cmake $out/lib/pkgconfig
# move results into multi outputs
mv $out/include $dev/
mv $out/lib $lib/
'';
outputs = [ "bin" "out" "dev" "lib" ];
passthru.jar = "${self.lib}/share/java/fdb-java.jar";
};
in
self