diff options
-rw-r--r-- | build-matrix.html | 2 | ||||
-rw-r--r-- | plugins/go/README.md | 34 | ||||
-rw-r--r-- | plugins/go/go-1-fixes.patch | 108 | ||||
-rw-r--r-- | plugins/go/go-native.mk | 32 | ||||
-rw-r--r-- | plugins/go/go.mk | 61 | ||||
-rw-r--r-- | plugins/go/src/mxe-test/main.go | 7 | ||||
-rw-r--r-- | src/gdal-1-fixes.patch | 47 | ||||
-rw-r--r-- | src/gdal.mk | 4 | ||||
-rw-r--r-- | src/gnutls.mk | 4 | ||||
-rw-r--r-- | src/oce.mk | 11 | ||||
-rw-r--r-- | src/proj-1-fixes.patch | 12 | ||||
-rw-r--r-- | src/proj.mk | 4 | ||||
-rw-r--r-- | versions.json | 2 |
13 files changed, 281 insertions, 47 deletions
diff --git a/build-matrix.html b/build-matrix.html index a35c937..bb0afa8 100644 --- a/build-matrix.html +++ b/build-matrix.html @@ -859,7 +859,7 @@ feel free to submit a pull request. <tr> <th class="row">gnutls</th> - <td>3.4.13</td> + <td>3.4.14</td> <td class="supported">✓</td> <td class="supported">✓</td> <td class="supported">✓</td> diff --git a/plugins/go/README.md b/plugins/go/README.md new file mode 100644 index 0000000..6d3c7dd --- /dev/null +++ b/plugins/go/README.md @@ -0,0 +1,34 @@ +# Go plugin for MXE + +See also article [cross-compile go code, including cgo][1] +by Dimitri John Ledkov. + +[1]: http://blog.surgut.co.uk/2014/06/cross-compile-go-code-including-cgo.html + +Package `go-native` installs native Go 1.4. This version of Go +doesn't depend on Go installation. + +Package `go` uses native Go 1.4 as a bootstrap and installs Go 1.6 +as a cross-compiler to windows/386 or windows/amd64. Versions of +Go starting with 1.5 need Go installation to build. + +To build Go packages for windows/386 or windows/amd64, you have to set +the [GOPATH](https://golang.org/doc/code.html#GOPATH) environment variable +and call `usr/bin/$(TARGET)-go` wrapper script. + +## Example + +Building [gohs](https://github.com/flier/gohs), GoLang Binding of +[HyperScan](https://01.org/hyperscan). + +``` +$ make hyperscan go MXE_PLUGIN_DIRS=plugins/go +$ mkdir gopath +$ GOPATH=`pwd`/gopath ./usr/bin/i686-w64-mingw32.static-go get \ + github.com/flier/gohs/examples/simplegrep +$ ./gopath/bin/windows_386/simplegrep.exe root /etc/passwd +Scanning 42 bytes with Hyperscan +root:x:0:0:root:/root:/bin/bash +root:x:0:0:root:/root:/bin/bash +root:x:0:0:root:/root:/bin/bash +``` diff --git a/plugins/go/go-1-fixes.patch b/plugins/go/go-1-fixes.patch new file mode 100644 index 0000000..27281c7 --- /dev/null +++ b/plugins/go/go-1-fixes.patch @@ -0,0 +1,108 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Boris Nagaev <bnagaev@gmail.com> +Date: Sat, 25 Jun 2016 13:51:06 +0200 +Subject: [PATCH] cgo: add environmental variable override for pkg-config + +Allow overriding default name of `pkg-config` utility via +environmental variable PKG_CONFIG (same as used by autoconf +pkg.m4 macros). This facilitates easy cross-compilation of cgo +code. + +Original patch against Go <= 1.4 was written by +xnox_canonical <dimitri.ledkov@canonical.com> in 2014. +Source: https://codereview.appspot.com/104960043/ + +Rebased against Go 1.6.2 by Boris Nagaev <bnagaev@gmail.com>. + +diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go +index 1111111..2222222 100644 +--- a/src/cmd/dist/build.go ++++ b/src/cmd/dist/build.go +@@ -41,6 +41,7 @@ var ( + defaultldflags string + defaultcxxtarget string + defaultcctarget string ++ defaultpkgconfigtarget string + rebuildall bool + defaultclang bool + +@@ -203,6 +204,12 @@ func xinit() { + } + defaultcxxtarget = b + ++ b = os.Getenv("PKG_CONFIG") ++ if b == "" { ++ b = "pkg-config" ++ } ++ defaultpkgconfigtarget = b ++ + // For tools being invoked but also for os.ExpandEnv. + os.Setenv("GO386", go386) + os.Setenv("GOARCH", goarch) +diff --git a/src/cmd/dist/buildgo.go b/src/cmd/dist/buildgo.go +index 1111111..2222222 100644 +--- a/src/cmd/dist/buildgo.go ++++ b/src/cmd/dist/buildgo.go +@@ -15,6 +15,7 @@ import "fmt" + // package main + // const defaultCC = <defaultcc> + // const defaultCXX = <defaultcxx> ++// const defaultPkgConfig = <defaultpkgconfig> + // + // It is invoked to write cmd/go/zdefaultcc.go + // but we also write cmd/cgo/zdefaultcc.go +@@ -27,8 +28,9 @@ func mkzdefaultcc(dir, file string) { + "package main\n"+ + "\n"+ + "const defaultCC = `%s`\n"+ +- "const defaultCXX = `%s`\n", +- defaultcctarget, defaultcxxtarget) ++ "const defaultCXX = `%s`\n"+ ++ "const defaultPkgConfig = `%s`\n", ++ defaultcctarget, defaultcxxtarget, defaultpkgconfigtarget) + + writefile(out, file, writeSkipSame) + +diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go +index 1111111..2222222 100644 +--- a/src/cmd/go/build.go ++++ b/src/cmd/go/build.go +@@ -1575,13 +1575,19 @@ func (b *builder) build(a *action) (err error) { + return nil + } + ++// pkgconfigCmd returns a pkg-config binary name ++// defaultPkgConfig is defined in zdefaultcc.go, written by cmd/dist. ++func (b *builder) pkgconfigCmd() string { ++ return envList("PKG_CONFIG", defaultPkgConfig)[0] ++} ++ + // Calls pkg-config if needed and returns the cflags/ldflags needed to build the package. + func (b *builder) getPkgConfigFlags(p *Package) (cflags, ldflags []string, err error) { + if pkgs := p.CgoPkgConfig; len(pkgs) > 0 { + var out []byte +- out, err = b.runOut(p.Dir, p.ImportPath, nil, "pkg-config", "--cflags", pkgs) ++ out, err = b.runOut(p.Dir, p.ImportPath, nil, b.pkgconfigCmd(), "--cflags", pkgs) + if err != nil { +- b.showOutput(p.Dir, "pkg-config --cflags "+strings.Join(pkgs, " "), string(out)) ++ b.showOutput(p.Dir, b.pkgconfigCmd()+" --cflags "+strings.Join(pkgs, " "), string(out)) + b.print(err.Error() + "\n") + err = errPrintedOutput + return +@@ -1589,9 +1595,9 @@ func (b *builder) getPkgConfigFlags(p *Package) (cflags, ldflags []string, err e + if len(out) > 0 { + cflags = strings.Fields(string(out)) + } +- out, err = b.runOut(p.Dir, p.ImportPath, nil, "pkg-config", "--libs", pkgs) ++ out, err = b.runOut(p.Dir, p.ImportPath, nil, b.pkgconfigCmd(), "--libs", pkgs) + if err != nil { +- b.showOutput(p.Dir, "pkg-config --libs "+strings.Join(pkgs, " "), string(out)) ++ b.showOutput(p.Dir, b.pkgconfigCmd()+" --libs "+strings.Join(pkgs, " "), string(out)) + b.print(err.Error() + "\n") + err = errPrintedOutput + return diff --git a/plugins/go/go-native.mk b/plugins/go/go-native.mk new file mode 100644 index 0000000..2278d2c --- /dev/null +++ b/plugins/go/go-native.mk @@ -0,0 +1,32 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := go-native +$(PKG)_WEBSITE := https://golang.org/ +$(PKG)_OWNER := https://github.com/starius +$(PKG)_IGNORE := +$(PKG)_VERSION := 1.4.3 +$(PKG)_CHECKSUM := 9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959 +$(PKG)_SUBDIR := go +$(PKG)_FILE := go$($(PKG)_VERSION).src.tar.gz +$(PKG)_URL := https://storage.googleapis.com/golang/$($(PKG)_FILE) +$(PKG)_DEPS_$(BUILD) := +$(PKG)_TARGETS := $(BUILD) + +define $(PKG)_UPDATE + $(WGET) -q -O- 'https://golang.org/dl/' | \ + $(SED) -n 's,.*go\(1.4.[0-9][^>]*\)\.src\.tar.*,\1,p' | \ + $(SORT) -h | tail -1 +endef + +define $(PKG)_BUILD + cd '$(1)/src' && \ + GOROOT_FINAL='$(PREFIX)/$(TARGET)/go' \ + DYLD_INSERT_LIBRARIES= \ + ./make.bash + + mkdir -p '$(PREFIX)/$(TARGET)/go' + for d in include src bin pkg; do \ + cp -a '$(1)'/$$d '$(PREFIX)/$(TARGET)/go/' ; \ + done +endef diff --git a/plugins/go/go.mk b/plugins/go/go.mk new file mode 100644 index 0000000..a28f0ed --- /dev/null +++ b/plugins/go/go.mk @@ -0,0 +1,61 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := go +$(PKG)_WEBSITE := https://golang.org/ +$(PKG)_OWNER := https://github.com/starius +$(PKG)_IGNORE := +$(PKG)_VERSION := 1.6.2 +$(PKG)_CHECKSUM := 787b0b750d037016a30c6ed05a8a70a91b2e9db4bd9b1a2453aa502a63f1bccc +$(PKG)_SUBDIR := go +$(PKG)_FILE := go$($(PKG)_VERSION).src.tar.gz +$(PKG)_URL := https://storage.googleapis.com/golang/$($(PKG)_FILE) +$(PKG)_DEPS := + +define $(PKG)_UPDATE + $(WGET) -q -O- 'https://golang.org/dl/' | \ + $(SED) -n 's,.*go\(1.6.[0-9][^>]*\)\.src\.tar.*,\1,p' | \ + $(SORT) -h | tail -1 +endef + +define $(PKG)_BUILD + cd '$(1)/src' && \ + GOROOT_BOOTSTRAP='$(PREFIX)/$(BUILD)/go' \ + GOROOT_FINAL='$(PREFIX)/$(TARGET)/go' \ + GOOS=windows \ + GOARCH='$(if $(findstring x86_64,$(TARGET)),amd64,386)' \ + DYLD_INSERT_LIBRARIES= \ + ./make.bash + + mkdir -p '$(PREFIX)/$(TARGET)/go' + for d in include src bin pkg; do \ + cp -a '$(1)'/$$d '$(PREFIX)/$(TARGET)/go/' ; \ + done + + #create prefixed go wrapper script + mkdir -p '$(PREFIX)/bin/$(TARGET)' + (echo '#!/usr/bin/env bash'; \ + echo 'echo "== Using MXE Go wrapper: $(PREFIX)/bin/$(TARGET)-go"'; \ + echo 'set -xue'; \ + echo 'CGO_ENABLED=1 \'; \ + echo 'GOOS=windows \'; \ + echo 'GOARCH=$(if $(findstring x86_64,$(TARGET)),amd64,386) \'; \ + echo 'DYLD_INSERT_LIBRARIES= \'; \ + echo 'CC=$(PREFIX)/bin/$(TARGET)-gcc \'; \ + echo 'CXX=$(PREFIX)/bin/$(TARGET)-g++ \'; \ + echo 'PKG_CONFIG=$(PREFIX)/bin/$(TARGET)-pkg-config \'; \ + echo 'exec $(PREFIX)/$(TARGET)/go/bin/go \'; \ + echo '"$$@"'; \ + ) \ + > '$(PREFIX)/bin/$(TARGET)-go' + chmod 0755 '$(PREFIX)/bin/$(TARGET)-go' + + GOPATH=$(PWD)/plugins/go \ + '$(TARGET)-go' build \ + -o '$(PREFIX)/$(TARGET)/go/bin/test-go.exe' \ + mxe-test +endef + +# -buildmode=shared not supported on windows +# See https://golang.org/s/execmodes +$(PKG)_BUILD_SHARED = diff --git a/plugins/go/src/mxe-test/main.go b/plugins/go/src/mxe-test/main.go new file mode 100644 index 0000000..c6d46fb --- /dev/null +++ b/plugins/go/src/mxe-test/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Printf("hello, world\n") +} diff --git a/src/gdal-1-fixes.patch b/src/gdal-1-fixes.patch index 4544444..67b5895 100644 --- a/src/gdal-1-fixes.patch +++ b/src/gdal-1-fixes.patch @@ -1,15 +1,16 @@ This file is part of MXE. See index.html for further information. -From ffcbf5c48eb8d8ae6a1c20e1496f1866d7903af8 Mon Sep 17 00:00:00 2001 -From: Timothy Gu <timothygu99@gmail.com> +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MXE Date: Sat, 18 Oct 2014 18:25:34 -0400 Subject: [PATCH 1/2] Fix geos detection -Signed-off-by: Timothy Gu <timothygu99@gmail.com> diff --git a/m4/geos.m4 b/m4/geos.m4 -index 386a2c8..cda1510 100644 +index 1111111..2222222 100644 --- a/m4/geos.m4 +++ b/m4/geos.m4 @@ -121,14 +121,14 @@ AC_DEFUN([GEOS_INIT],[ @@ -30,31 +31,36 @@ index 386a2c8..cda1510 100644 AC_CHECK_LIB([geos_c], [GEOSversion], --- -1.9.1 - -From 3c60ec35bec710dc9e8fd6f0606abb7646b4f8eb Mon Sep 17 00:00:00 2001 -From: Timothy Gu <timothygu99@gmail.com> -Date: Sat, 18 Oct 2014 18:33:43 -0400 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MXE +Date: Tue, 5 Jul 2016 22:23:16 +0300 Subject: [PATCH 2/2] Use AC_PATH_TOOL for config scripts -Signed-off-by: Timothy Gu <timothygu99@gmail.com> diff --git a/configure.in b/configure.in -index a0cf595..8ab4b5a 100644 +index 1111111..2222222 100644 --- a/configure.in +++ b/configure.in -@@ -640,7 +640,7 @@ AC_ARG_WITH(pg, +@@ -866,7 +866,7 @@ AC_ARG_WITH(pg, [Include PostgreSQL GDAL/OGR Support (ARG=path to pg_config)]),,) if test "x$with_pg" = "xyes" -o "x$with_pg" = "x" ; then - AC_PATH_PROG(PG_CONFIG, pg_config, no) + AC_PATH_TOOL(PG_CONFIG, pg_config, no) - else + else PG_CONFIG=$with_pg fi -@@ -1719,10 +1719,10 @@ else +@@ -2016,7 +2016,7 @@ KEA_CONFIG=no + AC_ARG_WITH(kea,[ --with-kea[=ARG] Include kealib (ARG=path to kea-config) [[default=yes]]],,) + + if test "$with_kea" = "yes" -o "x$with_kea" = "x" ; then +- AC_PATH_PROG(KEA_CONFIG, kea-config, no) ++ AC_PATH_TOOL(KEA_CONFIG, kea-config, no) + else + KEA_CONFIG=$with_kea + fi +@@ -2079,10 +2079,10 @@ else dnl find nc-config location unset ac_cv_path_NETCDF_NCCONFIG if test "$with_netcdf" = "yes" -o "$with_netcdf" = "" ; then @@ -67,7 +73,7 @@ index a0cf595..8ab4b5a 100644 fi dnl test nc-config -@@ -2447,7 +2447,7 @@ MYSQL_CONFIG=no +@@ -2832,7 +2832,7 @@ MYSQL_CONFIG=no AC_ARG_WITH(mysql,[ --with-mysql[=ARG] Include MySQL (ARG=path to mysql_config) [[default=no]]],,) if test "$with_mysql" = "yes" ; then @@ -76,7 +82,7 @@ index a0cf595..8ab4b5a 100644 else if test "x$with_mysql" != "x" ; then MYSQL_CONFIG=$with_mysql -@@ -2756,7 +2756,7 @@ if test "`basename xx/$with_curl`" = "curl-config" ; then +@@ -3162,7 +3162,7 @@ if test "`basename xx/$with_curl`" = "curl-config" ; then elif test "$with_curl" = "no" ; then LIBCURL_CONFIG=no else @@ -85,7 +91,7 @@ index a0cf595..8ab4b5a 100644 fi if test "$LIBCURL_CONFIG" != "no" ; then -@@ -2798,7 +2798,7 @@ if test "`basename xx/$with_xml2`" = "xml2-config" ; then +@@ -3204,7 +3204,7 @@ if test "`basename xx/$with_xml2`" = "xml2-config" ; then elif test "$with_xml2" = "no" ; then LIBXML2_CONFIG=no else @@ -95,7 +101,7 @@ index a0cf595..8ab4b5a 100644 if test "$LIBXML2_CONFIG" != "no" ; then diff --git a/m4/geos.m4 b/m4/geos.m4 -index cda1510..3fb4490 100644 +index 1111111..2222222 100644 --- a/m4/geos.m4 +++ b/m4/geos.m4 @@ -58,7 +58,7 @@ AC_DEFUN([GEOS_INIT],[ @@ -116,6 +122,3 @@ index cda1510..3fb4490 100644 [] ) --- -1.9.1 - diff --git a/src/gdal.mk b/src/gdal.mk index ff54ca4..ff785b5 100644 --- a/src/gdal.mk +++ b/src/gdal.mk @@ -3,8 +3,8 @@ PKG := gdal $(PKG)_IGNORE := -$(PKG)_VERSION := 2.0.2 -$(PKG)_CHECKSUM := db7722caf8d9dd798ec18012b9cacf40a518918466126a88b9fd277bd7d40cc4 +$(PKG)_VERSION := 2.1.0 +$(PKG)_CHECKSUM := eb499b18e5c5262a803bb7530ae56e95c3293be7b26c74bcadf67489203bf2cd $(PKG)_SUBDIR := gdal-$($(PKG)_VERSION) $(PKG)_FILE := gdal-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://download.osgeo.org/gdal/$($(PKG)_VERSION)/$($(PKG)_FILE) diff --git a/src/gnutls.mk b/src/gnutls.mk index a9a1445..8f30687 100644 --- a/src/gnutls.mk +++ b/src/gnutls.mk @@ -2,8 +2,8 @@ # See index.html for further information. PKG := gnutls -$(PKG)_VERSION := 3.4.13 -$(PKG)_CHECKSUM := fd3386e8e72725980bcd7f40949aa0121dcb7650b5147c6490e794555ed25859 +$(PKG)_VERSION := 3.4.14 +$(PKG)_CHECKSUM := 35deddf2779b76ac11057de38bf380b8066c05de21b94263ad5b6dfa75dfbb23 $(PKG)_SUBDIR := gnutls-$($(PKG)_VERSION) $(PKG)_FILE := gnutls-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://mirrors.dotsrc.org/gnupg/gnutls/v3.4/$($(PKG)_FILE) @@ -3,8 +3,8 @@ PKG := oce $(PKG)_IGNORE := -$(PKG)_VERSION := 0.16.1 -$(PKG)_CHECKSUM := d31030c8da4a1b33f767d0d59895a995c8eabc8fc65cbe0558734f6021ea2f57 +$(PKG)_VERSION := 0.17.2 +$(PKG)_CHECKSUM := 8d9995360cd531cbd4a7aa4ca5ed969f08ec7c7a37755e2f3d4ef832c1b2f56e $(PKG)_SUBDIR := $(PKG)-OCE-$($(PKG)_VERSION) $(PKG)_FILE := OCE-$($(PKG)_VERSION).tar.gz $(PKG)_URL := https://github.com/tpaviot/oce/archive/$($(PKG)_FILE) @@ -18,15 +18,16 @@ define $(PKG)_UPDATE endef define $(PKG)_BUILD - cd '$(1)' && cmake . \ - -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ + mkdir '$(1).build' + cd '$(1).build' && $(TARGET)-cmake '$(1)' \ -DOCE_BUILD_SHARED_LIB=$(if $(BUILD_STATIC),FALSE,TRUE) \ -DOCE_INSTALL_PREFIX=$(PREFIX)/$(TARGET) \ -DOCE_INSTALL_BIN_DIR=$(PREFIX)/$(TARGET)/bin \ -DOCE_INSTALL_LIB_DIR=$(PREFIX)/$(TARGET)/lib \ -DOCE_INSTALL_CMAKE_DATA_DIR=$(PREFIX)/$(TARGET)/lib/cmake/OCE - $(MAKE) -C '$(1)' -j '$(JOBS)' install VERBOSE=1 + $(MAKE) -C '$(1).build' -j '$(JOBS)' VERBOSE=1 + $(MAKE) -C '$(1).build' -j 1 install cd '$(1)/examples/find_package_oce' && cmake . -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' $(MAKE) -C '$(1)/examples/find_package_oce' diff --git a/src/proj-1-fixes.patch b/src/proj-1-fixes.patch deleted file mode 100644 index 3792b1c..0000000 --- a/src/proj-1-fixes.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -bruN proj-4.9.1.original/src/Makefile.in proj-4.9.1/src/Makefile.in ---- proj-4.9.1.original/src/Makefile.in 2016-04-05 10:59:38.834624359 +0200 -+++ proj-4.9.1/src/Makefile.in 2016-04-05 11:00:11.073813213 +0200 -@@ -400,7 +400,7 @@ - multistresstest_LDADD = libproj.la -lpthread - test228_LDADD = libproj.la -lpthread - lib_LTLIBRARIES = libproj.la --libproj_la_LDFLAGS = -no-undefined -version-info 9:0:0 -+libproj_la_LDFLAGS = -no-undefined -version-info 0:0:0 - libproj_la_SOURCES = \ - pj_list.h \ - PJ_aeqd.c PJ_gnom.c PJ_laea.c PJ_mod_ster.c \ diff --git a/src/proj.mk b/src/proj.mk index 5581ced..39d08d6 100644 --- a/src/proj.mk +++ b/src/proj.mk @@ -3,8 +3,8 @@ PKG := proj $(PKG)_IGNORE := -$(PKG)_VERSION := 4.9.1 -$(PKG)_CHECKSUM := fca0388f3f8bc5a1a803d2f6ff30017532367992b30cf144f2d39be88f36c319 +$(PKG)_VERSION := 4.9.2 +$(PKG)_CHECKSUM := 60bf9ad1ed1c18158e652dfff97865ba6fb2b67f1511bc8dceae4b3c7e657796 $(PKG)_SUBDIR := proj-$($(PKG)_VERSION) $(PKG)_FILE := proj-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://download.osgeo.org/proj/$($(PKG)_FILE) diff --git a/versions.json b/versions.json index 80e415a..db69318 100644 --- a/versions.json +++ b/versions.json @@ -81,7 +81,7 @@ "glibmm": "2.42.0", "glm": "0.9.7.4", "gmp": "6.1.1", - "gnutls": "3.4.13", + "gnutls": "3.4.14", "graphicsmagick": "1.3.21", "gsl": "1.16", "gsoap": "2.8.22", |