Skip to content

Commit

Permalink
foundationdb: add 5.2.5 release, and new 6.0.0 snapshot
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
thoughtpolice committed Jul 3, 2018
1 parent 08895c6 commit e42e0c8
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 48 deletions.
94 changes: 55 additions & 39 deletions pkgs/servers/foundationdb/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,42 @@
{ stdenv, fetchurl, fetchFromGitHub
{ stdenv49
, lib, fetchurl, fetchFromGitHub

, which, findutils, m4, gawk
, python, openjdk, mono58, libressl_2_6
, boost16x
, python, openjdk, mono58, libressl
}:

let
# 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 = stdenv49.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/";
};

makeFdb =
{ version
, branch
, rev, sha256
, sha256

# the revision can be inferred from the fdb tagging policy
, rev ? "refs/tags/${version}"

# fdb 6.0+ support boost 1.6x+, so default to it
, boost ? boost16x
# in theory newer versions of fdb support newer compilers, but they
# don't :( maybe one day
, stdenv ? stdenv49

# in theory newer versions of fdb support newer boost versions, but they
# don't :( maybe one day
, boost ? boost152
}: stdenv.mkDerivation rec {
name = "foundationdb-${version}";
inherit version;
Expand All @@ -23,14 +48,20 @@ let
};

nativeBuildInputs = [ gawk which m4 findutils mono58 ];
buildInputs = [ python openjdk libressl_2_6 boost ];
buildInputs = [ python openjdk libressl boost ];

patches =
[ ./fix-scm-version.patch
./ldflags.patch
];
[ # For 5.2+, we need a slightly adjusted patch to fix all the ldflags
(if lib.versionAtLeast version "5.2"
then ./ldflags.patch
else ./ldflags-5.1.patch)
] ++
# for 6.0+, we do NOT need to apply this version fix, since we can specify
# it ourselves. see configurePhase
(lib.optional (!lib.versionAtLeast version "6.0") ./fix-scm-version.patch);

postPatch = ''
# note: this does not do anything for 6.0+
substituteInPlace ./build/scver.mk \
--subst-var-by NIXOS_FDB_VERSION_ID "${rev}" \
--subst-var-by NIXOS_FDB_SCBRANCH "${branch}"
Expand All @@ -51,7 +82,13 @@ let
enableParallelBuilding = true;
makeFlags = [ "all" "fdb_c" "fdb_java" "KVRELEASE=1" ];

configurePhase = ":";
# on 6.0 and later, we can specify all this information manually
configurePhase = lib.optionalString (lib.versionAtLeast version "6.0") ''
export SOURCE_CONTROL=GIT
export SCBRANCH="${branch}"
export VERSION_ID="${rev}"
'';

installPhase = ''
mkdir -vp $out/{bin,libexec/plugins} $lib/{lib,share/java} $dev/include/foundationdb
Expand Down Expand Up @@ -85,45 +122,24 @@ let
};
};

# 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/";
};

