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-04-09 18:28:16 +0000
committerAlyssa Ross <hi@alyssa.is>2021-04-12 18:46:15 +0000
commitfd2e737e0678ee7d8081baef05b305146a2c0034 (patch)
treeac3e9b27576a0382335532d126f9a66d486bc638 /nixpkgs/pkgs/development/libraries/inchi
parentcc207d720b6aa836e256c1ee9842bc739e630a8a (diff)
parent9e377a6ce42dccd9b624ae4ce8f978dc892ba0e2 (diff)
downloadnixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.gz
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.bz2
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.lz
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.xz
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.zst
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.zip
Merge remote-tracking branch 'nixpkgs/nixos-unstable'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/inchi')
-rw-r--r--nixpkgs/pkgs/development/libraries/inchi/default.nix107
1 files changed, 56 insertions, 51 deletions
diff --git a/nixpkgs/pkgs/development/libraries/inchi/default.nix b/nixpkgs/pkgs/development/libraries/inchi/default.nix
index 256e0d702434..f74cfdec9305 100644
--- a/nixpkgs/pkgs/development/libraries/inchi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/inchi/default.nix
@@ -1,69 +1,74 @@
-{ pkgs
-, fetchurl
+{ fetchurl
 , lib
 , stdenv
 , unzip
 , fixDarwinDylibNames
 }:
 
-stdenv.mkDerivation {
-  pname = "inchi";
-  version = "1.05";
-  src = fetchurl {
-    url = "http://www.inchi-trust.org/download/105/INCHI-1-SRC.zip";
-    sha1 = "e3872a46d58cb321a98f4fd4b93a989fb6920b9c";
-  };
+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";
+    inherit version;
 
-  nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
-  outputs = [ "out" "doc" ];
+    src = fetchurl {
+      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 = ''
-    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
+    enableParallelBuilding = true;
 
-    cd ../../..
-    mkdir -p $out/lib
-    mkdir -p $out/include/inchi
-    mkdir -p $doc/share/
+    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 = let
+      versionOneDot = versionMajor + "." + removeDots versionMinor;
+    in ''
+      runHook preInstall
+
+      cd ../../..
+      mkdir -p $out/lib
+      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 644 INCHI_BASE/src/*.h $out/include/inchi
+      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
-  '';
+      runHook postInstall
+    '';
 
-  preFixup = lib.optionalString stdenv.isDarwin ''
-    fixDarwinDylibNames $(find "$out" -name "*.so.*")
-  '';
+    preFixup = lib.optionalString stdenv.isDarwin ''
+      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
     '';
 
-  meta = with lib; {
-    homepage = "https://www.inchi-trust.org/";
-    description = "IUPAC International Chemical Identifier library";
-    license = licenses.lgpl2Plus;
-    maintainers = with maintainers; [ rmcgibbo ];
-  };
-}
+    meta = with lib; {
+      homepage = "https://www.inchi-trust.org/";
+      description = "IUPAC International Chemical Identifier library";
+      license = licenses.lgpl2Plus;
+      maintainers = with maintainers; [ rmcgibbo ];
+    };
+  }