[packages/gpsbabel] - fix build against shapelib 1.4.1 - use system minizip - release 2, rebuild against shapelib 1.4.1

adamg adamg at pld-linux.org
Wed Dec 12 11:25:43 CET 2018


commit 8df74d147db1ac7e407fadd2325dfb45aee1032f
Author: Adam Gołębiowski <adamg at pld-linux.org>
Date:   Wed Dec 12 11:24:46 2018 +0100

    - fix build against shapelib 1.4.1
    - use system minizip
    - release 2, rebuild against shapelib 1.4.1

 gpsbabel-shapelib-shapefil-h-location.patch |  11 +++
 gpsbabel-system-minizip.patch               | 145 ++++++++++++++++++++++++++++
 gpsbabel.spec                               |   8 +-
 3 files changed, 163 insertions(+), 1 deletion(-)
---
diff --git a/gpsbabel.spec b/gpsbabel.spec
index def8121..09769dc 100644
--- a/gpsbabel.spec
+++ b/gpsbabel.spec
@@ -8,7 +8,7 @@ Summary:	GPSBabel - convert GPS waypoint, route and track data
 Summary(pl.UTF-8):	GPSBabel - konwertowanie danych GPS: waypointów, tras i śladów
 Name:		gpsbabel
 Version:	1.5.4
-Release:	1
+Release:	2
 License:	GPL v2+
 Group:		Applications/Engineering
 # Source0Download via POST form at https://www.gpsbabel.org/download.html#downloading
@@ -25,6 +25,8 @@ Patch2:		gmapbase.patch
 Patch3:		%{name}-link.patch
 Patch4:		qt.patch
 Patch5:		privacy.patch
+Patch6:		%{name}-shapelib-shapefil-h-location.patch
+Patch7:		%{name}-system-minizip.patch
 URL:		http://www.gpsbabel.org/
 BuildRequires:	autoconf >= 2.59
 BuildRequires:	automake
@@ -32,6 +34,7 @@ BuildRequires:	docbook-style-xsl
 BuildRequires:	expat-devel >= 1.95
 #BuildRequires:	libusb-compat-devel >= 0.1
 BuildRequires:	libxslt-progs
+BuildRequires:	minizip-devel
 BuildRequires:	rpmbuild(macros) >= 1.600
 BuildRequires:	shapelib-devel
 BuildRequires:	zlib-devel
@@ -78,6 +81,8 @@ Graficzny interfejs Qt do programu GPSBabel.
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 # Use system shapelib instead of bundled partial shapelib
 mv shapelib{,.bundled}
@@ -87,6 +92,7 @@ mv shapelib{,.bundled}
 %{__autoconf}
 %configure \
 	--with-zlib=system \
+	--with-libminizip=system \
 	--with-doc=./manual
 %{__make}
 
