summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 597180c900e12682b2acb1664005d76fe3fb74d0 (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
# Maintainer: Aikawa Yataro <aikawayataro at protonmail dot com>
# Contributor: Vaughan <vaughanm1@protonmail.com>
# Contributor: tytan652 <tytan652 at tytanium dot xyz>
# Contributor: Jun Bo Bi <jambonmcyeah@gmail.com>

pkgname=netcoredbg
_pkgver=3.1.3-1062
pkgver="${_pkgver//-/_}"
pkgrel=2
pkgdesc='Debugger for .NET Core runtime'
url='https://github.com/Samsung/netcoredbg'
license=('MIT')
arch=('x86_64')
depends=('dotnet-runtime-10.0' 'glibc' 'gcc-libs')
makedepends=('cmake' 'clang' 'dotnet-sdk-10.0')
# keep synced with extra/dotnet-core
# see src/source-manifest.json of dotnet/dotnet
_runtime_tag=0ada13fb1c2aefeef56450edb3e6ff4bc1e889bf
source=("$pkgname-$_pkgver.tar.gz::https://github.com/Samsung/netcoredbg/archive/refs/tags/$_pkgver.tar.gz"
        "dotnet_runtime_${_runtime_tag:0:7}.tar.gz::https://github.com/dotnet/runtime/archive/$_runtime_tag.tar.gz"
        "broken-assert.patch")

sha256sums=('4138f6f99432822b7f56053b91abb550607e1015d91275b82c3cddeaa02d903e'
            '44818b3e6c42afe303c5277bc3fc0383dc8ffdb8c59a3a3ee8310c213f6027dd'
            '3f468b84a0b018aec679339e7516ce8f365cb65dc77c97d891e8283756ced8ca')

prepare() {
  cd "$pkgname-$_pkgver"

  # TODO: fix the root problem upstream
  patch --strip=1 --input=../broken-assert.patch
}

build() {
  cmake -B build -S "$pkgname-$_pkgver" \
    -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
    -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
    -DCMAKE_BUILD_TYPE=None \
    -DDOTNET_DIR=/usr/share/dotnet \
    -DCORECLR_DIR="$(realpath "runtime-$_runtime_tag")/src/coreclr" \
    -DCMAKE_INSTALL_PREFIX=/

  cmake --build build
}

package() {
  DESTDIR="$pkgdir/opt/netcoredbg" cmake --install build
  install -d "$pkgdir/usr/bin"
  ln -s /opt/netcoredbg/netcoredbg "$pkgdir/usr/bin"
  install -Dm644 "$pkgname-$_pkgver/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname"
}