2019-02-19 12:01:27 +01:00
|
|
|
{ stdenv, fetchFromGitHub, fetchurl, nasm, perl, python, libuuid, mtools, makeWrapper }:
|
2006-10-12 17:09:27 +02:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2019-02-19 12:01:27 +01:00
|
|
|
name = "syslinux-2015-11-09";
|
2013-01-28 15:45:33 +01:00
|
|
|
|
2019-02-19 12:01:27 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "geneC";
|
2015-11-11 10:30:17 +01:00
|
|
|
repo = "syslinux";
|
2019-02-19 12:01:27 +01:00
|
|
|
rev = "0cc9a99e560a2f52bcf052fd85b1efae35ee812f";
|
|
|
|
sha256 = "0wk3r5ki4lc334f9jpml07wpl8d0bnxi9h1l4h4fyf9a0d7n4kmw";
|
2006-10-12 17:09:27 +02:00
|
|
|
};
|
2007-01-22 20:14:50 +01:00
|
|
|
|
2019-01-29 22:12:54 +01:00
|
|
|
patches = let
|
|
|
|
mkURL = commit: patchName:
|
|
|
|
"https://salsa.debian.org/images-team/syslinux/raw/${commit}/debian/patches/"
|
|
|
|
+ patchName;
|
|
|
|
in [
|
2019-02-19 12:01:27 +01:00
|
|
|
./perl-deps.patch
|
|
|
|
(fetchurl {
|
|
|
|
# ldlinux.elf: Not enough room for program headers, try linking with -N
|
|
|
|
name = "not-enough-room.patch";
|
2019-01-29 22:12:54 +01:00
|
|
|
url = mkURL "a556ad7" "0014_fix_ftbfs_no_dynamic_linker.patch";
|
2019-02-19 12:01:27 +01:00
|
|
|
sha256 = "0ijqjsjmnphmvsx0z6ppnajsfv6xh6crshy44i2a5klxw4nlvrsw";
|
|
|
|
})
|
2019-01-29 22:12:54 +01: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";
|
|
|
|
})
|
2019-02-19 12:01:27 +01:00
|
|
|
];
|
|
|
|
|
2018-08-08 23:27:57 +02:00
|
|
|
postPatch = ''
|
2014-06-19 02:54:19 +02:00
|
|
|
substituteInPlace Makefile --replace /bin/pwd $(type -P pwd)
|
2019-02-19 12:01:27 +01:00
|
|
|
substituteInPlace gpxe/src/Makefile.housekeeping --replace /bin/echo $(type -P echo)
|
2017-07-21 23:51:53 +02:00
|
|
|
substituteInPlace utils/ppmtolss16 --replace /usr/bin/perl $(type -P perl)
|
2019-02-19 12:01:27 +01:00
|
|
|
substituteInPlace gpxe/src/Makefile --replace /usr/bin/perl $(type -P perl)
|
2018-08-08 23:27:57 +02:00
|
|
|
|
|
|
|
# fix tests
|
|
|
|
substituteInPlace tests/unittest/include/unittest/unittest.h \
|
|
|
|
--replace /usr/include/ ""
|
2014-06-19 02:54:19 +02:00
|
|
|
'';
|
2013-01-28 15:45:33 +01:00
|
|
|
|
2018-08-08 23:27:57 +02:00
|
|
|
nativeBuildInputs = [ nasm perl python ];
|
|
|
|
buildInputs = [ libuuid makeWrapper ];
|
|
|
|
|
|
|
|
enableParallelBuilding = false; # Fails very rarely with 'No rule to make target: ...'
|
|
|
|
hardeningDisable = [ "pic" "stackprotector" "fortify" ];
|
|
|
|
|
2015-10-14 14:27:13 +02:00
|
|
|
stripDebugList = "bin sbin share/syslinux/com32";
|
|
|
|
|
2014-06-19 02:54:19 +02: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 23:27:57 +02:00
|
|
|
doCheck = false; # fails. some fail in a sandbox, others require qemu
|
|
|
|
|
2015-12-08 10:59:48 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/syslinux \
|
|
|
|
--prefix PATH : "${mtools}/bin"
|
2018-05-23 19:59:42 +02:00
|
|
|
|
|
|
|
# Delete com32 headers to save space, nobody seems to be using them
|
|
|
|
rm -rf $out/share/syslinux/com32
|
2015-12-08 10:59:48 +01:00
|
|
|
'';
|
|
|
|
|
2014-06-19 02:54:19 +02:00
|
|
|
meta = with stdenv.lib; {
|
2013-01-28 15:45:33 +01:00
|
|
|
homepage = http://www.syslinux.org/;
|
|
|
|
description = "A lightweight bootloader";
|
2014-06-19 02:54:19 +02:00
|
|
|
license = licenses.gpl2;
|
2019-02-10 05:20:56 +01:00
|
|
|
maintainers = [ maintainers.samueldr ];
|
2017-09-13 14:14:30 +02:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2013-01-28 15:45:33 +01:00
|
|
|
};
|
2006-10-12 17:09:27 +02:00
|
|
|
}
|