From 6fd2b327e550a0b33d23ca02df120bf58b97ab94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sun, 17 Apr 2022 00:16:10 +0700 Subject: [PATCH] refind: update to 0.13.3.1. --- .../patches/refind-install-abs-path.patch | 113 ++++++++++++++++++ srcpkgs/refind/template | 56 ++++----- 2 files changed, 134 insertions(+), 35 deletions(-) create mode 100644 srcpkgs/refind/patches/refind-install-abs-path.patch diff --git a/srcpkgs/refind/patches/refind-install-abs-path.patch b/srcpkgs/refind/patches/refind-install-abs-path.patch new file mode 100644 index 00000000000..22f30cbce01 --- /dev/null +++ b/srcpkgs/refind/patches/refind-install-abs-path.patch @@ -0,0 +1,113 @@ +Index: refind-0.13.3.1/refind-install +=================================================================== +--- refind-0.13.3.1.orig/refind-install ++++ refind-0.13.3.1/refind-install +@@ -342,19 +342,8 @@ DeterminePlatform() { + # $ThisDir to point to the directory in which this script resides, + # and $RefindDir to point to where the rEFInd binaries live + CheckForFiles() { +- # Note: $ThisDir points to real (not symlinked) script home on Linux, +- # enabling creating a symlink in /usr/sbin (or wherever); but on OS X, +- # "readlink" doesn't do the same thing as under Linux, so the script +- # must not be a symlink under OS X. +- case "$OSTYPE" in +- darwin*) +- ThisDir="$( cd -P "${BASH_SOURCE%/*}" && pwd )" +- ;; +- linux*) +- ThisDir="$(dirname "$(readlink -f "$0")")" +- ;; +- esac +- RefindDir="$ThisDir/refind" ++ ThisDir="/do/not/use/this/var" ++ RefindDir="/usr/share/refind" + + if [[ ! -f "$RefindDir/refind_$Platform.efi" ]] ; then + echo "The rEFInd binary file is missing! Aborting installation!" +@@ -363,8 +352,6 @@ CheckForFiles() { + + if [[ -f "$RefindDir/refind.conf-sample" ]] ; then + ConfFile="$RefindDir/refind.conf-sample" +- elif [[ -f "$ThisDir/refind.conf-sample" ]] ; then +- ConfFile="$ThisDir/refind.conf-sample" + else + echo "The sample configuration file is missing! Aborting installation!" + exit 1 +@@ -372,8 +359,6 @@ CheckForFiles() { + + if [[ -d "$RefindDir/icons" ]] ; then + IconsDir="$RefindDir/icons" +- elif [[ -d "$ThisDir/icons" ]] ; then +- IconsDir="$ThisDir/icons" + else + echo "The icons directory is missing! Aborting installation!" + exit 1 +@@ -603,7 +588,6 @@ SetBootFS() { + CopyDrivers() { + if [[ $InstallDrivers == "all" ]] ; then + mkdir -p "$InstallDir/$TargetDir/drivers_$1" +- cp "$ThisDir"/drivers_"$1"/*_"$1".efi "$InstallDir/$TargetDir/drivers_$1/" 2> /dev/null + cp "$RefindDir"/drivers_"$1"/*_"$1".efi "$InstallDir/$TargetDir/drivers_$1/" 2> /dev/null + elif [[ "$InstallDrivers" == "boot" ]] ; then + SetBootFS +@@ -628,7 +612,6 @@ CopyDrivers() { + if [[ -n $BootFS ]] ; then + echo "Installing driver for $BootFS (${DriverType}_$1.efi)" + mkdir -p "$InstallDir/$TargetDir/drivers_$1" +- cp "$ThisDir/drivers_$1/${DriverType}_$1.efi" "$InstallDir/$TargetDir/drivers_$1/" 2> /dev/null + cp "$RefindDir/drivers_$1/${DriverType}_$1.efi" "$InstallDir/$TargetDir/drivers_$1"/ 2> /dev/null + fi + fi +@@ -669,7 +652,6 @@ CopyRefindFiles() { + fi + if [[ $InstallDrivers == "all" ]] ; then + cp -r "$RefindDir"/drivers_* "$InstallDir/$TargetDir/" 2> /dev/null +- cp -r "$ThisDir"/drivers_* "$InstallDir/$TargetDir/" 2> /dev/null + elif [[ $Upgrade == 1 || $InstallToEspOnMac == 1 ]] ; then + CopyDrivers "$Platform" + CopyTools "$Platform" +@@ -693,8 +675,8 @@ CopyRefindFiles() { + if [[ $LocalKeys == 0 ]] ; then + echo "Storing copies of rEFInd Secure Boot public keys in $EtcKeysDir" + mkdir -p "$EtcKeysDir" +- cp "$ThisDir/keys/refind.cer" "$EtcKeysDir" 2> /dev/null +- cp "$ThisDir/keys/refind.crt" "$EtcKeysDir" 2> /dev/null ++ cp "$RefindDir/keys/refind.cer" "$EtcKeysDir" 2> /dev/null ++ cp "$RefindDir/keys/refind.crt" "$EtcKeysDir" 2> /dev/null + fi + fi + if [[ "$TargetDir" == '/System/Library/CoreServices' ]] ; then +@@ -731,7 +713,7 @@ CopyRefindFiles() { + Problems=1 + fi + mkdir -p "$InstallDir/$TargetDir/keys" +- cp -rf "$ThisDir"/keys/*.[cd]er "$InstallDir/$TargetDir/keys/" 2> /dev/null ++ cp -rf "$RefindDir"/keys/*.[cd]er "$InstallDir/$TargetDir/keys/" 2> /dev/null + cp -rf "$EtcKeysDir"/*.[cd]er "$InstallDir/$TargetDir/keys/" 2> /dev/null + if [[ -f "$InstallDir/$TargetDir/refind.conf" ]] ; then + echo "Existing refind.conf file found; copying sample file as refind.conf-sample" +@@ -1139,14 +1121,12 @@ ReSignBinaries() { + GenerateKeys + mkdir -p "$TempDir/drivers_$Platform" + cp "$RefindDir/refind.conf-sample $TempDir" 2> /dev/null +- cp "$ThisDir/refind.conf-sample $TempDir" 2> /dev/null + cp "$RefindDir/refind_ia32.efi $TempDir" 2> /dev/null + cp -a "$RefindDir/drivers_ia32 $TempDir" 2> /dev/null +- cp -a "$ThisDir/drivers_ia32 $TempDir" 2> /dev/null + SignOneBinary "$RefindDir/refind_$Platform.efi" "$TempDir/refind_$Platform.efi" + SaveIFS=$IFS + IFS=$(echo -en "\n\b") +- for Driver in $(ls "$RefindDir"/drivers_$Platform/*.efi "$ThisDir"/drivers_$Platform/*.efi 2> /dev/null) ; do ++ for Driver in $(ls "$RefindDir"/drivers_$Platform/*.efi 2> /dev/null) ; do + TempName=$(basename "$Driver") + SignOneBinary "$Driver" "$TempDir/drivers_$Platform/$TempName" + done +@@ -1403,7 +1383,7 @@ InstallSBKey() { + if [ "$LocalKeys" == "1" ] ; then + UsedDerKey="$DerKey" + else +- UsedDerKey="$ThisDir/keys/refind.cer" ++ UsedDerKey="$RefindDir/keys/refind.cer" + fi + if command -v mokutil &>/dev/null ; then + if mokutil --test-key "$UsedDerKey" &> /dev/null ; then diff --git a/srcpkgs/refind/template b/srcpkgs/refind/template index 49d46290752..bec621c4e3a 100644 --- a/srcpkgs/refind/template +++ b/srcpkgs/refind/template @@ -1,6 +1,6 @@ # Template file for 'refind' pkgname=refind -version=0.13.2 +version=0.13.3.1 revision=1 archs="x86_64* i686* aarch64*" makedepends="gnu-efi-libs" @@ -10,27 +10,10 @@ maintainer="Đoàn Trần Công Danh " license="GPL-3.0-only, BSD-3-Clause, BSD-2-Clause, GPL-2.0-only, LGPL-2.1-only" homepage="https://sourceforge.net/projects/refind/" distfiles="${SOURCEFORGE_SITE}/refind/refind-src-${version}.tar.gz" -checksum=dd58944854a42df5a2a943f15e5dcfd995808f28580df96ad39d68fb1e48c970 +checksum=7a3e3f0f81bd4ae95f24e120f44e01319231f488fef7cc8bf03a1aea23c6cfd1 python_version=2 conf_files="/etc/default/refind-kernel-hook.conf" - -post_extract() { - vsed -e 's|RefindDir=\"\$ThisDir/refind\"|RefindDir="/usr/share/refind"|g' \ - -i refind-install - - # Patch paths to libaries and includes for cross-compiling - vsed \ - -e "s|^EFIINC.*|EFIINC = ${XBPS_CROSS_BASE}/usr/include/efi|" \ - -e "s|^GNUEFILIB.*|GNUEFILIB = ${XBPS_CROSS_BASE}/usr/lib|" \ - -e "s|^EFILIB.*|EFILIB = ${XBPS_CROSS_BASE}/usr/lib|" \ - -e "s|^EFICRT0.*|EFICRT0 = ${XBPS_CROSS_BASE}/usr/lib|" \ - -i Make.common - - # Only this file is written in python3 - # All other files are python2 - vsed -e '1s,^.*python3$,#!/usr/bin/python3,' \ - -i refind-mkdefault -} +make_dirs="/etc/refind.d/keys 0755 root root" do_build() { unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS @@ -44,7 +27,12 @@ do_build() { export CROSS_COMPILE="${XBPS_CROSS_TRIPLET}-" fi - make ARCH=${_ARCH} gnuefi fs_gnuefi + make ARCH=${_ARCH} \ + EFIINC=${XBPS_CROSS_BASE}/usr/include/efi \ + GNUEFILIB=${XBPS_CROSS_BASE}/usr/lib \ + EFILIB=${XBPS_CROSS_BASE}/usr/lib \ + EFICRT0=${XBPS_CROSS_BASE}/usr/lib \ + gnuefi fs_gnuefi } do_install() { @@ -67,27 +55,25 @@ do_install() { vdoc README.txt vdoc CREDITS.txt vdoc NEWS.txt - vcopy docs/refind /usr/share/doc/refind - vcopy docs/Styles /usr/share/doc/refind + vcopy docs/refind usr/share/doc/refind + vcopy docs/Styles usr/share/doc/refind vman docs/man/mkrlconf.8 vman docs/man/mvrefind.8 vman docs/man/refind-install.8 vman docs/man/refind-mkdefault.8 - vmkdir usr/share/refind - vcopy refind/refind_${_EFI_ARCH}.efi /usr/share/refind/ - vcopy refind.conf-sample /usr/share/refind/ - vcopy fonts /usr/share/refind/ - vcopy icons /usr/share/refind/ - vcopy banners /usr/share/refind/ - vcopy images /usr/share/refind/ - vcopy drivers_${_EFI_ARCH} /usr/share/refind/ - vmkdir usr/share/refind/tools_${_EFI_ARCH} - vcopy gptsync/gptsync_${_EFI_ARCH}.efi /usr/share/refind/tools_${_EFI_ARCH}/ + vinstall refind/refind_${_EFI_ARCH}.efi 644 usr/share/refind/ + vinstall refind.conf-sample 644 usr/share/refind/ + vcopy keys usr/share/refind + vcopy fonts usr/share/refind/ + vcopy icons usr/share/refind/ + vcopy banners usr/share/refind/ + vcopy images usr/share/refind/ + vcopy drivers_${_EFI_ARCH} usr/share/refind/ + vinstall gptsync/gptsync_${_EFI_ARCH}.efi 644 \ + usr/share/refind/tools_${_EFI_ARCH}/ - vmkdir etc/refind.d - vcopy keys /etc/refind.d/ vinstall "${FILESDIR}/refind-kernel-hook.conf" 644 etc/default vinstall ${FILESDIR}/kernel.post-install 744 \