2021-04-17 00:35:05 +00:00
|
|
|
{ lib
|
2022-09-22 12:36:57 +00:00
|
|
|
, stdenvNoCC
|
2021-04-17 00:35:05 +00:00
|
|
|
, fetchzip
|
|
|
|
, autoPatchelfHook
|
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2021-04-17 00:35:05 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, gdk-pixbuf
|
|
|
|
, jre
|
2022-09-22 12:36:57 +00:00
|
|
|
, android-tools
|
2021-04-17 00:35:05 +00:00
|
|
|
}:
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
stdenvNoCC.mkDerivation rec {
|
2021-04-17 00:35:05 +00:00
|
|
|
pname = "agi";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "3.3.1";
|
2021-04-17 00:35:05 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
2023-10-09 19:29:22 +00:00
|
|
|
url = "https://github.com/google/agi/releases/download/${version}/agi-${version}-linux.zip";
|
|
|
|
sha256 = "sha256-Yawl6InBYSWNw3clHyGAeC2PVfXEzWmbd6vcYrqAPO0=";
|
2021-04-17 00:35:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2021-04-17 00:35:05 +00:00
|
|
|
gdk-pixbuf
|
|
|
|
gobject-introspection
|
2022-09-22 12:36:57 +00:00
|
|
|
autoPatchelfHook
|
2021-04-17 00:35:05 +00:00
|
|
|
copyDesktopItems
|
2022-09-22 12:36:57 +00:00
|
|
|
makeWrapper
|
2021-04-17 00:35:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2021-04-17 00:35:05 +00:00
|
|
|
cp ./{agi,gapis,gapir,gapit,device-info} $out/bin
|
2022-09-22 12:36:57 +00:00
|
|
|
cp -r lib $out
|
|
|
|
|
2021-04-17 00:35:05 +00: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
|
|
|
|
done
|
2022-09-22 12:36:57 +00:00
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
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-17 00:35:05 +00:00
|
|
|
name = "agi";
|
|
|
|
desktopName = "Android GPU Inspector";
|
2022-03-10 19:12:11 +00:00
|
|
|
exec = "agi";
|
2021-04-17 00:35:05 +00:00
|
|
|
icon = "agi";
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Development" "Debugger" "Graphics" "3DGraphics" ];
|
2022-09-22 12:36:57 +00:00
|
|
|
});
|
2021-04-17 00:35:05 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Android GPU Inspector";
|
2022-09-22 12:36:57 +00:00
|
|
|
homepage = "https://gpuinspector.dev";
|
|
|
|
changelog = "https://github.com/google/agi/releases/tag/v${version}";
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
license = licenses.asl20;
|
2024-07-01 15:47:52 +00:00
|
|
|
maintainers = with maintainers; [ kashw2 ];
|
2022-07-14 12:49:19 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
binaryBytecode
|
|
|
|
binaryNativeCode
|
|
|
|
];
|
2021-04-17 00:35:05 +00:00
|
|
|
};
|
|
|
|
}
|