diff options
author | Winston Wu | 2015-07-21 09:33:39 -0400 |
---|---|---|
committer | Winston Wu | 2015-07-21 09:33:39 -0400 |
commit | 1ccedeeb44c8a92b8c5c441cf7427aff30818c1a (patch) | |
tree | c6f13c0e856740ecfdfbac225d3dac93c38fec5b | |
download | aur-1ccedeeb44c8a92b8c5c441cf7427aff30818c1a.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 32 | ||||
-rw-r--r-- | PKGBUILD | 107 | ||||
-rw-r--r-- | decomp-options.patch | 12 | ||||
-rw-r--r-- | openfoam.install | 20 | ||||
-rw-r--r-- | paraFoam.patch | 38 | ||||
-rw-r--r-- | prefs.sh | 4 | ||||
-rw-r--r-- | scotch-options.patch | 9 | ||||
-rw-r--r-- | scotch.sh | 2 |
8 files changed, 224 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e480405fc85d --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,32 @@ +pkgbase = openfoam2.4-git + pkgdesc = The open source CFD toolbox + pkgver = 20150717.a6f90b1 + pkgrel = 1 + url = http://www.openfoam.com + install = openfoam.install + arch = i686 + arch = x86_64 + license = GPL + makedepends = git + depends = cgal + depends = paraview + depends = parmetis + depends = scotch + depends = boost + provides = openfoam + conflicts = openfoam + source = git+https://github.com/OpenFOAM/OpenFOAM-2.4.x.git + source = decomp-options.patch + source = paraFoam.patch + source = scotch-options.patch + source = prefs.sh + source = scotch.sh + md5sums = SKIP + md5sums = 98fd4f7bb2fd43a0854a583b41d47349 + md5sums = 4e6fdb19fd35f221ea98ede05a65476e + md5sums = f0aa8f083d67cddeea684cd3b4fec1e0 + md5sums = SKIP + md5sums = SKIP + +pkgname = openfoam2.4-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..ff64ada8abab --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,107 @@ +# Original Contributor: aquavitae <aquavitae69: gmail> +# Current Maintainer: Andrew Fischer <andrew_at_ltengsoft.com> + +pkgname=openfoam2.4-git + +# The distributors package name +_distpkgname=OpenFOAM +_distpkgver=2.4.x +_gitname=$_distpkgname-$_distpkgver +pkgver=20150717.a6f90b1 +pkgrel=1 +pkgdesc="The open source CFD toolbox" +arch=('i686' 'x86_64') +url="http://www.openfoam.com" +license=('GPL') +groups=() +depends=('cgal' 'paraview' 'parmetis' 'scotch' 'boost') +makedepends=('git') +optdepends=() +provides=('openfoam') +conflicts=('openfoam') +replaces=() +backup=() +options=() +source=(git+https://github.com/OpenFOAM/OpenFOAM-2.4.x.git + 'decomp-options.patch' + 'paraFoam.patch' + 'scotch-options.patch' + 'prefs.sh' + 'scotch.sh') +noextract=() +install=openfoam.install +md5sums=('SKIP' + '98fd4f7bb2fd43a0854a583b41d47349' + '4e6fdb19fd35f221ea98ede05a65476e' + 'f0aa8f083d67cddeea684cd3b4fec1e0' + 'SKIP' + 'SKIP') + +pkgver() { + cd "$srcdir/$_gitname" + git log -1 --date=short --format="%cd.%h" | tr -d '-' +} + + +build() { + # Extract the current version and major of paraview and of scotch for use in the system preferences + _pversion1=`pacman -Q {paraview,paraview-manta,paraview-git} | sed -e 's/.* //; s/-.*//g'` + _pversion=`echo $_pversion1 | grep .` + _pmajor=`echo $_pversion | cut -d '.' -f1` + _sversion=`pacman -Q scotch | sed -e 's/.* //; s/-.*//g'` + + # Generate and install the system preferences file + echo "compilerInstall=system" > $startdir/prefs.sh + echo "export WM_MPLIB=SYSTEMOPENMPI" >> $startdir/prefs.sh + echo "export ParaView_VERSION=$_pversion" >> $startdir/prefs.sh + echo "export ParaView_MAJOR=$_pmajor" >> $startdir/prefs.sh + cp $startdir/prefs.sh $srcdir/$_gitname/etc || return 1 + + # Generate the scotch.sh file for arch + echo "export SCOTCH_VERSION=scotch_$_sversion" > $startdir/scotch.sh + echo "export SCOTCH_ARCH_PATH=/usr" >> $startdir/scotch.sh + cp $startdir/scotch.sh $srcdir/$_gitname/etc/config || return 1 + + # Patch for archlinux parmetis, paraview and openmpi paths, and ptscotch link lines + patch -p1 < $startdir/decomp-options.patch + patch -p1 < $startdir/paraFoam.patch + patch -p1 < $startdir/scotch-options.patch + + # Setup the build environment + export FOAM_INST_DIR=$srcdir + foamDotFile=$srcdir/$_gitname/etc/bashrc + [ -f $foamDotFile ] && . $foamDotFile || return 1 + + # Enter build directory + cd "$srcdir/$_gitname" || return 1 + + # Build and clean up OpenFOAM + ./Allwmake || return 1 + wclean all || return 1 + wmakeLnIncludeAll || return 1 + +} +package() { + cd "$startdir" + + # Create destination directories + install -d "$pkgdir/opt/$_distpkgname" "$pkgdir/etc/profile.d" || return 1 + + # Move package to pkgdir + mv "$srcdir/$_gitname" "$pkgdir/opt/$_distpkgname/$_gitname" || return 1 + + # Add source file + echo "export FOAM_INST_DIR=/opt/$_distpkgname" > "$pkgdir/etc/profile.d/openfoam.sh" || return 1 + echo "alias ofoam=\"\$FOAM_INST_DIR/$_gitname/etc/bashrc\"" >> "$pkgdir/etc/profile.d/openfoam.sh" || return 1 + + # Add stub thirdparty directory to keep openfoam happy + install -d "$pkgdir/opt/$_distpkgname/ThirdParty-$_distpkgver" || return 1 + + # Permission fixes - for system-wide install and use + chmod -R go+r "$pkgdir/opt" + chmod -R 755 "$pkgdir/opt/$_distpkgname/$_gitname/bin" + chmod -R 755 "$pkgdir/opt/$_distpkgname/$_gitname/etc" +} + + + diff --git a/decomp-options.patch b/decomp-options.patch new file mode 100644 index 000000000000..bd29e9e07e1b --- /dev/null +++ b/decomp-options.patch @@ -0,0 +1,12 @@ +--- src/OpenFOAM-2.4.x/src/parallel/decompose/metisDecomp/Make/options ++++ src/OpenFOAM-2.4.x/src/parallel/decompose/metisDecomp/Make/options +@@ -1,7 +1,7 @@ + EXE_INC = \ + /* -DFULLDEBUG -g -O0 */ \ +- -I$(METIS_ARCH_PATH)/include \ ++ -I/usr/include \ + -I../decompositionMethods/lnInclude + + LIB_LIBS = \ +- -L$(METIS_ARCH_PATH)/lib -lmetis ++ -L$(FOAM_EXT_LIBBIN) -lparmetis diff --git a/openfoam.install b/openfoam.install new file mode 100644 index 000000000000..29a73cf7508b --- /dev/null +++ b/openfoam.install @@ -0,0 +1,20 @@ +post_install() { + echo "NOTE:" + echo "This install of OpenFOAM does Not include the" + echo "ThirdParty libraries from openfoam's website." + echo "It simply creates a stub OpenFOAM/ThirdParty" + echo "directory to keep the OpenFOAM bashrc happy." + echo "" + echo "The most common use of ThirdParty is to get Paraview." + echo "Modern versions of Paraview include an OpenFOAM" + echo "case file viewer. Instead of installing the ThirdParty" + echo "build of Paraview, using the standard arch Paraview" + echo "package is recommended." + echo "" + echo "If you need other components of the ThirdParty bundle" + echo "it will have to be installed manually." + echo "See http://www.openfoam.com/download/source.php for details." + echo "" + echo "Also, to avoid conflict with 'R' from r-project.org, please" + echo "type 'ofoam' to initialize the environment." +} diff --git a/paraFoam.patch b/paraFoam.patch new file mode 100644 index 000000000000..946a90daaec3 --- /dev/null +++ b/paraFoam.patch @@ -0,0 +1,38 @@ +--- src/OpenFOAM-2.4.x/bin/paraFoam ++++ src/OpenFOAM-2.4.x/bin/paraFoam +@@ -124,21 +124,23 @@ + # Get the ParaView major version to select the appropriate readers + version=`echo $ParaView_VERSION | sed -e 's/^\([0-9][0-9]*\).*$/\1/'` + +-# check that reader module has been built +-if [ $requirePV -eq 1 -a ! -f $PV_PLUGIN_PATH/libPV${version}FoamReader_SM.so ] +-then +- cat<< BUILDREADER ++# NOTE: For OpenFOAM built from AUR, paraview will already be installed ++# with the required readers. No need to perform this check. ++# ++#if [ $requirePV -eq 1 -a ! -f $PV_PLUGIN_PATH/libPV3FoamReader_SM.so ] ++#then ++# cat<< BUILDREADER + +-FATAL ERROR: ParaView reader module libraries do not exist ++#FATAL ERROR: ParaView reader module libraries do not exist + +-Please build the reader module before continuing: +-cd \$FOAM_UTILITIES/postProcessing/graphics/PV${version}Readers +-./Allwclean +-./Allwmake ++#Please build the reader module before continuing: ++#cd \$FOAM_UTILITIES/postProcessing/graphics/PV3Readers ++#./Allwclean ++#./Allwmake + +-BUILDREADER +- exit 1 +-fi ++#BUILDREADER ++# exit 1 ++#fi + + # check for --data=... argument + hasDataArg() diff --git a/prefs.sh b/prefs.sh new file mode 100644 index 000000000000..4dded4596080 --- /dev/null +++ b/prefs.sh @@ -0,0 +1,4 @@ +compilerInstall=system +export WM_MPLIB=SYSTEMOPENMPI +export ParaView_VERSION=4.3.1 +export ParaView_MAJOR=4 diff --git a/scotch-options.patch b/scotch-options.patch new file mode 100644 index 000000000000..ed2f3bda242b --- /dev/null +++ b/scotch-options.patch @@ -0,0 +1,9 @@ +--- src/OpenFOAM-2.4.x/src/parallel/decompose/ptscotchDecomp/Make/options ++++ src/OpenFOAM-2.4.x/src/parallel/decompose/ptscotchDecomp/Make/options +@@ -9,4 +9,4 @@ EXE_INC = \ + -I../decompositionMethods/lnInclude + + LIB_LIBS = \ +- -L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -lptscotcherrexit -lscotch ${LINK_FLAGS} -lrt ++ -L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -lscotch -lptscotcherrexit -lscotcherrexit ${LINK_FLAGS} -lrt + diff --git a/scotch.sh b/scotch.sh new file mode 100644 index 000000000000..b723bd9f70e6 --- /dev/null +++ b/scotch.sh @@ -0,0 +1,2 @@ +export SCOTCH_VERSION=scotch_6.0.4 +export SCOTCH_ARCH_PATH=/usr |