From e8de340ddb5b48062e71e38bb202cef95df5f2f4 Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Wed, 25 Jun 2025 10:00:56 -0700 Subject: [PATCH] input-leap: build on Darwin at 3.0.3 Fixes: #419996 --- pkgs/applications/misc/input-leap/default.nix | 11 ++++++++-- .../misc/input-leap/macos-no-dmg.patch | 22 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/misc/input-leap/macos-no-dmg.patch diff --git a/pkgs/applications/misc/input-leap/default.nix b/pkgs/applications/misc/input-leap/default.nix index a1b58f633b78..3592f13d80a8 100644 --- a/pkgs/applications/misc/input-leap/default.nix +++ b/pkgs/applications/misc/input-leap/default.nix @@ -4,7 +4,7 @@ fetchFromGitHub, cmake, - withLibei ? true, + withLibei ? !stdenv.hostPlatform.isDarwin, avahi, curl, @@ -19,6 +19,7 @@ libei, libportal, openssl, + pkgsStatic, pkg-config, qtbase, qttools, @@ -38,6 +39,8 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; + patches = [ ./macos-no-dmg.patch ]; + nativeBuildInputs = [ pkg-config cmake @@ -45,6 +48,7 @@ stdenv.mkDerivation rec { wrapQtAppsHook qttools ]; + buildInputs = [ curl @@ -62,6 +66,9 @@ stdenv.mkDerivation rec { ++ lib.optionals withLibei [ libei libportal + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + pkgsStatic.openssl ]; cmakeFlags = [ @@ -94,6 +101,6 @@ stdenv.mkDerivation rec { twey shymega ]; - platforms = lib.platforms.linux; + platforms = lib.platforms.linux ++ lib.platforms.darwin; }; } diff --git a/pkgs/applications/misc/input-leap/macos-no-dmg.patch b/pkgs/applications/misc/input-leap/macos-no-dmg.patch new file mode 100644 index 000000000000..13896cc90fff --- /dev/null +++ b/pkgs/applications/misc/input-leap/macos-no-dmg.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ab4e56f2..d01d946d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -289,17 +289,6 @@ endmacro (configure_files) + # Make a bundle for mac os + if (APPLE) + 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) +- set(INPUTLEAP_BUNDLE_APP_DIR ${INPUTLEAP_BUNDLE_DIR}/InputLeap.app) +- set(INPUTLEAP_BUNDLE_BINARY_DIR ${INPUTLEAP_BUNDLE_APP_DIR}/Contents/MacOS) +- +- configure_files(${INPUTLEAP_BUNDLE_SOURCE_DIR} ${INPUTLEAP_BUNDLE_DIR}) +- +- add_custom_target(InputLeap_MacOS ALL +- bash build_dist.sh +- DEPENDS input-leap input-leaps input-leapc +- WORKING_DIRECTORY ${INPUTLEAP_BUNDLE_DIR}) + elseif (UNIX AND NOT APPLE) + install(FILES doc/input-leapc.1 doc/input-leaps.1 DESTINATION share/man/man1) +