Skip to content

Instantly share code, notes, and snippets.

@maelvls
Last active April 16, 2023 12: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 maelvls/406f77aca0bef17a0697d3dd8b9d3c6a to your computer and use it in GitHub Desktop.
Save maelvls/406f77aca0bef17a0697d3dd8b9d3c6a to your computer and use it in GitHub Desktop.
Building ksnip

Building ksnip to work around images growing on each save

The issue in question is kImageAnnotator#257.

Updated on 16 April 2023 with ksnip 1.10.1.

git clone https://github.com/ksnip/kColorPicker
git clone https://github.com/ksnip/kImageAnnotator
git -C kImageAnnotator remote add maelvls https://github.com/maelvls/kImageAnnotator
git -C kImageAnnotator fetch maelvls fix-images-growing-in-size
git -C kImageAnnotator checkout fix-images-growing-in-size
git clone https://github.com/ksnip/ksnip

rm -rf kColorPicker/build kImageAnnotator/build ksnip/build
mkdir kColorPicker/build kImageAnnotator/build ksnip/build

cd kColorPicker/build
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD
make -j$(nproc) all install
cd ../..

cd kImageAnnotator/build
kColorPicker_DIR=../../kColorPicker/build/cmake cmake .. -DCMAKE_INSTALL_PREFIX=$PWD
make -j$(nproc) all install
cd ../..

# Will install to /usr/local/bin!
cd ksnip/build
kImageAnnotator_DIR=../../kImageAnnotator/build/cmake kColorPicker_DIR=../../kColorPicker/build/cmake cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
make -j$(nproc) all
sudo make install

Uninstall those three if you forgot to set CMAKE_INSTALL_PREFIX, and that it is now littering your system:

rm -rf kColorPicker/build kImageAnnotator/build ksnip/build
mkdir kColorPicker/build kImageAnnotator/build ksnip/build

cd kColorPicker/build
cmake ..
make -j$(nproc) all
sudo cmake -P cmake_install.cmake
cd ../..

cd kImageAnnotator/build
cmake ..
make -j$(nproc) all
sudo cmake -P cmake_install.cmake
cd ../..

cd ksnip/build
cmake ..
make -j$(nproc) all
sudo cmake -P cmake_install.cmake
cd ../..

cd kColorPicker/build
sudo cmake -P cmake_uninstall.cmake
cd ../..

cd kImageAnnotator/build
sudo cmake -P cmake_uninstall.cmake
cd ../..

cd ksnip/build
# sudo cmake -P cmake_uninstall.cmake
sudo cmake -P cmake_install.cmake | cut -d: -f2 | xargs sudo rm -rf
cd ../..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment