From patchwork Thu Oct 13 21:04:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43395 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4A34C27BBEA; Thu, 13 Oct 2022 22:09:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A033427BBE9 for ; Thu, 13 Oct 2022 22:09:20 +0100 (BST) Received: from localhost ([::1]:56942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5SB-00076c-Rj for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:09:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P7-00033s-4F for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36097) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P4-0007VC-OU for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P4-0005ng-J8 for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 12/15] gnu: Add yaehmop. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58261 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58261@debbugs.gnu.org Cc: David Elsing Received: via spool by 58261-submit@debbugs.gnu.org id=B58261.166569512122145 (code B ref 58261); Thu, 13 Oct 2022 21:06:06 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:21 +0000 Received: from localhost ([127.0.0.1]:35159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OK-0005l1-MO for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:21 -0400 Received: from mout01.posteo.de ([185.67.36.65]:41575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nz-0005hd-Ry for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:00 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5C94F240029 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695094; bh=Mol2jk9OkE6XDRueEQk7RLzW7BUm6XLLFtEB6As4IZg=; h=From:To:Cc:Subject:Date:From; b=CjCVrEUp4uA9ezAWziL4GhTwL4rBNXzMZhiNZblWRx/GbbrMLchbsg8/nJrGpH3pj VCnm06BCfNMEtT8tz8YScPwv/t0PjBpwR/k9c3axiEJxI5bQLESa5NAS/wxZLznLRM 6v8FcWdVDwdywT+LCdWalGDWMJFVX71SDDIdhmO78DnQQJCUEsgExryzpSBezPoY5O EEANzuwWQKi7iCxu+YtRuhyemAU9vIxyHhNACfFMfYbaWpcBWKWeUf+L8VA9VdYP5/ Ia2GmLoJ7NZOjeHmlGbLPBTVC2LI0UnBzwAIJTZhscrLoMDcelzE9oLg9IA3ntG1l5 jNozwama7tY9Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTx74nwz6tmH; Thu, 13 Oct 2022 23:04:53 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:21 +0000 Message-Id: <20221013210424.993-13-david.elsing@posteo.net> In-Reply-To: <20221007152148.32591-1-david.elsing@posteo.net> References: <20221007152148.32591-1-david.elsing@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/chemistry.scm (yaehmop): New variable. --- gnu/packages/chemistry.scm | 106 +++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 4da1bc10f1..a1c1dbfa1b 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -42,6 +42,7 @@ (define-module (gnu packages chemistry) #:use-module (gnu packages documentation) #:use-module (gnu packages flex) #:use-module (gnu packages fontutils) + #:use-module (gnu packages gcc) #:use-module (gnu packages gl) #:use-module (gnu packages graphviz) #:use-module (gnu packages gv) @@ -56,6 +57,7 @@ (define-module (gnu packages chemistry) #:use-module (gnu packages serialization) #:use-module (gnu packages sphinx) #:use-module (gnu packages stb) + #:use-module (gnu packages tex) #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module (guix build-system cmake) @@ -820,3 +822,107 @@ (define-public coordgenlibs coordinates of molecules including macrocycles and metal complexes. It has an emphasis on quality rather than speed.") (license license:bsd-3))) + +(define-public yaehmop + (package + (name "yaehmop") + (version "2022.09.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/greglandrum/yaehmop") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1x0d75m1hgdb411fiv7c5bwq1n4y0swrll0gigh8v5c73kjxrja0")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Separate program + (delete-file-recursively "viewkel") + ;; Remove example output (some are corrupted) + (for-each delete-file (find-files "examples" "\\.Z$")) + ;; Documentation outputs + (for-each delete-file (find-files "docs" "\\.(ps|pdf)$")) + ;; These are transpiled from Fortran to C, but we build the + ;; Fortran code instead + (delete-file-recursively "tightbind/f2c_files") + (delete-file "tightbind/diag.c") + (delete-file "tightbind/cboris.c") + (delete-file "tightbind/abfns.c") + (delete-file "tightbind/lovlap.c"))))) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags + #~(list + "-DUSE_BLAS_LAPACK=ON" + (string-append "-DPARM_FILE_LOC=" #$output + "/share/" #$name "-" #$version "/eht_parms.dat") + "-DBIND_EXE_NAME=yaehmop-bind") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "tightbind"))) + (add-after 'chdir 'patch-fortran-functions + (lambda _ + (substitute* '("mov.c" "prototypes.h") + (("lovlap\\(") "lovlap_(") + (("abfns\\(") "abfns_(")))) + (add-after 'chdir 'patch-cmake + (lambda _ + (substitute* "CMakeLists.txt" + (("project\\(yaehmop C\\)") "project(yaehmop C Fortran)") + (("abfns.c") "fortran77/abfns.f") + (("lovlap.c") "fortran77/lovlap.f") + (("(set\\(PARM_FILE_LOC.*)\\)" all init) + (string-append init " CACHE STRING \"\")")) + (("add_library\\(yaehmop_eht" lib) + (string-append lib " SHARED ")) + (("target_link_libraries\\(test_eht \\$\\{LAPACK_LIBRARIES\\}.*" + all) + (string-append all "\ntarget_link_libraries(yaehmop_eht " + "${LAPACK_LIBRARIES})\n"))))) + (add-after 'build 'build-doc + (lambda _ + (with-directory-excursion "../docs" + (substitute* "bind_manual.tex" + (("\\\\usepackage\\{bindpage\\}") + (string-append + "\\usepackage[left=2cm,right=2cm,top=4cm,bottom=2cm]" + "{geometry}\n" + "\\pdfsuppressptexinfo=-1\n"))) + (substitute* "Zmat_appendix.tex" + (("file=dihedral\\.eps") + "file=figs/dihedral.eps")) + (setenv "FORCE_SOURCE_DATE" "1") + (invoke "latexmk" "-pdf" "bind_manual.tex")))) + (add-after 'install 'install-eht-parms + (lambda _ + (install-file "../tightbind/eht_parms.dat" + (string-append #$output "/share/" + #$name "-" #$version)))) + (add-after 'install-eht-parms 'install-doc + (lambda _ + (install-file "../docs/bind_manual.pdf" + (string-append #$output "/share/doc/" + #$name "-" #$version)))) + (delete 'check) + (add-after 'install-doc 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "./test_eht"))))))) + (native-inputs + (list gfortran + (texlive-updmap.cfg (list texlive-fonts-ec + texlive-latex-graphics + texlive-latex-geometry)))) + (inputs (list openblas)) + (home-page "https://github.com/greglandrum/yaehmop") + (synopsis "Perform extended Hückel calculations") + (description "@acronym{YAeHMOP, Yet Another extended Hueckel Molecular +Orbital Package} contains a program and library for performing extended Hückel +calculations and analyzing the results.") + (license license:bsd-2)))