2024-12-30 11:52:31 -05:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
pkg-config,
|
|
|
|
autoPatchelfHook,
|
|
|
|
blisp,
|
|
|
|
dfu-util,
|
|
|
|
fontconfig,
|
|
|
|
glib,
|
|
|
|
gtk3,
|
|
|
|
openssl,
|
|
|
|
systemd,
|
|
|
|
libGL,
|
|
|
|
libxkbcommon,
|
|
|
|
nix-update-script,
|
2025-01-24 22:32:13 +01:00
|
|
|
wayland,
|
2024-12-30 11:52:31 -05:00
|
|
|
}:
|
2025-06-10 23:14:03 -04:00
|
|
|
rustPlatform.buildRustPackage (finalAttrs: {
|
2024-12-30 11:52:31 -05:00
|
|
|
pname = "pineflash";
|
|
|
|
version = "0.5.5";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Spagett1";
|
|
|
|
repo = "pineflash";
|
2025-06-10 23:14:03 -04:00
|
|
|
tag = finalAttrs.version;
|
2024-12-30 11:52:31 -05:00
|
|
|
hash = "sha256-4tcwEok36vuXbtlZNUkLNw1kHFQPBEJM/gWRhRWNLPg=";
|
|
|
|
};
|
|
|
|
|
treewide: migrate to fetchCargoVendor, batch 5
Cargo 1.84.0 seems to have changed the output format of cargo vendor
again, once again invalidating fetchCargoTarball FOD hashes. It's
time to fix this once and for all, switching across the board to
fetchCargoVendor, which is not dependent on cargo vendor's output
format.
These are a few cases that could have been in batch 1, but weren't for
whatever reason. Maybe there were merge conflicts, or a transient
network failure.
It should be possible to reproduce this diff. To do so, get the list
of files changed by this commit, e.g. with git diff --name-only, then
run the following two commands, each with that list of files as their
standard input:
xargs sed -i 's/^\(. *\)\(cargoHash\)\b/\1useFetchCargoVendor = true;\n\1cargoHash/'
cut -d / -f 4 | xargs -n 1 nix-update --version=skip
2025-01-24 21:51:27 +01:00
|
|
|
cargoHash = "sha256-OgUWOtqgGCRNYCrdMa8IAfxbbYqv+1WwubvfYybuAQU=";
|
2024-12-30 11:52:31 -05:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
]
|
|
|
|
++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
blisp
|
|
|
|
dfu-util
|
|
|
|
fontconfig
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
openssl
|
|
|
|
systemd
|
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDependencies = [
|
|
|
|
libGL
|
|
|
|
libxkbcommon
|
2025-01-24 22:32:13 +01:00
|
|
|
wayland
|
2024-12-30 11:52:31 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/submodules/flash.rs \
|
|
|
|
--replace-fail 'let command = Command::new("pkexec")' 'let command = Command::new("/run/wrappers/bin/pkexec")'
|
|
|
|
''
|
|
|
|
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
|
|
substituteInPlace src/submodules/flash.rs \
|
|
|
|
--replace-fail 'let blisppath = "blisp";' 'let blisppath = "${lib.getExe blisp}";' \
|
|
|
|
--replace-fail 'let dfupath = "dfu-util";' 'let dfupath = "${lib.getExe' dfu-util "dfu-util"}";'
|
|
|
|
''
|
|
|
|
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
|
|
substituteInPlace src/submodules/flash.rs \
|
|
|
|
--replace-fail 'Command::new("blisp")' 'Command::new("${lib.getExe blisp}")' \
|
|
|
|
--replace-fail 'Command::new("dfu-util")' 'Command::new("${lib.getExe' dfu-util "dfu-util"}")'
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/applications"
|
|
|
|
cp ./assets/Pineflash.desktop "$out/share/applications/Pineflash.desktop"
|
|
|
|
mkdir -p "$out/share/pixmaps"
|
|
|
|
cp ./assets/pine64logo.png "$out/share/pixmaps/pine64logo.png"
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "GUI tool to flash IronOS to the Pinecil V1 and V2";
|
|
|
|
homepage = "https://github.com/Spagett1/pineflash";
|
2025-06-10 23:14:03 -04:00
|
|
|
changelog = "https://github.com/Spagett1/pineflash/releases/tag/${finalAttrs.version}";
|
2024-12-30 11:52:31 -05:00
|
|
|
license = lib.licenses.gpl2Only;
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
acuteaangle
|
|
|
|
];
|
|
|
|
mainProgram = "pineflash";
|
|
|
|
};
|
2025-06-10 23:14:03 -04:00
|
|
|
})
|