From 175d1a0151e039a2124e9b3520c7922322659f56 Mon Sep 17 00:00:00 2001 From: David Elsing Date: Thu, 13 Oct 2022 21:04:23 +0000 Subject: gnu: Add ringdecomposerlib. * gnu/packages/chemistry.scm (ringdecomposerlib): New variable. Signed-off-by: Liliana Marie Prikler --- gnu/packages/chemistry.scm | 80 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'gnu/packages/chemistry.scm') diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index c13890001f..da65c90152 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -999,3 +999,83 @@ (define-public avalon-toolkit canonicalization of SMILES and MOL files, molecular structure fingerprinting and rendering molecules.") (license license:bsd-3))) + +(define-public ringdecomposerlib + (package + (name "ringdecomposerlib") + (version "1.1.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/rareylab/RingDecomposerLib") + (commit (string-append "v" version "_rdkit")))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1rxzs2wpkkdi40wdzxc4sn0brk7dm7ivgqyfh38gf2f5c7pbg0wi")))) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags + #~(list "-DBUILD_PYTHON_WRAPPER=ON" + "-DPYTHON_EXECUTABLE=python3" + (string-append "-DPYTHON_FLAGS=;--prefix=" #$output ";--root=/")) + #:imported-modules (append %cmake-build-system-modules + '((guix build python-build-system))) + #:modules '((guix build cmake-build-system) + (guix build utils) + ((guix build python-build-system) + #:select (add-installed-pythonpath))) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'patch-cmake + (lambda _ + (substitute* (list "src/Test/CMakeLists.txt" + "src/RingDecomposerLib/CMakeLists.txt") + (("build_.*STATIC") "#")) + (substitute* "test/CMakeLists.txt" + (("STATIC_TEST") "SHARED_TEST")) + ;; Link Python library against shared library + (substitute* "src/python/CMakeLists.txt" + (("RingDecomposerLibStatic") "RingDecomposerLib")) + (substitute* "src/python/setup.py.in" + (("static_libs =.*") "static_libs = []\n") + (("shared_libs\\s*=.*") + (string-append + "shared_libs = ['RingDecomposerLib']")) + (("library_dirs\\s*=\\s*\\[\\]") + "library_dirs = ['${CMAKE_BINARY_DIR}/src/RingDecomposerLib']") + (("extra_objects=.*") + (string-append + "extra_link_args=['-Wl,-rpath=" #$output "/lib'],\n"))))) + (add-after 'build 'build-doc + (lambda _ + ;; Disable redundant LaTeX documentation + (substitute* "../source/documentation/sphinx/conf.py" + (("^(subprocess.*latex|shutil).*") "")) + (substitute* "../source/documentation/doxygen.cfg" + (("GENERATE_LATEX.*YES") "GENERATE_LATEX = NO")) + ;; Build HTML documentation + (invoke "sphinx-build" "-b" "html" + "../source/documentation/sphinx" "html"))) + (add-after 'install 'install-doc + (lambda _ + ;; Not reproducible + (delete-file-recursively "html/.doctrees") + (copy-recursively "html" + (string-append #$output "/share/doc/" + #$name "-" #$version "/html")))) + (delete 'check) + (add-after 'install 'check + (assoc-ref %standard-phases 'check)) + (add-before 'check 'set-pythonpath + (lambda* (#:key inputs outputs #:allow-other-keys) + (add-installed-pythonpath inputs outputs)))))) + (inputs (list python)) + (native-inputs (list doxygen python python-cython python-sphinx)) + (home-page "https://github.com/rareylab/RingDecomposerLib") + (synopsis "Calculate ring topology descriptions") + (description "RingDecomposerLib is a library for the calculation of +unique ring families, relevant cycles, the smallest set of smallest rings and +other ring topology descriptions.") + (license license:bsd-3))) -- cgit v1.2.3