38 stdenv.mkDerivation rec {
40 version = "1.14.6.19-stable";
42 src = fetchFromGitHub {
44 repo = "synergy-core";
46 hash = "sha256-0QqklfSsvcXh7I2jaHk82k0nY8gQOj9haA4WOjGqBqY=";
47 fetchSubmodules = true;
51 # Without this OpenSSL from nixpkgs is not detected
52 ./darwin-non-static-openssl.patch
56 substituteInPlace src/gui/src/SslCertificate.cpp \
57 --replace 'kUnixOpenSslCommand[] = "openssl";' 'kUnixOpenSslCommand[] = "${openssl}/bin/openssl";'
58 '' + lib.optionalString stdenv.hostPlatform.isLinux ''
59 substituteInPlace src/lib/synergy/unix/AppUtilUnix.cpp \
60 --replace "/usr/share/X11/xkb/rules/evdev.xml" "${xkeyboardconfig}/share/X11/xkb/rules/evdev.xml"
66 ] ++ lib.optional withGUI wrapQtAppsHook;
69 qttools # Used for translations even when not building the GUI
72 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
79 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
97 # Silences many warnings
98 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-inconsistent-missing-override";
100 cmakeFlags = lib.optional (!withGUI) "-DSYNERGY_BUILD_LEGACY_GUI=OFF"
101 # NSFilenamesPboardType is deprecated in 10.14+
102 ++ lib.optional stdenv.hostPlatform.isDarwin "-DCMAKE_OSX_DEPLOYMENT_TARGET=${if stdenv.hostPlatform.isAarch64 then "10.13" else stdenv.hostPlatform.darwinSdkVersion}";
108 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
109 # filter out tests failing with sandboxing on darwin
110 export GTEST_FILTER=-ServerConfigTests.serverconfig_will_deem_equal_configs_with_same_cell_names:NetworkAddress.hostname_valid_parsing
120 cp bin/{synergyc,synergys,synergyd,syntool} $out/bin/
121 '' + lib.optionalString withGUI ''
122 cp bin/synergy $out/bin/
123 '' + lib.optionalString stdenv.hostPlatform.isLinux ''
124 mkdir -p $out/share/{applications,icons/hicolor/scalable/apps}
125 cp ../res/synergy.svg $out/share/icons/hicolor/scalable/apps/
126 substitute ../res/synergy.desktop $out/share/applications/synergy.desktop \
127 --replace "/usr/bin" "$out/bin"
128 '' + lib.optionalString (stdenv.hostPlatform.isDarwin && withGUI) ''
129 mkdir -p $out/Applications
130 cp -r bundle/Synergy.app $out/Applications
131 ln -s $out/bin $out/Applications/Synergy.app/Contents/MacOS
136 dontWrapQtApps = lib.optional (!withGUI) true;
139 description = "Share one mouse and keyboard between multiple computers";
140 homepage = "https://symless.com/synergy";
141 changelog = "https://github.com/symless/synergy-core/blob/${version}/ChangeLog";
142 mainProgram = lib.optionalString (!withGUI) "synergyc";
143 license = licenses.gpl2Only;
144 maintainers = with maintainers; [ talyz ];
145 platforms = platforms.unix;