about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/odpic
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/odpic')
-rw-r--r--nixpkgs/pkgs/development/libraries/odpic/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/odpic/default.nix b/nixpkgs/pkgs/development/libraries/odpic/default.nix
new file mode 100644
index 000000000000..89502e6c3eb7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/odpic/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, oracle-instantclient, libaio }:
+
+let
+  version = "5.1.0";
+  libPath = lib.makeLibraryPath [ oracle-instantclient.lib ];
+
+in
+stdenv.mkDerivation {
+  inherit version;
+
+  pname = "odpic";
+
+  src = fetchFromGitHub {
+    owner = "oracle";
+    repo = "odpi";
+    rev = "v${version}";
+    sha256 = "sha256-J7v6nNwAXy0j2mXc9RcO/V54WutA9TvTGUubHkpNBWo=";
+  };
+
+  nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  buildInputs = [ oracle-instantclient ]
+    ++ lib.optionals stdenv.isLinux [ libaio ];
+
+  dontPatchELF = true;
+  makeFlags = [ "PREFIX=$(out)" "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc" ];
+
+  postFixup = ''
+    ${lib.optionalString (stdenv.isLinux) ''
+      patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary})" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
+    ''}
+    ${lib.optionalString (stdenv.isDarwin) ''
+      install_name_tool -add_rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
+    ''}
+  '';
+
+  meta = with lib; {
+    description = "Oracle ODPI-C library";
+    homepage = "https://oracle.github.io/odpi/";
+    maintainers = with maintainers; [ mkazulak ];
+    license = licenses.asl20;
+    platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
+    hydraPlatforms = [ ];
+  };
+}