Browse Source

python3-gobject3 pygobject3 package update

Signed-off-by: guibuilder_pel7ppc64lebuilder0 <guibuilder@powerel.org>
master
guibuilder_pel7ppc64lebuilder0 5 years ago
parent
commit
b9b2493329
  1. 126
      SOURCES/0001-Revert-Correctly-decode-Adobe-CMYK-JPEGs-in-PDF-expo.patch
  2. 36
      SOURCES/pygobject-3.22.0-remove-Werror.patch
  3. 6
      SPECS/pygobject3.spec
  4. 104
      SPECS/python3-gobject3.spec

126
SOURCES/0001-Revert-Correctly-decode-Adobe-CMYK-JPEGs-in-PDF-expo.patch

@ -0,0 +1,126 @@ @@ -0,0 +1,126 @@
From bf597b89288b6271f56031d5a20bfaf59f146d4c Mon Sep 17 00:00:00 2001
From: Bryce Harrington <bryce@bryceharrington.org>
Date: Tue, 16 Oct 2018 09:13:23 -0700
Subject: [PATCH] Revert "Correctly decode Adobe CMYK JPEGs in PDF export"

From further testing and investigation it appears that many PDF viewers
already have a workaround to invert Adobe CMYK JPEGs, so our generated
PDFs display incorrectly with those viewers due to double-inversion.

Further investigation will be needed to find a better solution that
doesn't cause regression for some PDF viewers; perhaps PDF viewers that
lack this inversion workaround should be changed to include it. For now
we'll drop the patch to avoid shipping the regression in 1.16.0.

This reverts commit b207a932a2d3740984319dffd58a0791580597cd.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=97612
Fixes: https://gitlab.freedesktop.org/cairo/cairo/issues/156
---
src/cairo-image-info-private.h | 1 -
src/cairo-image-info.c | 21 ---------------------
src/cairo-pdf-surface.c | 2 --
3 files changed, 24 deletions(-)

