Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jun 2021 14:47:19 GMT
From:      Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: c4ca0e58eece - main - graphics/gdal: Convert REINPLACE_CMD to patch files
Message-ID:  <202106101447.15AElJLc047481@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c4ca0e58eececa5ee0fbea2c351844d03e2297c4

commit c4ca0e58eececa5ee0fbea2c351844d03e2297c4
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2021-06-10 14:26:13 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2021-06-10 14:45:58 +0000

    graphics/gdal: Convert REINPLACE_CMD to patch files
---
 graphics/gdal/Makefile                             |  4 --
 graphics/gdal/files/patch-GDALmake.opt.in          | 11 +++++
 graphics/gdal/files/patch-GNUmakefile              | 30 ++++++++++++
 graphics/gdal/files/patch-configure                | 57 ++++++++++++++++++++++
 graphics/gdal/files/patch-frmts-pdf-pdfdataset.cpp | 20 ++++++++
 graphics/gdal/files/patch-frmts-pdf-pdfobject.cpp  | 20 ++++++++
 6 files changed, 138 insertions(+), 4 deletions(-)

diff --git a/graphics/gdal/Makefile b/graphics/gdal/Makefile
index dc230978f4f4..02dc636d898c 100644
--- a/graphics/gdal/Makefile
+++ b/graphics/gdal/Makefile
@@ -162,10 +162,6 @@ ZSTD_CONFIGURE_WITH=	zstd
 ZSTD_LIB_DEPENDS=	libzstd.so:archivers/zstd
 
 post-patch:
-	@${REINPLACE_CMD} -e '/^#GDAL_SLIB_SONAME/ s|^#||' ${WRKSRC}/GDALmake.opt.in
-	@${REINPLACE_CMD} -e 's|$$(INST_LIB)/pkgconfig|${PREFIX}/libdata/pkgconfig|; s| LICENSE.TXT||' ${WRKSRC}/GNUmakefile
-	@${REINPLACE_CMD} -e 's|-lminizip|-lkmlminizip|' -e 's|IlmImf|OpenEXR|g' ${WRKSRC}/configure
-	@${REINPLACE_CMD} -e 's|getCString()|c_str()|' ${WRKSRC}/frmts/pdf/pdfdataset.cpp ${WRKSRC}/frmts/pdf/pdfobject.cpp
 # Clean up bundled libraries
 	@${RM} -r ${WRKSRC}/alg/internal_libqhull/
 	@${RM} -r ${WRKSRC}/frmts/gif/giflib/
