libk  Check-in [12a51d9c50]

Overview
Comment:Merge install script branch. Seems to be Good Enough for now, and shouldn't break anything at all to merge this.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 12a51d9c5092369194f3c2ff2567309649f350479bda5f4d57f2bfccd99d3d7c
User & Date: glowpelt on 2020-01-31 06:05:43
Other Links: manifest | tags
Context
2020-01-31
20:04
Greatly clean up Nix build. check-in: 49da7c1eeb user: glowpelt tags: trunk
06:05
Merge install script branch. Seems to be Good Enough for now, and shouldn't break anything at all to merge this. check-in: 12a51d9c50 user: glowpelt tags: trunk
05:58
Add a final terminating null to first message in kcli_usage. This was causing the shared library build to segfault. Not perfect, as if there are no options, there will be two nulls, but two is better than none. check-in: 6aeac330ce user: glowpelt tags: trunk
2020-01-24
21:18
Remove the $to check entirely and have more output in install.sh Sourcing a file doesn't need it to be executable, so global/common.sh can have it's executable bit removed and the $to check in it entirely removed. Adds some `say`s to install.sh to let you know it did something and help in case of error. Closed-Leaf check-in: 50b709b0d3 user: glowpelt tags: install
Changes

Modified global/common.sh from [582c735deb] to [d610091946].

     4      4   check() {
     5      5   	var=$1
     6      6   	test "${!var}" == "" || return 0
     7      7   	say "we were not able to detect a default value for the configuration variable \$$var. please set this variable to $2 and try again."
     8      8   	exit 1
     9      9   }
    10     10   
    11         -test "$to" = "" && {
    12         -	say "\$to environment variable must be set to your build directory - are you running this script by hand? run ./build.sh in the root directory instead!"
    13         -	exit 2
    14         -}
    15         -
    16     11   reqpack() {
    17     12   	if ! has "$1"; then
    18     13   		say "to $2 for libk, install the $1 package and try again"
    19     14   		exit 3
    20     15   	fi
    21     16   }
    22     17   

Modified install.sh from [b7dc8d033f] to [df12302eb0].

     1      1   #!/usr/bin/env bash
     2      2   source global/common.sh
     3      3   
     4         -say "this component of the build system does not yet exist"
            4  +check "prefix" "a directory to install to"
            5  +build="${build:-out}"
            6  +
            7  +bindir="$prefix/bin"
            8  +libdir="$prefix/lib"
            9  +
           10  +if [ "$prefix" = "/" ]; then
           11  +	say "installing docs and headers into usr instad of /"
           12  +	sharedir="$prefix/usr/share"
           13  +	incdir="$prefix/usr/include"
           14  +else
           15  +	incdir="$prefix/include"
           16  +	sharedir="$prefix/share"
           17  +fi
           18  +
           19  +say "Starting install."
           20  +
           21  +# Libraries
           22  +# These may or may not exist, depending on what library build is done, so check
           23  +say "Installing libraries..."
           24  +[ -e "$build/libk.a" ] && install -Dm644 -t "$libdir" "$build/libk.a"
           25  +[ -e "$build/libk.so" ] && install -Dm644 -t "$libdir" "$build/libk.so"
           26  +[ -e "$build/boot.o" ] && install -Dm644 -t "$libdir/libk" "$build/boot.o"
           27  +
           28  +# Binaries
           29  +say "Installing binaries..."
           30  +install -Dm755 -t "$bindir" "$build/kcore.testbin"
           31  +install -Dm755 -t "$bindir" "$build/kcli.testbin"
           32  +install -Dm755 -t "$bindir" "$build/kgraft.attach"
           33  +
           34  +# Includes
           35  +say "Installing includes..."
           36  +for inc in "$build"/k/*; do
           37  +	install -Dm644 -t "$incdir/k" "$inc"
           38  +done
           39  +
           40  +# Documentation
           41  +say "Installing documentation..."
           42  +for man in "$build"/doc/man/*; do
           43  +	install -Dm644 -t "$sharedir/man" "$man"
           44  +done
           45  +for html in "$build"/doc/html/*; do
           46  +	install -Dm644 -t "$sharedir/doc/libk/html" "$html"
           47  +done
           48  +for pdf in "$build"/doc/pdf/*; do
           49  +	install -Dm644 -t "$sharedir/doc/libk/pdf" "$pdf"
           50  +done
           51  +say "Install done!"