dot

packages and services management
Log | Files | Refs | README

commit 3329896381d16e9fd25e7191421a26359721b4df
parent 5e416874b477b605dec233227646c7ec55311aa5
Author: josuah <mail@josuah.net>
Date:   Fri, 27 Jan 2017 17:53:58 +0100

Added build in-tree

Diffstat:
A.local/share/build/abduco | 3+++
A.local/share/build/build | 3+++
A.local/share/build/busybox | 12++++++++++++
A.local/share/build/byacc | 3+++
A.local/share/build/cmatrix | 3+++
A.local/share/build/ctags | 3+++
A.local/share/build/dash | 3+++
A.local/share/build/dmenu | 13+++++++++++++
A.local/share/build/dvtm | 11+++++++++++
A.local/share/build/dwm | 3+++
A.local/share/build/ex-vi | 8++++++++
A.local/share/build/git | 3+++
A.local/share/build/ii | 3+++
A.local/share/build/iode | 3+++
A.local/share/build/iomenu | 3+++
A.local/share/build/isync | 10++++++++++
A.local/share/build/less | 3+++
A.local/share/build/libbearssl | 3+++
A.local/share/build/libevent | 2++
A.local/share/build/libncurses | 3+++
A.local/share/build/libtermkey | 10++++++++++
A.local/share/build/libtool | 3+++
A.local/share/build/libunibilium | 3+++
A.local/share/build/libutf | 3+++
A.local/share/build/lpeg | 8++++++++
A.local/share/build/lua | 9+++++++++
A.local/share/build/m4 | 3+++
A.local/share/build/mandoc | 20++++++++++++++++++++
A.local/share/build/mblaze | 3+++
A.local/share/build/mksh | 10++++++++++
A.local/share/build/mmh | 4++++
A.local/share/build/msmtp | 4++++
A.local/share/build/mujs | 3+++
A.local/share/build/nafe | 8++++++++
A.local/share/build/nq | 3+++
A.local/share/build/pcre | 3+++
A.local/share/build/pkg-config | 3+++
A.local/share/build/reflex | 11+++++++++++
A.local/share/build/retawq | 10++++++++++
A.local/share/build/ssmtp | 3+++
A.local/share/build/st | 3+++
A.local/share/build/tmux | 3+++
A.local/share/build/valgrind | 3+++
A.local/share/build/vim | 16++++++++++++++++
A.local/share/build/vis | 10++++++++++
A.local/share/build/yasm | 3+++
Abin/build | 183+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
47 files changed, 443 insertions(+), 0 deletions(-)

