2020-07-28 02:14:06 +02:00
|
|
|
{ stdenv, lib, fetchpatch, fetchFromGitHub, cmake, openssl, qttools
|
2019-06-19 22:21:48 +02:00
|
|
|
, ApplicationServices, Carbon, Cocoa, CoreServices, ScreenSaver
|
2020-02-17 20:41:43 +01:00
|
|
|
, xlibsWrapper, libX11, libXi, libXtst, libXrandr, xinput, avahi-compat
|
2020-02-15 01:39:47 +01:00
|
|
|
, withGUI ? true, wrapQtAppsHook }:
|
2010-07-28 17:35:01 +02:00
|
|
|
|
2012-10-15 14:26:44 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "synergy";
|
2020-03-20 19:08:39 +01:00
|
|
|
version = "1.11.1";
|
2007-11-11 09:16:23 +01:00
|
|
|
|
2014-11-23 05:25:15 +01:00
|
|
|
src = fetchFromGitHub {
|
2016-02-11 17:36:48 +01:00
|
|
|
owner = "symless";
|
2017-11-04 15:24:20 +01:00
|
|
|
repo = "synergy-core";
|
2020-02-15 01:39:47 +01:00
|
|
|
rev = "${version}-stable";
|
|
|
|
sha256 = "1jk60xw4h6s5crha89wk4y8rrf1f3bixgh5mzh3cq3xyrkba41gh";
|
2012-10-15 14:26:44 +02:00
|
|
|
};
|
2009-12-21 09:55:31 +01:00
|
|
|
|
2020-07-28 02:14:06 +02:00
|
|
|
patches = [
|
|
|
|
./build-tests.patch
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2020-15117.patch";
|
|
|
|
url = "https://github.com/symless/synergy-core/commit/"
|
|
|
|
+ "0a97c2be0da2d0df25cb86dfd642429e7a8bea39.patch";
|
|
|
|
sha256 = "03q8m5n50fms7fjfjgmqrgy9mrxwi9kkz3f3vlrs2x5h21dl6bmj";
|
|
|
|
})
|
2020-02-15 01:39:47 +01:00
|
|
|
] ++ lib.optional stdenv.isDarwin ./macos_build_fix.patch;
|
2017-07-22 19:42:26 +02:00
|
|
|
|
2020-02-15 01:39:47 +01:00
|
|
|
# Since the included gtest and gmock don't support clang and the
|
|
|
|
# segfault when built with gcc9, we replace it with 1.10.0 for
|
|
|
|
# synergy-1.11.0. This should become unnecessary when upstream
|
|
|
|
# updates these dependencies.
|
|
|
|
googletest = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "googletest";
|
|
|
|
rev = "release-1.10.0";
|
|
|
|
sha256 = "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz";
|
2018-07-14 14:33:24 +02:00
|
|
|
};
|
|
|
|
|
2015-08-11 12:38:27 +02:00
|
|
|
postPatch = ''
|
2020-02-15 01:39:47 +01:00
|
|
|
rm -r ext/*
|
|
|
|
cp -r ${googletest}/googlemock ext/gmock/
|
|
|
|
cp -r ${googletest}/googletest ext/gtest/
|
|
|
|
chmod -R +w ext/
|
2013-06-21 06:25:00 +02:00
|
|
|
'';
|
|
|
|
|
2020-02-17 20:41:43 +01:00
|
|
|
cmakeFlags = lib.optional (!withGUI) "-DSYNERGY_BUILD_LEGACY_GUI=OFF";
|
2020-02-15 01:39:47 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ] ++ lib.optional withGUI wrapQtAppsHook;
|
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
2018-07-14 14:33:24 +02:00
|
|
|
|
2015-08-11 12:38:27 +02:00
|
|
|
buildInputs = [
|
2020-02-17 20:41:43 +01:00
|
|
|
openssl
|
2020-03-20 19:08:39 +01:00
|
|
|
] ++ lib.optionals withGUI [
|
|
|
|
qttools
|
2018-07-14 14:33:24 +02:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2019-06-19 22:21:48 +02:00
|
|
|
ApplicationServices Carbon Cocoa CoreServices ScreenSaver
|
2020-02-17 20:41:43 +01:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
xlibsWrapper libX11 libXi libXtst libXrandr xinput avahi-compat
|
|
|
|
];
|
2007-11-11 09:16:23 +01:00
|
|
|
|
2012-10-15 14:26:44 +02:00
|
|
|
installPhase = ''
|
2014-06-30 14:56:10 +02:00
|
|
|
mkdir -p $out/bin
|
2020-02-15 01:39:47 +01:00
|
|
|
cp bin/{synergyc,synergys,synergyd,syntool} $out/bin/
|
|
|
|
'' + lib.optionalString withGUI ''
|
|
|
|
cp bin/synergy $out/bin/
|
|
|
|
wrapQtApp $out/bin/synergy --prefix PATH : ${lib.makeBinPath [ openssl ]}
|
2020-02-17 20:41:43 +01:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2020-02-15 01:39:47 +01:00
|
|
|
mkdir -p $out/share/icons/hicolor/scalable/apps
|
|
|
|
cp ../res/synergy.svg $out/share/icons/hicolor/scalable/apps/
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
substitute ../res/synergy.desktop $out/share/applications/synergy.desktop --replace /usr/bin $out/bin
|
2020-02-17 20:41:43 +01:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
mkdir -p $out/Applications/
|
|
|
|
mv bundle/Synergy.app $out/Applications/
|
|
|
|
ln -s $out/bin $out/Applications/Synergy.app/Contents/MacOS
|
2012-10-15 14:26:44 +02:00
|
|
|
'';
|
2009-04-29 15:04:01 +02:00
|
|
|
|
2013-06-21 07:14:17 +02:00
|
|
|
doCheck = true;
|
2020-02-15 01:39:47 +01:00
|
|
|
checkPhase = "bin/unittests";
|
2013-06-21 07:14:17 +02:00
|
|
|
|
2018-07-14 14:33:24 +02:00
|
|
|
meta = with lib; {
|
2015-08-11 13:13:13 +02:00
|
|
|
description = "Share one mouse and keyboard between multiple computers";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://synergy-project.org/";
|
2013-06-21 13:16:30 +02:00
|
|
|
license = licenses.gpl2;
|
2021-01-06 07:06:03 +01:00
|
|
|
maintainers = with maintainers; [ ];
|
2013-06-21 13:16:30 +02:00
|
|
|
platforms = platforms.all;
|
2007-11-11 09:16:23 +01:00
|
|
|
};
|
|
|
|
}
|