-
-
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
8e47434
commit 5ad3090
Showing
1 changed file
with
94 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,94 @@ | ||
{ lib | ||
, rustPlatform | ||
, fetchFromGitHub | ||
, pkg-config | ||
, makeDesktopItem | ||
, copyDesktopItems | ||
, atk | ||
, blisp | ||
, bzip2 | ||
, cairo | ||
, dfu-util | ||
, gdk-pixbuf | ||
, glib | ||
, gtk3 | ||
, libusb1 | ||
, libxkbcommon | ||
, openssl | ||
, pango | ||
, udev | ||
, stdenv | ||
, darwin | ||
, wayland | ||
}: | ||
|
||
rustPlatform.buildRustPackage rec { | ||
pname = "pineflash"; | ||
version = "0.5.4"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "Spagett1"; | ||
repo = "PineFlash"; | ||
rev = version; | ||
hash = "sha256-4izfxApaCLbetZmMMKZIAknb+88B7z2WO+sBafehKHI="; | ||
fetchSubmodules = true; | ||
}; | ||
|
||
desktopItems = [(makeDesktopItem { | ||
name = pname; | ||
exec = "pineflash"; | ||
desktopName = "PineFlash"; | ||
comment = meta.description; | ||
categories = [ "Utility" ]; | ||
})]; | ||
|
||
cargoHash = "sha256-VtUq/scRnx52ibqvUIqvaloaQpZyyXUlJYd2UIKQTjg="; | ||
|
||
nativeBuildInputs = [ | ||
pkg-config | ||
copyDesktopItems | ||
]; | ||
|
||
buildInputs = [ | ||
atk | ||
bzip2 | ||
blisp | ||
cairo | ||
dfu-util | ||
gdk-pixbuf | ||
glib | ||
gtk3 | ||
libusb1 | ||
libxkbcommon | ||
openssl | ||
pango | ||
udev | ||
] ++ lib.optionals stdenv.isDarwin [ | ||
darwin.apple_sdk.frameworks.AppKit | ||
darwin.apple_sdk.frameworks.CoreFoundation | ||
darwin.apple_sdk.frameworks.CoreGraphics | ||
darwin.apple_sdk.frameworks.Foundation | ||
darwin.apple_sdk.frameworks.Security | ||
darwin.apple_sdk.frameworks.SystemConfiguration | ||
] ++ lib.optionals stdenv.isLinux [ | ||
wayland | ||
]; | ||
|
||
postPatch = '' | ||
# Linux | ||
substituteInPlace src/submodules/flash.rs \ | ||
--replace 'dfupath = "dfu-util";' 'dfupath = "${dfu-util}/bin/dfu-util";' \ | ||
--replace 'blisppath = "blisp";' 'blisppath = "${blisp}/bin/blisp";' | ||
# Darwin | ||
substituteInPlace src/submodules/flash.rs \ | ||
--replace 'Command::new("dfu-util")' 'Command::new("${dfu-util}/bin/dfu-util")' \ | ||
--replace 'Command::new("blisp")' 'Command::new("${blisp}/bin/blisp")' | ||
''; | ||
|
||
meta = with lib; { | ||
description = "A tool to flash ironos to the pinecil soldering iron and possibly other pine64 devices in the future"; | ||
homepage = "https://github.com/Spagett1/PineFlash"; | ||
license = licenses.gpl3Only; | ||
maintainers = with maintainers; [ janik ]; | ||
}; | ||
} |