forked from mihaip/minivmac
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Encapsulate win/lin building in dockerfiles, must run mac on a mac.
- Loading branch information
1 parent
1a60398
commit ba4dbe4
Showing
7 changed files
with
139 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM ubuntu:22.04 as setup | ||
|
||
RUN apt update | ||
RUN apt install mingw-w64 build-essential libx11-dev -y | ||
|
||
FROM setup AS build | ||
ARG MACHINE_TYPE="II" | ||
ARG MAINTAINER="none" | ||
ARG HOMEPAGE="https://example.com" | ||
|
||
COPY . / | ||
RUN gcc -o setup_t setup/tool.c | ||
|
||
RUN ./setup_t -maintainer "$MAINTAINER" \ | ||
-homepage "$HOMEPAGE" \ | ||
-n "minivmac-3.7-bluescsi" \ | ||
-t lx64 \ | ||
-m II \ | ||
> setup.sh | ||
RUN sed -i '/.*SDL\.h/i printf \"%s\\n\" \"#define SDL_MAIN_HANDLED\" \>\> \"\$\{DestFile\}\"' setup.sh | ||
RUN bash -x ./setup.sh | ||
RUN export PATH=.:$PATH; make -j $(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM ubuntu:22.04 AS setup | ||
# TODO: Requires SDL2.dll from github.com/libsdl-org/SDL/releases | ||
|
||
RUN apt update | ||
RUN apt install mingw-w64 build-essential wget -y | ||
RUN wget https://www.libsdl.org/release/SDL2-devel-2.0.22-mingw.tar.gz | ||
RUN gzip -dc SDL2-devel-2.0.22-mingw.tar.gz | tar -xvf - | ||
RUN cd SDL2-2.0.22 && make install-package arch=x86_64-w64-mingw32 prefix=/usr/x86_64-w64-mingw32 | ||
RUN ln -s /usr/bin/x86_64-w64-mingw32-gcc gcc.exe | ||
RUN ln -s /usr/bin/x86_64-w64-mingw32-windres windres.exe | ||
RUN ln -s /usr/bin/x86_64-w64-mingw32-strip strip.exe | ||
RUN ln -s src SRC | ||
|
||
FROM setup AS build | ||
ARG MACHINE_TYPE="II" | ||
ARG MAINTAINER="none" | ||
ARG HOMEPAGE="https://example.com" | ||
|
||
COPY . / | ||
RUN gcc -o setup_t setup/tool.c | ||
|
||
RUN ./setup_t -maintainer "$MAINTAINER" \ | ||
-homepage "$HOMEPAGE" \ | ||
-m "$MACHINE_TYPE" \ | ||
-n "minivmac-3.7-bluescsi" \ | ||
-e mgw \ | ||
-t wx64 \ | ||
> setup.sh | ||
RUN sed -i '/.*SDL\.h/i printf \"%s\\n\" \"#define SDL_MAIN_HANDLED\" \>\> \"\$\{DestFile\}\"' setup.sh | ||
RUN bash -x ./setup.sh | ||
RUN export PATH=.:$PATH; make -j $(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh -e -x | ||
|
||
rm -rf ./dist | ||
mkdir -p ./dist | ||
|
||
./build_mac.sh | ||
./build_lin.sh | ||
./build_win.sh | ||
|
||
cd dist | ||
for file in ./*; | ||
do | ||
zip -vr $file.zip $file | ||
done | ||
mkdir -p zips | ||
mv *.zip zips/ | ||
cd .. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh -e -x | ||
|
||
mkdir -p dist/ | ||
|
||
#Vars | ||
declare -a types=("II" "Plus" "SE") | ||
MAINTAINER="[email protected]" | ||
HOMEPAGE="https://bluescsi.com" | ||
|
||
for type in "${types[@]}"; | ||
do | ||
docker build -f Dockerfile.lin \ | ||
--target=build \ | ||
--tag=minivmaclin \ | ||
--build-arg="MACHINE_TYPE=$type" \ | ||
--build-arg="MAINTAINER=$MAINTAINER" \ | ||
--build-arg="HOMEPAGE=$HOMEPAGE" \ | ||
. | ||
docker create --name minivmaclin minivmaclin # need to create a container to copy file from | ||
docker cp minivmaclin:/minivmac dist/minivmac-lx64-$type | ||
docker rm minivmaclin | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,30 @@ | ||
#!/bin/sh -e -x | ||
# | ||
# Example on how to build Mini vMac on Macintosh | ||
# | ||
EMAIL="[email protected]" | ||
WEB="https://github.com/egrath" | ||
rm -rf dist/ | ||
mkdir -p dist/ | ||
|
||
# Build tool each time incase of change, it's quick. | ||
gcc -o setup_t setup/tool.c | ||
#mc64 == intel mac | ||
# -t mcar \ arm mac | ||
# run setup tool to generate makefile generator | ||
./setup_t -maintainer $EMAIL \ | ||
-homepage $WEB \ | ||
-n "minivmac-3.7-test" \ | ||
-t mcar \ | ||
-m II \ | ||
> setup.sh | ||
|
||
# generate makefile and build | ||
. ./setup.sh | ||
xcodebuild | ||
|
||
mv minivmac.app dist/minivmac-mcar-MacII.app | ||
|
||
./setup_t -maintainer $EMAIL \ | ||
-homepage $WEB \ | ||
-n "minivmac-3.7-test" \ | ||
-t mcar \ | ||
> setup.sh | ||
|
||
# generate makefile and build | ||
. ./setup.sh | ||
xcodebuild | ||
|
||
mv minivmac.app dist/minivmac-mcar-MacPlus.app | ||
|
||
# will error/stop if we dont have xcode | ||
which xcodebuild | ||
which gcc | ||
|
||
# run setup tool to generate makefile generator | ||
./setup_t -maintainer $EMAIL \ | ||
-homepage $WEB \ | ||
-n "minivmac-3.7-test" \ | ||
-t mc64 \ | ||
-m II \ | ||
-ev 13000 \ | ||
> setup.sh | ||
|
||
# generate makefile and build | ||
. ./setup.sh | ||
xcodebuild | ||
|
||
mv minivmac.app dist/minivmac-mc64-MacII.app | ||
|
||
|
||
# run setup tool to generate makefile generator | ||
./setup_t -maintainer $EMAIL \ | ||
-homepage $WEB \ | ||
-n "minivmac-3.7-test" \ | ||
-t mc64 \ | ||
-ev 13000 \ | ||
> setup.sh | ||
|
||
# generate makefile and build | ||
. ./setup.sh | ||
xcodebuild | ||
declare -a types=("II" "Plus" "SE") | ||
declare -a platforms=("mc64" "mcar") | ||
MAINTAINER="[email protected]" | ||
HOMEPAGE="https://bluescsi.com" | ||
mkdir -p dist/ | ||
|
||
mv minivmac.app dist/minivmac-mc64-MacPlus.app | ||
gcc -o setup_t setup/tool.c | ||
|
||
# -e xcd \ | ||
|
||
# -hres 640 -vres 480 -depth 3 \ | ||
# -magnify 1 \ | ||
# -mf 2 \ | ||
# -sound 1 \ | ||
# -sony-sum 1 -sony-tag 1 \ | ||
# -speed 4 -ta 2 -em-cpu 2 -mem 8M \ | ||
# -chr 0 -drc 1 -sss 4 \ | ||
# -fullscreen 0 \ | ||
# -var-fullscreen 1 \ | ||
# -api cco \ | ||
for platform in "${platforms[@]}"; | ||
do | ||
for type in "${types[@]}"; | ||
do | ||
./setup_t -maintainer $MAINTAINER \ | ||
-homepage $HOMEPAGE \ | ||
-n "minivmac-3.7-bluescsi" \ | ||
-t $platform \ | ||
-m $type \ | ||
-ev 13000 \ | ||
> setup.sh | ||
. ./setup.sh | ||
xcodebuild | ||
mv minivmac.app dist/minivmac-$platform-$type.app | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh -e -x | ||
|
||
mkdir -p dist/ | ||
|
||
#Vars | ||
declare -a types=("II" "Plus" "SE") | ||
MAINTAINER="[email protected]" | ||
HOMEPAGE="https://bluescsi.com" | ||
|
||
for type in "${types[@]}"; | ||
do | ||
docker build -f Dockerfile.win \ | ||
--target=build \ | ||
--tag=minivmacwin \ | ||
--build-arg="MACHINE_TYPE=$type" \ | ||
--build-arg="MAINTAINER=$MAINTAINER" \ | ||
--build-arg="HOMEPAGE=$HOMEPAGE" \ | ||
. | ||
docker create --name minivmacwin minivmacwin # need to create a container to copy file from | ||
docker cp minivmacwin:/minivmac.exe dist/minivmac-x64-$type.exe | ||
docker rm minivmacwin | ||
done |