Skip to content

Instantly share code, notes, and snippets.

@tomac4t
Last active July 9, 2020 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomac4t/1dce9c5d9cde8ffda11ea534ca78190d to your computer and use it in GitHub Desktop.
Save tomac4t/1dce9c5d9cde8ffda11ea534ca78190d to your computer and use it in GitHub Desktop.
Building KeePassXC
#!/bin/sh
set -ex
# Get the new version
Version=`curl -sf 'https://api.github.com/repos/keepassxreboot/keepassxc/releases/latest' | python -c "import sys, json; print json.load(sys.stdin)['tag_name']"`;
curl -Lf --proxy socks5://127.0.0.1:1080 "https://github.com/keepassxreboot/keepassxc/releases/download/"$Version"/keepassxc-"$Version"-src.tar.xz" | tar -Jxv;
cd keepassxc-$Version;
unset Version;
if [ -d "build" ]; then
rm -rf build;
fi
mkdir build;
cd build;
# Install the dependencies is need:
# https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux#install-the-required-dependencies
cmake \
-DWITH_XC_AUTOTYPE=ON \
-DWITH_XC_YUBIKEY=ON \
-DWITH_XC_BROWSER=ON \
-DWITH_XC_NETWORKING=OFF \
-DWITH_XC_SSHAGENT=ON \
-DWITH_XC_TOUCHID=OFF \
-DWITH_XC_FDOSECRETS=ON \
-DWITH_XC_KEESHARE=ON \
-DWITH_XC_KEESHARE_SECURE=ON \
-DWITH_XC_UPDATECHECK=OFF \
-DWITH_TESTS=OFF \
-DWITH_GUI_TESTS=OFF \
-DWITH_ASAN=OFF \
-DWITH_COVERAGE=OFF \
-DWITH_APP_BUNDLE=OFF \
-DKEEPASSXC_BUILD_TYPE=Release \
-DKEEPASSXC_DIST_TYPE=Other \
-DCMAKE_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/keepassxc/ \
..;
make;
strip ./src/keepassxc;
strip ./src/cli/keepassxc-cli;
strip ./src/proxy/keepassxc-proxy;
strip ./src/autotype/xcb/libkeepassx-autotype-xcb.so;
# Clean install or upgrade?
if [ ! -f "/usr/bin/keepassxc" ]; then
sudo make install;
else
# Need to kill the keepassxc process.
sudo cp -pf ./src/keepassxc /usr/bin/keepassxc;
if [ -f "/usr/bin/keepassxc-cli" ]; then
sudo cp -pf ./src/cli/keepassxc-cli /usr/bin/keepassxc-cli;
fi
if [ -f "/usr/bin/keepassxc-proxy" ]; then
sudo cp -pf ./src/proxy/keepassxc-proxy /usr/bin/keepassxc-proxy;
fi
if [ -f "/usr/lib/x86_64-linux-gnu/keepassxc/libkeepassx-autotype-xcb.so" ]; then
sudo cp -pf ./src/autotype/xcb/libkeepassx-autotype-xcb.so /usr/lib/x86_64-linux-gnu/keepassxc/libkeepassx-autotype-xcb.so;
fi
fi
-- Enabled features:
 * Auto-Type, Automatic password typing
 * KeePassXC-Browser, Browser integration with KeePassXC-Browser
 * SSHAgent, SSH agent integration compatible with KeeAgent
 * KeeShare, Sharing integration with KeeShare (requires quazip5 for secure containers)
 * YubiKey, YubiKey HMAC-SHA1 challenge-response
 * FdoSecrets, Implement freedesktop.org Secret Storage Spec server side API.

-- Disabled features:
 * Networking, Compile KeePassXC with network access code (e.g. for downloading website icons)
 * UpdateCheck, Automatic update checking

https://github.com/keepassxreboot/keepassxc/blob/develop/INSTALL.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment