From 4f431cd2d2c61c7572f4a89aa3e8f17cd2caf927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sun, 10 Jul 2022 18:00:49 +0700 Subject: [PATCH] zbar-qt: split from zbar template Avoid cycle: gst-plugins-bad1 -> zbar ^ | | v gtk4 <- libinput <- qt5 Close #37948 --- srcpkgs/libzbar-qt | 2 +- srcpkgs/libzbar-qt-devel | 1 + srcpkgs/zbar-qt | 1 - srcpkgs/zbar-qt/template | 103 +++++++++++++++++++++++++++++++++++++++ srcpkgs/zbar-qt/update | 1 + srcpkgs/zbar/template | 67 ++++--------------------- 6 files changed, 116 insertions(+), 59 deletions(-) create mode 120000 srcpkgs/libzbar-qt-devel delete mode 120000 srcpkgs/zbar-qt create mode 100644 srcpkgs/zbar-qt/template create mode 100644 srcpkgs/zbar-qt/update diff --git a/srcpkgs/libzbar-qt b/srcpkgs/libzbar-qt index 8660d16a458f..5a72830bab2e 120000 --- a/srcpkgs/libzbar-qt +++ b/srcpkgs/libzbar-qt @@ -1 +1 @@ -zbar \ No newline at end of file +zbar-qt \ No newline at end of file diff --git a/srcpkgs/libzbar-qt-devel b/srcpkgs/libzbar-qt-devel new file mode 120000 index 000000000000..5a72830bab2e --- /dev/null +++ b/srcpkgs/libzbar-qt-devel @@ -0,0 +1 @@ +zbar-qt \ No newline at end of file diff --git a/srcpkgs/zbar-qt b/srcpkgs/zbar-qt deleted file mode 120000 index 8660d16a458f..000000000000 --- a/srcpkgs/zbar-qt +++ /dev/null @@ -1 +0,0 @@ -zbar \ No newline at end of file diff --git a/srcpkgs/zbar-qt/template b/srcpkgs/zbar-qt/template new file mode 100644 index 000000000000..16ef561ec2ac --- /dev/null +++ b/srcpkgs/zbar-qt/template @@ -0,0 +1,103 @@ +# Template file for 'zbar-qt' +# Keep in sync with zbar +pkgname=zbar-qt +version=0.23.1 +revision=6 +wrksrc="zbar-$version" +build_style=gnu-configure +configure_args="--with-qt --without-gir --without-gtk --without-python" +hostmakedepends="pkg-config qt5-qmake qt5-host-tools" +makedepends="libmagick-devel libXv-devel v4l-utils-devel qt5-x11extras-devel + libxml2-devel" +depends="libzbar-qt>=${version}_${revision}" +short_desc="Barcode reading library and application - Qt frondend" +maintainer="Leah Neukirchen " +license="LGPL-2.1-or-later" +homepage="https://git.linuxtv.org/zbar.git/" +distfiles="https://linuxtv.org/downloads/zbar/zbar-${version}.tar.bz2" +checksum=dad260b47ef887a639e840a89e5e6e132217b6bba2a8473565d1f459bcb97c1f + +case "$XBPS_TARGET_MACHINE" in + mips*) + broken="don't enable qt as it can't be built for mips*" + ;; +esac + +if [ "$XBPS_TARGET_LIBC" = musl ]; then + makedepends+=" argp-standalone" + LDFLAGS="-largp" +fi + +CFLAGS="-DNDEBUG" + +post_extract() { + # 0.23.1 doesn't ship this file, corrected in master + cat >zbar-qt5.pc.in <<-'_EOF' + prefix=@prefix@ + exec_prefix=@exec_prefix@ + libdir=@libdir@ + includedir=@includedir@ + + Name: zbar-qt + Description: bar code scanning and decoding Qt5 widget + URL: http://zbar.sourceforge.net + Version: @VERSION@ + Requires: zbar, Qt5Core >= 5, Qt5Gui >= 5 + Libs: -L${libdir} -lzbarqt + Cflags: -I${includedir} + _EOF +} + +post_patch() { + # https://github.com/mchehab/zbar/commit/a133aea7880bbb56d7553 + vsed -i -e 's/^.include.*gettext[.]h.*/#include /' \ + zbarcam/zbarcam.c zbarimg/zbarimg.c +} + +post_install() { + local _file + # shipped by zbar + rm -rf "$DESTDIR"/etc + rm -rf "$DESTDIR"/usr/bin/zbarcam + # rm -rf "$DESTDIR"/usr/bin/zbarcam-gtk + rm -rf "$DESTDIR"/usr/bin/zbarimg + # shipped by zbar, libzbar-devel + rm -rf "$DESTDIR"/usr/share + # shipped by libzbar and libzbar-devel + rm -rf "$DESTDIR"/usr/lib/girepository-1.0 + rm -rf "$DESTDIR"/usr/lib/libzbar.so* + # rm -rf "$DESTDIR"/usr/lib/libzbargtk.so* + rm -rf "$DESTDIR"/usr/lib/python* + # shipped by libzbar-devel + rm -rf "$DESTDIR"/usr/include/zbar.h + for _file in "$DESTDIR"/usr/include/zbar/*; do + case _file in + "$DESTDIR"/usr/include/zbar/QZBar*) ;; + *) rm -rf "$_file" ;; + esac + done + rm -rf "$DESTDIR"/usr/lib/libzbar.a + # rm -rf "$DESTDIR"/usr/lib/libzbargtk.a + rm -rf "$DESTDIR"/usr/lib/pkgconfig/zbar.pc + rm -rf "$DESTDIR"/usr/lib/pkgconfig/zbar-gtk.pc +} + +libzbar-qt_package() { + conflicts="libzbar<0.10_10" + short_desc="${short_desc/frondend/bindings}" + pkg_install() { + vmove "usr/lib/libzbarqt.so.*" + } +} + +libzbar-qt-devel_package() { + short_desc+=" - development files" + depends="libzbar-qt>=${version}_${revision} + libzbar-devel>=${version}_${revision}" + pkg_install() { + vmove usr/include + vmove usr/lib/pkgconfig + vmove "usr/lib/*.a" + vmove "usr/lib/*.so" + } +} diff --git a/srcpkgs/zbar-qt/update b/srcpkgs/zbar-qt/update new file mode 100644 index 000000000000..e797246e05a6 --- /dev/null +++ b/srcpkgs/zbar-qt/update @@ -0,0 +1 @@ +ignore='*.*.9?' diff --git a/srcpkgs/zbar/template b/srcpkgs/zbar/template index e8c8bdc28aab..f4768c38febf 100644 --- a/srcpkgs/zbar/template +++ b/srcpkgs/zbar/template @@ -1,15 +1,15 @@ # Template file for 'zbar' +# Keep in sync with zbar-qt pkgname=zbar version=0.23.1 -revision=5 +revision=6 build_style=gnu-configure build_helper=gir -configure_args="$(vopt_with qt) --with-gir --with-python=python3" -hostmakedepends="pkg-config python3 glib-devel - $(vopt_if qt 'qt5-qmake qt5-host-tools')" +configure_args="--with-gir --with-python=python3" +hostmakedepends="pkg-config python3 glib-devel" makedepends="libmagick-devel libXv-devel python3-devel v4l-utils-devel - gtk+3-devel $(vopt_if qt qt5-x11extras-devel)" -depends="libzbar-${version}_${revision}" + gtk+3-devel libxml2-devel" +depends="libzbar>=${version}_${revision}" short_desc="Barcode reading library and application" maintainer="Leah Neukirchen " license="LGPL-2.1-or-later" @@ -17,45 +17,14 @@ homepage="https://git.linuxtv.org/zbar.git/" distfiles="https://linuxtv.org/downloads/zbar/${pkgname}-${version}.tar.bz2" checksum=dad260b47ef887a639e840a89e5e6e132217b6bba2a8473565d1f459bcb97c1f -build_options="qt" -case "$XBPS_TARGET_MACHINE" in - mips*) ;; # don't enable qt as it can't be built for mips* - *) build_options_default="qt" ;; -esac - -case "$XBPS_TARGET_MACHINE" in - *-musl) makedepends+=" argp-standalone" - LDFLAGS="-largp" - ;; -esac +if [ "$XBPS_TARGET_LIBC" = musl ]; then + makedepends+=" argp-standalone" + LDFLAGS="-largp" +fi export PYTHON_CFLAGS="-I$XBPS_CROSS_BASE/usr/include/python$py3_ver" CFLAGS="-DNDEBUG" -subpackages="libzbar libzbar-devel" - -if [ "$build_option_qt" ]; then - subpackages+=" zbar-qt libzbar-qt" -fi - -post_extract() { - # 0.23.1 doesn't ship this file, corrected in master - cat >zbar-qt5.pc.in <<-'_EOF' - prefix=@prefix@ - exec_prefix=@exec_prefix@ - libdir=@libdir@ - includedir=@includedir@ - - Name: zbar-qt - Description: bar code scanning and decoding Qt5 widget - URL: http://zbar.sourceforge.net - Version: @VERSION@ - Requires: zbar, Qt5Core >= 5, Qt5Gui >= 5 - Libs: -L${libdir} -lzbarqt - Cflags: -I${includedir} - _EOF -} - post_patch() { # https://github.com/mchehab/zbar/commit/a133aea7880bbb56d7553 vsed -i -e 's/^.include.*gettext[.]h.*/#include /' \ @@ -72,22 +41,6 @@ libzbar_package() { } } -zbar-qt_package() { - short_desc+=" - Qt frontend" - pkg_install() { - vmove "usr/bin/*-qt" - } -} - - -libzbar-qt_package() { - conflicts="libzbar<0.10_10" - short_desc+=" - Qt bindings" - pkg_install() { - vmove "usr/lib/libzbarqt.so.*" - } -} - libzbar-devel_package() { short_desc+=" - development files" depends="libzbar>=${version}_${revision}"