openfoam-org

MEDIUM
maintainer faruq 66 votes base openfoam scanned 2026-11-01 14:00:44.307000
View on AUR
Why flagged

This package was orphaned and re-adopted within the last 30 days — a window where ownership transfers can introduce malicious changes.

Triggered rules

Medium Recently orphaned & re-adopted orphaned_readopted

This package was orphaned and re-adopted within the last 30 days — a window where ownership transfers can introduce malicious changes.

PKGBUILD

1# Maintainer: envolution
2# Contributor: Jingbei Li <i@jingbei.li>
3# Contributor: Xwang <xwaang1976@gmail.com>
4# Contributor: George Eleftheriou <eleftg>
5# Contributor: Andrew Fischer <andrew_at_apastron.co>
6# shellcheck shell=bash disable=SC2034,SC2154
7
8pkgbase=openfoam
9pkgname=openfoam-org
10pkgver=13.20250911+cde978a
11_pkgver="${pkgver%%.*}"
12_subver_and_commit="${pkgver#*.}"
13_subver="${_subver_and_commit%+*}"
14_commit="${pkgver#*+}"
15pkgrel=1
16pkgdesc="The open source CFD toolbox (www.openfoam.org)"
17_distpkgbase=OpenFOAM
18_gitname=$_distpkgbase-$_pkgver
19options=(!strip)
20arch=('x86_64')
21url="http://www.openfoam.org"
22license=("GPL-3.0-or-later")
23depends=(
24 glibc
25 qt6-base
26 gcc-libs
27 metis
28 vtk
29 bzip2
30 paraview
31 parmetis
32 scotch
33 boost
34 cgal
35 zoltan
36 openmpi
37 gnuplot
38 libxt
39 libxml2
40 freetype2
41 double-conversion
42 glew
43 utf8cpp
44 gl2ps
45 python
46 hdf5
47 zlib
48)
49makedepends=(
50 git
51 cmake
52 cli11
53 nlohmann-json
54 fast_float
55 flex
56)
57provides=(openfoam)
58source=(
59 "$_gitname-$_subver::git+https://github.com/OpenFOAM/OpenFOAM-${_pkgver}.git#commit=${_commit}"
60 paraview.arch
61 openfoam.install
62)
63install="${pkgbase}.install"
64sha256sums=('c7371730f61b12147e5ae85561b2d0d25747dd310ab0a11ef5f598ace0c61ab3'
65 'bbec057b1153a616ea388dc80fdaeb6337edc6150e0601f140a1304f82a10ddb'
66 'a94080d4e5bc4736868269d66f61f5430dec961c70bdcdaa1c9a402dba5203d2')
67
68_cache_notify() {
69 local yellow='\033[1;33m'
70 local red='\033[1;31m'
71 local nc='\033[0m'
72 echo -e "${yellow}==> Using build cache:${nc}"
73 echo " ${srcdir}/${_distpkgbase}-${_pkgver}"
74 echo
75 echo -e "${yellow}==> To build from scratch, run:${nc}"
76 echo -e " ${red}rm -rf ${srcdir}/${_distpkgbase}-${_pkgver}${nc}"
77}
78
79prepare() {
80 _cachefile=${_distpkgbase}-${_pkgver}/.arch_cache
81 if [[ -f "$_cachefile" ]] && grep -q "$pkgver" "$_cachefile"; then
82 _cache_notify
83 else
84 rm -rf $_distpkgbase-$_pkgver
85 mv $_gitname-$_subver $_distpkgbase-$_pkgver
86
87 _bashrc=${_distpkgbase}-${_pkgver}/etc/bashrc
88 sed -i "s|^export WM_PROJECT_VERSION=.*|export WM_PROJECT_VERSION=${_pkgver}|" "$_bashrc"
89 cp ${_bashrc} ${_bashrc}.prepared
90
91 # we'll be using $bashrc while building, and replace it with $bashrc.prepared
92 # (below) during install - so we have to modify the FOAM_INST_DIR for post-install use
93 sed -i 's|^# export FOAM_INST_DIR=.*|export FOAM_INST_DIR=/opt/\$WM_PROJECT|' \
94 ${_bashrc}.prepared
95
96 # Add system library settings to prefs.sh
97 cat <<EOF >"${_distpkgbase}-${_pkgver}/etc/prefs.sh"
98# System-wide settings for Arch Linux
99export SCOTCH_TYPE=system
100export METIS_TYPE=system
101export PARMETIS_TYPE=system
102export ZOLTAN_TYPE=system
103EOF
104
105 echo $pkgver >$_cachefile
106 fi
107
108 # Drop in Arch paraview environment script
109 cd ${_distpkgbase}-${_pkgver}
110 cp ${srcdir}/paraview.arch etc/config.sh/paraview
111}
112
113build() {
114 cd ${_distpkgbase}-${_pkgver}
115 # export FOAM_VERBOSE=1
116 # export PS1='~' # required for verbosity checks
117 # Setup the build environment
118 source etc/bashrc || true
119
120 # see if we have extra threads available in /etc/makepkg.conf MAKEFLAGS
121 [[ $MAKEFLAGS =~ -j[[:space:]]*([0-9]+) ]] &&
122 _jval="${BASH_REMATCH[1]}" || _jval=1
123
124 export PATH="$PWD/wmake:$PATH"
125 wmakeLnIncludeAll
126 ./Allwmake -s -q -j ${_jval:=1}
127}
128
129package() {
130 # Create destination directories
131 install -d "${pkgdir}/opt/${_distpkgbase}" "${pkgdir}/etc/profile.d"
132
133 # Copy package to pkgdir
134 cp -r "${_distpkgbase}-${_pkgver}" "${pkgdir}/opt/${_distpkgbase}"
135
136 # Clean up build files
137 # https://openfoamwiki.net/index.php/Installation/Delete_intermediate_files#OpenFOAM_v1706_and_newer
138 _baseclean="${pkgdir}/opt/${_distpkgbase}/${_distpkgbase}-${_pkgver}"
139 rm -rf ${_baseclean}/platforms/*/applications ${_baseclean}/platforms/*/src
140
141 # Add bash profile
142 _bash_profile=${pkgdir}/etc/profile.d/openfoam-${_pkgver}.sh
143 echo "export FOAM_INST_DIR=/opt/${_distpkgbase}" >$_bash_profile
144 echo "alias ofoam=\"source \${FOAM_INST_DIR}/${_distpkgbase}-${_pkgver}/etc/bashrc\"" \
145 >>$_bash_profile
146 echo "alias ofoam${_pkgver}=\"source \${FOAM_INST_DIR}/${_distpkgbase}-${_pkgver}/etc/bashrc\"" \
147 >>$_bash_profile
148 chmod 755 $_bash_profile
149
150 # Add stub thirdparty directory to keep openfoam happy
151 install -d "${pkgdir}/opt/${_distpkgbase}/ThirdParty-${_pkgver}"
152
153 install -Dm755 "${_distpkgbase}-${_pkgver}/etc/bashrc.prepared" \
154 "${pkgdir}/opt/${_distpkgbase}/${_distpkgbase}-${_pkgver}/etc/bashrc"
155 install -Dm644 ${_distpkgbase}-${_pkgver}/COPYING -t $pkgdir/usr/share/licenses/$pkgname
156}
157
158# vim:set ts=2 sw=2 et:
159

Scan history

Scanned at (UTC)SeverityRules
2026-11-01 14:00:44 Medium 1
2026-06-18 16:11:54 Clean 0

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion