mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
graphics/gdal: Convert REINPLACE_CMD to patch files
This commit is contained in:
parent
635a862037
commit
c4ca0e58ee
6 changed files with 138 additions and 4 deletions
|
@ -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/
|
||||
|
|
11
graphics/gdal/files/patch-GDALmake.opt.in
Normal file
11
graphics/gdal/files/patch-GDALmake.opt.in
Normal file
|
@ -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@
|
30
graphics/gdal/files/patch-GNUmakefile
Normal file
30
graphics/gdal/files/patch-GNUmakefile
Normal file
|
@ -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)
|
||||
|
57
graphics/gdal/files/patch-configure
Normal file
57
graphics/gdal/files/patch-configure
Normal file
|
@ -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
|
20
graphics/gdal/files/patch-frmts-pdf-pdfdataset.cpp
Normal file
20
graphics/gdal/files/patch-frmts-pdf-pdfdataset.cpp
Normal file
|
@ -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="))
|
20
graphics/gdal/files/patch-frmts-pdf-pdfobject.cpp
Normal file
20
graphics/gdal/files/patch-frmts-pdf-pdfobject.cpp
Normal file
|
@ -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';
|
Loading…
Add table
Reference in a new issue