From patchwork Fri Sep 2 20:34:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Paul A. Patience" X-Patchwork-Id: 42159 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 F1FF727BBEC; Fri, 2 Sep 2022 21:35:42 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 0B35427BBEA for ; Fri, 2 Sep 2022 21:35:42 +0100 (BST) Received: from localhost ([::1]:46282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUDO9-0004gn-7Y for patchwork@mira.cbaines.net; Fri, 02 Sep 2022 16:35:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUDNW-0004gc-Ll for guix-patches@gnu.org; Fri, 02 Sep 2022 16:35:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51782) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUDNW-000475-CQ for guix-patches@gnu.org; Fri, 02 Sep 2022 16:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oUDNV-0005mm-TT for guix-patches@gnu.org; Fri, 02 Sep 2022 16:35:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56638] [PATCH v3] gnu: Add asli. References: <20220719075934.67481-1-paul@apatience.com> In-Reply-To: <20220719075934.67481-1-paul@apatience.com> Resent-From: "Paul A. Patience" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Sep 2022 20:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56638 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56638@debbugs.gnu.org Cc: "Paul A. Patience" Received: via spool by 56638-submit@debbugs.gnu.org id=B56638.166215088422210 (code B ref 56638); Fri, 02 Sep 2022 20:35:01 +0000 Received: (at 56638) by debbugs.gnu.org; 2 Sep 2022 20:34:44 +0000 Received: from localhost ([127.0.0.1]:40481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUDNE-0005m9-9h for submit@debbugs.gnu.org; Fri, 02 Sep 2022 16:34:44 -0400 Received: from mail-4323.proton.ch ([185.70.43.23]:22659) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUDNB-0005lu-0g for 56638@debbugs.gnu.org; Fri, 02 Sep 2022 16:34:43 -0400 Date: Fri, 02 Sep 2022 20:34:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apatience.com; s=protonmail3; t=1662150873; x=1662410073; bh=p10XG4KWI+Vz9qhF+atbcNHrP6TYvERcIJaf5iPKOsk=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:Feedback-ID:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID; b=MC8aU6CwJB/c6gott6DSE/5XXNdjsUSRY0uJuJAkt/19ReGu/mogQh/Ks5WRSnDkn KqhPBNIIaxhvE88khE+v0JKfNvqKiNty1zv3aquDQdlbdJOQ+ytAFwm0MOwCN/dhWg gpy28Wobf7KIT4Y41SVVyTxuQkazx+k3dW8issvApb2mAL+s15ijgfJhgzO+dkTqtr cO9VEM8xTK6qlSmEuJ9XnCj9pcoiOJXKApHVuc9Az1AfPfky3B8Xm8BKUbG/x8Xf/n jzkbizh0sGEhQ+rASVH1sea+4khdMjp8/at/jOc0ZIqiRtU/cN7oOVHGk5wlzsrgv4 SfSVIltkyr+Yg== From: "Paul A. Patience" Message-ID: <20220902203420.17483-1-paul@apatience.com> Feedback-ID: 19227857:user:proton 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: , Reply-To: "Paul A. Patience" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/graphics.scm (asli): New variable. * gnu/packages/patches/asli-use-system-libs.patch: New file. * gnu/local.mk (dist_patch_DATA): Register patch. --- Ludo, I've added the header line to the patch file as you requested, but I can't reproduce your failure to build the derivation. The patch applies cleanly for me. What command are you running so I can try to reproduce it? Best regards, Paul gnu/local.mk | 1 + gnu/packages/graphics.scm | 74 +++++++++++++++++++ .../patches/asli-use-system-libs.patch | 72 ++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 gnu/packages/patches/asli-use-system-libs.patch -- 2.37.2 diff --git a/gnu/local.mk b/gnu/local.mk index 9d08fd5b28..5bee15ba1d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -867,6 +867,7 @@ dist_patch_DATA = \ %D%/packages/patches/aoflagger-use-system-provided-pybind11.patch \ %D%/packages/patches/apr-skip-getservbyname-test.patch \ %D%/packages/patches/ark-skip-xar-test.patch \ + %D%/packages/patches/asli-use-system-libs.patch \ %D%/packages/patches/aspell-CVE-2019-25051.patch \ %D%/packages/patches/aspell-default-dict-dir.patch \ %D%/packages/patches/ath9k-htc-firmware-binutils.patch \ diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index fdc72d5a8d..1200bb96c4 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -2295,6 +2295,80 @@ (define-public mmg @end itemize") (license license:lgpl3+))) +(define-public asli + (package + (name "asli") + (version "0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tpms-lattice/ASLI") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "02hwdavpsy3vmivd6prp03jn004ykrl11lbkvksy5i2zm38zbknr")) + (patches (search-patches "asli-use-system-libs.patch")) + (modules '((guix build utils))) + (snippet + ;; Remove bundled libraries except (the ones missing from Guix and) + ;; KU Leuven's mTT, which is an obscure (i.e., unfindable by searching + ;; online for “mTT KU Leuven”), BSD-3 licensed, header-only library. + #~(begin + ;;(delete-file-recursively "libs/AdaptTools") ; Missing from Guix + (delete-file-recursively "libs/CGAL") + ;;(delete-file-recursively "libs/alglib") ; Missing from Guix + (delete-file-recursively "libs/eigen") + (delete-file-recursively "libs/mmg") + ;;(delete-file-recursively "libs/tetgen") ; Missing from Guix + (delete-file-recursively "libs/yaml"))))) + (build-system cmake-build-system) + (inputs + (list boost + cgal + eigen + gmp + `(,mmg "lib") + mpfr + tbb-2020 + yaml-cpp)) + (arguments + (list #:tests? #f ; No tests + #:configure-flags + #~(list "-DCGAL_ACTIVATE_CONCURRENT_MESH_3=ON" + (string-append "-DEIGEN3_INCLUDE_DIR=" + #$(this-package-input "eigen") + "/include/eigen3") + (string-append "-DMMG_INCLUDE_DIR=" + (ungexp (this-package-input "mmg") "lib") + "/include") + (string-append "-DMMG_LIBRARY_DIR=" + (ungexp (this-package-input "mmg") "lib") + "/lib")) + #:phases + #~(modify-phases %standard-phases + (replace 'install ; No install phase + (lambda _ + (with-directory-excursion "../source/bin" + (install-file "ASLI" (string-append #$output "/bin")) + ;; The manual is included in the repository. + ;; Building it requires -DASLI_DOC=ON, but this is marked + ;; as unsupported (presumably for users). + ;; Besides, some of the LaTeX packages it uses are + ;; missing from Guix, for example emptypage, fvextra and + ;; menukeys. + (install-file "docs/ASLI [User Manual].pdf" + (string-append #$output "/share/doc/" + #$name "-" #$version)))))))) + (home-page "http://www.biomech.ulg.ac.be/ASLI/") + (synopsis "Create lattice infills with varying unit cell type, size and feature") + (description "ASLI (A Simple Lattice Infiller) is a command-line tool that +allows users to fill any 3D geometry with a functionally graded lattice. The +lattice infill is constructed out of unit cells, described by implicit +functions, whose type, size and feature can be varied locally to obtain the +desired local properties.") + (license license:agpl3+))) + (define-public f3d ;; There have been many improvements since the last tagged version (1.2.1, ;; released in December 2021), including support for the Alembic file diff --git a/gnu/packages/patches/asli-use-system-libs.patch b/gnu/packages/patches/asli-use-system-libs.patch new file mode 100644 index 0000000000..6c4518e04e --- /dev/null +++ b/gnu/packages/patches/asli-use-system-libs.patch @@ -0,0 +1,72 @@ +Adjust CMakeLists.txt to use system-provided mmg and yaml-cpp libraries. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b11c5ba..702423e 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,28 +122,8 @@ if(MMG_MESH) + add_definitions(-DMMG_MESH) + + # MMG +- set(MMG_PREFIX mmg3d) +- set(MMG_PREFIX_DIR ${CMAKE_CURRENT_BINARY_DIR}/${MMG_PREFIX}) +- set(MMG_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/${MMG_PREFIX}) +- ExternalProject_Add(${MMG_PREFIX} +- PREFIX ${MMG_PREFIX_DIR} +- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/mmg +- +- BUILD_ALWAYS OFF +- INSTALL_DIR ${MMG_INSTALL_DIR} +- +- CMAKE_ARGS(-DCMAKE_BUILD_TYPE=Release -DBUILD=MMG3D -DLIBMMG3D_STATIC=ON +- -DLIBMMG3D_SHARED=OFF -DCMAKE_INSTALL_PREFIX=) +- +- BUILD_COMMAND make +- INSTALL_COMMAND make install +- ) +- set(MMG3D_INCLUDE_DIRS "${MMG_INSTALL_DIR}/include") +- set(MMG3D_LIBRARIES "${MMG_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${MMG_PREFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") +- +- include_directories(${MMG3D_INCLUDE_DIRS}) +- #add_library(MMG3D STATIC IMPORTED) +- #set_target_properties(MMG3D PROPERTIES IMPORTED_LOCATION "${MMG3D_LIBRARIES}") ++ include_directories(${MMG_INCLUDE_DIR}) ++ set(MMG3D_LIBRARIES ${MMG_LIBRARY_DIR}/libmmg3d.so) + + # MshMet + set(MSHMET_PREFIX mshmet) +@@ -192,14 +172,8 @@ target_include_directories(tet PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libs/tetgen) + target_compile_definitions(tet PUBLIC TETLIBRARY) # -DTETLIBRARY: flag to compile tetgen as a library + + # yaml +-file(GLOB yaml_SRC CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libs/yaml/src/*.cpp) # Using file GLOB is not recomended! +-add_library(yaml STATIC) +-target_include_directories(yaml +- PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libs/yaml/include +- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libs/yaml/src +-) +-target_sources(yaml PRIVATE ${yaml_SRC}) +-set_target_properties(yaml PROPERTIES CXX_STANDARD 11) ++find_package(yaml-cpp REQUIRED) ++include_directories(${YAML_CPP_INCLUDE_DIRS}) + + # Compile options for debuging + if(CMAKE_BUILD_TYPE MATCHES Debug) +@@ -259,7 +233,7 @@ if(MARCH_NATIVE) + endif() + + # Create entries for C++ files in "ASLI" routine +-target_link_libraries(ASLI PUBLIC alg tet yaml) ++target_link_libraries(ASLI PUBLIC alg tet ${YAML_CPP_LIBRARIES}) + if(NOT MSVC) + target_link_libraries(ASLI PUBLIC stdc++fs) + endif() +@@ -272,7 +246,7 @@ if(CGAL_MESH) + endif() + + if(MMG_MESH) +- add_dependencies(ASLI ${MMG_PREFIX} ${MSHMET_PREFIX}) ++ add_dependencies(ASLI ${MSHMET_PREFIX}) + target_link_libraries(ASLI PUBLIC ${MMG3D_LIBRARIES} ${MSHMET_LIBRARIES}) + if(SCOTCH_FOUND) + target_link_libraries(ASLI PUBLIC ${SCOTCH_LIBRARIES} scotch)