pkgname=syslinux pkgver=6.04.pre3.r3.g05ac953c pkgrel=1 pkgdesc="Kernel loader which uses a FAT, ext2/3 or iso9660 filesystem or a PXE network" arch=('x86_64') url="https://www.syslinux.org" license=('GPL-2.0-or-later') depends=('glibc') makedepends=('git' 'nasm' 'mtools' 'perl' 'python' 'python-asciidoc' 'upx') options=('!makeflags' '!buildflags') install=${pkgname}.install source=(git+https://repo.or.cz/syslinux.git#commit=05ac953c23f90b2328d393f7eecde96e41aed067 syslinux.cfg syslinux-install_update 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 0026-add-missing-include.patch 0027-use-correct-type-for-size.patch) sha256sums=(deec61086a2cb73163d50e150d1ef32bd56c8a3faa1fc4322d11080ba0cbe63a 2a82eb0bffe92c1909c46c66401e24fb9c1219f71e271e5d94f3b294a596e7d5 6de61df1173fefa0a072892b56ec5b8dedf37686137e3ba62af5ab8b1dc9a818 d1fe9084ce2526619f94b8a07b89fb0194e874beef9f202f8b974879d77f2e1a 8610959df6c01568ff478ca1eb4aac301f3ba1f5bd4739daaec072865e8be2d7 5b017ba5eae77caa09fa5af6ecfa0df1e7e22776b2b13c8744c6cb7ecd7ad0e9 cf3c3da9300d6ea70eab5b8dca724ce03a3651bd63fb0168594dcfeb35eec11c 7facb5c2abc71c9bfe01bf4db388306ed7b7abf6654009af336262839527f962 755cd7062fe8495f6f62053ce664451c12ae65dba9fb5c75062a495fbe040fb1 9a76f6f75a42485bc337163ba38068b09f7889bdc1a4e191408898f10de36662 7e41e17e8cbc7287d6c3c9eb0a7b682cd8d3252030856b338050c21dff9bf05a d7410d0ff89a15e2a100faf1546d730e043dde15c295974564144e00a93f03a3 e16e051d17ead7e6457a479a1e2226160ca9aae3d607c0c25fa3677522aa9280 7f2ce9e16ddcca1a55b32bddfd39c7f190eed9d8df4319bbd6b07e0a2607e662) pkgver() { cd ${pkgname} git describe --long | sed 's/^syslinux-//;s/\([^-]*-g\)/r\1/;s/-/./g' } prepare() { cd ${pkgname} git revert -n 458a54133ecdf1685c02294d812cb562fe7bf4c3 patch -p1 < ${srcdir}/0002-gfxboot-menu-label.patch patch -p1 < ${srcdir}/0017-single-load-segment.patch patch -p1 < ${srcdir}/0016-strip-gnu-property.patch patch -p1 < ${srcdir}/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 < ${srcdir}/0025-reproducible-build.patch patch -p1 < ${srcdir}/0005-Workaround-multiple-definition-of-symbol-errors.patch patch -p1 < ${srcdir}/0006-Replace-builtin-strlen-that-appears-to-get-optimized.patch patch -p1 < ${srcdir}/0026-add-missing-include.patch patch -p1 < ${srcdir}/0027-use-correct-type-for-size.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 ${pkgname} export CC="${CHOST}-gcc" export CXX="${CHOST}-g++" 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 clean make PYTHON=python3 efi64 bios } package() { cd ${pkgname} make efi64 bios install INSTALLROOT=${pkgdir} SBINDIR=/usr/sbin MANDIR=/usr/share/man AUXDIR=/usr/lib/syslinux rm -r ${pkgdir}/usr/lib/syslinux/{com32,dosutil,syslinux.com} 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}/usr/share/syslinux/syslinux.cfg install -D -m0755 ../syslinux-install_update ${pkgdir}/usr/bin/syslinux-install_update }