tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
syslinux: refactor
AndersonTorres
3 years ago
64ad6ef2
c24cea67
+67
-39
1 changed file
expand all
collapse all
unified
split
pkgs
os-specific
linux
syslinux
default.nix
+67
-39
pkgs/os-specific/linux/syslinux/default.nix
···
1
-
{ lib, stdenv, fetchgit, fetchurl, fetchpatch, nasm, perl, python3, libuuid, mtools, makeWrapper }:
0
0
0
0
0
0
0
0
0
0
2
3
stdenv.mkDerivation {
4
pname = "syslinux";
5
-
version = "unstable-20190207";
6
7
# This is syslinux-6.04-pre3^1; syslinux-6.04-pre3 fails to run.
8
# Same issue here https://www.syslinux.org/archives/2019-February/026330.html
9
src = fetchgit {
10
url = "https://repo.or.cz/syslinux";
11
rev = "b40487005223a78c3bb4c300ef6c436b3f6ec1f7";
12
-
sha256 = "1acf6byx7i6vz8hq6mra526g8mf7fmfhid211y8nq0v6px7d3aqs";
13
fetchSubmodules = true;
14
};
15
16
patches = let
17
-
mkURL = commit: patchName:
18
-
"https://salsa.debian.org/images-team/syslinux/raw/${commit}/debian/patches/"
19
-
+ patchName;
0
0
0
0
0
0
0
0
0
20
in [
21
-
(fetchurl {
22
-
url = mkURL "fa1349f1" "0002-gfxboot-menu-label.patch";
23
-
sha256 = "06ifgzbpjj4picpj17zgprsfi501zf4pp85qjjgn29i5rs291zni";
24
-
})
25
-
(fetchurl {
26
-
url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/821c3da473d1399d930d5b4a086e46a4179eaa45/trunk/0005-gnu-efi-version-compatibility.patch";
27
-
name = "0005-gnu-efi-version-compatibility.patch";
28
-
sha256 = "1mz2idg8cwn0mvd3jixxynhkn7rhmi5fp8cc8zznh5f0ysfra446";
29
-
})
30
-
(fetchurl {
31
-
url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/821c3da473d1399d930d5b4a086e46a4179eaa45/trunk/0025-reproducible-build.patch";
32
-
name = "0025-reproducible-build.patch";
33
-
sha256 = "0qk6wc6z3648828y3961pn4pi7xhd20a6fqn6z1mnj22bbvzcxls";
34
-
})
35
-
(fetchurl {
36
# mbr.bin: too big (452 > 440)
37
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414
38
-
url = mkURL "7468ef0e38c43" "0016-strip-gnu-property.patch";
39
-
sha256 = "17n63b8wz6szv8npla1234g1ip7lqgzx2whrpv358ppf67lq8vwm";
40
-
})
41
-
(fetchurl {
42
# mbr.bin: too big (452 > 440)
43
-
url = mkURL "012e1dd312eb" "0017-single-load-segment.patch";
44
-
sha256 = "0azqzicsjw47b9ppyikhzaqmjl4lrvkxris1356bkmgcaiv6d98b";
45
-
})
46
-
(fetchurl {
47
-
url = mkURL "26f0e7b2" "0018-prevent-pow-optimization.patch";
48
-
sha256 = "1c8g0jz5yj9a0rsmryx9vdjsw4hw8mjfcg05c9pmyjg85w3dfp3m";
49
-
})
50
-
./gcc10.patch
51
];
52
53
postPatch = ''
···
63
touch gnu-efi/inc/ia32/gnu/stubs-32.h
64
'';
65
66
-
nativeBuildInputs = [ nasm perl python3 makeWrapper ];
67
-
buildInputs = [ libuuid ];
0
0
0
0
68
69
-
enableParallelBuilding = false; # Fails very rarely with 'No rule to make target: ...'
0
0
0
0
0
0
70
hardeningDisable = [ "pic" "stackprotector" "fortify" ];
71
72
stripDebugList = [ "bin" "sbin" "share/syslinux/com32" ];
···
85
"PERL=perl"
86
"HEXDATE=0x00000000"
87
]
88
-
++ lib.optionals stdenv.hostPlatform.isi686 [ "bios" "efi32" ];
89
90
-
doCheck = false; # fails. some fail in a sandbox, others require qemu
0
91
92
postInstall = ''
93
wrapProgram $out/bin/syslinux \
···
100
meta = with lib; {
101
homepage = "http://www.syslinux.org/";
102
description = "A lightweight bootloader";
103
-
license = licenses.gpl2;
104
maintainers = [ maintainers.samueldr ];
105
platforms = [ "i686-linux" "x86_64-linux" ];
106
};
···
1
+
{ lib
2
+
, stdenv
3
+
, fetchgit
4
+
, fetchurl
5
+
, libuuid
6
+
, makeWrapper
7
+
, mtools
8
+
, nasm
9
+
, perl
10
+
, python3
11
+
}:
12
13
stdenv.mkDerivation {
14
pname = "syslinux";
15
+
version = "unstable-2019-02-07";
16
17
# This is syslinux-6.04-pre3^1; syslinux-6.04-pre3 fails to run.
18
# Same issue here https://www.syslinux.org/archives/2019-February/026330.html
19
src = fetchgit {
20
url = "https://repo.or.cz/syslinux";
21
rev = "b40487005223a78c3bb4c300ef6c436b3f6ec1f7";
22
+
sha256 = "sha256-GqvRTr9mA2yRD0G0CF11x1X0jCgqV4Mh+tvE0/0yjqk=";
23
fetchSubmodules = true;
24
};
25
26
patches = let
27
+
fetchDebianPatch = name: commit: hash:
28
+
fetchurl {
29
+
url = "https://salsa.debian.org/images-team/syslinux/raw/"
30
+
+ commit + "/debian/patches/" + name;
31
+
inherit name hash;
32
+
};
33
+
fetchArchlinuxPatch = name: commit: hash:
34
+
fetchurl {
35
+
url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/"
36
+
+ commit + "/trunk/" + name;
37
+
inherit name hash;
38
+
};
39
in [
40
+
./gcc10.patch
41
+
(fetchDebianPatch
42
+
"0002-gfxboot-menu-label.patch"
43
+
"fa1349f1"
44
+
"sha256-0f6QhM4lJmGflLige4n7AZTodL7vnyAvi5dIedd/Lho=")
45
+
(fetchArchlinuxPatch
46
+
"0005-gnu-efi-version-compatibility.patch"
47
+
"821c3da473d1399d930d5b4a086e46a4179eaa45"
48
+
"sha256-hhCVnfbAFWj/R4yh60qsMB87ofW9RznarsByhl6L4tc=")
49
+
(fetchArchlinuxPatch
50
+
"0025-reproducible-build.patch"
51
+
"821c3da473d1399d930d5b4a086e46a4179eaa45"
52
+
"sha256-mnb291pCSFvDNxY7o4BosJ94ib3BpOGRQIiY8Q3jZmI=")
53
+
(fetchDebianPatch
0
54
# mbr.bin: too big (452 > 440)
55
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414
56
+
"0016-strip-gnu-property.patch"
57
+
"7468ef0e38c43"
58
+
"sha256-lW+E6THuXlTGvhly0f/D9NwYHhkiKHot2l+bz9Eaxp4=")
59
+
(fetchDebianPatch
60
# mbr.bin: too big (452 > 440)
61
+
"0017-single-load-segment.patch"
62
+
"012e1dd312eb"
63
+
"sha256-C6VmdlTs1blMGUHH3OfOlFBZsfpwRn9vWodwqVn8+Cs=")
64
+
(fetchDebianPatch
65
+
"0018-prevent-pow-optimization.patch"
66
+
"26f0e7b2"
67
+
"sha256-dVzXBi/oSV9vYgU85mRFHBKuZdup+1x1BipJX74ED7E=")
0
68
];
69
70
postPatch = ''
···
80
touch gnu-efi/inc/ia32/gnu/stubs-32.h
81
'';
82
83
+
nativeBuildInputs = [
84
+
nasm
85
+
perl
86
+
python3
87
+
makeWrapper
88
+
];
89
90
+
buildInputs = [
91
+
libuuid
92
+
];
93
+
94
+
# Fails very rarely with 'No rule to make target: ...'
95
+
enableParallelBuilding = false;
96
+
97
hardeningDisable = [ "pic" "stackprotector" "fortify" ];
98
99
stripDebugList = [ "bin" "sbin" "share/syslinux/com32" ];
···
112
"PERL=perl"
113
"HEXDATE=0x00000000"
114
]
115
+
++ lib.optionals stdenv.hostPlatform.isi686 [ "bios" "efi32" ];
116
117
+
# Some tests require qemu, some others fail in a sandboxed environment
118
+
doCheck = false;
119
120
postInstall = ''
121
wrapProgram $out/bin/syslinux \
···
128
meta = with lib; {
129
homepage = "http://www.syslinux.org/";
130
description = "A lightweight bootloader";
131
+
license = licenses.gpl2Plus;
132
maintainers = [ maintainers.samueldr ];
133
platforms = [ "i686-linux" "x86_64-linux" ];
134
};