Skip to content

Commit

Permalink
gdal-grass: update to 1.0.3, build with CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
nilason committed Feb 7, 2025
1 parent dda1eac commit 4820eb0
Showing 1 changed file with 16 additions and 65 deletions.
81 changes: 16 additions & 65 deletions gis/gdal-grass/Portfile
Original file line number Diff line number Diff line change
@@ -1,84 +1,35 @@
# -*- coding: utf-8; mode: tcl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=2:ts=2:sts=2

PortSystem 1.0
PortGroup github 1.0
PortGroup cmake 1.1

name gdal-grass
categories gis

# Due to upstream reset of version numbering after split from GDAL source repo,
# do not (re-)publish 1.4.3_0, 2.1.0_0, 2.1.0_1, 2.2.0_0, 2.2.0_1, or 2.2.0_2
github.setup OSGeo gdal-grass 1.0.2
github.tarball_from archive
revision 11
version 1.0.3
revision 0
epoch 1

categories gis
license MIT
maintainers {yahoo.com:n_larsson @nilason} {vince @Veence} openmaintainer
description GRASS Drivers for GDAL and OGR.

description GRASS Drivers for GDAL and OGR
long_description This plugin allows GDAL to read GRASS raster and vector files.

license MIT
homepage https://github.com/OSGeo/gdal-grass
master_sites https://download.osgeo.org/gdal-grass/

depends_lib port:gdal \
port:grass

checksums rmd160 316d2faf2c66aecbec9d340ef37e799600f7a89c \
sha256 91c45b3c316ed923f4fccb7e7e88fba131c883a6c92f950ec0c1a8b04a7bd851 \
size 58045

compiler.cxx_standard 2011
configure.cxxflags-append -std=c++11

pre-configure {
set grass_gisbase [exec ${prefix}/bin/grass --config path]

configure.args-append --with-grass=${grass_gisbase}

# retrieve include path to <proj.h> from GRASS
set fp [open ${grass_gisbase}/include/Make/Platform.make r]
foreach line [split [read $fp] "\n"] {
if {[string match PROJINC* ${line}]} {
configure.cppflags-append [string trim [lindex [split ${line} "="] 1]]
}
}
close $fp

reinplace "s|CXXFLAGS = @CXX_WFLAGS@|CXXFLAGS = @CXXFLAGS@ @CXX_WFLAGS@|" \
${worksrcpath}/Makefile.in
}

configure.args-append --with-gdal=${prefix}/bin/gdal-config

# PostGreSQL variants (from the GDAL port)
set postgresql_suffixes {12 13 14 15 16}

set postgresql_variants {}
foreach suffix ${postgresql_suffixes} {
lappend postgresql_variants postgresql${suffix}
}

foreach suffix ${postgresql_suffixes} {
set vrt postgresql${suffix}
set pgversion [string index ${suffix} 0].[string index ${suffix} 1]
set index [lsearch -exact ${postgresql_variants} ${vrt}]
set conf [lreplace ${postgresql_variants} ${index} ${index}]

variant ${vrt} description "Use PostgreSQL ${pgversion}" conflicts {*}${conf} "
depends_lib-append port:${vrt}
configure.args-append --with-postgres-includes=${prefix}/include/${vrt}
"
}

# PostGreSQL default
set pgdefault "if {"

foreach suffix ${postgresql_suffixes} {
set pgdefault "${pgdefault}!\[variant_isset postgresql${suffix}\] && "
}

set pgdefault [string range ${pgdefault} 0 end-4]
set pgdefault "${pgdefault}} { default_variants +postgresql${suffix} }"
checksums rmd160 3b5251029254b72215614df2e0690f0e9fa87ffc \
sha256 eb000f9b953f3f2dc399e833969a2bc7f8f4637791add43240b69f77f382a71f \
size 344478

eval ${pgdefault}
compiler.cxx_standard 2011

build.target default
livecheck.type regex
livecheck.url [lindex ${master_sites} 0]
livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)[quotemeta ${extract.suffix}]

0 comments on commit 4820eb0

Please sign in to comment.