summaryrefslogtreecommitdiff
path: root/games/yarntown/install.patch
blob: 7c0222c84876d1201b22ab45e748e7a825f402e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
From d335e5562c3b2d405a1b7c1b116a0f2333cd9389 Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Fri, 28 Aug 2020 09:45:43 -0700
Subject: [PATCH 1/4] Add a desktop file.

---
 yarntown.desktop | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 yarntown.desktop

diff --git a/yarntown.desktop b/yarntown.desktop
new file mode 100644
index 0000000..c2827d6
--- /dev/null
+++ b/yarntown.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Yarntown
+GenericName=Yarntown game for the Solarus engine
+Comment=Yarntown (2D hommage to Bloodborne)
+Exec=yarntown
+Terminal=false
+Type=Application
+Icon=yarntown
+Categories=Game;AdventureGame;
-- 
GitLab


From 959930c05781c13971945a81698a55e341771f06 Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Sat, 29 Aug 2020 13:47:39 -0700
Subject: [PATCH 2/4] Add a .gitignore.

---
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b37f35a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.solarus
+yarntown
-- 
GitLab


From ee5635b327b883486051d92be381a5202f0774ac Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Tue, 1 Sep 2020 07:00:47 -0700
Subject: [PATCH 3/4] Add the quest version to quest.dat.

---
 data/quest.dat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/quest.dat b/data/quest.dat
