2018-07-02 14:08:54 +00:00
|
|
|
{ stdenv, fetchurl, fetchFromGitHub
|
2018-05-01 07:17:46 +00:00
|
|
|
, which, findutils, m4, gawk
|
2018-07-02 14:08:54 +00:00
|
|
|
, python, openjdk, mono58, libressl_2_6
|
|
|
|
, boost16x
|
2018-04-20 11:35:35 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2018-05-01 07:17:46 +00:00
|
|
|
makeFdb =
|
|
|
|
{ version
|
|
|
|
, branch
|
2018-07-02 14:08:54 +00:00
|
|
|
, rev, sha256
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-07-02 14:08:54 +00:00
|
|
|
# fdb 6.0+ support boost 1.6x+, so default to it
|
|
|
|
, boost ? boost16x
|
2018-05-01 07:17:46 +00:00
|
|
|
}: stdenv.mkDerivation rec {
|
|
|
|
name = "foundationdb-${version}";
|
|
|
|
inherit version;
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "apple";
|
|
|
|
repo = "foundationdb";
|
|
|
|
inherit rev sha256;
|
|
|
|
};
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
nativeBuildInputs = [ gawk which m4 findutils mono58 ];
|
2018-07-02 14:08:54 +00:00
|
|
|
buildInputs = [ python openjdk libressl_2_6 boost ];
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
patches =
|
2018-07-02 14:08:54 +00:00
|
|
|
[ ./fix-scm-version.patch
|
|
|
|
./ldflags.patch
|
|
|
|
];
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ./build/scver.mk \
|
|
|
|
--subst-var-by NIXOS_FDB_VERSION_ID "${rev}" \
|
|
|
|
--subst-var-by NIXOS_FDB_SCBRANCH "${branch}"
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
substituteInPlace ./Makefile \
|
|
|
|
--replace 'shell which ccache' 'shell true' \
|
|
|
|
--replace -Werror ""
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
substituteInPlace ./Makefile \
|
|
|
|
--replace libstdc++_pic libstdc++
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
substituteInPlace ./build/link-validate.sh \
|
|
|
|
--replace 'exit 1' '#exit 1'
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
patchShebangs .
|
|
|
|
'';
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
makeFlags = [ "all" "fdb_c" "fdb_java" "KVRELEASE=1" ];
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-07-02 14:08:54 +00:00
|
|
|
configurePhase = ":";
|
2018-05-01 07:17:46 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -vp $out/{bin,libexec/plugins} $lib/{lib,share/java} $dev/include/foundationdb
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
cp -v ./lib/libfdb_c.so $lib/lib
|
|
|
|
cp -v ./lib/libFDBLibTLS.so $out/libexec/plugins/FDBLibTLS.so
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
cp -v ./bindings/c/foundationdb/fdb_c.h $dev/include/foundationdb
|
|
|
|
cp -v ./bindings/c/foundationdb/fdb_c_options.g.h $dev/include/foundationdb
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-05 06:29:39 +00:00
|
|
|
cp -v ./bindings/java/foundationdb-client.jar $lib/share/java/fdb-java.jar
|
2018-05-01 04:35:12 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
for x in fdbbackup fdbcli fdbserver fdbmonitor; do
|
|
|
|
cp -v "./bin/$x" $out/bin;
|
|
|
|
done
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
ln -sfv $out/bin/fdbbackup $out/bin/dr_agent
|
|
|
|
ln -sfv $out/bin/fdbbackup $out/bin/fdbrestore
|
|
|
|
ln -sfv $out/bin/fdbbackup $out/bin/fdbdr
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
ln -sfv $out/bin/fdbbackup $out/libexec/backup_agent
|
|
|
|
'';
|
2018-05-01 04:35:12 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
outputs = [ "out" "lib" "dev" ];
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Open source, distributed, transactional key-value store";
|
|
|
|
homepage = https://www.foundationdb.org;
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
};
|
|
|
|
};
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-07-02 14:08:54 +00:00
|
|
|
# hysterical raisins dictate a version of boost this old. however,
|
|
|
|
# we luckily do not need to build anything, we just need the header
|
|
|
|
# files.
|
|
|
|
boost152 = stdenv.mkDerivation rec {
|
|
|
|
name = "boost-headers-1.52.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/boost/boost_1_52_0.tar.bz2";
|
|
|
|
sha256 = "14mc7gsnnahdjaxbbslzk79rc0d12h1i681cd3srdwr3fzynlar2";
|
|
|
|
};
|
|
|
|
|
|
|
|
configurePhase = ":";
|
|
|
|
buildPhase = ":";
|
|
|
|
installPhase = "mkdir -p $out/include && cp -R boost $out/include/";
|
|
|
|
};
|
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
in with builtins; {
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-07-02 14:08:54 +00:00
|
|
|
foundationdb51 = makeFdb {
|
2018-05-01 07:17:46 +00:00
|
|
|
version = "5.1.7";
|
|
|
|
branch = "release-5.1";
|
2018-07-02 14:08:54 +00:00
|
|
|
rev = "9ad8d02386d4a6a5efecf898df80f2747695c627";
|
2018-05-01 07:17:46 +00:00
|
|
|
sha256 = "1rc472ih24f9s5g3xmnlp3v62w206ny0pvvw02bzpix2sdrpbp06";
|
2018-07-02 14:08:54 +00:00
|
|
|
boost = boost152;
|
2018-05-01 07:17:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
foundationdb52 = makeFdb rec {
|
2018-07-02 14:08:54 +00:00
|
|
|
version = "5.2.0pre1488_${substring 0 8 rev}";
|
|
|
|
branch = "master";
|
|
|
|
rev = "18f345487ed8d90a5c170d813349fa625cf05b4e";
|
|
|
|
sha256 = "0mz30fxj6q99cvjzg39s5zm992i6h2l2cb70lc58bdhsz92dz3vc";
|
|
|
|
boost = boost152;
|
2018-05-01 07:17:46 +00:00
|
|
|
};
|
2018-04-20 11:35:35 +00:00
|
|
|
|
2018-05-01 07:17:46 +00:00
|
|
|
foundationdb60 = makeFdb rec {
|
2018-07-02 14:08:54 +00:00
|
|
|
version = "6.0.0pre1636_${substring 0 8 rev}";
|
2018-05-01 07:17:46 +00:00
|
|
|
branch = "master";
|
2018-07-02 14:08:54 +00:00
|
|
|
rev = "1265a7b6d5e632dd562b3012e70f0727979806bd";
|
|
|
|
sha256 = "0z1i5bkbszsbn8cc48rlhr29m54n2s0gq3dln0n7f97gf58mi5yf";
|
2018-04-20 11:35:35 +00:00
|
|
|
};
|
2018-07-02 14:08:54 +00:00
|
|
|
|
2018-04-20 11:35:35 +00:00
|
|
|
}
|