pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / tools / graphics / snapdragon-profiler / default.nix
blob1d93bbe715c68299e1a54094c098deb0571be217
1 { lib
2 , stdenv
3 , makeWrapper
4 , makeDesktopItem
5 , copyDesktopItems
6 , icoutils
7 , mono
8 , jre
9 , androidenv
10 , gtk-sharp-2_0
11 , gtk2
12 , libcxx
13 , coreutils
14 , requireFile
15 , archive ? requireFile {
16     name = "snapdragonprofiler_external_linux.tar.gz";
17     message = ''
18       This nix expression requires that "snapdragonprofiler_external_linux.tar.gz" is
19       already part of the store. To get this archive, you need to download it from:
20         https://developer.qualcomm.com/software/snapdragon-profiler
21       and add it to the nix store with nix-store --add-fixed sha256 <FILE>.
22     '';
23     sha256 = "c6731c417ca39fa9b0f190bd80c99b1603cf97d23becab9e47db6beafd6206b7";
24   }
27 stdenv.mkDerivation rec {
28   pname = "snapdragon-profiler";
29   version = "2021.2";
31   src = archive;
33   nativeBuildInputs = [
34     makeWrapper
35     icoutils
36     copyDesktopItems
37   ];
39   buildInputs = [
40     mono
41     gtk-sharp-2_0
42     gtk2
43     libcxx
44   ];
46   installPhase = ''
47     runHook preInstall
48     mkdir -p $out/{bin,lib/snapdragon-profiler}
49     mkdir -p $out/share/icons/hicolor/{16x16,32x32,48x48}/apps
51     mv *.so $out/lib
52     cp -r * $out/lib/snapdragon-profiler
53     makeWrapper "${mono}/bin/mono" $out/bin/snapdragon-profiler \
54       --add-flags "$out/lib/snapdragon-profiler/SnapdragonProfiler.exe" \
55       --suffix PATH : ${lib.makeBinPath [ jre androidenv.androidPkgs.platform-tools coreutils ]} \
56       --prefix MONO_GAC_PREFIX : ${gtk-sharp-2_0} \
57       --suffix LD_LIBRARY_PATH : $(echo $NIX_LDFLAGS | sed 's/ -L/:/g;s/ -rpath /:/g;s/-rpath //') \
58       --chdir "$out/lib/snapdragon-profiler" # Fixes themes not loading correctly
60     wrestool -x -t 14 SnapdragonProfiler.exe > snapdragon-profiler.ico
61     icotool -x -i 1 -o $out/share/icons/hicolor/16x16/apps/snapdragon-profiler.png snapdragon-profiler.ico
62     icotool -x -i 2 -o $out/share/icons/hicolor/32x32/apps/snapdragon-profiler.png snapdragon-profiler.ico
63     icotool -x -i 3 -o $out/share/icons/hicolor/48x48/apps/snapdragon-profiler.png snapdragon-profiler.ico
65     runHook postInstall
66   '';
68   desktopItems = [(makeDesktopItem {
69     name = pname;
70     desktopName = "Snapdragon Profiler";
71     exec = "snapdragon-profiler";
72     icon = "snapdragon-profiler";
73     comment = meta.description;
74     categories = [ "Development" "Debugger" "Graphics" "3DGraphics" ];
75   })];
77   dontStrip = true; # Always needed on Mono
78   dontPatchELF = true; # Certain libraries are to be deployed to the remote device, they should not be patched
80   meta = with lib; {
81     homepage = "https://developer.qualcomm.com/software/snapdragon-profiler";
82     description = "An profiler for Android devices running Snapdragon chips";
83     license = licenses.unfree;
84     maintainers = [ ];
85     platforms = [ "x86_64-linux" ];
86   };