1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 pkg-config,
7 SDL2,
8 alsa-lib,
9 ffmpeg,
10 lua5_3,
11 qt5,
12 file,
13 binutils,
14 makeDesktopItem,
15}:
16
17stdenv.mkDerivation (finalAttrs: {
18 pname = "libtas";
19 version = "1.4.5";
20
21 src = fetchFromGitHub {
22 owner = "clementgallet";
23 repo = "libTAS";
24 rev = "v${finalAttrs.version}";
25 hash = "sha256-n4iaJG9k+/TFfGMDCYL83Z6paxpm/gY3thP9T84GeQU=";
26 };
27
28 nativeBuildInputs = [
29 autoreconfHook
30 qt5.wrapQtAppsHook
31 pkg-config
32 ];
33 buildInputs = [
34 SDL2
35 alsa-lib
36 ffmpeg
37 lua5_3
38 qt5.qtbase
39 ];
40
41 configureFlags = [
42 "--enable-release-build"
43 ];
44
45 postInstall = ''
46 mkdir -p $out/lib
47 mv $out/bin/libtas*.so $out/lib/
48 '';
49
50 enableParallelBuilding = true;
51
52 postFixup = ''
53 wrapProgram $out/bin/libTAS \
54 --suffix PATH : ${
55 lib.makeBinPath [
56 file
57 binutils
58 ffmpeg
59 ]
60 } \
61 --set-default LIBTAS_SO_PATH $out/lib/libtas.so
62 '';
63
64 desktopItems = [
65 (makeDesktopItem {
66 name = "libTAS";
67 desktopName = "libTAS";
68 exec = "libTAS %U";
69 icon = "libTAS";
70 startupWMClass = "libTAS";
71 keywords = [ "libTAS" ];
72 })
73 ];
74
75 meta = with lib; {
76 homepage = "https://clementgallet.github.io/libTAS/";
77 changelog = "https://github.com/clementgallet/libTAS/blob/${finalAttrs.src.rev}/CHANGELOG.md";
78 description = "GNU/Linux software to give TAS tools to games";
79 license = lib.licenses.gpl3Only;
80 maintainers = with maintainers; [ skyrina ];
81 mainProgram = "libTAS";
82 platforms = [
83 "i686-linux"
84 "x86_64-linux"
85 ];
86 };
87})