summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 01d41cf5bada82877ba80de6fffe0c1251107fbb (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:
# Contributor: nm10923 https://nm10923.xyz/contact

_pkgname="sdl3_ttf"
pkgname="$_pkgname-git"
pkgver=3.1.0.r7.g3d7b6ef
pkgrel=1
pkgdesc="Support for TrueType font files with Simple Directmedia Layer (Version 3)"
url="https://github.com/libsdl-org/SDL_ttf"
license=('Zlib')
arch=('x86_64')

depends=(
  'sdl3'
  'freetype2'
  'harfbuzz'
)
makedepends=(
  'cmake'
  'git'
  'ninja'
)

provides=(
  "$_pkgname=${pkgver%.g*}"
  "libSDL3_ttf.so"
)
conflicts=("$_pkgname")

_pkgsrc="SDL_ttf"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 \
    | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  local _cmake_options=(
    -B build
    -S "$_pkgsrc"
    -G Ninja
    -DCMAKE_BUILD_TYPE=None
    -DCMAKE_INSTALL_PREFIX='/usr'
    -DSDLTTF_SAMPLES=OFF
    -Wno-dev
  )

  cmake "${_cmake_options[@]}"
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 "$_pkgsrc/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}