pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/geography



Module Name:    pkgsrc
Committed By:   gdt
Date:           Tue May 21 13:36:10 UTC 2024

Modified Files:
        pkgsrc/geography/gdal-lib: Makefile Makefile.common PLIST distinfo
            options.mk
        pkgsrc/geography/py-gdal: Makefile
Removed Files:
        pkgsrc/geography/gdal-lib/patches: patch-configure

Log Message:
geography/gdal: Convert to cmake

In general, avoid adding dependencies and rototilling, in favor of a
straight build system conversion.  A notable exception is adding
spatialite, because that is easier than fixing the cmake spatialite
support not to error out.  (Other fixes to follow once the conversion
is ok.)

gdal-lib:

Straightforward use of cmake vs autoconf.

Add cmake args to disable finding things that happen to be installed
but are not bl3d.

Attempt to convert CONFIGURE_ARGS to cmake, confounded by some of them
perhaps being out of date and some of them not having clear analogs.
Accept some fuzz on the theory that things were likely not 100% right
earlier and it's going to change with updates.

Drop patch for png16 rename; cmake finds that ok by itself.

Withdraw include/cpl_odbc.h because cmake does so, and call it ok
without a revbum because we aren't (and weren't) building odbc so it
is nonsensical for any other package to have used it.

cmake installs man pages and bash completion scripts.  Roll with it vs
trying to make this like before, as those changes are not confounding
or hard to debug.

py-gdal:

Continue to use autoconf, and add commented-out cmake config.

Update committed to capture partial progress and have others test
earlier rather than later as we head to further updates.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 pkgsrc/geography/gdal-lib/Makefile
cvs rdiff -u -r1.24 -r1.25 pkgsrc/geography/gdal-lib/Makefile.common
cvs rdiff -u -r1.21 -r1.22 pkgsrc/geography/gdal-lib/PLIST
cvs rdiff -u -r1.62 -r1.63 pkgsrc/geography/gdal-lib/distinfo
cvs rdiff -u -r1.6 -r1.7 pkgsrc/geography/gdal-lib/options.mk
cvs rdiff -u -r1.5 -r0 pkgsrc/geography/gdal-lib/patches/patch-configure
cvs rdiff -u -r1.63 -r1.64 pkgsrc/geography/py-gdal/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/geography/gdal-lib/Makefile
diff -u pkgsrc/geography/gdal-lib/Makefile:1.163 pkgsrc/geography/gdal-lib/Makefile:1.164
--- pkgsrc/geography/gdal-lib/Makefile:1.163    Tue May 21 12:42:28 2024
+++ pkgsrc/geography/gdal-lib/Makefile  Tue May 21 13:36:10 2024
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.163 2024/05/21 12:42:28 gdt Exp $
+# $NetBSD: Makefile,v 1.164 2024/05/21 13:36:10 gdt Exp $
 
-PKGREVISION= 10
+PKGREVISION= 11
 .include "../../geography/gdal-lib/Makefile.common"
 PKGNAME=       ${DISTNAME:S/gdal/gdal-lib/}
 #PKGREVISION=  0
@@ -16,12 +16,8 @@ USE_CXX_FEATURES+=   c++11
 # libtool problem.
 # Therefore this package needs revbumping on every geos update.
 
-CONFIGURE_ARGS+=       --without-python
-
-CONFIGURE_ARGS+=       --with-proj
-CONFIGURE_ARGS+=       --with-sqlite3=${BUILDLINK_PREFIX.sqlite3}
-
-MAKE_FILE=             GNUmakefile
+.include "../../devel/cmake/build.mk"
+CMAKE_ARGS+=           -DBUILD_PYTHON_BINDINGS=OFF
 
 .include "options.mk"
 
