mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-01 14:15:24 +02:00
QWK: fix build issue on Debian/Ubuntu
This commit adds a patch for QWindowKit to ensure that it always
installs its dependency QMSetup in a directory where CMake will be able
to find it. This makes the previous QWindowKit patch unnecessary and
fixes a build issue when packaging Jami on Debian and Ubuntu that
started occurring when QWindowKit was updated in commit 6b70ffc
.
GitLab: #1976
Change-Id: I5f23fcbb612aa6d0eb0e77e9a5a006b24a5af082
This commit is contained in:
parent
cb05b4afd0
commit
c91bff35b6
4 changed files with 37 additions and 58 deletions
|
@ -94,13 +94,11 @@ if(WIN32)
|
|||
list(APPEND QWINDOWKIT_OPTIONS QWINDOWKIT_ENABLE_WINDOWS_SYSTEM_BORDERS OFF)
|
||||
endif()
|
||||
|
||||
# qmsetup uses the wrong package dir on some distributions
|
||||
# (including Fedora and openSUSE Leap at least)
|
||||
check_distro_needs_qmsetup_patch(DISTRO_NEEDS_QMSETUP_PATCH)
|
||||
if(DISTRO_NEEDS_QMSETUP_PATCH)
|
||||
list(APPEND QWINDOWKIT_PATCHES ${EXTRA_PATCHES_DIR}/0001-fix-fedora-fc-build.patch)
|
||||
set(qmsetup_cmake_path ${CMAKE_BINARY_DIR}/_install/lib64/cmake/qmsetup)
|
||||
endif()
|
||||
# If qwindowkit can't find qmsetup via cmake's find_package function, it will install it and
|
||||
# then call find_package again. Unfortunately, even the second call to find_package sometimes
|
||||
# fails due to qmsetup having been installed in the wrong directory. The following patch
|
||||
# ensures that qmsetup is always installed in the directory where find_package looks for it.
|
||||
list(APPEND QWINDOWKIT_PATCHES ${EXTRA_PATCHES_DIR}/0001-fix-qm_install_package-function.patch)
|
||||
|
||||
# qwindowkit (frameless window)
|
||||
add_fetch_content(
|
||||
|
|
|
@ -17,32 +17,6 @@
|
|||
include(FetchContent)
|
||||
include(CMakeParseArguments)
|
||||
|
||||
# Helper function to check if we're on a distribution that requires us
|
||||
# to apply a patch in order for qmsetup to use the right package directory
|
||||
function(check_distro_needs_qmsetup_patch DISTRO_NEEDS_QMSETUP_PATCH)
|
||||
set(${DISTRO_NEEDS_QMSETUP_PATCH} FALSE PARENT_SCOPE)
|
||||
# Check for the existence of /etc/os-release
|
||||
if(EXISTS "/etc/os-release")
|
||||
# Read the content of the file
|
||||
file(READ "/etc/os-release" OS_RELEASE_CONTENT)
|
||||
# Check if the distribution is Fedora or Red Hat-based
|
||||
string(REGEX MATCH "ID=fedora|ID_LIKE=\"rhel fedora\"|ID_LIKE=\"rhel centos fedora\"" RED_HAT_BASED "${OS_RELEASE_CONTENT}")
|
||||
# Check if the distribution is openSUSE Leap
|
||||
string(REGEX MATCH "ID=\"opensuse-leap\"" OPENSUSE_LEAP "${OS_RELEASE_CONTENT}")
|
||||
if(RED_HAT_BASED)
|
||||
set(${DISTRO_NEEDS_QMSETUP_PATCH} TRUE PARENT_SCOPE)
|
||||
message(STATUS "Running on a Red Hat-based distribution (Fedora, RHEL, CentOS, etc.)")
|
||||
elseif(OPENSUSE_LEAP)
|
||||
set(${DISTRO_NEEDS_QMSETUP_PATCH} TRUE PARENT_SCOPE)
|
||||
message(STATUS "Running on openSUSE Leap")
|
||||
else()
|
||||
message(STATUS "Distribution is not openSUSE Leap or Red Hat-based")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Cannot determine the distribution type: /etc/os-release not found")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Helper function to add external content with patches and options.
|
||||
# Parameters:
|
||||
# TARGET: Name of the target to create
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
From 161d28abb6784115ad71fcb6977e112e9d5756d4 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
|
||||
Date: Tue, 23 Jan 2024 15:38:34 -0500
|
||||
Subject: [PATCH] fix-fedora-fc-build
|
||||
|
||||
---
|
||||
CMakeLists.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0fb89c8..3a6ad6d 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -65,7 +65,7 @@ if(NOT TARGET qmsetup::library)
|
||||
)
|
||||
|
||||
# Find package again
|
||||
- find_package(qmsetup REQUIRED PATHS ${_package_path})
|
||||
+ find_package(qmsetup REQUIRED PATHS ${_package_path} ${qmsetup_cmake_path})
|
||||
|
||||
# Update import path
|
||||
set(qmsetup_DIR ${_package_path} CACHE PATH "" FORCE)
|
||||
--
|
||||
2.34.1
|
||||
|
32
extras/patches/0001-fix-qm_install_package-function.patch
Normal file
32
extras/patches/0001-fix-qm_install_package-function.patch
Normal file
|
@ -0,0 +1,32 @@
|
|||
From 56830725e641705e0113a068ee58df7029202439 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Fran=C3=A7ois-Simon=20Fauteux-Chapleau?=
|
||||
<francois-simon.fauteux-chapleau@savoirfairelinux.com>
|
||||
Date: Wed, 2 Apr 2025 20:54:02 -0400
|
||||
Subject: [PATCH] fix qm_install_package function
|
||||
|
||||
---
|
||||
cmake/modules/private/InstallPackage.cmake | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/qmsetup/cmake/modules/private/InstallPackage.cmake b/qmsetup/cmake/modules/private/InstallPackage.cmake
|
||||
index 70174bc..f067de5 100644
|
||||
--- a/qmsetup/cmake/modules/private/InstallPackage.cmake
|
||||
+++ b/qmsetup/cmake/modules/private/InstallPackage.cmake
|
||||
@@ -101,6 +101,7 @@ function(qm_install_package _name)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -S ${_src_dir} -B ${_build_dir}
|
||||
${_extra_args} ${_build_type}
|
||||
+ "-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}"
|
||||
"-DCMAKE_INSTALL_PREFIX=${_install_dir}" ${FUNC_CONFIGURE_ARGS}
|
||||
OUTPUT_FILE ${_log_file}
|
||||
ERROR_FILE ${_log_file}
|
||||
@@ -150,4 +151,4 @@ function(qm_install_package _name)
|
||||
if(FUNC_RESULT_PATH)
|
||||
set(${FUNC_RESULT_PATH} ${_install_cmake_dir} PARENT_SCOPE)
|
||||
endif()
|
||||
-endfunction()
|
||||
\ No newline at end of file
|
||||
+endfunction()
|
||||
--
|
||||
2.34.1
|
||||
|
Loading…
Add table
Reference in a new issue