summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b950d7b1bc4f808063a872f3e38008ca9edc2e03 (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
# Maintainer:

_pkgname="intel-xed"
pkgname="$_pkgname"
pkgver=2025.12.14
pkgrel=1
pkgdesc="A library for encoding and decoding x86 instructions"
url="https://github.com/intelxed/xed"
license=('Apache-2.0')
arch=('x86_64')

depends=(
  'glibc'
)
makedepends=(
  'doxygen'
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)

_pkgsrc="$_pkgname"
_pkgsrc_mbuild="intelxed.mbuild"
source=(
  "$_pkgsrc"::"git+$url.git#tag=v$pkgver"
  "$_pkgsrc_mbuild"::"git+https://github.com/intelxed/mbuild"
)
sha256sums=(
  'cba2eb253430e767baeb78b8341a5ee19a7a58571d6e2a1e51828277d09dc412'
  'SKIP'
)

build() (
  echo "Building mbuild..."
  cd "$_pkgsrc_mbuild"
  python -m build --wheel --no-isolation --skip-dependency-check

  python -m venv --system-site-packages mbuild-env
  source mbuild-env/bin/activate
  python -m installer dist/*.whl

  echo "Building Intel XED..."
  cd "../$_pkgsrc"
  ./mfile.py --shared doc doc-build examples install $MAKEFLAGS
)

package() {
  cd "$_pkgsrc"/kits/xed-install-base-*-lin-x86-64/

  # headers
  mkdir -pm755 "$pkgdir/usr/include"
  cp -r include/* "$pkgdir/usr/include/"

  # libs
  install -Dm644 lib/* -t "$pkgdir/usr/lib/"

  # binaries and symlink
  install -Dm755 bin/* -t "$pkgdir/usr/lib/$_pkgname/"
  mkdir -pm755 "$pkgdir/usr/bin"
  ln -sf "/usr/lib/$_pkgname/xed" "$pkgdir/usr/bin/intel-xed"

  # reference
  mkdir -pm755 "$pkgdir/usr/share/doc/$_pkgname"
  cp -r doc/ref-manual/html "$pkgdir/usr/share/doc/$_pkgname/ref-manual"

  # examples
  cp -r examples "$pkgdir/usr/share/doc/$_pkgname/examples"

  # permissions
  chmod -R u+rwX,go+rX,go-w "$pkgdir/"
}