2020-01-14 22:01:57 +00:00
|
|
|
{ stdenv, fetchFromRepoOrCz, fetchurl, nasm, perl, python3, libuuid, mtools, makeWrapper }:
|
2006-10-12 16:09:27 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2020-01-14 22:01:57 +00:00
|
|
|
name = "syslinux-2019-02-07";
|
2013-01-28 14:45:33 +00:00
|
|
|
|
2020-01-14 22:01:57 +00:00
|
|
|
# This is syslinux-6.04-pre3^1; syslinux-6.04-pre3 fails to run.
|
|
|
|
# Same issue here https://www.syslinux.org/archives/2019-February/026330.html
|
|
|
|
src = fetchFromRepoOrCz {
|
2015-11-11 09:30:17 +00:00
|
|
|
repo = "syslinux";
|
2020-01-14 22:01:57 +00:00
|
|
|
rev = "b40487005223a78c3bb4c300ef6c436b3f6ec1f7";
|
|
|
|
sha256 = "1qrxl1114sr2i2791z9rf8v53g200aq30f08808d7i8qnmgvxl2w";
|
2006-10-12 16:09:27 +01:00
|
|
|
};
|
2007-01-22 19:14:50 +00:00
|
|
|
|
2019-01-29 21:12:54 +00:00
|
|
|
patches = let
|
|
|
|
mkURL = commit: patchName:
|
|
|
|
"https://salsa.debian.org/images-team/syslinux/raw/${commit}/debian/patches/"
|
|
|
|
+ patchName;
|
|
|
|
in [
|
2019-02-19 11:01:27 +00:00
|
|
|
(fetchurl {
|
2020-01-14 22:01:57 +00:00
|
|
|
url = mkURL "fa1349f1" "0002-gfxboot-menu-label.patch";
|
|
|
|
sha256 = "06ifgzbpjj4picpj17zgprsfi501zf4pp85qjjgn29i5rs291zni";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
url = mkURL "477e56d2" "0005-gnu-efi-version-compatibility.patch";
|
|
|
|
sha256 = "041568b4abb79wynyps1n04lg4fr26rc3sbjncz99pp0mbz0ajlm";
|
2019-02-19 11:01:27 +00:00
|
|
|
})
|
2019-01-29 21:12:54 +00:00
|
|
|
(fetchurl {
|
|
|
|
# mbr.bin: too big (452 > 440)
|
|
|
|
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414
|
|
|
|
url = mkURL "7468ef0e38c43" "0016-strip-gnu-property.patch";
|
|
|
|
sha256 = "17n63b8wz6szv8npla1234g1ip7lqgzx2whrpv358ppf67lq8vwm";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
# mbr.bin: too big (452 > 440)
|
|
|
|
url = mkURL "012e1dd312eb" "0017-single-load-segment.patch";
|
|
|
|
sha256 = "0azqzicsjw47b9ppyikhzaqmjl4lrvkxris1356bkmgcaiv6d98b";
|
|
|
|
})
|
2020-01-14 22:01:57 +00:00
|
|
|
(fetchurl {
|
|
|
|
url = mkURL "26f0e7b2" "0018-prevent-pow-optimization.patch";
|
|
|
|
sha256 = "1c8g0jz5yj9a0rsmryx9vdjsw4hw8mjfcg05c9pmyjg85w3dfp3m";
|
|
|
|
})
|
2019-02-19 11:01:27 +00:00
|
|
|
];
|
|
|
|
|
2018-08-08 22:27:57 +01:00
|
|
|
postPatch = ''
|
2014-06-19 01:54:19 +01:00
|
|
|
substituteInPlace Makefile --replace /bin/pwd $(type -P pwd)
|
2017-07-21 22:51:53 +01:00
|
|
|
substituteInPlace utils/ppmtolss16 --replace /usr/bin/perl $(type -P perl)
|
2018-08-08 22:27:57 +01:00
|
|
|
|
|
|
|
# fix tests
|
|
|
|
substituteInPlace tests/unittest/include/unittest/unittest.h \
|
|
|
|
--replace /usr/include/ ""
|
2014-06-19 01:54:19 +01:00
|
|
|
'';
|
2013-01-28 14:45:33 +00:00
|
|
|
|
2020-01-14 22:01:57 +00:00
|
|
|
nativeBuildInputs = [ nasm perl python3 ];
|
2018-08-08 22:27:57 +01:00
|
|
|
buildInputs = [ libuuid makeWrapper ];
|
|
|
|
|
|
|
|
enableParallelBuilding = false; # Fails very rarely with 'No rule to make target: ...'
|
|
|
|
hardeningDisable = [ "pic" "stackprotector" "fortify" ];
|
|
|
|
|
2015-10-14 13:27:13 +01:00
|
|
|
stripDebugList = "bin sbin share/syslinux/com32";
|
|
|
|
|
2014-06-19 01:54:19 +01:00
|
|
|
makeFlags = [
|
|
|
|
"BINDIR=$(out)/bin"
|
|
|
|
"SBINDIR=$(out)/sbin"
|
|
|
|
"LIBDIR=$(out)/lib"
|
|
|
|
"INCDIR=$(out)/include"
|
|
|
|
"DATADIR=$(out)/share"
|
|
|
|
"MANDIR=$(out)/share/man"
|
|
|
|
"PERL=perl"
|
|
|
|
"bios"
|
|
|
|
];
|
|
|
|
|
2018-08-08 22:27:57 +01:00
|
|
|
doCheck = false; # fails. some fail in a sandbox, others require qemu
|
|
|
|
|
2015-12-08 09:59:48 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/syslinux \
|
|
|
|
--prefix PATH : "${mtools}/bin"
|
2018-05-23 18:59:42 +01:00
|
|
|
|
|
|
|
# Delete com32 headers to save space, nobody seems to be using them
|
|
|
|
rm -rf $out/share/syslinux/com32
|
2015-12-08 09:59:48 +00:00
|
|
|
'';
|
|
|
|
|
2014-06-19 01:54:19 +01:00
|
|
|
meta = with stdenv.lib; {
|
2013-01-28 14:45:33 +00:00
|
|
|
homepage = http://www.syslinux.org/;
|
|
|
|
description = "A lightweight bootloader";
|
2014-06-19 01:54:19 +01:00
|
|
|
license = licenses.gpl2;
|
2019-02-10 04:20:56 +00:00
|
|
|
maintainers = [ maintainers.samueldr ];
|
2017-09-13 13:14:30 +01:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2013-01-28 14:45:33 +00:00
|
|
|
};
|
2006-10-12 16:09:27 +01:00
|
|
|
}
|