nixos-configuration/pkgs/by-name/sp/SPFlashTool5/package.nix

72 lines
1.5 KiB
Nix
Raw Normal View History

2025-02-01 20:01:17 +01:00
{
lib,
autoPatchelfHook,
fetchurl,
fontconfig,
freetype,
glib,
libgcc,
libjpeg,
libpng12,
libz,
makeWrapper,
stdenvNoCC,
unzip,
2025-02-01 20:01:17 +01:00
xorg,
}:
stdenvNoCC.mkDerivation (self: {
pname = "SPFlashTool5";
version = "5.2228";
2025-02-01 20:01:17 +01:00
src = fetchurl {
url = "https://spflashtools.com/wp-content/uploads/SP_Flash_Tool_v5.2228_Linux.zip";
hash = "sha256-GLEe7TQf1X/rf7xYp7jrk0KbrMfSWpk4eK+KC26Y3xA=";
2025-02-01 20:01:17 +01:00
};
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
unzip
];
buildInputs = [
2025-02-01 20:01:17 +01:00
fontconfig
freetype
glib
libgcc
libjpeg
libpng12
libz
xorg.libSM
xorg.libX11
xorg.libXext
xorg.libXrender
];
# remove plugins that have outdated dependencies not available in nixpkgs
# they are not needed to run the tool anyway
prePatch = ''
rm \
plugins/imageformats/libqsvg.so \
plugins/imageformats/libqmng.so \
plugins/imageformats/libqtiff.so
'';
dontConfigure = true;
dontBuild = true;
dontCheck = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/share/SPFlashTool5
cp -r * $out/share/SPFlashTool5
chmod +x $out/share/SPFlashTool5/flash_tool
makeWrapper $out/share/SPFlashTool5/flash_tool $out/bin/SPFlashTool5
runHook postInstall
'';
meta = {
description = "Flash tool for MediaTek devices";
homepage = "https://spflashtools.com/";
2025-02-01 20:01:17 +01:00
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ amozeo ];
};
})