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