nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at netboot-syslinux-multiplatform 135 lines 3.7 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, cmake 5, qttools 6 7, asciidoctor 8, botan2 9, curl 10, libXi 11, libXtst 12, libargon2 13, libusb1 14, minizip 15, pcsclite 16, pkg-config 17, qrencode 18, qtbase 19, qtmacextras 20, qtsvg 21, qtx11extras 22, readline 23, wrapGAppsHook 24, wrapQtAppsHook 25, zlib 26 27, LocalAuthentication 28 29, withKeePassBrowser ? true 30, withKeePassFDOSecrets ? true 31, withKeePassKeeShare ? true 32, withKeePassNetworking ? true 33, withKeePassSSHAgent ? true 34, withKeePassTouchID ? true 35, withKeePassX11 ? true 36, withKeePassYubiKey ? true 37 38, nixosTests 39}: 40 41stdenv.mkDerivation rec { 42 pname = "keepassxc"; 43 version = "2.7.4"; 44 45 src = fetchFromGitHub { 46 owner = "keepassxreboot"; 47 repo = "keepassxc"; 48 rev = version; 49 sha256 = "sha256-amedKK9nplLVJTldeabN3/c+g/QesrdH+qx+rba2/4s="; 50 }; 51 52 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang (toString [ 53 "-Wno-old-style-cast" 54 "-Wno-error" 55 "-D__BIG_ENDIAN__=${if stdenv.isBigEndian then "1" else "0"}" 56 ]); 57 58 NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-rpath ${libargon2}/lib"; 59 60 patches = [ 61 ./darwin.patch 62 ]; 63 64 cmakeFlags = [ 65 "-DKEEPASSXC_BUILD_TYPE=Release" 66 "-DWITH_GUI_TESTS=ON" 67 "-DWITH_XC_UPDATECHECK=OFF" 68 ] 69 ++ (lib.optional (!withKeePassX11) "-DWITH_XC_X11=OFF") 70 ++ (lib.optional (withKeePassFDOSecrets && stdenv.isLinux) "-DWITH_XC_FDOSECRETS=ON") 71 ++ (lib.optional (withKeePassYubiKey && stdenv.isLinux) "-DWITH_XC_YUBIKEY=ON") 72 ++ (lib.optional withKeePassBrowser "-DWITH_XC_BROWSER=ON") 73 ++ (lib.optional withKeePassKeeShare "-DWITH_XC_KEESHARE=ON") 74 ++ (lib.optional withKeePassNetworking "-DWITH_XC_NETWORKING=ON") 75 ++ (lib.optional withKeePassSSHAgent "-DWITH_XC_SSHAGENT=ON"); 76 77 doCheck = true; 78 checkPhase = '' 79 runHook preCheck 80 81 export LC_ALL="en_US.UTF-8" 82 export QT_QPA_PLATFORM=offscreen 83 export QT_PLUGIN_PATH="${qtbase.bin}/${qtbase.qtPluginPrefix}" 84 # testcli, testgui and testkdbx4 are flaky - skip them all 85 # testautotype on darwin throws "QWidget: Cannot create a QWidget without QApplication" 86 make test ARGS+="-E 'testcli|testgui${lib.optionalString stdenv.isDarwin "|testautotype|testkdbx4"}' --output-on-failure" 87 88 runHook postCheck 89 ''; 90 91 nativeBuildInputs = [ asciidoctor cmake wrapGAppsHook wrapQtAppsHook qttools pkg-config ]; 92 93 dontWrapGApps = true; 94 preFixup = '' 95 qtWrapperArgs+=("''${gappsWrapperArgs[@]}") 96 '' + lib.optionalString stdenv.isDarwin '' 97 wrapQtApp "$out/Applications/KeePassXC.app/Contents/MacOS/KeePassXC" 98 ''; 99 100 buildInputs = [ 101 curl 102 botan2 103 libXi 104 libXtst 105 libargon2 106 minizip 107 pcsclite 108 qrencode 109 qtbase 110 qtsvg 111 readline 112 zlib 113 ] 114 ++ lib.optional (stdenv.isDarwin && withKeePassTouchID) LocalAuthentication 115 ++ lib.optional stdenv.isDarwin qtmacextras 116 ++ lib.optional stdenv.isLinux libusb1 117 ++ lib.optional withKeePassX11 qtx11extras; 118 119 passthru.tests = nixosTests.keepassxc; 120 121 meta = with lib; { 122 description = "Offline password manager with many features."; 123 longDescription = '' 124 A community fork of KeePassX, which is itself a port of KeePass Password Safe. 125 The goal is to extend and improve KeePassX with new features and bugfixes, 126 to provide a feature-rich, fully cross-platform and modern open-source password manager. 127 Accessible via native cross-platform GUI, CLI, has browser integration 128 using the KeePassXC Browser Extension (https://github.com/keepassxreboot/keepassxc-browser) 129 ''; 130 homepage = "https://keepassxc.org/"; 131 license = licenses.gpl2Plus; 132 maintainers = with maintainers; [ jonafato turion srapenne ]; 133 platforms = platforms.linux ++ platforms.darwin; 134 }; 135}