diff options
author | Carl Smedstad | 2023-02-12 16:12:33 +0100 |
---|---|---|
committer | Carl Smedstad | 2023-03-03 11:59:54 +0100 |
commit | 484c0d46736006811c17513cc0216d3c3508c800 (patch) | |
tree | 840378afb51919b9a4f4fdc77583875f22cc7ec0 /PKGBUILD | |
parent | e39ce29fd06f9b0d2ecc235abb7dd65202b16442 (diff) | |
download | aur-484c0d46736006811c17513cc0216d3c3508c800.tar.gz |
Remove git build dependency
Pull all sources, i.e. PowerShell, PowerShell-Native and googletest, as
version locked archives.
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 66 |
1 files changed, 38 insertions, 28 deletions
@@ -5,37 +5,52 @@ pkgname=powershell _binaryname=pwsh -_pkgver=7.3.3 -_pkgnum=${_pkgver:0:1} -pkgver=${_pkgver/-/.} -pkgrel=1 +pkgver=7.3.3 +_pkgnum=${pkgver:0:1} +pkgrel=2 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>=7.0.0') +makedepends=('cmake' 'dotnet-sdk>=7.0.0') depends=('krb5' 'gcc-libs' 'glibc' 'lttng-ust' 'zlib' 'openssl>=1.0' 'icu') -source=($pkgname::"git+https://github.com/PowerShell/PowerShell.git#tag=v$_pkgver" - 'powershell-native::git+https://github.com/PowerShell/PowerShell-Native.git' - 'Microsoft.PowerShell.SDK.csproj.TypeCatalog.targets') -sha256sums=('SKIP' - 'SKIP' - '8d10afb45883813f805bdf74ec445ae3f2fdbd4d30ab2ce7ce3a55df80693696') + +_googletest_commit_hash=4e4df226fc197c0dda6e37f5c8c3845ca1e73a49 +_powershell_native_version=7.3.2 +source=("$pkgname-$pkgver::$url/archive/refs/tags/v$pkgver.tar.gz" + "powershell-native-$_powershell_native_version::https://github.com/PowerShell/PowerShell-Native/archive/refs/tags/v$_powershell_native_version.tar.gz" + 'Microsoft.PowerShell.SDK.csproj.TypeCatalog.targets' + "googletest-$_googletest_commit_hash.tar.gz::https://github.com/google/googletest/archive/$_googletest_commit_hash.tar.gz" + 'version-from-environment-variable.patch') +sha256sums=('ad5f4533414b91abe67c46194aec81985313d6b54cf7c0019169cf62c1cb7bbd' + '1fcf21213a47f9554297f5cf3fc9adc866e037bde9a8d71c1c5889a2f5d79918' + '8d10afb45883813f805bdf74ec445ae3f2fdbd4d30ab2ce7ce3a55df80693696' + 'eebf7507efcfe7a4dff5d69dcbe52ee090e99548c1407714fe10821ba359bf32' + '50c7265492cd5cd87d81df29fa737d06dacd97586b0fafb3a0f3af8451b8c052') install=powershell.install options=(staticlibs !strip) +_powershell_native_archive="PowerShell-Native-$_powershell_native_version" +_powershell_archive="PowerShell-$pkgver" +_googletest_archive="googletest-$_googletest_commit_hash" + prepare() { - cd "$srcdir/powershell-native" - git submodule init - git submodule update - rm "$srcdir/powershell/global.json" + cd "$srcdir/$_powershell_archive" + rm global.json + patch --forward --strip=1 --input="${srcdir}/version-from-environment-variable.patch" + + cp -r "$srcdir/$_googletest_archive/." "$srcdir/$_powershell_native_archive/src/libpsl-native/test/googletest/" } build() { - cd $pkgname + cd "$srcdir/$_powershell_archive" + export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true export DOTNET_CLI_TELEMETRY_OPTOUT=true + # Mock git describe output that the build expects + export POWERSHELL_GIT_DESCRIBE_OUTPUT="v$pkgver-0-gxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + ## Restore dotnet restore src/powershell-unix dotnet restore src/ResGen @@ -45,9 +60,6 @@ build() { cp "$srcdir/Microsoft.PowerShell.SDK.csproj.TypeCatalog.targets" "src/Microsoft.PowerShell.SDK/obj/Microsoft.PowerShell.SDK.csproj.TypeCatalog.targets" dotnet msbuild src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj /t:_GetDependencies "/property:DesignTimeBuild=true;_DependencyFile=$(pwd)/src/TypeCatalogGen/powershell.inc" /nologo - ## Generate 'powershell.version' - git --git-dir="$(pwd)/.git" describe --dirty --abbrev=60 > "$(pwd)/powershell.version" - ## create the telemetry flag file touch "$(pwd)/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY" @@ -62,31 +74,29 @@ build() { popd ## Build native component - pushd $srcdir/powershell-native/src/libpsl-native + pushd "$srcdir/$_powershell_native_archive/src/libpsl-native" cmake -DCMAKE_BUILD_TYPE=Debug . make -j popd ## Build powershell core - dotnet publish --configuration Linux "src/powershell-unix/" --output bin --runtime "linux-x64" + dotnet publish --self-contained --configuration Linux "src/powershell-unix/" --output bin --runtime "linux-x64" } check() { - cd "$srcdir/powershell-native/src/libpsl-native" + cd "$srcdir/$_powershell_native_archive/src/libpsl-native" make test - cd "$srcdir/powershell/test/xUnit" + cd "$srcdir/$_powershell_archive/test/xUnit" dotnet test } package() { - mkdir -pv "$pkgdir/opt/microsoft/$pkgname/$_pkgnum" - cd "$srcdir/$pkgname/src/powershell-unix/bin/Linux/net7.0/linux-x64/" + mkdir -p "$pkgdir/opt/microsoft/$pkgname/$_pkgnum" + cp -ar "$srcdir/$_powershell_archive/src/powershell-unix/bin/Linux/net7.0/linux-x64/." "$pkgdir/opt/microsoft/$pkgname/$_pkgnum/" - cp -ar ./ "$pkgdir/opt/microsoft/$pkgname/$_pkgnum/" + install -Dm644 "$srcdir/$_powershell_archive/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" - mkdir -p "$pkgdir/usr/share/licenses/$pkgname" - cp LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE" mkdir -p "$pkgdir/usr/bin" ln -s "/opt/microsoft/$pkgname/$_pkgnum/$_binaryname" "$pkgdir/usr/bin/$_binaryname" } |