Skip to content

Commit 945055a

Browse files
committed
Initial commit: Game Boy emulator in Hare
Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
0 parents  commit 945055a

15 files changed

Lines changed: 5334 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
env:
13+
QBE_REF: 4f9b94a9b32a694ba58f99a49d5ceec2656c06ca
14+
HAREC_REF: 1e65ac55d1e9e944664e33fc03c642460ab1746d
15+
HARE_REF: f2449260531373e7bea52353a15a1bab978ff00a
16+
HARE_SDL2_REF: fb6008be0b79a2a24b1ac960316a83f7873b4f39
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install system dependencies
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y libsdl2-dev build-essential scdoc
24+
25+
- name: Install QBE
26+
run: |
27+
git clone git://c9x.me/qbe.git
28+
cd qbe
29+
git checkout "$QBE_REF"
30+
make -j$(nproc)
31+
sudo make install
32+
33+
- name: Install harec
34+
run: |
35+
git clone https://git.sr.ht/~sircmpwn/harec
36+
cd harec
37+
git checkout "$HAREC_REF"
38+
cp configs/linux.mk config.mk
39+
make -j$(nproc)
40+
sudo make install
41+
42+
- name: Install Hare
43+
run: |
44+
git clone https://git.sr.ht/~sircmpwn/hare
45+
cd hare
46+
git checkout "$HARE_REF"
47+
cp configs/linux.mk config.mk
48+
make -j$(nproc)
49+
sudo make install
50+
51+
- name: Install hare-sdl2
52+
run: |
53+
git clone https://git.sr.ht/~sircmpwn/hare-sdl2
54+
cd hare-sdl2
55+
git checkout "$HARE_SDL2_REF"
56+
cd ..
57+
sudo mkdir -p /usr/local/src/hare/third-party
58+
sudo cp -r hare-sdl2/sdl2 /usr/local/src/hare/third-party/
59+
60+
- name: Build hareboy
61+
run: hare build -lSDL2 -o hareboy .
62+
63+
- name: Smoke test CLI usage
64+
run: |
65+
set +e
66+
output="$(./hareboy 2>&1)"
67+
status=$?
68+
set -e
69+
if [ "$status" -ne 1 ]; then
70+
echo "Expected exit code 1 without ROM, got $status"
71+
exit 1
72+
fi
73+
case "$output" in
74+
*"Usage: hareboy <rom.gb>"*) ;;
75+
*)
76+
echo "Missing usage output"
77+
echo "$output"
78+
exit 1
79+
;;
80+
esac

.github/workflows/release.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
env:
15+
QBE_REF: 4f9b94a9b32a694ba58f99a49d5ceec2656c06ca
16+
HAREC_REF: 1e65ac55d1e9e944664e33fc03c642460ab1746d
17+
HARE_REF: f2449260531373e7bea52353a15a1bab978ff00a
18+
HARE_SDL2_REF: fb6008be0b79a2a24b1ac960316a83f7873b4f39
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install system dependencies
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y libsdl2-dev build-essential scdoc
26+
27+
- name: Install QBE
28+
run: |
29+
git clone git://c9x.me/qbe.git
30+
cd qbe
31+
git checkout "$QBE_REF"
32+
make -j$(nproc)
33+
sudo make install
34+
35+
- name: Install harec
36+
run: |
37+
git clone https://git.sr.ht/~sircmpwn/harec
38+
cd harec
39+
git checkout "$HAREC_REF"
40+
cp configs/linux.mk config.mk
41+
make -j$(nproc)
42+
sudo make install
43+
44+
- name: Install Hare
45+
run: |
46+
git clone https://git.sr.ht/~sircmpwn/hare
47+
cd hare
48+
git checkout "$HARE_REF"
49+
cp configs/linux.mk config.mk
50+
make -j$(nproc)
51+
sudo make install
52+
53+
- name: Install hare-sdl2
54+
run: |
55+
git clone https://git.sr.ht/~sircmpwn/hare-sdl2
56+
cd hare-sdl2
57+
git checkout "$HARE_SDL2_REF"
58+
cd ..
59+
sudo mkdir -p /usr/local/src/hare/third-party
60+
sudo cp -r hare-sdl2/sdl2 /usr/local/src/hare/third-party/
61+
62+
- name: Build hareboy
63+
run: hare build -lSDL2 -o hareboy .
64+
65+
- name: Package
66+
run: |
67+
VERSION=${GITHUB_REF_NAME}
68+
tar czf hareboy-${VERSION}-linux-x86_64.tar.gz hareboy
69+
70+
- name: Create release
71+
uses: softprops/action-gh-release@v2
72+
with:
73+
files: hareboy-*.tar.gz
74+
generate_release_notes: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
hareboy
2+
hare

0 commit comments

Comments
 (0)