2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fixDarwinDylibNames, oracle-instantclient, libaio }:
|
|
|
|
|
|
|
|
let
|
2020-10-16 20:44:37 +00:00
|
|
|
version = "4.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [ oracle-instantclient.lib ];
|
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
pname = "odpic";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "oracle";
|
|
|
|
repo = "odpi";
|
|
|
|
rev = "v${version}";
|
2020-10-16 20:44:37 +00:00
|
|
|
sha256 = "1g2wdchlwdihqj0ynx58nwyrpncxanghlnykgir97p0wimg3hnxl";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-11-12 09:05:59 +00:00
|
|
|
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ oracle-instantclient ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isLinux [ libaio ];
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
makeFlags = [ "PREFIX=$(out)" "CC=cc" "LD=cc"];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
${stdenv.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}
|
|
|
|
''}
|
|
|
|
${stdenv.lib.optionalString (stdenv.isDarwin) ''
|
|
|
|
install_name_tool -add_rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Oracle ODPI-C library";
|
|
|
|
homepage = "https://oracle.github.io/odpi/";
|
|
|
|
maintainers = with maintainers; [ mkazulak flokli ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
|
|
|
hydraPlatforms = [];
|
|
|
|
};
|
|
|
|
}
|