depot/third_party/nixpkgs/pkgs/development/libraries/odpic/default.nix
Default email b6f2ab0a42 Project import generated by Copybara.
GitOrigin-RevId: 253aecf69ed7595aaefabde779aa6449195bebb7
2021-08-18 15:19:15 +02:00

44 lines
1.4 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, oracle-instantclient, libaio }:
let
version = "4.2.1";
libPath = lib.makeLibraryPath [ oracle-instantclient.lib ];
in stdenv.mkDerivation {
inherit version;
pname = "odpic";
src = fetchFromGitHub {
owner = "oracle";
repo = "odpi";
rev = "v${version}";
sha256 = "sha256-jdDMG6+bvsKQkHSpUrwtwU/ngq1iINcUhWu2b9lJgPY=";
};
nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ oracle-instantclient ]
++ lib.optionals stdenv.isLinux [ libaio ];
dontPatchELF = true;
makeFlags = [ "PREFIX=$(out)" "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc"];
postFixup = ''
${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}
''}
${lib.optionalString (stdenv.isDarwin) ''
install_name_tool -add_rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
''}
'';
meta = with 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 = [];
};
}