nixpkgs/pkgs/applications/misc/keepassx/darwin.patch

53 lines
2.1 KiB
Diff
Raw Normal View History

Remove the use of macdeployqt to avoid copying dependencies and
reduce installation size from 90 MB to 9 MB.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -250,8 +250,8 @@ else()
set(PROGNAME keepassxc)
endif()
-if(APPLE AND WITH_APP_BUNDLE AND "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
- set(CMAKE_INSTALL_PREFIX "/Applications")
+if(APPLE AND WITH_APP_BUNDLE)
+ set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/Applications")
set(CMAKE_INSTALL_MANDIR "/usr/local/share/man")
endif()
@@ -262,7 +262,7 @@ if(MINGW)
set(PLUGIN_INSTALL_DIR ".")
set(DATA_INSTALL_DIR "share")
elseif(APPLE AND WITH_APP_BUNDLE)
- set(CLI_INSTALL_DIR "/usr/local/bin")
+ set(CLI_INSTALL_DIR "../bin")
set(PROXY_INSTALL_DIR "/usr/local/bin")
set(BIN_INSTALL_DIR ".")
set(PLUGIN_INSTALL_DIR "${PROGNAME}.app/Contents/PlugIns")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 69526967..38f7c5d4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -319,11 +319,6 @@ if(APPLE AND WITH_APP_BUNDLE)
set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION}")
include(CPack)
- add_custom_command(TARGET ${PROGNAME}
- POST_BUILD
- COMMAND ${MACDEPLOYQT_EXE} ${PROGNAME}.app
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
- COMMENT "Deploying app bundle")
endif()
install(TARGETS ${PROGNAME}
diff --git a/src/autotype/mac/CMakeLists.txt b/src/autotype/mac/CMakeLists.txt
index 08c53278..b833b692 100644
--- a/src/autotype/mac/CMakeLists.txt
+++ b/src/autotype/mac/CMakeLists.txt
@@ -14,7 +14,6 @@ if(WITH_APP_BUNDLE)
add_custom_command(TARGET keepassx-autotype-cocoa
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libkeepassx-autotype-cocoa.so ${PLUGIN_INSTALL_DIR}
- COMMAND ${MACDEPLOYQT_EXE} ${PROGNAME}.app -executable=${PLUGIN_INSTALL_DIR}/libkeepassx-autotype-cocoa.so -no-plugins
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
COMMENT "Deploying autotype plugin")
else()