go-sdl2 icon indicating copy to clipboard operation
go-sdl2 copied to clipboard

XBuilding

Open jkassis opened this issue 1 year ago • 7 comments

Go version: go version go1.19.4 darwin/arm64

Go-SDL2 version: require github.com/veandco/go-sdl2 v0.4.34

SDL2 version: ??

OS: MacOS

Architecture: arm64

Having trouble with cross-platform builds inside a Docker container on MacOS arm64 (Macbook M2) host OS...

The build is easily replicated by...

git clone https://github.com/jkassis/gas
cd go
go run bin/make.go setup
go run bin/make.go buildx

It uses an Ubuntu image setup for cross platform builds and a build script derived from the xgo project to build for multiple platforms using libraries vendored into the project on the HostOS.

Here's what I get from the docker builds...

[I] jkassis@Js-MacBook-Air ~/co/ga/go (main)> go run bin/make.go buildx                                                                                                                                                        05.03 18:28
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Building /source/go.mod...
Compiling for linux/amd64...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:5:11: fatal error: SDL.h: No such file or directory
    5 |  #include <SDL.h>
      |           ^~~~~~~
compilation terminated.
Compiling for linux/386...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:5:11: fatal error: SDL.h: No such file or directory
    5 |  #include <SDL.h>
      |           ^~~~~~~
compilation terminated.
Compiling for linux/arm-7...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:5:11: fatal error: SDL.h: No such file or directory
    5 |  #include <SDL.h>
      |           ^~~~~~~
compilation terminated.
Compiling for linux/arm64...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:5:11: fatal error: SDL.h: No such file or directory
    5 |  #include <SDL.h>
      |           ^~~~~~~
compilation terminated.

I'm concerned and confused by the references to what appear to be SDL1.x headers here.

jkassis avatar May 04 '23 01:05 jkassis