summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3f8abbeb8a5c3bcf613a11663dd90895e3df9c77 (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
59
60
# Maintainer: yjmthu <yjmthu@gmail.com>
# Maintainer: taotieren <admin@taotieren.com>

pkgname=neobox-git
pkgver=2.4.3.r6.g80fd723
pkgrel=1
pkgdesc="采用 C++ 20 编写的一个插件管理工具,可以安装网速悬浮窗等插件。"
arch=('x86_64')
url="https://github.com/yjmthu/Neobox"
license=('MIT')
provides=(${pkgname%-git})
conflicts=(${pkgname%-git})
depends=(curl
  qt6-tools)
makedepends=(cmake
  git
  ninja)
backup=()
options=('!strip')
source=("${pkgname}::git+${url}.git")
sha256sums=('SKIP')

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

prepare() {
  cd "${srcdir}/${pkgname}"
  git submodule update --init --recursive
}

build() {
  cd "${srcdir}/${pkgname}/"
  cmake -S . \
      -D CMAKE_BUILD_TYPE=None \
      -D CMAKE_INSTALL_PREFIX=/usr \
      -D CMAKE_INSTALL_LIBDIR=lib \
      -D CMAKE_INSTALL_LIBEXECDIR=lib \
      -B build \
      -G Ninja

  ninja -C build
}

package() {
  DESTDIR="${pkgdir}" ninja -C "${srcdir}"/$pkgname/build install

  cd "${srcdir}/${pkgname}/pluginmgr/desktop"
  install -Dm644 \
      "neobox.desktop" \
      "$pkgdir/usr/share/applications/${pkgname%-git}.desktop"
# icon
  local _icon
  for _icon in 16 32 64 128; do
      install -Dm0644 ${pkgname%-git}${_icon}x${_icon}.png \
                      ${pkgdir}/usr/share/icons/hicolor/${_icon}x${_icon}/apps/${pkgname%-git}.png
  done
}