From 0fe61da8170ee44db19f3ac8f0c9a4245db161c5 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Wed, 8 Oct 2025 14:14:47 +0800 Subject: [PATCH] fix linkage of libhpipp --- hplip-automake-fix-subdir-objects.patch | 12 ++++++ hplip-configure-python.patch | 56 +++++++++++++++++++++++++ hplip-fix-linkage.patch | 13 ++++++ hplip.spec | 30 ++++++------- 4 files changed, 97 insertions(+), 14 deletions(-) create mode 100644 hplip-automake-fix-subdir-objects.patch create mode 100644 hplip-configure-python.patch create mode 100644 hplip-fix-linkage.patch diff --git a/hplip-automake-fix-subdir-objects.patch b/hplip-automake-fix-subdir-objects.patch new file mode 100644 index 0000000..b671dac --- /dev/null +++ b/hplip-automake-fix-subdir-objects.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile.am b/Makefile.am +index 605744a..bb274d4 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -4,6 +4,7 @@ + # (c) 2004-2015 Copyright HP Development Company, LP + # Author: David Suffield, Naga Samrat Chowdary Narla, Sarbeswar Meher + INCLUDES = -Iip -Iio/hpmud -Iscan/sane -Iprnt/hpijs -Icommon/ ++AUTOMAKE_OPTIONS = subdir-objects + CFLAGS+= -DCONFDIR=\"$(hplip_confdir)\" + CXXFLAGS+= -DCONFDIR=\"$(hplip_confdir)\" + diff --git a/hplip-configure-python.patch b/hplip-configure-python.patch new file mode 100644 index 0000000..c06ac49 --- /dev/null +++ b/hplip-configure-python.patch @@ -0,0 +1,56 @@ +diff --git a/configure.in b/configure.in +index 9e330e3..e4a254e 100755 +--- a/configure.in ++++ b/configure.in +@@ -604,20 +604,31 @@ if test "$class_driver" = "no" && test " + fi + fi + +-SAVE_CPPFLAGS="$CPPFLAGS" +-CFLAGS=`python-config --includes` +-if [ $? -eq 0 ] +-then +- echo $FLAGS +-else +-CFLAGS=`python3-config --includes` +- if [ $? -eq 0 ] +- then +- echo $FLAGS +- fi ++AC_PATH_PROG(python3_config_path, python3-config, [AC_MSG_ERROR([python3-config not installed], 6)]) ++ ++PYTHON_INCLUDES=`$python3_config_path --includes` ++if test "X$PYTHON_INCLUDES" == "X" ; then ++ AC_MSG_ERROR([Cannot get Python includes via python3-config], 6) ++fi ++ ++PYTHON_LIBS=`$python3_config_path --libs` ++if test "X$PYTHON_LIBS" == "X" ; then ++ AC_MSG_ERROR([Cannot get Python libs via python3-config], 6) ++fi ++ ++SAVE_CFLAGS=$CFLAGS ++SAVE_LIBS=$LIBS ++ ++CFLAGS="$CFLAGS $PYTHON_INCLUDES" ++LIBS="$LIBS $PYTHON_LIBS" ++ ++AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); python_includes="ok", AC_MSG_ERROR([no: PYTHON DISABLED], 6)) ++ ++if test "X$python_includes" != "Xok" ; then ++ CFLAGS="$SAVE_CFLAGS" ++ LIBS="$SAVE_LIBS" + fi + +-#CFLAGS=`(python-config --includes)` + if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$lite_build" = "no" && test "$hpcups_only_build" = "no"; then + AC_ARG_VAR([PYTHON], [Python interpreter/compiler command]) + AC_CHECK_PROGS(PYTHON,[python python3 python2]) +@@ -631,7 +642,6 @@ if test "$class_driver" = "no" && test " + AS_IF([test "x$FOUND_HEADER" != "xyes"], + [AC_MSG_ERROR([cannot find python-devel support], 6)]) + fi +-CFLAGS="$save_CFLAGS" + + if test "$hpijs_only_build" = "no" && test "$scan_build" = "yes" && test "$hpcups_only_build" = "no"; then + AC_CHECK_LIB([sane], [sane_open], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find sane-backends-devel support (or --disable-scan-build)], 12)]) diff --git a/hplip-fix-linkage.patch b/hplip-fix-linkage.patch new file mode 100644 index 0000000..1e68102 --- /dev/null +++ b/hplip-fix-linkage.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.am b/Makefile.am +index 605744a..58bd60b 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -325,7 +325,7 @@ lib_LTLIBRARIES += libhpipp.la + libhpipp_la_SOURCES = protocol/hp_ipp.c protocol/hp_ipp.h protocol/hp_ipp_i.h + libhpipp_la_CFLAGS = -DCONFDIR=\"$(hplip_confdir)\" + libhpipp_la_LDFLAGS = -version-info 0:1:0 +-libhpipp_la_LIBADD = libhpmud.la ++libhpipp_la_LIBADD = libhpmud.la -lcups + + # cupsext + cupsextdir = $(PYTHONEXECDIR) diff --git a/hplip.spec b/hplip.spec index 165be2c..b06804a 100644 --- a/hplip.spec +++ b/hplip.spec @@ -1,7 +1,7 @@ Name: hplip Summary: HP Linux Imaging and Printing Project Version: 3.25.6 -Release: 1 +Release: 2 License: GPL-2.0-or-later AND MIT AND BSD-3-Clause AND IJG AND GPL-2.0-only AND LGPL-2.1-or-later AND BSD-2-Clause AND Public Domain Url: https://developers.hp.com/hp-linux-imaging-and-printing Source0: http://downloads.sourceforge.net/sourceforge/hplip/hplip-%%{version}.tar.gz @@ -40,6 +40,9 @@ Patch34: hplip-hpfax-importerror-print.patch Patch35: 0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch Patch36: 0026-Call-QMessageBox-constructors-of-PyQT5-with-the-corr.patch Patch37: 0027-Fixed-incomplete-removal-of-hp-toolbox-features-whic.patch +Patch38: hplip-fix-linkage.patch +Patch39: hplip-automake-fix-subdir-objects.patch +Patch40: hplip-configure-python.patch Requires: python3-pillow python3-gobject cups python3-dbus systemd %{_bindir}/gpg Requires: python3-qt5 wget python3-gobject python3-reportlab sane-backends python3 @@ -138,6 +141,9 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h %patch -P36 -p1 -b .qmsgbox-typos-fix %patch -P37 -p1 -b .toolbox-crash +%patch -P38 -p1 -b .linkage +%patch -P39 -p1 -b .subdir +%patch -P40 -p1 -b .python sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ @@ -157,9 +163,7 @@ sed -i 's|^AM_INIT_AUTOMAKE|AM_INIT_AUTOMAKE([foreign])|g' configure.in autoreconf --verbose --force --install -export CFLAGS="%{optflags} $(python3-config --includes)" -export CXXFLAGS="%{optflags} $(python3-config --includes)" -export LDFLAGS="${LDFLAGS} -fPIC" +export LDFLAGS="%{build_ldflags} -fPIC" %configure \ --enable-scan-build --enable-gui-build --enable-fax-build \ @@ -223,29 +227,23 @@ popd install -d ${RPM_BUILD_ROOT}%{_datadir}/applications sed -i -e '/^Categories=/d' hplip.desktop sed -i -e '/^Encoding=/d' hplip.desktop -desktop-file-validate hplip.desktop desktop-file-install --vendor HP --dir ${RPM_BUILD_ROOT}/%{_datadir}/applications --add-category System \ --add-category Settings --add-category HardwareSettings hplip.desktop -appstream-util validate-relax --nonet ${RPM_BUILD_ROOT}%{_datadir}/appdata/*.appdata.xml install -p -m755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_bindir}/hpcups-update-ppds install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sane.d/dll.d echo hpaio > ${RPM_BUILD_ROOT}%{_sysconfdir}/sane.d/dll.d/hpaio find doc/images -type f -exec chmod 644 {} \; install -d ${RPM_BUILD_ROOT}%{_datadir}/hplip/prnt/plugins -%pre -%{_bindir}/systemctl start cups &>/dev/null ||: -%{_bindir}/systemctl enable cups &>/dev/null ||: +%check +desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop +appstream-util validate-relax --nonet ${RPM_BUILD_ROOT}%{_datadir}/appdata/*.appdata.xml %post %{_bindir}/hpcups-update-ppds &>/dev/null ||: -/sbin/ldconfig - -%postun -/sbin/ldconfig %files -%doc COPYING doc/* +%doc doc/* %license COPYING %{_bindir}/* %dir %{_datadir}/%{name} @@ -269,6 +267,10 @@ install -d ${RPM_BUILD_ROOT}%{_datadir}/hplip/prnt/plugins %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Wed Oct 08 2025 Funda Wang - 3.25.6-2 +- fix linkage of libhpipp +- drop redundant code on cups + * Mon Sep 29 2025 xu_ping <707078654@qq.com> - 3.25.6-1 - Upgrade version to 3.25.6 -- Gitee