1 { lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, oracle-instantclient, libaio }:
5 libPath = lib.makeLibraryPath [ oracle-instantclient.lib ];
7 in stdenv.mkDerivation {
12 src = fetchFromGitHub {
16 sha256 = "1zk08z74q7njbj329xfy8aszphj27rqlkhsyglai60wfzl6mcf4x";
19 nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
21 buildInputs = [ oracle-instantclient ]
22 ++ lib.optionals stdenv.isLinux [ libaio ];
25 makeFlags = [ "PREFIX=$(out)" "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc"];
28 ${lib.optionalString (stdenv.isLinux) ''
29 patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary})" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
31 ${lib.optionalString (stdenv.isDarwin) ''
32 install_name_tool -add_rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
37 description = "Oracle ODPI-C library";
38 homepage = "https://oracle.github.io/odpi/";
39 maintainers = with maintainers; [ mkazulak flokli ];
40 license = licenses.asl20;
41 platforms = [ "x86_64-linux" "x86_64-darwin" ];