summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9804416aac9d172a8df9cbcaabf75e1a121edbc0 (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
# Maintainer: Trần Nam Tuấn <tuantran1632001@gmail.com>
# Contributor: Caltlgin Stsodaat <contact@fossdaily.xyz>
# Contributor: Lucas Saliés Brum <lucas@archlinux.com.br>
# Contributor: s3lph <aur-hsdquy@s3lph.me>

_pkgname='headsetcontrol'
pkgname="${_pkgname}-git"
pkgver=3.1.0.r55.g6611933
pkgrel=2
pkgdesc='Sidetone and Battery status for Logitech G930, G533, G633, G933 SteelSeries Arctis 7/PRO 2019 and Corsair VOID (Pro) in Linux and MacOSX'
arch=('x86_64')
url='https://github.com/Sapd/HeadsetControl'
license=('GPL-3.0-only')
depends=('hidapi')
makedepends=('cmake' 'git')
provides=(
    "${_pkgname}=${pkgver}"
    "lib${_pkgname}.a=${pkgver}"
    "lib${_pkgname}.so=${pkgver}"
)
conflicts=("${_pkgname}")
source=("${_pkgname}::git+${url}.git")
sha256sums=('SKIP')
options=(staticlibs)

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

build() {
    cd "${_pkgname}"

    # Change version to match PKGBUILD
    sed -i 's/COMMAND git describe --tags --dirty=-modified/COMMAND git describe --long --abbrev=7/' CMakeLists.txt

    export CXXFLAGS+=" -ffat-lto-objects"

    cmake -B build -S . \
      -DCMAKE_BUILD_TYPE='None' \
      -DCMAKE_INSTALL_PREFIX='/usr' \
      -DBUILD_SHARED_LIBRARY=ON \
      -Wno-dev

    cmake --build build
}

package() {
    cd "${_pkgname}"

    DESTDIR="$pkgdir" cmake --install build
    install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${_pkgname}"
    install -Dm644 license -t "${pkgdir}/usr/share/licenses/${_pkgname}"
}