summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2aa8b6d312f3f9333f703ad94148a18e414edd27 (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: pyamsoft <developer(dot)pyamsoft(at)gmail(dot)com>
##

_gitname=pstate-frequency
# shellcheck disable=SC2034
pkgname=pstate-frequency-git
# shellcheck disable=SC2034
pkgdesc="Easily control Intel p-state driver (git version)"
# shellcheck disable=SC2034
pkgver="3.18.0".r1091.7ff6ab5
# shellcheck disable=SC2034
pkgrel=1
# shellcheck disable=SC2034
arch=('i686' 'x86_64')
# shellcheck disable=SC2034
makedepends=('git')
# shellcheck disable=SC2034
depends=('coreutils' 'grep' 'awk')
# shellcheck disable=SC2034
optdepends=()
# shellcheck disable=SC2034
provides=('pstate-frequency')
# shellcheck disable=SC2034
conflicts=('pstate-frequency')
# shellcheck disable=SC2034
license=('GPL2')
url="https://github.com/pyamsoft/pstate-frequency.git"
# shellcheck disable=SC2034
backup=('etc/pstate-frequency.d/00-auto.plan'
  'etc/pstate-frequency.d/01-powersave.plan'
  'etc/pstate-frequency.d/02-balanced.plan'
  'etc/pstate-frequency.d/03-performance.plan'
  'etc/pstate-frequency.d/04-max.plan')

##
# The SHA256 is constantly changing since this is
# pulled from git so skip the verification check
##
# shellcheck disable=SC2034
source=(
  "${_gitname}::git+${url}#branch=main"
  "00-fix-prefix.patch")
# shellcheck disable=SC2034
sha256sums=('SKIP'
  'e5423df20c03ef19448a78a1ae39e630d90f63c6c4e0962296ad292665575f0d')

pkgver() {
  # shellcheck disable=SC2154
  cd "${srcdir}/${_gitname}" || {
    msg "Failed to cd into ${srcdir}/${_gitname}"
    return 1
  }

  printf "%s.r%s.%s" "$(awk -F '=' '{ if (/^readonly __VERSION=/) { print $2 } }' "${_gitname}")" \
    "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  # shellcheck disable=SC2154
  cd "${srcdir}/${_gitname}" || {
    msg "Failed to cd into ${srcdir}/${_gitname}"
    return 1
  }

  # Apply patches
  patch -p1 -i "${srcdir}/00-fix-prefix.patch"

  # Disabled by default to conform to AUR packaging
  # best practices. It is highly recommended that you
  # enable the line to allow for editing the config.mk file
  #
  # make DESTDIR="${pkgdir}" edit
}

package() {
  # shellcheck disable=SC2154
  cd "${srcdir}/${_gitname}" || {
    msg "Failed to cd into ${srcdir}/${_gitname}"
    return 1
  }

  # shellcheck disable=SC2154
  make DESTDIR="${pkgdir}" install
}