lol

inchi: fix build on darwin

+22 -4
+22 -4
pkgs/development/libraries/inchi/default.nix
··· 1 - { pkgs, fetchurl, lib, stdenv, unzip }: 1 + { pkgs 2 + , fetchurl 3 + , lib 4 + , stdenv 5 + , unzip 6 + , fixDarwinDylibNames 7 + }: 8 + 2 9 stdenv.mkDerivation { 3 10 pname = "inchi"; 4 11 version = "1.05"; ··· 7 14 sha1 = "e3872a46d58cb321a98f4fd4b93a989fb6920b9c"; 8 15 }; 9 16 10 - nativeBuildInputs = [ pkgs.unzip ]; 17 + nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 11 18 outputs = [ "out" "doc" ]; 12 19 13 20 enableParallelBuilding = true; 14 21 15 - preBuild = '' 22 + preConfigure = '' 16 23 cd ./INCHI_API/libinchi/gcc 24 + '' + lib.optionalString stdenv.isDarwin '' 25 + substituteInPlace makefile \ 26 + --replace ",--version-script=libinchi.map" "" \ 27 + --replace "LINUX_Z_RELRO = ,-z,relro" "" \ 28 + --replace "-soname" "-install_name" \ 29 + --replace "gcc" $CC 17 30 ''; 18 31 installPhase = '' 32 + runHook preInstall 33 + 19 34 cd ../../.. 20 35 mkdir -p $out/lib 21 36 mkdir -p $out/include/inchi ··· 27 42 install -m 644 INCHI_BASE/src/*.h $out/include/inchi 28 43 29 44 runHook postInstall 45 + ''; 46 + 47 + preFixup = lib.optionalString stdenv.isDarwin '' 48 + fixDarwinDylibNames $(find "$out" -name "*.so.*") 30 49 ''; 31 50 32 51 postInstall = ··· 45 64 homepage = "https://www.inchi-trust.org/"; 46 65 description = "IUPAC International Chemical Identifier library"; 47 66 license = licenses.lgpl2Plus; 48 - platforms = platforms.all; 49 67 maintainers = with maintainers; [ rmcgibbo ]; 50 68 }; 51 69 }