btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / li / libtas / package.nix
blob7a3ab2e7a155c78f633f3347237365a6bc3dd4a9
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , autoreconfHook
5 , pkg-config
6 , SDL2
7 , alsa-lib
8 , ffmpeg
9 , lua5_3
10 , qt5
11 , file
12 , makeDesktopItem
15 stdenv.mkDerivation (finalAttrs: {
16   pname = "libtas";
17   version = "1.4.5";
19   src = fetchFromGitHub {
20     owner = "clementgallet";
21     repo = "libTAS";
22     rev = "v${finalAttrs.version}";
23     hash = "sha256-n4iaJG9k+/TFfGMDCYL83Z6paxpm/gY3thP9T84GeQU=";
24   };
26   nativeBuildInputs = [ autoreconfHook qt5.wrapQtAppsHook pkg-config ];
27   buildInputs = [ SDL2 alsa-lib ffmpeg lua5_3 qt5.qtbase ];
29   configureFlags = [
30     "--enable-release-build"
31   ];
33   postInstall = ''
34     mkdir -p $out/lib
35     mv $out/bin/libtas*.so $out/lib/
36   '';
38   enableParallelBuilding = true;
40   postFixup = ''
41     wrapProgram $out/bin/libTAS \
42       --suffix PATH : ${lib.makeBinPath [ file ]} \
43       --set-default LIBTAS_SO_PATH $out/lib/libtas.so
44   '';
46   desktopItems = [
47     (makeDesktopItem {
48       name = "libTAS";
49       desktopName = "libTAS";
50       exec = "libTAS %U";
51       icon = "libTAS";
52       startupWMClass = "libTAS";
53       keywords = [ "libTAS" ];
54     })
55   ];
57   meta = with lib; {
58     homepage = "https://clementgallet.github.io/libTAS/";
59     changelog = "https://github.com/clementgallet/libTAS/blob/${finalAttrs.src.rev}/CHANGELOG.md";
60     description = "GNU/Linux software to give TAS tools to games";
61     license = lib.licenses.gpl3Only;
62     maintainers = with maintainers; [ skyrina ];
63     mainProgram = "libTAS";
64     platforms = [ "i686-linux" "x86_64-linux" ];
65   };