[bug#77394,1/5] gnu: inchi: Update to 1.07.3.
Commit Message
* gnu/packages/chemistry.scm (inchi): Update to 1.07.3.
[source]: Switch to git-fetch.
[arguments]: Use gexps. Adjust chdir-to-build-directory, build and install
phases. Enable parallel building.
[native-inputs]: Remove input label.
[license]: Change to Expat license.
---
gnu/packages/chemistry.scm | 122 ++++++++++++++++++-------------------
1 file changed, 59 insertions(+), 63 deletions(-)
Comments
Hello David,
thanks for the patches!
Am Sun, Mar 30, 2025 at 10:06:54PM +0000 schrieb David Elsing:
> [native-inputs]: Remove input label.
> ;; Update the inchi-doc native input when updating inchi.
> - (native-inputs
> - `(("unzip" ,unzip)
> - ("inchi-doc"
> - ,(origin
> - (method url-fetch)
> - (uri (string-append "http://www.inchi-trust.org/download/"
> - (string-join (string-split version #\.) "")
> - "/INCHI-1-DOC.zip"))
> - (sha256
> - (base32
> - "1kyda09i9p89xfq90ninwi7w13k1w3ljpl4gqdhpfhi5g8fgxx7f"))
> - (file-name (string-append name "-" version ".zip"))))))
> + (native-inputs (list unzip))
You also dropped the documentation native input. Is that intended?
Andreas
I have pushed your patches 2 and 4.
Concerning boost with numpy, I am not sure; should we add numpy
directly to boost as an input? This might actually create a circular
dependency (I have not checked). In any case, both are monster packages,
so replacing boost by a combination of the two may be a bad idea, and
your suggestion to create a separate boost-with-numpy is preferable.
I am cc-ing the science and C++ teams for their opinion.
Andreas
Hello,
Andreas Enge <andreas@enge.fr> writes:
> You also dropped the documentation native input. Is that intended?
Yes, it is included in the Git repo, but I forgot to mention it in the
commit message. I also forgot to update the copyright header. :)
Can you add them or should I send an updated patch?
Thank you,
David
Hello Andreas,
Andreas Enge <andreas@enge.fr> writes:
> I have pushed your patches 2 and 4.
Thanks!
> Concerning boost with numpy, I am not sure; should we add numpy
> directly to boost as an input? This might actually create a circular
> dependency (I have not checked). In any case, both are monster packages,
> so replacing boost by a combination of the two may be a bad idea, and
> your suggestion to create a separate boost-with-numpy is preferable.
I just checked and there does not seem to be a circular dependency.
However, boost has *much* less transitive dependencies than python-numpy
and is depended on by many packages. Its build time and compressed size
(~20 MB) is also not that large, so I think a separate package is not
that bad.
Cheers,
David
@@ -146,68 +146,66 @@ (define-public inchi
(package
(name "inchi")
;; Update the inchi-doc native input when updating inchi.
- (version "1.06")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://www.inchi-trust.org/download/"
- (string-join (string-split version #\.) "")
- "/INCHI-1-SRC.zip"))
- (sha256
- (base32
- "1zbygqn0443p0gxwr4kx3m1bkqaj8x9hrpch3s41py7jq08f6x28"))
- (file-name (string-append name "-" version ".zip"))))
+ (version "1.07.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/IUPAC-InChI/InChI")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0r32f6i5d8ir96ic3nvqb5lywxrznwrkk6hnz1q0a4bgsw5pmk0n"))
+ (modules '((guix build utils)))
+ (snippet '(delete-file-recursively "INCHI-1-BIN"))))
(build-system gnu-build-system)
(arguments
- '(#:tests? #f ; no check target
- #:phases
- (modify-phases %standard-phases
- (delete 'configure) ; no configure script
- (add-before 'build 'chdir-to-build-directory
- (lambda _ (chdir "INCHI_EXE/inchi-1/gcc") #t))
- (add-after 'build 'build-library
- (lambda _
- (chdir "../../../INCHI_API/libinchi/gcc")
- (invoke "make")))
- (replace 'install
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (bin (string-append out "/bin"))
- (doc (string-append out "/share/doc/inchi"))
- (include-dir (string-append out "/include/inchi"))
- (lib (string-append out "/lib/inchi"))
- (inchi-doc (assoc-ref inputs "inchi-doc"))
- (unzip (search-input-file inputs "/bin/unzip")))
- (chdir "../../..")
- ;; Install binary.
- (with-directory-excursion "INCHI_EXE/bin/Linux"
- (rename-file "inchi-1" "inchi")
- (install-file "inchi" bin))
- ;; Install libraries.
- (with-directory-excursion "INCHI_API/bin/Linux"
- (for-each (lambda (file)
- (install-file file lib))
- (find-files "." "libinchi\\.so\\.1\\.*")))
- ;; Install header files.
- (with-directory-excursion "INCHI_BASE/src"
- (for-each (lambda (file)
- (install-file file include-dir))
- (find-files "." "\\.h$")))
- ;; Install documentation.
- (mkdir-p doc)
- (invoke unzip "-j" "-d" doc inchi-doc)
- #t))))))
- (native-inputs
- `(("unzip" ,unzip)
- ("inchi-doc"
- ,(origin
- (method url-fetch)
- (uri (string-append "http://www.inchi-trust.org/download/"
- (string-join (string-split version #\.) "")
- "/INCHI-1-DOC.zip"))
- (sha256
- (base32
- "1kyda09i9p89xfq90ninwi7w13k1w3ljpl4gqdhpfhi5g8fgxx7f"))
- (file-name (string-append name "-" version ".zip"))))))
+ (list
+ #:tests? #f ; no check target
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure) ; no configure script
+ (add-after 'unpack 'chdir-to-build-directory
+ (lambda _ (chdir "INCHI-1-SRC/INCHI_EXE/inchi-1/gcc")))
+ (add-after 'build 'build-library
+ (lambda* (#:key parallel-build? #:allow-other-keys)
+ (chdir "../../../INCHI_API/libinchi/gcc")
+ (invoke "make" "-j" (if parallel-build?
+ (number->string (parallel-job-count))
+ "1"))))
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((bin (string-append #$output "/bin"))
+ (doc (string-append #$output "/share/doc/inchi"))
+ (include-dir (string-append #$output "/include/inchi"))
+ (lib (string-append #$output "/lib/inchi")))
+ (chdir "../../..")
+ ;; Install binary.
+ (with-directory-excursion "INCHI_EXE/bin/Linux"
+ (rename-file "inchi-1" "inchi")
+ (install-file "inchi" bin))
+ ;; Install library.
+ (with-directory-excursion "INCHI_API/bin/Linux"
+ (let ((libname (basename
+ (car
+ (find-files "." "libinchi\\.so\\.1\\.*")))))
+ (install-file libname lib)
+ (with-directory-excursion lib
+ (symlink libname "libinchi.so.1")
+ (symlink "libinchi.so.1" "libinchi.so"))))
+ ;; Install header files.
+ (with-directory-excursion "INCHI_BASE/src"
+ (for-each (lambda (file)
+ (install-file file include-dir))
+ (find-files "." "\\.h$")))
+ ;; Install documentation.
+ (with-directory-excursion "../INCHI-1-DOC"
+ (for-each
+ (lambda (file)
+ (install-file file doc))
+ (find-files "." "\\.pdf$")))))))))
+ (native-inputs (list unzip))
(home-page "https://www.inchi-trust.org")
(synopsis "Utility for manipulating machine-readable chemical structures")
(description
@@ -216,9 +214,7 @@ (define-public inchi
unique to the compound they describe and can encode absolute stereochemistry
making chemicals and chemistry machine-readable and discoverable. A simple
analogy is that InChI is the bar-code for chemistry and chemical structures.")
- (license (license:non-copyleft
- "file://LICENCE"
- "See LICENCE in the distribution."))))
+ (license license:expat)))
(define-public libmsym
(package