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
|
|
|
|
, wrapGAppsHook
|
|
|
|
, 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";
|
2022-09-22 12:36:57 +00:00
|
|
|
version = "3.0.1";
|
2021-04-17 00:35:05 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
2022-09-22 12:36:57 +00:00
|
|
|
url = "https://github.com/google/agi/releases/download/v${version}/agi-${version}-linux.zip";
|
|
|
|
sha256 = "sha256-793lOJL1/wqETkWfiksnLY3Lmxx500fw4PIzT9ZQqQs=";
|
2021-04-17 00:35:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapGAppsHook
|
|
|
|
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;
|
|
|
|
maintainers = [ maintainers.ivar ];
|
2022-07-14 12:49:19 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
binaryBytecode
|
|
|
|
binaryNativeCode
|
|
|
|
];
|
2021-04-17 00:35:05 +00:00
|
|
|
};
|
|
|
|
}
|