Skip to contentSkip to conversation

Revert "package/swig: add host-swig wrapper script"

PATCH In review Bernd Kuhls 2 participants 2 messages Feb 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "package/swig: add host-swig wrapper script"

This reverts commit 20d5e36fe86322fa93b285bbe2c658f163368423.

Fixes:
https://autobuild.buildroot.net/results/e65/e656684298b0462f8044667e7384c64d6508f22f/

Also fixes kodi build error:

CMake Error at /usr/share/cmake-3.31/Modules/ FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find SWIG (missing: SWIG_DIR) (found version "/home/bernd/buildroot/br6/output/per-package/kodi/host/bin/swig3.0: 8:
exec:
/home/bernd/buildroot/br6/output/per-package/kodi/host/bin/
swig3.0.br_real:
not found

")
Call Stack (most recent call first):
/usr/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603
(_FPHSA_FAILURE_MESSAGE)
cmake/modules/buildtools/FindSWIG.cmake:28
(find_package_handle_standard_args)
xbmc/interfaces/swig/CMakeLists.txt:34 (find_package)

using this defconfig:

BR2_x86_64=y
BR2_x86_corei7=y
BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_X86_64_CORE_I7_GLIBC_BLEEDING_EDGE=y BR2_PER_PACKAGE_DIRECTORIES=y
BR2_INIT_SYSTEMD=y BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin" # BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_KODI=y
BR2_PACKAGE_MESA3D=y BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y BR2_PACKAGE_MESA3D_OPENGL_EGL=y BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON3_PY_ONLY=y

---
 package/swig/swig-wrapper.in |  8 --------
 package/swig/swig.mk         | 15 ---------------
 2 files changed, 23 deletions(-)
 delete mode 100644 package/swig/swig-wrapper.in
package/swig/swig-wrapper.in deleted +0 -8
deleted file mode 100644
index 61c885fc90..0000000000
@@ -1,8 +0,0 @@
-#!/bin/sh
-# wrapper to make swig relocatable
-
-if [ -z "${SWIG_LIB}" ]; then
-    export SWIG_LIB="${0%/*}/../share/swig/@SWIG_VERSION@"
-fi
-
-exec "${0}.br_real" "$@"
package/swig/swig.mk +0 -15
index 7612e7b8a0..9d696e6f60 100644
@@ -15,21 +15,6 @@ HOST_SWIG_CONF_OPTS = \
 SWIG_LICENSE = GPL-3.0+, BSD-2-Clause, BSD-3-Clause
 SWIG_LICENSE_FILES = LICENSE LICENSE-GPL LICENSE-UNIVERSITIES
 
-# Swig has a compiled in absolute path to its data files, so it does
-# not work when copied somewhere else for the SDK. Issue was reported
-# upstream but rejected in https://github.com/swig/swig/issues/253 so
-# instead add a wrapper to work around this
-
-define HOST_SWIG_INSTALL_WRAPPER
-	mv -f $(HOST_DIR)/bin/swig $(HOST_DIR)/bin/swig.br_real
-	$(INSTALL) -m 0755 -D package/swig/swig-wrapper.in \
-		$(HOST_DIR)/bin/swig
-	$(SED) 's,@SWIG_VERSION@,$(SWIG_VERSION),g' \
-		$(HOST_DIR)/bin/swig
-endef
-
-HOST_SWIG_POST_INSTALL_HOOKS += HOST_SWIG_INSTALL_WRAPPER
-
 # CMake looks first at swig3.0, then swig2.0 and then swig. However,
 # when doing the search, it will look into the PATH for swig2.0 first,
 # and then for swig.
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Bernd" == Bernd Kuhls <[email protected]> writes:

This reverts commit 20d5e36fe86322fa93b285bbe2c658f163368423. Fixes:
https://autobuild.buildroot.net/results/e65/e656684298b0462f8044667e7384c64d6508f22f/

Ahh, that one uses the swig4.1 symlink.

Rather than reverting this, how about instead reworking the wrapper so it works no matter what symlink it is called through:

package/swig/swig-wrapper.in +1 -1
index 61c885fc90..e6cf2df134 100644
@@ -5,4 +5,4 @@ if [ -z "${SWIG_LIB}" ]; then
     export SWIG_LIB="${0%/*}/../share/swig/@SWIG_VERSION@"
 fi
 
-exec "${0}.br_real" "$@"
+exec "$(realpath "${0}").br_real" "$@"
Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot