flameshot build form src

This commit is contained in:
2025-03-24 19:48:25 +08:00
parent 3a226ed5bb
commit 3c9f1d71cb
3 changed files with 51 additions and 9 deletions

View File

@@ -4,12 +4,51 @@ source "$( dirname $(readlink -e -- "${BASH_SOURCE}"))/../helpers.sh" || exit 25
title
sudo apt install -y --autoremove flameshot && \
sudo systemctl restart flameshot
# https://github.com/flameshot-org/flameshot?tab=readme-ov-file#compilation
# sudo apt install -y --autoremove flameshot && \
# sudo systemctl restart flameshot
dir="$HOME/install"
clone_dir="$dir/flameshot"
mkdir -p "$dir"
sudo apt install -y \
g++ \
cmake \
build-essential \
qtbase5-dev \
qttools5-dev-tools \
libqt5svg5-dev \
qttools5-dev \
libqt5dbus5 \
libqt5network5 \
libqt5core5a \
libqt5widgets5 \
libqt5gui5 \
libqt5svg5
if [ ! -d "$clone_dir" ]; then
git clone --depth=1 --single-branch https://github.com/flameshot-org/flameshot.git "$clone_dir"
fi
# Directory where build files will be placed, may be relative
export BUILD_DIR=build
# Directory prefix where flameshot will be installed. If you are just building and don't want to
# install, comment this environment variable.
# This excludes the bin/flameshot part of the install,
# e.g. in /opt/flameshot/bin/flameshot, the CMAKE_INSTALL_PREFIX is /opt/flameshot
# This must be an absolute path. Requires CMAKE 3.29.
export CMAKE_INSTALL_PREFIX=/opt/flameshot
cd "$clone_dir" && \
git pull && \
cmake -S . -B "$BUILD_DIR" && \
cmake --build "$BUILD_DIR"
[ $? = 0 ] && {
echo
success "flameshot installed!"
flameshot -v
# /opt/flameshot/flameshot -v
echo
}