summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fa0daa0cd4ff21eedd7be4dbd0fe8d0b06274581 (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
# Maintainer: asyync1024 <asyync1024 at proton dot me>
# Contributor: yubimusubi <possum plus aur at possum dot cc>

_reponame=3dstool
pkgname=$_reponame-git
pkgver=1.2.6.r15.g3771ae96
pkgrel=1
epoch=1
pkgdesc="An all-in-one tool for extracting/creating 3ds roms (git)"
arch=('x86_64')
url="https://github.com/dnasdw/$_reponame"
license=('MIT')
depends=('glibc' 'curl' 'openssl')
makedepends=('cmake' 'git')
source=(
  "git+${url}.git"
  "$_reponame-paths.patch"
)
b2sums=('SKIP'
  '226f75f5154d849aec1816064aa5d87db0e41c07d02edb85df5b2b397172a30b32603bccfdfa09a5431f9fbc12fcbbd9a5baccf6d82523d9253a430af0432108')
provides=("$_reponame")
conflicts=("$_reponame")

pkgver() {
  cd "$_reponame"
  git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g;s/v//g'
}

prepare() {
  patch -Np1 -i "../$_reponame-paths.patch" -d "$_reponame"
}

build() {
  cd "$_reponame"

  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE='Release'
    -D USE_DEP=OFF
    -D CMAKE_SKIP_RPATH=ON
    -D CMAKE_BUILD_WITH_INSTALL_RPATH=OFF
    -D CMAKE_POLICY_VERSION_MINIMUM=3.5
  )

  cmake "${cmake_options[@]}"

  cmake --build build
}

package() {
  cd "$_reponame"

  install -Dm755 "bin/Release/$_reponame" -t "$pkgdir/usr/bin"
  install -Dm644 "bin/ignore_$_reponame.txt" -t "$pkgdir/usr/share/$_reponame"
  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname"
}

# vim: ts=2 sw=2 et: