nixpkgs/pkgs/applications/misc/synergy/default.nix

69 lines
2.2 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchpatch, fetchFromGitHub, cmake, openssl, qttools
2019-06-19 21:21:48 +01:00
, ApplicationServices, Carbon, Cocoa, CoreServices, ScreenSaver
, xlibsWrapper, libX11, libXi, libXtst, libXrandr, xinput, avahi-compat
, withGUI ? true, wrapQtAppsHook }:
2012-10-15 13:26:44 +01:00
stdenv.mkDerivation rec {
pname = "synergy";
2021-05-23 00:55:42 +01:00
version = "1.13.1.41";
2014-11-23 04:25:15 +00:00
src = fetchFromGitHub {
owner = "symless";
repo = "synergy-core";
rev = "${version}-stable";
2021-05-23 00:55:42 +01:00
fetchSubmodules = true;
sha256 = "1phg0szc9g018zxs5wbys4drzq1cdhyzajfg45l6a3fmi6qdi1kw";
2012-10-15 13:26:44 +01:00
};
2021-05-23 00:55:42 +01:00
patches = lib.optional stdenv.isDarwin ./macos_build_fix.patch;
postPatch = ''
2021-05-23 00:55:42 +01:00
substituteInPlace src/gui/src/SslCertificate.cpp \
--replace 'kUnixOpenSslCommand[] = "openssl";' 'kUnixOpenSslCommand[] = "${openssl}/bin/openssl";'
'';
cmakeFlags = lib.optional (!withGUI) "-DSYNERGY_BUILD_LEGACY_GUI=OFF";
nativeBuildInputs = [ cmake ] ++ lib.optional withGUI wrapQtAppsHook;
dontWrapQtApps = true;
buildInputs = [
openssl
2020-03-20 18:08:39 +00:00
] ++ lib.optionals withGUI [
qttools
] ++ lib.optionals stdenv.isDarwin [
2019-06-19 21:21:48 +01:00
ApplicationServices Carbon Cocoa CoreServices ScreenSaver
] ++ lib.optionals stdenv.isLinux [
xlibsWrapper libX11 libXi libXtst libXrandr xinput avahi-compat
];
2012-10-15 13:26:44 +01:00
installPhase = ''
mkdir -p $out/bin
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
'' + lib.optionalString stdenv.isLinux ''
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
'' + 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
'';
doCheck = true;
checkPhase = "bin/unittests";
meta = with lib; {
description = "Share one mouse and keyboard between multiple computers";
2021-05-23 00:55:42 +01:00
homepage = "https://synergy-project.org/";
license = licenses.gpl2;
2021-05-23 00:55:42 +01:00
maintainers = with maintainers; [ talyz ];
platforms = platforms.all;
};
}