summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2024-04-10 22:20:38 +0200
committerSlávek Banko <slavek.banko@axis.cz>2024-04-11 02:16:54 +0200
commitc9dcbc21dd354cfdf7a70a882b58cb12a0a0b203 (patch)
tree233870057bed35c4a5922063d063982566a40705
parent796994c302565b83e4dd8460b77f0f0f1b5da38e (diff)
downloadtde-packaging-c9dcbc21dd354cfdf7a70a882b58cb12a0a0b203.tar.gz
tde-packaging-c9dcbc21dd354cfdf7a70a882b58cb12a0a0b203.zip
DEB k3b: Change the library package name in case of incompatible ABI for 64-bit time_t.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 58da7fe89ae9d3439c8f6f73704e3475d118cd2b)
-rwxr-xr-xdebian/_base/applications/multimedia/k3b/debian/rules46
-rwxr-xr-xubuntu/_base/applications/multimedia/k3b/debian/rules46
2 files changed, 92 insertions, 0 deletions
diff --git a/debian/_base/applications/multimedia/k3b/debian/rules b/debian/_base/applications/multimedia/k3b/debian/rules
index 72db8e489..0cd87b24d 100755
--- a/debian/_base/applications/multimedia/k3b/debian/rules
+++ b/debian/_base/applications/multimedia/k3b/debian/rules
@@ -4,6 +4,14 @@ include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk
include debian/cdbs/debian-tde.mk
+DEB_TIME64_API = $(shell echo | cc $(dpkg-buildflags --get CPPFLAGS) -dM -E -x c++ - | grep -q "_TIME_BITS 64" && echo true || false)
+ifeq ($(DEB_TIME64_API),true)
+DEB_TIME64_SUFFIX = t64
+else
+DEB_TIME64_SUFFIX =
+endif
+
+
DEB_CMAKE_EXTRA_FLAGS := \
-DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \
-DCMAKE_INSTALL_PREFIX="/opt/trinity" \
@@ -14,3 +22,41 @@ DEB_CMAKE_EXTRA_FLAGS := \
-DCMAKE_VERBOSE_MAKEFILE="ON" \
-DCMAKE_SKIP_RPATH="OFF" \
-DWITH_ALL_OPTIONS="ON"
+
+
+post-patches::
+ dh_testdir
+ifeq ($(DEB_TIME64_API),true)
+ # update library package name for TIME64 ABI
+ ls -d debian/* | \
+ grep -E "/libk3b3-trinity\." | \
+ grep -v "\.t64$$" | \
+ while read a; do \
+ [ -d $$a ] || [ -f $$a.t64 ] || \
+ (cp -a $$a debian/libk3b3$(DEB_TIME64_SUFFIX)-$${a##*-} && mv $$a $$a.t64); \
+ done
+ [ -f debian/control.t64 ] || \
+ sed -i.t64 \
+ -e "s/^Package: \\(libk3b3\\)-trinity$$/Package: \\1$(DEB_TIME64_SUFFIX)-trinity/" \
+ -e "s/^\\(Replaces\\|Breaks\\):\\(.*\\)\\(libk3b3-trinity\\)\\( [^,]*\|$$\)/\\1:\\2\\3/" \
+ -e "s/\\(libk3b3\\)-trinity (=/\\1$(DEB_TIME64_SUFFIX)-trinity (=/" \
+ debian/control
+endif
+
+clean::
+ dh_testdir
+ dh_clean
+
+ifeq ($(DEB_TIME64_API),true)
+ # revert library package name for TIME64 ABI
+ ls -d debian/* | \
+ grep -E "\.t64$$" | \
+ while read a; do \
+ mv $$a $${a%.t64}; \
+ done
+ ls -d debian/* | \
+ grep -E "/libk3b3$(DEB_TIME64_SUFFIX)-" | \
+ xargs -r rm
+ [ ! -f debian/control.t64 ] || \
+ mv debian/control.t64 debian/control
+endif
diff --git a/ubuntu/_base/applications/multimedia/k3b/debian/rules b/ubuntu/_base/applications/multimedia/k3b/debian/rules
index 72db8e489..0cd87b24d 100755
--- a/ubuntu/_base/applications/multimedia/k3b/debian/rules
+++ b/ubuntu/_base/applications/multimedia/k3b/debian/rules
@@ -4,6 +4,14 @@ include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk
include debian/cdbs/debian-tde.mk
+DEB_TIME64_API = $(shell echo | cc $(dpkg-buildflags --get CPPFLAGS) -dM -E -x c++ - | grep -q "_TIME_BITS 64" && echo true || false)
+ifeq ($(DEB_TIME64_API),true)
+DEB_TIME64_SUFFIX = t64
+else
+DEB_TIME64_SUFFIX =
+endif
+
+
DEB_CMAKE_EXTRA_FLAGS := \
-DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \
-DCMAKE_INSTALL_PREFIX="/opt/trinity" \
@@ -14,3 +22,41 @@ DEB_CMAKE_EXTRA_FLAGS := \
-DCMAKE_VERBOSE_MAKEFILE="ON" \
-DCMAKE_SKIP_RPATH="OFF" \
-DWITH_ALL_OPTIONS="ON"
+
+
+post-patches::
+ dh_testdir
+ifeq ($(DEB_TIME64_API),true)
+ # update library package name for TIME64 ABI
+ ls -d debian/* | \
+ grep -E "/libk3b3-trinity\." | \
+ grep -v "\.t64$$" | \
+ while read a; do \
+ [ -d $$a ] || [ -f $$a.t64 ] || \
+ (cp -a $$a debian/libk3b3$(DEB_TIME64_SUFFIX)-$${a##*-} && mv $$a $$a.t64); \
+ done
+ [ -f debian/control.t64 ] || \
+ sed -i.t64 \
+ -e "s/^Package: \\(libk3b3\\)-trinity$$/Package: \\1$(DEB_TIME64_SUFFIX)-trinity/" \
+ -e "s/^\\(Replaces\\|Breaks\\):\\(.*\\)\\(libk3b3-trinity\\)\\( [^,]*\|$$\)/\\1:\\2\\3/" \
+ -e "s/\\(libk3b3\\)-trinity (=/\\1$(DEB_TIME64_SUFFIX)-trinity (=/" \
+ debian/control
+endif
+
+clean::
+ dh_testdir
+ dh_clean
+
+ifeq ($(DEB_TIME64_API),true)
+ # revert library package name for TIME64 ABI
+ ls -d debian/* | \
+ grep -E "\.t64$$" | \
+ while read a; do \
+ mv $$a $${a%.t64}; \
+ done
+ ls -d debian/* | \
+ grep -E "/libk3b3$(DEB_TIME64_SUFFIX)-" | \
+ xargs -r rm
+ [ ! -f debian/control.t64 ] || \
+ mv debian/control.t64 debian/control
+endif