Hello community, here is the log from the commit of package libgepub for openSUSE:Factory checked in at 2018-01-26 13:37:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libgepub (Old) and /work/SRC/openSUSE:Factory/.libgepub.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libgepub" Fri Jan 26 13:37:22 2018 rev:4 rq:568734 version:0.5.3 Changes: -------- --- /work/SRC/openSUSE:Factory/libgepub/libgepub.changes 2017-09-13 21:44:09.301528396 +0200 +++ /work/SRC/openSUSE:Factory/.libgepub.new/libgepub.changes 2018-01-26 13:37:23.879183912 +0100 @@ -1,0 +2,22 @@ +Fri Jan 19 18:57:48 UTC 2018 - [email protected] + +- Update to version 0.5.3: + + Fixed SVG image resource replacement. + + Rename introspection build option. + + Removed autotools. + + build: + - Conform to build-api expectations. + - Remove default warning level. + - Remove unused defines. + - Improved linker script handling. + - Set prefix-relative install_dir for libgepub. + - Fix typo in symbol path creation. + + tests: + - Fix crash on exit. + - Replace "100" with a constant. + - widget: Don't change LC_NUMERIC at runtime. +- Pass introspection=true to meson, ensure we build the features + we want. +- Minor spec cleanup, use autosetup macro. + +------------------------------------------------------------------- Old: ---- libgepub-0.5.2.tar.xz New: ---- libgepub-0.5.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libgepub.spec ++++++ --- /var/tmp/diff_new_pack.ueANX2/_old 2018-01-26 13:37:24.507154581 +0100 +++ /var/tmp/diff_new_pack.ueANX2/_new 2018-01-26 13:37:24.515154208 +0100 @@ -1,7 +1,7 @@ # # spec file for package libgepub # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,14 +19,16 @@ %define basever 0.5 %define soname 0_5 %global sover 0 + Name: libgepub -Version: 0.5.2 +Version: 0.5.3 Release: 0 Summary: EPUB document reader and render library License: LGPL-2.1+ Group: Development/Languages/C and C++ Url: https://git.gnome.org/browse/libgepub Source: https://download.gnome.org/sources/%{name}/%{basever}/%{name}-%{version}.tar.xz + BuildRequires: meson BuildRequires: pkgconfig BuildRequires: pkgconfig(gio-2.0) @@ -38,7 +40,6 @@ BuildRequires: pkgconfig(libsoup-2.4) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(webkit2gtk-4.0) -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description A GObject-based library for handling and rendering EPUB documents. @@ -67,10 +68,12 @@ A GObject-based library for handling and rendering EPUB documents. %prep -%setup -q +%autosetup %build -%meson +%meson \ + -D introspection=true \ + %{nil} %meson_build %install @@ -81,16 +84,13 @@ %postun -n %{name}%{sover} -p /sbin/ldconfig %files -n %{name}%{sover} -%defattr(-,root,root) %doc README COPYING %{_libdir}/%{name}.so.* %files -n typelib-1_0-Gepub-%{soname} -%defattr(-,root,root) %{_libdir}/girepository-1.0/Gepub-%{basever}.typelib %files devel -%defattr(-,root,root) %{_includedir}/%{name}/ %{_libdir}/%{name}.so %{_libdir}/pkgconfig/%{name}.pc ++++++ libgepub-0.5.2.tar.xz -> libgepub-0.5.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/Makefile.am new/libgepub-0.5.3/Makefile.am --- old/libgepub-0.5.2/Makefile.am 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -SUBDIRS = libgepub tests - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libgepub.pc - -# introspection -DISTCHECK_CONFIGURE_FLAGS = --enable-introspection - -EXTRA_DIST = \ - $(pkgconfig_DATA).in \ - meson.build \ - meson_options.txt - -DISTCLEANFILES = \ - $(pkgconfig_DATA) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/autogen.sh new/libgepub-0.5.3/autogen.sh --- old/libgepub-0.5.2/autogen.sh 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/autogen.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -PKG_NAME="libgepub" - -(test -f $srcdir/configure.ac) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level $PKG_NAME directory" - exit 1 -} - -which gnome-autogen.sh || { - echo "You need to install gnome-common from the GNOME Git" - exit 1 -} - -REQUIRED_AUTOMAKE_VERSION=1.10 -REQUIRED_GTK_DOC_VERSION=1.13 -. gnome-autogen.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/configure new/libgepub-0.5.3/configure --- old/libgepub-0.5.2/configure 1970-01-01 01:00:00.000000000 +0100 +++ new/libgepub-0.5.3/configure 2018-01-16 07:36:54.000000000 +0100 @@ -0,0 +1,180 @@ +#!/bin/bash +# configure script adapter for Meson +# Based on build-api: https://github.com/cgwalters/build-api +# Copyright 2010, 2011, 2013 Colin Walters <[email protected]> +# Copyright 2016, 2017 Emmanuele Bassi +# Copyright 2017 Iñigo Martínez <[email protected]> +# Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php) + +# Build API variables: + +# Little helper function for reading args from the commandline. +# it automatically handles -a b and -a=b variants, and returns 1 if +# we need to shift $3. +read_arg() { + # $1 = arg name + # $2 = arg value + # $3 = arg parameter + local rematch='^[^=]*=(.*)$' + if [[ $2 =~ $rematch ]]; then + read "$1" <<< "${BASH_REMATCH[1]}" + else + read "$1" <<< "$3" + # There is no way to shift our callers args, so + # return 1 to indicate they should do it instead. + return 1 + fi +} + +sanitycheck() { + # $1 = arg name + # $1 = arg command + # $2 = arg alternates + local cmd=$( which $2 2>/dev/null ) + + if [ -x "$cmd" ]; then + read "$1" <<< "$cmd" + return 0 + fi + + test -z $3 || { + for alt in $3; do + cmd=$( which $alt 2>/dev/null ) + + if [ -x "$cmd" ]; then + read "$1" <<< "$cmd" + return 0 + fi + done + } + + echo -e "\e[1;31mERROR\e[0m: Command '$2' not found" + exit 1 +} + +checkoption() { + # $1 = arg + option="${1#*--}" + action="${option%%-*}" + name="${option#*-}" + if [ ${default_options[$name]+_} ]; then + case "$action" in + enable) meson_options[$name]=true;; + disable) meson_options[$name]=false;; + *) echo -e "\e[1;33mINFO\e[0m: Ignoring unknown action '$action'";; + esac + else + echo -e "\e[1;33mINFO\e[0m: Ignoring unknown option '$option'" + fi +} + +echooption() { + # $1 = option + if [ ${meson_options[$1]+_} ]; then + echo ${meson_options[$1]} + elif [ ${default_options[$1]+_} ]; then + echo ${default_options[$1]} + fi +} + +sanitycheck MESON 'meson' +sanitycheck MESONTEST 'mesontest' +sanitycheck NINJA 'ninja' 'ninja-build' + +declare -A default_options=( + ['introspection']=true +) + +declare -A meson_options + +while (($# > 0)); do + case "${1%%=*}" in + --prefix) read_arg prefix "$@" || shift;; + --bindir) read_arg bindir "$@" || shift;; + --sbindir) read_arg sbindir "$@" || shift;; + --libexecdir) read_arg libexecdir "$@" || shift;; + --datarootdir) read_arg datarootdir "$@" || shift;; + --datadir) read_arg datadir "$@" || shift;; + --sysconfdir) read_arg sysconfdir "$@" || shift;; + --libdir) read_arg libdir "$@" || shift;; + --mandir) read_arg mandir "$@" || shift;; + --includedir) read_arg includedir "$@" || shift;; + *) checkoption $1;; + esac + shift +done + +# Defaults +test -z ${prefix} && prefix="/usr/local" +test -z ${bindir} && bindir=${prefix}/bin +test -z ${sbindir} && sbindir=${prefix}/sbin +test -z ${libexecdir} && libexecdir=${prefix}/bin +test -z ${datarootdir} && datarootdir=${prefix}/share +test -z ${datadir} && datadir=${datarootdir} +test -z ${sysconfdir} && sysconfdir=${prefix}/etc +test -z ${libdir} && libdir=${prefix}/lib +test -z ${mandir} && mandir=${prefix}/share/man +test -z ${includedir} && includedir=${prefix}/include + +# The source directory is the location of this file +srcdir=$(dirname $0) + +# The build directory is the current location +builddir=`pwd` + +# If we're calling this file from the source directory then +# we automatically create a build directory and ensure that +# both Meson and Ninja invocations are relative to that +# location +if [[ -f "${builddir}/meson.build" ]]; then + mkdir -p _build + builddir="${builddir}/_build" + NINJA_OPT="-C ${builddir}" +fi + +# Wrapper Makefile for Ninja +cat > Makefile <<END +# Generated by configure; do not edit + +all: + CC="\$(CC)" CXX="\$(CXX)" ${NINJA} ${NINJA_OPT} + +install: + DESTDIR="\$(DESTDIR)" ${NINJA} ${NINJA_OPT} install + +check: + ${MESONTEST} ${NINJA_OPT} +END + +echo " + + libgepub + ======== + + meson: ${MESON} + ninja: ${NINJA} + prefix: ${prefix} + compiler: ${CC} + global flags: ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} + introspection: $(echooption introspection) + + Now type '${NINJA} -C ${builddir}' to build +" + +cmd_options="" +for key in "${!meson_options[@]}"; do + cmd_options="$cmd_options -D${key/\-/_}=${meson_options[$key]}" +done + +exec ${MESON} \ + --prefix=${prefix} \ + --libdir=${libdir} \ + --libexecdir=${libexecdir} \ + --datadir=${datadir} \ + --sysconfdir=${sysconfdir} \ + --bindir=${bindir} \ + --includedir=${includedir} \ + --mandir=${mandir} \ + ${cmd_options} \ + ${builddir} \ + ${srcdir} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/configure.ac new/libgepub-0.5.3/configure.ac --- old/libgepub-0.5.2/configure.ac 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/configure.ac 1970-01-01 01:00:00.000000000 +0100 @@ -1,55 +0,0 @@ -AC_PREREQ(2.60) -AC_INIT([libgepub],[0.5.2],[[email protected]]) -AC_CONFIG_AUX_DIR([build]) -AM_INIT_AUTOMAKE([1.10 -Wall -Werror dist-bzip2]) -AM_SILENT_RULES([yes]) - -GNOME_COMMON_INIT - -# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it -m4_pattern_allow([AM_PROG_AR]) -AM_PROG_AR - -AC_PROG_CC -# Compiling sources with per-target flags requires AM_PROG_CC_C_O -AM_PROG_CC_C_O -AC_PROG_INSTALL -AC_PROG_LIBTOOL - -PKG_CHECK_MODULES(GEPUB, - webkit2gtk-4.0 - libsoup-2.4 - glib-2.0 - gobject-2.0 - gio-2.0 - libxml-2.0 - libarchive) - -AC_SUBST(GEPUB_CFLAGS) -AC_SUBST(GEPUB_LIBS) - -PKG_CHECK_MODULES(GEPUB_TESTS, - webkit2gtk-4.0 - libsoup-2.4 - glib-2.0 - gobject-2.0 - gtk+-3.0 - gio-2.0 - libxml-2.0 - libarchive) - -AC_SUBST(GEPUB_TESTS_CFLAGS) -AC_SUBST(GEPUB_TESTS_LIBS) - -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([ - Makefile - libgepub.pc - libgepub/Makefile - tests/Makefile -]) - -# introspection -GOBJECT_INTROSPECTION_CHECK([1.30.0]) - -AC_OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/configure_meson new/libgepub-0.5.3/configure_meson --- old/libgepub-0.5.2/configure_meson 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/configure_meson 1970-01-01 01:00:00.000000000 +0100 @@ -1,180 +0,0 @@ -#!/bin/bash -# configure script adapter for Meson -# Based on build-api: https://github.com/cgwalters/build-api -# Copyright 2010, 2011, 2013 Colin Walters <[email protected]> -# Copyright 2016, 2017 Emmanuele Bassi -# Copyright 2017 Iñigo Martínez <[email protected]> -# Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php) - -# Build API variables: - -# Little helper function for reading args from the commandline. -# it automatically handles -a b and -a=b variants, and returns 1 if -# we need to shift $3. -read_arg() { - # $1 = arg name - # $2 = arg value - # $3 = arg parameter - local rematch='^[^=]*=(.*)$' - if [[ $2 =~ $rematch ]]; then - read "$1" <<< "${BASH_REMATCH[1]}" - else - read "$1" <<< "$3" - # There is no way to shift our callers args, so - # return 1 to indicate they should do it instead. - return 1 - fi -} - -sanitycheck() { - # $1 = arg name - # $1 = arg command - # $2 = arg alternates - local cmd=$( which $2 2>/dev/null ) - - if [ -x "$cmd" ]; then - read "$1" <<< "$cmd" - return 0 - fi - - test -z $3 || { - for alt in $3; do - cmd=$( which $alt 2>/dev/null ) - - if [ -x "$cmd" ]; then - read "$1" <<< "$cmd" - return 0 - fi - done - } - - echo -e "\e[1;31mERROR\e[0m: Command '$2' not found" - exit 1 -} - -checkoption() { - # $1 = arg - option="${1#*--}" - action="${option%%-*}" - name="${option#*-}" - if [ ${default_options[$name]+_} ]; then - case "$action" in - enable) meson_options[$name]=true;; - disable) meson_options[$name]=false;; - *) echo -e "\e[1;33mINFO\e[0m: Ignoring unknown action '$action'";; - esac - else - echo -e "\e[1;33mINFO\e[0m: Ignoring unknown option '$option'" - fi -} - -echooption() { - # $1 = option - if [ ${meson_options[$1]+_} ]; then - echo ${meson_options[$1]} - elif [ ${default_options[$1]+_} ]; then - echo ${default_options[$1]} - fi -} - -sanitycheck MESON 'meson' -sanitycheck MESONTEST 'mesontest' -sanitycheck NINJA 'ninja' 'ninja-build' - -declare -A default_options=( - ['introspection']=true -) - -declare -A meson_options - -while (($# > 0)); do - case "${1%%=*}" in - --prefix) read_arg prefix "$@" || shift;; - --bindir) read_arg bindir "$@" || shift;; - --sbindir) read_arg sbindir "$@" || shift;; - --libexecdir) read_arg libexecdir "$@" || shift;; - --datarootdir) read_arg datarootdir "$@" || shift;; - --datadir) read_arg datadir "$@" || shift;; - --sysconfdir) read_arg sysconfdir "$@" || shift;; - --libdir) read_arg libdir "$@" || shift;; - --mandir) read_arg mandir "$@" || shift;; - --includedir) read_arg includedir "$@" || shift;; - *) checkoption $1;; - esac - shift -done - -# Defaults -test -z ${prefix} && prefix="/usr/local" -test -z ${bindir} && bindir=${prefix}/bin -test -z ${sbindir} && sbindir=${prefix}/sbin -test -z ${libexecdir} && libexecdir=${prefix}/bin -test -z ${datarootdir} && datarootdir=${prefix}/share -test -z ${datadir} && datadir=${datarootdir} -test -z ${sysconfdir} && sysconfdir=${prefix}/etc -test -z ${libdir} && libdir=${prefix}/lib -test -z ${mandir} && mandir=${prefix}/share/man -test -z ${includedir} && includedir=${prefix}/include - -# The source directory is the location of this file -srcdir=$(dirname $0) - -# The build directory is the current location -builddir=`pwd` - -# If we're calling this file from the source directory then -# we automatically create a build directory and ensure that -# both Meson and Ninja invocations are relative to that -# location -if [[ -f "${builddir}/meson.build" ]]; then - mkdir -p _build - builddir="${builddir}/_build" - NINJA_OPT="-C ${builddir}" -fi - -# Wrapper Makefile for Ninja -cat > Makefile <<END -# Generated by configure; do not edit - -all: - CC="\$(CC)" CXX="\$(CXX)" ${NINJA} ${NINJA_OPT} - -install: - DESTDIR="\$(DESTDIR)" ${NINJA} ${NINJA_OPT} install - -check: - ${MESONTEST} ${NINJA_OPT} -END - -echo " - - libgepub - ======== - - meson: ${MESON} - ninja: ${NINJA} - prefix: ${prefix} - compiler: ${CC} - global flags: ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} - introspection: $(echooption introspection) - - Now type '${NINJA} -C ${builddir}' to build -" - -cmd_options="" -for key in "${!meson_options[@]}"; do - cmd_options="$cmd_options -Denable-$key=${meson_options[$key]}" -done - -exec ${MESON} \ - --prefix=${prefix} \ - --libdir=${libdir} \ - --libexecdir=${libexecdir} \ - --datadir=${datadir} \ - --sysconfdir=${sysconfdir} \ - --bindir=${bindir} \ - --includedir=${includedir} \ - --mandir=${mandir} \ - ${cmd_options} \ - ${builddir} \ - ${srcdir} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/libgepub/Makefile.am new/libgepub-0.5.3/libgepub/Makefile.am --- old/libgepub-0.5.2/libgepub/Makefile.am 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/libgepub/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,69 +0,0 @@ -lib_LTLIBRARIES = libgepub.la - -NOINST_H_FILES = \ - gepub-utils.h - -INST_H_FILES = \ - gepub-widget.h \ - gepub-archive.h \ - gepub-text-chunk.h \ - gepub-doc.h \ - gepub.h - -libgepubincludedir = $(includedir)/libgepub -libgepubinclude_HEADERS = $(INST_H_FILES) - -libgepub_la_SOURCES = \ - gepub-widget.c \ - gepub-archive.c \ - gepub-text-chunk.c \ - gepub-doc.c \ - gepub-utils.c \ - $(NOINST_H_FILES) \ - $(INST_H_FILES) - -libgepub_la_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(srcdir) \ - -I$(top_srcdir) \ - $(AM_CPPFLAGS) - -libgepub_la_CFLAGS = \ - $(GEPUB_CFLAGS) \ - $(WARN_CFLAGS) \ - $(AM_CFLAGS) - -libgepub_la_LDFLAGS = \ - -no-undefined \ - -export-symbols-regex "^gepub_*" \ - $(AM_LDFLAGS) - -libgepub_la_LIBADD = \ - $(GEPUB_LIBS) - --include $(INTROSPECTION_MAKEFILE) -INTROSPECTION_GIRS = -INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) -INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) - -if HAVE_INTROSPECTION -introspection_sources = $(libgepub_la_SOURCES) - -Gepub-0.5.gir: libgepub.la -Gepub_0_5_gir_INCLUDES = GObject-2.0 libxml2-2.0 WebKit2-4.0 -Gepub_0_5_gir_CFLAGS = $(INCLUDES) -Gepub_0_5_gir_LIBS = libgepub.la -Gepub_0_5_gir_FILES = $(introspection_sources) -Gepub_0_5_gir_SCANNERFLAGS = --warn-all -INTROSPECTION_GIRS += Gepub-0.5.gir - -girdir = $(datadir)/gir-1.0 -gir_DATA = $(INTROSPECTION_GIRS) - -typelibdir = $(libdir)/girepository-1.0 -typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) - -CLEANFILES = $(gir_DATA) $(typelib_DATA) -endif - -EXTRA_DIST = meson.build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/libgepub/gepub-utils.c new/libgepub-0.5.3/libgepub/gepub-utils.c --- old/libgepub-0.5.2/libgepub/gepub-utils.c 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/libgepub/gepub-utils.c 2018-01-16 07:36:54.000000000 +0100 @@ -31,25 +31,38 @@ * function also makes the resource absolute based on the epub root */ static void -set_epub_uri (xmlNode *node, const gchar *path, const gchar *tagname, const gchar *attr) +set_epub_uri (xmlNode *node, + const gchar *path, + const gchar *tagname, + const gchar *attr, + const gchar *ns) { xmlNode *cur_node = NULL; xmlChar *text = NULL; + gchar *attrname = NULL; + SoupURI *baseURI; gchar *basepath = g_strdup_printf ("epub:///%s/", path); baseURI = soup_uri_new (basepath); g_free (basepath); + if (ns) { + attrname = g_strdup_printf ("%s:%s", ns, attr); + } else { + attrname = g_strdup (attr); + } + for (cur_node = node; cur_node; cur_node = cur_node->next) { if (cur_node->type == XML_ELEMENT_NODE ) { text = xmlGetProp (cur_node, BAD_CAST (attr)); + if (!strcmp ((const char *) cur_node->name, tagname) && text) { SoupURI *uri = soup_uri_new_with_base (baseURI, (const char *) text); gchar *value = soup_uri_to_string (uri, FALSE); - xmlSetProp (cur_node, BAD_CAST (attr), BAD_CAST (value)); + xmlSetProp (cur_node, BAD_CAST (attrname), BAD_CAST (value)); soup_uri_free (uri); g_free (value); @@ -61,9 +74,11 @@ } if (cur_node->children) - set_epub_uri (cur_node->children, path, tagname, attr); + set_epub_uri (cur_node->children, path, tagname, attr, ns); } + g_free (attrname); + soup_uri_free (baseURI); } @@ -252,13 +267,13 @@ root_element = xmlDocGetRootElement (doc); // replacing css resources - set_epub_uri (root_element, path, "link", "href"); + set_epub_uri (root_element, path, "link", "href", NULL); // replacing images resources - set_epub_uri (root_element, path, "img", "src"); + set_epub_uri (root_element, path, "img", "src", NULL); // replacing svg images resources - set_epub_uri (root_element, path, "image", "xlink:href"); + set_epub_uri (root_element, path, "image", "href", "xlink"); // replacing crosslinks - set_epub_uri (root_element, path, "a", "href"); + set_epub_uri (root_element, path, "a", "href", NULL); xmlDocDumpFormatMemory (doc, (xmlChar**)&buffer, (int*)&bufsize, 1); xmlFreeDoc (doc); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/libgepub/gepub-widget.c new/libgepub-0.5.3/libgepub/gepub-widget.c --- old/libgepub-0.5.2/libgepub/gepub-widget.c 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/libgepub/gepub-widget.c 2018-01-16 07:36:54.000000000 +0100 @@ -56,6 +56,8 @@ G_DEFINE_TYPE (GepubWidget, gepub_widget, WEBKIT_TYPE_WEB_VIEW) +#define HUNDRED_PERCENT 100.0 + static void scroll_to_chapter_pos (GepubWidget *widget) { gchar *script = g_strdup_printf("document.querySelector('body').scrollTo(%d, 0)", widget->chapter_pos); @@ -107,7 +109,7 @@ widget->chapter_length = (int)n; if (widget->init_chapter_pos) { - widget->chapter_pos = widget->init_chapter_pos * widget->chapter_length / 100; + widget->chapter_pos = widget->init_chapter_pos * widget->chapter_length / HUNDRED_PERCENT; if (widget->chapter_pos > (widget->chapter_length - widget->length)) { widget->chapter_pos = (widget->chapter_length - widget->length); } @@ -192,9 +194,15 @@ } if (l) { + char line_height[G_ASCII_DTOSTR_BUF_SIZE]; + + g_ascii_formatd (line_height, + G_ASCII_DTOSTR_BUF_SIZE, + "%f", + l); script = g_strdup_printf ( - "document.querySelector('#gepubwrap').style.lineHeight = %f;" - , l); + "document.querySelector('#gepubwrap').style.lineHeight = %s;" + , line_height); webkit_web_view_run_javascript (web_view, script, NULL, NULL, NULL); g_free (script); } @@ -335,9 +343,6 @@ widget->margin = 20; widget->font_size = 0; widget->line_height = 0; - - // locale to avoid '1,2' in line_height string composition - setlocale(LC_NUMERIC, "C"); } static void @@ -396,8 +401,8 @@ properties[PROP_CHAPTER_POS] = g_param_spec_float ("chapter_pos", "Current position in chapter", - "Current position in chapter", - 0, 100, 0, + "Current position in chapter as a percentage", + 0.0, HUNDRED_PERCENT, 0.0, G_PARAM_READWRITE); g_object_class_install_properties (object_class, NUM_PROPS, properties); @@ -627,7 +632,7 @@ widget->chapter_pos = widget->chapter_pos - widget->length; if (widget->chapter_pos < 0) { - widget->init_chapter_pos = 100; + widget->init_chapter_pos = HUNDRED_PERCENT; return gepub_doc_go_prev (widget->doc); } @@ -652,7 +657,7 @@ return 0; } - return widget->chapter_pos * 100 / (float)(widget->chapter_length); + return widget->chapter_pos * HUNDRED_PERCENT / (float)(widget->chapter_length); } /** @@ -667,7 +672,7 @@ gfloat index) { g_return_if_fail (GEPUB_IS_DOC (widget->doc)); - widget->chapter_pos = index * widget->chapter_length / 100; + widget->chapter_pos = index * widget->chapter_length / HUNDRED_PERCENT; adjust_chapter_pos (widget); g_object_notify_by_pspec (G_OBJECT (widget), properties[PROP_CHAPTER_POS]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/libgepub/meson.build new/libgepub-0.5.3/libgepub/meson.build --- old/libgepub-0.5.2/libgepub/meson.build 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/libgepub/meson.build 2018-01-16 07:36:54.000000000 +0100 @@ -21,13 +21,13 @@ 'gepub-widget.c' ) -symbol_map = 'gepub.map' +symbol_map = join_paths(meson.current_source_dir(), 'gepub.map') -ldflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbol_map) +test_ldflag = '-Wl,--version-script,' + symbol_map ldflags = [] -if host_machine.system().contains('linux') and cc.has_argument(ldflag) - ldflags += ldflag +if cc.has_argument(test_ldflag) + ldflags += test_ldflag endif libgepub = library( @@ -62,10 +62,10 @@ 'libarchive' ], variables: 'exec_prefix=' + gepub_libexecdir, - install_dir: join_paths(gepub_libdir, 'pkgconfig') + install_dir: join_paths(get_option('libdir'), 'pkgconfig') ) -if get_option('enable-introspection') and get_option('default_library') == 'shared' +if get_option('introspection') and get_option('default_library') == 'shared' gir_incs = [ 'GObject-2.0', 'libxml2-2.0', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/libgepub.pc.in new/libgepub-0.5.3/libgepub.pc.in --- old/libgepub-0.5.2/libgepub.pc.in 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/libgepub.pc.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libgepub -Description: epub Documents library -Version: @VERSION@ -Requires: gio-2.0 -Requires.private: libxml-2.0 libarchive -Libs: -L${libdir} -lgepub -Cflags: -I${includedir} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/meson.build new/libgepub-0.5.3/meson.build --- old/libgepub-0.5.2/meson.build 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/meson.build 2018-01-16 07:36:54.000000000 +0100 @@ -2,10 +2,7 @@ 'libgepub', 'c', version: '0.5.2', license: 'LGPL2+', - default_options: [ - 'buildtype=debugoptimized', - 'warning_level=1' - ], + default_options: 'buildtype=debugoptimized', meson_version: '>= 0.41.0' ) @@ -32,49 +29,6 @@ cc = meson.get_compiler('c') -config_h = configuration_data() - -# defines -set_defines = [ - # package - ['PACKAGE', meson.project_name()], - ['PACKAGE_API_VERSION', gepub_api_version], - ['PACKAGE_BUGREPORT', '[email protected]'], - ['PACKAGE_NAME', meson.project_name()], - ['PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), gepub_version)], - ['PACKAGE_TARNAME', meson.project_name()], - ['PACKAGE_URL', ''], - ['PACKAGE_VERSION', gepub_version], - ['VERSION', gepub_version] -] - -foreach define: set_defines - config_h.set_quoted(define[0], define[1]) -endforeach - -# headers -check_headers = [ - ['HAVE_DLFCN_H', 'dlfcn.h'], - ['HAVE_INTTYPES_H', 'inttypes.h'], - ['HAVE_MEMORY_H', 'memory.h'], - ['HAVE_STDINT_H', 'stdint.h'], - ['HAVE_STDLIB_H', 'stdlib.h'], - ['HAVE_STRINGS_H', 'strings.h'], - ['HAVE_STRING_H', 'string.h'], - ['HAVE_SYS_STAT_H', 'sys/stat.h'], - ['HAVE_SYS_TYPES_H', 'sys/types.h'], - ['HAVE_UNISTD_H', 'unistd.h'] -] - -foreach header: check_headers - config_h.set(header[0], cc.has_header(header[1])) -endforeach - -# compiler flags -common_flags = ['-DHAVE_CONFIG_H'] - -add_project_arguments(common_flags, language: 'c') - gepub_deps = [ dependency('webkit2gtk-4.0'), dependency('libsoup-2.4'), @@ -85,11 +39,6 @@ dependency('libarchive') ] -configure_file( - output: 'config.h', - configuration: config_h -) - gnome = import('gnome') pkg = import('pkgconfig') @@ -97,3 +46,8 @@ subdir('libgepub') subdir('tests') + +configure_file( + output: 'config.h', + configuration: configuration_data() +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/meson_options.txt new/libgepub-0.5.3/meson_options.txt --- old/libgepub-0.5.2/meson_options.txt 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/meson_options.txt 2018-01-16 07:36:54.000000000 +0100 @@ -1 +1 @@ -option('enable-introspection', type: 'boolean', value: true, description: 'Enable GObject Introspection (depends on GObject)') +option('introspection', type: 'boolean', value: true, description: 'Enable GObject Introspection (depends on GObject)') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/tests/Makefile.am new/libgepub-0.5.3/tests/Makefile.am --- old/libgepub-0.5.2/tests/Makefile.am 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/tests/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -noinst_PROGRAMS = test-gepub - -test_gepub_SOURCES = test-gepub.c -test_gepub_CPPFLAGS = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/libgepub \ - $(AM_CPPFLAGS) - -test_gepub_CFLAGS = \ - $(GEPUB_TESTS_CFLAGS) \ - $(WARN_CFLAGS) \ - $(AM_CFLAGS) - -test_gepub_LDADD = \ - $(top_builddir)/libgepub/libgepub.la \ - $(GEPUB_TESTS_LIBS) \ - $(GTK_LIBS) - -EXTRA_DIST = meson.build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.5.2/tests/test-gepub.c new/libgepub-0.5.3/tests/test-gepub.c --- old/libgepub-0.5.2/tests/test-gepub.c 2017-08-09 10:49:48.000000000 +0200 +++ new/libgepub-0.5.3/tests/test-gepub.c 2018-01-16 07:36:54.000000000 +0100 @@ -273,6 +273,16 @@ g_object_unref (G_OBJECT (doc)); } +static void +destroy_cb (GtkWidget *window, + GtkWidget *view) +{ + g_signal_handlers_disconnect_by_func (G_OBJECT (view), + reload_current_chapter, + view); + gtk_main_quit (); +} + int main (int argc, char **argv) { @@ -321,7 +331,7 @@ } window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_signal_connect (window, "destroy", (GCallback)gtk_main_quit, NULL); + g_signal_connect (window, "destroy", G_CALLBACK(destroy_cb), widget); gtk_widget_set_size_request (GTK_WIDGET (window), 1200, 800); vpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_container_add (GTK_CONTAINER (window), vpaned);