in with builtins; {

foundationdb51 = makeFdb {
foundationdb51 = makeFdb rec {
version = "5.1.7";
branch = "release-5.1";
rev = "9ad8d02386d4a6a5efecf898df80f2747695c627";
sha256 = "1rc472ih24f9s5g3xmnlp3v62w206ny0pvvw02bzpix2sdrpbp06";
boost = boost152;
};

foundationdb52 = makeFdb rec {
version = "5.2.0pre1488_${substring 0 8 rev}";
branch = "master";
rev = "18f345487ed8d90a5c170d813349fa625cf05b4e";
sha256 = "0mz30fxj6q99cvjzg39s5zm992i6h2l2cb70lc58bdhsz92dz3vc";
boost = boost152;
version = "5.2.5";
branch = "release-5.2";
sha256 = "00csr4v9cwl9y8r63p73grc6cvhlqmzcniwrf80i0klxv5asg7q7";
};

foundationdb60 = makeFdb rec {
version = "6.0.0pre1636_${substring 0 8 rev}";
version = "6.0.0pre2227_${substring 0 8 rev}";
branch = "master";
rev = "1265a7b6d5e632dd562b3012e70f0727979806bd";
sha256 = "0z1i5bkbszsbn8cc48rlhr29m54n2s0gq3dln0n7f97gf58mi5yf";
rev = "8caa6eaecf1eeec0298fc77db334761b0c1d1523";
sha256 = "1q200rpsphl5fzwzp2vk7ifgsnqh95k0xfiicfi1c8253ylnsgll";
};

}
90 changes: 90 additions & 0 deletions pkgs/servers/foundationdb/ldflags-5.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
diff --git a/FDBLibTLS/local.mk b/FDBLibTLS/local.mk
index 0b6eac8..b1891ca 100644
--- a/FDBLibTLS/local.mk
+++ b/FDBLibTLS/local.mk
@@ -1,6 +1,5 @@
FDBLibTLS_CFLAGS := -fPIC -I/usr/local/include -I$(BOOSTDIR)
-FDBLibTLS_STATIC_LIBS := -ltls -lssl -lcrypto
-FDBLibTLS_LDFLAGS := -L/usr/local/lib -static-libstdc++ -static-libgcc -lrt
+FDBLibTLS_LDFLAGS := -L/usr/local/lib -static-libstdc++ -static-libgcc -lrt -ltls -lssl -lcrypto
FDBLibTLS_LDFLAGS += -Wl,-soname,FDBLibTLS.so -Wl,--version-script=FDBLibTLS/FDBLibTLS.map

# The plugin isn't a typical library, so it feels more sensible to have a copy
diff --git a/bindings/c/local.mk b/bindings/c/local.mk
index 44f0c31..7aea5a4 100644
--- a/bindings/c/local.mk
+++ b/bindings/c/local.mk
@@ -29,8 +29,8 @@ fdb_c_tests_HEADERS := -Ibindings/c
CLEAN_TARGETS += fdb_c_tests_clean

ifeq ($(PLATFORM),linux)
- fdb_c_LIBS += lib/libstdc++.a -lm -lpthread -lrt -ldl
- fdb_c_LDFLAGS += -Wl,--version-script=bindings/c/fdb_c.map -static-libgcc -Wl,-z,nodelete
+ fdb_c_LIBS += lib/libstdc++.a
+ fdb_c_LDFLAGS += -Wl,--version-script=bindings/c/fdb_c.map -static-libgcc -Wl,-z,nodelete -lm -lpthread -lrt -ldl
fdb_c_tests_LIBS += -lpthread
endif

diff --git a/bindings/flow/tester/local.mk b/bindings/flow/tester/local.mk
index 2ef4fcb..6e59625 100644
--- a/bindings/flow/tester/local.mk
+++ b/bindings/flow/tester/local.mk
@@ -35,8 +35,7 @@ _fdb_flow_tester_clean:
@rm -rf bindings/flow/bin

ifeq ($(PLATFORM),linux)
- fdb_flow_tester_LIBS += -ldl -lpthread -lrt
- fdb_flow_tester_LDFLAGS += -static-libstdc++ -static-libgcc
+ fdb_flow_tester_LDFLAGS += -static-libstdc++ -static-libgcc -ldl -lpthread -lrt
else ifeq ($(PLATFORM),osx)
fdb_flow_tester_LDFLAGS += -lc++
endif
diff --git a/fdbbackup/local.mk b/fdbbackup/local.mk
index 033fe7d..865fc92 100644
--- a/fdbbackup/local.mk
+++ b/fdbbackup/local.mk
@@ -25,8 +25,7 @@ fdbbackup_LDFLAGS := $(fdbrpc_LDFLAGS)
fdbbackup_LIBS := lib/libfdbclient.a lib/libfdbrpc.a lib/libflow.a

ifeq ($(PLATFORM),linux)
- fdbbackup_LIBS += -ldl -lpthread -lrt
- fdbbackup_LDFLAGS += -static-libstdc++ -static-libgcc
+ fdbbackup_LDFLAGS += -static-libstdc++ -static-libgcc -ldl -lpthread -lrt

# GPerfTools profiler (uncomment to use)
# fdbbackup_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1
diff --git a/fdbcli/local.mk b/fdbcli/local.mk
index 81a4a42..892c079 100644
--- a/fdbcli/local.mk
+++ b/fdbcli/local.mk
@@ -22,14 +22,13 @@

fdbcli_CFLAGS := $(fdbclient_CFLAGS)
fdbcli_LDFLAGS := $(fdbrpc_LDFLAGS)
-fdbcli_LIBS := lib/libfdbclient.a lib/libfdbrpc.a lib/libflow.a -ldl
+fdbcli_LIBS := lib/libfdbclient.a lib/libfdbrpc.a lib/libflow.a
fdbcli_STATIC_LIBS :=

fdbcli_GENERATED_SOURCES += versions.h

ifeq ($(PLATFORM),linux)
- fdbcli_LDFLAGS += -static-libstdc++ -static-libgcc
- fdbcli_LIBS += -lpthread -lrt
+ fdbcli_LDFLAGS += -static-libstdc++ -static-libgcc -lpthread -lrt -ldl
else ifeq ($(PLATFORM),osx)
fdbcli_LDFLAGS += -lc++
endif
diff --git a/fdbserver/local.mk b/fdbserver/local.mk
index 78cad1b..36f2c0f 100644
--- a/fdbserver/local.mk
+++ b/fdbserver/local.mk
@@ -25,8 +25,7 @@ fdbserver_LDFLAGS := $(fdbrpc_LDFLAGS)
fdbserver_LIBS := lib/libfdbclient.a lib/libfdbrpc.a lib/libflow.a

ifeq ($(PLATFORM),linux)
- fdbserver_LIBS += -ldl -lpthread -lrt
- fdbserver_LDFLAGS += -static-libstdc++ -static-libgcc
+ fdbserver_LDFLAGS += -static-libstdc++ -static-libgcc -ldl -lpthread -lrt

# GPerfTools profiler (uncomment to use)
# fdbserver_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1
14 changes: 7 additions & 7 deletions pkgs/servers/foundationdb/ldflags.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
diff --git a/FDBLibTLS/local.mk b/FDBLibTLS/local.mk
index 0b6eac8..b1891ca 100644
index 5e6b9cfb..73f4e5f3 100644
--- a/FDBLibTLS/local.mk
+++ b/FDBLibTLS/local.mk
@@ -1,6 +1,5 @@
FDBLibTLS_CFLAGS := -fPIC -I/usr/local/include -I$(BOOSTDIR)
FDBLibTLS_CFLAGS := -fPIC -I/usr/local/include -I$(BOOSTDIR) -Ifdbrpc
-FDBLibTLS_STATIC_LIBS := -ltls -lssl -lcrypto
-FDBLibTLS_LDFLAGS := -L/usr/local/lib -static-libstdc++ -static-libgcc -lrt
+FDBLibTLS_LDFLAGS := -L/usr/local/lib -static-libstdc++ -static-libgcc -lrt -ltls -lssl -lcrypto
FDBLibTLS_LDFLAGS += -Wl,-soname,FDBLibTLS.so -Wl,--version-script=FDBLibTLS/FDBLibTLS.map

# The plugin isn't a typical library, so it feels more sensible to have a copy
diff --git a/bindings/c/local.mk b/bindings/c/local.mk
index 44f0c31..7aea5a4 100644
index 44f0c31b..7aea5a4f 100644
--- a/bindings/c/local.mk
+++ b/bindings/c/local.mk
@@ -29,8 +29,8 @@ fdb_c_tests_HEADERS := -Ibindings/c
Expand All @@ -26,7 +26,7 @@ index 44f0c31..7aea5a4 100644
endif

diff --git a/bindings/flow/tester/local.mk b/bindings/flow/tester/local.mk
index 2ef4fcb..6e59625 100644
index 2ef4fcb7..6e59625c 100644
--- a/bindings/flow/tester/local.mk
+++ b/bindings/flow/tester/local.mk
@@ -35,8 +35,7 @@ _fdb_flow_tester_clean:
Expand All @@ -40,7 +40,7 @@ index 2ef4fcb..6e59625 100644
fdb_flow_tester_LDFLAGS += -lc++
endif
diff --git a/fdbbackup/local.mk b/fdbbackup/local.mk
index 033fe7d..865fc92 100644
index 033fe7d4..865fc923 100644
--- a/fdbbackup/local.mk
+++ b/fdbbackup/local.mk
@@ -25,8 +25,7 @@ fdbbackup_LDFLAGS := $(fdbrpc_LDFLAGS)
Expand All @@ -54,7 +54,7 @@ index 033fe7d..865fc92 100644
# GPerfTools profiler (uncomment to use)
# fdbbackup_CFLAGS += -I/opt/gperftools/include -DUSE_GPERFTOOLS=1
diff --git a/fdbcli/local.mk b/fdbcli/local.mk
index 81a4a42..892c079 100644
index 81a4a42e..892c079c 100644
--- a/fdbcli/local.mk
+++ b/fdbcli/local.mk
@@ -22,14 +22,13 @@
Expand All @@ -75,7 +75,7 @@ index 81a4a42..892c079 100644
fdbcli_LDFLAGS += -lc++
endif
diff --git a/fdbserver/local.mk b/fdbserver/local.mk
index 78cad1b..36f2c0f 100644
index 78cad1bf..36f2c0f7 100644
--- a/fdbserver/local.mk
+++ b/fdbserver/local.mk
@@ -25,8 +25,7 @@ fdbserver_LDFLAGS := $(fdbrpc_LDFLAGS)
Expand Down
6 changes: 4 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2505,14 +2505,16 @@ with pkgs;

fuseiso = callPackage ../tools/filesystems/fuseiso { };

fdbPackages = callPackage ../servers/foundationdb { stdenv = overrideCC stdenv gcc49; };
fdbPackages = callPackage ../servers/foundationdb {
stdenv49 = overrideCC stdenv gcc49;
};

inherit (fdbPackages)
foundationdb51
foundationdb52
foundationdb60;

foundationdb = callPackage ../servers/foundationdb { stdenv = overrideCC stdenv gcc49; };
foundationdb = foundationdb52;

fuse-7z-ng = callPackage ../tools/filesystems/fuse-7z-ng { };

Expand Down

0 comments on commit e42e0c8

Please sign in to comment.