summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 71d657791d24452f1a609ca27633ff1941515032 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Maintainer:  Marcell Meszaros < marcell.meszaros AT runbox.eu >

pkgname='qbittorrent-enhanced-qt5-git'
pkgver=4.4.2.10.r3.g780ad2c06
pkgrel=2
pkgdesc='Bittorrent client using Qt5 and libtorrent-rasterbar, Enhanced Edition mod'
arch=('arm' 'armv6h' 'armv7h' 'aarch64' 'i686' 'x86_64')
url='https://github.com/c0re100/qBittorrent-Enhanced-Edition'
license=('custom:GPL2_with_OpenSSL_exception')
depends=('dbus'
         'gcc-libs'
         'glibc'
         'hicolor-icon-theme'
         'libtorrent-rasterbar'
         'openssl'
         'qt5-base'
         'zlib')
makedepends=('boost'
             'cmake'
             'ninja'
             'qt5-svg'
             'qt5-tools')
optdepends=('python: needed for torrent search tab')
provides=('qbittorrent'
          'qbittorrent-enhanced'
          'qbittorrent-enhanced-qt5'
          'qbittorrent-qt5')
conflicts=('qbittorrent'
           'qbittorrent-dark-git'
           'qbittorrent-enhanced'
           'qbittorrent-enhanced-git'
           'qbittorrent-enhanced-nox'
           'qbittorrent-enhanced-nox-git'
           'qbittorrent-enhanced-qt5'
           'qbittorrent-enhanced-ua'
           'qbittorrent-git'
           'qbittorrent-nox-git'
           'qbittorrent-qt5')
_srcrepodir="${pkgname%-qt5-git*}"
source=("${_srcrepodir}::git+${url}.git#branch=v4_4_x")
sha256sums=('SKIP')

pkgver() {
  cd "${_srcrepodir}"

# Generate git 'release-' tag based version.
  git describe --long --tags --match='release-*' | sed 's/^release-//;s/^\([0-9][0-9.]*\)-\([a-zA-Z]\+\)/\1\2/;s/\([0-9]\+-g\)/r\1/;s/-/./g'
}

prepare() {
  printf 'Checking if ccache is enabled for makepkg... '

  if check_buildoption "ccache" "y"; then
    printf 'yes\n'
    printf 'Enabling C++ ccache for CMake...\n'
    export CMAKE_CXX_COMPILER_LAUNCHER='ccache'
  else
    printf 'no\n'
  fi

  printf 'Configuring build with CMake...\n\n'
  export CXXFLAGS+=" ${CPPFLAGS}" # CMake ignores CPPFLAGS

  cmake -S "${_srcrepodir}" \
    -B 'build' \
    -G 'Ninja' \
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -DQT6='OFF' \
    -DCMAKE_BUILD_TYPE='RelWithDebInfo' \
    -DCMAKE_EXE_LINKER_FLAGS_INIT="${LDFLAGS}" \
    -DCMAKE_SHARED_LINKER_FLAGS_INIT="${LDFLAGS}" \
    -DCMAKE_MODULE_LINKER_FLAGS_INIT="${LDFLAGS}" \
    -DVERBOSE_CONFIGURE='ON'
}

build() {
  printf 'Building with CMake...\n\n'
  cmake --build 'build'
}

package() {
  printf 'Installing with CMake...\n\n'
  DESTDIR="${pkgdir}" cmake --install 'build'
  install -Dm644 "${_srcrepodir}/COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}