diff --git a/cmake/Components.cmake b/cmake/Components.cmake index 43db0f9..2057326 100644 --- a/cmake/Components.cmake +++ b/cmake/Components.cmake @@ -85,6 +85,10 @@ set(LIBZIP_VERSION 1.11.4) set(LIBZIP_HASH SHA256=8a247f57d1e3e6f6d11413b12a6f28a9d388de110adc0ec608d893180ed7097b) set(LIBZIP_URL https://libzip.org/download/libzip-${LIBZIP_VERSION}.tar.xz) +set(PKGCONF_VERSION 3.0.7) +set(PKGCONF_HASH SHA256=c926ff491cbd9a331a589160811bd97ab1749b4d5198a519338f2cdfabe6940a) +set(PKGCONF_URL https://github.com/pkgconf/pkgconf/releases/download/pkgconf-${PKGCONF_VERSION}/pkgconf-${PKGCONF_VERSION}.tar.xz) + # Each VitaSDK component selects both its source and its revision from the # command line. A local clone can be named here so that a change spanning two # repositories can be built before either side is published. @@ -94,7 +98,7 @@ set(SAMPLES_REPOSITORY https://github.com/vitasdk/samples CACHE STRING "samples repository URL or local path") set(HEADERS_REPOSITORY https://github.com/vitasdk/vita-headers CACHE STRING "vita-headers repository URL or local path") -set(TOOLCHAIN_REPOSITORY https://github.com/vitasdk/vita-toolchain +set(TOOLCHAIN_REPOSITORY https://github.com/devnoname120/vita-toolchain CACHE STRING "vita-toolchain repository URL or local path") set(PTHREAD_REPOSITORY https://github.com/vitasdk/pthread-embedded CACHE STRING "pthread-embedded repository URL or local path") @@ -106,7 +110,7 @@ set(VITA_MAKEPKG_REPOSITORY https://github.com/vitasdk/vita-makepkg.git set(NEWLIB_TAG 2e428297c0b6aefd830c5a75a7daa7e774562a42 CACHE STRING "newlib branch, commit id or tag") set(SAMPLES_TAG fe8fbef570f3280586c0c20157146e3faefb2181 CACHE STRING "samples branch, commit id or tag") set(HEADERS_TAG e66ebe90b73d1fa4cce005a5b2072cec27322544 CACHE STRING "vita-headers branch, commit id or tag") -set(TOOLCHAIN_TAG e8bc8f70ee5d3036f1562486cbc6065b52a8d173 CACHE STRING "vita-toolchain branch, commit id or tag") +set(TOOLCHAIN_TAG 9e3860c1617b8f55162851ff4093d3446093d8b9 CACHE STRING "vita-toolchain branch, commit id or tag") set(PTHREAD_TAG 11d2e5722d98c86f33c908fc47b2cf6e55205db5 CACHE STRING "pthread-embedded branch, commit id or tag") set(VDPM_TAG v0.1.4 CACHE STRING "vdpm branch, commit id or tag") set(VITA_MAKEPKG_TAG bbd1b18731cf8b6a69a18c9acdefd79a5b8c36eb CACHE STRING "vita-makepkg branch, commit id or tag") diff --git a/cmake/ValidateSdk.cmake b/cmake/ValidateSdk.cmake index 01791c0..dc321d7 100644 --- a/cmake/ValidateSdk.cmake +++ b/cmake/ValidateSdk.cmake @@ -16,6 +16,17 @@ foreach(tool IN LISTS required_tools) endif() endforeach() +set(host_suffix "") +if(HOST_SYSTEM_NAME STREQUAL "Windows") + set(host_suffix ".exe") +endif() +foreach(tool pkgconf ${TARGET_TRIPLE}-pkg-config) + set(path "${SDK_DIR}/bin/${tool}${host_suffix}") + if(NOT EXISTS "${path}") + message(FATAL_ERROR "Missing SDK pkg-config tool: ${path}") + endif() +endforeach() + set(sysroot "${SDK_DIR}/${TARGET_TRIPLE}") foreach(directory include lib) if(NOT IS_DIRECTORY "${sysroot}/${directory}") diff --git a/cmake/recipes/BuildHostTools.cmake b/cmake/recipes/BuildHostTools.cmake index b1a07cd..439fd7b 100644 --- a/cmake/recipes/BuildHostTools.cmake +++ b/cmake/recipes/BuildHostTools.cmake @@ -11,6 +11,33 @@ # because stage 1's vdpm/vita-makepkg were built for stage 1's own host, not # this one. +ExternalProject_Add(pkgconf + URL ${PKGCONF_URL} + URL_HASH ${PKGCONF_HASH} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + DOWNLOAD_EXTRACT_TIMESTAMP TRUE + CONFIGURE_COMMAND ${compiler_flags} ${wrapper_command} /configure + --build=${build_native} + --host=${host_native} + --prefix=/ + --disable-shared + --enable-static + --disable-dependency-tracking + --with-system-libdir=/usr/lib + --with-system-includedir=/usr/include + CPPFLAGS=-DPKGCONFIG_IS_STATIC + BUILD_COMMAND ${compiler_flags} ${wrapper_command} $(MAKE) pkgconf${CMAKE_EXECUTABLE_SUFFIX} + INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory + ${CMAKE_INSTALL_PREFIX}/bin + ${CMAKE_INSTALL_PREFIX}/share/licenses/pkgconf + COMMAND ${CMAKE_COMMAND} -E copy + /pkgconf${CMAKE_EXECUTABLE_SUFFIX} + ${CMAKE_INSTALL_PREFIX}/bin/pkgconf${CMAKE_EXECUTABLE_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E copy + /COPYING + ${CMAKE_INSTALL_PREFIX}/share/licenses/pkgconf/COPYING + ) + set(vdpm_use_release_bundle OFF) if(BUILD_PACMAN_CLIENT AND (VDPM_BUNDLE OR VDPM_BUNDLE_SHA256)) if(NOT VDPM_BUNDLE OR NOT VDPM_BUNDLE_SHA256) diff --git a/cmake/recipes/FinalizeSdk.cmake b/cmake/recipes/FinalizeSdk.cmake index aec562b..bc626d6 100644 --- a/cmake/recipes/FinalizeSdk.cmake +++ b/cmake/recipes/FinalizeSdk.cmake @@ -33,6 +33,7 @@ set(finalize_sdk_dependencies vita-toolchain_${target_suffix} binutils_${target_suffix} gdb_${target_suffix} + pkgconf vdpm vita-makepkg ${target_half_dependencies}) diff --git a/scripts/ci/build-host.sh b/scripts/ci/build-host.sh index 2581ecf..d36a256 100755 --- a/scripts/ci/build-host.sh +++ b/scripts/ci/build-host.sh @@ -148,12 +148,12 @@ download_vdpm_bundle() { # Same-runner smoke test only; a canadian cross cannot run what it built. smoke_test_bootstrap() { - local bootstrap_archive=$1 digest install_root + local bootstrap_archive=$1 digest install_root probe_pc version # Empty for a host that runs here directly; a launcher for one that needs # it. Unquoted on purpose, so an empty prefix contributes no argument. local -a run=(${2:-}) digest=$(awk '{print $1}' "$bootstrap_archive.sha256") - install_root="$PWD/bootstrap-installed" + install_root="$PWD/bootstrap installed" # ${run[@]+...}: macOS's /bin/bash is 3.2, where expanding an empty array # under set -u is an unbound-variable error -- and empty is the normal # case here, for every host that runs its own binaries. @@ -163,6 +163,31 @@ smoke_test_bootstrap() { # vdpm ships pacman under libexec/vdpm, not bin/. ${run[@]+"${run[@]}"} "$install_root/libexec/vdpm/pacman" --version >/dev/null ${run[@]+"${run[@]}"} "$install_root/bin/arm-vita-eabi-gcc" --version + probe_pc="$install_root/arm-vita-eabi/lib/pkgconfig/vitasdk-wrapper-probe.pc" + mkdir -p "$(dirname "$probe_pc")" + cat > "$probe_pc" <<'EOF' +prefix=${VITASDK}/arm-vita-eabi +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: vitasdk-wrapper-probe +Description: VitaSDK pkg-config frontend smoke test +Version: 1.0 +Libs: -L${libdir} -lprobe +Cflags: -I${includedir}/probe +EOF + version=$(VITASDK="$install_root" \ + PKG_CONFIG_DIR=/host/pkgconfig \ + PKG_CONFIG_PATH=/host/pkgconfig \ + PKG_CONFIG_SYSROOT_DIR=/host \ + PKG_CONFIG_LIBDIR=/host/pkgconfig \ + ${run[@]+"${run[@]}"} "$install_root/bin/arm-vita-eabi-pkg-config" \ + --modversion vitasdk-wrapper-probe) + [[ $version == 1.0 ]] || { + printf 'pkg-config frontend returned version %s, expected 1.0\n' "$version" >&2 + exit 1 + } } # Builds against $stage1_dir if set, then stages outputs plus provenance. diff --git a/scripts/ci/smoke-windows-bootstrap.ps1 b/scripts/ci/smoke-windows-bootstrap.ps1 index 4a91a8b..cf167a3 100644 --- a/scripts/ci/smoke-windows-bootstrap.ps1 +++ b/scripts/ci/smoke-windows-bootstrap.ps1 @@ -40,7 +40,7 @@ $vdpmCheckout = Join-Path $tempRoot "vdpm-bootstrap-$([guid]::NewGuid())" git clone --depth=1 --branch $vdpmTag https://github.com/vitasdk/vdpm.git $vdpmCheckout if ($LASTEXITCODE -ne 0) { throw 'failed to check out the vdpm frontend' } -$installRoot = Join-Path $tempRoot "vitasdk-bootstrap-installed-$([guid]::NewGuid())" +$installRoot = Join-Path $tempRoot "Vita SDK bootstrap installed $([guid]::NewGuid())" & (Join-Path $vdpmCheckout 'bootstrap-vitasdk.ps1') ` -ArchivePath $archive -Sha256 $digest -InstallDirectory $installRoot if ($LASTEXITCODE -ne 0) { throw 'bootstrap-vitasdk.ps1 failed' } @@ -54,4 +54,64 @@ if ($LASTEXITCODE -ne 0) { throw 'pacman self-test failed' } & (Join-Path $installRoot 'bin/arm-vita-eabi-gcc.exe') --version if ($LASTEXITCODE -ne 0) { throw 'compiler self-test failed' } +$pkgconf = Join-Path $installRoot 'bin/pkgconf.exe' +$pkgConfig = Join-Path $installRoot 'bin/arm-vita-eabi-pkg-config.exe' +foreach ($tool in @($pkgconf, $pkgConfig)) { + if (-not (Test-Path -PathType Leaf $tool)) { + throw "pkg-config tool is missing: $tool" + } +} + +$probeDirectory = Join-Path $installRoot 'arm-vita-eabi/lib/pkgconfig' +New-Item -ItemType Directory -Force -Path $probeDirectory | Out-Null +$probeFile = Join-Path $probeDirectory 'vitasdk-wrapper-probe.pc' +@' +prefix=${VITASDK}/arm-vita-eabi +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: vitasdk-wrapper-probe +Description: VitaSDK pkg-config frontend smoke test +Version: 1.0 +Libs: -L${libdir} -lprobe +Cflags: -I${includedir}/probe +'@ | Set-Content -NoNewline -Encoding utf8 $probeFile + +$hostMetadata = Join-Path $tempRoot "host-pkgconfig-$([guid]::NewGuid())" +New-Item -ItemType Directory -Path $hostMetadata | Out-Null +@' +Name: vitasdk-wrapper-probe +Description: Host package that must not be selected +Version: 9.9 +Libs: -lhost-contamination +'@ | Set-Content -NoNewline -Encoding utf8 (Join-Path $hostMetadata 'vitasdk-wrapper-probe.pc') + +$env:VITASDK = Join-Path $tempRoot 'wrong sdk root' +$env:PKG_CONFIG_DIR = $hostMetadata +$env:PKG_CONFIG_PATH = $hostMetadata +$env:PKG_CONFIG_SYSROOT_DIR = $hostMetadata +$env:PKG_CONFIG_LIBDIR = $hostMetadata +$version = (& $pkgConfig --modversion vitasdk-wrapper-probe | Out-String).Trim() +if ($LASTEXITCODE -ne 0 -or $version -ne '1.0') { + throw "pkg-config frontend selected version '$version' instead of the Vita package" +} + +$cmakeProject = Join-Path $tempRoot "pkgconfig-cmake-project-$([guid]::NewGuid())" +$cmakeBuild = Join-Path $tempRoot "pkgconfig-cmake-build-$([guid]::NewGuid())" +New-Item -ItemType Directory -Path $cmakeProject | Out-Null +@' +cmake_minimum_required(VERSION 3.16) +project(vitasdk_pkgconfig_probe NONE) +find_package(PkgConfig REQUIRED) +pkg_check_modules(PROBE REQUIRED IMPORTED_TARGET vitasdk-wrapper-probe) +if(NOT PROBE_VERSION STREQUAL "1.0") + message(FATAL_ERROR "unexpected probe version: ${PROBE_VERSION}") +endif() +'@ | Set-Content -NoNewline -Encoding utf8 (Join-Path $cmakeProject 'CMakeLists.txt') +$env:VITASDK = $installRoot +& cmake -S $cmakeProject -B $cmakeBuild ` + "-DCMAKE_TOOLCHAIN_FILE=$(Join-Path $installRoot 'share/vita.toolchain.cmake')" +if ($LASTEXITCODE -ne 0) { throw 'native Windows CMake could not use the Vita pkg-config frontend' } + Write-Host "Windows bootstrap smoke test passed for $windowsHost" diff --git a/scripts/create-bootstrap-archive.sh b/scripts/create-bootstrap-archive.sh index c0fc9c4..0f493b3 100755 --- a/scripts/create-bootstrap-archive.sh +++ b/scripts/create-bootstrap-archive.sh @@ -17,17 +17,20 @@ source_date_epoch=$4 required=(version_info.txt etc/pacman.conf share/vdpm/THIRD_PARTY_NOTICES.md share/vdpm/licenses/vdpm-LGPL-2.1.txt - share/vdpm/licenses/pacman-GPL-2.0.txt) + share/vdpm/licenses/pacman-GPL-2.0.txt + share/licenses/pkgconf/COPYING) case $host in *-w64-mingw32) required+=(bin/vdpm.exe bin/arm-vita-eabi-gcc.exe \ + bin/pkgconf.exe bin/arm-vita-eabi-pkg-config.exe \ share/vdpm/msys/usr/bin/pacman.exe \ share/vdpm/msys/usr/bin/vdpm-channel.exe \ share/vdpm/msys/usr/bin/msys-2.0.dll \ share/vdpm/refresh-repositories.ps1) ;; *) - required+=(bin/vdpm bin/arm-vita-eabi-gcc libexec/vdpm/pacman bin/vdpm-channel \ + required+=(bin/vdpm bin/arm-vita-eabi-gcc bin/pkgconf \ + bin/arm-vita-eabi-pkg-config libexec/vdpm/pacman bin/vdpm-channel \ bin/include/refresh-repositories.sh) ;; esac diff --git a/scripts/validate-core-package.sh b/scripts/validate-core-package.sh index 3b77398..b7bdfa3 100755 --- a/scripts/validate-core-package.sh +++ b/scripts/validate-core-package.sh @@ -56,6 +56,18 @@ if [[ $pkgname == vitasdk-core ]]; then printf 'core package does not contain the Vita compiler driver\n' >&2 exit 1 } + if [[ $architecture == *-w64-mingw32 ]]; then + pkgconfig_runtime=(bin/pkgconf.exe bin/arm-vita-eabi-pkg-config.exe) + else + pkgconfig_runtime=(bin/pkgconf bin/arm-vita-eabi-pkg-config) + fi + for runtime_file in ${pkgconfig_runtime[@]+"${pkgconfig_runtime[@]}"} \ + share/licenses/pkgconf/COPYING; do + grep -Fqx "$runtime_file" <<< "$archive_entries" || { + printf 'core package does not contain %s\n' "$runtime_file" >&2 + exit 1 + } + done grep -qx 'version_info.txt' <<< "$archive_entries" || { printf 'core package does not contain provenance information\n' >&2 exit 1 diff --git a/tests/cmake/pkgconf-sdk-validation.cmake b/tests/cmake/pkgconf-sdk-validation.cmake new file mode 100644 index 0000000..86a7d49 --- /dev/null +++ b/tests/cmake/pkgconf-sdk-validation.cmake @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 3.19) + +set(validate_script "${CMAKE_CURRENT_LIST_DIR}/../../cmake/ValidateSdk.cmake") +set(required_tools gcc g++ ld as ar ranlib strip objcopy objdump readelf nm gdb) + +function(create_sdk_fixture root suffix) + file(REMOVE_RECURSE "${root}") + file(MAKE_DIRECTORY "${root}/bin" "${root}/arm-vita-eabi/include" "${root}/arm-vita-eabi/lib") + foreach(tool IN LISTS required_tools) + file(WRITE "${root}/bin/arm-vita-eabi-${tool}${suffix}" "") + endforeach() +endfunction() + +function(run_validation root system_name expected_success) + execute_process( + COMMAND "${CMAKE_COMMAND}" + -DSDK_DIR=${root} + -DTARGET_TRIPLE=arm-vita-eabi + -DHOST_SYSTEM_NAME=${system_name} + -P "${validate_script}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error) + if(expected_success AND NOT result EQUAL 0) + message(FATAL_ERROR "${system_name} validation failed unexpectedly:\n${output}${error}") + endif() + if(NOT expected_success AND result EQUAL 0) + message(FATAL_ERROR "${system_name} validation accepted an SDK without the pkg-config frontend/backend") + endif() +endfunction() + +set(test_root "${CMAKE_CURRENT_BINARY_DIR}/pkgconf-sdk-validation") + +set(unix_root "${test_root}/unix") +create_sdk_fixture("${unix_root}" "") +run_validation("${unix_root}" Linux FALSE) +file(WRITE "${unix_root}/bin/pkgconf" "") +file(WRITE "${unix_root}/bin/arm-vita-eabi-pkg-config" "") +run_validation("${unix_root}" Linux TRUE) + +set(windows_root "${test_root}/windows") +create_sdk_fixture("${windows_root}" ".exe") +run_validation("${windows_root}" Windows FALSE) +file(WRITE "${windows_root}/bin/pkgconf.exe" "") +file(WRITE "${windows_root}/bin/arm-vita-eabi-pkg-config.exe" "") +run_validation("${windows_root}" Windows TRUE) + +file(REMOVE_RECURSE "${test_root}") +message(STATUS "pkgconf SDK validation checks passed") diff --git a/tests/cmake/static-sdk-validation.cmake b/tests/cmake/static-sdk-validation.cmake index 3fb2ad7..8a8804a 100644 --- a/tests/cmake/static-sdk-validation.cmake +++ b/tests/cmake/static-sdk-validation.cmake @@ -25,6 +25,8 @@ file(MAKE_DIRECTORY "${fixture}/bin") foreach(tool gcc g++ ld as ar ranlib strip objcopy objdump readelf nm gdb) file(WRITE "${fixture}/bin/${target_triple}-${tool}.exe" "") endforeach() +file(WRITE "${fixture}/bin/pkgconf.exe" "") +file(WRITE "${fixture}/bin/${target_triple}-pkg-config.exe" "") execute_process( COMMAND "${CMAKE_COMMAND}" -DSDK_DIR=${fixture} diff --git a/tests/package/test-bootstrap-archive.sh b/tests/package/test-bootstrap-archive.sh index 2235718..cbfaacc 100755 --- a/tests/package/test-bootstrap-archive.sh +++ b/tests/package/test-bootstrap-archive.sh @@ -8,8 +8,9 @@ cleanup() { rm -rf -- "$temporary_directory"; } trap cleanup EXIT sdk="$temporary_directory/sdk" -mkdir -p "$sdk/bin/include" "$sdk/libexec/vdpm" "$sdk/etc" "$sdk/share/vdpm/licenses" -for file in vdpm arm-vita-eabi-gcc vdpm-channel; do +mkdir -p "$sdk/bin/include" "$sdk/libexec/vdpm" "$sdk/etc" \ + "$sdk/share/vdpm/licenses" "$sdk/share/licenses/pkgconf" +for file in vdpm arm-vita-eabi-gcc vdpm-channel pkgconf arm-vita-eabi-pkg-config; do printf '%s\n' "$file" > "$sdk/bin/$file" done printf 'pacman\n' > "$sdk/libexec/vdpm/pacman" @@ -19,6 +20,7 @@ printf 'revision\n' > "$sdk/version_info.txt" printf 'notices\n' > "$sdk/share/vdpm/THIRD_PARTY_NOTICES.md" printf 'vdpm license\n' > "$sdk/share/vdpm/licenses/vdpm-LGPL-2.1.txt" printf 'pacman license\n' > "$sdk/share/vdpm/licenses/pacman-GPL-2.0.txt" +printf 'pkgconf license\n' > "$sdk/share/licenses/pkgconf/COPYING" for output in one two; do "$repository_root/scripts/create-bootstrap-archive.sh" \ @@ -28,9 +30,12 @@ archive=vitasdk-bootstrap-x86_64-linux-gnu.tar.bz2 cmp "$temporary_directory/one/$archive" "$temporary_directory/two/$archive" entries=$(tar -tjf "$temporary_directory/one/$archive") grep -qx 'vitasdk/bin/vdpm' <<< "$entries" +grep -qx 'vitasdk/bin/pkgconf' <<< "$entries" +grep -qx 'vitasdk/bin/arm-vita-eabi-pkg-config' <<< "$entries" grep -qx 'vitasdk/libexec/vdpm/pacman' <<< "$entries" grep -qx 'vitasdk/etc/pacman.conf' <<< "$entries" grep -qx 'vitasdk/version_info.txt' <<< "$entries" grep -qx 'vitasdk/share/vdpm/THIRD_PARTY_NOTICES.md' <<< "$entries" +grep -qx 'vitasdk/share/licenses/pkgconf/COPYING' <<< "$entries" printf 'reproducible VitaSDK bootstrap archive contract passed\n' diff --git a/tests/package/test-core-package.sh b/tests/package/test-core-package.sh index 6fa785c..e00f9f3 100755 --- a/tests/package/test-core-package.sh +++ b/tests/package/test-core-package.sh @@ -14,12 +14,12 @@ cleanup() { trap cleanup EXIT mkdir -p "$sdk_root/bin/include" "$sdk_root/libexec/vdpm" "$sdk_root/arm-vita-eabi/lib" \ - "$sdk_root/share/vdpm/licenses" "$sdk_root/etc" + "$sdk_root/share/vdpm/licenses" "$sdk_root/share/licenses/pkgconf" "$sdk_root/etc" cat > "$sdk_root/bin/arm-vita-eabi-gcc" <<'EOF' #!/usr/bin/env sh exit 0 EOF -for client in vdpm vdpm-channel; do +for client in vdpm vdpm-channel pkgconf arm-vita-eabi-pkg-config; do cat > "$sdk_root/bin/$client" <<'EOF' #!/usr/bin/env sh exit 0 @@ -32,7 +32,8 @@ exit 0 EOF done chmod +x "$sdk_root/bin/arm-vita-eabi-gcc" "$sdk_root/libexec/vdpm/pacman" \ - "$sdk_root/libexec/vdpm/pacman-conf" "$sdk_root/bin/vdpm" "$sdk_root/bin/vdpm-channel" + "$sdk_root/libexec/vdpm/pacman-conf" "$sdk_root/bin/vdpm" "$sdk_root/bin/vdpm-channel" \ + "$sdk_root/bin/pkgconf" "$sdk_root/bin/arm-vita-eabi-pkg-config" printf 'refresh\n' > "$sdk_root/bin/include/refresh-repositories.sh" printf 'archive\n' > "$sdk_root/arm-vita-eabi/lib/libfixture.a" printf 'source=fixture\nworld vita (float-abi=hard)\n' > "$sdk_root/version_info.txt" @@ -40,6 +41,7 @@ printf 'CARCH="vita"\n' > "$sdk_root/bin/makepkg.conf" printf 'notices\n' > "$sdk_root/share/vdpm/THIRD_PARTY_NOTICES.md" printf 'vdpm license\n' > "$sdk_root/share/vdpm/licenses/vdpm-LGPL-2.1.txt" printf 'pacman license\n' > "$sdk_root/share/vdpm/licenses/pacman-GPL-2.0.txt" +printf 'pkgconf license\n' > "$sdk_root/share/licenses/pkgconf/COPYING" printf 'version=0.1.0\nhost=x86_64-linux-gnu\n' > "$sdk_root/share/vdpm/release-info.txt" printf 'stale\n' > "$sdk_root/etc/pacman.conf" @@ -108,14 +110,16 @@ EOF # The dependency is what keeps the client alive across a core upgrade, # so the core must refuse to install without it. - if install_packages /packages/vitasdk-core-*.pkg.tar.xz 2>/dev/null; then - echo "the core installed without its client" >&2 - exit 1 - fi - - install_packages /packages/vdpm-*.pkg.tar.xz /packages/vitasdk-core-*.pkg.tar.xz - test -x /sdk/bin/arm-vita-eabi-gcc - test -x /sdk/bin/vdpm + if install_packages /packages/vitasdk-core-*.pkg.tar.xz 2>/dev/null; then + echo "the core installed without its client" >&2 + exit 1 + fi + + install_packages /packages/vdpm-*.pkg.tar.xz /packages/vitasdk-core-*.pkg.tar.xz + test -x /sdk/bin/arm-vita-eabi-gcc + test -x /sdk/bin/pkgconf + test -x /sdk/bin/arm-vita-eabi-pkg-config + test -x /sdk/bin/vdpm test -f /sdk/share/vdpm/THIRD_PARTY_NOTICES.md grep -qx "source=fixture" /sdk/version_info.txt test ! -e /sdk/etc/pacman.conf @@ -131,8 +135,11 @@ EOF # installs into usr/bin instead. windows_root="$temporary_root/windows-sdk" mkdir -p "$windows_root/bin" "$windows_root/arm-vita-eabi/lib" \ - "$windows_root/share/vdpm/licenses" "$windows_root/share/vdpm/msys/usr/bin" + "$windows_root/share/vdpm/licenses" "$windows_root/share/licenses/pkgconf" \ + "$windows_root/share/vdpm/msys/usr/bin" printf 'gcc\n' > "$windows_root/bin/arm-vita-eabi-gcc.exe" +printf 'pkgconf\n' > "$windows_root/bin/pkgconf.exe" +printf 'wrapper\n' > "$windows_root/bin/arm-vita-eabi-pkg-config.exe" printf 'vdpm\n' > "$windows_root/bin/vdpm.exe" printf 'archive\n' > "$windows_root/arm-vita-eabi/lib/libfixture.a" printf 'source=fixture\nworld vita (float-abi=hard)\n' > "$windows_root/version_info.txt" @@ -141,6 +148,7 @@ printf 'notices\n' > "$windows_root/share/vdpm/THIRD_PARTY_NOTICES.md" printf 'refresh\n' > "$windows_root/share/vdpm/refresh-repositories.ps1" printf 'vdpm license\n' > "$windows_root/share/vdpm/licenses/vdpm-LGPL-2.1.txt" printf 'pacman license\n' > "$windows_root/share/vdpm/licenses/pacman-GPL-2.0.txt" +printf 'pkgconf license\n' > "$windows_root/share/licenses/pkgconf/COPYING" printf 'version=0.1.0\nhost=x86_64-w64-mingw32\n' > "$windows_root/share/vdpm/release-info.txt" for runtime in pacman.exe vdpm-channel.exe msys-2.0.dll; do printf '%s\n' "$runtime" > "$windows_root/share/vdpm/msys/usr/bin/$runtime" @@ -170,6 +178,13 @@ grep -qx 'bin/arm-vita-eabi-gcc.exe' <<< "$windows_core" || { printf 'the Windows core package lost the toolchain\n' >&2 exit 1 } +for path in bin/pkgconf.exe bin/arm-vita-eabi-pkg-config.exe \ + share/licenses/pkgconf/COPYING; do + grep -qx "$path" <<< "$windows_core" || { + printf 'the Windows core package lost %s\n' "$path" >&2 + exit 1 + } +done for entries in "$windows_core" "$windows_client"; do grep -q '^usr/' <<< "$entries" && {