2019-08-19 23:17:13 +01:00
|
|
|
{ stdenv, fetchFromGitHub, fixDarwinDylibNames, oracle-instantclient, libaio }:
|
2018-06-01 09:30:55 +01:00
|
|
|
|
2019-08-19 23:17:13 +01:00
|
|
|
let
|
2020-10-02 13:27:20 +01:00
|
|
|
version = "4.0.2";
|
2019-08-19 23:17:13 +01:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [ oracle-instantclient.lib ];
|
2018-06-01 09:30:55 +01:00
|
|
|
|
2019-08-19 23:17:13 +01:00
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
pname = "odpic";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "oracle";
|
|
|
|
repo = "odpi";
|
|
|
|
rev = "v${version}";
|
2020-10-02 13:27:20 +01:00
|
|
|
sha256 = "1g2wdchlwdihqj0ynx58nwyrpncxanghlnykgir97p0wimg3hnxl";
|
2018-06-01 09:30:55 +01:00
|
|
|
};
|
|
|
|
|
2020-10-26 07:17:14 +00:00
|
|
|
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
2018-06-08 01:45:56 +01:00
|
|
|
|
|
|
|
buildInputs = [ oracle-instantclient ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isLinux [ libaio ];
|
2018-06-01 09:30:55 +01:00
|
|
|
|
|
|
|
dontPatchELF = true;
|
2018-06-08 01:45:56 +01:00
|
|
|
makeFlags = [ "PREFIX=$(out)" "CC=cc" "LD=cc"];
|
2018-06-01 09:30:55 +01:00
|
|
|
|
2018-06-07 16:25:49 +01:00
|
|
|
postFixup = ''
|
2018-06-08 01:45:56 +01:00
|
|
|
${stdenv.lib.optionalString (stdenv.isLinux) ''
|
2019-08-21 01:56:18 +01:00
|
|
|
patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary})" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
|
2018-06-08 01:45:56 +01:00
|
|
|
''}
|
|
|
|
${stdenv.lib.optionalString (stdenv.isDarwin) ''
|
|
|
|
install_name_tool -add_rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
''}
|
|
|
|
'';
|
2018-06-01 09:30:55 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Oracle ODPI-C library";
|
|
|
|
homepage = "https://oracle.github.io/odpi/";
|
2018-06-08 01:45:56 +01:00
|
|
|
maintainers = with maintainers; [ mkazulak flokli ];
|
2018-06-04 22:33:06 +01:00
|
|
|
license = licenses.asl20;
|
2018-06-08 01:45:56 +01:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
2018-06-01 09:30:55 +01:00
|
|
|
hydraPlatforms = [];
|
|
|
|
};
|
|
|
|
}
|