From aa79ae0c6425fa673401e845493c99e717ad4a69 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Sat, 4 Aug 2018 16:15:20 -0500 Subject: [PATCH] foundationdb: install python bindings Signed-off-by: Austin Seipp --- .../modules/services/databases/foundationdb.xml | 1 - pkgs/servers/foundationdb/default.nix | 17 ++++++++++++++--- pkgs/top-level/python-packages.nix | 12 ++++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/databases/foundationdb.xml b/nixos/modules/services/databases/foundationdb.xml index 51fe9ae3f910..1f60470aa3f8 100644 --- a/nixos/modules/services/databases/foundationdb.xml +++ b/nixos/modules/services/databases/foundationdb.xml @@ -295,7 +295,6 @@ only undergone fairly basic testing of all the available functionality. individual fdbserver processes. Currently, all server processes inherit all the global fdbmonitor settings. - Python bindings are not currently installed. Ruby bindings are not currently installed. Go bindings are not currently installed. diff --git a/pkgs/servers/foundationdb/default.nix b/pkgs/servers/foundationdb/default.nix index 200489fda982..265255c2f78a 100644 --- a/pkgs/servers/foundationdb/default.nix +++ b/pkgs/servers/foundationdb/default.nix @@ -88,7 +88,7 @@ let separateDebugInfo = true; enableParallelBuilding = true; - makeFlags = [ "all" "fdb_java" ] + makeFlags = [ "all" "fdb_java" "fdb_python" ] # Don't compile FDBLibTLS if we don't need it in 6.0 or later; # it gets statically linked in ++ lib.optional (!lib.versionAtLeast version "6.0") [ "fdb_c" ] @@ -106,17 +106,28 @@ let installPhase = '' mkdir -vp $out/{bin,libexec/plugins} $lib/{lib,share/java} $dev/include/foundationdb + mkdir -vp $python/lib/${python.libPrefix}/site-packages - cp -v ./lib/libfdb_c.so $lib/lib '' + lib.optionalString (!lib.versionAtLeast version "6.0") '' + # we only copy the TLS library on < 6.0, since it's compiled-in otherwise cp -v ./lib/libFDBLibTLS.so $out/libexec/plugins/FDBLibTLS.so '' + '' + # C API + cp -v ./lib/libfdb_c.so $lib/lib cp -v ./bindings/c/foundationdb/fdb_c.h $dev/include/foundationdb cp -v ./bindings/c/foundationdb/fdb_c_options.g.h $dev/include/foundationdb + # java cp -v ./bindings/java/foundationdb-client.jar $lib/share/java/fdb-java.jar + # python + rm -f ./bindings/python/fdb/*.pth # remove useless files + cp -R ./bindings/python/fdb $python/lib/${python.libPrefix}/site-packages/fdb + # symlink a copy of the shared object into place, so that impl.py can load it + ln -sv $lib/lib/libfdb_c.so $python/lib/${python.libPrefix}/site-packages/fdb/libfdb_c.so + + # binaries for x in fdbbackup fdbcli fdbserver fdbmonitor; do cp -v "./bin/$x" $out/bin; done @@ -128,7 +139,7 @@ let ln -sfv $out/bin/fdbbackup $out/libexec/backup_agent ''; - outputs = [ "out" "lib" "dev" ]; + outputs = [ "out" "lib" "dev" "python" ]; meta = with stdenv.lib; { description = "Open source, distributed, transactional key-value store"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e68c11028ef8..4913e533f29b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17554,6 +17554,18 @@ EOF })).python; rfc7464 = callPackage ../development/python-modules/rfc7464 { }; + + foundationdb51 = (toPythonModule (pkgs.fdbPackages.override { + inherit python; + }).foundationdb51).python; + + foundationdb52 = (toPythonModule (pkgs.fdbPackages.override { + inherit python; + }).foundationdb52).python; + + foundationdb60 = (toPythonModule (pkgs.fdbPackages.override { + inherit python; + }).foundationdb60).python; }); in fix' (extends overrides packages)