Skip to content

Commit 8aaf376

Browse files
committedNov 17, 2022
Update tooling and source
1 parent 5c9a46d commit 8aaf376

File tree

15 files changed

+776
-16
lines changed

15 files changed

+776
-16
lines changed
 

‎.dockerignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Icon?
2+
*.inform/Build
3+
*.inform/Index
4+
*.inform/Metadata.iFiction
5+
*.inform/Release.blurb
6+
*.inform/manifest.plist
7+
*.inform/notes.rtf
8+
*.materials/Release
9+
gameinfo.dbg

‎.github/workflows/main.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: main
2+
on: [push]
3+
jobs:
4+
build-and-test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Build Docker image
9+
run: docker build . --tag the-archive-public
10+
- name: Run tests
11+
run: docker run --rm the-archive-public

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ Icon?
88
*.inform/notes.rtf
99
*.materials/Release
1010
gameinfo.dbg
11+
*.glksave
12+
*.glksaverestore

‎.vscode/settings.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"spellright.language": [
3+
"en"
4+
],
5+
"spellright.documentTypes": [
6+
"markdown",
7+
"latex",
8+
"plaintext",
9+
"inform7"
10+
],
11+
"spellright.parserByClass": {
12+
"inform7": {
13+
"parser": "plain"
14+
}
15+
}
16+
}

‎Dockerfile

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM ubuntu as base
2+
RUN apt-get update && \
3+
apt-get install -y curl
4+
5+
FROM base as glulxe
6+
RUN apt-get install -y build-essential unzip
7+
8+
WORKDIR /build/
9+
10+
RUN curl -L -q https://github.com/erkyrath/cheapglk/archive/master.zip >cheapglk.zip && \
11+
unzip cheapglk.zip && \
12+
mv cheapglk-master cheapglk && \
13+
cd cheapglk && \
14+
make -j8 && \
15+
cd /build
16+
17+
RUN curl -L -q https://github.com/erkyrath/glulxe/archive/master.zip >glulxe.zip && \
18+
unzip glulxe.zip && \
19+
mv glulxe-master glulxe && \
20+
cd glulxe && \
21+
make -j8 && \
22+
cd /build
23+
24+
FROM base as final
25+
COPY --from=glulxe /build/glulxe/glulxe /usr/local/bin/dglulxe
26+
27+
WORKDIR /tmp/
28+
RUN curl -q -O http://emshort.com/inform-app-archive/6M62/I7_6M62_Linux_all.tar.gz && \
29+
tar -zxf I7_6M62_Linux_all.tar.gz && \
30+
cd inform7-6M62 && \
31+
./install-inform7.sh --prefix /usr/local && \
32+
cd /tmp && \
33+
rm -rf I7_6M62_Linux_all.tar.gz inform7-6M62
34+
35+
WORKDIR /root/
36+
37+
RUN mkdir -p /root/Library/Inform && \
38+
curl -q -L -O https://github.com/i7/archive/archive/master.tar.gz && \
39+
tar -zxf master.tar.gz && \
40+
mv archive-master /root/Library/Inform/Extensions && \
41+
rm -rf master.zip archive-master
42+
43+
COPY the-archive.inform /root/the-archive.inform
44+
COPY build ./
45+
RUN RELEASE=1 /root/build
46+
47+
COPY test /root/
48+
COPY tests/ /root/tests/
49+
CMD /root/test

‎LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Ian Langworth
3+
Copyright (c) 2022 Ian Langworth
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

‎build

+17-11
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,34 @@
22

33
set -eo pipefail
44

5-
app="/Applications/Inform.app"
6-
bin="$app/Contents/MacOS"
7-
lib="$HOME/Library/Inform"
8-
proj="$(dirname $0)/The Archive.inform"
5+
if [ "$(uname -s)" = "Darwin" ]; then
6+
app="/Applications/Inform.app"
7+
bin="$app/Contents/MacOS"
8+
lib="$HOME/Library/Inform"
9+
share="$app/Contents/Resources"
10+
else
11+
bin="/usr/local/share/inform7/Compilers"
12+
lib="$HOME/Library/Inform"
13+
share="/usr/local/share/inform7"
14+
fi
15+
16+
proj="$(dirname $0)/the-archive.inform"
917

1018
if [ -n "$RELEASE" ]; then
11-
i6opts="-~kE2~S~Dwv8"
12-
format="z8"
19+
i6opts="-~kE2~S~Dwv8G"
1320
else
1421
i6opts="-kE2SDwG"
15-
format="ulx"
1622
fi
1723

1824
$bin/ni \
19-
-internal "$app/Contents/Resources/Internal" \
25+
-internal "$share/Internal" \
2026
-external "$lib" \
2127
-project "$proj" \
22-
-format=$format
28+
-format=ulx
2329

2430
$bin/inform6 \
2531
$i6opts \
26-
"+include_path=$app/Contents/Resources/Library/6.11,.,../Source" \
32+
"+include_path=$share/Library/6.11,.,../Source" \
2733
"$proj/Build/auto.inf" \
28-
"$proj/Build/output.$format"
34+
"$proj/Build/output.ulx"
2935

