summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 31f2b7aa60aea3ddf70db7a50710f0433b3fd87a (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: Patrick Gelvin <patrick@gelvin.dev>
pkgname="rcalc"
pkgver=v2.0.0
pkgrel=1
pkgdesc="A lightweight RPN calculator"
arch=("x86_64")
url="https://github.com/gelvinp/rcalc"
license=('MIT')
depends=('glfw>=3.0.0' 'freetype2>=2.0.0' "libxcb" "dbus")
makedepends=("python>=3.11.0" "scons>=4.5.0" "pkg-config" "git")
_tag=5a27d2fbcef4f9e706c847f4960f409839ea7a64 # git rev-parse "tag-name"
source=(git+https://github.com/gelvinp/rcalc#tag=$_tag?signed
        git+https://github.com/glfw/glfw
        git+https://gitlab.freedesktop.org/freetype/freetype
        git+https://github.com/ArthurSonzogni/FTXUI
        git+https://github.com/dacap/clip
        git+https://github.com/snitch-org/snitch)
sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP')

pkgver() {
  cd "$pkgname"
  git describe
}

prepare() {
  cd "$pkgname"
  git submodule init

  git config submodule.modules/glfw/upstream.url "$srcdir/glfw"
  git config submodule.modules/freetype/upstream.url "$srcdir/freetype"
  git config submodule.modules/ftxui/upstream.url "$srcdir/FTXUI"
  git config submodule.modules/clip/upstream.url "$srcdir/clip"
  git config submodule.modules/snitch/upstream.url "$srcdir/snitch"

  git -c protocol.file.allow=always submodule update
}

build() {
  cd "$pkgname"

  GPERF_CMD=""

  if command -v gperf &> /dev/null
  then
    GPERF_CMD="gperf_path=$(which gperf)"
  fi

  BUILD_NAME="pkgbuild" VERSION_STATUS="stable" scons target=release default_renderer=terminal $GPERF_CMD
}

package() {
  cd "$pkgname"

  install -Dm755 bin/rcalc.linux.release.$CARCH $pkgdir/usr/bin/rcalc
  install -Dm644 LICENSE.md $pkgdir/usr/share/licenses/rcalc/LICENSE.md
  install -Dm644 misc/rcalc.desktop $pkgdir/usr/share/applications/rcalc.desktop
  install -Dm644 icon.svg $pkgdir/usr/share/pixmaps/rcalc.svg
}