makedeb


zelda-alttd-alpha-git 0.r9.9b842a4-1


!!!UNFINISHED!!! The Legend of Zelda: A Link to the Dream - Remake of The Legend of Zelda: Link's Awakening !!!UNFINISHED!!!

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for zelda-alttd-alpha-git.

# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
# Contributor: Qontinuum (AUR) <qontinuum.dev@protonmail.ch>

pkgname=zelda-alttd-alpha-git
_name="The Legend of Zelda: A Link to the Dream"
pkgver=0.r9.9b842a4
pkgrel=1
pkgdesc="!!!UNFINISHED!!! The Legend of Zelda: A Link to the Dream - Remake of The Legend of Zelda: Link's Awakening !!!UNFINISHED!!!"
arch=('all')
url='https://www.solarus-games.org/en/games/the-legend-of-zelda-a-link-to-the-dream'
license=('custom')
depends=('solarus>=1.6.0')
makedepends=('cmake' 'git' 'zip')
provides=('zelda-alttd-git')
conflicts=('zelda-alttd-git')
source=("$pkgname::git+https://gitlab.com/zeldaforce/zelda-alttd.git"
        "alttd-english::git+https://gitlab.com/grawprog/alttd-english.git")
b2sums=('SKIP'
        'SKIP')

pkgver() {
  cd "$pkgname"
  printf "0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  sed -i 's/set(quest_name "zelda-alttd")/set(quest_name "zelda-alttd-alpha-git")/' "$pkgname/CMakeLists.txt"
  cp -R "$srcdir/alttd-english/languages/en/" "$srcdir/$pkgname/data/languages/"
  sed -i 's!language{ id = "fr", description = "Français" }!language{ id = "en", description = "English" }\nlanguage{ id = "fr", description = "Français" }!' "$srcdir/$pkgname/data/project_db.dat"
}

build() {
  cd "$pkgname"
  cmake -DCMAKE_INSTALL_PREFIX='/usr' .
  make

export _WRAPPER="#!/bin/sh
exec solarus-run /usr/share/games/solarus/$pkgname/data.solarus \"\$@\""

export _DESKTOPFILE="[Desktop Entry]
Version=1.0
Type=Application
Name=$_name
Comment=$pkgdesc
Exec=$pkgname
Icon=$pkgname
Terminal=false
StartupNotify=false
Categories=Game;ActionGame;"
}

package() {
  # descktop file
  install -m644 -d "$pkgdir/usr/share/applications"
  echo "$_DESKTOPFILE" > "$pkgdir/usr/share/applications/$pkgname.desktop"
  # pixmap
  install -Dm644 "$srcdir/$pkgname/data/logos/icon_128.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
  # doc
  install -Dm644 "$srcdir/$pkgname/changelog.md" "${pkgdir}/usr/share/doc/${pkgname}/changelog"
  install -Dm644 "$srcdir/$pkgname/readme.md" "${pkgdir}/usr/share/doc/${pkgname}/readme"
  gzip "${pkgdir}/usr/share/doc/${pkgname}/changelog"
  # install
  cd "$pkgname"
  make DESTDIR="$pkgdir/" install
  # adjustments
  install -d "${pkgdir}/usr/share/games"
  mv -T  "${pkgdir}/usr/share/solarus" "${pkgdir}/usr/share/games/solarus"
  mv -T "${pkgdir}/usr/bin" "${pkgdir}/usr/games"
  echo "$_WRAPPER" > "$pkgdir/usr/games/$pkgname"
  chmod 755 "$pkgdir/usr/games/$pkgname"
}