@@ -1,17 +1,42 @@
1−{ stdenv, fetchurl, fetchFromGitHub
1+{ stdenv49
2+, lib, fetchurl, fetchFromGitHub
3+
24, which, findutils, m4, gawk
3−, python, openjdk, mono58, libressl_2_6
4−, boost16x
5+, python, openjdk, mono58, libressl
56}:
67
78let
9+ # hysterical raisins dictate a version of boost this old. however,
10+ # we luckily do not need to build anything, we just need the header
11+ # files.
12+ boost152 = stdenv49.mkDerivation rec {
13+ name = "boost-headers-1.52.0";
14+
15+ src = fetchurl {
16+ url = "mirror://sourceforge/boost/boost_1_52_0.tar.bz2";
17+ sha256 = "14mc7gsnnahdjaxbbslzk79rc0d12h1i681cd3srdwr3fzynlar2";
18+ };
19+
20+ configurePhase = ":";
21+ buildPhase = ":";
22+ installPhase = "mkdir -p $out/include && cp -R boost $out/include/";
23+ };
24+
825 makeFdb =
926 { version
1027 , branch
11− , rev, sha256
28+ , sha256
29+
30+ # the revision can be inferred from the fdb tagging policy
31+ , rev ? "refs/tags/${version}"
1232
13− # fdb 6.0+ support boost 1.6x+, so default to it
14− , boost ? boost16x
33+ # in theory newer versions of fdb support newer compilers, but they
34+ # don't :( maybe one day
35+ , stdenv ? stdenv49
36+
37+ # in theory newer versions of fdb support newer boost versions, but they
38+ # don't :( maybe one day
39+ , boost ? boost152
1540 }: stdenv.mkDerivation rec {
1641 name = "foundationdb-${version}";
1742 inherit version;
@@ -23,14 +48,20 @@ let
2348 };
2449
2550 nativeBuildInputs = [ gawk which m4 findutils mono58 ];
26− buildInputs = [ python openjdk libressl_2_6 boost ];
51+ buildInputs = [ python openjdk libressl boost ];
2752
2853 patches =
29− [ ./fix-scm-version.patch
30− ./ldflags.patch
31− ];
54+ [ # For 5.2+, we need a slightly adjusted patch to fix all the ldflags
55+ (if lib.versionAtLeast version "5.2"
56+ then ./ldflags.patch
57+ else ./ldflags-5.1.patch)
58+ ] ++
59+ # for 6.0+, we do NOT need to apply this version fix, since we can specify
60+ # it ourselves. see configurePhase
61+ (lib.optional (!lib.versionAtLeast version "6.0") ./fix-scm-version.patch);
3262
3363 postPatch = ''
64+ # note: this does not do anything for 6.0+
3465 substituteInPlace ./build/scver.mk \
3566 --subst-var-by NIXOS_FDB_VERSION_ID "${rev}" \
3667 --subst-var-by NIXOS_FDB_SCBRANCH "${branch}"
@@ -51,7 +82,13 @@ let
5182 enableParallelBuilding = true;
5283 makeFlags = [ "all" "fdb_c" "fdb_java" "KVRELEASE=1" ];
5384
54− configurePhase = ":";
85+ # on 6.0 and later, we can specify all this information manually
86+ configurePhase = lib.optionalString (lib.versionAtLeast version "6.0") ''
87+ export SOURCE_CONTROL=GIT
88+ export SCBRANCH="${branch}"
89+ export VERSION_ID="${rev}"
90+ '';
91+
5592 installPhase = ''
5693 mkdir -vp $out/{bin,libexec/plugins} $lib/{lib,share/java} $dev/include/foundationdb
5794
@@ -85,45 +122,24 @@ let
85122 };
86123 };
87124
88− # hysterical raisins dictate a version of boost this old. however,
89− # we luckily do not need to build anything, we just need the header
90− # files.
91− boost152 = stdenv.mkDerivation rec {
92− name = "boost-headers-1.52.0";
93−
94− src = fetchurl {
95− url = "mirror://sourceforge/boost/boost_1_52_0.tar.bz2";
96− sha256 = "14mc7gsnnahdjaxbbslzk79rc0d12h1i681cd3srdwr3fzynlar2";
97− };
98−
99− configurePhase = ":";
100− buildPhase = ":";
101− installPhase = "mkdir -p $out/include && cp -R boost $out/include/";
102− };
103−
104125in with builtins; {
105126
106− foundationdb51 = makeFdb {
127+ foundationdb51 = makeFdb rec {
107128 version = "5.1.7";
108129 branch = "release-5.1";
109− rev = "9ad8d02386d4a6a5efecf898df80f2747695c627";
110130 sha256 = "1rc472ih24f9s5g3xmnlp3v62w206ny0pvvw02bzpix2sdrpbp06";
111− boost = boost152;
112131 };
113132
114133 foundationdb52 = makeFdb rec {
115− version = "5.2.0pre1488_${substring 0 8 rev}";
116− branch = "master";
117− rev = "18f345487ed8d90a5c170d813349fa625cf05b4e";
118− sha256 = "0mz30fxj6q99cvjzg39s5zm992i6h2l2cb70lc58bdhsz92dz3vc";
119− boost = boost152;
134+ version = "5.2.5";
135+ branch = "release-5.2";
136+ sha256 = "00csr4v9cwl9y8r63p73grc6cvhlqmzcniwrf80i0klxv5asg7q7";
120137 };
121138
122139 foundationdb60 = makeFdb rec {
123− version = "6.0.0pre1636_${substring 0 8 rev}";
140+ version = "6.0.0pre2227_${substring 0 8 rev}";
124141 branch = "master";
125− rev = "1265a7b6d5e632dd562b3012e70f0727979806bd";
126− sha256 = "0z1i5bkbszsbn8cc48rlhr29m54n2s0gq3dln0n7f97gf58mi5yf";
142+ rev = "8caa6eaecf1eeec0298fc77db334761b0c1d1523";
143+ sha256 = "1q200rpsphl5fzwzp2vk7ifgsnqh95k0xfiicfi1c8253ylnsgll";
127144 };
128−
129145}