nixpkgs/pkgs/by-name/ri/riscv-pk/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

44 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, autoreconfHook, payload ? null }:
stdenv.mkDerivation {
pname = "riscv-pk";
version = "1.0.0-unstable-2024-10-09";
src = fetchFromGitHub {
owner = "riscv";
repo = "riscv-pk";
rev = "abadfdc507d5a75b6272dc360e70a80a510c758a";
sha256 = "sha256-02qcj0TAs7g4CSorWWbUzouS6mNthUOSdeocibw5g2A=";
};
nativeBuildInputs = [ autoreconfHook ];
preConfigure = ''
mkdir build
cd build
'';
configureScript = "../configure";
configureFlags = lib.optional (payload != null)
"--with-payload=${payload}";
hardeningDisable = [ "all" ];
# pk by default installs things in $out/$target_prefix/{bin,include,lib},
# we want to remove the target prefix directory hierarchy
postInstall = ''
mv $out/* $out/.cleanup
mv $out/.cleanup/* $out
rmdir $out/.cleanup
'';
meta = {
description = "RISC-V Proxy Kernel and Bootloader";
homepage = "https://github.com/riscv/riscv-pk";
license = lib.licenses.bsd3;
platforms = lib.platforms.riscv;
maintainers = [ lib.maintainers.shlevy ];
};
}