2021-05-04 21:30:55 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
|
|
|
, icoutils
|
2021-05-12 19:32:40 +00:00
|
|
|
, mono
|
2021-05-04 21:30:55 +00:00
|
|
|
, jre
|
|
|
|
, androidenv
|
|
|
|
, gtk-sharp-2_0
|
|
|
|
, gtk2
|
|
|
|
, libcxx
|
|
|
|
, libcxxabi
|
|
|
|
, coreutils
|
|
|
|
, requireFile
|
|
|
|
, archive ? requireFile {
|
|
|
|
name = "snapdragonprofiler_external_linux.tar.gz";
|
|
|
|
message = ''
|
|
|
|
This nix expression requires that "snapdragonprofiler_external_linux.tar.gz" is
|
|
|
|
already part of the store. To get this archive, you need to download it from:
|
|
|
|
https://developer.qualcomm.com/software/snapdragon-profiler
|
|
|
|
and add it to the nix store with nix-store --add-fixed sha256 <FILE>.
|
|
|
|
'';
|
|
|
|
sha256 = "c6731c417ca39fa9b0f190bd80c99b1603cf97d23becab9e47db6beafd6206b7";
|
|
|
|
}
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "snapdragon-profiler";
|
2022-02-28 11:35:10 +00:00
|
|
|
version = "2021.2";
|
2021-05-04 21:30:55 +00:00
|
|
|
|
|
|
|
src = archive;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
icoutils
|
|
|
|
copyDesktopItems
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-05-12 19:32:40 +00:00
|
|
|
mono
|
2021-05-04 21:30:55 +00:00
|
|
|
gtk-sharp-2_0
|
|
|
|
gtk2
|
|
|
|
libcxx
|
|
|
|
libcxxabi
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/{bin,lib/snapdragon-profiler}
|
|
|
|
mkdir -p $out/share/icons/hicolor/{16x16,32x32,48x48}/apps
|
|
|
|
|
|
|
|
mv *.so $out/lib
|
|
|
|
cp -r * $out/lib/snapdragon-profiler
|
2021-05-12 19:32:40 +00:00
|
|
|
makeWrapper "${mono}/bin/mono" $out/bin/snapdragon-profiler \
|
2021-05-04 21:30:55 +00:00
|
|
|
--add-flags "$out/lib/snapdragon-profiler/SnapdragonProfiler.exe" \
|
|
|
|
--suffix PATH : ${lib.makeBinPath [ jre androidenv.androidPkgs_9_0.platform-tools coreutils ]} \
|
|
|
|
--prefix MONO_GAC_PREFIX : ${gtk-sharp-2_0} \
|
|
|
|
--suffix LD_LIBRARY_PATH : $(echo $NIX_LDFLAGS | sed 's/ -L/:/g;s/ -rpath /:/g;s/-rpath //') \
|
2022-03-14 18:06:00 +00:00
|
|
|
--chdir "$out/lib/snapdragon-profiler" # Fixes themes not loading correctly
|
2021-05-04 21:30:55 +00:00
|
|
|
|
|
|
|
wrestool -x -t 14 SnapdragonProfiler.exe > snapdragon-profiler.ico
|
|
|
|
icotool -x -i 1 -o $out/share/icons/hicolor/16x16/apps/snapdragon-profiler.png snapdragon-profiler.ico
|
|
|
|
icotool -x -i 2 -o $out/share/icons/hicolor/32x32/apps/snapdragon-profiler.png snapdragon-profiler.ico
|
|
|
|
icotool -x -i 3 -o $out/share/icons/hicolor/48x48/apps/snapdragon-profiler.png snapdragon-profiler.ico
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItems = [(makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
desktopName = "Snapdragon Profiler";
|
2022-03-09 16:11:38 +00:00
|
|
|
exec = "snapdragon-profiler";
|
2021-05-04 21:30:55 +00:00
|
|
|
icon = "snapdragon-profiler";
|
|
|
|
comment = meta.description;
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Development" "Debugger" "Graphics" "3DGraphics" ];
|
2021-05-04 21:30:55 +00:00
|
|
|
})];
|
|
|
|
|
|
|
|
dontStrip = true; # Always needed on Mono
|
|
|
|
dontPatchELF = true; # Certain libraries are to be deployed to the remote device, they should not be patched
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://developer.qualcomm.com/software/snapdragon-profiler";
|
|
|
|
description = "An profiler for Android devices running Snapdragon chips";
|
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = [ maintainers.ivar ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|