swig4.4
LOW
maintainer andreas_baumann
1 votes
scanned 2026-11-01 12:00:25.775195
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Andreas Baumann <mail@andreasbaumann.cc>
2
# Contributor: Felix Yan <felixonmars@archlinux.org>
3
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
4
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
5
6
# Fork of Arch's official swig packaging, pinned to the last release
7
# that still generates valid Python 2 wrapper code. Commit f505f2566
8
# ("Python: Drop PY_VERSION_HEX<3.5 code", 2025-09-15, upstream
9
# github.com/swig/swig) removed Python 2 support from
10
# Lib/python/pyrun.swg right after the v4.4.0 tag -- every release from
11
# 4.5.0 onward emits
12
# `#error "This version of SWIG only supports Python >= 3.5"` in any
13
# generated *PYTHON_wrap.c, which breaks building Python bindings
14
# against python2. Kept here, installed to /opt/swig4.4 alongside the
15
# real `swig` package, for any package that still needs to generate
16
# python2 SWIG bindings (first use: obexftp).
17
#
18
# This repo's history is forked from gitlab.archlinux.org's official
19
# swig packaging at its last 4.4.0 commit (tag 4.4.0-3) -- not a fresh
20
# PKGBUILD written from scratch -- so the upstream packaging fixes
21
# below (prepare() sed/cherry-pick) are inherited, not reinvented.
22
23
# Note:
24
# When bumping major or minor versions, some downstream packages that use somewhat
25
# unorthodox runtime arrangements need rebuilding to match. After SWIG version
26
# bumps please rebuild first python-pivy then freecad in addition to usual suspects.
27
# c.f. https://github.com/FreeCAD/FreeCAD/issues/25048#issuecomment-3627741495
28
# c.f. https://gitlab.archlinux.org/archlinux/packaging/packages/python-pivy/-/issues/1
29
# c.f. https://gitlab.archlinux.org/archlinux/packaging/packages/swig/-/issues/2
30
31
_pkgname=swig
32
pkgname=swig4.4
33
pkgver=4.4.0
34
pkgrel=1
35
pkgdesc="Generate scripting interfaces to C/C++ code (pinned to the last release supporting Python 2 bindings)"
36
arch=('x86_64')
37
url="https://www.swig.org/"
38
license=(
39
GPL-3.0-or-later
40
LicenseRef-BSD-Arizona
41
LicenseRef-BSD-Chicago
42
LicenseRef-BSD-Utah-California
43
)
44
depends=('gcc-libs' 'glibc' 'pcre2' 'zlib')
45
makedepends=('git')
46
source=(git+https://github.com/${_pkgname}/${_pkgname}#tag=v$pkgver)
47
sha512sums=('eed3eb9b8c769661e039718982a17c2a39907023085ec2e7f957664456a8816c376756278cc2667ce73818fe986f26d4479819c7f0d50e43fa5dea012d742c90')
48
49
prepare() {
50
sed -n '5,32p' ${_pkgname}/LICENSE-UNIVERSITIES > LicenseRef-BSD-Utah-California.txt
51
sed -n '37,64p' ${_pkgname}/LICENSE-UNIVERSITIES > LicenseRef-BSD-Chicago.txt
52
sed -n '69,94p' ${_pkgname}/LICENSE-UNIVERSITIES > LicenseRef-BSD-Arizona.txt
53
54
# https://github.com/swig/swig/issues/2858
55
sed '/stl_no_default_constructor/d' -i ${_pkgname}/Examples/test-suite/common.mk
56
57
# https://github.com/swig/swig/issues/2859
58
sed '/li_std_list/d' -i ${_pkgname}/Examples/test-suite/java/Makefile.in
59
60
git -C ${_pkgname} cherry-pick -n b16a7c958a561721d164183f682d1511dc7c900b # Fix crash in R test
61
62
cd ${_pkgname}
63
./autogen.sh
64
}
65
66
build() {
67
cd ${_pkgname}
68
./configure --prefix=/opt/${pkgname}
69
make
70
}
71
72
package() {
73
cd ${_pkgname}
74
make DESTDIR="${pkgdir}" install
75
install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
76
install -D -m644 ../*.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}/
77
78
# coexist with the real swig package: /opt/swig4.4 holds the real
79
# install, /usr/bin gets suffixed symlinks only (same pattern as the
80
# project's own cmake2's "-2" suffix)
81
install -d "${pkgdir}"/usr/bin
82
for b in "${pkgdir}"/opt/${pkgname}/bin/*; do
83
ln -s /opt/${pkgname}/bin/$(basename "$b") "${pkgdir}"/usr/bin/$(basename "$b")4.4
84
done
85
}
86
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-11-01 12:00:25 | Low | 1 |