From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] gnu: Add openfoam Date: Tue, 25 Jul 2017 11:02:50 +0200 Message-ID: <871sp4nb2d.fsf@gnu.org> References: <20170723201138.18131-1-pgarlick@tourbillion-technology.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZvk2-0005v1-FX for guix-devel@gnu.org; Tue, 25 Jul 2017 05:03:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZvjy-0008Mn-Hy for guix-devel@gnu.org; Tue, 25 Jul 2017 05:02:58 -0400 In-Reply-To: <20170723201138.18131-1-pgarlick@tourbillion-technology.com> (Paul Garlick's message of "Sun, 23 Jul 2017 21:11:38 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Paul Garlick Cc: guix-devel@gnu.org Hello Paul, Thanks for this patch! Paul Garlick skribis: > * gnu/packages/maths.scm(openfoam): Add it > * gnu/packages/patches/openfoam-cleanup.patch: New file > * gnu/local.mk(dist_patch_DATA): Add patch I think it might make sense to create a new =E2=80=9Csimulation=E2=80=9D mo= dule, and eventually move OpenCascade there as well, WDYT? Some comments: > + (build-system trivial-build-system) Did you consider using =E2=80=98gnu-build-system=E2=80=99? I think this wo= uld save quite a few lines corresponding to the initial setup (set-paths, unpack, patch-shebang, etc.), and also ensure that the final phases (strip, compress-documentation, etc.) are run. In addition you wouldn=E2=80=99t ne= ed to list all the usual build inputs (GCC, Coreutils, Make, etc.). WDYT? > + ) > + ) > + ) > + ) Please listen to what =E2=80=98guix lint=E2=80=99 has to say about these. = :-) > + (native-search-paths > + ;; define the FOAM_INST_DIR variable > + (list (search-path-specification > + (variable "FOAM_INST_DIR") > + (files '("."))))) My guess is that =E2=80=98FOAM_INST_DIR=E2=80=99 is not a search path (in t= he sense of a colon-separated list of directories like =E2=80=98PATH=E2=80=99.) What about wrapping the resulting binaries so that they have =E2=80=98FOAM_INST_DIR=E2=80=99 set to %output? > diff --git a/gnu/packages/patches/openfoam-cleanup.patch b/gnu/packages/p= atches/openfoam-cleanup.patch > new file mode 100644 > index 000000000..e7760b7a5 > --- /dev/null > +++ b/gnu/packages/patches/openfoam-cleanup.patch > @@ -0,0 +1,267 @@ > +# This patch removes all need for the ThirdParty files of OpenFOAM Nice! > +# Derived from easybuild patch: Ward Poelmans > +# Modified for GNU Guix: Paul Garlick > + > +diff -ur OpenFOAM-4.x-version-4.1.org/applications/utilities/mesh/manipu= lation/setSet/Allwmake OpenFOAM-4.x-version-4.1/applications/utilities/mesh= /manipulation/setSet/Allwmake > +--- OpenFOAM-4.x-version-4.1.org/applications/utilities/mesh/manipulatio= n/setSet/Allwmake > ++++ OpenFOAM-4.x-version-4.1/applications/utilities/mesh/manipulation/se= tSet/Allwmake > +@@ -9,7 +9,7 @@ > + # > + # use readline if available > + # > +-if [ -f /usr/include/readline/readline.h ] > ++if [ -f $READLINE_ROOT/include/readline/readline.h ] You could make it =E2=80=9Cif true=E2=80=9D, thereby avoiding the need to d= efine $READLINE_ROOT. > +--- OpenFOAM-4.x-version-4.1.org/applications/utilities/mesh/manipulatio= n/setSet/Make/options > ++++ OpenFOAM-4.x-version-4.1/applications/utilities/mesh/manipulation/se= tSet/Make/options > +@@ -1,7 +1,9 @@ > + EXE_INC =3D \ > + -I$(LIB_SRC)/meshTools/lnInclude \ > ++ -I$(READLINE_ROOT)/include \ Likewise, =E2=80=98gnu-build-system=E2=80=99 will set C_INCLUDE_PATH approp= riately so this -I flag won=E2=80=99t be needed. Could you send an updated patch to guix-patches@gnu.org, where it will be visible in the patch tracker? Thank you! Ludo=E2=80=99.