about summary refs log tree commit diff
path: root/pkgs/applications/video/obs-studio/plugins/input-overlay.nix
blob: 8926b7e1764b837887306444bbbf88721faca88b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ stdenv, lib
, fetchFromGitHub
, cmake
, pkg-config
, obs-studio
, libuiohook
, qtbase
, xorg
, libxkbcommon
, libxkbfile
, SDL2
}:

stdenv.mkDerivation rec {
  pname = "obs-input-overlay";
  version = "5.0.4";
  src = fetchFromGitHub {
    owner = "univrsal";
    repo = "input-overlay";
    rev = "v${version}";
    sha256 = "sha256-MON68yjHUOF/bggWqhw8D0+23HpKQN3jWs+5lLAacaQ=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [ cmake pkg-config ];
  buildInputs = [
    obs-studio libuiohook qtbase SDL2
    xorg.libX11 xorg.libXau xorg.libXdmcp xorg.libXtst xorg.libXext
    xorg.libXi xorg.libXt xorg.libXinerama libxkbcommon libxkbfile
  ];

  cmakeFlags = [
    "-DCMAKE_CXX_FLAGS=-msse4.1"
  ];

  postUnpack = ''
    sed -i '/set(CMAKE_CXX_FLAGS "-march=native")/d' 'source/CMakeLists.txt'
  '';

  postInstall = ''
    mkdir $out/lib $out/share
    mv $out/obs-plugins/64bit $out/lib/obs-plugins
    rm -rf $out/obs-plugins
    mv $out/data $out/share/obs
  '';

  dontWrapQtApps = true;

  meta = with lib; {
    description = "Show keyboard, gamepad and mouse input on stream ";
    homepage = "https://github.com/univrsal/input-overlay";
    maintainers = with maintainers; [ glittershark ];
    license = licenses.gpl2;
    platforms = platforms.linux;
    # never built on aarch64-linux since first introduction in nixpkgs
    broken = stdenv.isLinux && stdenv.isAarch64;
  };
}