From patchwork Fri Dec 1 20:21:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: reza X-Patchwork-Id: 57185 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 2391A27BBE9; Fri, 1 Dec 2023 20:23:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_PASS, URIBL_BLOCKED autolearn=no 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 0013327BBE2 for ; Fri, 1 Dec 2023 20:23:17 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9A2M-00051G-5D; Fri, 01 Dec 2023 15:22:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9A2H-0004zM-Pw for guix-patches@gnu.org; Fri, 01 Dec 2023 15:22:53 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9A2H-0005JW-I6 for guix-patches@gnu.org; Fri, 01 Dec 2023 15:22:53 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r9A2Q-0000by-3m for guix-patches@gnu.org; Fri, 01 Dec 2023 15:23:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#66262] [PATCH v7 7/7] gnu: openfoam-org: Improve wrapping of binaries. Resent-From: reza Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Dec 2023 20:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66262 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66262@debbugs.gnu.org <66262@debbugs.gnu.org> Cc: reza Received: via spool by 66262-submit@debbugs.gnu.org id=B66262.17014621282282 (code B ref 66262); Fri, 01 Dec 2023 20:23:02 +0000 Received: (at 66262) by debbugs.gnu.org; 1 Dec 2023 20:22:08 +0000 Received: from localhost ([127.0.0.1]:56162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9A1Y-0000aj-4B for submit@debbugs.gnu.org; Fri, 01 Dec 2023 15:22:08 -0500 Received: from a2-134.smtp-out.eu-west-1.amazonses.com ([54.240.2.134]:59169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <0102018c270b602e-42d16a77-013b-4cca-ac8d-cc731d174e67-000000@mail.housseini.me>) id 1r9A1W-0000ZN-DO for 66262@debbugs.gnu.org; Fri, 01 Dec 2023 15:22:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=solmzk3ljecfoypi3q6x2mqs3bucnhjw; d=housseini.me; t=1701462106; h=Subject:From:To:Cc:Date:Mime-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Message-Id; bh=H6TF7FPnOeAZJssF5z+ScDO97VXouVgNqBPGjMS+Hcw=; b=DPU5DbvOEG7yBK9nRqIyoGYRJznZ0aqN+Y9XZZ6EtCIxOm1H3iIPvS5a7gQUztzl rvl9sDDa9HSwchzXbYWsS73RNOWHJW87bkndxaVNFqX9CDtYtNrf9Tb2U21JM57K2+t 5+6Hmc0/nu+PNQAy8HdbfmLHsmYqNe6YLvfEZgZo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=shh3fegwg5fppqsuzphvschd53n6ihuv; d=amazonses.com; t=1701462106; h=Subject:From:To:Cc:Date:Mime-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Message-Id:Feedback-ID; bh=H6TF7FPnOeAZJssF5z+ScDO97VXouVgNqBPGjMS+Hcw=; b=dlhaw6BGWkDmn8LX1sdk4ac7chfOFNzD4CUv3EaX3Dpjp2ptvUmmUVbai4KNX9uO a0LH6KMliPnXTlAv+QFmNZqgHaeJwGy7n2FYoa2iNyh/dD7ifAp3csnep2bD/zE/8Iq xL9mp/0jOW4oBPlA1ykVH1tA64UPG+QMY8cd61Ys= Date: Fri, 1 Dec 2023 20:21:46 +0000 Mime-Version: 1.0 In-Reply-To: <5a90ca452eac7f8947a241bf0900ca928acc311f.1701462064.git.reza@housseini.me> References: <5a90ca452eac7f8947a241bf0900ca928acc311f.1701462064.git.reza@housseini.me> X-Mailer: Amazon WorkMail Thread-Index: AQHaJJPzxeoHSzDjRfGKH1PaN4MhNQAAA3Xp Thread-Topic: [PATCH v7 7/7] gnu: openfoam-org: Improve wrapping of binaries. X-Wm-Sent-Timestamp: 1701462105 X-Original-Mailer: git-send-email 2.41.0 Message-ID: <0102018c270b602e-42d16a77-013b-4cca-ac8d-cc731d174e67-000000@eu-west-1.amazonses.com> Feedback-ID: 1.eu-west-1.b24dn6frgCi6dh20skzbuMRr7UL8M6Soir/3ogtEjHQ=:AmazonSES X-SES-Outgoing: 2023.12.01-54.240.2.134 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: reza X-ACL-Warn: , reza via Guix-patches X-Patchwork-Original-From: reza via Guix-patches via From: reza Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/simulation.scm (openfoam-org): Add all variables from etc/bashrc to the wrapping of binaries. Change-Id: Idf0d4d9a043dfff806b6fb1871c1931794c1935b --- gnu/packages/simulation.scm | 159 +++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 4 deletions(-) -- 2.41.0 diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm index f01044e76a..6b61783c2c 100644 --- a/gnu/packages/simulation.scm +++ b/gnu/packages/simulation.scm @@ -401,15 +401,166 @@ (define-public openfoam-org (add-after 'add-symbolic-link 'wrap (lambda* (#:key python inputs outputs #:allow-other-keys) (let* ((bin (string-append #$output "/bin")) - (openfoam (string-append #$output - "/share/OpenFOAM-" - #$(package-version this-package)))) + (openfoam-version #$(package-version this-package)) + (openfoam-root (string-append #$output + "/share/OpenFOAM-" + openfoam-version)) + (openmpi-version #$(package-version openmpi)) + (paraview-version #$(package-version paraview)) + (paraview-version-major+minor + #$(version-major+minor (package-version paraview)))) (for-each (lambda (program) (unless (member program '("." "..")) + ;; wrap the programs with all the variables created by sourcing + ;; etc/bashrc (wrap-program (string-append bin "/" program) - `("WM_PROJECT_DIR" ":" prefix (,openfoam))))) + `("WM_PROJECT_INST_DIR" = (,openfoam-root)) + `("WM_PROJECT_DIR" = (,openfoam-root)) + '("WM_PROJECT" = ("OpenFOAM")) + `("WM_PROJECT_VERSION" = (,openfoam-version)) + '("WM_COMPILER_TYPE" = ("system")) + '("WM_COMPILER" = ("Gcc")) + '("WM_ARCH_OPTION" = ("64")) + '("WM_PRECISION_OPTION" = ("DP")) + '("WM_LABEL_SIZE" = ("32")) + '("WM_COMPILE_OPTION" = ("Opt")) + '("WM_MPLIB" = ("OPENMPI")) + '("WM_OSTYPE" = ("POSIX")) + '("WM_OPTIONS" = ("linux64GccDPInt32Opt")) + `("WM_PROJECT_USER_DIR" = (,(string-append + "$HOME/OpenFOAM/$USER-" + openfoam-version))) + `("WM_THIRD_PARTY_DIR" = (,(string-append + openfoam-root + "/ThirdParty-" + openfoam-version))) + '("WM_LABEL_OPTION" = ("Int32")) + '("WM_LINK_LANGUAGE" = ("c++")) + '("WM_COMPILER_LIB_ARCH" = ("64")) + `("WM_DIR" = (,(string-append openfoam-root "/wmake"))) + '("WM_LDFLAGS" = ("-m64")) + '("WM_CC" = ("gcc")) + '("WM_CFLAGS" = ("-m64 -fPIC")) + '("WM_CXX" = ("g++")) + '("WM_CXXFLAGS" = ("-m64 -fPIC -std=c++0x")) + + `("FOAM_INST_DIR" = (,openfoam-root)) + `("FOAM_APP" = (,(string-append openfoam-root + "/applications"))) + `("FOAM_SRC" = (,(string-append openfoam-root "/src"))) + `("FOAM_ETC" = (,(string-append openfoam-root "/etc"))) + `("FOAM_TUTORIALS" = (,(string-append openfoam-root + "/tutorials"))) + `("FOAM_UTILITIES" = (,(string-append + openfoam-root + "/applications/utilities"))) + `("FOAM_SOLVERS" = (,(string-append + openfoam-root + "/applications/solvers"))) + `("FOAM_MPI" = (,(string-append "openmpi-" + openmpi-version))) + `("FOAM_RUN" = (,(string-append "$HOME/OpenFOAM/$USER-" + openfoam-version "/run"))) + `("FOAM_EXT_LIBBIN" = (,(string-append + openfoam-root + "/ThirdParty-" + openfoam-version + "/platforms/linux64GccDPInt32/lib"))) + `("FOAM_APPBIN" = (,(string-append + openfoam-root + "/platforms/linux64GccDPInt32Opt/bin"))) + `("FOAM_JOB_DIR" = (,(string-append openfoam-root + "/jobControl"))) + `("FOAM_LIBBIN" = (,(string-append + openfoam-root + "/platforms/linux64GccDPInt32Opt/lib"))) + `("FOAM_SITE_LIBBIN" = (,(string-append + openfoam-root + "/site/" + openfoam-version + "/platforms/linux64GccDPInt32Opt/lib"))) + `("FOAM_SITE_APPBIN" = (,(string-append + openfoam-root + "/site/" + openfoam-version + "/platforms/linux64GccDPInt32Opt/bin"))) + `("FOAM_USER_LIBBIN" = (,(string-append + "$HOME/OpenFOAM/$USER-" + openfoam-version + "/platforms/linux64GccDPInt32Opt/lib"))) + `("FOAM_USER_APPBIN" = (,(string-append + "$HOME/OpenFOAM/$USER-" + openfoam-version + "/platforms/linux64GccDPInt32Opt/bin"))) + `("FOAM_MODULES" = (,(string-append openfoam-root + "/applications/modules"))) + '("FOAM_SIGFPE" = ("")) + '("FOAM_SETTINGS" = ("")) + + `("ParaView_INCLUDE_DIR" = (,(string-append #$paraview + "/include/paraview-" + paraview-version-major+minor))) + '("ParaView_GL" = ("mesa")) + `("ParaView_VERSION" = (,paraview-version)) + `("ParaView_MAJOR" = (,paraview-version-major+minor)) + `("ParaView_DIR" = (,#$paraview)) + `("PV_PLUGIN_PATH" = (,(string-append + openfoam-root + "/platforms/linux64GccDPInt32Opt/lib/paraview-" + paraview-version-major+minor))) + + `("MPI_ARCH_PATH" = (,#$openmpi)) + `("OPAL_PREFIX" = (,#$openmpi)) + '("MPI_BUFFER_SIZE" = ("20000000")) + + `("LD_LIBRARY_PATH" prefix + (,(string-append openfoam-root "/ThirdParty-" + openfoam-version + "/platforms/linux64Gcc/gperftools-svn/lib") + ,(string-append #$paraview "/lib") + ,(string-append openfoam-root + "/platforms/linux64GccDPInt32Opt/lib/openmpi-" + openmpi-version) + ,(string-append openfoam-root "/ThirdParty-" + openfoam-version + "/platforms/linux64GccDPInt32/lib/openmpi-" + openmpi-version) + ,(string-append #$openmpi "/lib") + ,(string-append #$openmpi "/lib64") + ,(string-append "$HOME/OpenFOAM/$USER-" + openfoam-version + "/platforms/linux64GccDPInt32Opt/lib") + ,(string-append openfoam-root "/site/" + openfoam-version + "/platforms/linux64GccDPInt32Opt/lib") + ,(string-append openfoam-root + "/platforms/linux64GccDPInt32Opt/lib") + ,(string-append openfoam-root "/ThirdParty-" + openfoam-version + "/platforms/linux64GccDPInt32/lib") + ,(string-append openfoam-root + "/platforms/linux64GccDPInt32Opt/lib/dummy"))) + `("PATH" prefix + (,(string-append openfoam-root "/ThirdParty-" + openfoam-version + "/platforms/linux64Gcc/gperftools-svn/bin") + ,(string-append #$paraview "/bin") + ,(string-append openfoam-root "/ThirdParty-" + openfoam-version + "/platforms/linux64Gcc/cmake-*/bin") + ,(string-append #$openmpi "/bin") + ,(string-append openfoam-root "/bin") + ,(string-append openfoam-root "/wmake") + ,(string-append "$HOME/OpenFOAM/$USER-" + openfoam-version + "/platforms/linux64GccDPInt32Opt/bin") + ,(string-append openfoam-root "/site/" + openfoam-version + "/platforms/linux64GccDPInt32Opt/bin") + ,(string-append openfoam-root + "/platforms/linux64GccDPInt32Opt/bin")))))) (scandir bin)))))))) ;; Note: ;; Tutorial files are installed read-only in /gnu/store.