From patchwork Thu Oct 13 21:04:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43393 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 3426A27BBEA; Thu, 13 Oct 2022 22:09:04 +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 B167727BBE9 for ; Thu, 13 Oct 2022 22:09:03 +0100 (BST) Received: from localhost ([::1]:37458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5Ru-0006nR-UL for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:09:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P1-0002zw-D7 for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P0-0007UJ-IL for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P0-0005mT-6v for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 01/15] gnu: Add fast-float. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06:02 +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.166569510622052 (code B ref 58261); Thu, 13 Oct 2022 21:06:02 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:06 +0000 Received: from localhost ([127.0.0.1]:35128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nw-0005hp-5b for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:05 -0400 Received: from mout01.posteo.de ([185.67.36.65]:59041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nt-0005h0-J1 for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:54 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C42F0240028 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695087; bh=B+pRMSyt2aDgmtRbUQDp6Zx/3Eu6eQq13c2eV88zmzY=; h=From:To:Cc:Subject:Date:From; b=Bi2ot5HW3Mclf8fBo1a+mEfdibbibQnJExSL2VpFqMmKsFkDOeKwRArZB1RkApqwy xbIGsS/CQkWPj5PhG8J8FxLnLImsmpbR0uuIG+AAUBk4yTQlGJ69dHHaRxcIpt/Rk0 0JV7Xe9TE0pBVSiI/CBs+bhA+M7vNpeTSZr42bSkobsXj3ufxjThE2OKGto5D3jSIz wlzS78veReMjvBRUsSLVvhhoywbHOqWiqVx0XSinfJtEGdALzc4aOUU1wHZxL0RzSp Ucp2CCvmpqTA6MB5BCRuS/C7agvaELVa/vlM3Y5zKQF20GZcC4zzlGV77xpFbYipfm 0mTKAH4/1Hi/w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTp2jqmz6tpd; Thu, 13 Oct 2022 23:04:46 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:10 +0000 Message-Id: <20221013210424.993-2-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/cpp.scm (fast-float): New variable. --- gnu/packages/cpp.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 805413cc61..eba39ed660 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -29,6 +29,7 @@ ;;; Copyright © 2022 muradm ;;; Copyright © 2022 Attila Lendvai ;;; Copyright © 2022 Arun Isaac +;;; Copyright © 2022 David Elsing ;;; ;;; This file is part of GNU Guix. ;;; @@ -1954,3 +1955,52 @@ (define-public crc32c "This package provides architecture-specific implementations of the CRC32C algorithm, which is specified in RFC 3720, section 12.1.") (license license:bsd-3))) + +(define-public fast-float + (package + (name "fast-float") + (version "3.5.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/fastfloat/fast_float") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0z3rxxd0pwvw70dbnv63rm67biw829vdqf50y16isxm6g3sbrz8g")))) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags + #~(list + "-DFASTFLOAT_TEST=ON" + "-DSYSTEM_DOCTEST=ON") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-cmake-tests + (lambda _ + (substitute* "tests/CMakeLists.txt" + (("FetchContent_GetProperties\\(supplemental_test_files.*") + "") + (("if\\(NOT supplemental_test_files_POPULATED.*") + (string-append + "set(supplemental_test_files_BINARY_DIR " + #$(origin + (method git-fetch) + (uri (git-reference + (url (string-append "https://github.com/fastfloat" + "/supplemental_test_files.git")) + (commit "97a0b2e638feb479387554cf253e346500541e7e"))) + (file-name (git-file-name "fast_float_test-data" version)) + (sha256 + (base32 + "0dxbiyzyh7i847i89ablfzypfc3ckhm7f74w98jsh73v1mppmxlf"))) + "/data)\nif(0)\n")))))))) + (native-inputs (list doctest)) + (home-page "https://github.com/fastfloat/fast_float") + (synopsis "Floating point number parser for C++") + (description "@code{fast_float} is a header-only C++ library for parsing +floating point numbers from strings. It implements the C++ from_chars +functions for the float and double types.") + (license (list license:asl2.0 license:expat)))) ; dual licensed From patchwork Thu Oct 13 21:04:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43383 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 6A37D27BBEA; Thu, 13 Oct 2022 22:06:34 +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 BC46A27BBE9 for ; Thu, 13 Oct 2022 22:06:33 +0100 (BST) Received: from localhost ([::1]:49608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5PU-0002jg-Tx for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:06:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5O3-0002fh-UV for guix-patches@gnu.org; Thu, 13 Oct 2022 17:05:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5O3-0007Mk-MJ for guix-patches@gnu.org; Thu, 13 Oct 2022 17:05:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5O3-0005jD-GD for guix-patches@gnu.org; Thu, 13 Oct 2022 17:05:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 02/15] gnu: Add pocketfft-cpp. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:05:03 +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.166569509621940 (code B ref 58261); Thu, 13 Oct 2022 21:05:03 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:04:56 +0000 Received: from localhost ([127.0.0.1]:35125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nv-0005he-7p for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:56 -0400 Received: from mout02.posteo.de ([185.67.36.66]:35171) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nt-0005gz-1u for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 8CB86240104 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695087; bh=ZEQwkGyZhylBk05fowt1HYDbjUAw+eHEYckcxP4pMUA=; h=From:To:Cc:Subject:Date:From; b=mUB0Eec9HXSiv4uRis/b5tG1gpE2qzwkeBkCqgf+Th+0LF4HJ5lRbZ0w+RDOgaJag c15Lu7imk1wGk7MpwvwZ5XexT+ZuK6SnpWlJfWdHBp8XDtQrRS5x/xTYs8vXo8KwsF VHf6Lp8abAxj/o0Yb/HfJkOpiwABZZkW+ZTMGPzd05tMcXIsbWPFzRTfTlqcH287W9 wegHvaYH/YeVoL4AoVxKD5DRjLwW2rAwhRdCUhLMU9nStngI6YuNUK3+HAiBl7uygd 1c3tg/lxEjhV6IeFvJh/DySjXiSzW9/Fh0uWdiIVvtnN6INxCV1rcyzufBsoJMrpCN n2nmmrFsakKXw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTq0tmFz6tr3; Thu, 13 Oct 2022 23:04:47 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:11 +0000 Message-Id: <20221013210424.993-3-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/cpp.scm (pocketfft-cpp): New variable. --- gnu/packages/cpp.scm | 29 +++++ .../pocketfft-cpp-default-disable-simd.patch | 108 ++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 gnu/packages/patches/pocketfft-cpp-default-disable-simd.patch diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index eba39ed660..2b5841e777 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -2004,3 +2004,32 @@ (define-public fast-float floating point numbers from strings. It implements the C++ from_chars functions for the float and double types.") (license (list license:asl2.0 license:expat)))) ; dual licensed + +(define-public pocketfft-cpp + (let ((commit "daa8bb18327bc5c7d22c69428c25cf5dc64167d3") + (revision "0")) + (package + (name "pocketfft-cpp") + (version (git-version "0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mreineck/pocketfft") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1dbkkqkmkxgmz1qjpsqzic5ig3qw1pqndbb3dvjc7xq5f2rdzyq1")) + (patches (search-patches + "pocketfft-cpp-default-disable-simd.patch")))) + (build-system copy-build-system) + (arguments + (list + #:install-plan + #~'(("pocketfft_hdronly.h" "include/")))) + (home-page "https://github.com/mreineck/pocketfft") + (synopsis "C++11 header-only Fast Fourier Transform library") + (description "This package provides a single-header C++11 library for +computing Fast Fourier transformations. It supports multidimensional arrays, +different floating point sizes and complex transformations.") + (license license:bsd-3)))) diff --git a/gnu/packages/patches/pocketfft-cpp-default-disable-simd.patch b/gnu/packages/patches/pocketfft-cpp-default-disable-simd.patch new file mode 100644 index 0000000000..4d2ddae4b5 --- /dev/null +++ b/gnu/packages/patches/pocketfft-cpp-default-disable-simd.patch @@ -0,0 +1,108 @@ +Disable SIMD instructions by default. +They can be enabled by setting -DPOCKETFFT_NO_VECTORS=0. + +diff --git a/pocketfft_hdronly.h b/pocketfft_hdronly.h +index d75ada6..b2d0a23 100644 +--- a/pocketfft_hdronly.h ++++ b/pocketfft_hdronly.h +@@ -39,6 +39,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #ifndef POCKETFFT_HDRONLY_H + #define POCKETFFT_HDRONLY_H + ++#ifndef POCKETFFT_NO_VECTORS ++#define POCKETFFT_NO_VECTORS 1 ++#endif ++ + #ifndef __cplusplus + #error This file is C++ and requires a C++ compiler. + #endif +@@ -106,29 +110,29 @@ constexpr bool FORWARD = true, + BACKWARD = false; + + // only enable vector support for gcc>=5.0 and clang>=5.0 +-#ifndef POCKETFFT_NO_VECTORS +-#define POCKETFFT_NO_VECTORS ++#if !(POCKETFFT_NO_VECTORS) ++#define POCKETFFT_NO_VECTORS 1 + #if defined(__INTEL_COMPILER) + // do nothing. This is necessary because this compiler also sets __GNUC__. + #elif defined(__clang__) + // AppleClang has their own version numbering + #ifdef __apple_build_version__ + # if (__clang_major__ > 9) || (__clang_major__ == 9 && __clang_minor__ >= 1) +-# undef POCKETFFT_NO_VECTORS ++#define POCKETFFT_NO_VECTORS 0 + # endif + #elif __clang_major__ >= 5 +-# undef POCKETFFT_NO_VECTORS ++#define POCKETFFT_NO_VECTORS 0 + #endif + #elif defined(__GNUC__) + #if __GNUC__>=5 +-#undef POCKETFFT_NO_VECTORS ++#define POCKETFFT_NO_VECTORS 0 + #endif + #endif + #endif + + template struct VLEN { static constexpr size_t val=1; }; + +-#ifndef POCKETFFT_NO_VECTORS ++#if !(POCKETFFT_NO_VECTORS) + #if (defined(__AVX512F__)) + template<> struct VLEN { static constexpr size_t val=16; }; + template<> struct VLEN { static constexpr size_t val=8; }; +@@ -145,7 +149,7 @@ template<> struct VLEN { static constexpr size_t val=2; }; + template<> struct VLEN { static constexpr size_t val=4; }; + template<> struct VLEN { static constexpr size_t val=2; }; + #else +-#define POCKETFFT_NO_VECTORS ++#define POCKETFFT_NO_VECTORS 1 + #endif + #endif + +@@ -180,7 +184,7 @@ template class arr + T *p; + size_t sz; + +-#if defined(POCKETFFT_NO_VECTORS) ++#if POCKETFFT_NO_VECTORS + static T *ralloc(size_t num) + { + if (num==0) return nullptr; +@@ -3026,7 +3030,7 @@ class rev_iter + template struct VTYPE {}; + template using vtype_t = typename VTYPE::type; + +-#ifndef POCKETFFT_NO_VECTORS ++#if !(POCKETFFT_NO_VECTORS) + template<> struct VTYPE + { + using type = float __attribute__ ((vector_size (VLEN::val*sizeof(float)))); +@@ -3139,7 +3143,7 @@ POCKETFFT_NOINLINE void general_nd(const cndarr &in, ndarr &out, + auto storage = alloc_tmp(in.shape(), len, sizeof(T)); + const auto &tin(iax==0? in : out); + multi_iter it(tin, out, axes[iax]); +-#ifndef POCKETFFT_NO_VECTORS ++#if !(POCKETFFT_NO_VECTORS) + if (vlen>1) + while (it.remaining()>=vlen) + { +@@ -3245,7 +3249,7 @@ template POCKETFFT_NOINLINE void general_r2c( + constexpr auto vlen = VLEN::val; + auto storage = alloc_tmp(in.shape(), len, sizeof(T)); + multi_iter it(in, out, axis); +-#ifndef POCKETFFT_NO_VECTORS ++#if !(POCKETFFT_NO_VECTORS) + if (vlen>1) + while (it.remaining()>=vlen) + { +@@ -3300,7 +3304,7 @@ template POCKETFFT_NOINLINE void general_c2r( + constexpr auto vlen = VLEN::val; + auto storage = alloc_tmp(out.shape(), len, sizeof(T)); + multi_iter it(in, out, axis); +-#ifndef POCKETFFT_NO_VECTORS ++#if !(POCKETFFT_NO_VECTORS) + if (vlen>1) + while (it.remaining()>=vlen) + { From patchwork Thu Oct 13 21:04:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43389 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 42C6627BBEA; Thu, 13 Oct 2022 22:07:41 +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 8F59227BBE9 for ; Thu, 13 Oct 2022 22:07:40 +0100 (BST) Received: from localhost ([::1]:35560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5QZ-0005Cg-Nl for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:07:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P1-0002zx-DZ for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P0-0007UL-Vs for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P0-0005mc-QM for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 03/15] gnu: Add sajson. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06:02 +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.166569510622058 (code B ref 58261); Thu, 13 Oct 2022 21:06:02 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:06 +0000 Received: from localhost ([127.0.0.1]:35141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5O6-0005jd-70 for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:06 -0400 Received: from mout01.posteo.de ([185.67.36.65]:59621) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nt-0005h8-LW for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:54 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 2BBFE240029 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695088; bh=3RB/qoUS8+xbzKN61VD0Gg9UUu4vU88He+j5Lprdjc4=; h=From:To:Cc:Subject:Date:From; b=PeT7NmXZ2qVzSwL+IknBBFyOHNQ5gJzfC8QXZXiLNK20sj/ZCPhdXURikjiptGvuZ aOvFFCZupbEBOANGo/jQoezqAD/mhNhJpdXNfsLPnwtcbS200Qo7Gf40JAW42C6+mk o4yIiDDgxxYn45j8oc+fDKcR9UtlZFvODkELYo5Tq713Xy8FP8zH6y1+9L/ffi2Q0n K1WBHVAXKmKtAtQ19tQy8z/AAenmDhoIIhfXMyacMzKWjYwfXe0mTUuyMbnMWzvP8a rDNMGamrP64OfPhVfNYo5Eb9KZ4OIaFYqEzkb16rrFD0xPpqybLiKpB+hkP3/aNQNg 3I/OLFRECWWWg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTq5V0Cz6tnd; Thu, 13 Oct 2022 23:04:47 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:12 +0000 Message-Id: <20221013210424.993-4-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/cpp.scm (sajson): New variable. --- gnu/packages/cpp.scm | 60 +++++++++++++++++++ .../patches/sajson-build-with-gcc10.patch | 45 ++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 gnu/packages/patches/sajson-build-with-gcc10.patch diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 2b5841e777..b6a0a70ed7 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -57,6 +57,7 @@ (define-module (gnu packages cpp) #:use-module (guix build-system gnu) #:use-module (guix build-system meson) #:use-module (guix build-system python) + #:use-module (guix build-system scons) #:use-module (guix modules) #:use-module (guix gexp) #:use-module (gnu packages) @@ -2033,3 +2034,62 @@ (define-public pocketfft-cpp computing Fast Fourier transformations. It supports multidimensional arrays, different floating point sizes and complex transformations.") (license license:bsd-3)))) + +(define-public sajson + (let ((commit "ec644013e34f9984a3cc9ba568cab97a391db9cd") + (revision "0")) + (package + (name "sajson") + (version (git-version "1.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/chadaustin/sajson") + (commit commit))) + (file-name (git-file-name name version)) + (patches + (search-patches "sajson-build-with-gcc10.patch")) + (sha256 + (base32 + "0fjag27w7gvkc5pdhq3ad7yc09rabpzahndw1sgsg04ipznidmmq")) + (modules '((guix build utils))) + (snippet '(delete-file-recursively "third-party")))) + (build-system scons-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'disable-other-builds + (lambda _ + (substitute* "SConstruct" + (("for name, tools in builds:") + "for name, tools in [('opt', [gcc, opt])]:")))) + (add-after 'unpack 'use-external-unittest-cpp + (lambda _ + (substitute* "SConscript" + (("unittestpp_env\\.Library") "_dummy = ") + (("test_env = env.Clone\\(tools=\\[unittestpp, sajson\\]\\)") + (string-append + "test_env = env.Clone(tools=[sajson])\n" + "test_env.Append(CPPPATH='" + (search-input-directory %build-inputs "/include/UnitTest++") + "', LIBPATH='" + (string-append #$(this-package-native-input "unittest-cpp") + "/lib") + "', LIBS=['UnitTest++'])"))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "build/opt/test") + (invoke "build/opt/test_unsorted")))) + (replace 'install + (lambda _ + (let ((out (string-append #$output "/include"))) + (install-file "include/sajson.h" out) + (install-file "include/sajson_ostream.h" out))))))) + (native-inputs (list unittest-cpp)) + (home-page "https://github.com/chadaustin/sajson") + (synopsis "C++11 header-only, in-place JSON parser") + (description "@code{sajson} is an in-place JSON parser with support for +parsing with only a single memory allocation.") + (license license:expat)))) diff --git a/gnu/packages/patches/sajson-build-with-gcc10.patch b/gnu/packages/patches/sajson-build-with-gcc10.patch new file mode 100644 index 0000000000..878706dc79 --- /dev/null +++ b/gnu/packages/patches/sajson-build-with-gcc10.patch @@ -0,0 +1,45 @@ +This patch is from the upstream pull request +https://github.com/chadaustin/sajson/pull/54. +It fixes linking with GCC. + +diff --git a/include/sajson.h b/include/sajson.h +index 8b4e05a..1bd045b 100644 +--- a/include/sajson.h ++++ b/include/sajson.h +@@ -138,12 +138,17 @@ constexpr inline size_t make_element(tag t, size_t value) { + // header. This trick courtesy of Rich Geldreich's Purple JSON parser. + template + struct globals_struct { ++ static const unsigned char parse_flags[256]; ++}; ++typedef globals_struct<> globals; ++ + // clang-format off + + // bit 0 (1) - set if: plain ASCII string character + // bit 1 (2) - set if: whitespace + // bit 4 (0x10) - set if: 0-9 e E . +- constexpr static const uint8_t parse_flags[256] = { ++ template ++ const unsigned char globals_struct::parse_flags[256] = { + // 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, // 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 +@@ -162,15 +167,13 @@ struct globals_struct { + }; + + // clang-format on +-}; +-typedef globals_struct<> globals; + +-constexpr inline bool is_plain_string_character(char c) { ++inline bool is_plain_string_character(char c) { + // return c >= 0x20 && c <= 0x7f && c != 0x22 && c != 0x5c; + return (globals::parse_flags[static_cast(c)] & 1) != 0; + } + +-constexpr inline bool is_whitespace(char c) { ++inline bool is_whitespace(char c) { + // return c == '\r' || c == '\n' || c == '\t' || c == ' '; + return (globals::parse_flags[static_cast(c)] & 2) != 0; + } From patchwork Thu Oct 13 21:04:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43391 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 A6E1C27BBEA; Thu, 13 Oct 2022 22:08: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 8BEC127BBE9 for ; Thu, 13 Oct 2022 22:08:20 +0100 (BST) Received: from localhost ([::1]:48380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5RD-0005xg-C1 for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:08:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P3-00032P-Dj for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P2-0007Ug-MA for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P2-0005n5-FU for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 04/15] gnu: Add cbehave. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06: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.166569511822105 (code B ref 58261); Thu, 13 Oct 2022 21:06:04 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:18 +0000 Received: from localhost ([127.0.0.1]:35149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OG-0005kJ-4Q for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:17 -0400 Received: from mout01.posteo.de ([185.67.36.65]:59209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nu-0005hA-Bk for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:57 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id D6135240027 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695088; bh=/v+U3h5ILVWz56VBDwUv8OGMC9qq3QZiF67+ghyqIdc=; h=From:To:Cc:Subject:Date:From; b=j71PqMPE509BYf/fFdSZ+5fQuxrWySQIEoYKYUs9sPSlRKf2rbxFezk3GlWJfn7Fi jrc4GWo3BuLD4N4h1ukAUBHe/pcvys/Vyd7kPEZTyNGstnCk0ot94qRXKDXqEF+cYR X0i1IMFl9o6Wx+EdyRZ3gukZnGISMGsGfigoCaH0m0DlMgfwlAEIO4WI4UT6mM2ldT lPGOXdDvS+uY/0XPScepNVtZCJOOysjvEtJCdp6zWK/8Ws+kwO/83L5XGaxi/TgxFf rnrGrTPOv+oil8LNi64zKw3T/VDF6brlEJmMz3QDa36pES+j14VJdWWEttNWvyy3lV S1uLrT2gI0sHw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTr3DXlz6trC; Thu, 13 Oct 2022 23:04:48 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:13 +0000 Message-Id: <20221013210424.993-5-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/check.scm (cbehave): New variable. --- gnu/packages/check.scm | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 797fe71277..70dfbbac27 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -38,6 +38,7 @@ ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer ;;; Copyright © 2021 Hugo Lecomte ;;; Copyright © 2022 Maxime Devos +;;; Copyright © 2022 David Elsing ;;; ;;; This file is part of GNU Guix. ;;; @@ -3190,3 +3191,58 @@ (define-public python-pytest-regressions tables by saving expected data in a data directory (courtesy of pytest-datadir) that can be used to verify that future runs produce the same data.") (license license:expat))) + +(define-public cbehave + (let ((commit "5deaea0eaaf52f1c5ccdac0c68c003988f348fb4") + (revision "1")) + (package + (name "cbehave") + (version (git-version "0.2.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/bigwhite/cbehave") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0kicawxmxn059n3rmfc7r2q5wfjrqbr6lm8dmsi86ba76ak0f9gi")) + (snippet + #~(begin + (for-each + (lambda (file) + (delete-file file)) + '("Makefile.in" "aclocal.m4" "config.guess" "config.sub" + "configure" "depcomp" "install-sh" "libtool" + "ltmain.sh" "missing" "src/Makefile.in" + "src/example/Makefile.in")))))) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags #~(list "--enable-shared" "--disable-static") + #:phases + #~(modify-phases %standard-phases + (add-before 'bootstrap 'rename-configure.in + (lambda _ + (rename-file "configure.in" "configure.ac"))) + (add-after 'rename-configure.in 'set-AM_PROG_AR + (lambda _ + (substitute* "configure.ac" + (("^AC_PROG_LIBTOOL.*" orig) + (string-append "AM_PROG_AR\n" orig))))) + (add-after 'set-AM_PROG_AR 'enable-tests + (lambda _ + (let ((port (open-file "src/example/Makefile.am" "a"))) + (display (string-append "\nTESTS = calculator_test" + " text_editor_test string_test" + " product_database_test mock_test\n") + port) + (close-port port)))) + (add-before 'check 'create-dummy-file + (lambda _ + (invoke "touch" "src/example/foo.txt")))))) + (native-inputs (list autoconf automake libtool)) + (home-page "https://github.com/bigwhite/cbehave") + (synopsis "Behavior-driven development framework for C") + (description "CBehave is a C framework for behavior-driven development.") + (license license:apsl2)))) From patchwork Thu Oct 13 21:04:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43392 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 E968527BBEA; Thu, 13 Oct 2022 22:08:29 +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 8C69927BBE9 for ; Thu, 13 Oct 2022 22:08:29 +0100 (BST) Received: from localhost ([::1]:49754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5RM-0006Ga-ND for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:08:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P3-00032L-CS for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36089) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P1-0007Ua-C6 for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P1-0005mj-7l for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 05/15] gnu: Add tinydir. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06:03 +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.166569511522079 (code B ref 58261); Thu, 13 Oct 2022 21:06:03 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:15 +0000 Received: from localhost ([127.0.0.1]:35143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OE-0005k2-OF for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:15 -0400 Received: from mout01.posteo.de ([185.67.36.65]:33925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nv-0005hD-0e for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:55 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 831EE240028 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695089; bh=WEjO2xUfGUfJHiDrGCqsm4gPn5KttkaWp62v4uzPXeY=; h=From:To:Cc:Subject:Date:From; b=Q7CZMvgBfKanTyKmyREjlGRfmCKhJI7aSriKuX3oLLv1xj8lPUSBgp5vUjcVMBTkX 8rHptbmQUW3ncm6mg4/KMGkpq5yyiSBw+ZrBbHuSMzlNsut/nNmunuQWupcOAW9Ygp BEc3azSHnTFXDjLATzFMBKNhG2voPlpfxMTAR5oUFFmdykNhKihq9x6azxqGH439wy H3cgPzFcLJpPxLtGaS7uSVhBwVmINSBGn8+pZaSzMr5t1XYnD6v2oKlVSX5RCydvOW pLByof4ur/UDgg91Jsk3+TrEOQuI+IcP9RzWO5t5xeBKU+pOekSCnSoQsM8MTvBsxY 943SJq7MS3nAw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTs17V8z6tmB; Thu, 13 Oct 2022 23:04:49 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:14 +0000 Message-Id: <20221013210424.993-6-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/cpp.scm (tinydir): New variable. --- gnu/packages/cpp.scm | 41 +++++++++++++++++++ .../patches/tinydir-fix-cbehave-test.patch | 16 ++++++++ 2 files changed, 57 insertions(+) create mode 100644 gnu/packages/patches/tinydir-fix-cbehave-test.patch diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index b6a0a70ed7..7871660611 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -2093,3 +2093,44 @@ (define-public sajson (description "@code{sajson} is an in-place JSON parser with support for parsing with only a single memory allocation.") (license license:expat)))) + +(define-public tinydir + (package + (name "tinydir") + (version "1.2.5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cxong/tinydir") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1nprgdfx4i8wzc1idw6chan4fjfa75b5ll8kghdc0q2278pny259")) + (patches (search-patches "tinydir-fix-cbehave-test.patch")) + (modules '((guix build utils))) + (snippet '(delete-file-recursively "tests/cbehave")))) + (build-system cmake-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'path-cmake + (lambda _ + (substitute* "tests/CMakeLists.txt" + (("^include_dir.*cbehave.*") + (string-append "include_directories("#$cbehave "/include)")) + (("^add_subdir.*cbeha.*") "")))) + (add-before 'configure 'chdir + (lambda _ + (chdir "tests"))) + (replace 'install + (lambda _ + (install-file "../tinydir.h" + (string-append #$output "/include"))))))) + (native-inputs (list cbehave)) + (home-page "https://github.com/cxong/tinydir") + (synopsis "Directory listing wrapper") + (description "@code{tinydir} is a header-only C wrapper for listing +directory contents.") + (license license:bsd-2))) diff --git a/gnu/packages/patches/tinydir-fix-cbehave-test.patch b/gnu/packages/patches/tinydir-fix-cbehave-test.patch new file mode 100644 index 0000000000..84ecee12c2 --- /dev/null +++ b/gnu/packages/patches/tinydir-fix-cbehave-test.patch @@ -0,0 +1,16 @@ +Make test work with upstream cbehave +(tinydir bundles a modified version) + +diff --git a/tests/file_open_test.c b/tests/file_open_test.c +index 3e659bc..9f6f88d 100644 +--- a/tests/file_open_test.c ++++ b/tests/file_open_test.c +@@ -19,4 +19,7 @@ FEATURE(file_open, "File open") + SCENARIO_END + FEATURE_END + +-CBEHAVE_RUN("File open:", TEST_FEATURE(file_open)) ++int main(void) { ++ cbehave_feature _cfeatures[] = {{feature_idx(file_open)}}; ++ return cbehave_runner("File open:", _cfeatures); ++} From patchwork Thu Oct 13 21:04:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43390 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 A13CD27BBEA; Thu, 13 Oct 2022 22:07:50 +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 5D2AA27BBE9 for ; Thu, 13 Oct 2022 22:07:50 +0100 (BST) Received: from localhost ([::1]:42684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5Qj-0005fa-H8 for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:07:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P3-00032O-Db for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P1-0007Ue-Pq for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P1-0005mq-Km for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 06/15] gnu: Add optionparser. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06:03 +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.166569511522086 (code B ref 58261); Thu, 13 Oct 2022 21:06:03 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:15 +0000 Received: from localhost ([127.0.0.1]:35145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OF-0005k4-3k for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:15 -0400 Received: from mout02.posteo.de ([185.67.36.66]:34859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nv-0005hE-Qe for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:56 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 5305B240101 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695090; bh=+HDnWYXbih95168h1mcdHXf9NLtQInYIOnII2JH5StA=; h=From:To:Cc:Subject:Date:From; b=Z/EcqLQyhKXhl+bA7XBXZEbYxngfRVbcj4y3CyRmrmei7IEdZxB5q8LwPgNdnAiB7 yM3p7LXVXK1JdLF2QzCj4lzX8BSHdUL8jOgZlG+FHL5Q+qp4JV5LEsZfOnVeyicMC0 7SnY8LQagxWBC1ENWrFUovFXuiXFFNfwSnlwWQuGIzzA7dOTL92taYU0SXNgUGABbV do8UHqtIriV/OA274BSgp4+EjGfHJCpTgkHJ4B7UVdRiI5+DfnsTpQpkG6UqzdeNcD MMcxhbs+uYnh3+8lOuHPtXcy2hCahQqxJwqHmgRkjRZf4IFzAagx2J7iyzXYIt4PaM P/urRC6qXRYgw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTs6ZhHz6tmH; Thu, 13 Oct 2022 23:04:49 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:15 +0000 Message-Id: <20221013210424.993-7-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/cpp.scm (optionparser): New variable. --- gnu/packages/cpp.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 7871660611..51d146476f 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -2134,3 +2134,51 @@ (define-public tinydir (description "@code{tinydir} is a header-only C wrapper for listing directory contents.") (license license:bsd-2))) + +(define-public optionparser + (package + (name "optionparser") + (version "1.7") + (source (origin + (method url-fetch) + (uri + (string-append "mirror://sourceforge/optionparser/" + "optionparser-" version ".tar.gz")) + (sha256 + (base32 + "04gfxrdzwacaynb8scsz6rr7nh64n6yk6w9dh2qdhrxw4caqr0dk")))) + (outputs '("out" "doc")) + (build-system gnu-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'chdir + (lambda _ (chdir "src"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (begin + (invoke "./example_arg") + (invoke "./testparse") + (invoke "./testprintusage") + (invoke "./testodr") + (invoke "./example"))))) + (replace 'install + (lambda _ + (install-file "optionparser.h" + (string-append #$output "/include")))) + (add-after 'install 'install-doc + (lambda _ + (copy-recursively + "../html" + (string-append #$output:doc "/share/doc/optionparser/html"))))))) + (native-inputs (list doxygen)) + (home-page "https://optionparser.sourceforge.net/") + (synopsis "Header-only C++ library to parse command line options") + (description "This library can be used to handle the command line +arguments of a C++ program. It supports the short and long option formats of +getopt(), getopt_long() and getopt_long_only(), but has a more convenient +interface.") + (license license:expat))) From patchwork Thu Oct 13 21:04:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43385 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 A5E6027BBE9; Thu, 13 Oct 2022 22:06:48 +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 178CE27BBEA for ; Thu, 13 Oct 2022 22:06:47 +0100 (BST) Received: from localhost ([::1]:52932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5Pi-0003Ym-6R for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:06:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P3-00032M-Cw for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P2-0007Uf-62 for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P2-0005my-0z for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 07/15] gnu: Add sajson-for-gemmi. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06:03 +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.166569511622094 (code B ref 58261); Thu, 13 Oct 2022 21:06:03 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:16 +0000 Received: from localhost ([127.0.0.1]:35147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OF-0005kB-ET for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:16 -0400 Received: from mout01.posteo.de ([185.67.36.65]:55361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nw-0005hF-FO for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:57 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id F2343240027 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695091; bh=IWZ0Gtu/G8X7HUVM4xl8sRc99uIUqsH3k5jyIto+DXI=; h=From:To:Cc:Subject:Date:From; b=OiaaulYl144IN2JJq9wSoTF0hbo4lhMApfuTkLrXoPGhp6uoL22fYCreTzPlu1h8k WYIHzkEYUo2nn3nVMZCWbjzm5CP7ueFPBAiWHMhZZ558sXdoL71e4rZWMQHwcEsXVi ndiD5mEikYLKi2QG1ZVasOL7GpsgvnT3meecSu8XQOiWJSFQG+P/uGmievhxoLib+s DDjqwqdqLtYe+USut0E/I2oKjNTc2wvCXpaGB7gJtBdOW29jYWThw0Vna5BPHiRwRA OWG/X5Ex2r5ilDDAl5raDtJjf98hyxskW6Fgq+NPvp5W48PIEy6vZMsfs7LzEC7X2i EUgKLej0G9lpw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTt44wpz6tmH; Thu, 13 Oct 2022 23:04:50 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:16 +0000 Message-Id: <20221013210424.993-8-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 (sajson-for-gemmi): New variable. --- gnu/packages/chemistry.scm | 23 +++ .../sajson-for-gemmi-numbers-as-strings.patch | 195 ++++++++++++++++++ 2 files changed, 218 insertions(+) create mode 100644 gnu/packages/patches/sajson-for-gemmi-numbers-as-strings.patch diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index c517610fe8..723b7ee8db 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2020 Björn Höfling ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2021 Ricardo Wurmus +;;; Copyright © 2022 David Elsing ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,6 +28,7 @@ (define-module (gnu packages chemistry) #:use-module (guix utils) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (gnu packages) #:use-module (gnu packages algebra) @@ -35,6 +37,7 @@ (define-module (gnu packages chemistry) #: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 fontutils) #:use-module (gnu packages gl) @@ -50,8 +53,10 @@ (define-module (gnu packages chemistry) #:use-module (gnu packages qt) #:use-module (gnu packages serialization) #:use-module (gnu packages sphinx) + #:use-module (gnu packages stb) #:use-module (gnu packages xml) #:use-module (guix build-system cmake) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system python)) @@ -566,3 +571,21 @@ (define-public python-pymol used to prepare publication-quality figures, to share interactive results with your colleagues, or to generate pre-rendered animations.") (license license:bsd-3))) + +(define-public sajson-for-gemmi + (package/inherit sajson + (name "sajson-for-gemmi") + (source (origin + (inherit (package-source sajson)) + (patches (cons + (search-patch + "sajson-for-gemmi-numbers-as-strings.patch") + (origin-patches (package-source sajson)))))) + (arguments + (substitute-keyword-arguments (package-arguments sajson) + ;; This is a modified version used in gemmi, in which numbers are kept + ;; as strings. Building the tests fails with the modification. + ((#:tests? _ #f) #f) + ((#:phases phases) + #~(modify-phases #$phases + (delete 'build))))))) diff --git a/gnu/packages/patches/sajson-for-gemmi-numbers-as-strings.patch b/gnu/packages/patches/sajson-for-gemmi-numbers-as-strings.patch new file mode 100644 index 0000000000..6f476b8583 --- /dev/null +++ b/gnu/packages/patches/sajson-for-gemmi-numbers-as-strings.patch @@ -0,0 +1,195 @@ +Patch for gemmi: Keep numbers in JSON file as strings. + +Adapted from this commit of the bundled fork of sajson in gemmi: +https://github.com/project-gemmi/gemmi/commit/fccbca4f6040364ba708613e1429c2251872240d + +diff -ur a/include/sajson.h b/include/sajson.h +--- a/include/sajson.h ++++ b/include/sajson.h +@@ -411,43 +411,6 @@ + }; + } // namespace internal + +-namespace integer_storage { +-enum { word_length = 1 }; +- +-inline int load(const size_t* location) { +- int value; +- memcpy(&value, location, sizeof(value)); +- return value; +-} +- +-inline void store(size_t* location, int value) { +- // NOTE: Most modern compilers optimize away this constant-size +- // memcpy into a single instruction. If any don't, and treat +- // punning through a union as legal, they can be special-cased. +- static_assert( +- sizeof(value) <= sizeof(*location), +- "size_t must not be smaller than int"); +- memcpy(location, &value, sizeof(value)); +-} +-} // namespace integer_storage +- +-namespace double_storage { +-enum { word_length = sizeof(double) / sizeof(size_t) }; +- +-inline double load(const size_t* location) { +- double value; +- memcpy(&value, location, sizeof(double)); +- return value; +-} +- +-inline void store(size_t* location, double value) { +- // NOTE: Most modern compilers optimize away this constant-size +- // memcpy into a single instruction. If any don't, and treat +- // punning through a union as legal, they can be special-cased. +- memcpy(location, &value, sizeof(double)); +-} +-} // namespace double_storage +- + /// Represents a JSON value. First, call get_type() to check its type, + /// which determines which methods are available. + /// +@@ -585,70 +548,10 @@ + return length; + } + +- /// If a numeric value was parsed as a 32-bit integer, returns it. +- /// Only legal if get_type() is TYPE_INTEGER. +- int get_integer_value() const { +- assert_tag(tag::integer); +- return integer_storage::load(payload); +- } +- +- /// If a numeric value was parsed as a double, returns it. +- /// Only legal if get_type() is TYPE_DOUBLE. +- double get_double_value() const { +- assert_tag(tag::double_); +- return double_storage::load(payload); +- } +- +- /// Returns a numeric value as a double-precision float. +- /// Only legal if get_type() is TYPE_INTEGER or TYPE_DOUBLE. +- double get_number_value() const { +- assert_tag_2(tag::integer, tag::double_); +- if (value_tag == tag::integer) { +- return get_integer_value(); +- } else { +- return get_double_value(); +- } +- } +- +- /// Returns true and writes to the output argument if the numeric value +- /// fits in a 53-bit integer. This is useful for timestamps and other +- /// situations where integral values with greater than 32-bit precision +- /// are used, as 64-bit values are not understood by all JSON +- /// implementations or languages. +- /// Returns false if the value is not an integer or not in range. +- /// Only legal if get_type() is TYPE_INTEGER or TYPE_DOUBLE. +- bool get_int53_value(int64_t* out) const { +- // Make sure the output variable is always defined to avoid any +- // possible situation like +- // https://gist.github.com/chadaustin/2c249cb850619ddec05b23ca42cf7a18 +- *out = 0; +- +- assert_tag_2(tag::integer, tag::double_); +- switch (value_tag) { +- case tag::integer: +- *out = get_integer_value(); +- return true; +- case tag::double_: { +- double v = get_double_value(); +- if (v < -(1LL << 53) || v > (1LL << 53)) { +- return false; +- } +- int64_t as_int = static_cast(v); +- if (as_int != v) { +- return false; +- } +- *out = as_int; +- return true; +- } +- default: +- return false; +- } +- } +- + /// Returns the length of the string. + /// Only legal if get_type() is TYPE_STRING. + size_t get_string_length() const { +- assert_tag(tag::string); ++ assert_tag_3(tag::string, tag::integer, tag::double_); + return payload[1] - payload[0]; + } + +@@ -659,7 +562,7 @@ + /// embedded NULs. + /// Only legal if get_type() is TYPE_STRING. + const char* as_cstring() const { +- assert_tag(tag::string); ++ assert_tag_3(tag::string, tag::integer, tag::double_); + return text + payload[0]; + } + +@@ -667,7 +570,7 @@ + /// Returns a string's value as a std::string. + /// Only legal if get_type() is TYPE_STRING. + std::string as_string() const { +- assert_tag(tag::string); ++ assert_tag_3(tag::string, tag::integer, tag::double_); + return std::string(text + payload[0], text + payload[1]); + } + #endif +@@ -690,6 +593,10 @@ + assert(e1 == value_tag || e2 == value_tag); + } + ++ void assert_tag_3(tag e1, tag e2, tag e3) const { ++ assert(e1 == value_tag || e2 == value_tag || e3 == value_tag); ++ } ++ + void assert_in_bounds(size_t i) const { assert(i < get_length()); } + + const tag value_tag; +@@ -2059,6 +1966,8 @@ + std::pair parse_number(char* p) { + using internal::tag; + ++ size_t start = p - input.get_data(); ++ + // Assume 32-bit, two's complement integers. + static constexpr unsigned RISKY = INT_MAX / 10u; + unsigned max_digit_after_risky = INT_MAX % 10u; +@@ -2235,23 +2144,18 @@ + u = 0u - u; + } + } ++ ++ bool success; ++ size_t* out = allocator.reserve(2, &success); ++ if (SAJSON_UNLIKELY(!success)) { ++ return std::make_pair(oom(p, "number"), tag::null); ++ } ++ out[0] = start; ++ out[1] = p - input.get_data(); ++ + if (try_double) { +- bool success; +- size_t* out +- = allocator.reserve(double_storage::word_length, &success); +- if (SAJSON_UNLIKELY(!success)) { +- return std::make_pair(oom(p, "double"), tag::null); +- } +- double_storage::store(out, d); + return std::make_pair(p, tag::double_); + } else { +- bool success; +- size_t* out +- = allocator.reserve(integer_storage::word_length, &success); +- if (SAJSON_UNLIKELY(!success)) { +- return std::make_pair(oom(p, "integer"), tag::null); +- } +- integer_storage::store(out, static_cast(u)); + return std::make_pair(p, tag::integer); + } + } From patchwork Thu Oct 13 21:04:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43386 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 5C24127BBEA; Thu, 13 Oct 2022 22:06:57 +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 AD05C27BBE9 for ; Thu, 13 Oct 2022 22:06:56 +0100 (BST) Received: from localhost ([::1]:59610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5Pr-0003xG-Qd for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:06:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P7-00033u-4n for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P4-0007VB-B6 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-0005nZ-5p for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 08/15] gnu: Add gemmi. 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.166569512022137 (code B ref 58261); Thu, 13 Oct 2022 21:06:06 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:20 +0000 Received: from localhost ([127.0.0.1]:35157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OJ-0005ks-UN for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:20 -0400 Received: from mout01.posteo.de ([185.67.36.65]:35259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nz-0005ha-Kn 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 9EAAC240027 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695091; bh=Q2lEA2faRu8zy11QOt+w6OkaUhkUhPUw/mCXjD9ih30=; h=From:To:Cc:Subject:Date:From; b=D44FkDa8PtTEg2iUKTZq4vkgaS0klvnh/NovZIIbbO2NChupr76Y2/CM2MQEdk09X SFXZD4RYDBN+QsnI2PQBSw9k0oFjMdf1GXRxVeMwT93T/suJmZS0ntbR5c/pmjXlmU PYkTbaIWK9oAUmWv+qj4SrNI4cza/fVmht3fx3rod6OlbpmiW4rhIhJqyKOHl9CaZ2 XgFiYs480rLNmGehi+v8lf49R4mHMe4tLmcUElJO1pamAzdWSktEQBycITop1VpHcM 79dk6DnteOynjWTE5bg3L2KR7GEgY4vbnfGgqwMFOVZwb/+swrDuxTagJ8/lWbhf7I gfyXa/r8lV1BQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTv1qnGz6tnd; Thu, 13 Oct 2022 23:04:51 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:17 +0000 Message-Id: <20221013210424.993-9-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 (gemmi): New variable. --- gnu/packages/chemistry.scm | 96 +++++++++++++++++++ .../patches/gemmi-fix-pegtl-usage.patch | 31 ++++++ .../patches/gemmi-fix-sajson-types.patch | 11 +++ 3 files changed, 138 insertions(+) create mode 100644 gnu/packages/patches/gemmi-fix-pegtl-usage.patch create mode 100644 gnu/packages/patches/gemmi-fix-sajson-types.patch diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 723b7ee8db..c6b8376248 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -589,3 +589,99 @@ (define-public sajson-for-gemmi ((#:phases phases) #~(modify-phases #$phases (delete 'build))))))) + +(define-public gemmi + (package + (name "gemmi") + (version "0.5.7") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/project-gemmi/gemmi") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "00km5q726bslrw7xbfwb3f3mrsk19qbimfnl3hvr4wi1y3z8i18a")) + (patches + (search-patches "gemmi-fix-sajson-types.patch" + "gemmi-fix-pegtl-usage.patch")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file-recursively "include/gemmi/third_party") + (delete-file-recursively "third_party"))))) + (outputs '("out" "bin" "python")) + (build-system cmake-build-system) + (native-inputs + (list fast-float + optionparser + pegtl + pocketfft-cpp + pybind11 + sajson-for-gemmi + stb-sprintf + tinydir)) + (inputs (list python zlib)) + (arguments + (list + #:modules '((guix build cmake-build-system) + (guix build utils) + ((guix build python-build-system) + #:select (site-packages))) + #:imported-modules (append %cmake-build-system-modules + '((guix build python-build-system))) + #:configure-flags + #~(list "-DUSE_PYTHON=ON" + (string-append "-DPYTHON_INSTALL_DIR=" + (site-packages %build-inputs %outputs))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-includes + (lambda _ + (substitute* + (list + "include/gemmi/sprintf.hpp" + "include/gemmi/dirwalk.hpp" + "include/gemmi/cif.hpp" + "include/gemmi/json.hpp" + "python/gemmi.cpp" + "include/gemmi/atof.hpp" + "include/gemmi/numb.hpp" + "include/gemmi/fourier.hpp") + (("") "") + (("\"third_party/tinydir.h\"") "") + (("\"third_party/tao/pegtl.hpp\"") "") + (("\"third_party/sajson.h\"") "") + (("\"gemmi/third_party/tao/pegtl/parse_error.hpp\"") + "") + (("\"third_party/fast_float.h\"") + "") + (("\"third_party/pocketfft_hdronly.h\"") + "")))) + (add-after 'unpack 'change-bin-prefix + (lambda _ + (substitute* "CMakeLists.txt" + (("install\\(TARGETS program DESTINATION bin\\)") + (string-append + "install(TARGETS program DESTINATION " + #$output:bin "/bin)"))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "../source" + (setenv "PYTHONPATH" "../build") + (invoke "python3" "-m" "unittest" "discover" "-v" + "-s" "tests")))))))) + (home-page "https://gemmi.readthedocs.io/en/latest/") + (synopsis "Macromolecular crystallography library and utilities") + (description "GEMMI is a C++ library for macromolecular crystallography. +It can be used for working with +@enumerate +@item macromolecular models (content of PDB, PDBx/mmCIF and mmJSON files), +@item refinement restraints (CIF files), +@item reflection data (MTZ and mmCIF formats), +@item data on a 3D grid (electron density maps, masks, MRC/CCP4 format) +@item crystallographic symmetry. +@end enumerate") + (license license:mpl2.0))) diff --git a/gnu/packages/patches/gemmi-fix-pegtl-usage.patch b/gnu/packages/patches/gemmi-fix-pegtl-usage.patch new file mode 100644 index 0000000000..3667474847 --- /dev/null +++ b/gnu/packages/patches/gemmi-fix-pegtl-usage.patch @@ -0,0 +1,31 @@ +Use the definitions from (newer) upstream PEGTL. + +diff --git a/include/gemmi/cif.hpp b/include/gemmi/cif.hpp +index c7ffdb44..35d24210 100644 +--- a/include/gemmi/cif.hpp ++++ b/include/gemmi/cif.hpp +@@ -37,7 +37,6 @@ namespace pegtl = tao::pegtl; + namespace rules { + + template struct lookup_char { +- using analyze_t = pegtl::analysis::generic; + template static bool match(Input& in) { + if (!in.empty() && cif::char_table(in.peek_char()) == TableVal) { + if (TableVal == 2) // this set includes new-line +@@ -71,11 +70,11 @@ namespace rules { + struct ws_or_eof : pegtl::sor {}; + + // (b) Reserved words. +- struct str_data : TAOCPP_PEGTL_ISTRING("data_") {}; +- struct str_loop : TAOCPP_PEGTL_ISTRING("loop_") {}; +- struct str_global : TAOCPP_PEGTL_ISTRING("global_") {}; +- struct str_save : TAOCPP_PEGTL_ISTRING("save_") {}; +- struct str_stop : TAOCPP_PEGTL_ISTRING("stop_") {}; ++ struct str_data : TAO_PEGTL_ISTRING("data_") {}; ++ struct str_loop : TAO_PEGTL_ISTRING("loop_") {}; ++ struct str_global : TAO_PEGTL_ISTRING("global_") {}; ++ struct str_save : TAO_PEGTL_ISTRING("save_") {}; ++ struct str_stop : TAO_PEGTL_ISTRING("stop_") {}; + struct keyword : pegtl::sor {}; + diff --git a/gnu/packages/patches/gemmi-fix-sajson-types.patch b/gnu/packages/patches/gemmi-fix-sajson-types.patch new file mode 100644 index 0000000000..9633ddac8b --- /dev/null +++ b/gnu/packages/patches/gemmi-fix-sajson-types.patch @@ -0,0 +1,11 @@ +diff -ur a/include/gemmi/json.hpp b/include/gemmi/json.hpp +--- a/include/gemmi/json.hpp ++++ b/include/gemmi/json.hpp +@@ -38,6 +38,7 @@ + + inline std::string as_cif_value(const sajson::value& val) { + switch (val.get_type()) { ++ case sajson::TYPE_INTEGER: + case sajson::TYPE_DOUBLE: + return val.as_string(); + case sajson::TYPE_NULL: From patchwork Thu Oct 13 21:04:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43387 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 2A7D927BBE9; Thu, 13 Oct 2022 22:07:09 +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 13A1027BBEA for ; Thu, 13 Oct 2022 22:07:05 +0100 (BST) Received: from localhost ([::1]:59612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5Q0-00047k-4Y for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:07:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P3-00032N-D8 for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36093) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P3-0007Uj-31 for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P2-0005nD-Tv for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 09/15] gnu: Add freesasa. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06: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.166569511922113 (code B ref 58261); Thu, 13 Oct 2022 21:06:04 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:19 +0000 Received: from localhost ([127.0.0.1]:35151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OI-0005kU-1P for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:19 -0400 Received: from mout02.posteo.de ([185.67.36.66]:34785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nx-0005hH-RG for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:58 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 57EC2240101 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695092; bh=d52oTREH465b1cVlWmsh9LgN+tmCIg/imYKO6s7j27g=; h=From:To:Cc:Subject:Date:From; b=jn8QKYFspIJfZrdmUg1WDOEmIrjznvnFn9O/iQu9BhgSc6Y8mFmCeFV2V/veDf1US 4nJJu3P51CpqjP4iplX4eMAriSyPWATGcI6yyi9Oo2g//KGOoESyGp7YnOCBMZq61i g+q01iR/U4ecihi8n/wxyAZLNKGKGQYFDh2CiRfat348D92CcP+TbASTD2U+llyQvP vYwFLFDOGGr7Ctre2AQE3lQMNzK2hmubmI0XgEpF2hgPslQTPeERIzvVlTdEz/UyFH sDRyjIBd0VKajV1Lh48rJrw05enZlvJbO3eVqtMilJDBv9FPjX3a/aKg17U2OvBEMw eOmdGnZMA+LEA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTv6vTbz6tnd; Thu, 13 Oct 2022 23:04:51 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:18 +0000 Message-Id: <20221013210424.993-10-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 (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 c6b8376248..a9868ed64d 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) @@ -685,3 +688,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") + (description "FreeSASA is a command line tool and C-library for +calculating @acronym{SASAs, 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))) From patchwork Thu Oct 13 21:04:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43388 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 A9D1227BBEA; Thu, 13 Oct 2022 22:07:14 +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 6185527BBE9 for ; Thu, 13 Oct 2022 22:07:14 +0100 (BST) Received: from localhost ([::1]:51250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5Q9-0004YO-Ic for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:07:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P7-00033r-4B for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36095) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P3-0007VA-Td 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 1oj5P3-0005nR-Ot for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 10/15] gnu: Add maeparser. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06:05 +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.166569512022129 (code B ref 58261); Thu, 13 Oct 2022 21:06:05 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:20 +0000 Received: from localhost ([127.0.0.1]:35155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OJ-0005kp-I4 for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:19 -0400 Received: from mout01.posteo.de ([185.67.36.65]:40107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nz-0005hb-Kn 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 05FFE240029 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695093; bh=2QmAVmeULfPqXDeiy0Wu4AcytRymfaVMLyY+I1KUpqs=; h=From:To:Cc:Subject:Date:From; b=NxSxAUxpT1aIhUQpidkVNOg+pWRsSHeAakNccILNT3o3u1w16RQ/nDMpiVwDxkfxs zgXyLwACfmd+Mi7iTDx1Kiv1CCU6d6cZ/ei2TsEP6QAMzMIoOhSEuFxCopcq3g8qnT AyuUNrKuD9RD8ZKqhJh2cZHzms6hxmPZULy0NS4tJQ6YUjsnPqvI9Ev06AzP3u2+xW gVJecfoja6icqE+FHE6zSEzlBAG3a5uqtKM425C8HTPehTdox0ZVcz6Vx1fExmFF9b powWjkJ76YsqWyWxTNikNHUsgC0TDpuaFvq5rbv0sFuLMXAvhQ5RLj9CYaCyVm/D00 vWLqvdD/+fCYg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTw4VZgz6tpd; Thu, 13 Oct 2022 23:04:52 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:19 +0000 Message-Id: <20221013210424.993-11-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 (maeparser): New variable. --- gnu/packages/chemistry.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index a9868ed64d..0712c44ad9 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -771,3 +771,24 @@ (define-public freesasa can be parameterized to arbitrary precision, and for high resolution versions of the algorithms, the calculations give identical results.") (license license:expat))) + +(define-public maeparser + (package + (name "maeparser") + (version "1.3.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/schrodinger/maeparser") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1yv4y5hn49fhylziigsg922bb244lb57p69r7vg9q899zd3l5b7l")))) + (build-system cmake-build-system) + (native-inputs (list boost)) + (inputs (list zlib)) + (home-page "https://github.com/schrodinger/maeparser") + (synopsis "Maestro file parser") + (description "maeparser is a parser for Schrodinger Maestro files.") + (license license:expat))) From patchwork Thu Oct 13 21:04:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43394 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 E893727BBEA; Thu, 13 Oct 2022 22:09:10 +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 A453927BBE9 for ; Thu, 13 Oct 2022 22:09:10 +0100 (BST) Received: from localhost ([::1]:33712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5S1-0006xS-S9 for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:09:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P7-00033f-1e for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36094) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P3-0007V9-NX for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P3-0005nK-BQ for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 11/15] gnu: Add coordgenlibs. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06:05 +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.166569511922121 (code B ref 58261); Thu, 13 Oct 2022 21:06:05 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:19 +0000 Received: from localhost ([127.0.0.1]:35153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OJ-0005kc-5A for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:19 -0400 Received: from mout02.posteo.de ([185.67.36.66]:55181) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5Nz-0005hP-6P for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:04:59 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id AD583240103 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695093; bh=8byrgJxPEs3MjxtUlkCioVgZjZ/SfO6Ge5c8/pjNbhg=; h=From:To:Cc:Subject:Date:From; b=KEgUo+d1t6vDtcIH+zvb7OzpTJpBjiFdZj4DQgGhQ6qajvritEIiZU35bRxbwQbpE kHlClc3BMuvlS+rfpr842g0S5ottOQXyM8EvM8NDN9DCAuv95vUzd9d6BmGpdhZz+o S3qBqqMMrY9OmzU9e0+vZAVfsctB5i+yJVyObJg0WoF8XCHOAlMBIHAbyQ4mSl/RWw 91jPcKkbwEMSfSYm1xAUUU79l64OTAGAcKgYV+cdKDyeF1k2IkXspUzYR6m2a/W7an PZx52G2kBOpAHawt+jFtpTUjkEro000tnNzKdvEj+HHQAw1EmCfk5CjVo1ouJgKshR V1w40HsUvsgpA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTx2GSFz6tmH; Thu, 13 Oct 2022 23:04:53 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:20 +0000 Message-Id: <20221013210424.993-12-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 (coordgenlibs): New variable. --- gnu/packages/chemistry.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 0712c44ad9..4da1bc10f1 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -792,3 +792,31 @@ (define-public maeparser (synopsis "Maestro file parser") (description "maeparser is a parser for Schrodinger Maestro files.") (license license:expat))) + +(define-public coordgenlibs + (package + (name "coordgenlibs") + (version "3.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/schrodinger/coordgenlibs/") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0d09x3v38i9y184bml020bq7xizdrdwng38qmdxlplzfhqkjdidv")))) + (build-system cmake-build-system) + (native-inputs (list boost)) + (inputs (list maeparser)) + (arguments + (list + #:configure-flags + #~(list "-DCOORDGEN_RIGOROUS_BUILD=OFF" + "-DCOORDGEN_USE_MAEPARSER=ON"))) + (home-page "https://github.com/schrodinger/coordgenlibs/") + (synopsis "2D molecule coordinate generation") + (description "@code{coordgenlibs} contains algorithms to generate 2D +coordinates of molecules including macrocycles and metal complexes. It has an +emphasis on quality rather than speed.") + (license license:bsd-3))) 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))) From patchwork Thu Oct 13 21:04:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43397 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 2C09127BBEA; Thu, 13 Oct 2022 22:09:35 +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 9142027BBE9 for ; Thu, 13 Oct 2022 22:09:34 +0100 (BST) Received: from localhost ([::1]:59114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5SP-0007Q0-Pe for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:09:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P7-00033t-5G for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36098) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P5-0007VD-AX for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P4-0005nn-WB for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 13/15] gnu: Add avalon-toolkit. 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.166569512122153 (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]:35161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OL-0005l8-6C for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:21 -0400 Received: from mout01.posteo.de ([185.67.36.65]:41571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5O0-0005hf-HX for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:01 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0F0F1240027 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695095; bh=wl1BKsrz+eoAxE6R3d/THFqWqbcOoKEVh7637CuoC+o=; h=From:To:Cc:Subject:Date:From; b=kwpZoLM359qko766kDce9cs0K3xTdL7sLMYGDmrKqp+U9VFti2y29qHxdw7uXhQBb FGduoMk5N55pVtjTnWEc6F3Ot1wu/q/ILfohG10A8wRvo6M2KFmKWAvYX9cmftezzq 8Y/4xNmcZG/VKFmhh2irwCKWTajlK4VT/g11MGwgBsEVOfcEMZc53AzZX5ZNLV7PLh 4sXnb2++y82J49qvJlKGdVC5LHFId/cxHmOl+HXFixuILUKi08fgu1qEGmqI/ALbln /9jKwu/r0ucIjGtl98C9jCAa1G2lIGXTySZVognU4NMzXOqky7gfAB8W3+J4HUsAP6 +76Pk2eiPjG3Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTy4hKjz6tnG; Thu, 13 Oct 2022 23:04:54 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:22 +0000 Message-Id: <20221013210424.993-14-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 (avalon-toolkit): New variable. --- gnu/packages/chemistry.scm | 96 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index a1c1dbfa1b..82bc3ae29e 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -926,3 +926,99 @@ (define-public yaehmop Orbital Package} contains a program and library for performing extended Hückel calculations and analyzing the results.") (license license:bsd-2))) + +(define-public avalon-toolkit + (package + (name "avalon-toolkit") + (version "1.2.0") + (source + (origin + (method url-fetch) + (uri (string-append + "mirror://sourceforge/avalontoolkit/" + "AvalonToolkit_" (substring version 0 3) "/AvalonToolkit_" + version ".source.tar")) + (sha256 + (base32 + "0rnnyy6axs2da7aa4q6l30ldavbk49v6l22llj1adn74h1i67bpv")) + (modules '((guix build utils) (ice-9 ftw))) + (snippet + #~(begin + (delete-file-recursively "../SourceDistribution/java"))))) + (build-system gnu-build-system) + (arguments + (list + ;; There are no intended tests + #:tests? #f + #:phases + #~(let ((programs '("canonizer" "matchtest" "sketch" "smi2mol" "struchk"))) + (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'remove-free + (lambda _ + ;; Remove incorrect free of getenv result (patch also in rdkit) + (substitute* "common/reaccsio.c" + (("MyFree.*tempdir.*") "")))) + ;; The makefile has incorrect compiler flags and is missing some + ;; object files, so we build it ourselves. + (replace 'build + (lambda _ + (chdir "common") + (let* ((parts + (list + "aacheck" "casutils" "denormal" "depictutil" "didepict" + "fixcharges" "forio" "geometry" "graph" "hashcode" + "layout" "local" "pattern" "perceive" "reaccsio" + "rtutils" "set" "shortcut" "sketch" "ssmatch" "stereo" + "symbol_lists" "symboltable" "utilities")) + (objects (map (lambda (name) (string-append name ".o")) + parts))) + (for-each + (lambda (name) + (display (string-append "Compiling " name ".c\n")) + (invoke "gcc" "-c" "-fPIC" "-O2" + (string-append name ".c") + "-o" (string-append name ".o"))) + parts) + (display "Building shared library\n") + (apply invoke "gcc" "-fPIC" "-shared" "-lm" + "-o" "libavalontoolkit.so" "canonizer.c" "smi2mol.c" + "struchk.c" "patclean.c" objects) + ;; patclean is not built here as there is an undeclared + ;; variable in main(). + (for-each + (lambda (program) + (display (string-append "Building " program "\n")) + (invoke "gcc" "-L." "-lavalontoolkit" "-lm" "-O2" + (string-append "-Wl,-rpath=" #$output "/lib") + "-DMAIN" (string-append program ".c") "-o" program)) + programs)))) + (replace 'install + (lambda _ + ;; Executables + (for-each + (lambda (program) + (install-file program (string-append #$output "/bin"))) + programs) + (for-each + (lambda (name) + (symlink (string-append #$output "/bin/smi2mol") + (string-append #$output "/bin/" name))) + '("mol2smi" "rdf2smi" "mol2tbl" "mol2sma" "smi2rdf")) + ;; Library + (install-file "libavalontoolkit.so" + (string-append #$output "/lib")) + (for-each + (lambda (file) + (install-file file (string-append #$output + "/include/avalontoolkit"))) + (find-files "." "\\.h$")) + (install-file "../license.txt" + (string-append #$output "/share/doc/" + #$name "-" #$version "/")))))))) + (home-page "https://sourceforge.net/projects/avalontoolkit/") + (synopsis "Tools for SMILES and MOL files and for structure fingerprinting") + (description "This package contains a library and programs for +canonicalization of SMILES and MOL files, molecular structure fingerprinting +and rendering molecules.") + (license license:bsd-3))) From patchwork Thu Oct 13 21:04:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43396 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 E6F9827BBEA; Thu, 13 Oct 2022 22:09:27 +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 5729B27BBE9 for ; Thu, 13 Oct 2022 22:09:27 +0100 (BST) Received: from localhost ([::1]:59098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5SI-0007Ff-Gv for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:09:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P7-00033w-54 for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36099) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P5-0007VE-N7 for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P5-0005nv-Hl for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 14/15] gnu: Add ringdecomposerlib. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06:07 +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.166569512322161 (code B ref 58261); Thu, 13 Oct 2022 21:06:07 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:23 +0000 Received: from localhost ([127.0.0.1]:35163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5OL-0005lG-Lf for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:23 -0400 Received: from mout01.posteo.de ([185.67.36.65]:40577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5O1-0005hn-7G for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:02 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id B2EAC240027 for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695095; bh=SUL91lVQfctg1CdIhUb8ZqXqO5a/ldR7qqJQ3GZwRSA=; h=From:To:Cc:Subject:Date:From; b=kBVspxtrHTG2LbBUKasUraMJMt+hUZX4BGjffGc6M2/AN24N4qcK2KOvSaqxJbNVo Ws2RAQOiYpXlatB7VeRsc2eWm2MwfN59sWPh1TT0/ML68o38m+xs9Lv7JroOM6CGDR u/7ukL/b2lv00Ib9L0ugG9Jd00qHN1frwHywjOb7zASUEWI3YIou0sm4f6lgVlyESA rciz1NZgnJ/AgPC1DgOSDsFzAqJ375MyPpZsDkP9//uZFhch393zx4OZiuo2mw9tVH jvVcprmO4ff1Epf2zrOcOThBizwEe0kakp3m/UOhNXeqnnJQUgTKouhD/KuPaQy/ba HKx9slXS/feVA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMTz2QpKz6tnd; Thu, 13 Oct 2022 23:04:55 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:23 +0000 Message-Id: <20221013210424.993-15-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 (ringdecomposerlib): New variable. --- gnu/packages/chemistry.scm | 81 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 82bc3ae29e..1a80bd1ad5 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -1022,3 +1022,84 @@ (define-public avalon-toolkit canonicalization of SMILES and MOL files, molecular structure fingerprinting and rendering molecules.") (license license:bsd-3))) + +(define-public ringdecomposerlib + (package + (name "ringdecomposerlib") + (version "1.1.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/rareylab/RingDecomposerLib") + (commit (string-append "v" version "_rdkit")))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1rxzs2wpkkdi40wdzxc4sn0brk7dm7ivgqyfh38gf2f5c7pbg0wi")))) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags + #~(list "-DBUILD_PYTHON_WRAPPER=ON" + "-DPYTHON_EXECUTABLE=python3" + (string-append "-DPYTHON_FLAGS=;--prefix=" #$output ";--root=/")) + #:imported-modules (append %cmake-build-system-modules + '((guix build python-build-system))) + #:modules '((guix build cmake-build-system) + (guix build utils) + ((guix build python-build-system) + #:select (add-installed-pythonpath))) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'patch-cmake + (lambda _ + (substitute* (list "src/Test/CMakeLists.txt" + "src/RingDecomposerLib/CMakeLists.txt") + (("build_.*STATIC") "#")) + (substitute* "test/CMakeLists.txt" + (("STATIC_TEST") "SHARED_TEST")) + ;; Link Python library against shared library + (substitute* "src/python/CMakeLists.txt" + (("RingDecomposerLibStatic") "RingDecomposerLib")) + (substitute* "src/python/setup.py.in" + (("static_libs =.*") "static_libs = []\n") + (("shared_libs\\s*=.*") + (string-append + "shared_libs = ['RingDecomposerLib']")) + (("library_dirs\\s*=\\s*\\[\\]") + "library_dirs = ['${CMAKE_BINARY_DIR}/src/RingDecomposerLib']") + (("extra_objects=.*") + (string-append + "extra_link_args=['-Wl,-rpath=" #$output "/lib'],\n"))))) + (add-after 'build 'build-doc + (lambda _ + ;; Disable redundant LaTeX documentation + (substitute* "../source/documentation/sphinx/conf.py" + (("^(subprocess.*latex|shutil).*") "")) + (substitute* "../source/documentation/doxygen.cfg" + (("GENERATE_LATEX.*YES") "GENERATE_LATEX = NO")) + ;; Build HTML documentation + (invoke "sphinx-build" "-b" "html" + "../source/documentation/sphinx" "html"))) + (add-after 'install 'install-doc + (lambda _ + ;; Not reproducible + (delete-file-recursively "html/.doctrees") + (copy-recursively "html" + (string-append #$output "/share/doc/" + #$name "-" #$version "/html")))) + (delete 'check) + (add-after 'install 'check + (assoc-ref %standard-phases 'check)) + (add-before 'check 'set-pythonpath + (lambda* (#:key inputs outputs #:allow-other-keys) + (add-installed-pythonpath inputs outputs)))))) + (inputs (list python)) + (native-inputs (list doxygen python python-cython python-sphinx)) + (home-page "https://github.com/rareylab/RingDecomposerLib") + (synopsis "Library for calculating ring topology descriptions such as +unique ring families") + (description "ringdecomposerlib is a library for the calculation of +unique ring families, relevant cycles, the smallest set of smallest rings and +other ring topology descriptions.") + (license license:bsd-3))) From patchwork Thu Oct 13 21:04:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 43384 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 52DE327BBEA; Thu, 13 Oct 2022 22:06:44 +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 D028927BBE9 for ; Thu, 13 Oct 2022 22:06:42 +0100 (BST) Received: from localhost ([::1]:43036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oj5Pd-0003Iz-WF for patchwork@mira.cbaines.net; Thu, 13 Oct 2022 17:06:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oj5P7-00033v-5A for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36100) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oj5P6-0007VK-4T for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oj5P5-0005o2-VD for guix-patches@gnu.org; Thu, 13 Oct 2022 17:06:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58261] [PATCH v3 15/15] gnu: Add rdkit. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Oct 2022 21:06:07 +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.166569512422168 (code B ref 58261); Thu, 13 Oct 2022 21:06:07 +0000 Received: (at 58261) by debbugs.gnu.org; 13 Oct 2022 21:05:24 +0000 Received: from localhost ([127.0.0.1]:35165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5ON-0005lO-8a for submit@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:24 -0400 Received: from mout01.posteo.de ([185.67.36.65]:39021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oj5O1-0005i1-U2 for 58261@debbugs.gnu.org; Thu, 13 Oct 2022 17:05:04 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 6BB2D24002A for <58261@debbugs.gnu.org>; Thu, 13 Oct 2022 23:04:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665695096; bh=muGcSCHhv68R8Z61gA1GJwRoR/JTE2jBf+oc0mhdZ2s=; h=From:To:Cc:Subject:Date:From; b=MfNMK/i1fkLux5uMUbYrHEbmJ2Vo94y6oGM9aqily6ma5UpeuC52uTJIy9MKJSQiv KInh/PwgVF7T5Ut9mZbGJh4KvylGh4NLjmvuYrwkNyt+8CUvMHwfZVw8JyESfIo8iH PoNZnhVk4TjiDWjAVj1QqvKKxkpCZJykz0eAlxhKpClhVe+bjJNq4cW/l6kRYpPpsa 6WD1ID+4+Iwa7aRrAF2DgeteBkwdl2cP4dgiIFvAkEM9rB4HJLnWexT4/ij/3bWFnB AVHbut6fe9o4eYuCxVRcaR5ort4u7cdJK+PDqh5XM/fQO8EvKIv6tqlS4erwPuulne 335k8dxx1PLyA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MpMV009RGz6tnL; Thu, 13 Oct 2022 23:04:56 +0200 (CEST) From: David Elsing Date: Thu, 13 Oct 2022 21:04:24 +0000 Message-Id: <20221013210424.993-16-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 (rdkit): New variable. --- gnu/packages/chemistry.scm | 149 +++++++ ...rdkit-unbundle-external-dependencies.patch | 384 ++++++++++++++++++ 2 files changed, 533 insertions(+) create mode 100644 gnu/packages/patches/rdkit-unbundle-external-dependencies.patch diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 1a80bd1ad5..e72ecd6206 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -34,6 +34,7 @@ (define-module (gnu packages chemistry) #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) #:use-module (gnu packages backup) + #:use-module (gnu packages base) #:use-module (gnu packages bison) #:use-module (gnu packages boost) #:use-module (gnu packages check) @@ -41,10 +42,12 @@ (define-module (gnu packages chemistry) #:use-module (gnu packages cpp) #:use-module (gnu packages documentation) #:use-module (gnu packages flex) + #:use-module (gnu packages fonts) #:use-module (gnu packages fontutils) #:use-module (gnu packages gcc) #:use-module (gnu packages gl) #:use-module (gnu packages graphviz) + #:use-module (gnu packages gtk) #:use-module (gnu packages gv) #:use-module (gnu packages image) #:use-module (gnu packages maths) @@ -56,6 +59,7 @@ (define-module (gnu packages chemistry) #:use-module (gnu packages qt) #:use-module (gnu packages serialization) #:use-module (gnu packages sphinx) + #:use-module (gnu packages sqlite) #:use-module (gnu packages stb) #:use-module (gnu packages tex) #:use-module (gnu packages web) @@ -1103,3 +1107,148 @@ (define-public ringdecomposerlib unique ring families, relevant cycles, the smallest set of smallest rings and other ring topology descriptions.") (license license:bsd-3))) + +(define-public rdkit + (package + (name "rdkit") + (version "2022.03.5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/rdkit/rdkit") + (commit + (string-append + "Release_" (string-replace-substring version "." "_"))))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "19idgilabh04cbr1qj6zgrgsfjm248mmfz6fsr0smrd68d0xnml9")) + (patches + (search-patches "rdkit-unbundle-external-dependencies.patch")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Remove pickle files (only used in tests), + ;; as they are compiled programs + (for-each + (lambda (name) + (display (string-append name "\n")) + (delete-file name)) + (find-files "." "\\.pkl(\\.gz)?$")) + ;; Remove SQLite data files (can be generated) + (delete-file "Data/RDData.sqlt") + (delete-file "Data/RDTests.sqlt"))))) + (build-system cmake-build-system) + (arguments + (list + #:imported-modules (append %cmake-build-system-modules + '((guix build python-build-system))) + #:modules '((guix build cmake-build-system) + (guix build utils) + ((guix build python-build-system) + #:select (add-installed-pythonpath))) + #:configure-flags + #~(list + "-DRDK_BUILD_AVALON_SUPPORT=ON" + "-DRDK_BUILD_CAIRO_SUPPORT=ON" + "-DRDK_BUILD_FREESASA_SUPPORT=ON" + "-DRDK_BUILD_INCHI_SUPPORT=ON" + "-DRDK_BUILD_YAEHMOP_SUPPORT=ON" + (string-append "-DCATCH_DIR=" + #$(this-package-native-input "catch2") + "/include/catch2") + "-DRDK_INSTALL_INTREE=OFF" + "-DRDK_INSTALL_STATIC_LIBS=OFF" + (string-append + "-DRDK_OPTIMIZE_POPCNT=" + #$(let ((system (or (%current-target-system) + (%current-system)))) + (cond + ((string-prefix? "x86_64" system) "ON") + ((string-prefix? "i686" system) "ON") + (else "OFF")))) + "-DRDK_USE_FLEXBISON=ON" + (string-append + "-DCMAKE_INCLUDE_PATH=" + #$(this-package-input "avalon-toolkit") "/include/avalontoolkit")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'copy-external-dependencies + (lambda _ + (symlink + (string-append + (search-input-file + %build-inputs "/share/fonts/truetype/ComicNeue-Regular.ttf")) + "Data/Fonts/ComicNeue-Regular.ttf"))) + (add-after 'unpack 'fix-inchi-include + (lambda _ + (substitute* "Code/cmake/Modules/FindInchi.cmake" + (("inchi_api.h.*\\)") "inchi/inchi_api.h)") + (("INCHI_LIBRARY NAMES.*\\)") + "INCHI_LIBRARY NAMES inchi PATH_SUFFIXES inchi)") + (("find_library" prev) + (string-append + "list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.1)\n" + prev))) + (substitute* "External/INCHI-API/inchi.cpp" + (("") "")))) + (add-before 'build 'enable-bytecode-determinism + (lambda _ + (setenv "PYTHONHASHSEED" "0") + (setenv "PYTHONDONTWRITEBYTECODE" "1"))) + (add-after 'install 'pre-check + (lambda* (#:key inputs outputs #:allow-other-keys) + (with-directory-excursion "../source" + (invoke "sqlite3" "Data/RDData.sqlt" + ".read rdkit/Dbase/test_data/RDData.sqlite") + (invoke "sqlite3" "Data/RDTests.sqlt" + ".read rdkit/Dbase/test_data/RDTests.sqlite") + (setenv "RDBASE" (canonicalize-path "."))) + (add-installed-pythonpath inputs outputs))) + (delete 'check) + (add-after 'pre-check 'check + (lambda* (#:key tests? parallel-tests? #:allow-other-keys) + (when tests? + (let ((job-count (number->string + (if parallel-tests? (parallel-job-count) 1)))) + (invoke + "ctest" "-j" job-count + "-E" (string-append + (string-join + '(;; need pickled data + "(pyDiscreteValueVect" "pySparseIntVect" + "graphmoltestPickler" "pyPartialCharges" + "substructLibraryTest" "pyFeatures" + "pythonTestDirML" "pythonTestDirChem" + ;; Catching Python exception fails + "pyRanker)") "|")))))))))) + (native-inputs + (list bison + boost + catch2 + eigen + flex + freesasa + pkg-config + rapidjson + tar)) + (inputs + (list avalon-toolkit + cairo + coordgenlibs + font-comic-neue + freetype + inchi + maeparser + python + ringdecomposerlib + sqlite + yaehmop)) + (propagated-inputs + (list python-numpy python-cairocffi python-pillow)) + (home-page "https://rdkit.org/") + (synopsis "Collection of cheminformatics software") + (description "RDKit is a C++ and Python library for cheminformatics, which +includes (among other things) the analysis and modification of molecules in 2D +and 3D and descriptor generation for machine learning.") + (license license:bsd-3))) diff --git a/gnu/packages/patches/rdkit-unbundle-external-dependencies.patch b/gnu/packages/patches/rdkit-unbundle-external-dependencies.patch new file mode 100644 index 0000000000..8ee0611d3b --- /dev/null +++ b/gnu/packages/patches/rdkit-unbundle-external-dependencies.patch @@ -0,0 +1,384 @@ +Remove CMake code for downloading and builing bundled dependencies: +They are packaged separately as rapidjson, avalon-toolkit, freesasa, +ringdecomposerlib and yaehmop. + +diff --git a/Code/GraphMol/MolInterchange/CMakeLists.txt b/Code/GraphMol/MolInterchange/CMakeLists.txt +index 1673386a4..c3504e6f1 100644 +--- a/Code/GraphMol/MolInterchange/CMakeLists.txt ++++ b/Code/GraphMol/MolInterchange/CMakeLists.txt +@@ -1,18 +1,3 @@ +- +-if(NOT EXISTS "${CMAKE_SOURCE_DIR}/External/rapidjson-1.1.0") +- downloadAndCheckMD5("https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz" +- "${CMAKE_SOURCE_DIR}/External/rapidjson-1.1.0.tar.gz" +- "badd12c511e081fec6c89c43a7027bce") +- execute_process(COMMAND ${CMAKE_COMMAND} -E tar zxf +- ${CMAKE_SOURCE_DIR}/External/rapidjson-1.1.0.tar.gz +- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/External) +-else() +- message("-- Found RapidJSON source in ${CMAKE_SOURCE_DIR}/External") +-endif() +- +-include_directories(${CMAKE_SOURCE_DIR}/External/rapidjson-1.1.0/include) +- +- + rdkit_library(MolInterchange + Parser.cpp Writer.cpp + LINK_LIBRARIES GraphMol) +diff --git a/External/AvalonTools/AvalonTools.cpp b/External/AvalonTools/AvalonTools.cpp +index e6c382123..d83d80668 100644 +--- a/External/AvalonTools/AvalonTools.cpp ++++ b/External/AvalonTools/AvalonTools.cpp +@@ -24,15 +24,15 @@ + #include "AvalonTools.h" + + extern "C" { +-#include "local.h" +-#include "reaccs.h" +-#include "reaccsio.h" +-#include "utilities.h" +-#include "ssmatch.h" +-#include "smi2mol.h" +-#include "canonizer.h" +-#include "layout.h" +-#include "struchk.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + extern int RunStruchk(struct reaccs_molecule_t **mpp, + struct data_line_t *data_list); +diff --git a/External/AvalonTools/CMakeLists.txt b/External/AvalonTools/CMakeLists.txt +index 3e31195fc..314ba35b5 100644 +--- a/External/AvalonTools/CMakeLists.txt ++++ b/External/AvalonTools/CMakeLists.txt +@@ -2,107 +2,14 @@ if(NOT RDK_BUILD_AVALON_SUPPORT) + return() + endif(NOT RDK_BUILD_AVALON_SUPPORT) + +-if(NOT DEFINED AVALONTOOLS_DIR) +- set(AVALONTOOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SourceDistribution") +- set(fileToPatch "${CMAKE_CURRENT_SOURCE_DIR}/SourceDistribution/common/reaccsio.c") +- set(needDownload "TRUE") +- if(EXISTS "${fileToPatch}") +- file(READ "${fileToPatch}" buffer) +- if("${buffer}" MATCHES "//MyFree\\(\\(char \\*\\)tempdir\\);") +- set(needDownload "FALSE") +- endif() +- endif() +-else() +- string(REGEX REPLACE "\\\\" "/" AVALONTOOLS_DIR ${AVALONTOOLS_DIR}) +- set(needDownload "FALSE") +-endif() +- +-set(AVALON_SRC_PATH ${AVALONTOOLS_DIR}/common) +- +-if(needDownload) +- if(NOT DEFINED AVALONTOOLS_URL) +- set(AVALONTOOLS_URL "https://sourceforge.net/projects/avalontoolkit/files/AvalonToolkit_1.2/AvalonToolkit_1.2.0.source.tar") +- endif() +- if(NOT DEFINED AVALONTOOLS_MD5SUM) +- set(AVALONTOOLS_MD5SUM "092a94f421873f038aa67d4a6cc8cb54") +- endif() +- if(NOT DEFINED AVALONTOOLS_BASE) +- string(REGEX REPLACE "^.*/" "" AVALONTOOLS_BASE "${AVALONTOOLS_URL}") +- endif() +- downloadAndCheckMD5(${AVALONTOOLS_URL} "${CMAKE_CURRENT_SOURCE_DIR}/${AVALONTOOLS_BASE}" ${AVALONTOOLS_MD5SUM}) +- execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf +- ${CMAKE_CURRENT_SOURCE_DIR}/AvalonToolkit_1.2.0.source.tar +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +- # apply patch to AvalonTools +- configure_file("${fileToPatch}" "${fileToPatch}.orig" COPYONLY) +- file(READ "${fileToPatch}" buffer) +- string(REGEX REPLACE "MyFree\\(\\(char \\*\\)tempdir\\);" +- "//MyFree((char *)tempdir);" buffer "${buffer}") +- file(WRITE "${fileToPatch}" "${buffer}") +-endif() + + if (MSVC) + add_definitions("/D_CRT_SECURE_NO_WARNINGS") + add_compile_options(/wd4224 /wd4101 /wd4018 /wd4996 /wd4244 /wd4305 /wd4013 /wd4146 /wd4334 /wd4715 /wd4715 /nologo) + endif(MSVC) + +-set(avalon_clib_srcs ${AVALON_SRC_PATH}/layout.c +- ${AVALON_SRC_PATH}/symboltable.c +- ${AVALON_SRC_PATH}/patclean.c +- ${AVALON_SRC_PATH}/utilities.c +- ${AVALON_SRC_PATH}/symbol_lists.c +- ${AVALON_SRC_PATH}/stereo.c +- ${AVALON_SRC_PATH}/set.c +- ${AVALON_SRC_PATH}/perceive.c +- ${AVALON_SRC_PATH}/local.c +- ${AVALON_SRC_PATH}/graph.c +- ${AVALON_SRC_PATH}/geometry.c +- ${AVALON_SRC_PATH}/forio.c +- ${AVALON_SRC_PATH}/depictutil.c +- ${AVALON_SRC_PATH}/denormal.c +- ${AVALON_SRC_PATH}/casutils.c +- ${AVALON_SRC_PATH}/ssmatch.c +- ${AVALON_SRC_PATH}/rtutils.c +- ${AVALON_SRC_PATH}/smi2mol.c +- ${AVALON_SRC_PATH}/didepict.c +- ${AVALON_SRC_PATH}/pattern.c +- ${AVALON_SRC_PATH}/canonizer.c +- ${AVALON_SRC_PATH}/aacheck.c +- ${AVALON_SRC_PATH}/fixcharges.c +- ${AVALON_SRC_PATH}/struchk.c +- ${AVALON_SRC_PATH}/reaccsio.c +- ${AVALON_SRC_PATH}/hashcode.c +- ) +- +-# we need this to ensure that builds continue +-# to work on linux systems with older versions +-# of glibc when we're building with gcc-4.1. +-# Without this flag, we'll endup requiring +-# glibc 2.7. +-if(CMAKE_SYSTEM_NAME STREQUAL "Linux") +- add_definitions(-D_GNU_SOURCE=1) +-endif() +- +-if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-return-type -Wno-implicit-function-declaration -Wno-absolute-value -Wno-parentheses -Wno-logical-op-parentheses -Wno-dangling-else -Wno-format") +-endif() +-if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result -Wformat-overflow=0 -Wformat=0 -Wno-format-security -Wno-implicit-function-declaration") +-endif() +- +- +- +-rdkit_library(avalon_clib ${avalon_clib_srcs}) +-target_compile_definitions(avalon_clib PRIVATE RDKIT_AVALONLIB_BUILD) +-if((MSVC AND RDK_INSTALL_DLLS_MSVC) OR ((NOT MSVC) AND WIN32)) +- set_target_properties(avalon_clib PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +-endif() +- +-include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +-include_directories(${AVALON_SRC_PATH}) +- + rdkit_library(AvalonLib AvalonTools.cpp SHARED +- LINK_LIBRARIES avalon_clib SubstructMatch FileParsers SmilesParse GraphMol DataStructs ) ++ LINK_LIBRARIES -lavalontoolkit SubstructMatch FileParsers SmilesParse GraphMol DataStructs ) + target_compile_definitions(AvalonLib PRIVATE RDKIT_AVALONLIB_BUILD) + rdkit_headers(AvalonTools.h DEST GraphMol) + rdkit_test(testAvalonLib1 test1.cpp +diff --git a/External/AvalonTools/Wrap/pyAvalonTools.cpp b/External/AvalonTools/Wrap/pyAvalonTools.cpp +index fb24c497e..31997bc0a 100644 +--- a/External/AvalonTools/Wrap/pyAvalonTools.cpp ++++ b/External/AvalonTools/Wrap/pyAvalonTools.cpp +@@ -12,7 +12,7 @@ + #include + + extern "C" { +-#include "struchk.h" ++#include + } + + namespace python = boost::python; +diff --git a/External/FreeSASA/CMakeLists.txt b/External/FreeSASA/CMakeLists.txt +index 43dfbdc40..81165a143 100644 +--- a/External/FreeSASA/CMakeLists.txt ++++ b/External/FreeSASA/CMakeLists.txt +@@ -2,88 +2,8 @@ if(NOT RDK_BUILD_FREESASA_SUPPORT) + return() + endif(NOT RDK_BUILD_FREESASA_SUPPORT) + +-if(NOT DEFINED FREESASA_DIR) +- set(FREESASA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/freesasa") +- set(needDownload "TRUE") +- if(EXISTS "${FREESASA_DIR}/src/freesasa.h") +- set(needDownload "FALSE") +- endif() +-endif() +- +-if(needDownload) +- # don't actually use the md5 here +- set(FREESASA_VERSION "2.0.3") +- set(FREESASA_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/freesasa-${FREESASA_VERSION}") +- if(NOT EXISTS "${FREESASA_SRC_DIR}/src") +- downloadAndCheckMD5("https://github.com/mittinatten/freesasa/releases/download/${FREESASA_VERSION}/freesasa-${FREESASA_VERSION}.tar.gz" +- "${CMAKE_CURRENT_SOURCE_DIR}/master.tar.gz" +- "") +- execute_process(COMMAND ${CMAKE_COMMAND} -E tar zxf +- ${CMAKE_CURRENT_SOURCE_DIR}/master.tar.gz +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +- message("Copying freesasa2.c to ${FREESASA_SRC_DIR}/src/freesasa2.c") +- file(COPY freesasa2.c DESTINATION ${FREESASA_SRC_DIR}/src/) +- else() +- message("FreeSASA found in ${FREESASA_SRC_DIR}, no download required") +- endif() +-endif() +- +-set(CMAKE_C_STANDARD 99) +- +-set (freesasa_clib_srcs +- ${FREESASA_SRC_DIR}/src/classifier.c +- ${FREESASA_SRC_DIR}/src/classifier_naccess.c +- ${FREESASA_SRC_DIR}/src/classifier_oons.c +- ${FREESASA_SRC_DIR}/src/classifier_protor.c +- ${FREESASA_SRC_DIR}/src/coord.c +- ${FREESASA_SRC_DIR}/src/freesasa2.c +- ${FREESASA_SRC_DIR}/src/lexer.c +- ${FREESASA_SRC_DIR}/src/log.c +- ${FREESASA_SRC_DIR}/src/nb.c +- ${FREESASA_SRC_DIR}/src/node.c +- ${FREESASA_SRC_DIR}/src/parser.c +- ${FREESASA_SRC_DIR}/src/pdb.c +- ${FREESASA_SRC_DIR}/src/rsa.c +- ${FREESASA_SRC_DIR}/src/sasa_lr.c +- ${FREESASA_SRC_DIR}/src/sasa_sr.c +- ${FREESASA_SRC_DIR}/src/selection.c +- ${FREESASA_SRC_DIR}/src/structure.c +- ${FREESASA_SRC_DIR}/src/util.c +- ) +-if((MSVC AND RDK_INSTALL_DLLS_MSVC) OR ((NOT MSVC) AND WIN32)) +- set(freesasa_additional_exports ${CMAKE_CURRENT_SOURCE_DIR}/additional_exports.def) +- file(WRITE ${freesasa_additional_exports} +- "EXPORTS\n" +- "freesasa_default_parameters DATA\n" +- "freesasa_protor_classifier DATA\n" +- "freesasa_naccess_classifier DATA\n" +- "freesasa_oons_classifier DATA\n" +- ) +- set (freesasa_clib_srcs +- ${freesasa_clib_srcs} +- ${freesasa_additional_exports} +- ) +-endif() +- +-set (freesasa_h ${FREESASA_SRC_DIR}/src/freesasa.h) +-file(READ ${freesasa_h} freesasa_h_data) +-string(REGEX REPLACE "(#include )" "\\1\n#include " freesasa_h_data "${freesasa_h_data}") +-string(REGEX REPLACE "([^R][^D][^K][^I][^T][^_][^F][^R][^E][^E][^S][^A][^S][^A][^_][^C][^L][^I][^B][^_][^E][^X][^P][^O][^R][^T][^ ])(extern const)" "\\1RDKIT_FREESASA_CLIB_EXPORT \\2" freesasa_h_data "${freesasa_h_data}") +-file(WRITE ${freesasa_h} "${freesasa_h_data}") +- +-add_definitions(-DUSE_THREADS=0) +-add_definitions(-DUSE_JSON=0) +-add_definitions(-DUSE_XML=0) +-rdkit_library(freesasa_clib ${freesasa_clib_srcs}) +-target_compile_definitions(freesasa_clib PRIVATE RDKIT_FREESASALIB_BUILD) +- +-if((MSVC AND RDK_INSTALL_DLLS_MSVC) OR ((NOT MSVC) AND WIN32)) +- set_target_properties(freesasa_clib PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +-endif() +-include_directories("${FREESASA_SRC_DIR}/src") +- + rdkit_library(FreeSASALib RDFreeSASA.cpp SHARED +- LINK_LIBRARIES freesasa_clib GraphMol ) ++ LINK_LIBRARIES -lfreesasa GraphMol ) + target_compile_definitions(FreeSASALib PRIVATE RDKIT_FREESASALIB_BUILD) + + rdkit_headers(RDFreeSASA.h DEST GraphMol) +diff --git a/External/RingFamilies/CMakeLists.txt b/External/RingFamilies/CMakeLists.txt +index 08dd1fe04..66ecd5834 100644 +--- a/External/RingFamilies/CMakeLists.txt ++++ b/External/RingFamilies/CMakeLists.txt +@@ -1,47 +1,6 @@ +-add_custom_target(ringdecomposerlib_support ALL) +- + if(NOT RDK_USE_URF) + return() + endif(NOT RDK_USE_URF) + +-if(NOT DEFINED URFLIB_DIR) +- set(URFLIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/RingDecomposerLib/src/RingDecomposerLib") +-endif() +- +-if(NOT EXISTS "${URFLIB_DIR}/RingDecomposerLib.h") +- set(RELEASE_NO "1.1.3_rdkit") +- set(MD5 "e9a0bcdda8b921a35e812b9888a9a874") +- downloadAndCheckMD5("https://github.com/rareylab/RingDecomposerLib/archive/v${RELEASE_NO}.tar.gz" +- "${CMAKE_CURRENT_SOURCE_DIR}/RingDecomposerLib-v${RELEASE_NO}.tar.gz" ${MD5}) +- execute_process(COMMAND ${CMAKE_COMMAND} -E tar zxf +- ${CMAKE_CURRENT_SOURCE_DIR}/RingDecomposerLib-v${RELEASE_NO}.tar.gz +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +- file(RENAME "RingDecomposerLib-${RELEASE_NO}" "RingDecomposerLib") +-else() +- message("-- Found RingDecomposerLib source in ${URFLIB_DIR}") +-endif() +- +-set(urflib_INCLUDE_DIRS ${URFLIB_DIR} +- CACHE STRING "RingDecomposerLib Include Dir" FORCE) +-file(GLOB URFSOURCES "${URFLIB_DIR}/*.c") +- +-#if((MSVC AND RDK_INSTALL_DLLS_MSVC) OR ((NOT MSVC) AND WIN32 AND (NOT RDK_INSTALL_STATIC_LIBS))) +-if(WIN32) +- set (ringdecomposerlib_h ${URFLIB_DIR}/RingDecomposerLib.h) +- file(READ ${ringdecomposerlib_h} ringdecomposerlib_h_data) +- if (NOT "${ringdecomposerlib_h_data}" MATCHES "RDKIT_URFLIB_BUILD") +- string(REGEX REPLACE "(#if[ ]+\\([ ]*defined[ ]*\\([ ]*_WIN32[ ]*\\)[ ]*&&[ ]*)(defined\\([ ]*_MSC_VER[ ]*\\))" "\\1!defined( RDL_WIN_STATIC )" ringdecomposerlib_h_data "${ringdecomposerlib_h_data}") +- string(REGEX REPLACE "([ ]*)(#define[ ]+RDL_API[ ]+__declspec)(\\([ ]*dllexport[ ]*\\))" "\\1#ifdef RDKIT_URFLIB_BUILD\n\\1\\1\\2\\3\n\\1#else\n\\1\\1\\2(dllimport)\n\\1#endif" ringdecomposerlib_h_data "${ringdecomposerlib_h_data}") +- file(WRITE ${ringdecomposerlib_h} "${ringdecomposerlib_h_data}") +- endif() +-endif() +-rdkit_library(RingDecomposerLib ${URFSOURCES} SHARED) +-if((MSVC AND RDK_INSTALL_DLLS_MSVC) OR ((NOT MSVC) AND WIN32 AND (NOT RDK_INSTALL_STATIC_LIBS))) +- target_compile_definitions(RingDecomposerLib PRIVATE RDKIT_URFLIB_BUILD) +-endif() +-install(TARGETS RingDecomposerLib DESTINATION ${RDKit_LibDir}) +-rdkit_headers(${URFLIB_DIR}/RingDecomposerLib.h DEST "") +- +- +-set(RDK_URF_LIBS RingDecomposerLib +- CACHE STRING "the libraries for the URF calculation" FORCE) ++rdkit_library(RingDecomposerLib dummy.cpp SHARED LINK_LIBRARIES -lRingDecomposerLib) ++set(RDK_URF_LIBS RingDecomposerLib CACHE STRING "" FORCE) +diff --git a/External/RingFamilies/dummy.cpp b/External/RingFamilies/dummy.cpp +new file mode 100644 +index 000000000..e69de29bb +diff --git a/External/YAeHMOP/CMakeLists.txt b/External/YAeHMOP/CMakeLists.txt +index f1027b3bd..8bee2f910 100644 +--- a/External/YAeHMOP/CMakeLists.txt ++++ b/External/YAeHMOP/CMakeLists.txt +@@ -18,32 +18,8 @@ endif() + + include_directories( ${RDKit_ExternalDir}/YAeHMOP ) + +-ExternalProject_Add(yaehmop_project +- GIT_REPOSITORY https://github.com/greglandrum/yaehmop.git +- GIT_TAG master +- UPDATE_COMMAND "" +- PATCH_COMMAND "" +- PREFIX ${CMAKE_CURRENT_SOURCE_DIR} +- SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/yaehmop" +- SOURCE_SUBDIR "tightbind" +- CMAKE_ARGS -DUSE_BLAS_LAPACK=OFF -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +- TEST_COMMAND "") +- +-include_directories(${PROJECT_BINARY_DIR}/include) +-link_directories(${PROJECT_BINARY_DIR}/lib) +-link_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/yaehmop_project-build) +- +-set(EHT_PARAM_FILE ${CMAKE_CURRENT_SOURCE_DIR}/yaehmop/tightbind/eht_parms.dat ) +-install(FILES ${EHT_PARAM_FILE} +- DESTINATION ${RDKit_ShareDir}/Data +- COMPONENT data) +- +-message("YAeHMOP include_dirs: ${PROJECT_BINARY_DIR}/include") +-message("YAeHMOP link_dirs: ${PROJECT_BINARY_DIR}/lib ${CMAKE_CURRENT_SOURCE_DIR}/src/yaehmop_project-build") +- +-rdkit_library(EHTLib EHTTools.cpp SHARED LINK_LIBRARIES yaehmop_eht GraphMol ) ++rdkit_library(EHTLib EHTTools.cpp SHARED LINK_LIBRARIES -lyaehmop_eht GraphMol ) + target_compile_definitions(EHTLib PRIVATE RDKIT_EHTLIB_BUILD) +-add_dependencies(EHTLib yaehmop_project) + rdkit_headers(EHTTools.h DEST GraphMol) + rdkit_catch_test(testEHTLib1 test1.cpp + LINK_LIBRARIES EHTLib FileParsers SmilesParse ) +diff --git a/External/YAeHMOP/EHTTools.cpp b/External/YAeHMOP/EHTTools.cpp +index 7a229f51f..71033dc5c 100644 +--- a/External/YAeHMOP/EHTTools.cpp ++++ b/External/YAeHMOP/EHTTools.cpp +@@ -10,7 +10,7 @@ + #include + + extern "C" { +-#include ++#include + } + + namespace RDKit {