void-packages/srcpkgs/refind/template
Đoàn Trần Công Danh 51711d3c44 refind: enable page_poison by default, rewrite hook
- both efibootmgr and grub enable page_poison by default.
  Let's enable it with refind, too
- The old post-install hook was written (by me, myself)
  was originally written in ed, and converted to ugly-and-lengthy
  while-read-echo sh.
  Both base-minimal, base-system, and base-chroot provides some kind
  of awk, let's rewrite it in awk.
2020-02-20 10:07:27 +01:00

93 lines
2.6 KiB
Bash

# Template file for 'refind'
pkgname=refind
version=0.11.4
revision=4
makedepends="gnu-efi-libs git"
depends="bash dosfstools efibootmgr"
short_desc="EFI boot manager utility"
maintainer="Julio Galvan <juliogalvan@protonmail.com>"
license="GPL-3.0-only, BSD-3-Clause"
homepage="https://sourceforge.net/projects/refind/"
distfiles="${SOURCEFORGE_SITE}/refind/refind-src-${version}.tar.gz"
checksum=39baf140603951da098238c1cbf4176fdd7d4a45fab0399e9985ad7368034dae
conf_files="/etc/default/refind-kernel-hook.conf"
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*|aarch64*) ;;
*) broken="${XBPS_TARGET_MACHINE} is unsupported" ;;
esac
post_extract() {
sed 's|RefindDir=\"\$ThisDir/refind\"|RefindDir="/usr/share/refind"|g' -i refind-install
# Patch paths to libaries and includes for cross-compiling
sed -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
}
do_build() {
unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
case "$XBPS_TARGET_MACHINE" in
i686*) _ARCH="ia32";;
*) _ARCH="${XBPS_TARGET_MACHINE%-musl}";;
esac
if [ "$CROSS_BUILD" ]; then
export CROSS_COMPILE="${XBPS_CROSS_TRIPLET}-"
fi
make ARCH=${_ARCH} gnuefi fs_gnuefi
}
do_install() {
case "$XBPS_TARGET_MACHINE" in
i686*) _EFI_ARCH="ia32";;
x86_64*) _EFI_ARCH="x64";;
aarch64*) _EFI_ARCH="aa64";;
esac
vbin mkrlconf
vbin mvrefind
vbin refind-mkdefault
vbin refind-install
vbin fonts/mkfont.sh refind-mkfont
vlicense LICENSE.txt
vdoc COPYING.txt
vdoc README.txt
vdoc CREDITS.txt
vdoc NEWS.txt
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}/
vmkdir etc/refind.d
vcopy keys /etc/refind.d/
vinstall "${FILESDIR}/refind-kernel-hook.conf" 644 etc/default
vinstall ${FILESDIR}/kernel.post-install 744 \
etc/kernel.d/post-install 50-refind
vinstall ${FILESDIR}/kernel.post-remove 744 \
etc/kernel.d/post-remove 50-refind
}