fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ stdenv
2, lib
3, fetchurl
4, bison
5, dtc
6, flex
7, libusb1
8, lzop
9, openssl
10, pkg-config
11, buildPackages
12}:
13
14let
15 buildBarebox = {
16 filesToInstall
17 , installDir ? "$out"
18 , defconfig
19 , extraMeta ? {}
20 , ... } @ args: stdenv.mkDerivation rec {
21 pname = "barebox-${defconfig}";
22
23 version = "2020.12.0";
24
25 src = fetchurl {
26 url = "https://www.barebox.org/download/barebox-${version}.tar.bz2";
27 sha256 = "06vsd95ihaa2nywpqy6k0c7xwk2pzws4yvbp328yd2pfiigachrv";
28 };
29
30 postPatch = ''
31 patchShebangs scripts
32 '';
33
34 nativeBuildInputs = [
35 bison
36 dtc
37 flex
38 openssl
39 libusb1
40 lzop
41 pkg-config
42 ];
43 depsBuildBuild = [ buildPackages.stdenv.cc ];
44
45 hardeningDisable = [ "all" ];
46
47 makeFlags = [
48 "DTC=dtc"
49 "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
50 ];
51
52 configurePhase = ''
53 runHook preConfigure
54
55 make ${defconfig}
56
57 runHook postConfigure
58 '';
59
60 installPhase = ''
61 runHook preInstall
62
63 mkdir -p ${installDir}
64 cp ${lib.concatStringsSep " " filesToInstall} ${installDir}
65
66 runHook postInstall
67 '';
68
69 enableParallelBuilding = true;
70
71 dontStrip = true;
72
73 meta = with lib; {
74 homepage = "https://www.barebox.org";
75 description = "The Swiss Army Knive for bare metal";
76 license = licenses.gpl2;
77 maintainers = with maintainers; [ emantor ];
78 } // extraMeta;
79 } // removeAttrs args [ "extraMeta" ];
80
81in {
82 inherit buildBarebox;
83
84 bareboxTools = buildBarebox {
85 defconfig = "hosttools_defconfig";
86 installDir = "$out/bin";
87 extraMeta.platforms = lib.platforms.linux;
88 filesToInstall = [
89 "scripts/bareboximd"
90 "scripts/imx/imx-usb-loader"
91 "scripts/omap4_usbboot"
92 "scripts/omap3-usb-loader"
93 "scripts/kwboot"
94 ];
95 };
96}