Skip to content

Commit

Permalink
synergy: 1.13.1.41 -> 1.14.1.32
Browse files Browse the repository at this point in the history
  • Loading branch information
talyz authored and Jonathan Ringer committed Nov 8, 2021
1 parent 753a895 commit c11d08f
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 127 deletions.
97 changes: 0 additions & 97 deletions pkgs/applications/misc/synergy/build-tests.patch

This file was deleted.

73 changes: 61 additions & 12 deletions pkgs/applications/misc/synergy/default.nix
@@ -1,41 +1,90 @@
{ stdenv, lib, fetchpatch, fetchFromGitHub, cmake, openssl, qttools
, ApplicationServices, Carbon, Cocoa, CoreServices, ScreenSaver
, xlibsWrapper, libX11, libXi, libXtst, libXrandr, xinput, avahi-compat
, withGUI ? true, wrapQtAppsHook }:
{ 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
}:

stdenv.mkDerivation rec {
pname = "synergy";
version = "1.13.1.41";
version = "1.14.1.32";

src = fetchFromGitHub {
owner = "symless";
repo = "synergy-core";
rev = "${version}-stable";
fetchSubmodules = true;
sha256 = "1phg0szc9g018zxs5wbys4drzq1cdhyzajfg45l6a3fmi6qdi1kw";
sha256 = "123p75rm22vb3prw1igh0yii2y4bvv7r18iykfvmnr41hh4w7z2p";
};

patches = lib.optional stdenv.isDarwin ./macos_build_fix.patch;
patches = [ ./macos_build_fix.patch ];

postPatch = ''
substituteInPlace src/gui/src/SslCertificate.cpp \
--replace 'kUnixOpenSslCommand[] = "openssl";' 'kUnixOpenSslCommand[] = "${openssl}/bin/openssl";'
'';

cmakeFlags = lib.optional (!withGUI) "-DSYNERGY_BUILD_LEGACY_GUI=OFF";
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";

nativeBuildInputs = [ cmake ] ++ lib.optional withGUI wrapQtAppsHook;
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];

dontWrapQtApps = true;

buildInputs = [
openssl
pcre
] ++ lib.optionals withGUI [
qttools
] ++ lib.optionals stdenv.isDarwin [
ApplicationServices Carbon Cocoa CoreServices ScreenSaver
ApplicationServices
Carbon
Cocoa
CoreServices
ScreenSaver
] ++ lib.optionals stdenv.isLinux [
xlibsWrapper libX11 libXi libXtst libXrandr xinput avahi-compat
util-linux
libselinux
libsepol
xlibsWrapper
libX11
libXi
libXtst
libXrandr
xinput
avahi-compat
gdk-pixbuf
libnotify
];

installPhase = ''
Expand All @@ -60,7 +109,7 @@ stdenv.mkDerivation rec {

meta = with lib; {
description = "Share one mouse and keyboard between multiple computers";
homepage = "https://synergy-project.org/";
homepage = "https://symless.com/synergy";
license = licenses.gpl2;
maintainers = with maintainers; [ talyz ];
platforms = platforms.all;
Expand Down
43 changes: 26 additions & 17 deletions pkgs/applications/misc/synergy/macos_build_fix.patch
@@ -1,20 +1,29 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1e78d1d..13639ba1 100644
index 50e712fa..d39c2ce4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -328,14 +328,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
${OPENSSL_ROOT}/lib/libssl.lib
${OPENSSL_ROOT}/lib/libcrypto.lib
)
-elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- set (OPENSSL_ROOT /usr/local/opt/openssl)
- include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
- set (OPENSSL_LIBS
- ${OPENSSL_ROOT}/lib/libssl.a
- ${OPENSSL_ROOT}/lib/libcrypto.a
- )
-elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux|.*BSD|DragonFly")
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux|Darwin|.*BSD|DragonFly")
set (OPENSSL_LIBS ssl crypto)
else()
message (FATAL_ERROR "Couldn't find OpenSSL")
@@ -326,9 +326,6 @@ endif()
# Apple has to use static libraries because
# "Use of the Apple-provided OpenSSL libraries by apps is strongly discouraged."
# https://developer.apple.com/library/archive/documentation/Security/Conceptual/cryptoservices/SecureNetworkCommunicationAPIs/SecureNetworkCommunicationAPIs.html
-if(APPLE)
- set(OPENSSL_USE_STATIC_LIBS TRUE)
-endif()
find_package(OpenSSL REQUIRED)

#
diff --git a/src/gui/src/OSXHelpers.mm b/src/gui/src/OSXHelpers.mm
index 0c98afc1..38c190a6 100644
--- a/src/gui/src/OSXHelpers.mm
+++ b/src/gui/src/OSXHelpers.mm
@@ -20,10 +20,6 @@
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import <Cocoa/Cocoa.h>
-#import <UserNotifications/UNNotification.h>
-#import <UserNotifications/UNUserNotificationCenter.h>
-#import <UserNotifications/UNNotificationContent.h>
-#import <UserNotifications/UNNotificationTrigger.h>

#import <QtGlobal>

1 change: 0 additions & 1 deletion pkgs/top-level/all-packages.nix
Expand Up @@ -28184,7 +28184,6 @@ with pkgs;
};

synergy = libsForQt5.callPackage ../applications/misc/synergy {
stdenv = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
inherit (darwin.apple_sdk.frameworks) ApplicationServices Carbon Cocoa CoreServices ScreenSaver;
};

Expand Down

0 comments on commit c11d08f

Please sign in to comment.