mathematica
maintainer JP-Ellis
· 82 votes
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The download is from Wolfram's official domain, uses a verifiable checksum, and installs a legitimate binary distribution; the untrusted host flag is a false positive due to dynamic URL parameters.
Triggered rules
LOW
AI review downgraded a static finding
llm_review
The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-2507) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The download is from Wolfram's official domain, uses a verifiable checksum, and installs a legitimate binary distribution; the untrusted host flag is a false positive due to dynamic URL parameters.
1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM
External download from an untrusted host, not in source=()
external_download_not_in_source
curl/wget fetches a URL on a non-allowlisted host that is not part of source=(), so it is not checksum-verified by makepkg.
-
PKGBUILD:52
curl -fsSL https://www.wolfram.com/download-center/ \
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: Joshua Ellis <josh@jpellis.me>
2
# Contributor: "marmis" Tiago de Paula <tiagodepalves@gmail.com>
3
# Contributor: Anish Tondwalkar <anish@tjhsst.edu>
4
# Contributor: Ghost91 <m_graeb11@cs.uni-kl.de>
5
# Contributor: Michael Pusterhofer <pusterhofer at student dot tugraz dot at>
6
# Contributor: Raphael Scholer <rscholer@gmx.de>
7
# Contributor: kjslag <kjslag at gmail dot com>
8
# Contributor: teratomata <teratomat@gmail.com>
9
# Contributor: Maxim Mikityanskiy <maxtram95@gmail.com>
10
11
pkgname=mathematica
12
pkgdesc='Computational software for mathematics, with offline documentation bundled'
13
pkgver=15.0.1
14
IFS=. read -r _major _minor _patch <<< "${pkgver}"
15
_minor=${_minor:-0}
16
pkgrel=1
17
url='http://www.wolfram.com/mathematica/'
18
arch=(x86_64)
19
license=('LicenseRef-Wolfram-Mathematica-License-Agreement') # https://www.wolfram.com/legal/agreements/wolfram-mathematica/
20
makedepends=('curl' 'inetutils')
21
depends=(
22
'alsa-lib'
23
'bash'
24
'fontconfig'
25
'freetype2'
26
'glibc'
27
'hicolor-icon-theme'
28
'libquadmath'
29
'libstdc++'
30
'libx11'
31
'libxkbcommon'
32
'nss'
33
'qt6-base'
34
'zstd'
35
)
36
optdepends=(
37
'qt6-wayland: full Wayland support'
38
'openssl-1.1: MQTTLink and Kerberos integration'
39
'libxinerama: required by FFmpegTools'
40
'ffmpeg4.4: alternative FFmpegTools backend'
41
'libxtst: X11 backend for Java AWT libraries'
42
'ttf-dejavu: correct fonts for Greek characters and inline TeX'
43
'libcups: printer support'
44
)
45
_source_url='https://account.wolfram.com/dl/WolframApp'
46
# Source URL has a dynamic signature parameter that allows downloads without logging in. You can
47
# skip fetching this value if you already have the installer by setting SKIP_DYNAMIC_SIGNATURE=1.
48
# Signatures are updated hourly, so we hide them by default in .SCRINFO and the AUR page.
49
if [[ ${SKIP_DYNAMIC_SIGNATURE:-${PRINTSRCINFO}} != 1 ]]; then
50
_dynamic_signature=$(
51
set -o pipefail
52
curl -fsSL https://www.wolfram.com/download-center/ \
53
| grep -oP "\bhref=\"${_source_url/./\.}\?[^\"]+\K&signature=[a-zA-Z0-9]+(?=\"|&)" \
54
| uniq
55
)
56
fi
57
source=("Wolfram_${pkgver}.sh::${_source_url}?version=${_major}.${_minor}${_patch/#?/.&}&platform=Linux&downloadManager=false${_dynamic_signature}"
58
'wolfram-remove-xdg-scripts.patch')
59
sha256sums=('5732bc0ae3a1938b0e3b908be33deb7e9639eb7d45d9137a7340e1f1c13179e8'
60
'1ea85d8df27e875e8073832ff3a25c7594eeacc7d83add6b8fa8c4462e38a5fe')
61
## Symbol searching and stripping takes a long time, so they are disabled by default.
62
## Also, `debug` won't be of too much help here, since this is a binary distribution.
63
## Here's a quick comparison on my machine:
64
## | Build options | Build time | Package Size (Zstd) | Uncompressed Size |
65
## | :-------------- | ---------: | ------------------: | ----------------: |
66
## | (!strip !debug) | 176.38 s | 8051 MiB | 20282 MiB |
67
## | (!strip debug) | 324.13 s | 8051 MiB | 20282 MiB |
68
## | (strip !debug) | 801.52 s | 7815 MiB | 19339 MiB |
69
options=(!strip !debug)
70
71
## To build this package you might need to place the mathematica-installer into
72
## your startdir If you don't own the installer you can download a trial version
73
## at http://www.wolfram.com/mathematica/trial
74
75
## The documentation takes up the majority of the disk space. If you do not wish
76
## to keep it, uncomment the relevant lines at the bottom of this PKGBUILD, or
77
## install https://aur.archlinux.org/packages/mathematica-light.
78
79
## Package compression can be disabled if it won't be kept, but keep in mind that
80
## CPU operations are much faster than disk, so compressing with the default zstd
81
## options will probably be just as fast or faster than writing the whole .pkg.tar.
82
## Here's a comparison on my machine:
83
## | PKGEXT | Build time | Package size |
84
## | :----------- | ---------: | -----------: |
85
## | .pkg.tar | 173.78 s | 20341 MiB |
86
## | .pkg.tar.lz4 | 175.97 s | 12932 MiB |
87
## | .pkg.tar.zst | 173.85 s | 8052 MiB |
88
## | .pkg.tar.xz | 507.60 s | 7091 MiB |
89
# PKGEXT='.pkg.tar'
90
91
## Here you can change the installation directory. The default is '/opt/Mathematica'.
92
_installdir='/opt/Mathematica'
93
94
prepare() {
95
local available_space
96
available_space="$(df --output=avail -BG .)"
97
available_space="$(tail -n 1 <<< "${available_space}")"
98
99
if [[ ${available_space/%G/} -lt 32 ]]; then
100
warning "Mathematica takes around 29 GiB of space with 'makepkg'."
101
warning 'Building in a tmpfs (e.g. /tmp when mounted into RAM) may not work.'
102
fi
103
104
if [[ ${PWD} =~ [[:space:]] ]]; then
105
error "ERROR: The Mathematica installer doesn't support directory names with spaces."
106
warning "Current build directory: ${PWD}"
107
exit 1
108
fi
109
110
msg2 'Extracting Mathematica installer...'
111
bash "Wolfram_${pkgver}.sh" --keep --target bundle -- -noexec
112
113
patch -t -d bundle/ -Np1 < wolfram-remove-xdg-scripts.patch
114
}
115
116
package() {
117
local installdir
118
installdir="$(realpath -m "${pkgdir}/${_installdir}")"
119
120
msg2 'Running Mathematica installer'
121
# https://reference.wolfram.com/language/tutorial/InstallingWolfram.html#650929293
122
bash bundle/Unix/Installer/WolframInstaller \
123
-execdir="${pkgdir}/usr/bin" \
124
-targetdir="${installdir}" \
125
-auto
126
rm bundle/Unix/Installer/WolframInstaller
127
128
# Install documentation
129
bash bundle/Unix/.bundle/Unix/Installer/MathInstaller \
130
-targetdir=tmp \
131
-auto
132
rm -rf bundle
133
134
cd tmp
135
find Documentation/English -type d -exec mkdir -p -m755 "${installdir}/{}" \;
136
find Documentation/English -type f -exec mv -f --no-copy {} -T "${installdir}/{}" \;
137
138
cd "${installdir}"
139
if [[ -s InstallErrors ]]; then
140
warning 'Review installation errors:'
141
cat InstallErrors
142
fi
143
rm -vf InstallErrors
144
145
msg2 'Setting up WolframScript'
146
# shellcheck disable=SC2312
147
ar -p SystemFiles/Installation/wolframscript_*_amd64.deb \
148
-O data.tar.xz | tar -xvJ -C "${pkgdir}" ./usr/share/
149
150
msg2 'Copying menu and MIME type information'
151
152
install -vD -t "${pkgdir}/usr/share/applications/" \
153
-m644 "SystemFiles/Installation/com.wolfram.Wolfram.${_major}.${_minor}.desktop"
154
install -vD -t "${pkgdir}/usr/share/desktop-directories/" \
155
-m644 SystemFiles/Installation/wolfram-wolfram.directory
156
install -vD -t "${pkgdir}/usr/share/mime/packages/" \
157
-m644 SystemFiles/Installation/*.xml
158
rm -vr SystemFiles/Installation/
159
160
_fix_desktop_file "${pkgdir}/usr/share/applications/com.wolfram.Wolfram.${_major}.${_minor}.desktop"
161
_fix_desktop_file "${pkgdir}/usr/share/desktop-directories/wolfram-wolfram.directory"
162
163
msg2 'Copying icons'
164
165
# Read MIME types from XML declarations: <mime-type ... type="...">
166
local -a mimetypes
167
mapfile -t mimetypes < <(
168
# shellcheck disable=SC2312
169
sed -nE '/<mime-type\b/,/>/ s/.*\btype="([^"]+)".*/\1/ p' \
170
"${pkgdir}/usr/share/mime/packages/"*.xml
171
)
172
173
local i mimetype icon
174
for i in 32 64 128; do
175
install -vD -m644 "SystemFiles/FrontEnd/SystemResources/X/App-${i}.png" \
176
-T "${pkgdir}/usr/share/icons/hicolor/${i}x${i}/apps/wolfram-wolfram-${_major}.${_minor}.png"
177
178
for mimetype in "${mimetypes[@]}"; do
179
icon="SystemFiles/FrontEnd/SystemResources/X/$(basename "${mimetype}")-${i}.png"
180
if [[ -f ${icon} ]]; then
181
install -vD -m644 "${icon}" \
182
-T "${pkgdir}/usr/share/icons/hicolor/${i}x${i}/mimetypes/${mimetype//\//-}.png"
183
else
184
printf 'Missing icon: %s\n' "${icon}"
185
fi
186
done
187
done
188
189
msg2 'Copying man pages'
190
install -vD -t "${pkgdir}/usr/share/man/man1/" \
191
-m644 SystemFiles/SystemDocumentation/Unix/*.1
192
193
msg2 'Copying license'
194
install -vD -t "${pkgdir}/usr/share/licenses/${pkgname}/" \
195
-m644 LICENSE.txt
196
197
_fix_binary_symlinks # namcap rule: symlink
198
_fix_permissions # namcap rule: permissions
199
}
200
201
_fix_desktop_file() {
202
sed -i -E "
203
# Wolfram declares an invalid 'Version=2.0'. Most DEs just ignore it, but best to remove it.
204
/^Version=/ d
205
# encoding is outdated
206
/^Encoding=/ d
207
# executable path contains BUILDDIR
208
/^TryExec=/ s|=.*|=/usr/bin/WolframNB|
209
/^Exec=/ s|=.*|=/usr/bin/WolframNB --name com.wolfram.Wolfram.${_major}.${_minor} %F|
210
# optional sections for desktop entry: https://specifications.freedesktop.org/desktop-entry/latest/recognized-keys.html
211
/^Type=Application\$/,\$ {
212
/^Comment=/ a GenericName=Mathematical Software
213
\$ a Keywords=Wolfram;Mathematica;Symbolic;Computation;Programming;Simulation;Data Analysis;Visualization;Algebra;Calculus;Graphing;
214
\$ a Categories=Science;Math;ComputerScience;DataVisualization;NumericalAnalysis;ArtificialIntelligence;Physics;ParallelComputing;
215
}
216
# checked with desktop-file-validate
217
" "$1"
218
}
219
220
_fix_binary_symlinks() {
221
msg2 'Fixing symbolic links'
222
223
ln -v -ft Executables/ -sr SystemFiles/Kernel/Binaries/Linux-x86-64/wolframscript
224
ln -v -ft "${pkgdir}/usr/bin/" -sr \
225
Executables/math \
226
Executables/MathKernel \
227
Executables/wolfram \
228
Executables/wolframnb \
229
Executables/WolframKernel \
230
Executables/WolframNB \
231
SystemFiles/Kernel/Binaries/Linux-x86-64/ELProver \
232
SystemFiles/Kernel/Binaries/Linux-x86-64/wolframscript
233
}
234
235
_fix_permissions() {
236
msg2 'Fixing file permissions'
237
chmod -c go-w -R "${pkgdir}"
238
}
239
Changes since previous scan
--- PKGBUILD @ 2026-07-31 00:14+++ PKGBUILD @ 2026-08-03 00:08@@ -23,9 +23,10 @@ 'bash' 'fontconfig' 'freetype2'- 'gcc-libs' 'glibc' 'hicolor-icon-theme'+ 'libquadmath'+ 'libstdc++' 'libx11' 'libxkbcommon' 'nss'Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-03 00:08:14 | LOW | 2 |
| 2026-08-02 00:16:08 | LOW | 2 |
| 2026-08-01 00:11:18 | LOW | 2 |
| 2026-07-31 11:17:50 | MEDIUM | 1 |
| 2026-07-31 00:14:10 | LOW | 2 |
| 2026-07-30 00:17:23 | LOW | 2 |
| 2026-07-29 00:25:53 | LOW | 2 |
| 2026-07-28 00:07:28 | LOW | 2 |
| 2026-07-27 23:36:42 | MEDIUM | 1 |
| 2026-07-27 00:24:32 | LOW | 2 |
| 2026-07-26 00:07:32 | LOW | 2 |
| 2026-07-25 00:13:44 | LOW | 2 |
| 2026-07-24 00:02:28 | LOW | 2 |
| 2026-07-23 00:14:47 | LOW | 2 |
| 2026-07-22 00:29:32 | LOW | 2 |
| 2026-07-21 00:24:15 | LOW | 2 |
| 2026-07-20 00:19:49 | LOW | 2 |
| 2026-07-19 00:17:08 | LOW | 2 |
| 2026-07-18 00:14:48 | LOW | 2 |
| 2026-07-17 00:06:16 | LOW | 2 |