smlinux/base/syslinux/syslinux.SMBuild
PktSurf 1ddfe9abba * Fixed indentation in base/docbook build file
* Replaced patch command with applypatch function in multiple build files in base, xorg, gtk, extra and xfce sections
2022-02-23 23:21:55 +05:30

84 lines
3.7 KiB
Text
Executable file

app=syslinux
version=6.03
build=1sml
homepage="https://wiki.syslinux.org/wiki/index.php?title=The_Syslinux_Project"
desc="boot loader for the linux operating system which boots off of MS-DOS Windows FAT filesystem"
requires="musl"
build() {
compileonlyfor x86_64
mkandenterbuilddir
rm -rf $app-$version
tar xf $srcdir/$app-$version.tar.?z*
cd $app-$version
fixbuilddirpermissions
applypatch $srcdir/syslinux6-ext4_fix_64bit_feature.patch
# We don't use sbin
sed -i 's,/sbin,/bin,' syslinux.spec mk/syslinux.mk
# Exclude windows stuff and mtools and others
sed 's|INSTALLSUBDIRS = com32 utils dosutil|INSTALLSUBDIRS = com32 utils|g' -i Makefile
sed '/DIAGDIR/d' -i Makefile
# Windows stuff not needed.
sed 's|diag libinstaller dos win32 win64 dosutil txt|libinstaller txt|g' -i Makefile
sed 's|win32/syslinux.exe win64/syslinux64.exe||g' -i Makefile
sed 's|dosutil/\*.com dosutil/\*.sys||g' -i Makefile
sed 's|dos/syslinux.com||g' -i Makefile
sed 's|gpxe/gpxelinuxk*\.0||g' -i Makefile
# We dont want the perl-based utils
# They also pull in the isohybrid mbrs
sed "s|utils/[a-z]*||g" -i Makefile
# rarely used COM32 Modules
sed "s,com32/modules/\*.c32,," -i Makefile
sed "s,com32/hdt/\*.c32,," -i Makefile
sed "s,com32/rosh/\*.c32,," -i Makefile
sed "s,com32/gfxboot/\*.c32,," -i Makefile
sed "s,com32/sysdump/\*.c32,," -i Makefile
sed "s,com32/lua/src/\*.c32,," -i Makefile
sed "s,com32/gpllib/\*.c32,," -i Makefile
sed "s,com32/cmenu/libmenu/\*.c32,," -i Makefile
# Exclude perl utils from being installed
sed '/DIRS/ s/utils//' -i Makefile
sed -i 's,#include <getkey.h>,#include "include/getkey.h",' com32/libutil/keyname.c
sed -i 's,#include <libutil.h>,#include "include/libutil.h",' com32/libutil/keyname.c
sed -i 's,#include "sha1.h",#include "include/sha1.h",' com32/libutil/sha1hash.c
sed -i 's,#include <base64.h>,#include "include/base64.h",' com32/libutil/unbase64.c
sed -i 's,#include <md5.h>,#include "include/md5.h",' com32/libutil/md5.c
sed -i 's,#include <md5.h>,#include "include/md5.h",' com32/libutil/crypt-md5.c
sed -i 's,#include <minmax.h>,#include "include/minmax.h",' com32/libutil/sha256crypt.c
sed -i 's,#include "xcrypt.h",#include "include/xcrypt.h",' com32/libutil/sha256crypt.c
sed -i 's,#include <minmax.h>,#include "include/minmax.h",' com32/libutil/sha512crypt.c
sed -i 's,#include "xcrypt.h",#include "include/xcrypt.h",' com32/libutil/sha512crypt.c
sed -i 's,#include <base64.h>,#include "include/base64.h",' com32/libutil/base64.c
sed -i '/herror.*/d' utils/gethostip.c
sed -ri 's,__uint([0-9]+)_t,uint\1_t,g' efi/wrapper.c
sed -ri 's,__uint([0-9]+)_t,uint\1_t,g' efi/wrapper.h
PREFIXED_PATHS="BINDIR='/bin' LIBDIR='/lib' DATADIR='/share' MANDIR='/share/man' INCDIR='/include'"
make CC="gcc -I/include -include sys/sysmacros.h" $PREFIXED_PATHS AUXDIR="/lib/syslinux/bios" INSTALLROOT="$pkg" -j1 bios installer
make $PREFIXED_PATHS AUXDIR="/lib/syslinux/bios" INSTALLROOT="$pkg" -j1 bios install
make CC="gcc -I/include -include sys/sysmacros.h" $PREFIXED_PATHS AUXDIR="/lib/syslinux/bios" INSTALLROOT="$pkg" efi64 installer
make CC="gcc -I/include -include sys/sysmacros.h" $PREFIXED_PATHS AUXDIR="/lib/syslinux/bios" INSTALLROOT="$pkg" -j1 efi64 install
# copy the smlinux bootloader configuration
install -Dm 0644 $srcdir/extlinux.conf.smlinux $pkg/boot/extlinux.conf.sample
cp COPYING $pkgdocs/LICENSE
mkfinalpkg
}
sha512sums="
5740536857c7789304ff00fc568fdce18ed3b2e09cf3623f08df7f46144ccc87248b618934d9fa092b99ceab054698b3e0250fd70a664b631da28bf3612b8160 syslinux-6.03.tar.lz
1ecba0810415963707099143de74ea5c9e41e38b200da2de57ceee29914b1eaeebc58b1cf14738f0b7bd4d37695a8490adb8a9f1b4f35ff4ad1f34c816db54da syslinux6-ext4_fix_64bit_feature.patch
"