From 213e90413c024832029ffa9f5f58679f3852255e Mon Sep 17 00:00:00 2001 From: cy Date: Thu, 6 Mar 2025 13:44:09 -0500 Subject: [PATCH] pixelflasher: init at 7.11.1.0 --- pkgs/by-name/pi/pixelflasher/package.nix | 99 ++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 pkgs/by-name/pi/pixelflasher/package.nix diff --git a/pkgs/by-name/pi/pixelflasher/package.nix b/pkgs/by-name/pi/pixelflasher/package.nix new file mode 100644 index 000000000000..c946c22dbd0b --- /dev/null +++ b/pkgs/by-name/pi/pixelflasher/package.nix @@ -0,0 +1,99 @@ +{ + lib, + stdenv, + fetchFromGitHub, + wrapGAppsHook3, + python3Packages, + makeDesktopItem, + copyDesktopItems, + nix-update-script, +}: +python3Packages.buildPythonApplication rec { + pname = "pixelflasher"; + version = "7.11.1.0"; + format = "other"; + + src = fetchFromGitHub { + owner = "badabing2005"; + repo = "PixelFlasher"; + tag = "v${version}"; + hash = "sha256-1h0rHiYi3buLZjWFjJoTDWckeEBtZwFVRNscS3wsD3o="; + }; + + desktopItems = [ + (makeDesktopItem { + name = "PixelFlasher"; + exec = "pixelflasher"; + icon = "pixelflasher"; + desktopName = "PixelFlasher"; + genericName = "Pixelâ„¢ phone flashing GUI utility with features"; + categories = [ "Development" ]; + }) + ]; + + dependencies = with python3Packages; [ + attrdict + beautifulsoup4 + bsdiff4 + chardet + cryptography + darkdetect + httplib2 + json5 + lz4 + markdown + platformdirs + protobuf4 + psutil + pyperclip + requests + rsa + six + wxpython + ]; + + nativeBuildInputs = [ + wrapGAppsHook3 + python3Packages.pyinstaller + copyDesktopItems + ]; + + buildPhase = + let + specFile = + if stdenv.hostPlatform.isDarwin then + if stdenv.hostPlatform.isAarch64 then "build-on-mac" else "build-on-mac-intel-only" + else + "build-on-linux"; + in + '' + runHook preBuild + + pyinstaller --clean --noconfirm --log-level=DEBUG ${specFile}.spec + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + mkdir -p $out/share/icons/hicolor/64x64/apps + cp dist/PixelFlasher $out/bin/pixelflasher + cp images/icon-64.png $out/share/icons/hicolor/64x64/apps/pixelflasher.png + + runHook postInstall + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Pixelâ„¢ phone flashing GUI utility with features"; + homepage = "https://github.com/badabing2005/PixelFlasher"; + changelog = "https://github.com/badabing2005/PixelFlasher/releases/tag/v${version}"; + license = lib.licenses.agpl3Plus; + maintainers = with lib.maintainers; [ cything ]; + mainProgram = "pixelflasher"; + platforms = lib.platforms.linux; + }; +}