Skip to content

Commit daf7064

Browse files
committed
wip msys2
1 parent 577b0e1 commit daf7064

File tree

3 files changed

+89
-89
lines changed

3 files changed

+89
-89
lines changed

.github/workflows/build.yml

+86-88
Original file line numberDiff line numberDiff line change
@@ -7,107 +7,105 @@ on:
77

88
jobs:
99

10-
linux:
11-
runs-on: ubuntu-20.04
12-
steps:
13-
- name: "Install dependencies"
14-
run: |
15-
sudo apt update -y
16-
sudo apt install -y libsdl2-dev libsdl2-image-dev
17-
18-
- name: "Checkout sources"
19-
uses: actions/checkout@v3
20-
21-
- name: "Compile"
22-
run: |
23-
make bin/brogue
24-
25-
- name: "Create artifact"
26-
run: |
27-
make BrogueCE-linux
28-
tar -czvf BrogueCE-linux-x86_64.tar.gz BrogueCE-linux
29-
30-
- name: "Upload artifact"
31-
uses: actions/upload-artifact@v4
32-
with:
33-
name: linux-x86_64
34-
path: BrogueCE-linux-x86_64.tar.gz
35-
compression-level: 0 # There's no point compressing something already compressed
36-
37-
macos:
38-
runs-on: macos-13
39-
steps:
40-
- name: "Checkout sources"
41-
uses: actions/checkout@v3
42-
43-
- name: "Prepare"
44-
run: |
45-
make macos/sdl2.rb
46-
47-
- name: "Cache SDL2"
48-
uses: actions/cache@v3
49-
with:
50-
path: sdl2-cellar
51-
key: sdl2-${{hashFiles('macos/sdl2.rb')}}
52-
53-
- name: "Compile and install dependencies"
54-
run: |
55-
if [ -d sdl2-cellar ]; then
56-
cp -r sdl2-cellar $(brew --cellar)/sdl2
57-
brew link sdl2
58-
else
59-
brew install --build-from-source ./macos/sdl2.rb
60-
cp -r $(brew --cellar)/sdl2 sdl2-cellar
61-
fi
62-
brew install sdl2_image dylibbundler
63-
64-
- name: "Compile"
65-
run: |
66-
make MAC_APP=YES Brogue.app
67-
env:
68-
MACOSX_DEPLOYMENT_TARGET: "10.7"
69-
70-
- name: "Fix and bundle dylib references"
71-
run: |
72-
cd Brogue.app/Contents && dylibbundler -cd -b -x MacOS/brogue
73-
74-
- name: "Create artifact"
75-
run: |
76-
make BrogueCE-macos
77-
zip -rll BrogueCE-macos-x86_64.zip BrogueCE-macos
78-
79-
- name: "Upload artifact"
80-
uses: actions/upload-artifact@v4
81-
with:
82-
name: macos-x86_64
83-
path: BrogueCE-macos-x86_64.zip
84-
compression-level: 0 # There's no point compressing something already compressed
10+
# linux:
11+
# runs-on: ubuntu-20.04
12+
# steps:
13+
# - name: "Install dependencies"
14+
# run: |
15+
# sudo apt update -y
16+
# sudo apt install -y libsdl2-dev libsdl2-image-dev
17+
18+
# - name: "Checkout sources"
19+
# uses: actions/checkout@v3
20+
21+
# - name: "Compile"
22+
# run: |
23+
# make bin/brogue
24+
25+
# - name: "Create artifact"
26+
# run: |
27+
# make BrogueCE-linux
28+
# tar -czvf BrogueCE-linux-x86_64.tar.gz BrogueCE-linux
29+
30+
# - name: "Upload artifact"
31+
# uses: actions/upload-artifact@v4
32+
# with:
33+
# name: linux-x86_64
34+
# path: BrogueCE-linux-x86_64.tar.gz
35+
# compression-level: 0 # There's no point compressing something already compressed
36+
37+
# macos:
38+
# runs-on: macos-13
39+
# steps:
40+
# - name: "Checkout sources"
41+
# uses: actions/checkout@v3
42+
43+
# - name: "Prepare"
44+
# run: |
45+
# make macos/sdl2.rb
46+
47+
# - name: "Cache SDL2"
48+
# uses: actions/cache@v3
49+
# with:
50+
# path: sdl2-cellar
51+
# key: sdl2-${{hashFiles('macos/sdl2.rb')}}
52+
53+
# - name: "Compile and install dependencies"
54+
# run: |
55+
# if [ -d sdl2-cellar ]; then
56+
# cp -r sdl2-cellar $(brew --cellar)/sdl2
57+
# brew link sdl2
58+
# else
59+
# brew install --build-from-source ./macos/sdl2.rb
60+
# cp -r $(brew --cellar)/sdl2 sdl2-cellar
61+
# fi
62+
# brew install sdl2_image dylibbundler
63+
64+
# - name: "Compile"
65+
# run: |
66+
# make MAC_APP=YES Brogue.app
67+
# env:
68+
# MACOSX_DEPLOYMENT_TARGET: "10.7"
69+
70+
# - name: "Fix and bundle dylib references"
71+
# run: |
72+
# cd Brogue.app/Contents && dylibbundler -cd -b -x MacOS/brogue
73+
74+
# - name: "Create artifact"
75+
# run: |
76+
# make BrogueCE-macos
77+
# zip -rll BrogueCE-macos-x86_64.zip BrogueCE-macos
78+
79+
# - name: "Upload artifact"
80+
# uses: actions/upload-artifact@v4
81+
# with:
82+
# name: macos-x86_64
83+
# path: BrogueCE-macos-x86_64.zip
84+
# compression-level: 0 # There's no point compressing something already compressed
8585

