#! /bin/bash # Git # Source: https://www.kernel.org/pub/software/scm/git/git-2.50.1.tar.xz # # $BUILD = Directory to temporarily install # $PKGS = Directory to store built packages # # DEPS # Required: NONE # Recommended: curl # Optional: pcre2 or pcre, subversion, tk, valgrind # If optimizing, use these flags with GCC export CFLAGS="-march=native -pipe " export CFLAGS+="-O3 -Ofast -falign-functions=32 -ffat-lto-objects -flto=auto " export CFLAGS+="-fno-semantic-interposition -mprefer-vector-width=256 " export LDFLAGS="-flto=auto -Wl,-O2 -Wl,--as-needed " # NOTE: Git CAN compile against libreSSL export PVER="2.50.1" # Ascertain installed perl version export PV=$(perl --version | grep version | cut -d 'v' -f 4 | cut -c 1-4) ./configure --prefix=/usr \ --with-gitconfig=/etc/gitconfig \ --with-libpcre2 \ --with-python=python3 read -p "Compile? " && make -j2 && read -p "Press Enter to install" && sudo -S make DESTDIR=$BUILD perllibdir=/usr/lib/perl5/$PV/site_perl install && unset PV cd $BUILD && sudo mkdir -v 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 ':'. |-----handy-ruler------------------------------------------------------| git: git (the stupid content tracker) git: git: Git is a fast, scalable, distributed revision control system with an git: unusually rich command set that provides both high-level operations git: and full access to internals. git: git: "git" can mean anything, depending on your mood. git: git: Git was originally written by Linus Torvalds and is currently git: maintained by Junio C. Hamano. git: EOF sudo mv /tmp/slack-desc install/ && sudo makepkg -l y -c n $PKGS/git-$PVER-$PSUFFIX && sudo rm -rf $BUILD/*