Skip to content

Instantly share code, notes, and snippets.

@nmlgc
Last active January 7, 2025 14:01
Show Gist options
  • Save nmlgc/798d23695e7bd93583652dbbd62a8375 to your computer and use it in GitHub Desktop.
Save nmlgc/798d23695e7bd93583652dbbd62a8375 to your computer and use it in GitHub Desktop.
Shuusou Gyoku Linux port Arch Linux PKGBUILD preview
# Maintainer: Nmlgc <[email protected]>
# I'm not happy with the font situation:
#
# • Preferably you'd want to install MS Gothic because that's what the original
# game used. But it's nonfree and you'd either have to copy it from a real
# Windows system or use one of the various semi-automated AUR packages that
# download the font from somewhere:
#
# https://aur.archlinux.org/packages?O=0&SeB=nd&K=ttf+win+japanese&outdated=&SB=p&SO=d&PP=250&submit=Go
#
# • If you don't want to go to these lengths, you'd want `ttf-ipa-mona` from
# the AUR. This font is a free metric-compatible alternative to MS Gothic and
# contains the 7×14 and 8×16 bitmap fonts that are essential for the game's
# text rendering to look at all acceptable.
#
# You do want to install one or the other, but probably not both at the same
# time. PKGBUILDs can't express such a relation, and especially not if both
# solutions are part of the AUR. So I've put both of them into the `optdepends`
# list, and only made the package depend on the bare minimum `ttf-font`
# meta-package so that it would render *any* text at all.
pkgname=seihou-shuusou-gyoku
pkgver=P0303
pkgrel=1
pkgdesc='First game of the Seihou project; ReC98 source port, engine only'
arch=('x86_64' 'i686')
url='https://github.com/nmlgc/ssg'
license=('MIT')
makedepends=('clang>=18.1.8' 'git' 'jq' 'pkg-config' 'tup')
depends=('libblake3' 'libc++' 'libogg' 'libvorbis' 'pango' 'sdl2' 'ttf-font')
optdepends=(
"ttf-ipa-mona: Free Japanese bitmap font, metric-compatible with the original game's MS Gothic"
"ttf-ms-win11-auto-japanese: Extracts MS Gothic from a Windows 11 ISO"
"ttf-ms-win10-cdn-japanese: Downloads MS Gothic from IPFS"
)
source=("git+https://github.com/nmlgc/ssg.git#branch=linux")
b2sums=('SKIP')
_binary_fn='GIAN07'
_skel=/usr/share/$pkgname/skel/
build() {
cd "$srcdir/ssg"
# Unconditionally updating without a preceding `git submodule init` does
# the right thing in all cases:
# • For the initial package build, it does nothing, leaving shallow and
# sparse submodule initialization to `build.sh`.
# • On subsequent package builds, it checks out the correct commits of all
# registered submodules. This bypasses the warning in `build.sh`, but
# matches `makepkg`'s unconditional checkout of the main repo.
git submodule update
# `-Wp,-D_FORTIFY_SOURCE=3` currently clashes with the std.compat module:
#
# https://github.com/llvm/llvm-project/issues/121709
CFLAGS="${CFLAGS//-Wp,-D_FORTIFY_SOURCE=3/} -DPATH_SKELETON=$_skel" ./build.sh "bin/$_binary_fn"
}
package() {
install -Dm755 "$srcdir/ssg/bin/$_binary_fn" -t "$pkgdir/usr/bin/"
install -Dm755 "$srcdir/ssg/bin/bgm/Folder structure.png" -t "$pkgdir/$_skel/bgm/"
install -Dm644 "$srcdir/ssg/bin/net.nmlgc.rec98.sh01.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
install -Dm644 "$srcdir/ssg/art/VIVIT_128.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/net.nmlgc.rec98.sh01.png"
install -Dm644 "$srcdir/ssg/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment