build: static link various xcb libs

This commit is contained in:
tobtoht 2023-06-28 12:50:32 +02:00
parent 42310fce06
commit d1fd270caa
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
14 changed files with 93 additions and 26 deletions

View file

@ -67,6 +67,13 @@ get_directory_property(UNBOUND_LIBRARY DIRECTORY "monero" DEFINITION UNBOUND_LIB
get_directory_property(DEVICE_TREZOR_READY DIRECTORY "monero" DEFINITION DEVICE_TREZOR_READY)
get_directory_property(TREZOR_DEP_LIBS DIRECTORY "monero" DEFINITION TREZOR_DEP_LIBS)
# libXau
# workaround for: undefined reference to `XauGetBestAuthByAddr'
if (DEPENDS AND UNIX AND NOT APPLE)
find_library(LIBXAU_LIBRARY Xau)
message(STATUS "libXau: libraries at ${LIBXAU_LIBRARY}")
endif()
# pthread
find_package(Threads REQUIRED)

View file

@ -10,7 +10,6 @@ APPDIR="$PWD/feather.AppDir"
mkdir -p "$APPDIR"
mkdir -p "$APPDIR/usr/share/applications/"
mkdir -p "$APPDIR/usr/bin"
mkdir -p "$APPDIR/usr/lib"
cp "src/assets/feather.desktop" "$APPDIR/usr/share/applications/feather.desktop"
cp "src/assets/feather.desktop" "$APPDIR/feather.desktop"
@ -18,22 +17,6 @@ cp "src/assets/images/appicons/64x64.png" "$APPDIR/feather.png"
cp "build/bin/feather" "$APPDIR/usr/bin/feather"
chmod +x "$APPDIR/usr/bin/feather"
mkdir -p "${APPDIR}/usr/lib"
XCB_LIBS=(libxcb-cursor.so.0 libxcb-render.so.0 libxcb-xfixes.so.0 libxcb-icccm.so.4 libxcb-render-util.so.0
libxcb-xkb.so.1 libxcb-image.so.0 libxcb-shape.so.0 libxkbcommon.so.0 libxcb-keysyms.so.1
libxcb-shm.so.0 libxkbcommon-x11.so.0 libxcb-randr.so.0 libxcb-sync.so.1)
for lib in "${XCB_LIBS[@]}"
do
echo "${lib}"
cp "/feather/contrib/depends/${HOST}/lib/${lib}" "${APPDIR}/usr/lib/"
"${HOST}-strip" "${APPDIR}/usr/lib/${lib}"
patchelf --set-rpath "\$ORIGIN" "${APPDIR}/usr/lib/${lib}"
done
patchelf --set-rpath "\$ORIGIN/../lib" "$APPDIR/usr/bin/feather"
cp "contrib/AppImage/AppRun" "$APPDIR/"
chmod +x "$APPDIR/AppRun"

View file

@ -7,10 +7,10 @@ $(package)_dependencies=xcb_proto libXau
$(package)_patches = remove_pthread_stubs.patch
define $(package)_set_vars
$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen --without-launchd
$(package)_config_opts=--disable-shared --disable-devel-docs --without-doxygen --without-launchd
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
# Disable unneeded extensions.
# More info is available from: https://doc.qt.io/qt-5.15/linux-requirements.html
# More info is available from: https://doc.qt.io/qt-6.5/linux-requirements.html
$(package)_config_opts += --disable-composite --disable-damage --disable-dpms
$(package)_config_opts += --disable-dri2 --disable-dri3 --disable-glx
$(package)_config_opts += --disable-present --disable-record --disable-resource

View file

@ -6,7 +6,7 @@ $(package)_sha256_hash=cc8608ebb695742b6cf84712be29b2b66aa5f6768039528794fca0fa2
$(package)_dependencies=libxcb libxcb_util_render libxcb_util_image
define $(package)_set_vars
$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
$(package)_config_opts=--disable-shared --disable-devel-docs --without-doxygen
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
endef

View file

@ -4,14 +4,17 @@ $(package)_download_path=https://xcb.freedesktop.org/dist
$(package)_file_name=xcb-util-image-$($(package)_version).tar.xz
$(package)_sha256_hash=ccad8ee5dadb1271fd4727ad14d9bd77a64e505608766c4e98267d9aede40d3d
$(package)_dependencies=libxcb libxcb_util
$(package)_patches = no-tests.patch
define $(package)_set_vars
$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
$(package)_config_opts=--disable-shared --disable-devel-docs --without-doxygen
$(package)_config_opts+= --disable-dependency-tracking --enable-option-checking
endef
define $(package)_preprocess_cmds
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . && \
patch -p1 -i $($(package)_patch_dir)/no-tests.patch && \
autoreconf -i
endef
define $(package)_config_cmds

View file

@ -6,7 +6,7 @@ $(package)_sha256_hash=7c260a5294412aed429df1da2f8afd3bd07b7cba3fec772fba15a613a
$(package)_dependencies=libxcb xproto
define $(package)_set_vars
$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
$(package)_config_opts=--disable-shared --disable-devel-docs --without-doxygen
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
endef

View file

@ -6,7 +6,7 @@ $(package)_sha256_hash=3e15d4f0e22d8ddbfbb9f5d77db43eacd7a304029bf25a6166cc63caa
$(package)_dependencies=libxcb
define $(package)_set_vars
$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
$(package)_config_opts=--disable-shared --disable-devel-docs --without-doxygen
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
endef

View file

@ -6,7 +6,7 @@ $(package)_sha256_hash=62c34e21d06264687faea7edbf63632c9f04d55e72114aa4a57bb95e4
$(package)_dependencies=libxcb
define $(package)_set_vars
$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
$(package)_config_opts=--disable-shared --disable-devel-docs --without-doxygen
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
endef

View file

@ -11,7 +11,7 @@ $(package)_dependencies=libxcb
# a different build system (Meson)
define $(package)_set_vars
$(package)_config_opts = --enable-option-checking --disable-dependency-tracking
$(package)_config_opts += --disable-static --disable-docs
$(package)_config_opts += --disable-shared --disable-docs
$(package)_cflags += -Wno-error=array-bounds
endef

View file

@ -30,6 +30,8 @@ $(package)_patches += windows_func_fix.patch
$(package)_patches += WindowsToolchain.cmake
$(package)_patches += revert_f99ee441.patch
$(package)_patches += CVE-2023-34410-qtbase-6.5.diff
$(package)_patches += xcb-util-image-fix.patch
$(package)_patches += libxau-fix.patch
#$(package)_patches += fix-static-fontconfig-static-linking.patch
$(package)_qttools_file_name=qttools-$($(package)_suffix)
@ -266,6 +268,8 @@ define $(package)_preprocess_cmds
cd qtbase && \
patch -p1 -i $($(package)_patch_dir)/revert_f99ee441.patch && \
patch -p1 -i $($(package)_patch_dir)/CVE-2023-34410-qtbase-6.5.diff && \
patch -p1 -i $($(package)_patch_dir)/xcb-util-image-fix.patch && \
patch -p1 -i $($(package)_patch_dir)/libxau-fix.patch && \
cd ../qtmultimedia && \
patch -p1 -i $($(package)_patch_dir)/qtmultimedia-fixes.patch && \
patch -p1 -i $($(package)_patch_dir)/v4l2.patch

View file

@ -0,0 +1,23 @@
diff --git a/Makefile.am b/Makefile.am
index 23956fd..0f4c3c9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,5 +12,5 @@ ChangeLog:
dist-hook: ChangeLog INSTALL
-SUBDIRS = image test
+SUBDIRS = image
EXTRA_DIST = autogen.sh README.md
diff --git a/configure.ac b/configure.ac
index 9cf3f5a..0949d55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,6 @@ PKG_CHECK_MODULES(XCB_UTIL, xcb-util)
AC_CONFIG_FILES([
Makefile
image/Makefile
- test/Makefile
image/xcb-image.pc
])
AC_OUTPUT

View file

@ -0,0 +1,12 @@
diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake
index 1ff24eebaf..1ce02f058e 100644
--- a/src/gui/configure.cmake
+++ b/src/gui/configure.cmake
@@ -499,6 +499,7 @@ qt_config_compile_test(xcb_syslibs
XCB::XFIXES
XCB::XKB
XCB::XCB
+ X11::Xau
CODE
"// xkb.h is using a variable called 'explicit', which is a reserved keyword in C++
#define explicit dont_use_cxx_explicit

View file

@ -0,0 +1,31 @@
undefined reference to `xcb_aux_create_gc'
diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake
index dc60289401..703f7739d8 100644
--- a/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake
+++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake
@@ -108,7 +108,6 @@ set(XCB_known_components
EWMH
GLX
ICCCM
- IMAGE
KEYSYMS
PRESENT
RANDR
@@ -118,6 +117,7 @@ set(XCB_known_components
SCREENSAVER
SYNC
UTIL
+ IMAGE
XEVIE
XF86DRI
XINERAMA
@@ -142,7 +142,7 @@ endforeach()
set(XCB_XCB_component_deps)
set(XCB_COMPOSITE_component_deps XCB XFIXES)
set(XCB_DAMAGE_component_deps XCB XFIXES)
-set(XCB_IMAGE_component_deps XCB SHM)
+set(XCB_IMAGE_component_deps XCB SHM UTIL)
set(XCB_RENDERUTIL_component_deps XCB RENDER)
set(XCB_XFIXES_component_deps XCB RENDER SHAPE)
set(XCB_XVMC_component_deps XCB XV)

View file

@ -301,6 +301,10 @@ if(DEPENDS AND APPLE)
${CMAKE_OSX_SYSROOT}/lib/darwin/libclang_rt.osx.a)
endif()
if(DEPENDS AND UNIX AND NOT APPLE)
target_link_libraries(XCB::XCB INTERFACE ${LIBXAU_LIBRARY})
endif()
if(STACK_TRACE AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_link_libraries(feather -rdynamic)
endif()