2021-11-08 11:04:34 +00:00
|
|
|
{ withGUI ? true
|
|
|
|
, stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapQtAppsHook
|
|
|
|
|
|
|
|
, cmake
|
|
|
|
, openssl
|
|
|
|
, pcre
|
|
|
|
, util-linux
|
|
|
|
, libselinux
|
|
|
|
, libsepol
|
|
|
|
, pkg-config
|
|
|
|
, gdk-pixbuf
|
|
|
|
, libnotify
|
|
|
|
, qttools
|
2022-11-14 08:31:17 +00:00
|
|
|
, libICE
|
|
|
|
, libSM
|
2021-11-08 11:04:34 +00:00
|
|
|
, libX11
|
2022-09-03 18:59:30 +00:00
|
|
|
, libxkbfile
|
2021-11-08 11:04:34 +00:00
|
|
|
, libXi
|
|
|
|
, libXtst
|
|
|
|
, libXrandr
|
2022-09-03 18:59:30 +00:00
|
|
|
, libXinerama
|
|
|
|
, xkeyboardconfig
|
2021-11-08 11:04:34 +00:00
|
|
|
, xinput
|
|
|
|
, avahi-compat
|
|
|
|
|
2022-09-03 18:59:30 +00:00
|
|
|
# MacOS / darwin
|
2022-11-01 00:41:15 +00:00
|
|
|
, darwin
|
2021-11-08 11:04:34 +00:00
|
|
|
, ApplicationServices
|
|
|
|
, Carbon
|
|
|
|
, Cocoa
|
|
|
|
, CoreServices
|
|
|
|
, ScreenSaver
|
|
|
|
}:
|
2010-07-28 15:35:01 +00:00
|
|
|
|
2012-10-15 12:26:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "synergy";
|
2023-05-13 05:29:12 +00:00
|
|
|
version = "1.14.6.19-stable";
|
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";
|
2022-09-03 18:59:30 +00:00
|
|
|
rev = version;
|
2023-05-13 05:29:12 +00:00
|
|
|
sha256 = "sha256-0QqklfSsvcXh7I2jaHk82k0nY8gQOj9haA4WOjGqBqY=";
|
2021-05-22 23:55:42 +00:00
|
|
|
fetchSubmodules = true;
|
2012-10-15 12:26:44 +00:00
|
|
|
};
|
2009-12-21 08:55:31 +00:00
|
|
|
|
2022-09-03 18:59:30 +00:00
|
|
|
patches = [
|
|
|
|
# Without this OpenSSL from nixpkgs is not detected
|
|
|
|
./darwin-non-static-openssl.patch
|
2022-11-01 00:41:15 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin && !(darwin.apple_sdk.frameworks ? UserNotifications)) [
|
2022-09-03 18:59:30 +00:00
|
|
|
# We cannot include UserNotifications because of a build failure in the Apple SDK.
|
|
|
|
# The functions used from it are already implicitly included anyways.
|
|
|
|
./darwin-no-UserNotifications-includes.patch
|
|
|
|
];
|
2018-07-14 12:33:24 +00:00
|
|
|
|
2015-08-11 10:38:27 +00:00
|
|
|
postPatch = ''
|
2021-05-22 23:55:42 +00:00
|
|
|
substituteInPlace src/gui/src/SslCertificate.cpp \
|
|
|
|
--replace 'kUnixOpenSslCommand[] = "openssl";' 'kUnixOpenSslCommand[] = "${openssl}/bin/openssl";'
|
2022-09-03 18:59:30 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
|
|
|
substituteInPlace src/lib/synergy/unix/AppUtilUnix.cpp \
|
|
|
|
--replace "/usr/share/X11/xkb/rules/evdev.xml" "${xkeyboardconfig}/share/X11/xkb/rules/evdev.xml"
|
2013-06-21 04:25:00 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-03 18:59:30 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
] ++ lib.optional withGUI wrapQtAppsHook;
|
2018-07-14 12:33:24 +00:00
|
|
|
|
2015-08-11 10:38:27 +00:00
|
|
|
buildInputs = [
|
2022-09-03 18:59:30 +00:00
|
|
|
qttools # Used for translations even when not building the GUI
|
2020-02-17 19:41:43 +00:00
|
|
|
openssl
|
2021-11-08 11:04:34 +00:00
|
|
|
pcre
|
2018-07-14 12:33:24 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2021-11-08 11:04:34 +00:00
|
|
|
ApplicationServices
|
|
|
|
Carbon
|
|
|
|
Cocoa
|
|
|
|
CoreServices
|
|
|
|
ScreenSaver
|
2022-11-01 00:41:15 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin && darwin.apple_sdk.frameworks ? UserNotifications) [
|
|
|
|
darwin.apple_sdk.frameworks.UserNotifications
|
2020-02-17 19:41:43 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2021-11-08 11:04:34 +00:00
|
|
|
util-linux
|
|
|
|
libselinux
|
|
|
|
libsepol
|
2022-11-14 08:31:17 +00:00
|
|
|
libICE
|
|
|
|
libSM
|
2021-11-08 11:04:34 +00:00
|
|
|
libX11
|
|
|
|
libXi
|
|
|
|
libXtst
|
|
|
|
libXrandr
|
2022-09-03 18:59:30 +00:00
|
|
|
libXinerama
|
|
|
|
libxkbfile
|
2021-11-08 11:04:34 +00:00
|
|
|
xinput
|
|
|
|
avahi-compat
|
|
|
|
gdk-pixbuf
|
|
|
|
libnotify
|
2020-02-17 19:41:43 +00:00
|
|
|
];
|
2007-11-11 08:16:23 +00:00
|
|
|
|
2022-09-03 18:59:30 +00:00
|
|
|
# Silences many warnings
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-inconsistent-missing-override";
|
2022-09-03 18:59:30 +00:00
|
|
|
|
|
|
|
cmakeFlags = lib.optional (!withGUI) "-DSYNERGY_BUILD_LEGACY_GUI=OFF"
|
2022-11-01 00:41:15 +00:00
|
|
|
# NSFilenamesPboardType is deprecated in 10.14+
|
|
|
|
++ lib.optional stdenv.isDarwin "-DCMAKE_OSX_DEPLOYMENT_TARGET=${if stdenv.isAarch64 then "10.13" else stdenv.targetPlatform.darwinSdkVersion}";
|
2022-09-03 18:59:30 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
bin/unittests
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2012-10-15 12:26:44 +00:00
|
|
|
installPhase = ''
|
2022-09-03 18:59:30 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2014-06-30 12:56:10 +00: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/
|
2020-02-17 19:41:43 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2022-09-03 18:59:30 +00:00
|
|
|
mkdir -p $out/share/{applications,icons/hicolor/scalable/apps}
|
2020-02-15 00:39:47 +00:00
|
|
|
cp ../res/synergy.svg $out/share/icons/hicolor/scalable/apps/
|
2022-09-03 18:59:30 +00:00
|
|
|
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 ''
|
2022-09-03 18:59:30 +00:00
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -r bundle/Synergy.app $out/Applications
|
2020-02-17 19:41:43 +00:00
|
|
|
ln -s $out/bin $out/Applications/Synergy.app/Contents/MacOS
|
2022-09-03 18:59:30 +00:00
|
|
|
'' + ''
|
|
|
|
runHook postInstall
|
2012-10-15 12:26:44 +00:00
|
|
|
'';
|
2009-04-29 13:04:01 +00:00
|
|
|
|
2022-09-03 18:59:30 +00:00
|
|
|
dontWrapQtApps = lib.optional (!withGUI) true;
|
2013-06-21 05:14:17 +00:00
|
|
|
|
2018-07-14 12:33:24 +00:00
|
|
|
meta = with lib; {
|
2015-08-11 11:13:13 +00:00
|
|
|
description = "Share one mouse and keyboard between multiple computers";
|
2021-11-08 11:04:34 +00:00
|
|
|
homepage = "https://symless.com/synergy";
|
2022-09-03 18:59:30 +00:00
|
|
|
changelog = "https://github.com/symless/synergy-core/blob/${version}/ChangeLog";
|
|
|
|
mainProgram = lib.optionalString (!withGUI) "synergyc";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ talyz ivar ];
|
|
|
|
platforms = platforms.unix;
|
2007-11-11 08:16:23 +00:00
|
|
|
};
|
|
|
|
}
|