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>

+156 -48
+55 -39
pkgs/servers/foundationdb/default.nix
··· 1 - { stdenv, fetchurl, fetchFromGitHub 1 + { stdenv49 2 + , lib, fetchurl, fetchFromGitHub 3 + 2 4 , which, findutils, m4, gawk 3 - , python, openjdk, mono58, libressl_2_6 4 - , boost16x 5 + , python, openjdk, mono58, libressl 5 6 }: 6 7 7 8 let 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 + 8 25 makeFdb = 9 26 { version 10 27 , branch 11 - , rev, sha256 28 + , sha256 12 29 13 - # fdb 6.0+ support boost 1.6x+, so default to it 14 - , boost ? boost16x 30 + # the revision can be inferred from the fdb tagging policy 31 + , rev ? "refs/tags/${version}" 32 + 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 15 40 }: stdenv.mkDerivation rec { 16 41 name = "foundationdb-${version}"; 17 42 inherit version; ··· 23 48 }; 24 49 25 50 nativeBuildInputs = [ gawk which m4 findutils mono58 ]; 26 - buildInputs = [ python openjdk libressl_2_6 boost ]; 51 + buildInputs = [ python openjdk libressl boost ]; 27 52 28 53 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); 32 62 33 63 postPatch = '' 64 + # note: this does not do anything for 6.0+ 34 65 substituteInPlace ./build/scver.mk \ 35 66 --subst-var-by NIXOS_FDB_VERSION_ID "${rev}" \ 36 67 --subst-var-by NIXOS_FDB_SCBRANCH "${branch}" ··· 51 82 enableParallelBuilding = true; 52 83 makeFlags = [ "all" "fdb_c" "fdb_java" "KVRELEASE=1" ]; 53 84 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 + 55 92 installPhase = '' 56 93 mkdir -vp $out/{bin,libexec/plugins} $lib/{lib,share/java} $dev/include/foundationdb 57 94 ··· 85 122 }; 86 123 }; 87 124 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 - 104 125 in with builtins; { 105 126 106 - foundationdb51 = makeFdb { 127 + foundationdb51 = makeFdb rec { 107 128 version = "5.1.7"; 108 129 branch = "release-5.1"; 109 - rev = "9ad8d02386d4a6a5efecf898df80f2747695c627"; 110 130 sha256 = "1rc472ih24f9s5g3xmnlp3v62w206ny0pvvw02bzpix2sdrpbp06"; 111 - boost = boost152; 112 131 }; 113 132 114 133 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"; 120 137 }; 121 138 122 139 foundationdb60 = makeFdb rec { 123 - version = "6.0.0pre1636_${substring 0 8 rev}"; 140 + version = "6.0.0pre2227_${substring 0 8 rev}"; 124 141 branch = "master"; 125 - rev = "1265a7b6d5e632dd562b3012e70f0727979806bd"; 126 - sha256 = "0z1i5bkbszsbn8cc48rlhr29m54n2s0gq3dln0n7f97gf58mi5yf"; 142 + rev = "8caa6eaecf1eeec0298fc77db334761b0c1d1523"; 143 + sha256 = "1q200rpsphl5fzwzp2vk7ifgsnqh95k0xfiicfi1c8253ylnsgll"; 127 144 }; 128 - 129 145 }
+90
pkgs/servers/foundationdb/ldflags-5.1.patch
··· 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
+7 -7
pkgs/servers/foundationdb/ldflags.patch
··· 1 1 diff --git a/FDBLibTLS/local.mk b/FDBLibTLS/local.mk 2 - index 0b6eac8..b1891ca 100644 2 + index 5e6b9cfb..73f4e5f3 100644 3 3 --- a/FDBLibTLS/local.mk 4 4 +++ b/FDBLibTLS/local.mk 5 5 @@ -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 7 7 -FDBLibTLS_STATIC_LIBS := -ltls -lssl -lcrypto 8 8 -FDBLibTLS_LDFLAGS := -L/usr/local/lib -static-libstdc++ -static-libgcc -lrt 9 9 +FDBLibTLS_LDFLAGS := -L/usr/local/lib -static-libstdc++ -static-libgcc -lrt -ltls -lssl -lcrypto ··· 11 11 12 12 # The plugin isn't a typical library, so it feels more sensible to have a copy 13 13 diff --git a/bindings/c/local.mk b/bindings/c/local.mk 14 - index 44f0c31..7aea5a4 100644 14 + index 44f0c31b..7aea5a4f 100644 15 15 --- a/bindings/c/local.mk 16 16 +++ b/bindings/c/local.mk 17 17 @@ -29,8 +29,8 @@ fdb_c_tests_HEADERS := -Ibindings/c ··· 26 26 endif 27 27 28 28 diff --git a/bindings/flow/tester/local.mk b/bindings/flow/tester/local.mk 29 - index 2ef4fcb..6e59625 100644 29 + index 2ef4fcb7..6e59625c 100644 30 30 --- a/bindings/flow/tester/local.mk 31 31 +++ b/bindings/flow/tester/local.mk 32 32 @@ -35,8 +35,7 @@ _fdb_flow_tester_clean: ··· 40 40 fdb_flow_tester_LDFLAGS += -lc++ 41 41 endif 42 42 diff --git a/fdbbackup/local.mk b/fdbbackup/local.mk 43 - index 033fe7d..865fc92 100644 43 + index 033fe7d4..865fc923 100644 44 44 --- a/fdbbackup/local.mk 45 45 +++ b/fdbbackup/local.mk 46 46 @@ -25,8 +25,7 @@ fdbbackup_LDFLAGS := $(fdbrpc_LDFLAGS) ··· 54 54 # GPerfTools profiler (uncomment to use) 55 55 # fdbbackup_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1 56 56 diff --git a/fdbcli/local.mk b/fdbcli/local.mk 57 - index 81a4a42..892c079 100644 57 + index 81a4a42e..892c079c 100644 58 58 --- a/fdbcli/local.mk 59 59 +++ b/fdbcli/local.mk 60 60 @@ -22,14 +22,13 @@ ··· 75 75 fdbcli_LDFLAGS += -lc++ 76 76 endif 77 77 diff --git a/fdbserver/local.mk b/fdbserver/local.mk 78 - index 78cad1b..36f2c0f 100644 78 + index 78cad1bf..36f2c0f7 100644 79 79 --- a/fdbserver/local.mk 80 80 +++ b/fdbserver/local.mk 81 81 @@ -25,8 +25,7 @@ fdbserver_LDFLAGS := $(fdbrpc_LDFLAGS)
+4 -2
pkgs/top-level/all-packages.nix
··· 2505 2505 2506 2506 fuseiso = callPackage ../tools/filesystems/fuseiso { }; 2507 2507 2508 - fdbPackages = callPackage ../servers/foundationdb { stdenv = overrideCC stdenv gcc49; }; 2508 + fdbPackages = callPackage ../servers/foundationdb { 2509 + stdenv49 = overrideCC stdenv gcc49; 2510 + }; 2509 2511 2510 2512 inherit (fdbPackages) 2511 2513 foundationdb51 2512 2514 foundationdb52 2513 2515 foundationdb60; 2514 2516 2515 - foundationdb = callPackage ../servers/foundationdb { stdenv = overrideCC stdenv gcc49; }; 2517 + foundationdb = foundationdb52; 2516 2518 2517 2519 fuse-7z-ng = callPackage ../tools/filesystems/fuse-7z-ng { }; 2518 2520