From cd4b35e85ce46ec5cf243ac7db024f967d03818b Mon Sep 17 00:00:00 2001 From: mid-kid Date: Tue, 27 Dec 2016 18:24:45 +0100 Subject: [PATCH] Astronaut with new features Removed dir_sysroot, changed all dirs to fall directly below dir_prefix (thus removing the need for dir_sysroot, which is only needed in some exotic circumstances anyway), added the ability to build multiple satellites with one command and restructured the way the wrappers work, added configuration file handling in astronautpkg. Updated all satellites accordingly. --- astronaut/astronaut | 129 ++++++++++++---------- astronaut/astronautpkg | 82 +++++++++----- astronaut/pacman-astronaut | 35 ++++-- astronaut/xbps-astronaut | 27 +++-- satellites/compton-git.sat | 2 +- satellites/create_ap.sat | 2 +- satellites/ffmpeg.sat | 7 +- satellites/functions/compile/cmake.sh | 21 ++-- satellites/functions/compile/configure.sh | 9 +- satellites/i3status.sat | 4 +- satellites/lua.sat | 3 +- satellites/luajit.sat | 3 +- satellites/mpv.sat | 5 +- satellites/python3.sat | 8 +- satellites/qt5-base.sat | 8 +- satellites/qt5-tools.sat | 2 +- satellites/rt8192cu-git.sat | 6 +- satellites/waf.sat | 2 +- satellites/yajl.sat | 5 +- satellites/zim.sat | 4 +- todo.txt | 2 - 21 files changed, 219 insertions(+), 147 deletions(-) delete mode 100644 todo.txt diff --git a/astronaut/astronaut b/astronaut/astronaut index 1147f60..d138e25 100755 --- a/astronaut/astronaut +++ b/astronaut/astronaut @@ -12,27 +12,22 @@ dir_install='/tmp/astronaut/install' # Directory where the package will be inst # which is the filename of the satellite, without the .sat suffix. # Runtime directories -dir_sysroot='' # The root directory of the system -dir_prefix='usr' # Prefix directory (for /bin, /lib, /include, /share and such) +dir_prefix='usr' # Prefix directory # Finer-grained control of runtime dirs # This can't be set from the command line, but might need to be adapted for your distro. -# Dirs always outside of $dir_prefix -dir_sysconfdir='etc' - -# Dirs outside and inside of $dir_prefix dir_bindir='bin' dir_sbindir='sbin' -dir_libdir='lib' - -# Dirs only inside of $dir_prefix dir_libexecdir='libexec' +dir_sysconfdir='etc' +dir_libdir='lib' +dir_includedir='include' dir_datadir='share' -dir_mandir='share/man' -dir_docdir='share/doc' dir_infodir='share/info' dir_localedir='share/locale' +dir_mandir='share/man' +dir_docdir='share/doc' # Default commands cmd_download='curl -# -L -o {dst} {src}' # Command to execute to download files @@ -61,34 +56,42 @@ package_options() { :; } # Per-package options function. # Options not in the configuration _download_only=false _vcs_only=false -vcs_compile=false +_nuke_dir_install=false unset _user_options # Options specified in the command line get the highest priority unset _sat_options # Options defined by the satellite -#_astronaut_nuke_dir_install (This can be set from wrappers) + +# Check if running from a wrapper +if [ "$(basename "$0")" != "astronaut" ]; then + type _astronaut_wrapper_pre > /dev/null || _astronaut_wrapper_pre() { :; } + type _astronaut_wrapper_post > /dev/null || _astronaut_wrapper_post() { :; } +else + _astronaut_wrapper_pre() { :; } + _astronaut_wrapper_post() { :; } +fi # Should be specified in the satellite unset name unset version unset update_url +vcs_compile=false # Some printing functions _show_help() { echo "This astronaut will help you build some satellites. Just describe what he's got to do in a satellite file. -Usage: $0 [-bsirp ] [-hIdv] [-o ] +Usage: $0 [-bsip ] [-hIdv] [-o ] ... -h/? Show this message -b Set build directory [WARNING: Will be deleted before build] -s Set source directory -i Set install directory --r Set root directory -p Set prefix directory -I Nuke install directory before build [WARNING: You will not be prompted] -d Only download package files -v Only build vcs package if any updates have been made to it -o Set package options (comma-separated) -Tips:$([ "$(basename "$0")" = "astronaut" ] && printf "\n- Use \`head -n 55 $0 > astronaut.conf.example\` to generate a default configuration file.") +Tips:$([ "$(basename "$0")" = "astronaut" ] && printf "\n- Use \`head -n 50 $0 > astronaut.conf.example\` to generate a default configuration file.") - Keep in mind that when specifying options on the command line in a string, the first always takes priority. For example, in \"opt,someotheropt,!opt\", opt is enabled, due to it being the first occurrence. - If you have set \$dir_satellites in the config, you can omit the .sat suffix. @@ -105,7 +108,7 @@ _exiterr() { } # Gather info -while getopts "h?s:b:i:r:p:IcCdvo:" opt; do +while getopts "h?s:b:i:p:IcCdvo:" opt; do case "$opt" in h|\?) _show_help @@ -120,14 +123,11 @@ while getopts "h?s:b:i:r:p:IcCdvo:" opt; do i) dir_install="$OPTARG" ;; - r) - dir_sysroot="$OPTARG" - ;; p) dir_prefix="$OPTARG" ;; I) - _astronaut_nuke_dir_install=true + _nuke_dir_install=true ;; d) _download_only=true @@ -291,7 +291,7 @@ header_end() { :; } if [ "$_vcs_only" = true ]; then header_end() { if [ ! "$vcs_compile" = true ]; then - exit + exit 1 fi } fi @@ -305,51 +305,62 @@ if [ "$_download_only" = true ]; then header_end() { exit; } fi -_satellite="$1" -_satname="$(basename "$_satellite" .sat)" - -# Try to find the satellite file if it can't be found. -if [ ! -f "$_satellite" ]; then - if [ -d "$dir_satellites" ]; then - file="$(find "$dir_satellites" -type f \( -name "$_satname.sat" -o -name "$_satname" \) -print -quit)" - if [ -f "$file" ]; then - _satellite="$file" - _satname="$(basename "$_satellite" .sat)" - fi - fi - - # If it still can't be found, exit. - if [ ! -f "$_satellite" ]; then - _exiterr "Can't find satellite" - fi -fi - -_satellite="$(realpath "$_satellite")" - -# Build the definitive options list (not including the options defined in the satellite) -options="$_user_options$(package_options "$_satname"),$options" - # Create the directories mkdir -p "$dir_source" dir_source="$(realpath "$dir_source")" if [ "$_download_only" = false ]; then - # Fix up the install path - dir_install="$(echo "$dir_install" | sed -e "s/{pkg}/$(safe_sed "$satname")/g")" - - # This variable can be set by a wrapper script in need to nuke the install dir. - if [ "$_astronaut_nuke_dir_install" = true -a ! -z "$dir_install" ]; then - rm -rf "$dir_install" - fi - - rm -rf "$dir_build" mkdir -p "$dir_build" mkdir -p "$dir_install" dir_build="$(realpath "$dir_build")" dir_install="$(realpath "$dir_install")" - - cd "$dir_build" fi -# Create the satellite -. "$_satellite" +for _satellite in "$@"; do + _satname="$(basename "$_satellite" .sat)" + + # Try to find the satellite file if it can't be found. + if [ ! -f "$_satellite" ]; then + if [ -d "$dir_satellites" ]; then + file="$(find "$dir_satellites" -type f \( -name "$_satname.sat" -o -name "$_satname" \) -print -quit)" + if [ -f "$file" ]; then + _satellite="$file" + _satname="$(basename "$_satellite" .sat)" + fi + fi + + # If it still can't be found, exit. + if [ ! -f "$_satellite" ]; then + _exiterr "Can't find satellite: $_satellite" + fi + fi + + _satellite="$(realpath "$_satellite")" + + ( + options="$_user_options$(package_options "$_satname"),$options" + + if [ "$_download_only" = true ]; then + # Just download it + . "$_satellite" + else + _astronaut_wrapper_pre + + # Remove install dir if appropriate + if [ "$_nuke_dir_install" = true -a ! -z "$dir_install" ]; then + rm -rf "$dir_install" + mkdir -p "$dir_install" + fi + + rm -rf "$dir_build" + mkdir -p "$dir_build" + + # Create the satellite + options="$_user_options$(package_options "$_satname"),$options" + cd "$dir_build" + . "$_satellite" + + _astronaut_wrapper_post + fi + ) +done diff --git a/astronaut/astronautpkg b/astronaut/astronautpkg index f9f92eb..fcd4924 100755 --- a/astronaut/astronautpkg +++ b/astronaut/astronautpkg @@ -1,41 +1,48 @@ #!/bin/sh -e # A hacky script to generate .t?z files using satellites. -# It's a fairly simple wrapper to astronaut, that generates a pkgtools package at the end. +# It's a fairly simple wrapper to astronaut, that generates pkgtools packages. # This may also serve as an example on how you can wrap astronaut to package in any format. -_fakeroot="$(command -v fakeroot || true)" -[ "$_fakeroot" ] && _fakeroot='fakeroot' +# Check whether we'll use fakeroot or not +_astronaut_wrapper_fakeroot="$(command -v fakeroot || true)" +[ "$_astronaut_wrapper_fakeroot" ] && _astronaut_wrapper_fakeroot='fakeroot' -if [ ! "$_fakeroot" -a "$(id -u)" != "0" ]; then +if [ ! "$_astronaut_wrapper_fakeroot" -a "$(id -u)" != "0" ]; then echo 'This script has to be run as root, or you need fakeroot installed.' 1>&2 exit 1 fi -_topdir=$PWD +# Find astronaut _astronaut="$(dirname "$0")/astronaut" [ ! -f "$_astronaut" ] && _astronaut='astronaut' -_astronaut_nuke_dir_install=true +# Configuration +dir_wrapper_pkgtools="$PWD" # Where the packages should be stored -. "$_astronaut" +# Wrapper functions +_astronaut_wrapper_pre() { + # Make sure to remove the contents of the install directory before building + _nuke_dir_install=true +} -# Gzip man and info pages -if [ -d "$dir_install/$dir_prefix/$dir_mandir" ]; then - find "$dir_install/$dir_prefix/$dir_mandir" -type f -exec gzip -9 {} \; - for i in $(find "$dir_install/$dir_prefix/$dir_mandir" -type l); do ln -s "$(readlink "$i").gz" "$i.gz"; rm "$i"; done -fi -if [ -d "$dir_install/$dir_prefix/$dir_infodir" ]; then - rm -f "$dir_install/$dir_prefix/$dir_infodir/dir" - gzip -9 -r "$dir_install/$dir_prefix/$dir_infodir" -fi +_astronaut_wrapper_post() { + # Gzip man and info pages + if [ -d "$dir_install/$dir_prefix/$dir_mandir" ]; then + find "$dir_install/$dir_prefix/$dir_mandir" -type f -exec gzip -9 {} \; + for i in $(find "$dir_install/$dir_prefix/$dir_mandir" -type l); do ln -s "$(readlink "$i").gz" "$i.gz"; rm "$i"; done + fi + if [ -d "$dir_install/$dir_prefix/$dir_infodir" ]; then + rm -f "$dir_install/$dir_prefix/$dir_infodir/dir" + gzip -9 -r "$dir_install/$dir_prefix/$dir_infodir" + fi -# Strip binaries -find "$dir_install" | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null | true + # Strip binaries + find "$dir_install" | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null | true -# Generate slack-desc for proper compliance, even if it's completely redundant -#mkdir -p "$dir_install/install" -#cat > "$dir_install/install/slack-desc" << EOF + # Generate slack-desc for proper compliance, even if it's completely redundant + #mkdir -p "$dir_install/install" + #cat > "$dir_install/install/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 '|' @@ -57,8 +64,33 @@ find "$dir_install" | xargs file | grep -e "executable" -e "shared object" | gre #$_satname: #EOF -# dir_wrapper_pkgtools should be set from a configuration file (e.g. ~/.astronaut.conf), and points to wherever you want your packages to be placed. -[ "$dir_wrapper_pkgtools" ] && mkdir -p "$dir_wrapper_pkgtools" || dir_wrapper_pkgtools="$_topdir" -cd "$dir_install" + # Move configuration files to .new and install them for proper compliance. + if [ -d "$dir_install/etc" ]; then + mkdir -p "$dir_install/install" + cat > "$dir_install/install/doinst.sh" << EOF +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} +EOF -PATH="$PATH:/sbin" $_fakeroot makepkg -l y -c n "$dir_wrapper_pkgtools/$_satname-$(echo "$version" | sed -e 's/-/_/g')-$(uname -m)-astro.txz" + find "$dir_install/etc" -type f -printf '%P\n' | while IFS= read file; do + mv "$dir_install/etc/$file" "$dir_install/etc/$file.new" + echo "config 'etc/$file.new'" >> "$dir_install/install/doinst.sh" + done + fi + + # Create the package + cd "$dir_install" + mkdir -p "$dir_wrapper_pkgtools" + PATH="$PATH:/sbin" $_astronaut_wrapper_fakeroot makepkg -l y -c n "$dir_wrapper_pkgtools/$_satname-$(echo "$version" | sed -e 's/-/_/g')-$(uname -m)-astro.txz" +} + +. "$_astronaut" diff --git a/astronaut/pacman-astronaut b/astronaut/pacman-astronaut index a920ef4..6b7f145 100755 --- a/astronaut/pacman-astronaut +++ b/astronaut/pacman-astronaut @@ -1,23 +1,27 @@ #!/bin/sh -e # A hacky script to generate .pkg.tar.?z files using satellites. -# It's a fairly simple wrapper to astronaut, that generates a pacman package at the end. +# It's a fairly simple wrapper to astronaut, that generates pacman packages. # This may also serve as an example on how you can wrap astronaut to package in any format. # Sure, no dependency resolution, and the packages won't make it in any official repositories, # but it isn't meant for that anyway. -_topdir=$PWD +# Find astronaut _astronaut="$(dirname "$0")/astronaut" [ ! -f "$_astronaut" ] && _astronaut="astronaut" -_astronaut_nuke_dir_install=true +# Configuration +dir_wrapper_pacman="$PWD" # Where the packages should be stored -. "$_astronaut" - -# dir_wrapper_pacman should be set from a configuration file (e.g. ~/.astronaut.conf), and points to wherever you want your packages to be placed. -[ "$dir_wrapper_pacman" ] && mkdir -p "$dir_wrapper_pacman" && cd "$dir_wrapper_pacman" || cd "$_topdir" +# Wrapper functions +_astronaut_wrapper_pre() { + # Make sure to remove the contents of the install directory before building + _nuke_dir_install=true +} -cat << EOF > "$dir_install/.PKGINFO" +_astronaut_wrapper_post() { + # Create the package info file + cat > "$dir_install/.PKGINFO" << EOF pkgname = $_satname pkgver = $version-astro pkgdesc = Generated with pacman-astronaut @@ -27,7 +31,14 @@ size = $(du -sb --apparent-size "$dir_install" | awk '{print $1}') arch = $(uname -m) EOF -bsdtar --strip-components 1 -C "$dir_install" -czf .MTREE --format=mtree --options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' . -mv .MTREE "$dir_install/.MTREE" # bsdtar doesn't like the file being in the same directory. -fakeroot -- bsdtar --strip-components 1 -C "$dir_install" -cf - . > "$_satname-$version-astro-$(uname -m).pkg.tar" -repo-add astronaut.db.tar.gz "$_satname-$version-astro-$(uname -m).pkg.tar" + mkdir -p "$dir_wrapper_pacman" + cd "$dir_wrapper_pacman" + + # Create the package + bsdtar --strip-components 1 -C "$dir_install" -czf .MTREE --format=mtree --options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' . + mv .MTREE "$dir_install/.MTREE" # bsdtar doesn't like the file being in the same directory. + fakeroot -- bsdtar --strip-components 1 -C "$dir_install" -cf - . > "$_satname-$version-astro-$(uname -m).pkg.tar" + repo-add astronaut.db.tar.gz "$_satname-$version-astro-$(uname -m).pkg.tar" +} + +. "$_astronaut" diff --git a/astronaut/xbps-astronaut b/astronaut/xbps-astronaut index d43d902..e9dcd02 100755 --- a/astronaut/xbps-astronaut +++ b/astronaut/xbps-astronaut @@ -1,20 +1,31 @@ #!/bin/sh -e # A hacky script to generate .xbps files using satellites. -# It's a fairly simple wrapper to astronaut, that generates a xbps package at the end. +# It's a fairly simple wrapper to astronaut, that generates xbps packages. # This may also serve as an example on how you can wrap astronaut to package in any format. # Sure, no dependency resolution, and the packages won't make it in any official repositories, # but it isn't meant for that anyway. -_topdir=$PWD +# Find astronaut _astronaut="$(dirname "$0")/astronaut" [ ! -f "$_astronaut" ] && _astronaut="astronaut" -_astronaut_nuke_dir_install=true +# Configuration +dir_wrapper_xbps="$PWD" -. "$_astronaut" +# Wrapper functions +_astronaut_wrapper_pre() { + # Make sure to remove the contents of the install directory before building + _nuke_dir_install=true +} + +_astronaut_wrapper_post() { + mkdir -p "$dir_wrapper_xbps" + cd "$dir_wrapper_xbps" -# _dir_xbps should be set from a configuration file (e.g. ~/.astronaut.conf), and points to wherever you want your packages to be placed. -[ "$dir_wrapper_xbps" ] && mkdir -p "$dir_wrapper_xbps" && cd "$dir_wrapper_xbps" || cd "$_topdir" -xbps-create --compression none -A "$(uname -m)" -n "$_satname-${version}_astro" -s "Generated with xbps-astronaut" -H "$update_url" "$dir_install" -xbps-rindex -f -a "$_satname-${version}_astro.$(uname -m).xbps" + # Create the package + xbps-create --compression none -A "$(uname -m)" -n "$_satname-${version}_astro" -s "Generated with xbps-astronaut" -H "$update_url" "$dir_install" + xbps-rindex -f -a "$_satname-${version}_astro.$(uname -m).xbps" +} + +. "$_astronaut" diff --git a/satellites/compton-git.sat b/satellites/compton-git.sat index 8af6ce9..6aa4fa7 100644 --- a/satellites/compton-git.sat +++ b/satellites/compton-git.sat @@ -12,6 +12,6 @@ make install \ BINDIR="/$dir_prefix/$dir_bindir" \ MANDIR="/$dir_prefix/$dir_mandir" \ APPDIR="/$dir_prefix/$dir_datadir/applications" \ - INODIR="/$dir_prefix/$dir_datadir/icons/hicolor" + ICODIR="/$dir_prefix/$dir_datadir/icons/hicolor" # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/create_ap.sat b/satellites/create_ap.sat index 5b4e0d1..5bb443b 100644 --- a/satellites/create_ap.sat +++ b/satellites/create_ap.sat @@ -9,7 +9,7 @@ header_end cd "$name-$version" install -Dm755 -t "$dir_install/$dir_prefix/$dir_bindir" "$name" -install -Dm644 -t "$dir_install/$dir_sysconfdir" "$name.conf" +install -Dm644 -t "$dir_install/$dir_prefix/$dir_sysconfdir" "$name.conf" install -Dm644 -t "$dir_install/$dir_prefix/$dir_datadir/bash-completion/$name" bash_completion install -Dm644 -t "$dir_install/$dir_prefix/$dir_docdir/$name" README.md diff --git a/satellites/ffmpeg.sat b/satellites/ffmpeg.sat index 8a9e72b..05ca9ad 100644 --- a/satellites/ffmpeg.sat +++ b/satellites/ffmpeg.sat @@ -16,10 +16,11 @@ cd "$name-$version" --enable-libvorbis \ --prefix="/$dir_prefix" \ --bindir="/$dir_prefix/$dir_bindir" \ - --libdir="/$dir_prefix/$dir_libdir" \ --datadir="/$dir_prefix/$dir_datadir/$name" \ - --mandir="/$dir_prefix/$dir_mandir" \ - --docdir="/$dir_prefix/$dir_docdir/$name" + --docdir="/$dir_prefix/$dir_docdir/$name" \ + --libdir="/$dir_prefix/$dir_libdir" \ + --incdir="/$dir_prefix/$dir_includedir" \ + --mandir="/$dir_prefix/$dir_mandir" make make DESTDIR="$dir_install" install diff --git a/satellites/functions/compile/cmake.sh b/satellites/functions/compile/cmake.sh index 5a2b4a6..dd60387 100644 --- a/satellites/functions/compile/cmake.sh +++ b/satellites/functions/compile/cmake.sh @@ -16,16 +16,17 @@ compile_cmake() { cmake "$olddir" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="/$dir_prefix" \ - -DCMAKE_INSTALL_SYSCONFDIR="$dir_sysconfdir" \ - -DCMAKE_INSTALL_BINDIR="$dir_bindir" \ - -DCMAKE_INSTALL_SBINDIR="$dir_sbindir" \ - -DCMAKE_INSTALL_LIBDIR="$dir_libdir" \ - -DCMAKE_INSTALL_LIBEXECDIR="$dir_libexecdir" \ - -DCMAKE_INSTALL_DATADIR="$dir_datadir" \ - -DCMAKE_INSTALL_MANDIR="$dir_mandir" \ - -DCMAKE_INSTALL_DOCDIR="$dir_docdir/$name" \ - -DCMAKE_INSTALL_INFODIR="$dir_infodir" \ - -DCMAKE_INSTALL_LOCALEDIR="$dir_localedir" \ + -DCMAKE_INSTALL_FULL_SYSCONFDIR="/$dir_prefix/$dir_sysconfdir" \ + -DCMAKE_INSTALL_FULL_BINDIR="/$dir_prefix/$dir_bindir" \ + -DCMAKE_INSTALL_FULL_SBINDIR="/$dir_prefix/$dir_sbindir" \ + -DCMAKE_INSTALL_FULL_LIBEXECDIR="/$dir_prefix/$dir_libexecdir" \ + -DCMAKE_INSTALL_FULL_LIBDIR="/$dir_prefix/$dir_libdir" \ + -DCMAKE_INSTALL_FULL_INCLUDEDIR="/$dir_prefix/$dir_includedir" \ + -DCMAKE_INSTALL_FULL_DATADIR="/$dir_prefix/$dir_datadir" \ + -DCMAKE_INSTALL_FULL_MANDIR="/$dir_prefix/$dir_mandir" \ + -DCMAKE_INSTALL_FULL_DOCDIR="/$dir_prefix/$dir_docdir/$name" \ + -DCMAKE_INSTALL_FULL_INFODIR="/$dir_prefix/$dir_infodir" \ + -DCMAKE_INSTALL_FULL_LOCALEDIR="/$dir_prefix/$dir_localedir" \ "$@" make [ "$noinstall" = false ] && make DESTDIR="$dir_install" install diff --git a/satellites/functions/compile/configure.sh b/satellites/functions/compile/configure.sh index 3be477c..627800f 100644 --- a/satellites/functions/compile/configure.sh +++ b/satellites/functions/compile/configure.sh @@ -31,16 +31,17 @@ compile_configure() { "$olddir/configure" \ --prefix="/$dir_prefix" \ - --sysconfdir="/$dir_sysconfdir" \ --bindir="/$dir_prefix/$dir_bindir" \ --sbindir="/$dir_prefix/$dir_sbindir" \ - --libdir="/$dir_prefix/$dir_libdir" \ --libexecdir="/$dir_prefix/$dir_libexecdir" \ + --sysconfdir="/$dir_prefix/$dir_sysconfdir" \ + --libdir="/$dir_prefix/$dir_libdir" \ + --includedir="/$dir_prefix/$dir_includedir" \ --datadir="/$dir_prefix/$dir_datadir" \ - --mandir="/$dir_prefix/$dir_mandir" \ - --docdir="/$dir_prefix/$dir_docdir/$name" \ --infodir="/$dir_prefix/$dir_infodir" \ --localedir="/$dir_prefix/$dir_localedir" \ + --mandir="/$dir_prefix/$dir_mandir" \ + --docdir="/$dir_prefix/$dir_docdir/$name" \ $build $cross "$@" [ "$nomake" = false ] && make $makeflags diff --git a/satellites/i3status.sat b/satellites/i3status.sat index 05246a6..d6fa404 100644 --- a/satellites/i3status.sat +++ b/satellites/i3status.sat @@ -13,14 +13,14 @@ cd "$name-$version" patch -p0 -i "../$name-$version-optional-pulseaudio.patch" -# Fix install directories +# Fix paths sed -i -e "/install -m/s/bin/$(safe_sed "$dir_bindir")/" \ -e "/install -m/s/share\/man/$(safe_sed "$dir_mandir")/" Makefile make WITH_PULSEAUDIO=$(option pulseaudio && echo yes || echo no) make install \ PREFIX="/$dir_prefix" \ - SYSCONFDIR="/$dir_sysconfdir" \ + SYSCONFDIR="/$dir_prefix/$dir_sysconfdir" \ DESTDIR="$dir_install" # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/lua.sat b/satellites/lua.sat index f5f249a..3637154 100644 --- a/satellites/lua.sat +++ b/satellites/lua.sat @@ -9,7 +9,7 @@ header_end cd "$name-$version" -# Fix paths in luaconf.h +# Fix paths sed -i -e "/LUA_ROOT/s/usr\/local/$(safe_sed "$dir_prefix")/" \ -e "/LUA_LDIR/s/share/$(safe_sed "$dir_datadir")/" \ -e "/LUA_CDIR/s/lib/$(safe_sed "$dir_libdir")/" src/luaconf.h @@ -23,6 +23,7 @@ make install \ INSTALL_TOP="$PWD/install" \ INSTALL_BIN="\$(INSTALL_TOP)/$dir_bindir" \ INSTALL_LIB="\$(INSTALL_TOP)/$dir_libdir" \ + INSTALL_INC="\$(INSTALL_TOP)/$dir_includedir" \ INSTALL_MAN="\$(INSTALL_TOP)/$dir_mandir/man1" \ INSTALL_LMOD="\$(INSTALL_TOP)/$dir_datadir/$majver" \ INSTALL_CMOD="\$(INSTALL_TOP)/$dir_libdir/$majver" diff --git a/satellites/luajit.sat b/satellites/luajit.sat index d71c553..d89344f 100644 --- a/satellites/luajit.sat +++ b/satellites/luajit.sat @@ -16,6 +16,7 @@ make install \ MULTILIB="$dir_libdir" \ INSTALL_BIN="\$(DPREFIX)/$dir_bindir" \ INSTALL_SHARE="\$(DPREFIX)/$dir_datadir" \ - INSTALL_MAN="\$(DPREFIX)/$dir_mandir" + INSTALL_MAN="\$(DPREFIX)/$dir_mandir" \ + INSTALL_INC="\$(DPREFIX)/$dir_includedir/luajit-\$(MAJVER).\$(MINVER)" # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/mpv.sat b/satellites/mpv.sat index 093a038..9c65125 100644 --- a/satellites/mpv.sat +++ b/satellites/mpv.sat @@ -10,10 +10,11 @@ header_end cd "$name-$version" compile_waf -- \ - --confdir="/$dir_sysconfdir" \ + --confdir="/$dir_prefix/$dir_sysconfdir" \ + --incdir="/$dir_prefix/$dir_includedir" \ + --datadir="/$dir_prefix/$dir_datadir" \ --mandir="/$dir_prefix/$dir_mandir" \ --docdir="/$dir_prefix/$dir_docdir/$name" \ - --datadir="/$dir_prefix/$dir_datadir" \ --enable-zsh-comp # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/python3.sat b/satellites/python3.sat index a3d9138..1cb0293 100644 --- a/satellites/python3.sat +++ b/satellites/python3.sat @@ -14,9 +14,11 @@ cd "$name-$version" # Fix paths sed -i -e "/os.path.join(prefix/s/lib/$(safe_sed "$dir_libdir")/" Lib/site.py -sed -i -e "s/\/lib\/python/\/$(safe_sed "$dir_libdir")\/python/" \ - -e "s/\/bin/\/$(safe_sed "$dir_bindir")/" Lib/sysconfig.py Lib/distutils/command/install.py -sed -i -e "/libpython =/!b;n;s/lib/$(safe_sed "$dir_libdir")/" Lib/distutils/sysconfig.py +sed -i -e "s/\/lib\/python/$(safe_sed "/$dir_libdir/python")/" \ + -e "s/\/include\/python/$(safe_sed "/$dir_includedir/python")/" \ + -e "s/\/bin/$(safe_sed "/$dir_bindir")/" Lib/sysconfig.py Lib/distutils/command/install.py +sed -i -e "/libpython =/!b;n;s/lib/$(safe_sed "$dir_libdir")/" \ + -e "/os.path.join/s/include/$(safe_sed "$dir_includedir")/" Lib/distutils/sysconfig.py sed -i -e "/lib_python =/s/lib\//$(safe_sed "$dir_libdir")\//" Modules/getpath.c sed -i -e "/SCRIPTDIR=/s/lib/$(safe_sed "$dir_libdir")/" Makefile.pre.in sed -i -e "/LIBPL=/s/lib/$(safe_sed "$dir_libdir")/" configure diff --git a/satellites/qt5-base.sat b/satellites/qt5-base.sat index 642febe..45cf193 100644 --- a/satellites/qt5-base.sat +++ b/satellites/qt5-base.sat @@ -28,11 +28,11 @@ for opt in $optional_libraries; do done # NOTE: Only double-conversion from Qt itself is used, as there's no recent stable version available, due to lack of maintenance (last I can find is 1.1.5 from 2014, but there's scripts to build 2.0.1, for example in AUR, yet there's no proper place to get the sources for that). -./configure -v -confirm-license -opensource \ +./configure -confirm-license -opensource \ -prefix "/$dir_prefix" \ -libdir "/$dir_prefix/$dir_libdir" \ - -headerdir "/$dir_prefix/include/$name" \ - -sysconfdir "/$dir_sysconfdir/xdg" \ + -headerdir "/$dir_prefix/$dir_includedir/$name" \ + -sysconfdir "/$dir_prefix/$dir_sysconfdir/xdg" \ -datadir "/$dir_prefix/$dir_datadir/$name" \ -bindir "/$dir_prefix/$dir_libdir/$name/bin" \ -archdatadir "/$dir_prefix/$dir_libdir/$name" \ @@ -52,7 +52,7 @@ make make INSTALL_ROOT="$dir_install" install mkdir -p "$dir_install/$dir_prefix/$dir_bindir" -for bin in $(find "$dir_install/$dir_prefix/$dir_libdir/$name/bin/" -type f -printf '%P '); do +find "$dir_install/$dir_prefix/$dir_libdir/$name/bin/" -type f -printf '%P\n' | while IFS= read bin; do ln -s "../$dir_libdir/$name/bin/$bin" "$dir_install/$dir_prefix/$dir_bindir/$bin-$name" done diff --git a/satellites/qt5-tools.sat b/satellites/qt5-tools.sat index 1149c4e..599d683 100644 --- a/satellites/qt5-tools.sat +++ b/satellites/qt5-tools.sat @@ -15,7 +15,7 @@ cd "qt$submodule-opensource-src-$version" compile_qt 5 mkdir -p "$dir_install/$dir_prefix/$dir_bindir" -for bin in $(find "$dir_install/$dir_prefix/$dir_libdir/$name/bin/" -type f -printf '%P '); do +find "$dir_install/$dir_prefix/$dir_libdir/$name/bin/" -type f -printf '%P\n' | while IFS= read bin; do ln -s "../$dir_libdir/$name/bin/$bin" "$dir_install/$dir_prefix/$dir_bindir/$bin-$name" done diff --git a/satellites/rt8192cu-git.sat b/satellites/rt8192cu-git.sat index 9c64d41..4e67e39 100644 --- a/satellites/rt8192cu-git.sat +++ b/satellites/rt8192cu-git.sat @@ -10,9 +10,9 @@ header_end kver="$(option =kver)" cd "$name" -make KSRC="$dir_sysroot/lib/modules/$kver/build" modules +make KSRC="/lib/modules/$kver/build" modules install -Dm644 -t "$dir_install/lib/modules/$kver/kernel/drivers/net/wireless" 8192cu.ko -install -Dm644 blacklist-dkms-8192cu.conf "$dir_install/$dir_sysconfdir/modprobe.d/$name.conf" -echo 'blacklist rtl8xxxu' >> "$dir_install/$dir_sysconfdir/modprobe.d/$name.conf" +install -Dm644 blacklist-dkms-8192cu.conf "$dir_install/$dir_prefix/$dir_sysconfdir/modprobe.d/$name.conf" +echo 'blacklist rtl8xxxu' >> "$dir_install/$dir_prefix/$dir_sysconfdir/modprobe.d/$name.conf" # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: diff --git a/satellites/waf.sat b/satellites/waf.sat index bd841d3..6f56fdd 100644 --- a/satellites/waf.sat +++ b/satellites/waf.sat @@ -19,7 +19,7 @@ sed -i -e '/dirname =/s/%s-%s-%s/%s-%s/' \ -e '/dirname =/s/, REVISION//' "$name" # Change the logic of checking dirs to find waflib to only check one dir, the dir where we installed it. -sed -i -e "s/INSTALL,'\/usr','\/usr\/local','\/opt'/'$(safe_sed "$dir_sysroot/$dir_prefix")',/" \ +sed -i -e "s/INSTALL,'\/usr','\/usr\/local','\/opt'/'$(safe_sed "/$dir_prefix")',/" \ -e "s/'\/lib\/'/'$(safe_sed "/$dir_libdir/")'/" "$name" # Fix the shebang to point to python3 diff --git a/satellites/yajl.sat b/satellites/yajl.sat index e400e29..410ff19 100644 --- a/satellites/yajl.sat +++ b/satellites/yajl.sat @@ -16,9 +16,10 @@ sed -i -e '/yajl_s/d' \ -e '/COMMAND ${CMAKE_COMMAND}/d' src/CMakeLists.txt find . -name "CMakeLists.txt" -exec sed -i -e '/TARGET_LINK_LIBRARIES/s/yajl_s/yajl/' '{}' \; -# Fix install dirs +# Fix paths sed -i -e "/DESTINATION/s/lib\${LIB_SUFFIX}/\"$(safe_sed "$dir_libdir")\"/" \ - -e "/DESTINATION/s/share\\pkgconfig/\"$(safe_sed "$dir_datadir/pkgconfig")\"/" src/CMakeLists.txt + -e "/DESTINATION/s/share\/pkgconfig/\"$(safe_sed "$dir_datadir/pkgconfig")\"/" \ + -e "/DESTINATION/s/include\/yajl/\"$(safe_sed "$dir_includedir/yajl")\"/" src/CMakeLists.txt sed -i -e "/DESTINATION/s/bin/\"$(safe_sed "$dir_bindir")\"/" \ verify/CMakeLists.txt reformatter/CMakeLists.txt diff --git a/satellites/zim.sat b/satellites/zim.sat index b5ebab3..49723b2 100644 --- a/satellites/zim.sat +++ b/satellites/zim.sat @@ -12,8 +12,8 @@ cd "$name-$version" # Shitty method to fix setup.py for paths safe_datadir="$(safe_sed "$dir_datadir")" -sed -i -e "s/share/$safe_datadir/g" setup.py -sed -i -e "s/$safe_datadir\/man/$(safe_sed "$dir_mandir")/g" setup.py +sed -i -e "s/share/$safe_datadir/g" \ + -e "s/$safe_datadir\/man/$(safe_sed "$dir_mandir")/g" setup.py compile_python 2 --skip-xdg-cmd diff --git a/todo.txt b/todo.txt deleted file mode 100644 index da5f182..0000000 --- a/todo.txt +++ /dev/null @@ -1,2 +0,0 @@ -Remove the need for dir_sysroot, using it as an option only in the strictly required packages. -Update the vcs and compile functions to support better options.