diff --git a/.local/share/build/abduco b/.local/share/build/abduco @@ -0,0 +1,3 @@ +# Dynamic virtual terminal manager + +tar=http://www.brain-dump.org/projects/abduco/abduco-0.6.tar.gz diff --git a/.local/share/build/build b/.local/share/build/build @@ -0,0 +1,3 @@ +# download, compile, install programs sources + +tar=http://github.com/josuah/build/archive/master.tar.gz diff --git a/.local/share/build/busybox b/.local/share/build/busybox @@ -0,0 +1,12 @@ +# Multitool for the shell + +tar=https://busybox.net/downloads/busybox-1.25.1.tar.bz2 + +build() +{ + make defconfig + make CONFIG_PREFIX="$PREFIX" + + ./busybox --install "$LOCAL/bin" + ln -sf ./busybox "$LOCAL/bin/busybox" +} diff --git a/.local/share/build/byacc b/.local/share/build/byacc @@ -0,0 +1,3 @@ +# Rewrite of YACC: Yet Another Compiler Compiler + +tar=http://invisible-island.net/datafiles/release/byacc.tar.gz diff --git a/.local/share/build/cmatrix b/.local/share/build/cmatrix @@ -0,0 +1,3 @@ +# Matrix ncurses animation + +tar=http://www.asty.org/cmatrix/dist/cmatrix-1.2a.tar.gz diff --git a/.local/share/build/ctags b/.local/share/build/ctags @@ -0,0 +1,3 @@ +# Exuberant Ctags + +tar=http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz diff --git a/.local/share/build/dash b/.local/share/build/dash @@ -0,0 +1,3 @@ +# debian almquist shell + +tar=http://gondor.apana.org.au/~herbert/dash/files/dash-0.5.9.tar.gz diff --git a/.local/share/build/dmenu b/.local/share/build/dmenu @@ -0,0 +1,13 @@ +# Dynamic menu + +tar=http://dl.suckless.org/tools/dmenu-4.6.tar.gz + +build() +{ + cc stest.c -o stest + cp stest "$PREFIX/bin/stest" + + sed -i '/^FREETYPEINC = \$/ s/^/#/' config.mk + + make PREFIX="$PREFIX" install clean +} diff --git a/.local/share/build/dvtm b/.local/share/build/dvtm @@ -0,0 +1,11 @@ +# Dynamic virtual terminal manager + +tar=http://github.com/martanne/dvtm/archive/master.tar.gz + +build() +{ + patch -Ni ~/.config/dvtm/dvtm-statusline.diff + cp ~/.config/dvtm/config.h config.h + cp ~/.config/dvtm/dvtm-status dvtm-status + make PREFIX="$PREFIX" install +} diff --git a/.local/share/build/dwm b/.local/share/build/dwm @@ -0,0 +1,3 @@ +# Dynamic window manager + +tar=http://dl.suckless.org/dwm/dwm-6.1.tar.gz diff --git a/.local/share/build/ex-vi b/.local/share/build/ex-vi @@ -0,0 +1,8 @@ +# The Traditional Vi - Source Code for Modern Unix Systems + +tar=http://prdownloads.sourceforge.net/ex-vi/ex-050325.tar.bz2 + +build() +{ + make INSTALL='install' PREFIX="$PREFIX" install +} diff --git a/.local/share/build/git b/.local/share/build/git @@ -0,0 +1,3 @@ +# The great git version control system + +tar=http://www.kernel.org/pub/software/scm/git/git-2.10.0.tar.gz diff --git a/.local/share/build/ii b/.local/share/build/ii @@ -0,0 +1,3 @@ +# IRC-it, a FIFO-based irc client + +tar=http://git.suckless.org/ii/snapshot/ii-714bd0cb6ae1eae57ca69b4dbe9fb5243c7a9456.tar.gz diff --git a/.local/share/build/iode b/.local/share/build/iode @@ -0,0 +1,3 @@ +# Draft for a simple editor + +tar=http://github.com/josuah/iode/archive/master.tar.gz diff --git a/.local/share/build/iomenu b/.local/share/build/iomenu @@ -0,0 +1,3 @@ +# Input/Output interactive menu and completion engine. + +tar=http://repo.or.cz/iomenu.git/snapshot/991ea73d728682256b15165743c216e4baac1255.tar.gz diff --git a/.local/share/build/isync b/.local/share/build/isync @@ -0,0 +1,10 @@ +# Sync IMAP to Maildir + +tar=http://downloads.sourceforge.net/project/isync/isync +tar=$tar/1.2.1/isync-1.2.1.tar.gz + +build() +{ + ./configure --prefix="$PREFIX" --with-ssl="/home/josuah/.local/lib/" + make PREFIX="$PREFIX" install clean +} diff --git a/.local/share/build/less b/.local/share/build/less @@ -0,0 +1,3 @@ +# Great pager + +tar=http://ftp.gnu.org/gnu/less/less-481.tar.gz diff --git a/.local/share/build/libbearssl b/.local/share/build/libbearssl @@ -0,0 +1,3 @@ +# a smaller SSL/TLS library + +tar=https://www.bearssl.org/bearssl-0.2.tar.gz diff --git a/.local/share/build/libevent b/.local/share/build/libevent @@ -0,0 +1,2 @@ +# Event-driven callback library used by tmux +tar=https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz diff --git a/.local/share/build/libncurses b/.local/share/build/libncurses @@ -0,0 +1,3 @@ +# The new curses library + +tar=http://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz diff --git a/.local/share/build/libtermkey b/.local/share/build/libtermkey @@ -0,0 +1,10 @@ +# Processing of keyboard entry from terminal-based programs + +tar=http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.18.tar.gz + +build() +{ + make PREFIX="$PREFIX" install + + ln -s "$LOCAL/lib/libtermkey.so.1.12.0" "$LOCAL/lib/libtermkey.so.1" +} diff --git a/.local/share/build/libtool b/.local/share/build/libtool @@ -0,0 +1,3 @@ +# The GNU Portable Library Tool + +tar=http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz diff --git a/.local/share/build/libunibilium b/.local/share/build/libunibilium @@ -0,0 +1,3 @@ +# a terminfo parsing library + +tar=http://github.com/mauke/unibilium/archive/master.tar.gz diff --git a/.local/share/build/libutf b/.local/share/build/libutf @@ -0,0 +1,3 @@ +# Plan 9 compatible C89 UTF-8 library + +tar=http://github.com/cls/libutf/archive/master.tar.gz diff --git a/.local/share/build/lpeg b/.local/share/build/lpeg @@ -0,0 +1,8 @@ +# Parsing Expression Grammars For Lua + +tar=http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.0.tar.gz + +build() +{ + make "$(uname -s | tr [[:upper:]] [[:lower:]])" +} diff --git a/.local/share/build/lua b/.local/share/build/lua @@ -0,0 +1,9 @@ +# Embeddable scripting language + +tar='http://www.lua.org/ftp/lua-5.3.2.tar.gz' + +build() +{ + make MYCFLAGS='-fPIC' INSTALL_TOP="$PREFIX" \ + "$(uname | tr [A-Z] [a-z])" install +} diff --git a/.local/share/build/m4 b/.local/share/build/m4 @@ -0,0 +1,3 @@ +# Macro language processor m4 + +tar=http://ftp.gnu.org/gnu/m4/m4-latest.tar.gz diff --git a/.local/share/build/mandoc b/.local/share/build/mandoc @@ -0,0 +1,20 @@ +# UNIX manpage compiler + +tar=http://mdocml.bsd.lv/snapshots/mdocml.tar.gz + +build() +{ + tee configure.local << EOF +PREFIX="$PREFIX" +BINDIR="$PREFIX/bin" +SBINDIR="$PREFIX/bin" +INCLUDEDIR="$PREFIX/include/mandoc" +LIBDIR="$PREFIX/lib/mandoc" +MANDIR="$PREFIX/man" +BUILD_DB=1 +EOF + + ./configure + + make install +} diff --git a/.local/share/build/mblaze b/.local/share/build/mblaze @@ -0,0 +1,3 @@ +# NMH-like mail client for maildir + +tar=https://github.com/chneukirchen/mblaze/archive/master.tar.gz diff --git a/.local/share/build/mksh b/.local/share/build/mksh @@ -0,0 +1,10 @@ +# MirBSD version of the Korn shell (ksh) + +tar=http://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R54.tgz + +build() +{ + sh ./Build.sh + + cp mksh "$PREFIX/bin/mksh" +} diff --git a/.local/share/build/mmh b/.local/share/build/mmh @@ -0,0 +1,4 @@ +# Meillo's Mail Handler, a modern nmh implementation + +tar=http://marmaro.de/prog/mmh/files/mmh-0.2.tar.gz + diff --git a/.local/share/build/msmtp b/.local/share/build/msmtp @@ -0,0 +1,3 @@ +# Relatively small MTA + +tar=http://downloads.sourceforge.net/project/msmtp/msmtp/1.6.5/msmtp-1.6.5.tar.xz+ \ No newline at end of file diff --git a/.local/share/build/mujs b/.local/share/build/mujs @@ -0,0 +1,3 @@ +# Small, JavaScript interpreter + +tar=https://github.com/ccxvii/mujs/archive/master.tar.gz diff --git a/.local/share/build/nafe b/.local/share/build/nafe @@ -0,0 +1,8 @@ +# Not A Font Editor - convert psf font to a text form and back on + +tar=http://sourceforge.net/projects/nafe/files/nafe/nafe-0.1/nafe-0.1.tar.gz + +build() +{ + make && cp psf2txt txt2psf "$PREFIX/bin/" +} diff --git a/.local/share/build/nq b/.local/share/build/nq @@ -0,0 +1,3 @@ +# Unix command line queue utility + +tar=https://github.com/chneukirchen/nq/archive/master.tar.gz diff --git a/.local/share/build/pcre b/.local/share/build/pcre @@ -0,0 +1,3 @@ +# Perl-Compatible Regular Expressions + +tar=http://downloads.sourceforge.net/project/pcre/pcre/8.39/pcre-8.39.tar.gz diff --git a/.local/share/build/pkg-config b/.local/share/build/pkg-config @@ -0,0 +1,3 @@ +# Find correct flags and libraries + +tar=http://pkg-config.freedesktop.org/releases/pkg-config-0.29.1.tar.gz diff --git a/.local/share/build/reflex b/.local/share/build/reflex @@ -0,0 +1,11 @@ +# Re-Localized FLex: Fast Lexical scanner. + +tar=http://invisible-island.net/datafiles/release/reflex.tar.gz + +build() +{ + ./configure --prefix="$PREFIX" + make install + + ln -s "$PREFIX/bin/reflex" "$PREFIX/bin/flex" +} diff --git a/.local/share/build/retawq b/.local/share/build/retawq @@ -0,0 +1,10 @@ +# Small text-based web browser + +tar=http://prdownloads.sourceforge.net/retawq/retawq-0.2.6c.tar.gz + +build() +{ + ./configure + make + cp retawq "$PREFIX/bin/" +} diff --git a/.local/share/build/ssmtp b/.local/share/build/ssmtp @@ -0,0 +1,3 @@ +# simple SMTP client, MTA for sending mail + +tar=http://http.debian.net/debian/pool/main/s/ssmtp/ssmtp_2.64.orig.tar.bz2 diff --git a/.local/share/build/st b/.local/share/build/st @@ -0,0 +1,3 @@ +# Simple terminal + +tar=http://dl.suckless.org/st/st-0.6.tar.gz diff --git a/.local/share/build/tmux b/.local/share/build/tmux @@ -0,0 +1,3 @@ +# Terminal multiplexer that rocks + +tar=http://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz diff --git a/.local/share/build/valgrind b/.local/share/build/valgrind @@ -0,0 +1,3 @@ +# Dynamic analysis tools for programs + +tar=http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2 diff --git a/.local/share/build/vim b/.local/share/build/vim @@ -0,0 +1,16 @@ +# The vim. + +tar=https://github.com/vim/vim/archive/master.tar.gz + +build() +{ + ./configure \ + --prefix="$PREFIX" \ + --with-features=tiny \ + --enable-multibyte \ + --disable-gui \ + --without-x \ + --without-gnome + + make install +} diff --git a/.local/share/build/vis b/.local/share/build/vis @@ -0,0 +1,10 @@ +# a highly efficient vim like text editor + +tar=http://github.com/martanne/vis/archive/master.tar.gz + +build() +{ + ./configure --disable-lua --disable-lpeg + + make PREFIX="$PREFIX" install +} diff --git a/.local/share/build/yasm b/.local/share/build/yasm @@ -0,0 +1,3 @@ +# Modular Assembler Project + +tar=http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz diff --git a/bin/build b/bin/build @@ -0,0 +1,183 @@ +# Install sources from build receipes + + +export LOCAL="$HOME/.local" +export CONFIG="${XDG_CONFIG_HOME:-HOME/.config}" +export PROGRAMS="$HOME/programs" +export PATH="$LOCAL/bin:$PATH" +export CPATH="$LOCAL/include:$CPATH" +export MANPATH="$LOCAL/share/man:$LOCAL/man:$MANPATH" +export LIBPATH="$LOCAL/lib:$LIBPATH" +export LD_RUN_PATH="$LOCAL/lib:$LD_RUN_PATH" +export LD_LIBRARY_PATH="$LOCAL/lib:$LD_LIBRARY_PATH" + + +[ "${0##*/}" = build ] && { + + +usage() +{ + printf %s "\ +${0##*/} d[ownload] PKG Download PKG's sources +${0##*/} i[nstall] PKG Download then install PKG +${0##*/} r[emove] PKG Remove build PKG and its sources +${0##*/} u[pdate] PKG Delete, then download and install PKG again +${0##*/} l[inks] Update links from ~${PROGRAMS#$HOME} to ~${LOCAL#$HOME} +${0##*/} v[iew] View the list of available packages +" + exit 0 +} + + +view() +{ + find -L "$LOCAL/share/build" -type f | while IFS='' read -r f + do + read -r comment description < "$f" + printf ' %-12s %s\n' "${f#$LOCAL/share/build/}" "$description" + done | sort | more + exit 0 +} + + +error() +{ + printf '\033[31m%-12s \033[1m%s\033[m\n' "$1" "$2" 1>&2; exit 1 +} + + +info() +{ + printf '\033[36m%-12s \033[1m%s\033[m\n' "$1" "$2" 1>&2 +} + + +# +# Default build function, to be overriden in the build recipes scripts +# +build() +{ + find "$CONFIG/$1" -name '*.diff' -exec patch -N -p 1 -i {} \; + + for file in "$CONFIG/$1/config.mk" "$CONFIG/$1/config.h" + do + [ -h "$file" ] || [ -f "$file" ] && cp -f "$file" . + done + + [ -f ./autogen.sh ] && ./autogen.sh + [ -f ./configure ] && ./configure --prefix="$PREFIX" + + make && make PREFIX="$PREFIX" install clean +} + + +compile() +{ + name="$1" + PREFIX="$PROGRAMS/$name" script="$LOCAL/share/build/$name" + + export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 + export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 + export CFLAGS="-I $LOCAL/include -L$LOCAL/lib" + + [ -f "$script" ] || [ -h "$script" ] || error "$name" "no build script" + . "$script" + + info "$name" "installing" + + cd "$PREFIX" && mkdir -p bin doc etc include lib libexec share man + cd src && build "$name" + cd "$PREFIX" && rmdir -p ./* 2> /dev/null +} + + +download() +{ + name="$1" tar="$2" script="$LOCAL/share/build/$name" + + [ -d "$PROGRAMS/$name/src" ] && error "$name" "already in $PROGRAMS" + [ -f "$script" ] || [ -h "$script" ] || error "$name" "no build script" + . "$script" + + info "$name" "downloading" + + case "$tar" in + *.tar ) opt='' ;; + *.tbz2 | *.tar.bz2 ) opt='j' ;; + *.tgz | *.tar.gz ) opt='z' ;; + *.txz | *.tar.xz ) opt='J' ;; + * ) error "$name" 'not a known tar extension' ;; + esac + + mkdir -p "$PROGRAMS/$name" + wget -O - "$tar" | tar -xv"$opt" -f - -C "$PROGRAMS/$name" 1> /dev/null + + mv "$PROGRAMS/$name/"* "$PROGRAMS/$name/src" +} + + +remove() +{ + info "$1" "removing" + rm -rf "${PROGRAMS:?}/$1" + + info '' "removing broken links from ~${LOCAL#$HOME}" + find -L "$LOCAL" -type l -exec rm {} \; +} + + +# 1: name of the program in "$PROGRAMS" to index in "$LOCAL" + +index() +{ + info "$1" "updating index in ~${LOCAL#$HOME}" + cd "$PROGRAMS/$1" || exit 1 + find . -type d ! -path '*/src/*' -exec mkdir -p "$LOCAL/{}" \; + find . ! -type d ! -path '*/src/*' -exec ln -sf "$PWD/{}" "$LOCAL/{}" \; +} + + +main() +{ + mkdir -p "$PROGRAMS" + + case "$1" in + d | download ) + download "$2" "$tar" + index "$2" + ;; + i | install ) + [ ! -d "$PROGRAMS/$2/src" ] && download "$2" "$tar" + compile "$2" + index "$2" + ;; + r | remove ) + remove "$2" + ;; + u | update ) + remove "$2" + download "$2" "$tar" + compile "$2" + index "$2" + ;; + l | link ) + find "$PROGRAMS" -maxdepth 1 -mindepth 1 | + while IFS='' read -r name + do + index "${name#$PROGRAMS/}" + done + ;; + v | view ) + view + ;; + * | '' ) + usage + ;; + esac +} + + +main "$@" + + +}