3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #116963 from rmcgibbo/inchi-106

inchi: 1.05 -> 1.06
This commit is contained in:
Sandro 2021-03-20 03:29:11 +01:00 committed by GitHub
commit 20cb1fc781
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,69 +1,74 @@
{ pkgs { fetchurl
, fetchurl
, lib , lib
, stdenv , stdenv
, unzip , unzip
, fixDarwinDylibNames , fixDarwinDylibNames
}: }:
stdenv.mkDerivation { let
pname = "inchi"; versionMajor = "1";
version = "1.05"; versionMinor = "0.6";
src = fetchurl { version = versionMajor + "." + versionMinor;
url = "http://www.inchi-trust.org/download/105/INCHI-1-SRC.zip"; removeDots = lib.replaceStrings [ "." ] [ "" ];
sha1 = "e3872a46d58cb321a98f4fd4b93a989fb6920b9c"; src-doc = fetchurl {
}; url = "http://www.inchi-trust.org/download/${removeDots version}/INCHI-1-DOC.zip";
sha256 = "1kyda09i9p89xfq90ninwi7w13k1w3ljpl4gqdhpfhi5g8fgxx7f";
};
in
stdenv.mkDerivation rec {
pname = "inchi";
inherit version;
nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; src = fetchurl {
outputs = [ "out" "doc" ]; url = "http://www.inchi-trust.org/download/${removeDots version}/INCHI-1-SRC.zip";
sha256 = "1zbygqn0443p0gxwr4kx3m1bkqaj8x9hrpch3s41py7jq08f6x28";
};
enableParallelBuilding = true; nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
outputs = [ "out" "doc" ];
preConfigure = '' enableParallelBuilding = true;
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 ../../.. preConfigure = ''
mkdir -p $out/lib cd ./INCHI_API/libinchi/gcc
mkdir -p $out/include/inchi '' + lib.optionalString stdenv.isDarwin ''
mkdir -p $doc/share/ substituteInPlace makefile \
--replace ",--version-script=libinchi.map" "" \
--replace "LINUX_Z_RELRO = ,-z,relro" "" \
--replace "-soname" "-install_name" \
--replace "gcc" $CC
'';
installPhase = let
versionOneDot = versionMajor + "." + removeDots versionMinor;
in ''
runHook preInstall
install -m 755 INCHI_API/bin/Linux/libinchi.so.1.05.00 $out/lib cd ../../..
ln -s $out/lib/libinchi.so.1.05.00 $out/lib/libinchi.so.1 mkdir -p $out/lib
ln -s $out/lib/libinchi.so.1.05.00 $out/lib/libinchi.so mkdir -p $out/include/inchi
install -m 644 INCHI_BASE/src/*.h $out/include/inchi mkdir -p $doc/share/
runHook postInstall install -m 755 INCHI_API/bin/Linux/libinchi.so.${versionOneDot}.00 $out/lib
''; ln -s $out/lib/libinchi.so.${versionOneDot}.00 $out/lib/libinchi.so.1
ln -s $out/lib/libinchi.so.${versionOneDot}.00 $out/lib/libinchi.so
install -m 644 INCHI_BASE/src/*.h $out/include/inchi
preFixup = lib.optionalString stdenv.isDarwin '' runHook postInstall
fixDarwinDylibNames $(find "$out" -name "*.so.*") '';
'';
postInstall = preFixup = lib.optionalString stdenv.isDarwin ''
let fixDarwinDylibNames $(find "$out" -name "*.so.*")
src-doc = fetchurl { '';
url = "http://www.inchi-trust.org/download/105/INCHI-1-DOC.zip";
sha1 = "2f54y0san34v01c215kk0cigzsn76js5"; postInstall = ''
};
in
''
unzip '${src-doc}' unzip '${src-doc}'
install -m 644 INCHI-1-DOC/*.pdf $doc/share install -m 644 INCHI-1-DOC/*.pdf $doc/share
''; '';
meta = with lib; { meta = with lib; {
homepage = "https://www.inchi-trust.org/"; homepage = "https://www.inchi-trust.org/";
description = "IUPAC International Chemical Identifier library"; description = "IUPAC International Chemical Identifier library";
license = licenses.lgpl2Plus; license = licenses.lgpl2Plus;
maintainers = with maintainers; [ rmcgibbo ]; maintainers = with maintainers; [ rmcgibbo ];
}; };
} }