# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup legacysupport 1.1 # Enable use of 'macports-libcxx' for macOS 10.11 and earlier, as port uses # libcxx features normally only available on 10.12 and later. # See: https://trac.macports.org/ticket/64055 legacysupport.newest_darwin_requires_legacy 15 legacysupport.use_mp_libcxx yes PortGroup qt5 1.0 PortGroup github 1.0 PortGroup cmake 1.1 PortGroup compiler_blacklist_versions 1.0 PortGroup gpg_verify 1.0 name KeePassXC subport KeePassXC-devel {} categories security aqua maintainers nomaintainer description KeePassXC is a cross-platform community-driven port \ of the Windows application “Keepass Password Safe”. long_description KeePassXC is a community fork of KeePassX with the \ goal to extend and improve it with new features and \ bugfixes to provide a feature-rich, fully \ cross-platform and modern open-source password manager. platforms darwin license GPL-2+ license_noconflict openssl openssl10 openssl11 openssl3 if {${subport} eq ${name}} { # stable github.setup keepassxreboot keepassxc 2.7.6 revision 1 github.tarball_from releases distname keepassxc-${version}-src use_xz yes distfiles-append ${distname}${extract.suffix}.sig worksrcdir keepassxc-${version} conflicts KeePassXC-devel # See keepassxc-${version}-src.tar.xz.DIGEST on upstream GitHub releases page for SHA256 sums checksums ${distname}${extract.suffix} \ rmd160 a939976cff7273f9243f9c3aae39269e11047e6d \ sha256 a58074509fa8e90f152c6247f73e75e126303081f55eedb4ea0cbb6fa980d670 \ size 8474624 \ ${distname}${extract.suffix}.sig \ rmd160 693cbc4a5648735cd4a53afdb9617bca9702bf45 \ sha256 af439d1954101c1b140f759cf0f42efdfe19d066f90412e325b806f8d3774eb4 \ size 488 gpg_verify.use_gpg_verification \ yes } else { # devel subport github.setup keepassxreboot keepassxc 37dabd2561c33d7c0e66bba6ab0883bb55e90cf1 set githash [string range ${github.version} 0 6] version 20230514.git${githash} revision 1 conflicts KeePassXC checksums rmd160 16d79aa775a0dc6d8cf32015a3dc7131a2e13163 \ sha256 05fb0c84e426f33bacd41f6809d52c5bc758dace52b41c58001385a26bed89c3 \ size 10967053 gpg_verify.use_gpg_verification \ no } if {[option gpg_verify.use_gpg_verification]} { post-checksum { # The public key is downloaded from [1], and the key ID is listed on [2]. # [1] https://keepassxc.org/keepassxc_master_signing_key.asc # [2] https://keepassxc.org/verifying-signatures/ set gpg_keyid CFB4C2166397D0D2 gpg_verify.verify_gpg_signature \ ${filespath}/keyid-${gpg_keyid}.txt \ ${distpath}/[lindex ${distfiles} 0].sig \ ${distpath}/[lindex ${distfiles} 0] } } qt5.min_version 5.5.0 qt5.depends_component qtmacextras qtsvg qt5.depends_build_component \ qttools depends_lib-append port:argon2 \ port:botan \ port:libgcrypt \ port:libsodium \ port:minizip \ port:readline \ port:qrencode \ port:ykpers \ port:zlib patchfiles-append patch-no-deployqt.diff \ patch-no-findpackage-path.diff \ add_support_for_old_macos.diff \ add_support_for_old_macos-2.diff # KeePassXC uses -fstack-protector-strong on Clang [1]. That flag is not # available until clang 602 [2] or upstream clang 3.5 [3] # [1] https://github.com/keepassxreboot/keepassxc/blob/develop/CMakeLists.txt # [2] https://opensource.apple.com/source/clang/clang-600.0.57/src/tools/clang/lib/CodeGen/CodeGenModule.cpp.auto.html # https://opensource.apple.com/source/clang/clang-602.0.53/src/tools/clang/lib/CodeGen/CodeGenModule.cpp.auto.html # [3] https://github.com/llvm-project/clang/blob/release_34/lib/CodeGen/CodeGenModule.cpp # https://github.com/llvm-project/clang/blob/release_35/lib/CodeGen/CodeGenModule.cpp compiler.blacklist-append {clang < 602} compiler.cxx_standard 2017 configure.pre_args-append \ -DCMAKE_INSTALL_PREFIX=${applications_dir} \ -DCMAKE_INSTALL_MANDIR=${prefix}/share/man \ -DCMAKE_PREFIX_PATH=${qt_cmake_module_dir} \ -DKEEPASSXC_BUILD_TYPE=Release \ -DWITH_XC_BROWSER=ON \ -DWITH_XC_KEESHARE=ON \ -DWITH_XC_NETWORKING=ON \ -DWITH_XC_SSHAGENT=ON \ -DWITH_XC_YUBIKEY=ON \ -DWITH_XC_UPDATECHECK=OFF \ -DWITH_XC_DOCS=OFF # QTest::addRow was introduced in Qt 5.9 # Don't build tests in that case if {[vercmp ${qt5.version} 5.9] < 0} { configure.pre_args-append -DWITH_TESTS=OFF } post-destroot { set kp_doc_path ${destroot}${prefix}/share/doc/${name} xinstall -d ${kp_doc_path} xinstall -W ${worksrcpath} COPYING LICENSE.BSD LICENSE.CC0 \ LICENSE.GPL-2 LICENSE.GPL-3 LICENSE.LGPL-2.1 LICENSE.LGPL-3 \ LICENSE.MIT LICENSE.NOKIA-LGPL-EXCEPTION LICENSE.OFL \ ${kp_doc_path} set kp_app_path ${applications_dir}/KeePassXC.app/Contents/MacOS set kp_bin_path ${destroot}${prefix}/bin ln -s ${kp_app_path}/keepassxc-cli \ ${kp_bin_path}/keepassxc-cli ln -s ${kp_app_path}/keepassxc-proxy \ ${kp_bin_path}/keepassxc-proxy } test.run yes test.target test ARGS="-V -E testautotype" test.env TMPDIR=/tmp # Ignore betas, RCs, etc. - See: https://trac.macports.org/ticket/64956 github.livecheck.regex {([0-9.]+)}