foundationdb: init at 5.1.7

Signed-off-by: Austin Seipp <aseipp@pobox.com>

+233
+99
pkgs/servers/foundationdb/default.nix
···
··· 1 + { stdenv, fetchurl, fetchFromGitHub 2 + , which, findutils, m4, gawk, python, openjdk, mono58, libressl_2_6 3 + }: 4 + 5 + let 6 + version = "5.1.7"; 7 + branch = "release-5.1"; 8 + rev = "9ad8d02386d4a6a5efecf898df80f2747695c627"; 9 + sha256 = "1rc472ih24f9s5g3xmnlp3v62w206ny0pvvw02bzpix2sdrpbp06"; 10 + 11 + # hysterical raisins dictate a version of boost this old. however, 12 + # we luckily do not need to build anything, we just need the header 13 + # files. 14 + boost152 = stdenv.mkDerivation rec { 15 + name = "boost-headers-1.52.0"; 16 + 17 + src = fetchurl { 18 + url = "mirror://sourceforge/boost/boost_1_52_0.tar.bz2"; 19 + sha256 = "14mc7gsnnahdjaxbbslzk79rc0d12h1i681cd3srdwr3fzynlar2"; 20 + }; 21 + 22 + buildPhase = ":"; 23 + configurePhase = ":"; 24 + installPhase = '' 25 + mkdir -p $out/include/ 26 + cp -R boost $out/include/ 27 + ''; 28 + }; 29 + 30 + in stdenv.mkDerivation rec { 31 + name = "foundationdb-${version}"; 32 + inherit version; 33 + 34 + src = fetchFromGitHub { 35 + owner = "apple"; 36 + repo = "foundationdb"; 37 + inherit rev sha256; 38 + }; 39 + 40 + nativeBuildInputs = [ gawk which m4 findutils boost152 mono58 ]; 41 + buildInputs = [ python openjdk libressl_2_6 ]; 42 + 43 + patches = 44 + [ ./fix-scm-version.patch 45 + ./ldflags.patch 46 + ]; 47 + 48 + postPatch = '' 49 + substituteInPlace ./build/scver.mk \ 50 + --subst-var-by NIXOS_FDB_VERSION_ID "${rev}" \ 51 + --subst-var-by NIXOS_FDB_SCBRANCH "${branch}" 52 + 53 + substituteInPlace ./Makefile \ 54 + --replace 'shell which ccache' 'shell true' \ 55 + --replace -Werror "" 56 + 57 + substituteInPlace ./Makefile \ 58 + --replace libstdc++_pic libstdc++ 59 + 60 + substituteInPlace ./build/link-validate.sh \ 61 + --replace 'exit 1' '#exit 1' 62 + 63 + patchShebangs . 64 + ''; 65 + 66 + enableParallelBuilding = true; 67 + makeFlags = [ "all" "fdb_c" "KVRELEASE=1" ]; 68 + 69 + configurePhase = ":"; 70 + installPhase = '' 71 + mkdir -vp $out/{bin,libexec/plugins} $lib/lib $dev/include/foundationdb 72 + 73 + cp -v ./lib/libfdb_c.so $lib/lib 74 + cp -v ./lib/libFDBLibTLS.so $out/libexec/plugins/FDBLibTLS.so 75 + 76 + cp -v ./bindings/c/foundationdb/fdb_c.h $dev/include/foundationdb 77 + cp -v ./bindings/c/foundationdb/fdb_c_options.g.h $dev/include/foundationdb 78 + 79 + for x in fdbbackup fdbcli fdbserver fdbmonitor; do 80 + cp -v "./bin/$x" $out/bin; 81 + done 82 + 83 + ln -sfv $out/bin/fdbbackup $out/bin/dr_agent 84 + ln -sfv $out/bin/fdbbackup $out/bin/fdbrestore 85 + ln -sfv $out/bin/fdbbackup $out/bin/fdbdr 86 + 87 + ln -sfv $out/bin/fdbbackup $out/libexec/backup_agent 88 + ''; 89 + 90 + outputs = [ "out" "lib" "dev" ]; 91 + 92 + meta = with stdenv.lib; { 93 + description = "Open source, distributed, transactional key-value store"; 94 + homepage = https://www.foundationdb.org; 95 + license = licenses.asl20; 96 + platforms = platforms.linux; 97 + maintainers = with maintainers; [ thoughtpolice ]; 98 + }; 99 + }
+42
pkgs/servers/foundationdb/fix-scm-version.patch
···
··· 1 + diff --git a/build/scver.mk b/build/scver.mk 2 + index bdae8be..7539864 100644 3 + --- a/build/scver.mk 4 + +++ b/build/scver.mk 5 + @@ -98,33 +98,10 @@ endif 6 + GITPRESENT := $(wildcard $(FDBDIR)/.git) 7 + HGPRESENT := $(wildcard $(FDBDIR)/.hg) 8 + 9 + -# Use Git, if not missing 10 + -ifneq ($(GITPRESENT),) 11 + - SCVER := $(shell cd "$(FDBDIR)" && git --version 2>/dev/null) 12 + - ifneq ($(SCVER),) 13 + - VERSION_ID := $(shell cd "$(FDBDIR)" && git rev-parse --verify HEAD) 14 + - SOURCE_CONTROL := GIT 15 + - SCBRANCH := $(shell cd "$(FDBDIR)" && git rev-parse --abbrev-ref HEAD) 16 + - else 17 + -$(error Missing git executable on $(PLATFORM) ) 18 + - endif 19 + -# Otherwise, use Mercurial 20 + -else 21 + - # Otherwise, use Mercurial, if not missing 22 + - ifneq ($(HGPRESENT),) 23 + - SCVER := $(shell cd "$(FDBDIR)" && hg --version 2>/dev/null) 24 + - ifdef SCVER 25 + - VERSION_ID := $(shell cd "$(FDBDIR)" && hg id -n) 26 + - SOURCE_CONTROL := MERCURIAL 27 + - SCBRANCH := $(shell cd "$(FDBDIR)" && hg branch) 28 + - else 29 + -$(error Missing hg executable on $(PLATFORM)) 30 + - endif 31 + - else 32 + - FDBFILES := (shell ls -la $(FDBDIR)) 33 + -$(error Missing source control information for source on $(PLATFORM) in directory: $(FDBDIR) with files: $(FDBFILES)) 34 + - endif 35 + -endif 36 + +# NixOS-specific non-VCS packaging, filled out by the nix build 37 + +SOURCE_CONTROL := GIT 38 + +VERSION_ID := @NIXOS_FDB_VERSION_ID@ 39 + +SCBRANCH := @NIXOS_FDB_SCBRANCH@ 40 + 41 + # Set the RELEASE variable based on the KVRELEASE variable. 42 + ifeq ($(KVRELEASE),1)
+90
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 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
+2
pkgs/top-level/all-packages.nix
··· 2409 2410 fuseiso = callPackage ../tools/filesystems/fuseiso { }; 2411 2412 fuse-7z-ng = callPackage ../tools/filesystems/fuse-7z-ng { }; 2413 2414 fwknop = callPackage ../tools/security/fwknop { };
··· 2409 2410 fuseiso = callPackage ../tools/filesystems/fuseiso { }; 2411 2412 + foundationdb = callPackage ../servers/foundationdb { stdenv = overrideCC stdenv gcc49; }; 2413 + 2414 fuse-7z-ng = callPackage ../tools/filesystems/fuse-7z-ng { }; 2415 2416 fwknop = callPackage ../tools/security/fwknop { };