2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, oracle-instantclient, libaio }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "4.6.0";
|
2021-02-05 17:12:51 +00:00
|
|
|
libPath = lib.makeLibraryPath [ oracle-instantclient.lib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
pname = "odpic";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "oracle";
|
|
|
|
repo = "odpi";
|
|
|
|
rev = "v${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
sha256 = "sha256-hhe6j0qJkRoUIr+FZ4GqGUmI9Yu4Rwxu01f9b4pU5Dc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ oracle-instantclient ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ libaio ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontPatchELF = true;
|
2021-02-19 19:06:45 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc"];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postFixup = ''
|
2021-02-05 17:12:51 +00:00
|
|
|
${lib.optionalString (stdenv.isLinux) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary})" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
''}
|
2021-02-05 17:12:51 +00:00
|
|
|
${lib.optionalString (stdenv.isDarwin) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
install_name_tool -add_rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Oracle ODPI-C library";
|
|
|
|
homepage = "https://oracle.github.io/odpi/";
|
|
|
|
maintainers = with maintainers; [ mkazulak flokli ];
|
|
|
|
license = licenses.asl20;
|
2022-10-21 18:38:19 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
hydraPlatforms = [];
|
|
|
|
};
|
|
|
|
}
|