archrelease: copy trunk to community-any
[ArchLinux/community.git] / hipsparse / repos / community-x86_64 / PKGBUILD
blobaaf45c477cc57f9fff499b68ef19f7af737cc92e
1 # Maintainer: Torsten Keßler <tpkessler at archlinux dot org>
2 # Contributor: Markus Näther <naetherm@informatik.uni-freiburg.de>
3 # Contributor: acxz <akashpatel2008 at yahoo dot com>
5 pkgname=hipsparse
6 pkgver=5.4.3
7 pkgrel=1
8 pkgdesc='rocSPARSE marshalling library.'
9 arch=('x86_64')
10 url='https://hipsparse.readthedocs.io/en/latest/'
11 license=('MIT')
12 depends=('hip' 'rocsparse')
13 makedepends=('rocm-cmake' 'gcc-fortran')
14 _git='https://github.com/ROCmSoftwarePlatform/hipSPARSE'
15 source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz"
16         "hipsparse-no-git.patch")
17 sha256sums=('b373eccd03679a13fab4e740fc780da25cbd598abca3a1e5e3613ae14954f9db'
18             '0f4ca37b246e9908ebb3a80818abb28b4c6996036b65f8f89be9affc854efa7f')
19 options=(!lto)
20 _dirname="$(basename "$_git")-$(basename "${source[0]}" ".tar.gz")"
22 prepare() {
23     cd "$_dirname"
24     patch -Np1 -i "$srcdir/hipsparse-no-git.patch"
27 build() {
28   # -fcf-protection is not supported by HIP, see
29   # https://docs.amd.com/bundle/ROCm-Compiler-Reference-Guide-v5.4/page/Appendix_A.html
30   CXXFLAGS="${CXXFLAGS} -fcf-protection=none" \
31   HIP_PATH=/opt/rocm \
32   cmake \
33     -Wno-dev \
34     -B build \
35     -S "$_dirname" \
36     -DCMAKE_BUILD_TYPE=None \
37     -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc \
38     -DCMAKE_INSTALL_PREFIX=/opt/rocm
39   cmake --build build
42 package() {
43   DESTDIR="$pkgdir" cmake --install build
45   echo "/opt/rocm/$pkgname/lib" > "$pkgname.conf"
46   install -Dm644 "$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
48   install -Dm644 "$srcdir/$_dirname/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"