git.iko.soy/typeable/nixpkgs
on master help sign in
foundationdb: add 5.2.5 release, and new 6.0.0 snapshot

This requires a bit of fiddling with the ldflags patches and reworking a few things about how the SCM info is configured. Ideally, not much more will change before the 6.0 release, I think... This also upgrades all FoundationDB packages to use the ordinary libressl expression (which is now at 2.7.x), and changes around a few other things, which will require a rebuild. Signed-off-by: Austin Seipp <aseipp@pobox.com>

commit1fa2503f9dba814eb23726a25642d2180ce791c3 authorAustin Seipp <aseipp@pobox.com> dateMon 2 Jul 2018, 06:02 (8 years ago) parentb43c4d8
4 files changed+155−47
pkgs/servers/foundationdb/default.nix+55−39 pkgs/servers/foundationdb/ldflags-5.1.patch+90 pkgs/servers/foundationdb/ldflags.patch+7−7 pkgs/top-level/all-packages.nix+3−1
pkgs/servers/foundationdb/default.nix+55−39
@@ -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}
pkgs/servers/foundationdb/ldflags-5.1.patchnew file+90
@@ -0,0 +1,90 @@
1+diff --git a/FDBLibTLS/local.mk b/FDBLibTLS/local.mk
2+index 0b6eac8..b1891ca 100644
3+--- a/FDBLibTLS/local.mk
4++++ b/FDBLibTLS/local.mk
5+@@ -1,6 +1,5 @@
6+ FDBLibTLS_CFLAGS := -fPIC -I/usr/local/include -I$(BOOSTDIR)
7+-FDBLibTLS_STATIC_LIBS := -ltls -lssl -lcrypto
8+-FDBLibTLS_LDFLAGS := -L/usr/local/lib -static-libstdc++ -static-libgcc -lrt
9++FDBLibTLS_LDFLAGS := -L/usr/local/lib -static-libstdc++ -static-libgcc -lrt -ltls -lssl -lcrypto
10+ FDBLibTLS_LDFLAGS += -Wl,-soname,FDBLibTLS.so -Wl,--version-script=FDBLibTLS/FDBLibTLS.map
11+
12+ # The plugin isn't a typical library, so it feels more sensible to have a copy
13+diff --git a/bindings/c/local.mk b/bindings/c/local.mk
14+index 44f0c31..7aea5a4 100644
15+--- a/bindings/c/local.mk
16++++ b/bindings/c/local.mk
17+@@ -29,8 +29,8 @@ fdb_c_tests_HEADERS := -Ibindings/c
18+ CLEAN_TARGETS += fdb_c_tests_clean
19+
20+ ifeq ($(PLATFORM),linux)
21+- fdb_c_LIBS += lib/libstdc++.a -lm -lpthread -lrt -ldl
22+- fdb_c_LDFLAGS += -Wl,--version-script=bindings/c/fdb_c.map -static-libgcc -Wl,-z,nodelete
23++ fdb_c_LIBS += lib/libstdc++.a
24++ fdb_c_LDFLAGS += -Wl,--version-script=bindings/c/fdb_c.map -static-libgcc -Wl,-z,nodelete -lm -lpthread -lrt -ldl
25+ fdb_c_tests_LIBS += -lpthread
26+ endif
27+
28+diff --git a/bindings/flow/tester/local.mk b/bindings/flow/tester/local.mk
29+index 2ef4fcb..6e59625 100644
30+--- a/bindings/flow/tester/local.mk
31++++ b/bindings/flow/tester/local.mk
32+@@ -35,8 +35,7 @@ _fdb_flow_tester_clean:
33+ @rm -rf bindings/flow/bin
34+
35+ ifeq ($(PLATFORM),linux)
36+- fdb_flow_tester_LIBS += -ldl -lpthread -lrt
37+- fdb_flow_tester_LDFLAGS += -static-libstdc++ -static-libgcc
38++ fdb_flow_tester_LDFLAGS += -static-libstdc++ -static-libgcc -ldl -lpthread -lrt
39+ else ifeq ($(PLATFORM),osx)
40+ fdb_flow_tester_LDFLAGS += -lc++
41+ endif
42+diff --git a/fdbbackup/local.mk b/fdbbackup/local.mk
43+index 033fe7d..865fc92 100644
44+--- a/fdbbackup/local.mk
45++++ b/fdbbackup/local.mk
46+@@ -25,8 +25,7 @@ fdbbackup_LDFLAGS := $(fdbrpc_LDFLAGS)
47+ fdbbackup_LIBS := lib/libfdbclient.a lib/libfdbrpc.a lib/libflow.a
48+
49+ ifeq ($(PLATFORM),linux)
50+- fdbbackup_LIBS += -ldl -lpthread -lrt
51+- fdbbackup_LDFLAGS += -static-libstdc++ -static-libgcc
52++ fdbbackup_LDFLAGS += -static-libstdc++ -static-libgcc -ldl -lpthread -lrt
53+
54+ # GPerfTools profiler (uncomment to use)
55+ # fdbbackup_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1
56+diff --git a/fdbcli/local.mk b/fdbcli/local.mk
57+index 81a4a42..892c079 100644
58+--- a/fdbcli/local.mk
59++++ b/fdbcli/local.mk
60+@@ -22,14 +22,13 @@
61+
62+ fdbcli_CFLAGS := $(fdbclient_CFLAGS)
63+ fdbcli_LDFLAGS := $(fdbrpc_LDFLAGS)
64+-fdbcli_LIBS := lib/libfdbclient.a lib/libfdbrpc.a lib/libflow.a -ldl
65++fdbcli_LIBS := lib/libfdbclient.a lib/libfdbrpc.a lib/libflow.a
66+ fdbcli_STATIC_LIBS :=
67+
68+ fdbcli_GENERATED_SOURCES += versions.h
69+
70+ ifeq ($(PLATFORM),linux)
71+- fdbcli_LDFLAGS += -static-libstdc++ -static-libgcc
72+- fdbcli_LIBS += -lpthread -lrt
73++ fdbcli_LDFLAGS += -static-libstdc++ -static-libgcc -lpthread -lrt -ldl
74+ else ifeq ($(PLATFORM),osx)
75+ fdbcli_LDFLAGS += -lc++
76+ endif
77+diff --git a/fdbserver/local.mk b/fdbserver/local.mk
78+index 78cad1b..36f2c0f 100644
79+--- a/fdbserver/local.mk
80++++ b/fdbserver/local.mk
81+@@ -25,8 +25,7 @@ fdbserver_LDFLAGS := $(fdbrpc_LDFLAGS)
82+ fdbserver_LIBS := lib/libfdbclient.a lib/libfdbrpc.a lib/libflow.a
83+
84+ ifeq ($(PLATFORM),linux)
85+- fdbserver_LIBS += -ldl -lpthread -lrt
86+- fdbserver_LDFLAGS += -static-libstdc++ -static-libgcc
87++ fdbserver_LDFLAGS += -static-libstdc++ -static-libgcc -ldl -lpthread -lrt
88+
89+ # GPerfTools profiler (uncomment to use)
90+ # fdbserver_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1
pkgs/servers/foundationdb/ldflags.patch+7−7
@@ -1,9 +1,9 @@
11diff --git a/FDBLibTLS/local.mk b/FDBLibTLS/local.mk
2−index 0b6eac8..b1891ca 100644
2+index 5e6b9cfb..73f4e5f3 100644
33--- a/FDBLibTLS/local.mk
44+++ b/FDBLibTLS/local.mk
55@@ -1,6 +1,5 @@
6− FDBLibTLS_CFLAGS := -fPIC -I/usr/local/include -I$(BOOSTDIR)
6+ FDBLibTLS_CFLAGS := -fPIC -I/usr/local/include -I$(BOOSTDIR) -Ifdbrpc
77-FDBLibTLS_STATIC_LIBS := -ltls -lssl -lcrypto
88-FDBLibTLS_LDFLAGS := -L/usr/local/lib -static-libstdc++ -static-libgcc -lrt
99+FDBLibTLS_LDFLAGS := -L/usr/local/lib -static-libstdc++ -static-libgcc -lrt -ltls -lssl -lcrypto
@@ -11,7 +11,7 @@ index 0b6eac8..b1891ca 100644
1111
1212 # The plugin isn't a typical library, so it feels more sensible to have a copy
1313diff --git a/bindings/c/local.mk b/bindings/c/local.mk
14−index 44f0c31..7aea5a4 100644
14+index 44f0c31b..7aea5a4f 100644
1515--- a/bindings/c/local.mk
1616+++ b/bindings/c/local.mk
1717@@ -29,8 +29,8 @@ fdb_c_tests_HEADERS := -Ibindings/c
@@ -26,7 +26,7 @@ index 44f0c31..7aea5a4 100644
2626 endif
2727
2828diff --git a/bindings/flow/tester/local.mk b/bindings/flow/tester/local.mk
29−index 2ef4fcb..6e59625 100644
29+index 2ef4fcb7..6e59625c 100644
3030--- a/bindings/flow/tester/local.mk
3131+++ b/bindings/flow/tester/local.mk
3232@@ -35,8 +35,7 @@ _fdb_flow_tester_clean:
@@ -40,7 +40,7 @@ index 2ef4fcb..6e59625 100644
4040 fdb_flow_tester_LDFLAGS += -lc++
4141 endif
4242diff --git a/fdbbackup/local.mk b/fdbbackup/local.mk
43−index 033fe7d..865fc92 100644
43+index 033fe7d4..865fc923 100644
4444--- a/fdbbackup/local.mk
4545+++ b/fdbbackup/local.mk
4646@@ -25,8 +25,7 @@ fdbbackup_LDFLAGS := $(fdbrpc_LDFLAGS)
@@ -54,7 +54,7 @@ index 033fe7d..865fc92 100644
5454 # GPerfTools profiler (uncomment to use)
5555 # fdbbackup_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1
5656diff --git a/fdbcli/local.mk b/fdbcli/local.mk
57−index 81a4a42..892c079 100644
57+index 81a4a42e..892c079c 100644
5858--- a/fdbcli/local.mk
5959+++ b/fdbcli/local.mk
6060@@ -22,14 +22,13 @@
@@ -75,7 +75,7 @@ index 81a4a42..892c079 100644
7575 fdbcli_LDFLAGS += -lc++
7676 endif
7777diff --git a/fdbserver/local.mk b/fdbserver/local.mk
78−index 78cad1b..36f2c0f 100644
78+index 78cad1bf..36f2c0f7 100644
7979--- a/fdbserver/local.mk
8080+++ b/fdbserver/local.mk
8181@@ -25,8 +25,7 @@ fdbserver_LDFLAGS := $(fdbrpc_LDFLAGS)
pkgs/top-level/all-packages.nix+3−1
@@ -2522,7 +2522,9 @@ with pkgs;
25222522
25232523 fuseiso = callPackage ../tools/filesystems/fuseiso { };
25242524
2525− fdbPackages = callPackage ../servers/foundationdb { stdenv = overrideCC stdenv gcc49; };
2525+ fdbPackages = callPackage ../servers/foundationdb {
2526+ stdenv49 = overrideCC stdenv gcc49;
2527+ };
25262528
25272529 inherit (fdbPackages)
25282530 foundationdb51