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 2 , which, findutils, m4, gawk 3 - , python, openjdk, mono58, libressl_2_6 4 - , boost16x 5 }: 6 7 let 8 makeFdb = 9 { version 10 , branch 11 - , rev, sha256 12 13 - # fdb 6.0+ support boost 1.6x+, so default to it 14 - , boost ? boost16x 15 }: stdenv.mkDerivation rec { 16 name = "foundationdb-${version}"; 17 inherit version; ··· 23 }; 24 25 nativeBuildInputs = [ gawk which m4 findutils mono58 ]; 26 - buildInputs = [ python openjdk libressl_2_6 boost ]; 27 28 patches = 29 - [ ./fix-scm-version.patch 30 - ./ldflags.patch 31 - ]; 32 33 postPatch = '' 34 substituteInPlace ./build/scver.mk \ 35 --subst-var-by NIXOS_FDB_VERSION_ID "${rev}" \ 36 --subst-var-by NIXOS_FDB_SCBRANCH "${branch}" ··· 51 enableParallelBuilding = true; 52 makeFlags = [ "all" "fdb_c" "fdb_java" "KVRELEASE=1" ]; 53 54 - configurePhase = ":"; 55 installPhase = '' 56 mkdir -vp $out/{bin,libexec/plugins} $lib/{lib,share/java} $dev/include/foundationdb 57 ··· 85 }; 86 }; 87 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 in with builtins; { 105 106 - foundationdb51 = makeFdb { 107 version = "5.1.7"; 108 branch = "release-5.1"; 109 - rev = "9ad8d02386d4a6a5efecf898df80f2747695c627"; 110 sha256 = "1rc472ih24f9s5g3xmnlp3v62w206ny0pvvw02bzpix2sdrpbp06"; 111 - boost = boost152; 112 }; 113 114 foundationdb52 = makeFdb rec { 115 - version = "5.2.0pre1488_${substring 0 8 rev}"; 116 - branch = "master"; 117 - rev = "18f345487ed8d90a5c170d813349fa625cf05b4e"; 118 - sha256 = "0mz30fxj6q99cvjzg39s5zm992i6h2l2cb70lc58bdhsz92dz3vc"; 119 - boost = boost152; 120 }; 121 122 foundationdb60 = makeFdb rec { 123 - version = "6.0.0pre1636_${substring 0 8 rev}"; 124 branch = "master"; 125 - rev = "1265a7b6d5e632dd562b3012e70f0727979806bd"; 126 - sha256 = "0z1i5bkbszsbn8cc48rlhr29m54n2s0gq3dln0n7f97gf58mi5yf"; 127 }; 128 - 129 }
··· 1 + { stdenv49 2 + , lib, fetchurl, fetchFromGitHub 3 + 4 , which, findutils, m4, gawk 5 + , python, openjdk, mono58, libressl 6 }: 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 + 25 makeFdb = 26 { version 27 , branch 28 + , sha256 29 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 40 }: stdenv.mkDerivation rec { 41 name = "foundationdb-${version}"; 42 inherit version; ··· 48 }; 49 50 nativeBuildInputs = [ gawk which m4 findutils mono58 ]; 51 + buildInputs = [ python openjdk libressl boost ]; 52 53 patches = 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); 62 63 postPatch = '' 64 + # note: this does not do anything for 6.0+ 65 substituteInPlace ./build/scver.mk \ 66 --subst-var-by NIXOS_FDB_VERSION_ID "${rev}" \ 67 --subst-var-by NIXOS_FDB_SCBRANCH "${branch}" ··· 82 enableParallelBuilding = true; 83 makeFlags = [ "all" "fdb_c" "fdb_java" "KVRELEASE=1" ]; 84 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 + 92 installPhase = '' 93 mkdir -vp $out/{bin,libexec/plugins} $lib/{lib,share/java} $dev/include/foundationdb 94 ··· 122 }; 123 }; 124 125 in with builtins; { 126 127 + foundationdb51 = makeFdb rec { 128 version = "5.1.7"; 129 branch = "release-5.1"; 130 sha256 = "1rc472ih24f9s5g3xmnlp3v62w206ny0pvvw02bzpix2sdrpbp06"; 131 }; 132 133 foundationdb52 = makeFdb rec { 134 + version = "5.2.5"; 135 + branch = "release-5.2"; 136 + sha256 = "00csr4v9cwl9y8r63p73grc6cvhlqmzcniwrf80i0klxv5asg7q7"; 137 }; 138 139 foundationdb60 = makeFdb rec { 140 + version = "6.0.0pre2227_${substring 0 8 rev}"; 141 branch = "master"; 142 + rev = "8caa6eaecf1eeec0298fc77db334761b0c1d1523"; 143 + sha256 = "1q200rpsphl5fzwzp2vk7ifgsnqh95k0xfiicfi1c8253ylnsgll"; 144 }; 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 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 ··· 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 ··· 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: ··· 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) ··· 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 @@ ··· 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)
··· 1 diff --git a/FDBLibTLS/local.mk b/FDBLibTLS/local.mk 2 + index 5e6b9cfb..73f4e5f3 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) -Ifdbrpc 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 ··· 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 44f0c31b..7aea5a4f 100644 15 --- a/bindings/c/local.mk 16 +++ b/bindings/c/local.mk 17 @@ -29,8 +29,8 @@ fdb_c_tests_HEADERS := -Ibindings/c ··· 26 endif 27 28 diff --git a/bindings/flow/tester/local.mk b/bindings/flow/tester/local.mk 29 + index 2ef4fcb7..6e59625c 100644 30 --- a/bindings/flow/tester/local.mk 31 +++ b/bindings/flow/tester/local.mk 32 @@ -35,8 +35,7 @@ _fdb_flow_tester_clean: ··· 40 fdb_flow_tester_LDFLAGS += -lc++ 41 endif 42 diff --git a/fdbbackup/local.mk b/fdbbackup/local.mk 43 + index 033fe7d4..865fc923 100644 44 --- a/fdbbackup/local.mk 45 +++ b/fdbbackup/local.mk 46 @@ -25,8 +25,7 @@ fdbbackup_LDFLAGS := $(fdbrpc_LDFLAGS) ··· 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 81a4a42e..892c079c 100644 58 --- a/fdbcli/local.mk 59 +++ b/fdbcli/local.mk 60 @@ -22,14 +22,13 @@ ··· 75 fdbcli_LDFLAGS += -lc++ 76 endif 77 diff --git a/fdbserver/local.mk b/fdbserver/local.mk 78 + index 78cad1bf..36f2c0f7 100644 79 --- a/fdbserver/local.mk 80 +++ b/fdbserver/local.mk 81 @@ -25,8 +25,7 @@ fdbserver_LDFLAGS := $(fdbrpc_LDFLAGS)
+4 -2
pkgs/top-level/all-packages.nix
··· 2505 2506 fuseiso = callPackage ../tools/filesystems/fuseiso { }; 2507 2508 - fdbPackages = callPackage ../servers/foundationdb { stdenv = overrideCC stdenv gcc49; }; 2509 2510 inherit (fdbPackages) 2511 foundationdb51 2512 foundationdb52 2513 foundationdb60; 2514 2515 - foundationdb = callPackage ../servers/foundationdb { stdenv = overrideCC stdenv gcc49; }; 2516 2517 fuse-7z-ng = callPackage ../tools/filesystems/fuse-7z-ng { }; 2518
··· 2505 2506 fuseiso = callPackage ../tools/filesystems/fuseiso { }; 2507 2508 + fdbPackages = callPackage ../servers/foundationdb { 2509 + stdenv49 = overrideCC stdenv gcc49; 2510 + }; 2511 2512 inherit (fdbPackages) 2513 foundationdb51 2514 foundationdb52 2515 foundationdb60; 2516 2517 + foundationdb = foundationdb52; 2518 2519 fuse-7z-ng = callPackage ../tools/filesystems/fuse-7z-ng { }; 2520