summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c096492ae38a16e852575ee188dd92ec49cc4724 (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
# Maintainer: Greg Hurrell <greg@hurrell.net>
pkgname=clipper-git
pkgver=2.0.0_20_g8984a2e
pkgrel=2
pkgdesc="Clipboard access for local and remote tmux sessions"
arch=(x86_64)
url="https://github.com/wincent/clipper"
license=('BSD')
depends=('glibc')
makedepends=(
  'git'
  'go'
)
optdepends=('xclip: access to X11 clipboard')
source=(
  "${pkgname}::git+https://github.com/wincent/clipper.git"
  "service.patch"
)
sha256sums=('SKIP'
            'd3bbb206593832a7f25bc37e957286e0769ef0714bc8d38ca3cbe2a1b2976aa3')

prepare() {
  cd "$pkgname"
  echo "$LDFLAGS"
  git reset --hard main
  patch --strip 1 --input="${srcdir}/service.patch"
}

pkgver() {
  cd "$pkgname"
  git describe | sed s/-/_/g
}

build() {
  cd "$pkgname"
  LDFLAGS="-extldflags \"${LDFLAGS}\"" make DESTDIR="$pkgdir" PREFIX=/usr build
}

check() {
  true
}

package() {
  cd "$pkgname"
  install -Dm755 clipper "$pkgdir/usr/bin/clipper"
  install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/clipper-git/LICENSE"
  install -Dm644 contrib/linux/systemd-service/clipper.service "$pkgdir/usr/share/clipper/clipper.service"
  echo
  echo "A sample systemd service has been installed to /usr/share/clipper/clipper.service"
  echo
  echo "To use it:"
  echo
  echo "    mkdir -p ~/.config/systemd/user"
  echo "    cp /usr/share/clipper/clipper.service ~/.config/systemd/user/clipper.service"
  echo "    systemctl --user daemon-reload"
  echo "    systemctl --user enable clipper.service"
  echo "    systemctl --user start clipper.service"
  echo
}