uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
84
pkgs/development/quickemu/default.nix
Normal file
84
pkgs/development/quickemu/default.nix
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
{ lib
|
||||
, fetchFromGitHub
|
||||
, stdenv
|
||||
, makeWrapper
|
||||
, qemu
|
||||
, gnugrep
|
||||
, lsb-release
|
||||
, jq
|
||||
, procps
|
||||
, python3
|
||||
, cdrtools
|
||||
, usbutils
|
||||
, util-linux
|
||||
, spice-gtk
|
||||
, swtpm
|
||||
, wget
|
||||
, xdg-user-dirs
|
||||
, xrandr
|
||||
, zsync
|
||||
, OVMF
|
||||
, quickemu
|
||||
, testers
|
||||
}:
|
||||
let
|
||||
runtimePaths = [
|
||||
qemu
|
||||
gnugrep
|
||||
jq
|
||||
lsb-release
|
||||
procps
|
||||
python3
|
||||
cdrtools
|
||||
usbutils
|
||||
util-linux
|
||||
spice-gtk
|
||||
swtpm
|
||||
wget
|
||||
xdg-user-dirs
|
||||
xrandr
|
||||
zsync
|
||||
];
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "quickemu";
|
||||
version = "3.15";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "quickemu-project";
|
||||
repo = "quickemu";
|
||||
rev = version;
|
||||
sha256="sha256-ako/eh8cMWKvdrgm9VTgSH67nA2igKUlJZtBeH1bu4Y=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./input_overrides.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 -t "$out/bin" quickemu quickget macrecovery
|
||||
|
||||
for f in quickget macrecovery quickemu; do
|
||||
wrapProgram $out/bin/$f \
|
||||
--prefix PATH : "${lib.makeBinPath runtimePaths}" \
|
||||
--set ENV_EFI_CODE "${OVMF.fd}/FV/OVMF_CODE.fd" \
|
||||
--set ENV_EFI_VARS "${OVMF.fd}/FV/OVMF_VARS.fd"
|
||||
done
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.tests = testers.testVersion { package = quickemu; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Quickly create and run optimised Windows, macOS and Linux desktop virtual machines";
|
||||
homepage = "https://github.com/quickemu-project/quickemu";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ fedx-sudo ];
|
||||
};
|
||||
}
|
||||
37
pkgs/development/quickemu/input_overrides.patch
Normal file
37
pkgs/development/quickemu/input_overrides.patch
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
diff --git a/quickemu b/quickemu
|
||||
index 24e1007..39cd5e4 100755
|
||||
--- a/quickemu
|
||||
+++ b/quickemu
|
||||
@@ -196,7 +196,7 @@ function efi_vars() {
|
||||
|
||||
if [ ! -e "${VARS_OUT}" ]; then
|
||||
if [ -e "${VARS_IN}" ]; then
|
||||
- cp "${VARS_IN}" "${VARS_OUT}"
|
||||
+ cp "${VARS_IN}" "${VARS_OUT}" && chmod +w "${VARS_OUT}"
|
||||
else
|
||||
echo "ERROR! ${VARS_IN} was not found. Please install edk2."
|
||||
exit 1
|
||||
@@ -383,7 +383,10 @@ function vm_boot() {
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1929357#c5
|
||||
case ${secureboot} in
|
||||
on)
|
||||
- if [ -e "/usr/share/OVMF/OVMF_CODE_4M.secboot.fd" ]; then
|
||||
+ if [[ ${ENV_EFI_CODE_SECURE} && ${ENV_EFI_CODE_SECURE-x} ]] && [[ ${ENV_EFI_VARS_SECURE} && ${ENV_EFI_VARS_SECURE-x} ]]; then
|
||||
+ EFI_CODE="${ENV_EFI_CODE_SECURE}"
|
||||
+ efi_vars "${ENV_EFI_VARS_SECURE}" "${EFI_VARS}"
|
||||
+ elif [ -e "/usr/share/OVMF/OVMF_CODE_4M.secboot.fd" ]; then
|
||||
EFI_CODE="/usr/share/OVMF/OVMF_CODE_4M.secboot.fd"
|
||||
efi_vars "/usr/share/OVMF/OVMF_VARS_4M.fd" "${EFI_VARS}"
|
||||
elif [ -e "/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd" ]; then
|
||||
@@ -408,7 +411,10 @@ function vm_boot() {
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
- if [ -e "/usr/share/OVMF/OVMF_CODE_4M.fd" ]; then
|
||||
+ if [[ ${ENV_EFI_CODE} && ${ENV_EFI_CODE-x} ]] && [[ ${ENV_EFI_VARS} && ${ENV_EFI_VARS-x} ]]; then
|
||||
+ EFI_CODE="${ENV_EFI_CODE}"
|
||||
+ efi_vars "${ENV_EFI_VARS}" "${EFI_VARS}"
|
||||
+ elif [ -e "/usr/share/OVMF/OVMF_CODE_4M.fd" ]; then
|
||||
EFI_CODE="/usr/share/OVMF/OVMF_CODE_4M.fd"
|
||||
efi_vars "/usr/share/OVMF/OVMF_VARS_4M.fd" "${EFI_VARS}"
|
||||
elif [ -e "/usr/share/edk2/ovmf/OVMF_CODE.fd" ]; then
|
||||
Loading…
Add table
Add a link
Reference in a new issue