izapple2/dockerbuild/buildindocker.sh

50 lines
2.1 KiB
Bash
Raw Normal View History

2019-12-26 22:11:32 +00:00
#!/bin/bash
cd /tmp
2020-10-03 21:38:26 +00:00
git clone https://github.com/ivanizag/izapple2
2019-12-26 22:11:32 +00:00
2020-10-03 21:38:26 +00:00
# Build izapple2console for Linux
2024-02-13 21:50:44 +00:00
echo "Building Linux console frontend"
2020-10-17 21:59:52 +00:00
cd /tmp/izapple2/frontend/console
2024-02-13 21:50:44 +00:00
env CGO_ENABLED=1 go build -tags static -ldflags "-s -w" .
2020-10-17 21:59:52 +00:00
chown --reference /build console
2024-02-13 21:50:44 +00:00
cp console /build/izapple2console_linux_amd64
2019-12-26 22:11:32 +00:00
2020-10-03 21:38:26 +00:00
# Build izapple2console.exe for Windows
2024-02-13 21:50:44 +00:00
echo "Building Windows console frontend"
2020-10-17 21:59:52 +00:00
cd /tmp/izapple2/frontend/console
2024-02-13 21:50:44 +00:00
env CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows CGO_LDFLAGS="-L/usr/x86_64-w64-mingw32/lib" CGO_FLAGS="-I/usr/x86_64-w64-mingw32/include -D_REENTRANT" go build -tags static -ldflags "-s -w" -o izapple2console.exe .
2020-10-03 21:38:26 +00:00
chown --reference /build izapple2console.exe
2024-02-13 21:50:44 +00:00
cp izapple2console.exe /build/izapple2console_windows_amd64.exe
2019-12-26 22:11:32 +00:00
2020-10-03 21:38:26 +00:00
# Build izapple2sdl for Linux
2024-02-13 21:50:44 +00:00
echo "Building Linux SDL frontend"
2020-10-17 21:59:52 +00:00
cd /tmp/izapple2/frontend/a2sdl
2024-02-13 21:50:44 +00:00
env CGO_ENABLED=1 go build -tags static -ldflags "-s -w" .
2020-10-17 21:59:52 +00:00
chown --reference /build a2sdl
2024-02-13 21:50:44 +00:00
cp a2sdl /build/izapple2sdl_linux_amd64
2019-12-26 22:11:32 +00:00
2020-10-03 21:38:26 +00:00
# Build izapple2sdl.exe for Windows
2024-02-13 21:50:44 +00:00
echo "Building Windows SDL frontend"
2020-10-17 21:59:52 +00:00
cd /tmp/izapple2/frontend/a2sdl
2024-02-13 21:50:44 +00:00
env CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows CGO_LDFLAGS="-L/usr/x86_64-w64-mingw32/lib -lSDL2" CGO_FLAGS="-I/usr/x86_64-w64-mingw32/include -D_REENTRANT" go build -tags static -ldflags "-s -w" -o izapple2sdl.exe .
2020-10-03 21:38:26 +00:00
chown --reference /build izapple2sdl.exe
2024-02-13 21:50:44 +00:00
cp izapple2sdl.exe /build/izapple2sdl_windows_amd64.exe
2020-10-04 13:45:23 +00:00
2020-10-17 22:29:45 +00:00
# Build izapple2fyne for Linux
2024-02-13 21:50:44 +00:00
echo "Building Linux Fyne frontend"
2020-10-17 22:29:45 +00:00
cd /tmp/izapple2/frontend/a2fyne
2024-02-13 21:50:44 +00:00
env CGO_ENABLED=1 go build -tags static -ldflags "-s -w" .
2020-10-17 22:29:45 +00:00
chown --reference /build a2fyne
2024-02-13 21:50:44 +00:00
cp a2fyne /build/izapple2fyne_linux_amd64
2020-10-17 22:29:45 +00:00
# Build izapple2fyne.exe for Windows
2024-02-13 21:50:44 +00:00
echo "Building Windows Fyne frontend"
2020-10-17 22:29:45 +00:00
cd /tmp/izapple2/frontend/a2fyne
2024-02-13 21:50:44 +00:00
env CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows CGO_LDFLAGS="-L/usr/x86_64-w64-mingw32/lib " CGO_FLAGS="-I/usr/x86_64-w64-mingw32/include -D_REENTRANT" go build -tags static -ldflags "-s -w" -o izapple2fyne.exe .
2020-10-17 22:29:45 +00:00
chown --reference /build izapple2fyne.exe
2024-02-13 21:50:44 +00:00
cp izapple2fyne.exe /build/izapple2fyne_windows_amd64.exe
2020-10-17 22:29:45 +00:00
2020-10-04 13:45:23 +00:00
# Copy SDL2 Runtime
cp /sdl2runtime/* /build