Skip to content

Commit

Permalink
Remove AEC shared libs. (#19)
Browse files Browse the repository at this point in the history
* Remove AEC shared libs.

These interfere with the static linkage of GDAL, breaking the build.

* Update GDAL to 3.4.2.

* Update GEOS to 3.10.2.

Also add an update script to make updating easier.

* Add additional GDAL URL.

* Add GDAL patch.

This is a temporary workaround for
OSGeo/gdal#4815.

* Update README.md.
  • Loading branch information
Attila Oláh authored Mar 30, 2022
1 parent b576bb3 commit ec20f2f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ toolchain, pass `--cpu=wasm32`. Pass `-c opt` for an optimised build.
[`//lib/fftw`](https://github.com/attilaolah/wasm/blob/main/lib/fftw/BUILD.bazel) | 3.3.10 [🔗](http://www.fftw.org/fftw-3.3.10.tar.gz)
[`//lib/flex`](https://github.com/attilaolah/wasm/blob/main/lib/flex/BUILD.bazel) | 2.6.4 [🔗](https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz)
[`//lib/gcc`](https://github.com/attilaolah/wasm/blob/main/lib/gcc/BUILD.bazel) | 10.2.0 [🔗](https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.xz) [🔗](https://mirror.kumi.systems/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.xz)
[`//lib/gdal`](https://github.com/attilaolah/wasm/blob/main/lib/gdal/BUILD.bazel) | 3.2.1 [🔗](https://github.com/OSGeo/gdal/releases/download/v3.2.1/gdal-3.2.1.tar.gz)
[`//lib/geos`](https://github.com/attilaolah/wasm/blob/main/lib/geos/BUILD.bazel) | 3.9.1 [🔗](https://github.com/libgeos/geos/archive/3.9.1.tar.gz)
[`//lib/gdal`](https://github.com/attilaolah/wasm/blob/main/lib/gdal/BUILD.bazel) | 3.4.2 [🔗](http://download.osgeo.org/gdal/3.4.2/gdal-3.4.2.tar.gz) [🔗](https://github.com/OSGeo/gdal/releases/download/v3.4.2/gdal-3.4.2.tar.gz)
[`//lib/geos`](https://github.com/attilaolah/wasm/blob/main/lib/geos/BUILD.bazel) | 3.10.2 [🔗](https://github.com/libgeos/geos/archive/3.10.2.tar.gz)
[`//lib/geotiff`](https://github.com/attilaolah/wasm/blob/main/lib/geotiff/BUILD.bazel) | 1.6.0 [🔗](https://github.com/OSGeo/libgeotiff/releases/download/1.6.0/libgeotiff-1.6.0.tar.gz)
[`//lib/gflags`](https://github.com/attilaolah/wasm/blob/main/lib/gflags/BUILD.bazel) | 2.2.2 [🔗](https://github.com/gflags/gflags/archive/v2.2.2.tar.gz)
[`//lib/gif`](https://github.com/attilaolah/wasm/blob/main/lib/gif/BUILD.bazel) | 5.2.1 [🔗](https://downloads.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz)
Expand Down
2 changes: 2 additions & 0 deletions lib/aec/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ cmake_lib(
"libaec.a",
"libsz.a",
],
# The build script insists on installing shared libs, so remove them.
postfix_script = 'rm "${INSTALLDIR}"/lib/*.so{,.*}',
)
11 changes: 11 additions & 0 deletions lib/gdal/gdal.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- configure
+++ configure
@@ -38844,7 +38844,7 @@

HAVE_GEOS="no"

- GEOS_LIBS="`${GEOS_CONFIG} --ldflags` -lgeos_c"
+ GEOS_LIBS="`${GEOS_CONFIG} --static-clibs`"
GEOS_CFLAGS="`${GEOS_CONFIG} --cflags`"
GEOS_VERSION="`${GEOS_CONFIG} --version`"

13 changes: 9 additions & 4 deletions lib/gdal/package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
load("//lib:http_archive.bzl", "http_archive")

NAME = "gdal"
VERSION = "3.2.1"
VERSION = "3.4.2"

URL = "https://github.com/OSGeo/{name}/releases/download/v{version}/{name}-{version}.tar.gz"
URLS = [
"http://download.osgeo.org/{name}/{version}/{name}-{version}.tar.gz",
"https://github.com/OSGeo/{name}/releases/download/v{version}/{name}-{version}.tar.gz"
]

SHA256 = "43d40ba940e3927e38f9e98062ff62f9fa993ceade82f26f16fab7e73edb572e"
SHA256 = "7edef6de47c67da806b74eb8d3a20550933392a295c707682ea21b72123e34ce"

def download():
http_archive(
name = NAME,
version = VERSION,
urls = [URL],
urls = URLS,
sha256 = SHA256,
strip_prefix = "{name}-{version}",
# Workaround for https://github.com/OSGeo/gdal/issues/4815.
patches = ["//lib/gdal:gdal.patch"],
)
5 changes: 4 additions & 1 deletion lib/geos/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ load("//toolchains/cmake:cmake.bzl", "cmake_lib")

package(default_visibility = ["//:__subpackages__"])

package_lib()
package_lib(
version_regex = r'href="/libgeos/geos/archive/refs/tags/([^"]+).tar.gz"',
version_url = "https://github.com/libgeos/geos/tags",
)

CACHE_ENTRIES = {
"BUILD_BENCHMARKS": False,
Expand Down
4 changes: 2 additions & 2 deletions lib/geos/package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
load("//lib:http_archive.bzl", "http_archive")

NAME = "geos"
VERSION = "3.9.1"
VERSION = "3.10.2"

URL = "https://github.com/lib{name}/{name}/archive/{version}.tar.gz"

SHA256 = "e9e20e83572645ac2af0af523b40a404627ce74b3ec99727754391cdf5b23645"
SHA256 = "d71932b444c9bd5d0bdf9eab4d22f25d9c31c122a73d619e2ec15294fb32147d"

def download():
http_archive(
Expand Down

0 comments on commit ec20f2f

Please sign in to comment.