‎push

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash -e
2+
3+
scp output.ulx langworth.com:data/stories/archive.ulx

‎run

+16-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22

33
set -eo pipefail
44

5-
glulxe "$(dirname $0)/The Archive.inform/Build/output.ulx" <<EOF
6-
look door
7-
showme door
8-
showme keypad
5+
clear
6+
7+
rm -f game.glksaverestore
8+
9+
glulxe "$(dirname $0)/the-archive.inform/Build/output.ulx" <<EOF &
10+
game
11+
look
12+
go north
13+
go west
14+
go door
915
go south
1016
EOF
17+
18+
# glulxe uses curses, which uses 100% CPU while it polls for input. :(
19+
pid=$!
20+
trap "kill $pid" exit
21+
sleep 1
22+

‎test

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
set -eo pipefail
4+
cd "$(dirname $0)"
5+
6+
if ! which dglulxe &>/dev/null ; then
7+
echo "dglulxe not found. Please compile glulxe with cheapglk and put it in"
8+
echo "the PATH somewhere as dglulxe."
9+
exit 1
10+
fi
11+
12+
echo "Building story..."
13+
RELEASE=1 ./build >/dev/null
14+
15+
tmp="$(mktemp)"
16+
trap "{ rm -f $tmp; }" EXIT
17+
18+
src=the-archive.inform/Source/story.ni
19+
out=the-archive.inform/Build/output.ulx
20+
21+
exitcode=0
22+
23+
for input in tests/*.in ; do
24+
output="${input%.*}.out"
25+
dglulxe $out <$input >$tmp
26+
if [ "$1" = "-s" ]; then
27+
cp $tmp $output
28+
fi
29+
if diff -q $output $tmp &>/dev/null ; then
30+
echo "OK - $output"
31+
else
32+
echo "FAIL - $output"
33+
if [ "$1" = "-d" ]; then
34+
diff -u $output $tmp
35+
fi
36+
exitcode=1
37+
fi
38+
done
39+
40+
exit $exitcode

‎tests/outside.in

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
game
2+
x grass
3+
eat grass
4+
go in
5+
go inside
6+
look door
7+
unlock door
8+
look keypad
9+
use keypad
10+
go north
11+
go east
12+
x wall
13+
x crack
14+
go south
15+
enter 1234
16+
scrape wall
17+
look debris
18+
search debris
19+
take pile
20+
take chips
21+
look chips
22+
i
23+
look debris
24+
look paper
25+
take paper
26+
turn paper
27+
i
28+
go west
29+
look keypad
30+
look door
31+
press
32+
press keypad
33+
press keypad 1
34+
press 1
35+
press 1234
36+
tap
37+
tap keypad
38+
tap 1
39+
tap 1234
40+
enter x
41+
enter ABC
42+
enter A123
43+
enter 0000
44+
unlock door
45+
go door
46+
go out
47+
go in

‎tests/outside.out

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
Welcome to the Cheap Glk Implementation, library version 1.0.6.
2+
3+
4+
5+
6+
WELCOME
7+
You have connected to Ian Langworth's archive.
8+
9+
Enter GAME to continue.
10+
11+
Other valid commands: LINKEDIN GITHUB DOTFILES BLOG TWITTER EMAIL ABOUT SOURCE LINKS PERLBOOK GPGKEY HELP
12+
13+
Hint: Page Up and Page Down scroll when on desktop.
14+
15+
Good luck!
16+
17+
>WEST SIDE
18+
You are standing on the west side of a small, concrete building. Surrounding the building is a field of lush, green grass that meets the horizon in every direction under a clear blue sky. The entrance to the building is bare. A steel door is recessed into a square concrete building. You can go around the building to the north and south.
19+
20+
>The lush, green grass under a clear sky reminds you of the Windows 95 wallpaper.
21+
22+
>That's plainly inedible.
23+
24+
>(first opening the steel door)
25+
It seems to be locked.
26+
27+
>(first opening the steel door)
28+
It seems to be locked.
29+
30+
>An old, tarnished, reinforced steel door appears to be the only way into the building. On the door is a numeric keypad.
31+
32+
>The door appears to be locked with a keypad.
33+
34+
>A brushed metal numeric keypad with buttons. You guess that it controls the steel door.
35+
36+
>Try entering a number on the keypad, like ENTER 1234
37+
>
38+
NORTH SIDE
39+
The north side of the building is featureless and unremarkable. You can go east and west.
40+
41+
>
42+
EAST SIDE
43+
The east side of the building is as plain as the rest. The concrete wall is cracked and has clearly been here for some time. You can go north and south.
44+
45+
>A single-story, aged, crumbling concrete building that appears to have been once been painted white. It stands as a solitary cube in the green grassy field.
46+
47+
>A long, thin crack has appeared in the concrete, probably from the building settling over time.
48+
49+
>
50+
SOUTH SIDE
51+
The south side of the building is featureless other than a few cracked paint chips where the concrete was painted white a long time ago. You can go east and west.
52+
53+
You can see a pile of debris and some paint chips here.
54+
>There is no keypad here on which you can enter a code.
55+
56+
>That's not a verb I recognize.
57+
58+
>You rummage through the debris. It's mostly paint chips but you also find a scrap of paper.
59+
60+
>You find nothing of interest.
61+
62+
>That's fixed in place.
63+
64+
>Taken.
65+
66+
>You see nothing special about the paint chips.
67+
68+
>You're carrying some paint chips.
69+
70+
>Bits of concrete and paint appear to have collected at the base of the wall.
71+
72+
>The piece of paper is a torn corner of a larger document. You can make out the numbers "000" but the paper has rotted away where the last number was written.
73+
74+
>Taken.
75+
76+
>The other side of the scrap of paper is blank.
77+
78+
>You're carrying a scrap of paper and some paint chips.
79+
80+
>
81+
WEST SIDE
82+
You are standing on the west side of a small, concrete building. Surrounding the building is a field of lush, green grass that meets the horizon in every direction under a clear blue sky. The entrance to the building is bare. A steel door is recessed into a square concrete building. You can go around the building to the north and south.
83+
84+
>A brushed metal numeric keypad with buttons. You guess that it controls the steel door.
85+
86+
>An old, tarnished, reinforced steel door appears to be the only way into the building. On the door is a numeric keypad.
87+
88+
>What do you want to press?
89+
90+
>Try entering a number on the keypad, like ENTER 1234
91+
>Nothing happens for a few moments, and then the keypad emits a negative-sounding tone. Maybe the code needs more numbers?
92+
93+
>Nothing happens for a few moments, and then the keypad emits a negative-sounding tone. Maybe the code needs more numbers?
94+
95+
>The keypad beeps negatively, but other than that nothing happens.
96+
97+
>What do you want to tap?
98+
99+
>Try entering a number on the keypad, like ENTER 1234
100+
>Nothing happens for a few moments, and then the keypad emits a negative-sounding tone. Maybe the code needs more numbers?
101+
102+
>The keypad beeps negatively, but other than that nothing happens.
103+
104+
>The keypad only has numbers on the buttons.
105+
106+
>The keypad only has numbers on the buttons.
107+
108+
>The keypad only has numbers on the buttons.
109+
110+
>The keypad chirps excitedly. From behind the door you hear a large whirring sound followed by a series of metallic clanks. The whirring stops and the steel door opens slowly.
111+
112+
>It is already unlocked.
113+
114+
>
115+
UPPER STAIRCASE
116+
As you enter the small building, a fluorescent light flickers to life and reveals bare, unfinished concrete walls. In the center of the room an industrial-looking spiral staircase goes down into darkness.
117+
118+
>
119+
WEST SIDE
120+
You are standing on the west side of a small, concrete building. Surrounding the building is a field of lush, green grass that meets the horizon in every direction under a clear blue sky. The entrance to the building is bare. A steel door is recessed into a square concrete building. You can go around the building to the north and south.
121+
122+
>
123+
UPPER STAIRCASE
124+
As you enter the small building, a fluorescent light flickers to life and reveals bare, unfinished concrete walls. In the center of the room an industrial-looking spiral staircase goes down into darkness.
125+
126+
>
127+
<end of input>

‎the-archive.inform/Settings.plist

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IFCompilerOptions</key>
6+
<dict>
7+
<key>IFSettingNaturalInform</key>
8+
<true/>
9+
</dict>
10+
<key>IFCompilerVersionSettings</key>
11+
<dict/>
12+
<key>IFI7OutputSettings</key>
13+
<dict>
14+
<key>IFSettingCreateBlorb</key>
15+
<false/>
16+
</dict>
17+
<key>IFLibrarySettings</key>
18+
<dict>
19+
<key>IFSettingLibraryToUse</key>
20+
<string>Natural</string>
21+
</dict>
22+
<key>IFMiscSettings</key>
23+
<dict>
24+
<key>IFSettingInfix</key>
25+
<false/>
26+
<key>IFSettingTestingTabHelpShown</key>
27+
<true/>
28+
<key>IFSettingTestingTabShownCount</key>
29+
<integer>11</integer>
30+
</dict>
31+
<key>IFOutputSettings</key>
32+
<dict>
33+
<key>IFSettingCreateBlorb</key>
34+
<false/>
35+
<key>IFSettingNobbleRng</key>
36+
<false/>
37+
<key>IFSettingZCodeVersion</key>
38+
<integer>256</integer>
39+
</dict>
40+
<key>IFRandomSettings</key>
41+
<dict/>
42+
</dict>
43+
</plist>

‎the-archive.inform/Source/story.ni

+394
Large diffs are not rendered by default.

‎the-archive.inform/uuid.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ffa5f95e-6f58-4040-96c2-31e37871bdd2

0 commit comments

Comments
 (0)
Please sign in to comment.