#! /bin/bash # ccache # Source: https://github.com/ccache/ccache/releases/download/v4.1/ccache-4.1.tar.xz # # $BUILD = Directory to temporarily install # $PKGS = Directory to store built packages # # DEPS # Required: NONE # Recommended: NONE # Optional: NONE mkdir BUILD && cd BUILD && cmake -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release .. read -p "Compile?" && make -j2 && sudo -S make DESTDIR=$BUILD install && cd $BUILD && sudo -S mkdir -v ${BUILD}/install && cat > /tmp/slack-desc << "EOF" # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':' except on otherwise blank lines. |-----handy-ruler------------------------------------------------------| ccache: ccache (a fast compiler cache) ccache: ccache: ccache is a compiler cache. It speeds up re-compilation of C/C++ code ccache: by caching previous compiles and detecting when the same compile is ccache: being done again. ccache: ccache: ccache was written by Andrew Tridgell. ccache: ccache: ccache: ccache: EOF sudo -S mv -v /tmp/slack-desc install/ && sudo mkdir -pv usr/lib/ccache/bin && for f in clang clang++ do sudo ln -sfr usr/bin/ccache usr/lib/ccache/bin/${f} done && for f in gcc cc c++ g++ do sudo ln -sfr usr/bin/ccache usr/lib/ccache/bin/${f} done && sudo -S makepkg -l y -c n $PKGS/ccache-4.1-$(uname -m)-mlfs.txz && sudo -S rm -rf ${BUILD}/*