@@ -32,6 +28,17 @@ INSTALLATION_DIRS=   bin include lib ${PKG
 # \todo: Support geopdf by including poppler, PoDoFo, or PDFium.
 # https://gdal.org/drivers/raster/pdf.html
 
+# As an exception to the "cmake change only" rule, enable spatialite because
+# that's easier than working around a bug that causes cmake to fail because
+# of an empty variable leading to a wrong number of args error.
+#
+# NB: spatialite requires sqlite3, so there is the spectre of base/pkg confusion.
+# Therefore, include it first in the baseless hope that helps.
+.include "../../geography/libspatialite/buildlink3.mk"
+
+# \todo Enable zstd
+# .include "../../archivers/zstd/buildlink3.mk"
+
 # Avoid NetBSD base sqlite3, which is deficient because it lacks rtree.
 # \todo Enhance pkgsrc to be able to declare that modules are needed.
 #BUILDLINK_API_DEPENDS.sqlite3+= sqlite3>=3.36.0
@@ -48,6 +55,8 @@ INSTALLATION_DIRS=    bin include lib ${PKG
 .include "../../graphics/openjpeg/buildlink3.mk"
 .include "../../graphics/png/buildlink3.mk"
 .include "../../graphics/tiff/buildlink3.mk"
+# \todo See USE_JSONC_INTERNAL in Makefile.common.
+# .include "../../textproc/json-c/buildlink3.mk"
 .include "../../textproc/libxml2/buildlink3.mk"
 .include "../../textproc/xerces-c/buildlink3.mk"
 .include "../../www/curl/buildlink3.mk"

Index: pkgsrc/geography/gdal-lib/Makefile.common
diff -u pkgsrc/geography/gdal-lib/Makefile.common:1.24 pkgsrc/geography/gdal-lib/Makefile.common:1.25
--- pkgsrc/geography/gdal-lib/Makefile.common:1.24      Tue May 21 12:42:28 2024
+++ pkgsrc/geography/gdal-lib/Makefile.common   Tue May 21 13:36:10 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.24 2024/05/21 12:42:28 gdt Exp $
+# $NetBSD: Makefile.common,v 1.25 2024/05/21 13:36:10 gdt Exp $
 #
 # used by geography/gdal-lib/Makefile
 # used by geography/py-gdal/Makefile
@@ -24,20 +24,46 @@ DISTINFO_FILE=      ${.CURDIR}/../../geograph
 
 CHECK_PORTABILITY_SKIP+=       mkbindist.sh
 
+# The base gdal and the python bindings have very different dependency
+# footprints.  Sorting content into gdal-lib/Makefile and
+# Makefile.common is already somewhat difficult, and complicated by
+# cmake's habit of finding installed packages that are not buildlinked.
+
+# \todo Consider moving to package Makefiles.
 USE_TOOLS+=            gmake pkg-config
 USE_LANGUAGES=         c99 c++
 USE_LIBTOOL=           yes
 USE_PKGLOCALEDIR=      yes
-GNU_CONFIGURE=         yes
-CONFIGURE_ARGS+=       --with-geos
-CONFIGURE_ARGS+=       --with-libjson-c=internal
-CONFIGURE_ARGS+=       --with-libtiff=${BUILDLINK_PREFIX.tiff}
-CONFIGURE_ARGS+=       --with-libz=${BUILDLINK_PREFIX.zlib}
-CONFIGURE_ARGS+=       --with-netcdf=${BUILDLINK_PREFIX.netcdf}
-CONFIGURE_ARGS+=       --with-webp=${BUILDLINK_PREFIX.libwebp}
-CONFIGURE_ARGS+=       --with-xerces
-CONFIGURE_ARGS+=       --with-xerces-inc=${BUILDLINK_PREFIX.xerces-c}/include
-CONFIGURE_ARGS+=       --with-xerces-lib=-L${BUILDLINK_PREFIX.xerces-c}/lib\ -lxerces-c
 
-# force OpenJPEG for JPEG 2000 support
-CONFIGURE_ARGS+=       --with-openjpeg
+# \todo Justify or move to bl3 of json-c
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_JSONC_INTERNAL=ON
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_JSONC=OFF
+
+# Disable things that cmake finds that we didn't bl3.
+# \todo For each, consider if we should intead add a bl3.
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_DEFLATE=OFF
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_FREEXL=OFF
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_HDF5=OFF
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_HEIF=OFF
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_LZ4=OFF
+# \todo Resolve LZMA usage.
+# GDAL_USE_LZMA appears in gtif but cmake says it doesn't exist.
+#CMAKE_CONFIGURE_ARGS+=        -DGDAL_USE_LZMA=OFF
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_ODBC=OFF
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_OPENEXR=OFF
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_PCRE2=OFF
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_POPPLER=OFF
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_ZSTD=OFF
+
+# \todo One would think these are unnnecessary.  Check if these
+# can/should be dropped.  If not, explain why we have some and not
+# all.  Commented lines are incompletely translated from autoconf,
+# because there is no obvious analog.
+CMAKE_CONFIGURE_ARGS+= -DGEOS_DIR=${BUILDLINK_PREFIX.geos}
+CMAKE_CONFIGURE_ARGS+= -DTIFFDIR=${BUILDLINK_PREFIX.tiff}
+#CMAKE_CONFIGURE_ARGS+=        -Dlibz=${BUILDLINK_PREFIX.zlib}
+CMAKE_CONFIGURE_ARGS+= -DNetCDF_DIR=${BUILDLINK_PREFIX.netcdf}
+#CMAKE_CONFIGURE_ARGS+=        -Dwebp=${BUILDLINK_PREFIX.libwebp}
+#CMAKE_CONFIGURE_ARGS+=        -Dxerces
+#CMAKE_CONFIGURE_ARGS+=        -Dxerces-inc=${BUILDLINK_PREFIX.xerces-c}/include
+#CMAKE_CONFIGURE_ARGS+=        -Dxerces-lib=-L${BUILDLINK_PREFIX.xerces-c}/lib\ -lxerces-c

Index: pkgsrc/geography/gdal-lib/PLIST
diff -u pkgsrc/geography/gdal-lib/PLIST:1.21 pkgsrc/geography/gdal-lib/PLIST:1.22
--- pkgsrc/geography/gdal-lib/PLIST:1.21        Fri May 13 13:28:52 2022
+++ pkgsrc/geography/gdal-lib/PLIST     Tue May 21 13:36:10 2024
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.21 2022/05/13 13:28:52 gdt Exp $
+@comment $NetBSD: PLIST,v 1.22 2024/05/21 13:36:10 gdt Exp $
 bin/gdal-config
 bin/gdal_contour
 bin/gdal_create
@@ -43,7 +43,6 @@ include/cpl_minizip_ioapi.h
 include/cpl_minizip_unzip.h
 include/cpl_minizip_zip.h
 include/cpl_multiproc.h
-include/cpl_odbc.h
 include/cpl_port.h
 include/cpl_progress.h
 include/cpl_quad_tree.h
@@ -94,9 +93,94 @@ include/ogr_swq.h
 include/ogrsf_frmts.h
 include/rawdataset.h
 include/vrtdataset.h
+lib/cmake/gdal/GDAL-targets-noconfig.cmake
+lib/cmake/gdal/GDAL-targets.cmake
+lib/cmake/gdal/GDALConfig.cmake
+lib/cmake/gdal/GDALConfigVersion.cmake
 lib/gdalplugins/drivers.ini
-lib/libgdal.la
+lib/libgdal.so
+lib/libgdal.so.31
+lib/libgdal.so.31.0.3
 lib/pkgconfig/gdal.pc
+man/man1/gdal-config.1
+man/man1/gdal2tiles.1
+man/man1/gdal_calc.1
+man/man1/gdal_contour.1
+man/man1/gdal_create.1
+man/man1/gdal_edit.1
+man/man1/gdal_fillnodata.1
+man/man1/gdal_grid.1
+man/man1/gdal_merge.1
+man/man1/gdal_pansharpen.1
+man/man1/gdal_polygonize.1
+man/man1/gdal_proximity.1
+man/man1/gdal_rasterize.1
+man/man1/gdal_retile.1
+man/man1/gdal_sieve.1
+man/man1/gdal_translate.1
+man/man1/gdal_viewshed.1
+man/man1/gdaladdo.1
+man/man1/gdalbuildvrt.1
+man/man1/gdalcompare.1
+man/man1/gdaldem.1
+man/man1/gdalinfo.1
+man/man1/gdallocationinfo.1
+man/man1/gdalmanage.1
+man/man1/gdalmdiminfo.1
+man/man1/gdalmdimtranslate.1
+man/man1/gdalmove.1
+man/man1/gdalsrsinfo.1
+man/man1/gdaltindex.1
+man/man1/gdaltransform.1
+man/man1/gdalwarp.1
+man/man1/gnmanalyse.1
+man/man1/gnmmanage.1
+man/man1/nearblack.1
+man/man1/ogr2ogr.1
+man/man1/ogrinfo.1
+man/man1/ogrlineref.1
+man/man1/ogrmerge.1
+man/man1/ogrtindex.1
+man/man1/pct2rgb.1
+man/man1/rgb2pct.1
+share/bash-completion/completions/gdal-config
+share/bash-completion/completions/gdal2tiles.py
+share/bash-completion/completions/gdal2xyz.py
+share/bash-completion/completions/gdal_calc.py
+share/bash-completion/completions/gdal_contour
+share/bash-completion/completions/gdal_create
+share/bash-completion/completions/gdal_edit.py
+share/bash-completion/completions/gdal_fillnodata.py
+share/bash-completion/completions/gdal_grid
+share/bash-completion/completions/gdal_merge.py
+share/bash-completion/completions/gdal_polygonize.py
+share/bash-completion/completions/gdal_proximity.py
+share/bash-completion/completions/gdal_rasterize
+share/bash-completion/completions/gdal_retile.py
+share/bash-completion/completions/gdal_sieve.py
+share/bash-completion/completions/gdal_translate
+share/bash-completion/completions/gdal_viewshed
+share/bash-completion/completions/gdaladdo
+share/bash-completion/completions/gdalbuildvrt
+share/bash-completion/completions/gdalchksum.py
+share/bash-completion/completions/gdalcompare.py
+share/bash-completion/completions/gdaldem
+share/bash-completion/completions/gdalenhance
+share/bash-completion/completions/gdalident.py
+share/bash-completion/completions/gdalimport.py
+share/bash-completion/completions/gdalinfo
+share/bash-completion/completions/gdallocationinfo
+share/bash-completion/completions/gdalmanage
+share/bash-completion/completions/gdalmove.py
+share/bash-completion/completions/gdalsrsinfo
+share/bash-completion/completions/gdaltindex
+share/bash-completion/completions/gdaltransform
+share/bash-completion/completions/gdalwarp
+share/bash-completion/completions/ogr2ogr
+share/bash-completion/completions/ogrinfo
+share/bash-completion/completions/ogrlineref
+share/bash-completion/completions/ogrmerge.py
+share/bash-completion/completions/ogrtindex
 share/gdal/GDALLogoBW.svg
 share/gdal/GDALLogoColor.svg
 share/gdal/GDALLogoGS.svg

Index: pkgsrc/geography/gdal-lib/distinfo
diff -u pkgsrc/geography/gdal-lib/distinfo:1.62 pkgsrc/geography/gdal-lib/distinfo:1.63
--- pkgsrc/geography/gdal-lib/distinfo:1.62     Thu Feb  1 07:31:50 2024
+++ pkgsrc/geography/gdal-lib/distinfo  Tue May 21 13:36:10 2024
@@ -1,9 +1,8 @@
-$NetBSD: distinfo,v 1.62 2024/02/01 07:31:50 wiz Exp $
+$NetBSD: distinfo,v 1.63 2024/05/21 13:36:10 gdt Exp $
 
 BLAKE2s (gdal-3.5.3.tar.xz) = a9932da1b8d17bc4b37ebe8e74b23eccc6a0ce4810f976587e9617735dffcd4d
 SHA512 (gdal-3.5.3.tar.xz) = b7bac9dd568e9db49d1fa5be8cd48df37f37196b0cacce44f738a981f0c43a77b5750312cd0c3385fdd881a6b525a5ceac56bcd08284d76071bd508d01781f49
 Size (gdal-3.5.3.tar.xz) = 9504740 bytes
-SHA1 (patch-configure) = 86eae1d146161752ba9468d0aca7f2bb7f3b121b
 SHA1 (patch-frmts_grib_degrib_degrib_myutil.c) = 0e046afa236d7e0d6186fe392cb2da05fa5b42c5
 SHA1 (patch-frmts_mrf_LERCV1_Lerc1Image.cpp) = 87bf6e873a0565e8d79700039700a4289cf7c8fa
 SHA1 (patch-gcore_gdaljp2metadatagenerator.cpp) = a6552d7d98059354c1bf2fca87319c561ed5b570

Index: pkgsrc/geography/gdal-lib/options.mk
diff -u pkgsrc/geography/gdal-lib/options.mk:1.6 pkgsrc/geography/gdal-lib/options.mk:1.7
--- pkgsrc/geography/gdal-lib/options.mk:1.6    Thu Apr 29 13:06:04 2021
+++ pkgsrc/geography/gdal-lib/options.mk        Tue May 21 13:36:10 2024
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.6 2021/04/29 13:06:04 gdt Exp $
+# $NetBSD: options.mk,v 1.7 2024/05/21 13:36:10 gdt Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.gdal-lib
 
@@ -15,17 +15,19 @@ PKG_SUGGESTED_OPTIONS=
 
 .if !empty(PKG_OPTIONS:Mpgsql)
 .  include "../../mk/pgsql.buildlink3.mk"
-CONFIGURE_ARGS+=       --with-pg
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_POSTGRESQL=ON
 .else
-CONFIGURE_ARGS+=       --without-pg
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_POSTGRESQL=OFF
 .endif
 
+# \todo Fix/test MYSQL
 .if !empty(PKG_OPTIONS:Mmysql)
 .  include "../../mk/mysql.buildlink3.mk"
-CONFIGURE_ARGS+=       --with-mysql
 .else
-CONFIGURE_ARGS+=       --without-mysql
+# The builds says:
+#   -- Could NOT find MySQL (missing: MYSQL_LIBRARY MYSQL_INCLUDE_DIR)
+# but cmake -L does not show the option to turn it off.
 .endif
 
-# There is no ODBC option, and hence only the "no ODBC" case.
-CONFIGURE_ARGS+=       --without-odbc
+# For now, there is no ODBC option, and hence only the "no ODBC" case.
+CMAKE_CONFIGURE_ARGS+= -DGDAL_USE_ODBC=OFF

Index: pkgsrc/geography/py-gdal/Makefile
diff -u pkgsrc/geography/py-gdal/Makefile:1.63 pkgsrc/geography/py-gdal/Makefile:1.64
--- pkgsrc/geography/py-gdal/Makefile:1.63      Thu May 16 06:14:59 2024
+++ pkgsrc/geography/py-gdal/Makefile   Tue May 21 13:36:10 2024
@@ -1,16 +1,22 @@
-# $NetBSD: Makefile,v 1.63 2024/05/16 06:14:59 wiz Exp $
+# $NetBSD: Makefile,v 1.64 2024/05/21 13:36:10 gdt Exp $
 
-PKGREVISION= 8
+PKGREVISION= 9
 .include "../../geography/gdal-lib/Makefile.common"
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 #PKGREVISION=  0
 
 COMMENT=       Translator library for raster geospatial data formats, Python binding
 
+GNU_CONFIGURE=         yes
+
 BUILD_DIRS=    swig/python
 
 MAKE_FILE=     GNUmakefile
 
+# CONFIGURE_DIR=               swig/python     # cmake
+# CMAKE_CONFIGURE_ARGS+=       -DGDAL_USE_SPATIALITE=OFF
+# .include "../../devel/cmake/build.mk"
+
 PYTHON_VERSIONS_INCOMPATIBLE=  27 38
 
 INSTALLATION_DIRS=     bin



Home | Main Index | Thread Index | Old Index