@@ -0,0 +1,35 @@
1+{ stdenv, fetchurl, unzip, nasm }:
2+
3+let arch =
4+ if stdenv.isi686 then "i386"
5+ else if stdenv.isx86_64 then "x86_64"
6+ else abort "Unknown architecture";
7+in stdenv.mkDerivation {
8+ name = "grub4dos-0.4.6a";
9+
10+ src = fetchurl {
11+ url = https://github.com/chenall/grub4dos/archive/e855b293432bd4d155e42d48356f9aa1974ec385.zip;
12+ sha256 = "1vihzllsdshd5dyr7i7dp5ragyg77gg8r279pz954p7lkcda4kx7";
13+ };
14+
15+ nativeBuildInputs = [ unzip nasm ];
16+
17+ configureFlags = [ "--host=${arch}-pc-linux-gnu" ];
18+
19+ postInstall = ''
20+ mv $out/lib/grub/${arch}-pc/* $out/lib/grub
21+ rmdir $out/lib/grub/${arch}-pc
22+ chmod +x $out/lib/grub/bootlace.com
23+ '';
24+
25+ dontStrip = true;
26+ dontPatchELF = true;
27+
28+ meta = with stdenv.lib; {
29+ homepage = http://grub4dos.chenall.net/;
30+ description = "GRUB for DOS is the dos extension of GRUB";
31+ maintainers = with maintainers; [ abbradar ];
32+ platforms = platforms.all;
33+ license = licenses.gpl2;
34+ };
35+}