summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c8be713de1dc2696cb32f240c650c3a20119f9e0 (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
# -*- sh -*-

#  Maintainer: Klaus Alexander Seistrup <$(echo 0x1fd+d59decfa=40 | tr 0-9+a-f=x ka-i@p-u.l)>
# Contributor: éclairevoyant

_pkgname='nimdow'
pkgname="${_pkgname}-git"
pkgver=0.7.40.r1.g29a0cd2
pkgrel=2
pkgdesc='Tiling window manager written in Nim (latest commit)'
arch=('x86_64')
url="https://github.com/avahe-kellenberger/$_pkgname"
license=('GPL-2.0-or-later')
depends=('gcc-libs' 'glibc')
makedepends=('git' 'nim>=1.2.0')
source=("git+$url.git")
sha256sums=('SKIP')
options=('lto')
provides=('nimdow')
conflicts=('nimdow')

_setup() {
  _nimble_dir="$srcdir/nimbleDir"
  _path="$_nimble_dir/bin:$PATH"

  cd "$_pkgname"
}

pkgver() {
  _setup

  git describe --long --tags \
  | sed 's/^v//;s/-rc\d*//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  _setup

  # RFC-0023
  # 🔗 https://rfc.archlinux.page/0023-pack-relative-relocs/
  #
  # ld(1) says: “Supported for i386 and x86-64.”
  case "Z${CARCH:-unknown}" in
    'Zx86_64' | 'Zi386' )
      export LDFLAGS="$LDFLAGS -Wl,-z,pack-relative-relocs"
    ;;
    * ) : pass ;;
  esac

  export CHOOSENIM_NO_ANALYTICS=1

  PATH="$_path" nimble refresh -l
  PATH="$_path" nimble install -d -l
}

build() {
  _setup

  PATH="$_path" nimble install -l --verbose \
    --deepcopy:on \
    --passNim:--passC:"\"$CFLAGS\"" --passNim:--passL:"\"$LDFLAGS\""
}

package() {
  _setup

  install -vDm0755 -t "$pkgdir/usr/bin" \
    nimdow
  install -vDm0644 -t "$pkgdir/usr/share/man/man1" \
    doc/nimdow.1
  install -vDm0644 -t "$pkgdir/usr/share/$_pkgname" \
    config.default.toml
  install -vDm0644 -t "$pkgdir/usr/share/xsessions" \
    nimdow.desktop
  install -vDm0644 -t "$pkgdir/usr/share/doc/$pkgname" \
    README.md
}

# eof