nixpkgs/pkgs/tools/graphics/agi/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
1.7 KiB
Nix
Raw Normal View History

2021-04-12 20:14:23 +02:00
{ lib
, stdenvNoCC
2021-04-12 20:14:23 +02:00
, fetchzip
, autoPatchelfHook
, makeWrapper
, makeDesktopItem
, copyDesktopItems
, wrapGAppsHook
, gobject-introspection
, gdk-pixbuf
, jre
, android-tools
2021-04-12 20:14:23 +02:00
}:
stdenvNoCC.mkDerivation rec {
2021-04-12 20:14:23 +02:00
pname = "agi";
version = "3.0.1";
2021-04-12 20:14:23 +02:00
src = fetchzip {
url = "https://github.com/google/agi/releases/download/v${version}/agi-${version}-linux.zip";
sha256 = "sha256-793lOJL1/wqETkWfiksnLY3Lmxx500fw4PIzT9ZQqQs=";
2021-04-12 20:14:23 +02:00
};
nativeBuildInputs = [
wrapGAppsHook
gdk-pixbuf
gobject-introspection
autoPatchelfHook
2021-04-12 20:14:23 +02:00
copyDesktopItems
makeWrapper
2021-04-12 20:14:23 +02:00
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
2021-04-12 20:14:23 +02:00
cp ./{agi,gapis,gapir,gapit,device-info} $out/bin
cp -r lib $out
2021-04-12 20:14:23 +02:00
for i in 16 32 48 64 96 128 256 512 1024; do
install -D ${src}/icon.png $out/share/icons/hicolor/''${i}x$i/apps/agi.png
2021-04-12 20:14:23 +02:00
done
2021-04-12 20:14:23 +02:00
runHook postInstall
'';
dontWrapGApps = true;
preFixup = ''
wrapProgram $out/bin/agi \
--add-flags "--vm ${jre}/bin/java" \
--add-flags "--adb ${android-tools}/bin/adb" \
--add-flags "--jar $out/lib/gapic.jar" \
"''${gappsWrapperArgs[@]-}"
'';
desktopItems = lib.toList (makeDesktopItem {
2021-04-12 20:14:23 +02:00
name = "agi";
desktopName = "Android GPU Inspector";
exec = "agi";
2021-04-12 20:14:23 +02:00
icon = "agi";
categories = [ "Development" "Debugger" "Graphics" "3DGraphics" ];
});
2021-04-12 20:14:23 +02:00
meta = with lib; {
description = "Android GPU Inspector";
homepage = "https://gpuinspector.dev";
changelog = "https://github.com/google/agi/releases/tag/v${version}";
platforms = [ "x86_64-linux" ];
license = licenses.asl20;
maintainers = [ maintainers.ivar ];
sourceProvenance = with sourceTypes; [
binaryBytecode
binaryNativeCode
];
2021-04-12 20:14:23 +02:00
};
}