Skip to content
This repository was archived by the owner on Apr 20, 2020. It is now read-only.

Commit d737ecf

Browse files
authored
Merge pull request #2 from MaximeBouton/windows
Build on Mac and Windows
2 parents 32edacd + 9eca71f commit d737ecf

5 files changed

Lines changed: 68 additions & 21 deletions

File tree

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ env:
2727
- TARGET=x86_64-linux-musl
2828
- TARGET=aarch64-linux-musl
2929
- TARGET=arm-linux-musleabihf
30+
- TARGET=x86_64-apple-darwin14
3031
- TARGET=x86_64-unknown-freebsd11.1
32+
- TARGET=i686-w64-mingw32
33+
- TARGET=x86_64-w64-mingw32
3134
sudo: required
3235

3336
jobs:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# LibSpatialIndexBuilder builder
1+
# LibSpatialIndexBuilder
22

33
This repository builds binary artifacts for the LibSpatialIndexBuilder project.
44
This repository has a default .travis.yml file that can be used to build

build_tarballs.jl

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,43 @@
22
# `julia build_tarballs.jl --help` to see a usage message.
33
using BinaryBuilder
44

5-
name = "LibSpatialIndexBuilder"
6-
version = v"1.8.5"
5+
version = v"1.8.5" # also change in raw script string
76

87
# Collection of sources required to build LibSpatialIndexBuilder
98
sources = [
10-
"http://download.osgeo.org/libspatialindex/spatialindex-src-1.8.5.tar.bz2" =>
9+
"http://download.osgeo.org/libspatialindex/spatialindex-src-$version.tar.bz2" =>
1110
"31ec0a9305c3bd6b4ad60a5261cba5402366dd7d1969a8846099717778e9a50a",
12-
11+
"./patches"
1312
]
1413

1514
# Bash recipe for building across all platforms
1615
script = raw"""
1716
cd $WORKSPACE/srcdir
17+
1818
cd spatialindex-src-1.8.5/
19+
20+
patch < ${WORKSPACE}/srcdir/makefile.patch
21+
rm Makefile.am.orig
22+
23+
if [ $target = "x86_64-w64-mingw32" ] || [ $target = "i686-w64-mingw32" ]; then
24+
patch < ${WORKSPACE}/srcdir/header-check.patch
25+
fi
26+
27+
aclocal
28+
autoconf
29+
automake --add-missing --foreign
30+
31+
# Show options in the log
32+
./configure --help
33+
1934
./configure --prefix=$prefix --host=$target
2035
make
2136
make install
2237
"""
2338

2439
# These are the platforms we will build for by default, unless further
2540
# platforms are passed in on the command line
26-
platforms = [
27-
Linux(:i686, libc=:glibc),
28-
Linux(:x86_64, libc=:glibc),
29-
Linux(:aarch64, libc=:glibc),
30-
Linux(:armv7l, libc=:glibc, call_abi=:eabihf),
31-
Linux(:powerpc64le, libc=:glibc),
32-
Linux(:i686, libc=:musl),
33-
Linux(:x86_64, libc=:musl),
34-
Linux(:aarch64, libc=:musl),
35-
Linux(:armv7l, libc=:musl, call_abi=:eabihf),
36-
FreeBSD(:x86_64)
37-
]
41+
platforms = supported_platforms()
3842

3943
# The products that we will ensure are always built
4044
products(prefix) = [
@@ -43,10 +47,8 @@ products(prefix) = [
4347
]
4448

4549
# Dependencies that must be installed before this package can be built
46-
dependencies = [
47-
48-
]
50+
dependencies = []
4951

5052
# Build the tarballs, and possibly a `build.jl` as well.
51-
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies)
53+
build_tarballs(ARGS, "SpatialIndex", version, sources, script, platforms, products, dependencies)
5254

patches/header-check.patch

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This file is part of MXE. See LICENSE.md for licensing information.
2+
3+
Contains ad hoc patches for cross building.
4+
5+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
6+
From: Luke Potgieter <fried.roadkill+ght@gmail.com>
7+
Date: Thu, 24 Aug 2017 10:53:39 +0200
8+
Subject: [PATCH 1/1] Remove explicit header check - mingw does not ship with
9+
this header.
10+
11+
12+
diff --git a/configure.ac b/configure.ac
13+
index 1111111..2222222 100644
14+
--- a/configure.ac
15+
+++ b/configure.ac
16+
@@ -38,7 +38,7 @@ AC_CHECK_HEADERS(pthread.h, [
17+
LIBS="$LIBS -lpthread"
18+
#endif])
19+
20+
-AC_CHECK_HEADERS(sys/resource.h,, [AC_MSG_ERROR([cannot find sys/resource.h, bailing out])])
21+
+#AC_CHECK_HEADERS(sys/resource.h,, [AC_MSG_ERROR([cannot find sys/resource.h, bailing out])])
22+
AC_CHECK_HEADERS(sys/time.h,, [AC_MSG_ERROR([cannot find sys/time.h, bailing out])])
23+
AC_CHECK_HEADERS(stdint.h,, [AC_MSG_ERROR([cannot find stdint.h, bailing out])])
24+
AC_CHECK_HEADERS(features.h)

patches/makefile.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- Makefile.am.orig
2+
+++ Makefile.am
3+
@@ -18,8 +18,13 @@
4+
libspatialindex.la \
5+
src/capi/libsidxc.la
6+
7+
-libspatialindex_la_LDFLAGS = -version-info 4:1:0 -no-undefined -lstdc++
8+
-libspatialindex_c_la_LDFLAGS = -version-info 4:1:0 -no-undefined -lstdc++
9+
+# Dummy file to force C++ linking, see this page for more details:
10+
+# https://www.gnu.org/software/automake/manual/html_node/Libtool-Convenience-Libraries.html
11+
+nodist_EXTRA_libspatialindex_la_SOURCES = dummy.cxx
12+
+nodist_EXTRA_libspatialindex_c_la_SOURCES = dummy.cxx
13+
+
14+
+libspatialindex_la_LDFLAGS = -version-info 4:1:0 -no-undefined
15+
+libspatialindex_c_la_LDFLAGS = -version-info 4:1:0 -no-undefined
16+
17+
EXTRA_DIST = INSTALL.WIN \
18+
spatialindex.sln \

0 commit comments

Comments
 (0)