summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 153912bdb346a98f1217c800a9dedc7c1ed709fa (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
# Maintainer: Kyle Sferrazza <kyle.sferrazza@gmail.com>
# Contributor: Max Liebkies <mail@maxliebkies.de>

pkgname=powershell
binaryname=pwsh
_pkgver=6.0.0
pkgver=${_pkgver/-/.}
pkgrel=1
pkgdesc='A cross-platform automation and configuration tool/framework (latest release)'
arch=('x86_64')
url='https://github.com/PowerShell/PowerShell'
license=('MIT')
makedepends=('git' 'cmake' 'dotnet-sdk>=2.0')
depends=('icu')
source=($pkgname::git+https://github.com/PowerShell/PowerShell.git#tag=v$_pkgver
        pester::git+https://github.com/PowerShell/psl-pester.git#branch=develop
        googletest::git+https://github.com/google/googletest.git
        build.sh
        dotnet-version.patch)
md5sums=('SKIP'
         'SKIP'
         'SKIP'
         'a0d7e3fa753f74e9722f71a5ab3da6d9'
         '7fc09756121a31bc336498a18edfe6da')
install=powershell.install

prepare() {
  cd $pkgname
  git submodule init
  git config submodule.src/Modules/Pester.url $srcdir/pester
  git config submodule.src/libpsl-native/test/googletest.url $srcdir/googletest
  git submodule update
  git clean -dfx

  cat $srcdir/dotnet-version.patch | patch -p1
}

build() {
  cd $pkgname
  $srcdir/build.sh
}

check() {
  cd $pkgname/src/libpsl-native
  make test
}

package() {
  cd $pkgname/src/powershell-unix

  mkdir -p $pkgdir/usr/lib/$pkgname
  cp -a bin/Linux/netcoreapp*/linux-x64 $pkgdir/usr/lib/$pkgname
  chmod 755 $pkgdir/usr/lib/$pkgname/linux-x64/$binaryname

  mkdir -p $pkgdir/usr/share/licenses/$pkgname
  cp ../../LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE

  mkdir -p $pkgdir/usr/bin
  ln -s /usr/lib/$pkgname/linux-x64/$binaryname $pkgdir/usr/bin/$binaryname

  chmod 644 \
    $pkgdir/usr/lib/powershell/linux-x64/libhostfxr.so \
    $pkgdir/usr/lib/powershell/linux-x64/libhostpolicy.so \
    $pkgdir/usr/lib/powershell/linux-x64/en-US/default.help.txt \
    $pkgdir/usr/lib/powershell/linux-x64/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.psm1
}