From 29f70db773e16f56b2aa3ce899b1cfbc8c9c5947 Mon Sep 17 00:00:00 2001 From: Jon Banafato Date: Sun, 4 Mar 2018 00:22:30 -0500 Subject: [PATCH 1/2] libargon2: add darwin to platforms --- pkgs/development/libraries/libargon2/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libargon2/default.nix b/pkgs/development/libraries/libargon2/default.nix index 94e8ea05e66..a1a04a1dd7b 100644 --- a/pkgs/development/libraries/libargon2/default.nix +++ b/pkgs/development/libraries/libargon2/default.nix @@ -36,6 +36,6 @@ stdenv.mkDerivation rec { homepage = https://www.argon2.com/; license = with licenses; [ asl20 cc0 ]; maintainers = with maintainers; [ taeer olynch ]; - platforms = platforms.linux; + platforms = platforms.linux ++ platforms.darwin; }; } From e0ba76c228c7f85c6d2c121a046af86892b8f4a0 Mon Sep 17 00:00:00 2001 From: Jon Banafato Date: Sun, 4 Mar 2018 00:23:33 -0500 Subject: [PATCH 2/2] keepassxc: 2.2.4 -> 2.3.0 See the [changelog](https://github.com/keepassxreboot/keepassxc/blob/a06e85f6ceac39851ca694464f74c927dd953f1e/CHANGELOG#L1-L51). Changes to options: - `withKeePassBrowser`: New in version 2.3.0 and replaces the functionality provided by the KeePassHTTP plugin. Users should install the [KeePassXC-Browser extension](https://github.com/keepassxreboot/keepassxc-browser). Defaults to `true` to remain consistent with the old default for `withKeePassHTTP`. - `withKeePassHTTP`: This feature is deprecated and disabled by default in the source repository. Default changed from `true` to `false`. - `withKeePassNetworking`: Controls all network access code within KeePassXC. Defaults to `false` to match the source repository. - `withKeePassSSHAgent`: Enables the SSH Agent plugin for use with [KeeAgent](https://lechnology.com/software/keeagent/). Defaults to `false` to match the source repository. --- pkgs/applications/misc/keepassx/cmake.patch | 18 ------- pkgs/applications/misc/keepassx/community.nix | 52 ++++++++++++++++--- pkgs/applications/misc/keepassx/darwin.patch | 28 +++++----- 3 files changed, 59 insertions(+), 39 deletions(-) delete mode 100644 pkgs/applications/misc/keepassx/cmake.patch diff --git a/pkgs/applications/misc/keepassx/cmake.patch b/pkgs/applications/misc/keepassx/cmake.patch deleted file mode 100644 index 4ddf8b2e7e9..00000000000 --- a/pkgs/applications/misc/keepassx/cmake.patch +++ /dev/null @@ -1,18 +0,0 @@ -Fix "No known features for CXX compiler", see -https://cmake.org/pipermail/cmake/2016-December/064733.html and the note at -https://cmake.org/cmake/help/v3.10/command/cmake_minimum_required.html ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -20,10 +20,10 @@ if(NOT CMAKE_BUILD_TYPE) - FORCE) - endif() - --project(KeePassXC) -- - cmake_minimum_required(VERSION 3.1.0) - -+project(KeePassXC) -+ - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) - - # Support Visual Studio Code diff --git a/pkgs/applications/misc/keepassx/community.nix b/pkgs/applications/misc/keepassx/community.nix index 2f08fbd5fc7..6f2f31473eb 100644 --- a/pkgs/applications/misc/keepassx/community.nix +++ b/pkgs/applications/misc/keepassx/community.nix @@ -1,28 +1,51 @@ { stdenv, fetchFromGitHub, cmake, makeWrapper, qttools -, libgcrypt, zlib, libmicrohttpd, libXtst, qtbase, libgpgerror, glibcLocales, libyubikey, yubikey-personalization, libXi, qtx11extras -, withKeePassHTTP ? true + +, curl +, libargon2 +, libgcrypt +, libsodium +, zlib +, libmicrohttpd +, libXtst +, qtbase +, libgpgerror +, glibcLocales +, libyubikey +, yubikey-personalization +, libXi +, qtx11extras + +, withKeePassBrowser ? true +, withKeePassHTTP ? false +, withKeePassNetworking ? false +, withKeePassSSHAgent ? false }: with stdenv.lib; stdenv.mkDerivation rec { name = "keepassxc-${version}"; - version = "2.2.4"; + version = "2.3.0"; src = fetchFromGitHub { owner = "keepassxreboot"; repo = "keepassxc"; rev = "${version}"; - sha256 = "0q913v2ka6p7jr7c4w9fq8aqh5v6nxqgcv9h7zllk5p0amsf8d80"; + sha256 = "1zch1qbqgphhp2p2kvjlah8s337162m69yf4y00kcnfb3539ii5f"; }; - patches = [ ./cmake.patch ./darwin.patch ]; + patches = [ ./darwin.patch ]; cmakeFlags = [ + "-DKEEPASSXC_BUILD_TYPE=Release" "-DWITH_GUI_TESTS=ON" "-DWITH_XC_AUTOTYPE=ON" "-DWITH_XC_YUBIKEY=ON" - ] ++ (optional withKeePassHTTP "-DWITH_XC_HTTP=ON"); + ] + ++ (optional withKeePassBrowser "-DWITH_XC_BROWSER=ON") + ++ (optional withKeePassHTTP "-DWITH_XC_HTTP=ON") + ++ (optional withKeePassNetworking "-DWITH_XC_NETWORKING=ON") + ++ (optional withKeePassSSHAgent "-DWITH_XC_SSHAGENT=ON"); doCheck = true; checkPhase = '' @@ -32,7 +55,22 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake makeWrapper qttools ]; - buildInputs = [ libgcrypt zlib qtbase libXtst libmicrohttpd libgpgerror glibcLocales libyubikey yubikey-personalization libXi qtx11extras ]; + buildInputs = [ + curl + glibcLocales + libXi + libXtst + libargon2 + libgcrypt + libgpgerror + libmicrohttpd + libsodium + libyubikey + qtbase + qtx11extras + yubikey-personalization + zlib + ]; postInstall = optionalString stdenv.isDarwin '' # Make it work without Qt in PATH. diff --git a/pkgs/applications/misc/keepassx/darwin.patch b/pkgs/applications/misc/keepassx/darwin.patch index 85fc49e3636..1edf0a573a3 100644 --- a/pkgs/applications/misc/keepassx/darwin.patch +++ b/pkgs/applications/misc/keepassx/darwin.patch @@ -2,7 +2,7 @@ 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 -@@ -188,8 +188,8 @@ else() +@@ -250,8 +250,8 @@ else() set(PROGNAME keepassxc) endif() @@ -10,43 +10,43 @@ reduce installation size from 90 MB to 9 MB. - 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() - if(MINGW) -@@ -198,7 +198,7 @@ if(MINGW) +@@ -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") - set(DATA_INSTALL_DIR "${PROGNAME}.app/Contents/Resources") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5255186..0175983 100644 +index 69526967..38f7c5d4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -282,11 +282,6 @@ if(APPLE AND WITH_APP_BUNDLE) - if(NOT DEFINED QT_BINARY_DIR) - set(QT_BINARY_DIR "/usr/local/opt/qt5/bin" CACHE PATH "QT binary folder") - endif() +@@ -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 ${QT_BINARY_DIR}/macdeployqt ${PROGNAME}.app +- COMMAND ${MACDEPLOYQT_EXE} ${PROGNAME}.app - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src - COMMENT "Deploying app bundle") endif() - if(MINGW) + install(TARGETS ${PROGNAME} diff --git a/src/autotype/mac/CMakeLists.txt b/src/autotype/mac/CMakeLists.txt -index ac93de0..03d502e 100644 +index 08c53278..b833b692 100644 --- a/src/autotype/mac/CMakeLists.txt +++ b/src/autotype/mac/CMakeLists.txt -@@ -16,7 +16,6 @@ if(WITH_APP_BUNDLE) +@@ -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 ${QT_BINARY_DIR}/macdeployqt ${PROGNAME}.app -executable=${PLUGIN_INSTALL_DIR}/libkeepassx-autotype-cocoa.so -no-plugins +- 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()