2021-11-08 11:04:34 +00:00
|
|
|
{ withGUI ? true
|
|
|
|
, stdenv
|
|
|
|
, lib
|
|
|
|
, fetchpatch
|
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapQtAppsHook
|
|
|
|
|
|
|
|
, cmake
|
|
|
|
, openssl
|
|
|
|
, pcre
|
|
|
|
, util-linux
|
|
|
|
, libselinux
|
|
|
|
, libsepol
|
|
|
|
, pkg-config
|
|
|
|
, gdk-pixbuf
|
|
|
|
, libnotify
|
|
|
|
, qttools
|
|
|
|
, xlibsWrapper
|
|
|
|
, libX11
|
|
|
|
, libXi
|
|
|
|
, libXtst
|
|
|
|
, libXrandr
|
|
|
|
, xinput
|
|
|
|
, avahi-compat
|
|
|
|
|
|
|
|
# macOS / darwin
|
|
|
|
, ApplicationServices
|
|
|
|
, Carbon
|
|
|
|
, Cocoa
|
|
|
|
, CoreServices
|
|
|
|
, ScreenSaver
|
|
|
|
}:
|
2010-07-28 16:35:01 +01:00
|
|
|
|
2012-10-15 13:26:44 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "synergy";
|
2021-11-08 11:04:34 +00:00
|
|
|
version = "1.14.1.32";
|
2007-11-11 08:16:23 +00:00
|
|
|
|
2014-11-23 04:25:15 +00:00
|
|
|
src = fetchFromGitHub {
|
2016-02-11 16:36:48 +00:00
|
|
|
owner = "symless";
|
2017-11-04 14:24:20 +00:00
|
|
|
repo = "synergy-core";
|
2020-02-15 00:39:47 +00:00
|
|
|
rev = "${version}-stable";
|
2021-05-23 00:55:42 +01:00
|
|
|
fetchSubmodules = true;
|
2021-11-08 11:04:34 +00:00
|
|
|
sha256 = "123p75rm22vb3prw1igh0yii2y4bvv7r18iykfvmnr41hh4w7z2p";
|
2012-10-15 13:26:44 +01:00
|
|
|
};
|
2009-12-21 08:55:31 +00:00
|
|
|
|
2021-11-08 11:04:34 +00:00
|
|
|
patches = [ ./macos_build_fix.patch ];
|
2018-07-14 13:33:24 +01:00
|
|
|
|
2015-08-11 11:38:27 +01:00
|
|
|
postPatch = ''
|
2021-05-23 00:55:42 +01:00
|
|
|
substituteInPlace src/gui/src/SslCertificate.cpp \
|
|
|
|
--replace 'kUnixOpenSslCommand[] = "openssl";' 'kUnixOpenSslCommand[] = "${openssl}/bin/openssl";'
|
2013-06-21 05:25:00 +01:00
|
|
|
'';
|
|
|
|
|
2021-11-08 11:04:34 +00:00
|
|
|
cmakeFlags = lib.optionals (!withGUI) [
|
|
|
|
"-DSYNERGY_BUILD_LEGACY_GUI=OFF"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.09"
|
|
|
|
];
|
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-inconsistent-missing-override";
|
2020-02-15 00:39:47 +00:00
|
|
|
|
2021-11-08 11:04:34 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
|
2020-02-15 00:39:47 +00:00
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
2018-07-14 13:33:24 +01:00
|
|
|
|
2015-08-11 11:38:27 +01:00
|
|
|
buildInputs = [
|
2020-02-17 19:41:43 +00:00
|
|
|
openssl
|
2021-11-08 11:04:34 +00:00
|
|
|
pcre
|
2020-03-20 18:08:39 +00:00
|
|
|
] ++ lib.optionals withGUI [
|
|
|
|
qttools
|
2018-07-14 13:33:24 +01:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2021-11-08 11:04:34 +00:00
|
|
|
ApplicationServices
|
|
|
|
Carbon
|
|
|
|
Cocoa
|
|
|
|
CoreServices
|
|
|
|
ScreenSaver
|
2020-02-17 19:41:43 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2021-11-08 11:04:34 +00:00
|
|
|
util-linux
|
|
|
|
libselinux
|
|
|
|
libsepol
|
|
|
|
xlibsWrapper
|
|
|
|
libX11
|
|
|
|
libXi
|
|
|
|
libXtst
|
|
|
|
libXrandr
|
|
|
|
xinput
|
|
|
|
avahi-compat
|
|
|
|
gdk-pixbuf
|
|
|
|
libnotify
|
2020-02-17 19:41:43 +00:00
|
|
|
];
|
2007-11-11 08:16:23 +00:00
|
|
|
|
2012-10-15 13:26:44 +01:00
|
|
|
installPhase = ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $out/bin
|
2020-02-15 00:39:47 +00:00
|
|
|
cp bin/{synergyc,synergys,synergyd,syntool} $out/bin/
|
|
|
|
'' + lib.optionalString withGUI ''
|
|
|
|
cp bin/synergy $out/bin/
|
2021-05-23 00:55:42 +01:00
|
|
|
wrapQtApp $out/bin/synergy
|
2020-02-17 19:41:43 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2020-02-15 00:39:47 +00: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 19:41:43 +00: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 13:26:44 +01:00
|
|
|
'';
|
2009-04-29 14:04:01 +01:00
|
|
|
|
2013-06-21 06:14:17 +01:00
|
|
|
doCheck = true;
|
2020-02-15 00:39:47 +00:00
|
|
|
checkPhase = "bin/unittests";
|
2013-06-21 06:14:17 +01:00
|
|
|
|
2018-07-14 13:33:24 +01:00
|
|
|
meta = with lib; {
|
2015-08-11 12:13:13 +01:00
|
|
|
description = "Share one mouse and keyboard between multiple computers";
|
2021-11-08 11:04:34 +00:00
|
|
|
homepage = "https://symless.com/synergy";
|
2013-06-21 12:16:30 +01:00
|
|
|
license = licenses.gpl2;
|
2021-05-23 00:55:42 +01:00
|
|
|
maintainers = with maintainers; [ talyz ];
|
2013-06-21 12:16:30 +01:00
|
|
|
platforms = platforms.all;
|
2007-11-11 08:16:23 +00:00
|
|
|
};
|
|
|
|
}
|