summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorkyechou2023-11-20 21:36:39 -0600
committerkyechou2023-11-20 21:37:10 -0600
commit079439148db0bd5fb62237808661b5f99eec3f7f (patch)
treecc427b17bf43c0dbdce07bc8066703e829717a5a
parentc9e6f978fad20fe2dd45c704f1ab74118aaa4db1 (diff)
downloadaur-079439148db0bd5fb62237808661b5f99eec3f7f.tar.gz
Fix the strlcpy compile issue
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD20
-rw-r--r--fix-openflow-strlcpy.patch26
3 files changed, 43 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index af88ebef950e..b8fd8533f180 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = mininet
pkgdesc = Emulator for rapid prototyping of Software Defined Networks
pkgver = 2.3.0
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/mininet/mininet
install = mininet.install
arch = x86_64
@@ -23,10 +23,11 @@ pkgbase = mininet
optdepends = socat: for X11 forwarding
optdepends = xterm: required for MiniEdit
optdepends = tk: required for MiniEdit
- source = https://github.com/mininet/mininet/archive/2.3.0.tar.gz
+ source = https://github.com/mininet/mininet/archive/refs/tags/2.3.0.tar.gz
source = git+https://github.com/mininet/openflow
+ source = fix-openflow-strlcpy.patch
sha256sums = 1b16ee53ddb9a34a3751a77517643bda2286fc31be123209e84884d0697107b0
sha256sums = SKIP
+ sha256sums = 0a85f8a5ce2dd900d4f874849b28301aa47d7b9d7b03ed405c973d917d98383a
pkgname = mininet
-
diff --git a/PKGBUILD b/PKGBUILD
index 52fc0cadb4f0..9e3816466d61 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=mininet
pkgver=2.3.0
-pkgrel=1
+pkgrel=2
pkgdesc='Emulator for rapid prototyping of Software Defined Networks'
depends=('python' 'iproute2' 'net-tools' 'iputils' 'inetutils' 'iperf' 'ethtool'
'libcgroup' 'openvswitch' 'psmisc')
@@ -17,20 +17,25 @@ arch=('x86_64')
url='https://github.com/mininet/mininet'
license=('custom')
install=mininet.install
-source=("https://github.com/mininet/mininet/archive/$pkgver.tar.gz"
- 'git+https://github.com/mininet/openflow') # for UserSwitch
+source=("https://github.com/mininet/mininet/archive/refs/tags/$pkgver.tar.gz"
+ 'git+https://github.com/mininet/openflow' # for UserSwitch
+ 'fix-openflow-strlcpy.patch')
sha256sums=('1b16ee53ddb9a34a3751a77517643bda2286fc31be123209e84884d0697107b0'
- 'SKIP')
+ 'SKIP'
+ '0a85f8a5ce2dd900d4f874849b28301aa47d7b9d7b03ed405c973d917d98383a')
prepare () {
cd "$srcdir/openflow"
sed '/^include debian\/automake.mk/d' -i Makefile.am
# Patch controller to handle more than 16 switches
patch -Np1 -i "$srcdir/$pkgname-$pkgver/util/openflow-patches/controller.patch"
+ patch -Np1 -i "$srcdir/fix-openflow-strlcpy.patch"
cd "$srcdir/$pkgname-$pkgver"
- sed 's:PREFIX ?= /usr:PREFIX ?= "$(DESTDIR)"/usr:' -i Makefile
- sed '/^[[:space:]]*$(PYTHON) /d' -i Makefile
+ # shellcheck disable=SC2016
+ sed -i Makefile \
+ -e 's:PREFIX ?= /usr:PREFIX ?= "$(DESTDIR)"/usr:' \
+ -e '/^[[:space:]]*$(PYTHON) /d'
}
build () {
@@ -41,6 +46,7 @@ build () {
cd "$srcdir/$pkgname-$pkgver"
make mnexec man
+ python setup.py build
}
package () {
@@ -49,6 +55,6 @@ package () {
cd "$srcdir/$pkgname-$pkgver"
make DESTDIR="${pkgdir}" install
- python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
+ python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/mininet/LICENSE"
}
diff --git a/fix-openflow-strlcpy.patch b/fix-openflow-strlcpy.patch
new file mode 100644
index 000000000000..3a007cff28b5
--- /dev/null
+++ b/fix-openflow-strlcpy.patch
@@ -0,0 +1,26 @@
+diff --git a/lib/util.c b/lib/util.c
+index 21cc28d..67ba765 100644
+--- a/lib/util.c
++++ b/lib/util.c
+@@ -138,7 +138,7 @@ xasprintf(const char *format, ...)
+ return s;
+ }
+
+-void
++size_t
+ strlcpy(char *dst, const char *src, size_t size)
+ {
+ if (size > 0) {
+diff --git a/lib/util.h b/lib/util.h
+index fde681f..efb0df9 100644
+--- a/lib/util.h
++++ b/lib/util.h
+@@ -106,7 +106,7 @@ char *xvasprintf(const char *format, va_list) PRINTF_FORMAT(1, 0) MALLOC_LIKE;
+ void *x2nrealloc(void *p, size_t *n, size_t s);
+
+ #ifndef HAVE_STRLCPY
+-void strlcpy(char *dst, const char *src, size_t size);
++size_t strlcpy(char *dst, const char *src, size_t size);
+ #endif
+
+ void ofp_fatal(int err_no, const char *format, ...)