11 version = versionMajor + "." + versionMinor;
12 removeDots = lib.replaceStrings [ "." ] [ "" ];
14 url = "http://www.inchi-trust.org/download/${removeDots version}/INCHI-1-DOC.zip";
15 sha256 = "1kyda09i9p89xfq90ninwi7w13k1w3ljpl4gqdhpfhi5g8fgxx7f";
18 stdenv.mkDerivation rec {
23 url = "http://www.inchi-trust.org/download/${removeDots version}/INCHI-1-SRC.zip";
24 sha256 = "1zbygqn0443p0gxwr4kx3m1bkqaj8x9hrpch3s41py7jq08f6x28";
27 nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
28 outputs = [ "out" "doc" ];
30 enableParallelBuilding = true;
33 cd ./INCHI_API/libinchi/gcc
34 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
35 substituteInPlace makefile \
36 --replace ",--version-script=libinchi.map" "" \
37 --replace "LINUX_Z_RELRO = ,-z,relro" "" \
38 --replace "-soname" "-install_name" \
42 versionOneDot = versionMajor + "." + removeDots versionMinor;
48 mkdir -p $out/include/inchi
51 install -m 755 INCHI_API/bin/Linux/libinchi.so.${versionOneDot}.00 $out/lib
52 ln -s $out/lib/libinchi.so.${versionOneDot}.00 $out/lib/libinchi.so.1
53 ln -s $out/lib/libinchi.so.${versionOneDot}.00 $out/lib/libinchi.so
54 install -m 644 INCHI_BASE/src/*.h $out/include/inchi
59 preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
60 fixDarwinDylibNames $(find "$out" -name "*.so.*")
65 install -m 644 INCHI-1-DOC/*.pdf $doc/share
69 homepage = "https://www.inchi-trust.org/";
70 description = "IUPAC International Chemical Identifier library";
71 license = licenses.lgpl2Plus;
72 maintainers = with maintainers; [ rmcgibbo ];