8686
windows:
8787
runs-on: windows-latest
8888
steps:
8989
- name: "Checkout sources"
9090
uses: actions/checkout@v3
9191

92-
- name: "Install dependencies"
93-
run: |
94-
.\.github\get-deps-mingw.ps1
92+
- name: "Install MSYS2 and packages"
93+
uses: msys2/setup-msys2@v2
94+
with:
95+
msystem: MINGW64
96+
release: false
97+
install: "make diffutils mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image"
9598

9699
- name: "Compile"
97-
shell: powershell
100+
shell: "msys2 {0}"
98101
run: |
99-
$env:path = $env:path + ";" + (Join-Path $pwd.Drive.Root "opt/local/x86_64-w64-mingw32/bin")
100-
$env:path = $env:path + ';C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64'
101-
mingw32-make SYSTEM=WINDOWS CC=gcc bin/brogue.exe
102+
make SYSTEM=WINDOWS CC=gcc MT="$(cygpath -u 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\mt.exe')" bin/brogue.exe
103+
ldd bin/brogue.exe
102104
103105
- name: "Create artifact"
106+
shell: "msys2 {0}"
104107
run: |
105-
mingw32-make SYSTEM=WINDOWS BrogueCE-windows
106-
cp SDL2\x86_64-w64-mingw32\bin\SDL2.dll BrogueCE-windows
107-
cp SDL2_image\x86_64-w64-mingw32\bin\zlib1.dll BrogueCE-windows
108-
cp SDL2_image\x86_64-w64-mingw32\bin\SDL2_image.dll BrogueCE-windows
109-
cp SDL2_image\x86_64-w64-mingw32\bin\libpng16-16.dll BrogueCE-windows
110-
7z a BrogueCE-windows-x86_64.zip BrogueCE-windows
108+
make SYSTEM=WINDOWS BrogueCE-windows
111109
112110
- name: "Upload artifact"
113111
uses: actions/upload-artifact@v4

config.mk

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ DATADIR := .
33

44
# Host and target platform. Values: LINUXLIKE, WINDOWS, OS2
55
SYSTEM := LINUXLIKE
6+
# Path to mt (Windows SDK), when building on Windows
7+
MT := mt
68

79
# Include terminal support. Requires ncurses
810
TERMINAL := NO

make/brogue.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ bin/brogue bin/brogue.exe: $(objects) vars/cflags vars/LDFLAGS vars/libs vars/ob
33
# on windows, embedding the manifest modifies the executable, preventing debugging
44
ifeq ($(SYSTEM),WINDOWS)
55
ifeq ($(DEBUG),NO)
6-
mt -manifest windows/brogue.exe.manifest '-outputresource:bin/brogue.exe;1'
6+
$(MT) -manifest windows/brogue.exe.manifest '-outputresource:bin/brogue.exe;1'
77
endif
88
endif

0 commit comments

Comments
 (0)