2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, oracle-instantclient, libaio }:
|
2018-06-01 08:30:55 +00:00
|
|
|
|
2019-08-19 22:17:13 +00:00
|
|
|
let
|
2021-12-07 19:02:26 +00:00
|
|
|
version = "4.3.0";
|
2021-01-21 17:00:13 +00:00
|
|
|
libPath = lib.makeLibraryPath [ oracle-instantclient.lib ];
|
2018-06-01 08:30:55 +00:00
|
|
|
|
2019-08-19 22:17:13 +00:00
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
pname = "odpic";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "oracle";
|
|
|
|
repo = "odpi";
|
|
|
|
rev = "v${version}";
|
2021-12-07 19:02:26 +00:00
|
|
|
sha256 = "sha256-oL2yehjP8JJxU19VY4e/ueh2xjo1yp4X7FGslqCXO8A=";
|
2018-06-01 08:30:55 +00:00
|
|
|
};
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
2018-06-08 00:45:56 +00:00
|
|
|
|
|
|
|
buildInputs = [ oracle-instantclient ]
|
2021-01-21 17:00:13 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ libaio ];
|
2018-06-01 08:30:55 +00:00
|
|
|
|
|
|
|
dontPatchELF = true;
|
2021-02-16 11:48:46 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc"];
|
2018-06-01 08:30:55 +00:00
|
|
|
|
2018-06-07 15:25:49 +00:00
|
|
|
postFixup = ''
|
2021-01-21 17:00:13 +00:00
|
|
|
${lib.optionalString (stdenv.isLinux) ''
|
2019-08-21 00:56:18 +00: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 00:45:56 +00:00
|
|
|
''}
|
2021-01-21 17:00:13 +00:00
|
|
|
${lib.optionalString (stdenv.isDarwin) ''
|
2018-06-08 00:45:56 +00:00
|
|
|
install_name_tool -add_rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
''}
|
|
|
|
'';
|
2018-06-01 08:30:55 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2018-06-01 08:30:55 +00:00
|
|
|
description = "Oracle ODPI-C library";
|
|
|
|
homepage = "https://oracle.github.io/odpi/";
|
2018-06-08 00:45:56 +00:00
|
|
|
maintainers = with maintainers; [ mkazulak flokli ];
|
2018-06-04 21:33:06 +00:00
|
|
|
license = licenses.asl20;
|
2018-06-08 00:45:56 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
2018-06-01 08:30:55 +00:00
|
|
|
hydraPlatforms = [];
|
|
|
|
};
|
|
|
|
}
|