jobcore/syslinux/PKGBUILD

123 lines
5.2 KiB
Text
Raw Normal View History

2023-09-10 02:57:04 +02:00
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=syslinux
pkgver=6.04.pre2.r11.gbf6db5b4
#_tag=syslinux-$pkgver
_commit=bf6db5b4
pkgrel=04
pkgdesc='Collection of boot loaders that boot from FAT, ext2/3/4 and btrfs filesystems, from CDs and via PXE'
url='https://www.syslinux.org/'
backup=(boot/syslinux/syslinux.cfg)
install=syslinux.install
# syslinux build system is a mess of submakes that does not work with -jN
# efi32/com32 do not like Arch cflags/ldflags, though it would be nice to have the flags for userspace tools
options=(!makeflags !buildflags)
makedepends=(git python nasm upx asciidoc)
makedepends_x86_64=(lib32-glibc) # efi32 needs it
optdepends=('perl-crypt-passwdmd5: For md5pass'
'perl-digest-sha1: For sha1pass'
'mtools: For mkdiskimage and syslinux support'
'gptfdisk: For GPT support'
'util-linux: For isohybrid'
'efibootmgr: For EFI support'
'dosfstools: For EFI support')
# The syslinux-install_update script is maintained at https://gist.github.com/pyther/772138
# Script not yet updated for syslinux-efi
source=(git+https://repo.or.cz/syslinux.git#commit=$_commit
syslinux.cfg
syslinux-install_update
splash.png
0002-gfxboot-menu-label.patch
0005-gnu-efi-version-compatibility.patch
0017-single-load-segment.patch
0004-gnu-efi-from-arch.patch
0016-strip-gnu-property.patch
0018-prevent-pow-optimization.patch
0025-reproducible-build.patch
0005-Workaround-multiple-definition-of-symbol-errors.patch
0006-Replace-builtin-strlen-that-appears-to-get-optimized.patch)
_targets='bios efi32 efi64'
pkgver() {
cd syslinux
git describe --long | sed 's/^syslinux-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd syslinux
patch -p1 < ../0002-gfxboot-menu-label.patch
patch -p1 < ../0017-single-load-segment.patch
patch -p1 < ../0016-strip-gnu-property.patch
patch -p1 < ../0018-prevent-pow-optimization.patch
# TODO: use 'gnu-efi-libs' package instead of embedded sources
#patch -p1 < ../0004-gnu-efi-from-arch.patch
#patch -p1 < ../0005-gnu-efi-version-compatibility.patch
patch -p1 < ../0025-reproducible-build.patch
patch -p1 < ../0005-Workaround-multiple-definition-of-symbol-errors.patch
patch -p1 < ../0006-Replace-builtin-strlen-that-appears-to-get-optimized.patch
# do not swallow efi compilation output to make debugging easier
sed 's|> /dev/null 2>&1||' -i efi/check-gnu-efi.sh
# disable debug and development flags to reduce bootloader size
truncate --size 0 mk/devel.mk
}
build() {
cd syslinux
export LDFLAGS+=--no-dynamic-linker # workaround for binutils 2.28 http://www.syslinux.org/wiki/index.php?title=Building
export EXTRA_CFLAGS=-fno-PIE # to fix gpxe build
make PYTHON=python $_targets
}
package() {
cd syslinux
make $_targets install INSTALLROOT="$pkgdir" SBINDIR=/usr/bin MANDIR=/usr/share/man AUXDIR=/usr/lib/syslinux
rm -r "$pkgdir"/usr/lib/syslinux/{com32,dosutil,syslinux.com}
install -D -m644 COPYING "$pkgdir"/usr/share/licenses/syslinux/COPYING
install -d "$pkgdir"/usr/share/doc
cp -ar doc "$pkgdir"/usr/share/doc/syslinux
install -d "$pkgdir"/usr/lib/syslinux/bios
mv "$pkgdir"/usr/lib/syslinux/{*.bin,*.c32,*.0,memdisk} "$pkgdir"/usr/lib/syslinux/bios
install -D -m0644 ../syslinux.cfg "$pkgdir"/boot/syslinux/syslinux.cfg
install -D -m0644 ../splash.png "$pkgdir"/boot/syslinux/splash.png
install -D -m0755 ../syslinux-install_update "$pkgdir"/usr/bin/syslinux-install_update
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=(GPL2)
sha256sums=(SKIP
a341c4724ce09e198c7d517418f0db1bbfa0b2f9e98499cce8543cfb7f49886a # syslinux.cfg
093cdbca2f52b24599f414573d5e56747739c5a2185dca711bef1255dfba90b6 # syslinux-install_update
16413f7f689155319804c1bd964ae9047d1b682b28386b2441d849fc14031da7 # splash.png
d1fe9084ce2526619f94b8a07b89fb0194e874beef9f202f8b974879d77f2e1a # 0002-gfxboot-menu-label.patch
8610959df6c01568ff478ca1eb4aac301f3ba1f5bd4739daaec072865e8be2d7 # 0005-gnu-efi-version-compatibility.patch
5b017ba5eae77caa09fa5af6ecfa0df1e7e22776b2b13c8744c6cb7ecd7ad0e9 # 0017-single-load-segment.patch
cf3c3da9300d6ea70eab5b8dca724ce03a3651bd63fb0168594dcfeb35eec11c # 0004-gnu-efi-from-arch.patch
7facb5c2abc71c9bfe01bf4db388306ed7b7abf6654009af336262839527f962 # 0016-strip-gnu-property.patch
755cd7062fe8495f6f62053ce664451c12ae65dba9fb5c75062a495fbe040fb1 # 0018-prevent-pow-optimization.patch
9a76f6f75a42485bc337163ba38068b09f7889bdc1a4e191408898f10de36662 # 0025-reproducible-build.patch
7e41e17e8cbc7287d6c3c9eb0a7b682cd8d3252030856b338050c21dff9bf05a # 0005-Workaround-multiple-definition-of-symbol-errors.patch
d7410d0ff89a15e2a100faf1546d730e043dde15c295974564144e00a93f03a3) # 0006-Replace-builtin-strlen-that-appears-to-get-optimized.patch)
## fa71cd3c73ea9b00cb441b495b17385e63074fdcdd75aaf8e700cc9c476125d5 syslinux-6.04.pre2.r11.gbf6db5b4-04-x86_64.pkg.tar.lz