1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 13:10:33 +00:00
nixpkgs/pkgs/tools/misc/odroid-xu3-bootloader/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

35 lines
1.2 KiB
Nix

{ stdenv, lib, fetchFromGitHub, coreutils, ubootOdroidXU3, runtimeShell }:
stdenv.mkDerivation {
name = "odroid-xu3-bootloader-2015-12-04";
src = fetchFromGitHub {
owner = "hardkernel";
repo = "u-boot";
rev = "fe2f831fd44a4071f58a42f260164544697aa666";
sha256 = "1h5yvawzla0vqhkk98gxcwc824bhc936bh6j77qkyspvqcw761fr";
};
buildCommand = ''
install -Dm644 -t $out/lib/sd_fuse-xu3 $src/sd_fuse/hardkernel_1mb_uboot/{bl2,tzsw}.*
install -Dm644 -t $out/lib/sd_fuse-xu3 $src/sd_fuse/hardkernel/bl1.*
ln -sf ${ubootOdroidXU3}/u-boot-dtb.bin $out/lib/sd_fuse-xu3/u-boot-dtb.bin
install -Dm755 $src/sd_fuse/hardkernel_1mb_uboot/sd_fusing.1M.sh $out/bin/sd_fuse-xu3
sed -i \
-e '1i#!${runtimeShell}' \
-e '1iPATH=${lib.makeBinPath [ coreutils ]}:$PATH' \
-e '/set -x/d' \
-e 's,.\/sd_fusing\.sh,sd_fuse-xu3,g' \
-e "s,\./,$out/lib/sd_fuse-xu3/,g" \
$out/bin/sd_fuse-xu3
'';
meta = with lib; {
platforms = platforms.linux;
license = licenses.unfreeRedistributableFirmware;
description = "Secure boot enabled boot loader for ODROID-XU{3,4}";
maintainers = with maintainers; [ abbradar ];
};
}