diff --git a/graphics/gdal/files/patch-GDALmake.opt.in b/graphics/gdal/files/patch-GDALmake.opt.in
new file mode 100644
index 000000000000..7db235d0d961
--- /dev/null
+++ b/graphics/gdal/files/patch-GDALmake.opt.in
@@ -0,0 +1,11 @@
+--- GDALmake.opt.in.orig	2021-04-27 09:10:56 UTC
++++ GDALmake.opt.in
+@@ -141,7 +141,7 @@ GDAL_VERSION_REV   =    @GDAL_VERSION_REV@
+ GDAL_LIB	= 	$(GDAL_ROOT)/libgdal.a
+ GDAL_SLIB	=	$(GDAL_ROOT)/libgdal.$(SO_EXT)
+ GDAL_SLIB_LINK	=	-L$(GDAL_ROOT) -lgdal
+-#GDAL_SLIB_SONAME = -Wl,-soname,libgdal.$(SO_EXT).@GDAL_VERSION_MAJOR@
++GDAL_SLIB_SONAME = -Wl,-soname,libgdal.$(SO_EXT).@GDAL_VERSION_MAJOR@
+ 
+ # Mac OS X Framework definition
+ MACOSX_FRAMEWORK = @MACOSX_FRAMEWORK@
diff --git a/graphics/gdal/files/patch-GNUmakefile b/graphics/gdal/files/patch-GNUmakefile
new file mode 100644
index 000000000000..fbdcee9f7a2a
--- /dev/null
+++ b/graphics/gdal/files/patch-GNUmakefile
@@ -0,0 +1,30 @@
+--- GNUmakefile.orig	2021-04-27 09:10:56 UTC
++++ GNUmakefile
+@@ -201,10 +201,10 @@ install-static-lib: static-lib gdal.pc
+ 	(cd alg; $(MAKE) install)
+ 	(cd ogr; $(MAKE) install)
+ 	(cd gnm; $(MAKE) install)
+-	for f in LICENSE.TXT data/*.* ; do $(INSTALL_DATA) $$f $(DESTDIR)$(INST_DATA) ; done
++	for f in data/*.* ; do $(INSTALL_DATA) $$f $(DESTDIR)$(INST_DATA) ; done
+ 	$(LIBTOOL_FINISH) $(DESTDIR)$(INST_LIB)
+-	$(INSTALL_DIR) $(DESTDIR)$(INST_LIB)/pkgconfig
+-	$(INSTALL_DATA) gdal.pc $(DESTDIR)$(INST_LIB)/pkgconfig/gdal.pc
++	$(INSTALL_DIR) $(DESTDIR)/usr/local/libdata/pkgconfig
++	$(INSTALL_DATA) gdal.pc $(DESTDIR)/usr/local/libdata/pkgconfig/gdal.pc
+ 
+ install-actions: install-lib
+ 	$(INSTALL_DIR) $(DESTDIR)$(INST_BIN)
+@@ -236,10 +236,10 @@ endif
+ ifdef INST_BASH_COMPLETION
+ 	(cd scripts; $(MAKE) install)
+ endif
+-	for f in LICENSE.TXT data/*.* ; do $(INSTALL_DATA) $$f $(DESTDIR)$(INST_DATA) ; done
++	for f in data/*.* ; do $(INSTALL_DATA) $$f $(DESTDIR)$(INST_DATA) ; done
+ 	$(LIBTOOL_FINISH) $(DESTDIR)$(INST_LIB)
+-	$(INSTALL_DIR) $(DESTDIR)$(INST_LIB)/pkgconfig
+-	$(INSTALL_DATA) gdal.pc $(DESTDIR)$(INST_LIB)/pkgconfig/gdal.pc
++	$(INSTALL_DIR) $(DESTDIR)/usr/local/libdata/pkgconfig
++	$(INSTALL_DATA) gdal.pc $(DESTDIR)/usr/local/libdata/pkgconfig/gdal.pc
+ 
+ ifeq ($(HAVE_LIBTOOL),yes)
+ 
diff --git a/graphics/gdal/files/patch-configure b/graphics/gdal/files/patch-configure
new file mode 100644
index 000000000000..0b6de58a0826
--- /dev/null
+++ b/graphics/gdal/files/patch-configure
@@ -0,0 +1,57 @@
+sed -e 's|-lminizip|-lkmlminizip|; s|IlmImf|OpenEXR|' configure
+
+--- configure.orig	2021-04-27 09:10:56 UTC
++++ configure
+@@ -36668,9 +36668,9 @@ $as_echo "$LIBKML_VERSION" >&6; }
+             libkml_include_dir2="$libkml_prefix/include/kml"
+             libkml_include_dir3="$libkml_prefix/include/kml/third_party/boost_1_34_1"
+             if test "$libkml_prefix" = "/usr"; then
+-                libkml_lib_flags="-lkmldom -lkmlbase -lkmlengine -lkmlconvenience -lminizip -luriparser"
++                libkml_lib_flags="-lkmldom -lkmlbase -lkmlengine -lkmlconvenience -lkmlminizip -luriparser"
+             else
+-                libkml_lib_flags="-L$libkml_prefix/lib -lkmldom -lkmlbase -lkmlengine -lkmlconvenience -lminizip -luriparser"
++                libkml_lib_flags="-L$libkml_prefix/lib -lkmldom -lkmlbase -lkmlengine -lkmlconvenience -lkmlminizip -luriparser"
+             fi
+             run_libkml_test="yes"
+         elif test "$libkml_requested" = "yes"; then
+@@ -42248,13 +42248,13 @@ fi
+     # Test that the package found is for the right architecture
+     saved_LIBS="$LIBS"
+     LIBS="$EXR_LIBS"
+-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ImfTiledInputReadTile in -lIlmImf" >&5
+-$as_echo_n "checking for ImfTiledInputReadTile in -lIlmImf... " >&6; }
+-if ${ac_cv_lib_IlmImf_ImfTiledInputReadTile+:} false; then :
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ImfTiledInputReadTile in -lOpenEXR" >&5
++$as_echo_n "checking for ImfTiledInputReadTile in -lOpenEXR... " >&6; }
++if ${ac_cv_lib_OpenEXR_ImfTiledInputReadTile+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lIlmImf  $LIBS"
++LIBS="-lOpenEXR  $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+@@ -42274,17 +42274,17 @@ return ImfTiledInputReadTile ();
+ }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  ac_cv_lib_IlmImf_ImfTiledInputReadTile=yes
++  ac_cv_lib_OpenEXR_ImfTiledInputReadTile=yes
+ else
+-  ac_cv_lib_IlmImf_ImfTiledInputReadTile=no
++  ac_cv_lib_OpenEXR_ImfTiledInputReadTile=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_IlmImf_ImfTiledInputReadTile" >&5
+-$as_echo "$ac_cv_lib_IlmImf_ImfTiledInputReadTile" >&6; }
+-if test "x$ac_cv_lib_IlmImf_ImfTiledInputReadTile" = xyes; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OpenEXR_ImfTiledInputReadTile" >&5
++$as_echo "$ac_cv_lib_OpenEXR_ImfTiledInputReadTile" >&6; }
++if test "x$ac_cv_lib_OpenEXR_ImfTiledInputReadTile" = xyes; then :
+   HAVE_EXR=yes
+ else
+   HAVE_EXR=no
diff --git a/graphics/gdal/files/patch-frmts-pdf-pdfdataset.cpp b/graphics/gdal/files/patch-frmts-pdf-pdfdataset.cpp
new file mode 100644
index 000000000000..247bc4a4fdb0
--- /dev/null
+++ b/graphics/gdal/files/patch-frmts-pdf-pdfdataset.cpp
@@ -0,0 +1,20 @@
+--- frmts/pdf/pdfdataset.cpp.orig	2021-04-27 09:12:27 UTC
++++ frmts/pdf/pdfdataset.cpp
+@@ -3584,7 +3584,7 @@ void PDFDataset::FindLayersPoppler()
+ #if (POPPLER_MAJOR_VERSION >= 1 || POPPLER_MINOR_VERSION >= 72)
+                 const char* pszLayerName = (const char*)ocg->getName()->c_str();
+ #else
+-                const char* pszLayerName = (const char*)ocg->getName()->getCString();
++                const char* pszLayerName = (const char*)ocg->getName()->c_str();
+ #endif
+                 AddLayer(pszLayerName);
+                 oLayerOCGListPoppler.push_back(std::make_pair(CPLString(pszLayerName), ocg));
+@@ -4969,7 +4969,7 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInf
+ #if (POPPLER_MAJOR_VERSION >= 1 || POPPLER_MINOR_VERSION >= 72)
+         const char* pszContent = poMetadata->c_str();
+ #else
+-        const char* pszContent = poMetadata->getCString();
++        const char* pszContent = poMetadata->c_str();
+ #endif
+         if (pszContent != nullptr &&
+             STARTS_WITH(pszContent, "<?xpacket begin="))
diff --git a/graphics/gdal/files/patch-frmts-pdf-pdfobject.cpp b/graphics/gdal/files/patch-frmts-pdf-pdfobject.cpp
new file mode 100644
index 000000000000..c567af323cd9
--- /dev/null
+++ b/graphics/gdal/files/patch-frmts-pdf-pdfobject.cpp
@@ -0,0 +1,20 @@
+--- frmts/pdf/pdfobject.cpp.orig	2021-04-27 09:12:27 UTC
++++ frmts/pdf/pdfobject.cpp
+@@ -1082,7 +1082,7 @@ const CPLString& GDALPDFObjectPoppler::GetString()
+         return (osStr = GDALPDFGetUTF8StringFromBytes(reinterpret_cast<const GByte*>(gooString->c_str()),
+                                                       static_cast<int>(gooString->getLength())));
+ #else
+-        return (osStr = GDALPDFGetUTF8StringFromBytes(reinterpret_cast<const GByte*>(gooString->getCString()),
++        return (osStr = GDALPDFGetUTF8StringFromBytes(reinterpret_cast<const GByte*>(gooString->c_str()),
+                                                       static_cast<int>(gooString->getLength())));
+ #endif
+     }
+@@ -1442,7 +1442,7 @@ static char* GooStringToCharStart(GooString& gstr)
+ #if (POPPLER_MAJOR_VERSION >= 1 || POPPLER_MINOR_VERSION >= 72)
+             const char* srcStr = gstr.c_str();
+ #else
+-            const char* srcStr = gstr.getCString();
++            const char* srcStr = gstr.c_str();
+ #endif
+             memcpy(pszContent, srcStr, nLength);
+             pszContent[nLength] = '\0';



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106101447.15AElJLc047481>