summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 678fe53cf4590f4e935c977d62fd01db07688206 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Maintainer:  dreieck (https://aur.archlinux.org/account/dreieck)
# Contributor: éclairevoyant (https://aur.archlinux.org/account/eclairevoyant)
# Contributor: keenord (https://aur.archlinux.org/account/keenerd)

_pkgname="nasm-segelf"
pkgname="${_pkgname}-git"
pkgver=2.16.01+30.r4913.20231207.g13292aec
pkgrel=2
epoch=1
pkgdesc="80x86 assembler designed for portability and modularity. 'elf16' branch."
arch=(
  'i686'
  'x86_64'
)
url='https://github.com/stsp/nasm/tree/elf16'
depends=(
  'gcc-libs'
  'glibc'
)
makedepends=(
  adobe-source-sans-pro-fonts
  asciidoc
  diffutils
  fontconfig
  ghostscript
  git
  perl
  perl-font-ttf
  perl-sort-versions
  ttf-liberation
  xmlto
)
license=(
  'BSD'
)
provides=(
  "${_pkgname}=${pkgver%%.r*}"
)
conflicts=(
  "${_pkgname}"
)
source=(
  "${_pkgname}::git+https://github.com/stsp/nasm.git#branch=elf16"
)
b2sums=(
  'SKIP'
)

prepare() {
  cd "${srcdir}/${_pkgname}"

  NOCONFIGURE=1 ./autogen.sh

  git log > git.log
}

pkgver() {
  cd "${srcdir}/${_pkgname}"

  _ver="$(git describe --tags | sed -E  -e 's|^nasm\-||' -e 's|^[vV]||' | sed -E 's|\-g[0-9a-f]+$||' | tr '-' '+')"
  _rev="$(git rev-list --count HEAD)"
  _date="$(git log -n 1 --format=tformat:%ci | awk '{print $1}' | tr -d '-')"
  _hash="$(git rev-parse --short HEAD)"

  printf '%s\n' "${_ver}.r${_rev}.${_date}.g${_hash}"
}

build() {
  cd "${srcdir}/${_pkgname}"

  # --enable-sanitizer makes tests fail and makes compiling other projects (fdpp-git) fail with `==10946==ERROR: LeakSanitizer: detected memory leaks`.

  ./configure \
    --prefix=/usr \
    --docdir="/usr/share/doc/${_pkgname}/doc" \
    --disable-gdb \
    --enable-optimization \
    --disable-profiling \
    --enable-largefile \
    --enable-pdf-compression \
    --enable-section \
    --disable-sanitizer \
    --disable-werror \
    --disable-suggestions

  make everything
}

check() {
  cd "${srcdir}/${_pkgname}"

  make -j1 -C test golden test diff
}

package() {
  cd "${srcdir}/${_pkgname}"

  make DESTDIR="${pkgdir}" install install_doc

  for _docfile in git.log AUTHORS ChangeLog CHANGES INSTALL README.md *.txt; do
    install -vDm644 "${_docfile}" -t "${pkgdir}/usr/share/doc/${_pkgname}/"
  done

  install -vDm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
}