aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/odpic/default.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2018-06-08 02:45:56 +0200
committerMaciej Kazulak <kazulakm@gmail.com>2018-06-09 19:00:09 +0200
commitf4434bef8bb2e4c27b998bd05a233f3be05b1a88 (patch)
treebebec4fae8d471e56a59a71f4fe09e185205f0a7 /pkgs/development/libraries/odpic/default.nix
parenta757aff8393a75e3d0235db61805618f9c9df6b9 (diff)
odpic: enable on darwin
Diffstat (limited to 'pkgs/development/libraries/odpic/default.nix')
-rw-r--r--pkgs/development/libraries/odpic/default.nix27
1 files changed, 20 insertions, 7 deletions
diff --git a/pkgs/development/libraries/odpic/default.nix b/pkgs/development/libraries/odpic/default.nix
index 10a36b03d8db..07edc24ecabc 100644
--- a/pkgs/development/libraries/odpic/default.nix
+++ b/pkgs/development/libraries/odpic/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libaio, oracle-instantclient }:
+{ stdenv, fetchurl, fetchpatch, fixDarwinDylibNames, oracle-instantclient, libaio }:
stdenv.mkDerivation rec {
name = "odpic-${version}";
@@ -9,24 +9,37 @@ stdenv.mkDerivation rec {
sha256 = "1z793mg8hmy067xhllip7ca84xy07ca1cqilnr35mbvhmydp03zz";
};
- buildInputs = [ libaio oracle-instantclient ];
+ patches = [ (fetchpatch {
+ url = https://github.com/oracle/odpi/commit/31fdd70c06be711840a2668f572c7ee7c4434d18.patch;
+ sha256 = "1f00zp4w7l4vnkg0fmvnkga20ih8kjd5bxvr1nryziibjh1xp41j";
+ }) ];
+
+ nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin [ fixDarwinDylibNames ];
+
+ buildInputs = [ oracle-instantclient ]
+ ++ stdenv.lib.optionals stdenv.isLinux [ libaio ];
libPath = stdenv.lib.makeLibraryPath
[ oracle-instantclient ];
dontPatchELF = true;
- makeFlags = [ "PREFIX=$(out)" ];
+ makeFlags = [ "PREFIX=$(out)" "CC=cc" "LD=cc"];
postFixup = ''
- patchelf --set-rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
- '';
+ ${stdenv.lib.optionalString (stdenv.isLinux) ''
+ patchelf --set-rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
+ ''}
+ ${stdenv.lib.optionalString (stdenv.isDarwin) ''
+ install_name_tool -add_rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
+ ''}
+ '';
meta = with stdenv.lib; {
description = "Oracle ODPI-C library";
homepage = "https://oracle.github.io/odpi/";
- maintainers = with maintainers; [ mkazulak ];
+ maintainers = with maintainers; [ mkazulak flokli ];
license = licenses.asl20;
- platforms = [ "x86_64-linux" ];
+ platforms = [ "x86_64-linux" "x86_64-darwin" ];
hydraPlatforms = [];
};
}