diff --git a/gpsbabel-shapelib-shapefil-h-location.patch b/gpsbabel-shapelib-shapefil-h-location.patch
new file mode 100644
index 0000000..9e2ba4d
--- /dev/null
+++ b/gpsbabel-shapelib-shapefil-h-location.patch
@@ -0,0 +1,11 @@
+--- gpsbabel-gpsbabel_1_5_4/shape.cc~	2018-12-12 10:42:31.597454151 +0100
++++ gpsbabel-gpsbabel_1_5_4/shape.cc	2018-12-12 10:44:35.680635553 +0100
+@@ -20,7 +20,7 @@
+ 
+  */
+ #include "defs.h"
+-#include <libshp/shapefil.h>
++#include <shapefil.h>
+ #include <stdlib.h>
+ 
+ #if SHAPELIB_ENABLED
diff --git a/gpsbabel-system-minizip.patch b/gpsbabel-system-minizip.patch
new file mode 100644
index 0000000..9397419
--- /dev/null
+++ b/gpsbabel-system-minizip.patch
@@ -0,0 +1,145 @@
+based on https://github.com/gpsbabel/gpsbabel/commit/8bf7ad22e5d4e6d3e365fd81a7f183978cdc2fe5
+
+diff --git a/Makefile.in b/Makefile.in
+index 5b792f46f..1edc25e7e 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -106,7 +114,7 @@ MINIZIP=zlib/contrib/minizip/zip.o \
+ ZLIB=zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/inffast.o \
+ 	zlib/inflate.o zlib/infback.o zlib/inftrees.o zlib/trees.o \
+ 	zlib/uncompr.o zlib/gzlib.o zlib/gzclose.o zlib/gzread.o \
+-	zlib/gzwrite.o zlib/zutil.o $(MINIZIP)
++	zlib/gzwrite.o zlib/zutil.o
+ 
+ 
+ LIBOBJS = queue.o route.o waypt.o filter_vecs.o util.o vecs.o mkshort.o \
+@@ -117,7 +125,7 @@ LIBOBJS = queue.o route.o waypt.o filter_vecs.o util.o vecs.o mkshort.o \
+ 	  src/core/xmlstreamwriter.o \
+ 	  src/core/usasciicodec.o\
+ 	  src/core/ziparchive.o \
+-	  $(GARMIN) $(JEEPS) $(FMTS) $(FILTERS) $(SHAPE) @ZLIB@
++	  $(GARMIN) $(JEEPS) $(FMTS) $(FILTERS) $(SHAPE) @ZLIB@ @MINIZIP@
+ OBJS = main.o globals.o $(LIBOBJS) @FILEINFO@
+ 
+ DEPFILES = $(OBJS:.o=.d)
+diff --git a/config.h.in b/config.h.in
+index f669911cf..f553d8520 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -21,6 +21,9 @@
+ /* Define to 1 if you have the `m' library (-lm). */
+ #undef HAVE_LIBM
+ 
++/* Define to 1 if you have the `minizip' library (-lminizip). */
++#undef HAVE_LIBMINIZIP
++
+ /* Defined if you have libusb */
+ #undef HAVE_LIBUSB
+ 
+@@ -72,6 +75,9 @@
+ /* 1 to enable as many formats as possible */
+ #undef MAXIMAL_ENABLED
+ 
++/* 1 to inhibit our use of libminizip. */
++#undef MINIZIP_INHIBITED
++
+ /* Define to the address where bug reports for this package should be sent. */
+ #undef PACKAGE_BUGREPORT
+ 
+diff --git a/configure.ac b/configure.ac
+index bfa5f6609..0a49f627a 100644
+--- a/configure.in
++++ b/configure.in
+@@ -121,9 +121,29 @@ AS_CASE([$with_zlib], ["system"], [
+ 	AC_MSG_RESULT(no)
+ 	;;
+     *) 	ZLIB="\$(ZLIB)" 
++	ZLIB_CPP="-I\$(srcdir)/zlib"
+ 	AC_MSG_RESULT(using included version);;
+   esac
+ 
++AC_SUBST(ZLIB_CPP)
++AC_SUBST(ZLIB)
++
++AC_MSG_CHECKING([whether to support zlib's minizip])
++AC_ARG_WITH([libminizip],
++	[AS_HELP_STRING(
++		[--with-libminizip=(included)|system|no],
++		[])])
++AS_CASE([$with_libminizip], ["system"], [
++	AC_CHECK_LIB([minizip], [zipOpen64])
++], ["no"], [
++	AC_DEFINE(MINIZIP_INHIBITED, 1, [1 to inhibit our use of libminizip.])
++	AC_MSG_RESULT([no])
++], [
++	MINIZIP="\$(MINIZIP)"
++	AC_MSG_RESULT([using included version])
++])
++AC_SUBST(MINIZIP)
++ 
+ case "$target" in
+     *-*-mingw32*)
+ 	FILEINFO=fileinfo.o
+@@ -265,7 +284,6 @@ AC_SUBST(USB_LIBS)
+ AC_SUBST(USB_CFLAGS)
+ AC_SUBST(OSJEEPS)
+ AC_SUBST(GBSER)
+-AC_SUBST(ZLIB)
+ 
+ dnl Linux HID support
+ AS_CASE(["$target"], [*-linux-*], [
+@@ -336,7 +354,7 @@ AC_MSG_RESULT([$DOCDIR])
+ 
+ # AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/time.h termios.h unistd.h])
+ # set up HAVE_STDARG_H for zlib.
+-AC_CHECK_HEADERS([stdarg.h])
++AC_CHECK_HEADERS([unistd.h stdarg.h])
+ 
+ # Checks for typedefs, structures, and compiler characteristics.
+ # AC_C_CONST
+diff --git a/defs.h b/defs.h
+index ea2bc0ac5..98e025f16 100644
+--- a/defs.h
++++ b/defs.h
+@@ -28,7 +28,7 @@
+ #if HAVE_LIBZ
+ #include <zlib.h>
+ #elif !ZLIB_INHIBITED
+-#include "zlib/zlib.h"
++#include "zlib.h"
+ #endif
+ #include "gbfile.h"
+ #include "inifile.h"
+diff --git a/src/core/ziparchive.cc b/src/core/ziparchive.cc
+index d4b5dcacc..947444505 100644
+--- a/src/core/ziparchive.cc
++++ b/src/core/ziparchive.cc
+@@ -23,7 +23,11 @@
+ 
+ #include "defs.h"
+ #include "src/core/logging.h"
++#ifdef HAVE_LIBMINIZIP
++#include <minizip/zip.h>
++#else
+ #include "zlib/contrib/minizip/zip.h"
++#endif
+ 
+ #include <QtCore/QFile>
+ #include <QtCore/QDebug>
+diff --git a/src/core/ziparchive.h b/src/core/ziparchive.h
+index 0c9f8f27b..e91da17e2 100644
+--- a/src/core/ziparchive.h
++++ b/src/core/ziparchive.h
+@@ -21,7 +21,12 @@
+ 
+ #include <QtCore/QString>
+ #include <QtCore/QStringList>
++#include "defs.h"
++#ifdef HAVE_LIBMINIZIP
++#include <minizip/zip.h>
++#else
+ #include "zlib/contrib/minizip/zip.h"
++#endif
+ 
+ class  ZipArchive
+ {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gpsbabel.git/commitdiff/8df74d147db1ac7e407fadd2325dfb45aee1032f



More information about the pld-cvs-commit mailing list