Skip to content

Instantly share code, notes, and snippets.

@hfutxqd
Forked from naetherm/PKGBUILD
Created December 3, 2019 12:59
Show Gist options
  • Save hfutxqd/aff3273cc5f6ca04d904bb231d431879 to your computer and use it in GitHub Desktop.
Save hfutxqd/aff3273cc5f6ca04d904bb231d431879 to your computer and use it in GitHub Desktop.
hsakmt-roct
# Maintainer: Olaf Leidinger <[email protected]>
pkgname=hsakmt-roct
pkgver=2.9.0
pkgrel=2
pkgdesc="Radeon Open Compute Thunk Interface"
_gitdir=ROCT-Thunk-Interface
arch=('x86_64')
url="https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface"
license=('X11/MIT')
groups=()
depends=(pciutils numactl)
makedepends=(git cmake gcc)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
replaces=()
backup=()
options=()
source=('git+https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface.git#branch=roc-2.9.x')
md5sums=('SKIP')
pkgver() {
cd "$srcdir/${_gitdir}"
# Git, tags available
printf "%s" "$(git describe --long | sed -e 's:roc-::g' -e 's/\([^-]*-\)g/r\1/;s/-/./g')"
}
build() {
cd "$srcdir/${_gitdir}"
mkdir -p build && \
cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm .. && \
make
}
package() {
cd "$srcdir/${_gitdir}/build"
make DESTDIR="$pkgdir/" install
# additional links
mkdir -p "$pkgdir/usr/include"
ln -s opt/rocm/libhsakmt/include/libhsakmt "$pkgdir/usr/include"
# ldconfig
mkdir -p "$pkgdir/etc/ld.so.conf.d"
echo "/opt/rocm/libhsakmt/lib" > "$pkgdir/etc/ld.so.conf.d/libhsakmt.conf"
############
# dev-parts
# pkg-build config file(s)
find `pwd` -name "*.pc" -exec install -D '{}' $pkgdir/opt/rocm/libhsakmt ';'
# headers, reconstruct tree
cd "$srcdir/${_gitdir}/include"
find . -name '*.h' -exec install -D '{}' $pkgdir/opt/rocm/libhsakmt/include/libhsakmt/{} ';'
# cleanup
rm -Rf "$pkgdir/opt/rocm/include"
rm -Rf "$pkgdir/opt/rocm/lib"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment