inchi: 1.05 -> 1.06

This commit is contained in:
Robert T. McGibbon 2021-03-19 16:13:41 -04:00
parent 70ed6f5fee
commit eb7c92cb5e
1 changed files with 56 additions and 51 deletions

View File

@ -1,17 +1,27 @@
{ pkgs
, fetchurl
{ fetchurl
, lib
, stdenv
, unzip
, fixDarwinDylibNames
}:
stdenv.mkDerivation {
let
versionMajor = "1";
versionMinor = "0.6";
version = versionMajor + "." + versionMinor;
removeDots = lib.replaceStrings [ "." ] [ "" ];
src-doc = fetchurl {
url = "http://www.inchi-trust.org/download/${removeDots version}/INCHI-1-DOC.zip";
sha256 = "1kyda09i9p89xfq90ninwi7w13k1w3ljpl4gqdhpfhi5g8fgxx7f";
};
in
stdenv.mkDerivation rec {
pname = "inchi";
version = "1.05";
inherit version;
src = fetchurl {
url = "http://www.inchi-trust.org/download/105/INCHI-1-SRC.zip";
sha1 = "e3872a46d58cb321a98f4fd4b93a989fb6920b9c";
url = "http://www.inchi-trust.org/download/${removeDots version}/INCHI-1-SRC.zip";
sha256 = "1zbygqn0443p0gxwr4kx3m1bkqaj8x9hrpch3s41py7jq08f6x28";
};
nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
@ -28,7 +38,9 @@ stdenv.mkDerivation {
--replace "-soname" "-install_name" \
--replace "gcc" $CC
'';
installPhase = ''
installPhase = let
versionOneDot = versionMajor + "." + removeDots versionMinor;
in ''
runHook preInstall
cd ../../..
@ -36,9 +48,9 @@ stdenv.mkDerivation {
mkdir -p $out/include/inchi
mkdir -p $doc/share/
install -m 755 INCHI_API/bin/Linux/libinchi.so.1.05.00 $out/lib
ln -s $out/lib/libinchi.so.1.05.00 $out/lib/libinchi.so.1
ln -s $out/lib/libinchi.so.1.05.00 $out/lib/libinchi.so
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
runHook postInstall
@ -48,14 +60,7 @@ stdenv.mkDerivation {
fixDarwinDylibNames $(find "$out" -name "*.so.*")
'';
postInstall =
let
src-doc = fetchurl {
url = "http://www.inchi-trust.org/download/105/INCHI-1-DOC.zip";
sha1 = "2f54y0san34v01c215kk0cigzsn76js5";
};
in
''
postInstall = ''
unzip '${src-doc}'
install -m 644 INCHI-1-DOC/*.pdf $doc/share
'';