This commit is contained in:
Zdenek Dohnal 2020-05-19 10:44:40 +02:00
parent 07e64db764
commit 0f2672f23b
3 changed files with 68 additions and 32 deletions

View File

@ -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 "$hpijs_only_build" = "no" && test "$hpcu
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])
AM_PATH_PYTHON([2.2])
@@ -630,7 +641,6 @@ if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$lite
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)])

View File

@ -1,18 +0,0 @@
diff --git a/installer/dcheck.py b/installer/dcheck.py
index 3d0624e..1817819 100644
--- a/installer/dcheck.py
+++ b/installer/dcheck.py
@@ -366,11 +366,11 @@ def get_xsane_version():
def get_pil_version():
try:
- from PIL import Image
+ import PIL
except ImportError:
return '-'
else:
- return Image.PILLOW_VERSION
+ return PIL.__version__
def get_libpthread_version():
try:

View File

@ -6,8 +6,8 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.20.3
Release: 5%{?dist}
Version: 3.20.5
Release: 1%{?dist}
License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC
Url: https://developers.hp.com/hp-linux-imaging-and-printing
@ -126,12 +126,13 @@ Patch49: hplip-model-mismatch.patch
# sixext has problems with python3 strings (bz#1573430)
# reported https://bugs.launchpad.net/bugs/1480152
Patch50: hplip-unicodeerror.patch
# the version attribute in python-pillow got changed again..
# https://bugs.launchpad.net/hplip/+bug/1863620
Patch51: hplip-pil.patch
# error with new gcc, already reported in upstream as
# https://bugs.launchpad.net/hplip/+bug/1836735
Patch52: hplip-fix-Wreturn-type-warning.patch
Patch51: hplip-fix-Wreturn-type-warning.patch
# upstream check for python clears OS build system
# CFLAGS
# https://bugs.launchpad.net/hplip/+bug/1879445
Patch52: hplip-configure-python.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -393,8 +394,8 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h
%patch49 -p1 -b .model-mismatch
# 1573430 - sixext.py:to_string_utf8:UnicodeDecodeError: 'utf-8' codec can't decode bytes
%patch50 -p1 -b .unicodeerror
%patch51 -p1 -b .pil
%patch52 -p1 -b .Wreturn-fix
%patch51 -p1 -b .Wreturn-fix
%patch52 -p1 -b .configure-python
sed -i.duplex-constraints \
-e 's,\(UIConstraints.* \*Duplex\),//\1,' \
@ -419,12 +420,6 @@ sed -i 's|^AM_INIT_AUTOMAKE|AM_INIT_AUTOMAKE([foreign])|g' configure.in
# Regenerating all autotools files works-around these rpath issues.
autoreconf --verbose --force --install
# hplip used improper way of checking python usability which worked
# until python38 - start to include python in spec file
# https://bugzilla.redhat.com/show_bug.cgi?id=1706233
export CFLAGS="%{optflags} $(python3-config --includes)"
export CXXFLAGS="%{optflags} $(python3-config --includes)"
%configure \
--enable-scan-build --enable-gui-build --enable-fax-build \
--disable-foomatic-rip-hplip-install --enable-pp-build \
@ -701,6 +696,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
%changelog
* Thu May 14 2020 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.5-1
- 3.20.5
* Wed Apr 15 2020 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.3-5
- model mismatch during scanning due 'HP_' string