Commit | Line | Data |
---|---|---|
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> |
4ae16f9c | 4 | ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il> |
631249dd | 5 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
357328d2 | 6 | ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de> |
73114e30 KH |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
11 | ;;; under the terms of the GNU General Public License as published by | |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | (define-module (gnu packages chemistry) | |
24 | #:use-module (guix packages) | |
4ae16f9c | 25 | #:use-module (guix utils) |
73114e30 KH |
26 | #:use-module ((guix licenses) #:prefix license:) |
27 | #:use-module (guix download) | |
631249dd | 28 | #:use-module (guix git-download) |
0c468cb5 | 29 | #:use-module (gnu packages) |
348edd91 | 30 | #:use-module (gnu packages algebra) |
7d01ee66 | 31 | #:use-module (gnu packages boost) |
a49eb85c | 32 | #:use-module (gnu packages compression) |
7d01ee66 KK |
33 | #:use-module (gnu packages documentation) |
34 | #:use-module (gnu packages gl) | |
f250a868 KH |
35 | #:use-module (gnu packages gv) |
36 | #:use-module (gnu packages maths) | |
348edd91 | 37 | #:use-module (gnu packages pkg-config) |
73114e30 | 38 | #:use-module (gnu packages python) |
44d10b1f | 39 | #:use-module (gnu packages python-xyz) |
7d01ee66 | 40 | #:use-module (gnu packages qt) |
348edd91 KK |
41 | #:use-module (gnu packages xml) |
42 | #:use-module (guix build-system cmake) | |
a49eb85c | 43 | #:use-module (guix build-system gnu) |
73114e30 KH |
44 | #:use-module (guix build-system python)) |
45 | ||
7d01ee66 KK |
46 | (define-public avogadro |
47 | (package | |
48 | (name "avogadro") | |
49 | (version "1.2.0") | |
631249dd TGR |
50 | (source |
51 | (origin | |
52 | (method git-fetch) | |
53 | (uri (git-reference | |
54 | (url "https://github.com/cryos/avogadro.git") | |
55 | (commit version))) | |
56 | (sha256 | |
57 | (base32 "0258py3lkba85qhs5ynancinyym61vlp0zaq9yrfs3hhnhpzv9n2")) | |
58 | (file-name (git-file-name name version)) | |
59 | (patches | |
60 | (search-patches "avogadro-eigen3-update.patch" | |
61 | "avogadro-python-eigen-lib.patch" | |
62 | "avogadro-boost148.patch")))) | |
7d01ee66 KK |
63 | (build-system cmake-build-system) |
64 | (arguments | |
4ae16f9c | 65 | `(#:tests? #f |
7d01ee66 KK |
66 | #:configure-flags |
67 | (list "-DENABLE_GLSL=ON" | |
68 | (string-append "-DPYTHON_LIBRARIES=" | |
69 | (assoc-ref %build-inputs "python") | |
70 | "/lib") | |
71 | (string-append "-DPYTHON_INCLUDE_DIRS=" | |
72 | (assoc-ref %build-inputs "python") | |
4ae16f9c EF |
73 | "/include/python" |
74 | ,(version-major+minor | |
75 | (package-version python)))) | |
7d01ee66 KK |
76 | #:phases |
77 | (modify-phases %standard-phases | |
78 | (add-after 'unpack 'patch-python-lib-path | |
79 | (lambda* (#:key outputs #:allow-other-keys) | |
80 | ;; This is necessary to install the Python module in the correct | |
81 | ;; directory. | |
82 | (substitute* "libavogadro/src/python/CMakeLists.txt" | |
83 | (("^EXECUTE_PROCESS.*$") "") | |
84 | (("^.*from sys import stdout.*$") "") | |
85 | (("^.*OUTPUT_VARIABLE.*") | |
86 | (string-append "set(PYTHON_LIB_PATH \"" | |
87 | (assoc-ref outputs "out") | |
4ae16f9c EF |
88 | "/lib/python" |
89 | ,(version-major+minor | |
90 | (package-version python)) | |
91 | "/site-packages\")"))) | |
7d01ee66 KK |
92 | #t)) |
93 | (add-after 'install 'wrap-program | |
94 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
95 | ;; Make sure 'avogadro' runs with the correct PYTHONPATH. | |
96 | (let* ((out (assoc-ref outputs "out"))) | |
97 | (setenv "PYTHONPATH" | |
98 | (string-append | |
99 | (assoc-ref outputs "out") | |
4ae16f9c EF |
100 | "/lib/python" |
101 | ,(version-major+minor | |
102 | (package-version python)) | |
103 | "/site-packages:" | |
7d01ee66 KK |
104 | (getenv "PYTHONPATH"))) |
105 | (wrap-program (string-append out "/bin/avogadro") | |
106 | `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))) | |
107 | #t))))) | |
108 | (native-inputs | |
109 | `(("doxygen" ,doxygen) | |
110 | ("pkg-config" ,pkg-config))) | |
111 | (inputs | |
112 | `(("boost" ,boost) | |
113 | ("eigen" ,eigen) | |
114 | ("glew" ,glew) | |
115 | ("openbabel" ,openbabel) | |
116 | ("python" ,python-2) | |
117 | ("python-numpy" ,python2-numpy) | |
118 | ("python-pyqt" ,python2-pyqt-4) | |
119 | ("python-sip" ,python2-sip) | |
120 | ("qt" ,qt-4) | |
121 | ("zlib" ,zlib))) | |
122 | (home-page "https://avogadro.cc") | |
123 | (synopsis "Advanced molecule editor") | |
124 | (description | |
125 | "Avogadro is an advanced molecule editor and visualizer designed for use | |
126 | in computational chemistry, molecular modeling, bioinformatics, materials | |
127 | science, and related areas. It offers flexible high quality rendering and a | |
128 | powerful plugin architecture.") | |
129 | (license license:gpl2+))) | |
130 | ||
73114e30 KH |
131 | (define-public domainfinder |
132 | (package | |
133 | (name "domainfinder") | |
134 | (version "2.0.5") | |
135 | (source | |
136 | (origin | |
137 | (method url-fetch) | |
138 | (uri (string-append "https://bitbucket.org/khinsen/" | |
139 | "domainfinder/downloads/DomainFinder-" | |
140 | version ".tar.gz")) | |
141 | (sha256 | |
142 | (base32 | |
143 | "1z26lsyf7xwnzwjvimmbla7ckipx6p734w7y0jk2a2fzci8fkdcr")))) | |
144 | (build-system python-build-system) | |
145 | (inputs | |
146 | `(("python-mmtk" ,python2-mmtk))) | |
147 | (arguments | |
148 | `(#:python ,python-2 | |
149 | ;; No test suite | |
150 | #:tests? #f)) | |
7f489c56 | 151 | (home-page "http://dirac.cnrs-orleans.fr/DomainFinder.html") |
73114e30 KH |
152 | (synopsis "Analysis of dynamical domains in proteins") |
153 | (description "DomainFinder is an interactive program for the determination | |
154 | and characterization of dynamical domains in proteins. It can infer dynamical | |
155 | domains by comparing two protein structures, or from normal mode analysis on a | |
156 | single structure. The software is currently not actively maintained and works | |
157 | only with Python 2 and NumPy < 1.9.") | |
158 | (license license:cecill-c))) | |
f250a868 | 159 | |
a49eb85c KK |
160 | (define-public inchi |
161 | (package | |
162 | (name "inchi") | |
163 | (version "1.05") | |
164 | (source (origin | |
165 | (method url-fetch) | |
166 | (uri (string-append "http://www.inchi-trust.org/download/" | |
167 | (string-join (string-split version #\.) "") | |
168 | "/INCHI-1-SRC.zip")) | |
169 | (sha256 | |
170 | (base32 | |
171 | "081pcjx1z5jm23fs1pl2r3bccia0ww8wfkzcjpb7byhn7b513hsa")) | |
172 | (file-name (string-append name "-" version ".zip")))) | |
173 | (build-system gnu-build-system) | |
174 | (arguments | |
175 | '(#:tests? #f ; no check target | |
176 | #:phases | |
177 | (modify-phases %standard-phases | |
178 | (delete 'configure) ; no configure script | |
179 | (add-before 'build 'chdir-to-build-directory | |
180 | (lambda _ (chdir "INCHI_EXE/inchi-1/gcc") #t)) | |
181 | (add-after 'build 'build-library | |
182 | (lambda _ | |
183 | (chdir "../../../INCHI_API/libinchi/gcc") | |
184 | (invoke "make"))) | |
185 | (replace 'install | |
186 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
187 | (let* ((out (assoc-ref outputs "out")) | |
188 | (bin (string-append out "/bin")) | |
189 | (doc (string-append out "/share/doc/inchi")) | |
190 | (include-dir (string-append out "/include/inchi")) | |
191 | (lib (string-append out "/lib/inchi")) | |
192 | (inchi-doc (assoc-ref inputs "inchi-doc")) | |
193 | (unzip (string-append (assoc-ref inputs "unzip") | |
194 | "/bin/unzip"))) | |
195 | (chdir "../../..") | |
196 | ;; Install binary. | |
197 | (with-directory-excursion "INCHI_EXE/bin/Linux" | |
198 | (rename-file "inchi-1" "inchi") | |
199 | (install-file "inchi" bin)) | |
200 | ;; Install libraries. | |
201 | (with-directory-excursion "INCHI_API/bin/Linux" | |
202 | (for-each (lambda (file) | |
203 | (install-file file lib)) | |
204 | (find-files "." "libinchi\\.so\\.1\\.*"))) | |
205 | ;; Install header files. | |
206 | (with-directory-excursion "INCHI_BASE/src" | |
207 | (for-each (lambda (file) | |
208 | (install-file file include-dir)) | |
209 | (find-files "." "\\.h$"))) | |
210 | ;; Install documentation. | |
211 | (mkdir-p doc) | |
212 | (invoke unzip "-j" "-d" doc inchi-doc) | |
213 | #t)))))) | |
214 | (native-inputs | |
215 | `(("unzip" ,unzip) | |
216 | ("inchi-doc" | |
217 | ,(origin | |
218 | (method url-fetch) | |
219 | (uri (string-append "http://www.inchi-trust.org/download/" | |
220 | (string-join (string-split version #\.) "") | |
221 | "/INCHI-1-DOC.zip")) | |
222 | (sha256 | |
223 | (base32 | |
224 | "1id1qb2y4lwsiw91qr2yqpn6kxbwjwhjk0hb2rwk4fxhdqib6da6")) | |
225 | (file-name (string-append name "-" version ".zip")))))) | |
226 | (home-page "https://www.inchi-trust.org") | |
227 | (synopsis "Utility for manipulating machine-readable chemical structures") | |
228 | (description | |
229 | "The @dfn{InChI} (IUPAC International Chemical Identifier) algorithm turns | |
230 | chemical structures into machine-readable strings of information. InChIs are | |
231 | unique to the compound they describe and can encode absolute stereochemistry | |
232 | making chemicals and chemistry machine-readable and discoverable. A simple | |
233 | analogy is that InChI is the bar-code for chemistry and chemical structures.") | |
234 | (license (license:non-copyleft | |
235 | "file://LICENCE" | |
236 | "See LICENCE in the distribution.")))) | |
237 | ||
f250a868 KH |
238 | (define with-numpy-1.8 |
239 | (package-input-rewriting `((,python2-numpy . ,python2-numpy-1.8)))) | |
240 | ||
241 | (define-public nmoldyn | |
242 | (package | |
243 | (name "nmoldyn") | |
244 | (version "3.0.11") | |
245 | (source | |
246 | (origin | |
e2293cbb KH |
247 | (method git-fetch) |
248 | (uri (git-reference | |
249 | (url "https://github.com/khinsen/nMOLDYN3") | |
250 | (commit (string-append "v" version)))) | |
251 | (file-name (git-file-name name version)) | |
f250a868 KH |
252 | (sha256 |
253 | (base32 | |
e2293cbb | 254 | "016h4bqg419p6s7bcx55q5iik91gqmk26hbnfgj2j6zl0j36w51r")))) |
f250a868 KH |
255 | (build-system python-build-system) |
256 | (inputs | |
257 | `(("python-matplotlib" ,(with-numpy-1.8 python2-matplotlib)) | |
c695fb76 TGR |
258 | ("python-scientific" ,python2-scientific) |
259 | ("netcdf" ,netcdf) | |
f250a868 KH |
260 | ("gv" ,gv))) |
261 | (propagated-inputs | |
262 | `(("python-mmtk" ,python2-mmtk))) | |
263 | (arguments | |
264 | `(#:python ,python-2 | |
265 | #:tests? #f ; No test suite | |
266 | #:phases | |
267 | (modify-phases %standard-phases | |
268 | (add-before 'build 'create-linux2-directory | |
269 | (lambda _ | |
270 | (mkdir-p "nMOLDYN/linux2"))) | |
271 | (add-before 'build 'change-PDF-viewer | |
272 | (lambda* (#:key inputs #:allow-other-keys) | |
273 | (substitute* "nMOLDYN/Preferences.py" | |
274 | ;; Set the paths for external executables, substituting | |
275 | ;; gv for acroread. | |
276 | ;; There is also vmd_path, but VMD is not free software | |
277 | ;; and Guix contains currently no free molecular viewer that | |
278 | ;; could be substituted. | |
279 | (("PREFERENCES\\['acroread_path'\\] = ''") | |
30d0f7fa | 280 | (format #f "PREFERENCES['acroread_path'] = '~a'" |
f250a868 KH |
281 | (which "gv"))) |
282 | (("PREFERENCES\\['ncdump_path'\\] = ''") | |
30d0f7fa | 283 | (format #f "PREFERENCES['ncdump_path'] = '~a'" |
f250a868 KH |
284 | (which "ncdump"))) |
285 | (("PREFERENCES\\['ncgen_path'\\] = ''") | |
30d0f7fa | 286 | (format #f "PREFERENCES['ncgen_path'] = '~a'" |
f250a868 KH |
287 | (which "ncgen3"))) |
288 | (("PREFERENCES\\['task_manager_path'\\] = ''") | |
30d0f7fa | 289 | (format #f "PREFERENCES['task_manager_path'] = '~a'" |
f250a868 KH |
290 | (which "task_manager"))) |
291 | ;; Show documentation as PDF | |
292 | (("PREFERENCES\\['documentation_style'\\] = 'html'") | |
293 | "PREFERENCES['documentation_style'] = 'pdf'") )))))) | |
357328d2 | 294 | (home-page "http://dirac.cnrs-orleans.fr/nMOLDYN.html") |
f250a868 KH |
295 | (synopsis "Analysis software for Molecular Dynamics trajectories") |
296 | (description "nMOLDYN is an interactive analysis program for Molecular Dynamics | |
297 | simulations. It is especially designed for the computation and decomposition of | |
298 | neutron scattering spectra, but also computes other quantities. The software | |
299 | is currently not actively maintained and works only with Python 2 and | |
300 | NumPy < 1.9.") | |
301 | (license license:cecill))) | |
348edd91 KK |
302 | |
303 | (define-public openbabel | |
304 | (package | |
305 | (name "openbabel") | |
306 | (version "2.4.1") | |
307 | (source (origin | |
308 | (method url-fetch) | |
309 | (uri (string-append "mirror://sourceforge/" name "/" name "/" | |
310 | version "/" name "-" version ".tar.gz")) | |
311 | (sha256 | |
312 | (base32 | |
eb5ece73 KK |
313 | "1z3d6xm70dpfikhwdnbzc66j2l49vq105ch041wivrfz5ic3ch90")) |
314 | (patches | |
315 | (search-patches "openbabel-fix-crash-on-nwchem-output.patch")))) | |
348edd91 KK |
316 | (build-system cmake-build-system) |
317 | (arguments | |
318 | `(#:configure-flags | |
319 | (list "-DOPENBABEL_USE_SYSTEM_INCHI=ON" | |
320 | (string-append "-DINCHI_LIBRARY=" | |
321 | (assoc-ref %build-inputs "inchi") | |
322 | "/lib/inchi/libinchi.so.1") | |
323 | (string-append "-DINCHI_INCLUDE_DIR=" | |
324 | (assoc-ref %build-inputs "inchi") "/include/inchi")) | |
325 | #:test-target "test")) | |
326 | (native-inputs | |
327 | `(("pkg-config" ,pkg-config))) | |
328 | (inputs | |
329 | `(("eigen" ,eigen) | |
330 | ("inchi" ,inchi) | |
331 | ("libxml2" ,libxml2) | |
332 | ("zlib" ,zlib))) | |
333 | (home-page "http://openbabel.org/wiki/Main_Page") | |
334 | (synopsis "Chemistry data manipulation toolbox") | |
335 | (description | |
336 | "Open Babel is a chemical toolbox designed to speak the many languages of | |
337 | chemical data. It's a collaborative project allowing anyone to search, convert, | |
338 | analyze, or store data from molecular modeling, chemistry, solid-state | |
339 | materials, biochemistry, or related areas.") | |
340 | (license license:gpl2))) |