Skip to content

Commit

Permalink
input-leap: Update to latest HEAD
Browse files Browse the repository at this point in the history
Despite there now being official releases of input-leap, code quality remains
unchanged and there is unfortunately still no added value from sticking to the
release versions.

This update disables GUI variant due to intrusive build changes in project
upstream, which need to be fixed before re-enabling it.
  • Loading branch information
Koston-0xDEADBEEF committed Feb 25, 2025
1 parent 72de4e5 commit b6cfddf
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 39 deletions.
35 changes: 23 additions & 12 deletions aqua/input-leap/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ PortGroup cmake 1.1
PortGroup legacysupport 1.1
PortGroup openssl 1.0

github.setup input-leap input-leap 5fbf52bfa84069b316dbd63070a36f292ad30199
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
version 2.4.0-20240912
github.setup input-leap input-leap e4c31b78edc646915147011205a546898c07fd1d
version 3.0.2-20250224
revision 0
categories aqua net sysutils
platforms {darwin >= 16}
Expand All @@ -21,12 +19,14 @@ long_description ${name} shares a keyboard, mouse, and clipboard over the net
Linux, FreeBSD, OpenBSD, and Windows. It is a fork of barrier,\
which in turn is a fork of synergy.

checksums rmd160 b950a45d8ba239c09e069e4a1816174b598e48ef \
sha256 0364365f9600f8f07016367d47777db3f57b1186a42a8185098166bc5b1bff1a \
size 1758915
checksums rmd160 4763f4c218fbfbb5f0b142d397230fb8cdd2948e \
sha256 7e2e3b56a764e1768b0754a10fbb07caa80806094683f27476ce03a0398aabef \
size 1765873

patchfiles map-altgr-to-altr.patch \
workaround-for-unsafe-threads.patch \
fix-non-gui-build.patch

patchfiles set-cmake-revision.patch \
fix-macos-scroll.patch
patch.pre_args-replace -p0 -p1

compiler.cxx_standard 2014
Expand All @@ -39,8 +39,13 @@ depends_build-append \
legacysupport.newest_darwin_requires_legacy 16

configure.args-append \
-DINPUTLEAP_BUILD_INSTALLER=OFF \
-DINPUTLEAP_BUILD_TESTS=OFF
-DINPUTLEAP_BUILD_TESTS=OFF \
-DINPUTLEAP_VERSION_DESC=20250224

# Ensure input-leap build doesn't pick /usr/bin/c++ as the compiler
if { ${os.platform} eq "darwin" } {
configure.cxx clang++
}

if {[variant_isset debug]} {
cmake.build_type Debug
Expand All @@ -52,13 +57,19 @@ if {[variant_isset debug]} {
configure.optflags
}

variant gui description {Build the configuration frontend (Qt6)} {}
# The GUI build is messed up, uses a jank shellscript instead of cmake/make to
# build the macOS app bundle. This needs to be fixed upstream instead of worked
# around in the Portfile using ugly hacks. The GUI isn't required for anything,
# so leaving it broken doesn't compromise utility of the port.
#
#variant gui description {Build the configuration frontend (Qt6)} {}

# the gui requires metal
if { (${os.platform} eq "darwin" && ${os.major} < 16) || (![variant_isset gui]) } {
configure.args-append \
-DINPUTLEAP_BUILD_GUI=OFF
} else {

PortGroup qt6 1.0
PortGroup app 1.0

Expand Down
13 changes: 0 additions & 13 deletions aqua/input-leap/files/fix-macos-scroll.patch

This file was deleted.

13 changes: 13 additions & 0 deletions aqua/input-leap/files/fix-non-gui-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 822ea2a2..79eea9ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -287,7 +287,7 @@ macro (configure_files srcDir destDir)
endmacro (configure_files)

# Make a bundle for mac os
-if (APPLE)
+if (APPLE__NOPE)
set (CMAKE_INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks")
set(INPUTLEAP_BUNDLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dist/macos/bundle)
set(INPUTLEAP_BUNDLE_DIR ${CMAKE_BINARY_DIR}/bundle)
14 changes: 14 additions & 0 deletions aqua/input-leap/files/map-altgr-to-altr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/src/lib/platform/OSXKeyState.cpp b/src/lib/platform/OSXKeyState.cpp
index 89e57e2b..e69d133d 100644
--- a/src/lib/platform/OSXKeyState.cpp
+++ b/src/lib/platform/OSXKeyState.cpp
@@ -109,6 +109,9 @@ static const KeyEntry s_controlKeys[] = {
{ kKeyMeta_L, kVK_Command }, // 55
{ kKeyMeta_R, kVK_RightCommand }, // 54

+ // macOS doesn't understand AltGr, so interpret it simply as right hand Alt
+ { kKeyAltGr, kVK_RightOption }, // 61
+
// toggle modifiers
{ kKeyNumLock, kVK_ANSI_KeypadClear },
{ kKeyCapsLock, kVK_CapsLock },
14 changes: 0 additions & 14 deletions aqua/input-leap/files/set-cmake-revision.patch

This file was deleted.

15 changes: 15 additions & 0 deletions aqua/input-leap/files/workaround-for-unsafe-threads.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/src/lib/inputleap/ClientApp.cpp b/src/lib/inputleap/ClientApp.cpp
index 3c620a1e..c3b8793d 100644
--- a/src/lib/inputleap/ClientApp.cpp
+++ b/src/lib/inputleap/ClientApp.cpp
@@ -435,7 +435,9 @@ ClientApp::mainLoop()
// that.
DAEMON_RUNNING(true);

-#if defined(MAC_OS_X_VERSION_10_7)
+// XXX: Creating a thread here is disabled, because it creates race
+// conditions and segfaults.
+#if defined(MAC_OS_X_VERSION_10_7__NOPE)

Thread thread([this](){ run_events_loop(); });

0 comments on commit b6cfddf

Please sign in to comment.