1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6
7 withLibei ? !stdenv.hostPlatform.isDarwin,
8
9 avahi,
10 curl,
11 libICE,
12 libSM,
13 libX11,
14 libXdmcp,
15 libXext,
16 libXinerama,
17 libXrandr,
18 libXtst,
19 libei,
20 libportal,
21 openssl,
22 pkgsStatic,
23 pkg-config,
24 qtbase,
25 qttools,
26 wrapGAppsHook3,
27 wrapQtAppsHook,
28}:
29
30stdenv.mkDerivation rec {
31 pname = "input-leap";
32 version = "3.0.3";
33
34 src = fetchFromGitHub {
35 owner = "input-leap";
36 repo = "input-leap";
37 rev = "v${version}";
38 hash = "sha256-zSaeeMlhpWIX3y4OmZ7eHXCu1HPP7NU5HFkME/JZjuQ=";
39 fetchSubmodules = true;
40 };
41
42 patches = [ ./macos-no-dmg.patch ];
43
44 nativeBuildInputs = [
45 pkg-config
46 cmake
47 wrapGAppsHook3
48 wrapQtAppsHook
49 qttools
50 ];
51
52 buildInputs = [
53 curl
54 qtbase
55 avahi
56 libX11
57 libXext
58 libXtst
59 libXinerama
60 libXrandr
61 libXdmcp
62 libICE
63 libSM
64 ]
65 ++ lib.optionals withLibei [
66 libei
67 libportal
68 ]
69 ++ lib.optionals stdenv.hostPlatform.isDarwin [
70 pkgsStatic.openssl
71 ];
72
73 cmakeFlags = [
74 "-DINPUTLEAP_REVISION=${builtins.substring 0 8 src.rev}"
75 ]
76 ++ lib.optional withLibei "-DINPUTLEAP_BUILD_LIBEI=ON";
77
78 dontWrapGApps = true;
79 preFixup = ''
80 qtWrapperArgs+=(
81 "''${gappsWrapperArgs[@]}"
82 --prefix PATH : "${lib.makeBinPath [ openssl ]}"
83 )
84 '';
85
86 meta = {
87 description = "Open-source KVM software";
88 longDescription = ''
89 Input Leap is software that mimics the functionality of a KVM switch, which historically
90 would allow you to use a single keyboard and mouse to control multiple computers by
91 physically turning a dial on the box to switch the machine you're controlling at any
92 given moment. Input Leap does this in software, allowing you to tell it which machine
93 to control by moving your mouse to the edge of the screen, or by using a keypress
94 to switch focus to a different system.
95 '';
96 homepage = "https://github.com/input-leap/input-leap";
97 license = lib.licenses.gpl2Plus;
98 maintainers = with lib.maintainers; [
99 kovirobi
100 phryneas
101 twey
102 shymega
103 ];
104 platforms = lib.platforms.linux ++ lib.platforms.darwin;
105 };
106}