[packages/libhttpseverywhere] - updated to 0.8.3 - added vala0.42 patch (compatibility with libarchive binding from vala 0.42+)

qboosh qboosh at pld-linux.org
Sat Nov 23 08:46:41 CET 2019


commit 55cba399bce290901727705eb98291f5ba96243d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Nov 23 08:47:01 2019 +0100

    - updated to 0.8.3
    - added vala0.42 patch (compatibility with libarchive binding from vala 0.42+)

 libhttpseverywhere-vala0.42.patch | 45 +++++++++++++++++++++++++++++++++++++++
 libhttpseverywhere.spec           | 21 +++++++++++-------
 2 files changed, 58 insertions(+), 8 deletions(-)
---
diff --git a/libhttpseverywhere.spec b/libhttpseverywhere.spec
index 1cbe647..44371dc 100644
--- a/libhttpseverywhere.spec
+++ b/libhttpseverywhere.spec
@@ -5,13 +5,14 @@
 Summary:	A library to rewrite HTTP URLs to HTTPS URLs
 Summary(pl.UTF-8):	Biblioteka przepisująca URL-e HTTP na HTTPS
 Name:		libhttpseverywhere
-Version:	0.8.2
+Version:	0.8.3
 Release:	1
 License:	LGPL v3+
 Group:		Libraries
 Source0:	http://ftp.gnome.org/pub/GNOME/sources/libhttpseverywhere/0.8/%{name}-%{version}.tar.xz
-# Source0-md5:	569d9f84345aa9c1ee26da295a096837
-URL:		https://github.com/GNOME/libhttpseverywhere
+# Source0-md5:	c2a029fe6adac0d27e393cd2cfe74c7f
+Patch0:		%{name}-vala0.42.patch
+URL:		https://gitlab.gnome.org/GNOME/libhttpseverywhere
 BuildRequires:	glib2-devel >= 2.0
 BuildRequires:	gobject-introspection-devel
 BuildRequires:	json-glib-devel
@@ -20,11 +21,14 @@ BuildRequires:	libgee-devel >= 0.8
 BuildRequires:	libsoup-devel >= 2.4
 BuildRequires:	libxml2-devel >= 2.0
 BuildRequires:	meson >= 0.39.1
-BuildRequires:	ninja
+BuildRequires:	ninja >= 1.5
 BuildRequires:	pkgconfig
+BuildRequires:	rpmbuild(macros) >= 1.736
+BuildRequires:	tar >= 1:1.22
 BuildRequires:	vala
-BuildRequires:	vala-libgee
-BuildRequires:	valadoc
+BuildRequires:	vala-libgee >= 0.8
+%{?with_apidocs:BuildRequires:	valadoc}
+BuildRequires:	xz
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -104,17 +108,18 @@ Dokumentacja API biblioteki HTTPSEverywhere.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %meson build \
 	%{?with_apidocs:-Denable_valadoc=true}
 
-%meson_build -C build
+%ninja_build -C build
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%meson_install -C build
+%ninja_install -C build
 
 %clean
 rm -rf $RPM_BUILD_ROOT
diff --git a/libhttpseverywhere-vala0.42.patch b/libhttpseverywhere-vala0.42.patch
new file mode 100644
index 0000000..f27681f
--- /dev/null
+++ b/libhttpseverywhere-vala0.42.patch
@@ -0,0 +1,45 @@
+From 6da08ef1ade9ea267cecf14dd5cb2c3e6e5e50cb Mon Sep 17 00:00:00 2001
+From: Rico Tzschichholz <ricotz at ubuntu.com>
+Date: Tue, 8 Jan 2019 08:27:59 +0100
+Subject: [PATCH] update: Adapt to libarchive binding change since valac 0.42
+
+Fixes https://gitlab.gnome.org/GNOME/libhttpseverywhere/issues/1
+---
+ src/update.vala | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/src/update.vala b/src/update.vala
+index 9168e28..86e39c1 100644
+--- a/src/update.vala
++++ b/src/update.vala
+@@ -188,7 +188,12 @@ namespace HTTPSEverywhere {
+ 
+             Archive.Read zipreader = new Archive.Read();
+             zipreader.set_format(Archive.Format.ZIP);
++#if VALA_0_42
++            output.length = (int) size_read;
++            zipreader.open_memory(output);
++#else
+             zipreader.open_memory(output, size_read);
++#endif
+ 
+             string json = "";
+             unowned Archive.Entry e = null;
+@@ -198,11 +203,15 @@ namespace HTTPSEverywhere {
+                     found_ruleset_file = true;
+                     uint8[] jsonblock = new uint8[1024*1024];
+                     while (true) {
+-                        var r = zipreader.read_data(jsonblock, 1024*1024);
++#if VALA_0_42
++                        var r = zipreader.read_data(jsonblock);
++#else
++                        var r = zipreader.read_data(jsonblock, jsonblock.length);
++#endif
+                         if (r < 0) {
+                             throw new UpdateError.CANT_READ_FROM_ARCHIVE("Failed reading archive stream");
+                         }
+-                        if (r < 1024*1024 && r != 0) {
++                        if (r < jsonblock.length && r != 0) {
+                             uint8[] remainder = new uint8[r];
+                             Memory.copy(remainder, jsonblock, r);
+                             json += (string)remainder;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libhttpseverywhere.git/commitdiff/55cba399bce290901727705eb98291f5ba96243d



More information about the pld-cvs-commit mailing list