Skip to content

Commit

Permalink
Merge branch 'v0.47_fixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstace committed Apr 14, 2024
2 parents ed4c5ea + 7b3c890 commit db62790
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 23 deletions.
10 changes: 0 additions & 10 deletions .ci/alpine_geos.pc

This file was deleted.

2 changes: 1 addition & 1 deletion .ci/docker-compose-geos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ services:
ALPINE_VERSION: $alpine_version
GEOS_VERSION: $geos_version
working_dir: /mnt/sf
entrypoint: go test -test.count=1 -test.run=. ./geos ./internal/rawgeos
entrypoint: go test $tags -test.count=1 -test.run=. ./geos ./internal/rawgeos
volumes:
- ..:/mnt/sf
5 changes: 0 additions & 5 deletions .ci/geos.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ FROM alpine:${ALPINE_VERSION}
ARG GEOS_VERSION
RUN apk add pkgconfig gcc musl-dev geos-dev=${GEOS_VERSION}

# Alpine 3.13 doesn't include the geos.pc file, so we need to add it manually.
# It doesn't hurt to add it manually for other versions of Alpine either, so we
# just add it unconditionally.
COPY alpine_geos.pc /usr/lib/pkgconfig/geos.pc

COPY --from=golang:1.21-alpine /usr/local/go /usr/local/go
ENV PATH=${PATH}:/usr/local/go/bin
RUN go version
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ YYYY-MM-DD
- Adds wrappers in the `geos` package for the `GEOSConcaveHull_r` function
(exposed as `ConcaveHull`).

## v0.47.2

2024-04-15

- Adds support for the `sfnopkgconfig` build tag, which has an effect on the
build process of the `github.com/peterstace/geos` package. It causes the
`#cgo pkg-config` directive to be replaced with the `#cgo LDFLAGS: -lgeos_c`
directive (which was the previous behaviour, before v0.47.1). This is useful
in environments where `pkg-config` is not available or the `geos.pc` file is
not installed. The majority of systems won't need to use the `sfnopkgconfig`
build tag.

## v0.47.1

2024-03-08
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ geos-3.9:

.PHONY: geos-3.8
geos-3.8:
export alpine_version=3.13 geos_version=3.8.1-r2; $(DC_GEOS_RUN)
# Alpine 3.13 doesn't include a geos.pc file (needed by pkg-config). So
# the sfnopkgconfig tag is used, disabling the use of pkg-config.
# LDFLAGS are used to configure GEOS directly.
export tags='-tags sfnopkgconfig' \
alpine_version=3.13 geos_version=3.8.1-r2; $(DC_GEOS_RUN)

.PHONY: geos
geos: geos-3.12
Expand Down
9 changes: 9 additions & 0 deletions internal/rawgeos/configure_hardcoded.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build sfnopkgconfig

package rawgeos

/*
#cgo LDFLAGS: -lgeos_c
#cgo CFLAGS: -Wall
*/
import "C"
9 changes: 9 additions & 0 deletions internal/rawgeos/configure_pkg_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build !sfnopkgconfig

package rawgeos

/*
#cgo pkg-config: geos
#cgo CFLAGS: -Wall
*/
import "C"
2 changes: 0 additions & 2 deletions internal/rawgeos/entrypoints.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package rawgeos

/*
#cgo pkg-config: geos
#cgo CFLAGS: -Wall
#include "geos_c.h"
#include <stdlib.h>
Expand Down
2 changes: 0 additions & 2 deletions internal/rawgeos/generic_operations.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package rawgeos

/*
#cgo pkg-config: geos
#cgo CFLAGS: -Wall
#include "geos_c.h"
*/
import "C"
Expand Down
2 changes: 0 additions & 2 deletions internal/rawgeos/handle.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package rawgeos

/*
#cgo pkg-config: geos
#cgo CFLAGS: -Wall
#include "geos_c.h"
#include <stdlib.h>
#include <string.h>
Expand Down

0 comments on commit db62790

Please sign in to comment.