summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b7547660848384c30117dd024af1bdd343208880 (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
# Maintainer: Tmplt <tmplt@dragons.rocks>
_pkgname=bookwyrm
pkgname="${_pkgname}-git"
pkgver=v0.5.0.r0.g92cd41b
pkgrel=1
pkgdesc="traverse various sources, find ebooks/textbooks/papers, and download them "
arch=("x86_64")
url="https://github.com/Tmplt/bookwyrm"
license=("MIT")
depends=("curl" "python")
makedepends=("cmake" "git")
provides=("bookwyrm")
conflicts=("bookwyrm")
source=("${_pkgname}::git+${url}.git")
md5sums=("SKIP")

pkgver() {
  git -C "${_pkgname}" describe --long --tags | sed "s/-/.r/;s/-/./g"
}

prepare() {
  git -C "${_pkgname}" submodule update --init --recursive
  mkdir -p "${_pkgname}/build"

  # Comment out `find_package(Curses REQUIRED)` for now
  sed -i 's/find_package(Curses REQUIRED)/#find_package(Curses REQUIRED)/' "${_pkgname}/src/tui/CMakeLists.txt"
  sed -i 's/${CURSES_LIBRARIES}/ncursesw/' "${_pkgname}/src/tui/CMakeLists.txt"

  # ad-hoc fix some install paths
  sed -i 's/usr\/bin/bin/' "${_pkgname}/src/CMakeLists.txt"
  sed -i 's/usr\/lib/lib/' "${_pkgname}/src/core/bindings/CMakeLists.txt"
}

build() {
  cd "${_pkgname}/build" || exit 1
  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
  cmake --build .
}

package() {
  cmake --build "${_pkgname}/build" --target install -- DESTDIR="${pkgdir}"
}