lol
1{ stdenv, fetchFromGitHub, nasm }:
2
3let arch =
4 if stdenv.isi686 then "i386"
5 else if stdenv.isx86_64 then "x86_64"
6 else abort "Unknown architecture";
7in stdenv.mkDerivation rec {
8 name = "grub4dos-${version}";
9 version = "0.4.6a-2016-08-06";
10
11 src = fetchFromGitHub {
12 owner = "chenall";
13 repo = "grub4dos";
14 rev = "99d6ddbe7611f942d2708d77a620d6aa94a284d1";
15 sha256 = "0gnllk0qkx6d0azf7v9cr0b23gp577avksz0f4dl3v3ldgi0dksq";
16 };
17
18 nativeBuildInputs = [ nasm ];
19
20 hardeningDisable = [ "stackprotector" ];
21
22 configureFlags = [ "--host=${arch}-pc-linux-gnu" ];
23
24 postInstall = ''
25 mv $out/lib/grub/${arch}-pc/* $out/lib/grub
26 rmdir $out/lib/grub/${arch}-pc
27 chmod +x $out/lib/grub/bootlace.com
28 '';
29
30 dontStrip = true;
31 dontPatchELF = true;
32
33 meta = with stdenv.lib; {
34 homepage = "http://grub4dos.chenall.net/";
35 description = "GRUB for DOS is the dos extension of GRUB";
36 maintainers = with maintainers; [ abbradar ];
37 platforms = platforms.linux;
38 license = licenses.gpl2;
39 };
40}