index f97b633..bf7ff4c 100644
--- a/data/quest.dat
+++ b/data/quest.dat
@@ -6,7 +6,7 @@ quest{
   long_description = [[
 ]],
   author = "Max Mraz",
-  quest_version = "",
+  quest_version = "1.0.6",
   release_date = "",
   website = "",
   normal_quest_size = "416x240",
-- 
GitLab


From 9bf2149bd137d14940ca451b1976f26f15b650d3 Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Sat, 29 Aug 2020 11:24:27 -0700
Subject: [PATCH 4/4] Add a install.sh posix script.

---
 INSTALL    |  68 ++++++++++++++++
 install.sh | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 293 insertions(+)
 create mode 100644 INSTALL
 create mode 100755 install.sh

diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..cc12b3d
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,68 @@
+install.sh is a POSIX sh script known to work with the following shells:
+
+  ash
+  dash
+  bash
+  ksh
+  loksh
+  mksh
+  pdksh
+  posh (0.14.1 or newer)
+  oksh
+  yash
+  zsh
+
+install.sh accepts the following arguments as targets:
+
+build - Generates the solarus.data archive and the executable script.
+clean - Removes the solarus.data archive and the executable script.
+install - Installs the solarus.data archive and executable script.
+install-assets - Installs the docs, icons and desktop file.
+uninstall - Uninstalls all installed files.
+
+The build, clean and install targets can customize the name of the data
+archive.
+
+  DATANAME - Name of the solarus data archive (data.solarus)
+
+Additionally the following arguments can be passed to the install
+and uninstall targets to configure the install paths.
+
+  PREFIX - Install path prefix (/usr/local)
+  BINDIR - Binary install directory (PREFIX/bin)
+  DOCDIR - Documentation install directory (PREFIX/share/doc)
+  MANDIR - Manpage install directory (PREFIX/share/man)
+  DATADIR - Read-only data install directory (DATAROOTDIR)
+  DATAROOTDIR -  Read-only data root install directory (PREFIX/share)
+  SYSCONFDIR - Read-only data install directory (PREFIX/etc)
+
+The configurable install directories can be either absolute or relative
+paths. If they are set as relative paths the value of PREFIX will be
+prepended to the install directory. For example if MANDIR is set to
+'man' man pages will be installed to '/usr/local/man/' instead of
+'/usr/local/share/man/'.
+
+By design install.sh will not use any set environment variables and all
+configuration must be passed explicitly as arguments.
+
+EXAMPLES
+
+  ./install.sh install PREFIX=/usr DESTDIR=/tmp
+
+      Installs to '/tmp/usr/'.
+
+  ./install.sh uninstall PREFIX=/usr DESTDIR=/tmp
+
+      Uninstalls from '/tmp/usr/'.
+
+  ./install.sh install DOCDIR=/usr/local/doc
+
+      Installs documentation to '/usr/local/doc/$PRGNAM-$VERSION'.
+
+  ./install.sh install MANDIR=man
+
+      Installs man pages to '$PREFIX/man/man1/'.
+
+  ./install.sh install SYSCONFDIR=/etc
+
+      Installs read-only data to '/etc/'.
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..9cc10da
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,225 @@
+#!/bin/sh
+# Install script for yarntown.
+
+# Copyright 2017-2020 orbea
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
+#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# IFS is <space><tab><newline>
+IFS=' 	
+'
+\unset -f command printf unalias : 2>/dev/null
+\unalias -a 2>/dev/null
+PATH="$(command -p getconf PATH):$PATH"
+LC_ALL=C; export LC_ALL
+
+set -euf
+
+die () {
+  ret="$1"; shift
+  case "$ret" in
+    : ) printf %s\\n "$@" >&2; return 0 ;;
+    0 ) printf %s\\n "$@" ;;
+    * ) printf %s\\n "$@" >&2 ;;
+  esac
+  exit "$ret"
+}
+
+case "${1:-}" in
+  install-assets ) INSTALL=4 ;;
+  clean ) INSTALL=3 ;;
+  build ) INSTALL=2 ;;
+  install ) INSTALL=1 ;;
+  uninstall ) INSTALL=0 ;;
+  '' ) die 1 'No install target.' ;;
+  * ) die 1 "No rule to install target '$1'." ;;
+esac
+
+cmd () {
+  print=
+  for command do
+    case "$command" in
+      -- ) : ;;
+      */* ) print="${print} '$command'" ;;
+      * ) print="${print} $command" ;;
+    esac
+  done
+  printf " %s\\n" "$print"
+  command -p "$@"
+}
+
+is_absolute () { case "$1" in /*) return 0 ;; *) return 1 ;; esac; }
+
+PREFIX=; BINDIR=; DATADIR=; DATANAME=; DATAROOTDIR=; DOCDIR=; MANDIR=
+SYSCONFDIR=; DESTDIR=
+
+CWD="$(pwd)"
+
+if [ "$0" != "${0%/*}" ]; then
+  SOURCE_DIR="$(cd -- "${0%/*}/" && pwd -P)"
+else
+  SOURCE_DIR="$(pwd -P)"
+fi
+
+quest_version="$(grep quest_version "$SOURCE_DIR"/data/quest.dat)"
+quest_version="${quest_version%\"*}"
+
+PRGNAM=yarntown
+VERSION="${quest_version#*\"}"
+
+shift
+
+install_args=
+
+while [ $# -gt 0 ]; do
+  arg="$1"; shift
+  case "${arg%%=*}" in
+    DATANAME|DESTDIR|PREFIX )
+      eval "${arg%%=*}=\"\${arg#*=}\""
+    ;;
+    BINDIR|DATADIR|DATAROOTDIR|DOCDIR|MANDIR|SYSCONFDIR )
+      install_args=1
+      eval "${arg%%=*}=\"\${arg#*=}\""
+    ;;
+    * )
+      die : "WARNING: Variable '${arg%%=*}' was not used by $PRGNAM."
+    ;;
+  esac
+done
+
+PREFIX="${PREFIX:-/usr/local}"
+BINDIR="${BINDIR:-${PREFIX}/bin}"
+DOCDIR="${DOCDIR:-${PREFIX}/share/doc}/$PRGNAM-$VERSION"
+MANDIR="${MANDIR:-${PREFIX}/share/man}"
+DATANAME="${DATANAME:-data.solarus}"
+DATAROOTDIR="${DATAROOTDIR:-${PREFIX}/share}"
+DATADIR="${DATADIR:-${DATAROOTDIR}}/solarus/$PRGNAM"
+SYSCONFDIR="${SYSCONFDIR:-${PREFIX}/etc}"
+DESTDIR="${DESTDIR:-}"
+
+is_absolute "$PREFIX" || PREFIX="$CWD/$PREFIX"
+
+if [ -n "$install_args" ]; then
+  for i in \$BINDIR \$DATADIR \$DATAROOTDIR \$DOCDIR \$MANDIR \$SYSCONFDIR; do
+    eval "dest=\"$i\""
+    is_absolute "${dest:?}" || eval "${i#*$}=\"\${PREFIX}/$i\""
+  done
+fi
+
+####################
+### Project Code ###
+####################
+
+build_bin () {
+  command -p rm -f -- "$CWD/$PRGNAM"
+  printf 'Generating %s script...\n' "$PRGNAM"
+  printf '#!/bin/sh\nsolarus-run %s "$@"\n' "$DATADIR" > "$CWD/$PRGNAM"
+}
+
+build_data () {
+  command -p rm -f -- "$CWD/$DATANAME"
+  printf 'Generating %s...\n' "$DATANAME"
+  (
+    cd -- "${SOURCE_DIR}"/data/
+    command -p find . -type f \( \
+      -name '*.spc' -o \
+      -name '*.ogg' -o \
+      -name '*.it'  -o \
+      -name '*.png' -o \
+      -name '*.dat' -o \
+      -name '*.lua' -o \
+      -name '*.ttf' -o \
+      -name '*.ttc' -o \
+      -name '*.fon' -o \
+      -name '*.glsl'   \
+    \) -exec zip -9 -q "$CWD/$DATANAME" {} +
+  )
+}
+
+icon_sizes='16 32 64 128 256 512 1024'
+
+case $INSTALL in
+  # install-assets
+  4 )
+    printf 'Installing assets...\n'
+    cmd mkdir -p -- "${DESTDIR}${DATAROOTDIR}/applications"
+    cmd mkdir -p -- "${DESTDIR}${DATAROOTDIR}/pixmaps"
+    cmd mkdir -p -- "${DESTDIR}${DOCDIR}"
+    cmd rm -f -- "${DESTDIR}${DOCDIR}/credits.txt"
+    cmd cp -- "${SOURCE_DIR}/credits.txt" "${DESTDIR}${DOCDIR}"
+    cmd rm -f -- "${DESTDIR}${DOCDIR}/readme.md"
+    cmd cp -- "${SOURCE_DIR}/readme.md" "${DESTDIR}${DOCDIR}"
+    cmd rm -f -- "${DESTDIR}${DATAROOTDIR}/applications/$PRGNAM.desktop"
+    cmd cp -- "${SOURCE_DIR}/$PRGNAM.desktop" \
+      "${DESTDIR}${DATAROOTDIR}/applications"
+    cmd rm -f -- "${DESTDIR}${DATAROOTDIR}/pixmaps/$PRGNAM.png"
+    cmd cp -- "${SOURCE_DIR}/data/logos/logo.png" \
+      "${DESTDIR}${DATAROOTDIR}/pixmaps/$PRGNAM.png"
+
+    eval "set -- $icon_sizes"
+    for icon do
+      icon_dir="${DESTDIR}${DATAROOTDIR}/icons/hicolor/${icon}x${icon}/apps"
+      cmd mkdir -p -- "$icon_dir"
+      cmd rm -f -- "$icon_dir/$PRGNAM.png"
+      cmd cp -- "${SOURCE_DIR}/medias/icon/icon_$icon.png" \
+        "$icon_dir/$PRGNAM.png"
+    done
+  ;;
+  # clean
+  3 )
+    printf 'Removing %s...\n' "$DATANAME"
+    cmd rm -f -- "$CWD/$DATANAME"
+    cmd rm -f -- "$CWD/$PRGNAM"
+  ;;
+  # build
+  2 )
+    build_data
+    build_bin
+  ;;
+  # install
+  1 )
+    [ -f "$CWD/$DATANAME" ] || build_data
+    [ -f "$CWD/$PRGNAM" ] || build_bin
+    printf 'Installing...\n'
+    cmd mkdir -p -- "${DESTDIR}${BINDIR}"
+    cmd mkdir -p -- "${DESTDIR}${DATADIR}"
+    cmd rm -f -- "${DESTDIR}${BINDIR}/$PRGNAM"
+    cmd cp -- "$CWD/$PRGNAM" "${DESTDIR}${BINDIR}"
+    cmd rm -f -- "${DESTDIR}${DATADIR}/$DATANAME"
+    cmd cp -- "$CWD/$DATANAME" "${DESTDIR}${DATADIR}"
+    cmd chmod 0755 -- "${DESTDIR}${BINDIR}/$PRGNAM"
+  ;;
+  # uninstall
+  0 )
+    printf 'Uninstalling...\n'
+    cmd rm -rf -- "${DESTDIR}${DOCDIR}"
+    cmd rm -rf -- "${DESTDIR}${DATADIR}"
+    cmd rm -f -- "${DESTDIR}${BINDIR}/$PRGNAM"
+    cmd rm -f -- "${DESTDIR}${DATAROOTDIR}/applications/$PRGNAM.desktop"
+    cmd rm -f -- "${DESTDIR}${DATAROOTDIR}/pixmaps/$PRGNAM.png"
+
+    eval "set -- $icon_sizes"
+    for icon do
+      icon_dir="${DESTDIR}${DATAROOTDIR}/icons/hicolor/${icon}x${icon}/apps"
+      cmd rm -f -- "$icon_dir/$PRGNAM.png"
+    done
+  ;;
+esac
+
+exit 0
-- 
GitLab