diff --git a/src/cairo-image-info-private.h b/src/cairo-image-info-private.h
index 99cbbcc02..e64928e40 100644
--- a/src/cairo-image-info-private.h
+++ b/src/cairo-image-info-private.h
@@ -43,7 +43,6 @@ typedef struct _cairo_image_info {
int height;
int num_components;
int bits_per_component;
- int is_adobe_jpeg;
} cairo_image_info_t;
cairo_private cairo_int_status_t
diff --git a/src/cairo-image-info.c b/src/cairo-image-info.c
index 3b4cf6edb..d147e3723 100644
--- a/src/cairo-image-info.c
+++ b/src/cairo-image-info.c
@@ -67,9 +67,6 @@
#define SOF14 0xce
#define SOF15 0xcf
-/* Start of tag markers */
-#define APP14 0xee /* Adobe */
-
static const unsigned char *
_jpeg_skip_segment (const unsigned char *p)
{
@@ -97,8 +94,6 @@ _cairo_image_info_get_jpeg_info (cairo_image_info_t *info,
{
const unsigned char *p = data;
- info->is_adobe_jpeg = FALSE;
-
while (p + 1 < data + length) {
if (*p != 0xff)
return CAIRO_INT_STATUS_UNSUPPORTED;
@@ -136,18 +131,6 @@ _cairo_image_info_get_jpeg_info (cairo_image_info_t *info,
_jpeg_extract_info (info, p);
return CAIRO_STATUS_SUCCESS;
- case APP14:
- /* "Adobe" tags segment indicates inverted CMYK (in
- * CMYK images). */
- if (p + 12 > data + length)
- return CAIRO_INT_STATUS_UNSUPPORTED;
-
- info->is_adobe_jpeg =
- (0 == strncmp((const char *)(p + 3), "Adobe", 5));
-
- p = _jpeg_skip_segment(p);
- break;
-
default:
if (*p >= RST_begin && *p <= RST_end) {
p++;
@@ -223,7 +206,6 @@ _jpx_extract_info (const unsigned char *p, cairo_image_info_t *info)
info->width = get_unaligned_be32 (p + 4);
info->num_components = (p[8] << 8) + p[9];
info->bits_per_component = p[10];
- info->is_adobe_jpeg = FALSE;
}
cairo_int_status_t
@@ -301,8 +283,6 @@ _cairo_image_info_get_png_info (cairo_image_info_t *info,
p += 4;
info->height = get_unaligned_be32 (p);
- info->is_adobe_jpeg = FALSE;
-
return CAIRO_STATUS_SUCCESS;
}
@@ -415,7 +395,6 @@ _jbig2_extract_info (cairo_image_info_t *info, const unsigned char *p)
info->height = get_unaligned_be32 (p + 4);
info->num_components = 1;
info->bits_per_component = 1;
- info->is_adobe_jpeg = FALSE;
}
cairo_int_status_t
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index ab6781340..7eb61aa1e 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -3169,7 +3169,6 @@ _cairo_pdf_surface_emit_jpeg_image (cairo_pdf_surface_t *surface,
" /Height %d\n"
" /ColorSpace %s\n"
" /Interpolate %s\n"
- "%s"
" /BitsPerComponent %d\n"
"%s"
" /Filter /DCTDecode\n",
@@ -3177,7 +3176,6 @@ _cairo_pdf_surface_emit_jpeg_image (cairo_pdf_surface_t *surface,
info.height,
colorspace,
surface_entry->interpolate ? "true" : "false",
- info.is_adobe_jpeg && info.num_components == 4 ? " /Decode [ 1 0 1 0 1 0 1 0 ]\n" : "",
info.bits_per_component,
smask_buf);
}
--
2.20.1

36
SOURCES/pygobject-3.22.0-remove-Werror.patch

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
diff -up ./configure.upstream_werror ./configure
--- ./configure.upstream_werror 2016-09-19 09:23:28.000000000 -0400
+++ ./configure 2019-03-08 20:35:22.017458006 -0500
@@ -13672,7 +13672,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PySignal_SetWakeupFd in Python.h" >&5
$as_echo_n "checking for PySignal_SetWakeupFd in Python.h... " >&6; }
old_CPPFLAGS=$CPPFLAGS
-CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES"
+CPPFLAGS="-Wall $PYTHON_INCLUDES"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <Python.h>
@@ -14856,14 +14856,6 @@ fi
"
base_error_flags=" \
- -Werror=missing-prototypes \
- -Werror=implicit-function-declaration \
- -Werror=pointer-arith \
- -Werror=init-self \
- -Werror=format-security \
- -Werror=format=2 \
- -Werror=missing-include-dirs \
- -Werror=return-type \
"
additional_flags=""
@@ -14884,7 +14876,7 @@ fi
esac
if test "$enable_compile_warnings" = "error" ; then
- warning_flags="$warning_flags -Werror"
+ warning_flags="$warning_flags "
fi
for option in $warning_flags; do

6
SPECS/pygobject3.spec

@ -2,11 +2,11 @@ @@ -2,11 +2,11 @@
%define glib2_version 2.38.0
%define gobject_introspection_version 1.46.0
%define python2_version 2.7

%global with_python3 1
%global with_python3 1
%define python3_version 3.6
%global with_check 0

%global with_check 0
%global _smp_mflags -j1

Name: pygobject3
Version: 3.22.0

104
SPECS/python3-gobject3.spec

@ -0,0 +1,104 @@ @@ -0,0 +1,104 @@
# Last updated for version 3.18.0
%global glib2_version 2.38.0
%global gobject_introspection_version 1.46.0
%global confopts --disable-silent-rules --srcdir=..

Name: python3-gobject3
Version: 3.22.0
Release: 6%{?dist}
Summary: Python %{python3_version} bindings for GObject Introspection
License: LGPLv2+ and MIT
URL: https://wiki.gnome.org/Projects/PyGObject
Source0: https://download.gnome.org/sources/pygobject/3.22/pygobject-%{version}.tar.xz
# https://bugzilla.redhat.com/1247996
# which reverts https://bugzilla.gnome.org/709183
Patch1: pygobject-3.22.0-allow-static-module-import.patch
Patch2: pygobject-3.22.0-remove-Werror.patch
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
BuildRequires: python3-devel
BuildRequires: python3-cairo-devel
BuildRequires: cairo-gobject-devel


%description
The %{name} package provides a convenient wrapper for the GObject
library and and other libraries that are compatible with GObject Introspection,
for use in Python %{python3_version} programs.


%package -n python3-gobject
Summary: Python 3 bindings for GObject Introspection
Requires: python3-gobject-base%{?_isa} = %{version}-%{release}
Requires: python3-cairo%{?_isa}
%description -n python3-gobject
The %{name} package provides a convenient wrapper for the GObject
library and and other libraries that are compatible with GObject Introspection,
for use in Python %{python3_version} programs.


%package -n python3-gobject-base
Summary: Python %{python3_version} bindings for GObject Introspection base package
Requires: gobject-introspection%{?_isa} >= %{gobject_introspection_version}
%description -n python%{python3_pkgversion}-gobject-base
This package provides the non-cairo specific bits of the GObject Introspection
library.


%package -n python3-gobject-devel
Summary: Development files for embedding Python %{python3_version} GObject introspection support
Requires: python%{python3_pkgversion}-gobject%{?_isa} = %{version}-%{release}
Requires: gobject-introspection-devel%{?_isa}
%description -n python%{python3_pkgversion}-gobject-devel
This package contains files required to embed Python %{python3_version} PyGObject.


%prep
%autosetup -n pygobject-%{version} -p 1
%{_bindir}/find . -name '*.py' | %{_bindir}/xargs %{__sed} -i '1s|^#!python|#!%{__python3}|'


%build
%{__mkdir} -p python3
pushd python3
export PYTHON=%{__python3}
%{__ln_s} ../configure configure
%configure %{confopts}
make %{?_smp_mflags} V=1
popd


%install
export PYTHON=%{__python3}
%make_install -C python3
%{_bindir}/find %{buildroot} -name '*.la' -delete
# Don't include makefiles in the installed docs, in order to avoid creating
# multilib conflicts
%{__rm} -fr _docs
%{__mkdir} _docs
%{__cp} -a examples _docs
%{__rm} _docs/examples/Makefile*


%files -n python3-gobject
%{python3_sitearch}/gi/_gi_cairo*.so


%files -n python3-gobject-base
%license COPYING
%doc AUTHORS NEWS README
%dir %{python3_sitearch}/gi
%{python3_sitearch}/gi/*
%exclude %{python3_sitearch}/gi/_gi_cairo*.so
%{python3_sitearch}/pygobject-*.egg-info
%{python3_sitearch}/pygtkcompat/


%files -n python3-gobject-devel
%doc _docs/*
%dir %{_includedir}/pygobject-3.0/
%{_includedir}/pygobject-3.0/pygobject.h
%{_libdir}/pkgconfig/pygobject-3.0.pc


%changelog
Loading…
Cancel
Save