gnu: libx11: Replace with 1.6.6 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / chemistry.scm
CommitLineData
73114e30
KH
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
a49eb85c 3;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
73114e30
KH
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages chemistry)
21 #:use-module (guix packages)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix download)
0c468cb5 24 #:use-module (gnu packages)
348edd91 25 #:use-module (gnu packages algebra)
a49eb85c 26 #:use-module (gnu packages compression)
f250a868
KH
27 #:use-module (gnu packages gv)
28 #:use-module (gnu packages maths)
348edd91 29 #:use-module (gnu packages pkg-config)
73114e30 30 #:use-module (gnu packages python)
348edd91
KK
31 #:use-module (gnu packages xml)
32 #:use-module (guix build-system cmake)
a49eb85c 33 #:use-module (guix build-system gnu)
73114e30
KH
34 #:use-module (guix build-system python))
35
36(define-public domainfinder
37 (package
38 (name "domainfinder")
39 (version "2.0.5")
40 (source
41 (origin
42 (method url-fetch)
43 (uri (string-append "https://bitbucket.org/khinsen/"
44 "domainfinder/downloads/DomainFinder-"
45 version ".tar.gz"))
46 (sha256
47 (base32
48 "1z26lsyf7xwnzwjvimmbla7ckipx6p734w7y0jk2a2fzci8fkdcr"))))
49 (build-system python-build-system)
50 (inputs
51 `(("python-mmtk" ,python2-mmtk)))
52 (arguments
53 `(#:python ,python-2
54 ;; No test suite
55 #:tests? #f))
56 (home-page "http://dirac.cnrs-orleans.fr/DomainFinder")
57 (synopsis "Analysis of dynamical domains in proteins")
58 (description "DomainFinder is an interactive program for the determination
59and characterization of dynamical domains in proteins. It can infer dynamical
60domains by comparing two protein structures, or from normal mode analysis on a
61single structure. The software is currently not actively maintained and works
62only with Python 2 and NumPy < 1.9.")
63 (license license:cecill-c)))
f250a868 64
a49eb85c
KK
65(define-public inchi
66 (package
67 (name "inchi")
68 (version "1.05")
69 (source (origin
70 (method url-fetch)
71 (uri (string-append "http://www.inchi-trust.org/download/"
72 (string-join (string-split version #\.) "")
73 "/INCHI-1-SRC.zip"))
74 (sha256
75 (base32
76 "081pcjx1z5jm23fs1pl2r3bccia0ww8wfkzcjpb7byhn7b513hsa"))
77 (file-name (string-append name "-" version ".zip"))))
78 (build-system gnu-build-system)
79 (arguments
80 '(#:tests? #f ; no check target
81 #:phases
82 (modify-phases %standard-phases
83 (delete 'configure) ; no configure script
84 (add-before 'build 'chdir-to-build-directory
85 (lambda _ (chdir "INCHI_EXE/inchi-1/gcc") #t))
86 (add-after 'build 'build-library
87 (lambda _
88 (chdir "../../../INCHI_API/libinchi/gcc")
89 (invoke "make")))
90 (replace 'install
91 (lambda* (#:key inputs outputs #:allow-other-keys)
92 (let* ((out (assoc-ref outputs "out"))
93 (bin (string-append out "/bin"))
94 (doc (string-append out "/share/doc/inchi"))
95 (include-dir (string-append out "/include/inchi"))
96 (lib (string-append out "/lib/inchi"))
97 (inchi-doc (assoc-ref inputs "inchi-doc"))
98 (unzip (string-append (assoc-ref inputs "unzip")
99 "/bin/unzip")))
100 (chdir "../../..")
101 ;; Install binary.
102 (with-directory-excursion "INCHI_EXE/bin/Linux"
103 (rename-file "inchi-1" "inchi")
104 (install-file "inchi" bin))
105 ;; Install libraries.
106 (with-directory-excursion "INCHI_API/bin/Linux"
107 (for-each (lambda (file)
108 (install-file file lib))
109 (find-files "." "libinchi\\.so\\.1\\.*")))
110 ;; Install header files.
111 (with-directory-excursion "INCHI_BASE/src"
112 (for-each (lambda (file)
113 (install-file file include-dir))
114 (find-files "." "\\.h$")))
115 ;; Install documentation.
116 (mkdir-p doc)
117 (invoke unzip "-j" "-d" doc inchi-doc)
118 #t))))))
119 (native-inputs
120 `(("unzip" ,unzip)
121 ("inchi-doc"
122 ,(origin
123 (method url-fetch)
124 (uri (string-append "http://www.inchi-trust.org/download/"
125 (string-join (string-split version #\.) "")
126 "/INCHI-1-DOC.zip"))
127 (sha256
128 (base32
129 "1id1qb2y4lwsiw91qr2yqpn6kxbwjwhjk0hb2rwk4fxhdqib6da6"))
130 (file-name (string-append name "-" version ".zip"))))))
131 (home-page "https://www.inchi-trust.org")
132 (synopsis "Utility for manipulating machine-readable chemical structures")
133 (description
134 "The @dfn{InChI} (IUPAC International Chemical Identifier) algorithm turns
135chemical structures into machine-readable strings of information. InChIs are
136unique to the compound they describe and can encode absolute stereochemistry
137making chemicals and chemistry machine-readable and discoverable. A simple
138analogy is that InChI is the bar-code for chemistry and chemical structures.")
139 (license (license:non-copyleft
140 "file://LICENCE"
141 "See LICENCE in the distribution."))))
142
f250a868
KH
143(define with-numpy-1.8
144 (package-input-rewriting `((,python2-numpy . ,python2-numpy-1.8))))
145
146(define-public nmoldyn
147 (package
148 (name "nmoldyn")
149 (version "3.0.11")
150 (source
151 (origin
152 (method url-fetch)
153 (uri (string-append "https://bitbucket.org/khinsen/"
154 "nmoldyn3/downloads/nMOLDYN-"
155 version ".tar.gz"))
156 (sha256
157 (base32
158 "1mvmz3lkr217kdrd8cvdr1d82y58wp1403c9rnd943mijgq8xb5a"))))
159 (build-system python-build-system)
160 (inputs
161 `(("python-matplotlib" ,(with-numpy-1.8 python2-matplotlib))
c695fb76
TGR
162 ("python-scientific" ,python2-scientific)
163 ("netcdf" ,netcdf)
f250a868
KH
164 ("gv" ,gv)))
165 (propagated-inputs
166 `(("python-mmtk" ,python2-mmtk)))
167 (arguments
168 `(#:python ,python-2
169 #:tests? #f ; No test suite
170 #:phases
171 (modify-phases %standard-phases
172 (add-before 'build 'create-linux2-directory
173 (lambda _
174 (mkdir-p "nMOLDYN/linux2")))
175 (add-before 'build 'change-PDF-viewer
176 (lambda* (#:key inputs #:allow-other-keys)
177 (substitute* "nMOLDYN/Preferences.py"
178 ;; Set the paths for external executables, substituting
179 ;; gv for acroread.
180 ;; There is also vmd_path, but VMD is not free software
181 ;; and Guix contains currently no free molecular viewer that
182 ;; could be substituted.
183 (("PREFERENCES\\['acroread_path'\\] = ''")
184 (format "PREFERENCES['acroread_path'] = '~a'"
185 (which "gv")))
186 (("PREFERENCES\\['ncdump_path'\\] = ''")
187 (format "PREFERENCES['ncdump_path'] = '~a'"
188 (which "ncdump")))
189 (("PREFERENCES\\['ncgen_path'\\] = ''")
190 (format "PREFERENCES['ncgen_path'] = '~a'"
191 (which "ncgen3")))
192 (("PREFERENCES\\['task_manager_path'\\] = ''")
193 (format "PREFERENCES['task_manager_path'] = '~a'"
194 (which "task_manager")))
195 ;; Show documentation as PDF
196 (("PREFERENCES\\['documentation_style'\\] = 'html'")
197 "PREFERENCES['documentation_style'] = 'pdf'") ))))))
198 (home-page "http://dirac.cnrs-orleans.fr/nMOLDYN/")
199 (synopsis "Analysis software for Molecular Dynamics trajectories")
200 (description "nMOLDYN is an interactive analysis program for Molecular Dynamics
201simulations. It is especially designed for the computation and decomposition of
202neutron scattering spectra, but also computes other quantities. The software
203is currently not actively maintained and works only with Python 2 and
204NumPy < 1.9.")
205 (license license:cecill)))
348edd91
KK
206
207(define-public openbabel
208 (package
209 (name "openbabel")
210 (version "2.4.1")
211 (source (origin
212 (method url-fetch)
213 (uri (string-append "mirror://sourceforge/" name "/" name "/"
214 version "/" name "-" version ".tar.gz"))
215 (sha256
216 (base32
eb5ece73
KK
217 "1z3d6xm70dpfikhwdnbzc66j2l49vq105ch041wivrfz5ic3ch90"))
218 (patches
219 (search-patches "openbabel-fix-crash-on-nwchem-output.patch"))))
348edd91
KK
220 (build-system cmake-build-system)
221 (arguments
222 `(#:configure-flags
223 (list "-DOPENBABEL_USE_SYSTEM_INCHI=ON"
224 (string-append "-DINCHI_LIBRARY="
225 (assoc-ref %build-inputs "inchi")
226 "/lib/inchi/libinchi.so.1")
227 (string-append "-DINCHI_INCLUDE_DIR="
228 (assoc-ref %build-inputs "inchi") "/include/inchi"))
229 #:test-target "test"))
230 (native-inputs
231 `(("pkg-config" ,pkg-config)))
232 (inputs
233 `(("eigen" ,eigen)
234 ("inchi" ,inchi)
235 ("libxml2" ,libxml2)
236 ("zlib" ,zlib)))
237 (home-page "http://openbabel.org/wiki/Main_Page")
238 (synopsis "Chemistry data manipulation toolbox")
239 (description
240 "Open Babel is a chemical toolbox designed to speak the many languages of
241chemical data. It's a collaborative project allowing anyone to search, convert,
242analyze, or store data from molecular modeling, chemistry, solid-state
243materials, biochemistry, or related areas.")
244 (license license:gpl2)))