about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/inchi
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-02-16 18:32:21 +0000
committerAlyssa Ross <hi@alyssa.is>2021-02-16 18:32:21 +0000
commit9becdcc5df71b47a5da84ad670e9a7eae9e0c65a (patch)
tree2ddf0335eb393f89501e3753b50c3f7ab0552d12 /nixpkgs/pkgs/development/libraries/inchi
parent49f2a77ac9abc88c253f68952eda26557fc3b555 (diff)
parentff96a0fa5635770390b184ae74debea75c3fd534 (diff)
downloadnixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.gz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.bz2
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.lz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.xz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.zst
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.zip
nixpkgs: merge nixos-unstable
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/inchi')
-rw-r--r--nixpkgs/pkgs/development/libraries/inchi/default.nix26
1 files changed, 22 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/development/libraries/inchi/default.nix b/nixpkgs/pkgs/development/libraries/inchi/default.nix
index 6acdf340c91a..256e0d702434 100644
--- a/nixpkgs/pkgs/development/libraries/inchi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/inchi/default.nix
@@ -1,4 +1,11 @@
-{ pkgs, fetchurl, lib, stdenv, unzip }:
+{ pkgs
+, fetchurl
+, lib
+, stdenv
+, unzip
+, fixDarwinDylibNames
+}:
+
 stdenv.mkDerivation {
   pname = "inchi";
   version = "1.05";
@@ -7,15 +14,23 @@ stdenv.mkDerivation {
     sha1 = "e3872a46d58cb321a98f4fd4b93a989fb6920b9c";
   };
 
-  nativeBuildInputs = [ pkgs.unzip ];
+  nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
   outputs = [ "out" "doc" ];
 
   enableParallelBuilding = true;
 
-  preBuild = ''
+  preConfigure = ''
     cd ./INCHI_API/libinchi/gcc
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace makefile \
+      --replace ",--version-script=libinchi.map" "" \
+      --replace "LINUX_Z_RELRO = ,-z,relro" "" \
+      --replace "-soname" "-install_name" \
+      --replace "gcc" $CC
   '';
   installPhase = ''
+    runHook preInstall
+
     cd ../../..
     mkdir -p $out/lib
     mkdir -p $out/include/inchi
@@ -29,6 +44,10 @@ stdenv.mkDerivation {
     runHook postInstall
   '';
 
+  preFixup = lib.optionalString stdenv.isDarwin ''
+    fixDarwinDylibNames $(find "$out" -name "*.so.*")
+  '';
+
   postInstall =
     let
       src-doc = fetchurl {
@@ -45,7 +64,6 @@ stdenv.mkDerivation {
     homepage = "https://www.inchi-trust.org/";
     description = "IUPAC International Chemical Identifier library";
     license = licenses.lgpl2Plus;
-    platforms = platforms.all;
     maintainers = with maintainers; [ rmcgibbo ];
   };
 }