From patchwork Fri Oct 7 15:21:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43195 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 0ACE327BBE9; Fri, 7 Oct 2022 16:57:42 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 366F327BBEA for ; Fri, 7 Oct 2022 16:57:38 +0100 (BST) Received: from localhost ([::1]:51924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogpjF-0000jm-Aq for patchwork@mira.cbaines.net; Fri, 07 Oct 2022 11:57:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogpBp-0002ZO-8V for guix-patches@gnu.org; Fri, 07 Oct 2022 11:23:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38114) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogpBp-0005qV-0C for guix-patches@gnu.org; Fri, 07 Oct 2022 11:23:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogpBo-0005oi-Rw for guix-patches@gnu.org; Fri, 07 Oct 2022 11:23:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v2 07/13] gnu: Add freesasa. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 15:23:04 +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.166515615622208 (code B ref 58261); Fri, 07 Oct 2022 15:23:04 +0000 Received: (at 58261) by debbugs.gnu.org; 7 Oct 2022 15:22:36 +0000 Received: from localhost ([127.0.0.1]:37172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogpBM-0005m2-1p for submit@debbugs.gnu.org; Fri, 07 Oct 2022 11:22:36 -0400 Received: from mout02.posteo.de ([185.67.36.66]:42689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogpAt-0005jU-EK for 58261@debbugs.gnu.org; Fri, 07 Oct 2022 11:22:09 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DCD96240101 for <58261@debbugs.gnu.org>; Fri, 7 Oct 2022 17:22:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665156121; bh=V/+UamU9jZNmy4/FY2xLkfGYxoDNKMb22lxoM/B1zRQ=; h=From:To:Cc:Subject:Date:From; b=iYSP6oVj1JlCRe2iAFan3ZxaHDBuhioryjktnttYkhs9f0rYmTPFwUcYKIELwgIxo MeXwKZhsvclt4Rf6pnvJqSNl2Ax0e0WgIA4mrBDJFC+sY44VkmHlZ4egwoMDjtWVuX WL4bo5d6UcDdPSQepr3JcNgq+mt2ghPLiKo80eRufuL1eyE4nyeRD/XQQcq2YAGgWb kxwyHRw3eLAOw+U+nB94pF0R5eDUgWP5hX4EX4Ap2vOMAs2VCd4reMSK7hoQSJ2+jg qMi0PsaoLfXxH0PxEzL3OzSOdkm+C4tTEqsCUke+Uyn6jvgMo0P8y+tMPp8IUfIi6r Ic7ZPrtt1SAfQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MkX953BLFz6tpX; Fri, 7 Oct 2022 17:22:01 +0200 (CEST) From: David Elsing Date: Fri, 7 Oct 2022 15:21:44 +0000 Message-Id: <20221007152148.32591-8-david.elsing@posteo.net> In-Reply-To: References: 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 (freesasa): New variable. --- gnu/packages/chemistry.scm | 86 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index d8f1608a3a..681e026186 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -34,11 +34,13 @@ (define-module (gnu packages chemistry) #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) #:use-module (gnu packages backup) + #:use-module (gnu packages bison) #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages cpp) #:use-module (gnu packages documentation) + #:use-module (gnu packages flex) #:use-module (gnu packages fontutils) #:use-module (gnu packages gl) #:use-module (gnu packages graphviz) @@ -54,6 +56,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 web) #:use-module (gnu packages xml) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) @@ -684,3 +687,86 @@ (define-public gemmi @item crystallographic symmetry. @end enumerate") (license license:mpl2.0))) + +(define-public freesasa + (package + (name "freesasa") + (version "2.1.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mittinatten/freesasa") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "07wdnahf3g355ryaiqvfxd5f4rl54wv8jwxcbn0nia89fqysbv0f")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Remove C files generated by Flex and Bison + (for-each delete-file + '("src/parser.c" "src/parser.h" + "src/lexer.c" "src/lexer.h")))))) + (outputs '("out" "doc")) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags + #~(list "--enable-check" + "--enable-parser-generator" + "CXXFLAGS=-std=c++17" + "--enable-doxygen") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'remove-libc++-linking + (lambda _ + (substitute* "src/Makefile.am" + (("-lc\\+\\+") "")))) + (add-after 'unpack 'build-shared-library + (lambda _ + (substitute* "src/Makefile.am" + (("lib_LIBRARIES") "lib_LTLIBRARIES") + (("libfreesasa\\.a") "libfreesasa.la") + (("freesasa_LDADD \\+= libfreesasa\\.la" prev) + (string-append prev "\nlibfreesasa_la_LIBADD" + " = -ljson-c ${libxml2_LIBS}\n")) + (("_a_SOURCES") "_la_SOURCES")) + (substitute* "configure.ac" + (("AC_PROG_INSTALL" inst) + (string-append "AM_PROG_LIBTOOL\n" inst))) + (substitute* "tests/Makefile.am" + (("libfreesasa\\.a") "libfreesasa.la")))) + (add-before 'build 'build-lexer-and-parser + (lambda _ + (with-directory-excursion "src" + (invoke "make" "lexer.h" "parser.h")))) + (add-after 'install 'install-doc + (lambda _ + (copy-recursively + "doc/html" + (string-append #$output:doc "/share/doc/" #$name "-" #$version))))))) + (native-inputs + (list autoconf + automake + bison + check + doxygen + fast-float + flex + libtool + pegtl + perl + pkg-config)) + (inputs + (list gemmi json-c libxml2)) + (home-page "https://freesasa.github.io/") + (synopsis "Calculate the solvent accessible surface area (SASA) of +molecules") + ;; TODO: @abbr + (description "FreeSASA is a command line tool and C-library for +calculating solvent accessible surface areas. By default Lee & Richards' +algorithm is used, but Shrake & Rupley's is also available. Both can be +parameterized to arbitrary precision, and for high resolution versions of the +algorithms, the calculations give identical results.") + (license license:expat)))