-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f1e16d
commit 4e39dcf
Showing
2 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/src/submodules/flash.rs b/src/submodules/flash.rs | ||
index 5b224b2..e30f286 100644 | ||
--- a/src/submodules/flash.rs | ||
+++ b/src/submodules/flash.rs | ||
@@ -107,7 +107,7 @@ impl Flasher { | ||
let dfupath = "dfu-util"; | ||
|
||
#[cfg(target_os = "linux")] | ||
- let command = Command::new("pkexec") | ||
+ let command = Command::new("/run/wrappers/bin/pkexec") | ||
// .env("PATH", path) | ||
.arg(dfupath) | ||
.arg("-D") | ||
@@ -182,7 +182,7 @@ impl Flasher { | ||
let blisppath = "blisp"; | ||
|
||
#[cfg(target_os = "linux")] | ||
- let command = Command::new("pkexec") | ||
+ let command = Command::new("/run/wrappers/bin/pkexec") | ||
.env("PATH", "/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:linux") | ||
.arg(blisppath) | ||
.arg("write") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
fetchFromGitHub, | ||
rustPlatform, | ||
pkg-config, | ||
openssl, | ||
systemd, | ||
glib, | ||
gtk3, | ||
dfu-util, | ||
blisp, | ||
fontconfig, | ||
libxkbcommon, | ||
libGL, | ||
}: | ||
rustPlatform.buildRustPackage rec { | ||
pname = "pineflash"; | ||
version = "0.5.5"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "Spagett1"; | ||
repo = "pineflash"; | ||
tag = "${version}"; | ||
hash = "sha256-4tcwEok36vuXbtlZNUkLNw1kHFQPBEJM/gWRhRWNLPg="; | ||
}; | ||
|
||
cargoHash = "sha256-l01It6mUflENlADW6PpOQvK1o4qOjbTsMLB6n+OIl0U="; | ||
|
||
patches = [ | ||
./fix_pkexec_path.patch | ||
]; | ||
|
||
postPatch = '' | ||
substituteInPlace src/submodules/flash.rs \ | ||
--replace-fail 'let blisppath = "blisp";' 'let blisppath = "${blisp}/bin/blisp";' \ | ||
--replace-fail 'let dfupath = "dfu-util";' 'let dfupath = "${dfu-util}/bin/dfu-util";' | ||
''; | ||
|
||
nativeBuildInputs = [ | ||
pkg-config | ||
]; | ||
|
||
buildInputs = [ | ||
openssl | ||
systemd | ||
glib | ||
gtk3 | ||
fontconfig | ||
libxkbcommon | ||
libGL | ||
dfu-util | ||
blisp | ||
]; | ||
|
||
postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' | ||
patchelf $out/bin/pineflash --add-rpath ${libxkbcommon}/lib | ||
patchelf $out/bin/pineflash --add-rpath ${libGL}/lib | ||
''; | ||
|
||
meta = { | ||
description = "GUI tool to flash IronOS to the Pinecil V1 and V2"; | ||
homepage = "https://github.com/Spagett1/pineflash"; | ||
license = lib.licenses.gpl2Only; | ||
maintainers = with lib.maintainers; [ | ||
acuteaangle | ||
]; | ||
mainProgram = "pineflash"; | ||
}; | ||
} |