summary refs log tree commit diff
path: root/pkgs/os-specific/linux/syslinux/default.nix
blob: b9896888c10cf12f071a92ae62cd8b768b1936d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{stdenv, fetchurl, nasm, perl}:

stdenv.mkDerivation {
  name = "syslinux-3.31";
  src = fetchurl {
    url = http://www.nl.kernel.org/pub/linux/utils/boot/syslinux/syslinux-3.31.tar.bz2;
    sha256 = "1w0hw28w97mj27h4w64wn9bi24zcff1i8ifcxnbh4iing1pcmi2p";
  };
  buildInputs = [nasm perl];

  preBuild = "
    makeFlagsArray=(BINDIR=$out/bin SBINDIR=$out/sbin LIBDIR=$out/lib INCDIR=$out/include)

    # Really dirty hack to get syslinux to build without needing a GCC
    # with 32-bit libraries and headers.
    if test \"$system\" = x86_64-linux; then
        substituteInPlace memdisk/Makefile \\
            --replace 'all: memdisk e820test' 'all: memdisk'
        mkdir gnu
        touch gnu/stubs-32.h
    fi
  ";
}