Browse Source

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.
master
mid-kid 8 years ago
parent
commit
cd4b35e85c
  1. 103
      astronaut/astronaut
  2. 74
      astronaut/astronautpkg
  3. 35
      astronaut/pacman-astronaut
  4. 27
      astronaut/xbps-astronaut
  5. 2
      satellites/compton-git.sat
  6. 2
      satellites/create_ap.sat
  7. 7
      satellites/ffmpeg.sat
  8. 21
      satellites/functions/compile/cmake.sh
  9. 9
      satellites/functions/compile/configure.sh
  10. 4
      satellites/i3status.sat
  11. 3
      satellites/lua.sat
  12. 3
      satellites/luajit.sat
  13. 5
      satellites/mpv.sat
  14. 8
      satellites/python3.sat
  15. 8
      satellites/qt5-base.sat
  16. 2
      satellites/qt5-tools.sat
  17. 6
      satellites/rt8192cu-git.sat
  18. 2
      satellites/waf.sat
  19. 5
      satellites/yajl.sat
  20. 4
      satellites/zim.sat
  21. 2
      todo.txt

103
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. # which is the filename of the satellite, without the .sat suffix.
# Runtime directories # Runtime directories
dir_sysroot='' # The root directory of the system dir_prefix='usr' # Prefix directory
dir_prefix='usr' # Prefix directory (for /bin, /lib, /include, /share and such)
# Finer-grained control of runtime dirs # Finer-grained control of runtime dirs
# This can't be set from the command line, but might need to be adapted for your distro. # 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_bindir='bin'
dir_sbindir='sbin' dir_sbindir='sbin'
dir_libdir='lib'
# Dirs only inside of $dir_prefix
dir_libexecdir='libexec' dir_libexecdir='libexec'
dir_sysconfdir='etc'
dir_libdir='lib'
dir_includedir='include'
dir_datadir='share' dir_datadir='share'
dir_mandir='share/man'
dir_docdir='share/doc'
dir_infodir='share/info' dir_infodir='share/info'
dir_localedir='share/locale' dir_localedir='share/locale'
dir_mandir='share/man'
dir_docdir='share/doc'
# Default commands # Default commands
cmd_download='curl -# -L -o {dst} {src}' # Command to execute to download files 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 # Options not in the configuration
_download_only=false _download_only=false
_vcs_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 _user_options # Options specified in the command line get the highest priority
unset _sat_options # Options defined by the satellite 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 # Should be specified in the satellite
unset name unset name
unset version unset version
unset update_url unset update_url
vcs_compile=false
# Some printing functions # Some printing functions
_show_help() { _show_help() {
echo "This astronaut will help you build some satellites. echo "This astronaut will help you build some satellites.
Just describe what he's got to do in a satellite file. Just describe what he's got to do in a satellite file.
Usage: $0 [-bsirp <dir>] [-hIdv] [-o <options>] <satellite> Usage: $0 [-bsip <dir>] [-hIdv] [-o <options>] <satellite>...
-h/? Show this message -h/? Show this message
-b Set build directory [WARNING: Will be deleted before build] -b Set build directory [WARNING: Will be deleted before build]
-s Set source directory -s Set source directory
-i Set install directory -i Set install directory
-r Set root directory
-p Set prefix directory -p Set prefix directory
-I Nuke install directory before build [WARNING: You will not be prompted] -I Nuke install directory before build [WARNING: You will not be prompted]
-d Only download package files -d Only download package files
-v Only build vcs package if any updates have been made to it -v Only build vcs package if any updates have been made to it
-o Set package options (comma-separated) -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. - 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. 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. - If you have set \$dir_satellites in the config, you can omit the .sat suffix.
@ -105,7 +108,7 @@ _exiterr() {
} }
# Gather info # 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 case "$opt" in
h|\?) h|\?)
_show_help _show_help
@ -120,14 +123,11 @@ while getopts "h?s:b:i:r:p:IcCdvo:" opt; do
i) i)
dir_install="$OPTARG" dir_install="$OPTARG"
;; ;;
r)
dir_sysroot="$OPTARG"
;;
p) p)
dir_prefix="$OPTARG" dir_prefix="$OPTARG"
;; ;;
I) I)
_astronaut_nuke_dir_install=true _nuke_dir_install=true
;; ;;
d) d)
_download_only=true _download_only=true
@ -291,7 +291,7 @@ header_end() { :; }
if [ "$_vcs_only" = true ]; then if [ "$_vcs_only" = true ]; then
header_end() { header_end() {
if [ ! "$vcs_compile" = true ]; then if [ ! "$vcs_compile" = true ]; then
exit exit 1
fi fi
} }
fi fi
@ -305,11 +305,22 @@ if [ "$_download_only" = true ]; then
header_end() { exit; } header_end() { exit; }
fi fi
_satellite="$1" # Create the directories
_satname="$(basename "$_satellite" .sat)" mkdir -p "$dir_source"
dir_source="$(realpath "$dir_source")"
if [ "$_download_only" = false ]; then
mkdir -p "$dir_build"
mkdir -p "$dir_install"
dir_build="$(realpath "$dir_build")"
dir_install="$(realpath "$dir_install")"
fi
for _satellite in "$@"; do
_satname="$(basename "$_satellite" .sat)"
# Try to find the satellite file if it can't be found. # Try to find the satellite file if it can't be found.
if [ ! -f "$_satellite" ]; then if [ ! -f "$_satellite" ]; then
if [ -d "$dir_satellites" ]; then if [ -d "$dir_satellites" ]; then
file="$(find "$dir_satellites" -type f \( -name "$_satname.sat" -o -name "$_satname" \) -print -quit)" file="$(find "$dir_satellites" -type f \( -name "$_satname.sat" -o -name "$_satname" \) -print -quit)"
if [ -f "$file" ]; then if [ -f "$file" ]; then
@ -320,36 +331,36 @@ if [ ! -f "$_satellite" ]; then
# If it still can't be found, exit. # If it still can't be found, exit.
if [ ! -f "$_satellite" ]; then if [ ! -f "$_satellite" ]; then
_exiterr "Can't find satellite" _exiterr "Can't find satellite: $_satellite"
fi
fi fi
fi
_satellite="$(realpath "$_satellite")"
# Build the definitive options list (not including the options defined in the satellite) _satellite="$(realpath "$_satellite")"
options="$_user_options$(package_options "$_satname"),$options"
# Create the directories (
mkdir -p "$dir_source" options="$_user_options$(package_options "$_satname"),$options"
dir_source="$(realpath "$dir_source")"
if [ "$_download_only" = false ]; then if [ "$_download_only" = true ]; then
# Fix up the install path # Just download it
dir_install="$(echo "$dir_install" | sed -e "s/{pkg}/$(safe_sed "$satname")/g")" . "$_satellite"
else
_astronaut_wrapper_pre
# This variable can be set by a wrapper script in need to nuke the install dir. # Remove install dir if appropriate
if [ "$_astronaut_nuke_dir_install" = true -a ! -z "$dir_install" ]; then if [ "$_nuke_dir_install" = true -a ! -z "$dir_install" ]; then
rm -rf "$dir_install" rm -rf "$dir_install"
mkdir -p "$dir_install"
fi fi
rm -rf "$dir_build" rm -rf "$dir_build"
mkdir -p "$dir_build" mkdir -p "$dir_build"
mkdir -p "$dir_install"
dir_build="$(realpath "$dir_build")"
dir_install="$(realpath "$dir_install")"
# Create the satellite
options="$_user_options$(package_options "$_satname"),$options"
cd "$dir_build" cd "$dir_build"
fi . "$_satellite"
# Create the satellite _astronaut_wrapper_post
. "$_satellite" fi
)
done

74
astronaut/astronautpkg

@ -1,41 +1,48 @@
#!/bin/sh -e #!/bin/sh -e
# A hacky script to generate .t?z files using satellites. # 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. # This may also serve as an example on how you can wrap astronaut to package in any format.
_fakeroot="$(command -v fakeroot || true)" # Check whether we'll use fakeroot or not
[ "$_fakeroot" ] && _fakeroot='fakeroot' _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 echo 'This script has to be run as root, or you need fakeroot installed.' 1>&2
exit 1 exit 1
fi fi
_topdir=$PWD # Find astronaut
_astronaut="$(dirname "$0")/astronaut" _astronaut="$(dirname "$0")/astronaut"
[ ! -f "$_astronaut" ] && _astronaut='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 _astronaut_wrapper_post() {
if [ -d "$dir_install/$dir_prefix/$dir_mandir" ]; then # 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 {} \; 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 for i in $(find "$dir_install/$dir_prefix/$dir_mandir" -type l); do ln -s "$(readlink "$i").gz" "$i.gz"; rm "$i"; done
fi fi
if [ -d "$dir_install/$dir_prefix/$dir_infodir" ]; then if [ -d "$dir_install/$dir_prefix/$dir_infodir" ]; then
rm -f "$dir_install/$dir_prefix/$dir_infodir/dir" rm -f "$dir_install/$dir_prefix/$dir_infodir/dir"
gzip -9 -r "$dir_install/$dir_prefix/$dir_infodir" gzip -9 -r "$dir_install/$dir_prefix/$dir_infodir"
fi fi
# Strip binaries # 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 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 # Generate slack-desc for proper compliance, even if it's completely redundant
#mkdir -p "$dir_install/install" #mkdir -p "$dir_install/install"
#cat > "$dir_install/install/slack-desc" << EOF #cat > "$dir_install/install/slack-desc" << EOF
## HOW TO EDIT THIS FILE: ## HOW TO EDIT THIS FILE:
## The "handy ruler" below makes it easier to edit a package description. Line ## 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 '|' ## 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: #$_satname:
#EOF #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. # Move configuration files to .new and install them for proper compliance.
[ "$dir_wrapper_pkgtools" ] && mkdir -p "$dir_wrapper_pkgtools" || dir_wrapper_pkgtools="$_topdir" if [ -d "$dir_install/etc" ]; then
cd "$dir_install" 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"

35
astronaut/pacman-astronaut

@ -1,23 +1,27 @@
#!/bin/sh -e #!/bin/sh -e
# A hacky script to generate .pkg.tar.?z files using satellites. # 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. # 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, # Sure, no dependency resolution, and the packages won't make it in any official repositories,
# but it isn't meant for that anyway. # but it isn't meant for that anyway.
_topdir=$PWD # Find astronaut
_astronaut="$(dirname "$0")/astronaut" _astronaut="$(dirname "$0")/astronaut"
[ ! -f "$_astronaut" ] && _astronaut="astronaut" [ ! -f "$_astronaut" ] && _astronaut="astronaut"
_astronaut_nuke_dir_install=true # Configuration
dir_wrapper_pacman="$PWD" # Where the packages should be stored
. "$_astronaut" # Wrapper functions
_astronaut_wrapper_pre() {
# 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. # Make sure to remove the contents of the install directory before building
[ "$dir_wrapper_pacman" ] && mkdir -p "$dir_wrapper_pacman" && cd "$dir_wrapper_pacman" || cd "$_topdir" _nuke_dir_install=true
}
cat << EOF > "$dir_install/.PKGINFO" _astronaut_wrapper_post() {
# Create the package info file
cat > "$dir_install/.PKGINFO" << EOF
pkgname = $_satname pkgname = $_satname
pkgver = $version-astro pkgver = $version-astro
pkgdesc = Generated with pacman-astronaut pkgdesc = Generated with pacman-astronaut
@ -27,7 +31,14 @@ size = $(du -sb --apparent-size "$dir_install" | awk '{print $1}')
arch = $(uname -m) arch = $(uname -m)
EOF 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' . mkdir -p "$dir_wrapper_pacman"
mv .MTREE "$dir_install/.MTREE" # bsdtar doesn't like the file being in the same directory. cd "$dir_wrapper_pacman"
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" # 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"

27
astronaut/xbps-astronaut

@ -1,20 +1,31 @@
#!/bin/sh -e #!/bin/sh -e
# A hacky script to generate .xbps files using satellites. # 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. # 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, # Sure, no dependency resolution, and the packages won't make it in any official repositories,
# but it isn't meant for that anyway. # but it isn't meant for that anyway.
_topdir=$PWD # Find astronaut
_astronaut="$(dirname "$0")/astronaut" _astronaut="$(dirname "$0")/astronaut"
[ ! -f "$_astronaut" ] && _astronaut="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. # Create the package
[ "$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-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"
xbps-rindex -f -a "$_satname-${version}_astro.$(uname -m).xbps" }
. "$_astronaut"

2
satellites/compton-git.sat

@ -12,6 +12,6 @@ make install \
BINDIR="/$dir_prefix/$dir_bindir" \ BINDIR="/$dir_prefix/$dir_bindir" \
MANDIR="/$dir_prefix/$dir_mandir" \ MANDIR="/$dir_prefix/$dir_mandir" \
APPDIR="/$dir_prefix/$dir_datadir/applications" \ 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: # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:

2
satellites/create_ap.sat

@ -9,7 +9,7 @@ header_end
cd "$name-$version" cd "$name-$version"
install -Dm755 -t "$dir_install/$dir_prefix/$dir_bindir" "$name" 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_datadir/bash-completion/$name" bash_completion
install -Dm644 -t "$dir_install/$dir_prefix/$dir_docdir/$name" README.md install -Dm644 -t "$dir_install/$dir_prefix/$dir_docdir/$name" README.md

7
satellites/ffmpeg.sat

@ -16,10 +16,11 @@ cd "$name-$version"
--enable-libvorbis \ --enable-libvorbis \
--prefix="/$dir_prefix" \ --prefix="/$dir_prefix" \
--bindir="/$dir_prefix/$dir_bindir" \ --bindir="/$dir_prefix/$dir_bindir" \
--libdir="/$dir_prefix/$dir_libdir" \
--datadir="/$dir_prefix/$dir_datadir/$name" \ --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
make DESTDIR="$dir_install" install make DESTDIR="$dir_install" install

21
satellites/functions/compile/cmake.sh

@ -16,16 +16,17 @@ compile_cmake() {
cmake "$olddir" \ cmake "$olddir" \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/$dir_prefix" \ -DCMAKE_INSTALL_PREFIX="/$dir_prefix" \
-DCMAKE_INSTALL_SYSCONFDIR="$dir_sysconfdir" \ -DCMAKE_INSTALL_FULL_SYSCONFDIR="/$dir_prefix/$dir_sysconfdir" \
-DCMAKE_INSTALL_BINDIR="$dir_bindir" \ -DCMAKE_INSTALL_FULL_BINDIR="/$dir_prefix/$dir_bindir" \
-DCMAKE_INSTALL_SBINDIR="$dir_sbindir" \ -DCMAKE_INSTALL_FULL_SBINDIR="/$dir_prefix/$dir_sbindir" \
-DCMAKE_INSTALL_LIBDIR="$dir_libdir" \ -DCMAKE_INSTALL_FULL_LIBEXECDIR="/$dir_prefix/$dir_libexecdir" \
-DCMAKE_INSTALL_LIBEXECDIR="$dir_libexecdir" \ -DCMAKE_INSTALL_FULL_LIBDIR="/$dir_prefix/$dir_libdir" \
-DCMAKE_INSTALL_DATADIR="$dir_datadir" \ -DCMAKE_INSTALL_FULL_INCLUDEDIR="/$dir_prefix/$dir_includedir" \
-DCMAKE_INSTALL_MANDIR="$dir_mandir" \ -DCMAKE_INSTALL_FULL_DATADIR="/$dir_prefix/$dir_datadir" \
-DCMAKE_INSTALL_DOCDIR="$dir_docdir/$name" \ -DCMAKE_INSTALL_FULL_MANDIR="/$dir_prefix/$dir_mandir" \
-DCMAKE_INSTALL_INFODIR="$dir_infodir" \ -DCMAKE_INSTALL_FULL_DOCDIR="/$dir_prefix/$dir_docdir/$name" \
-DCMAKE_INSTALL_LOCALEDIR="$dir_localedir" \ -DCMAKE_INSTALL_FULL_INFODIR="/$dir_prefix/$dir_infodir" \
-DCMAKE_INSTALL_FULL_LOCALEDIR="/$dir_prefix/$dir_localedir" \
"$@" "$@"
make make
[ "$noinstall" = false ] && make DESTDIR="$dir_install" install [ "$noinstall" = false ] && make DESTDIR="$dir_install" install

9
satellites/functions/compile/configure.sh

@ -31,16 +31,17 @@ compile_configure() {
"$olddir/configure" \ "$olddir/configure" \
--prefix="/$dir_prefix" \ --prefix="/$dir_prefix" \
--sysconfdir="/$dir_sysconfdir" \
--bindir="/$dir_prefix/$dir_bindir" \ --bindir="/$dir_prefix/$dir_bindir" \
--sbindir="/$dir_prefix/$dir_sbindir" \ --sbindir="/$dir_prefix/$dir_sbindir" \
--libdir="/$dir_prefix/$dir_libdir" \
--libexecdir="/$dir_prefix/$dir_libexecdir" \ --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" \ --datadir="/$dir_prefix/$dir_datadir" \
--mandir="/$dir_prefix/$dir_mandir" \
--docdir="/$dir_prefix/$dir_docdir/$name" \
--infodir="/$dir_prefix/$dir_infodir" \ --infodir="/$dir_prefix/$dir_infodir" \
--localedir="/$dir_prefix/$dir_localedir" \ --localedir="/$dir_prefix/$dir_localedir" \
--mandir="/$dir_prefix/$dir_mandir" \
--docdir="/$dir_prefix/$dir_docdir/$name" \
$build $cross "$@" $build $cross "$@"
[ "$nomake" = false ] && make $makeflags [ "$nomake" = false ] && make $makeflags

4
satellites/i3status.sat

@ -13,14 +13,14 @@ cd "$name-$version"
patch -p0 -i "../$name-$version-optional-pulseaudio.patch" patch -p0 -i "../$name-$version-optional-pulseaudio.patch"
# Fix install directories # Fix paths
sed -i -e "/install -m/s/bin/$(safe_sed "$dir_bindir")/" \ sed -i -e "/install -m/s/bin/$(safe_sed "$dir_bindir")/" \
-e "/install -m/s/share\/man/$(safe_sed "$dir_mandir")/" Makefile -e "/install -m/s/share\/man/$(safe_sed "$dir_mandir")/" Makefile
make WITH_PULSEAUDIO=$(option pulseaudio && echo yes || echo no) make WITH_PULSEAUDIO=$(option pulseaudio && echo yes || echo no)
make install \ make install \
PREFIX="/$dir_prefix" \ PREFIX="/$dir_prefix" \
SYSCONFDIR="/$dir_sysconfdir" \ SYSCONFDIR="/$dir_prefix/$dir_sysconfdir" \
DESTDIR="$dir_install" DESTDIR="$dir_install"
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:

3
satellites/lua.sat

@ -9,7 +9,7 @@ header_end
cd "$name-$version" cd "$name-$version"
# Fix paths in luaconf.h # Fix paths
sed -i -e "/LUA_ROOT/s/usr\/local/$(safe_sed "$dir_prefix")/" \ sed -i -e "/LUA_ROOT/s/usr\/local/$(safe_sed "$dir_prefix")/" \
-e "/LUA_LDIR/s/share/$(safe_sed "$dir_datadir")/" \ -e "/LUA_LDIR/s/share/$(safe_sed "$dir_datadir")/" \
-e "/LUA_CDIR/s/lib/$(safe_sed "$dir_libdir")/" src/luaconf.h -e "/LUA_CDIR/s/lib/$(safe_sed "$dir_libdir")/" src/luaconf.h
@ -23,6 +23,7 @@ make install \
INSTALL_TOP="$PWD/install" \ INSTALL_TOP="$PWD/install" \
INSTALL_BIN="\$(INSTALL_TOP)/$dir_bindir" \ INSTALL_BIN="\$(INSTALL_TOP)/$dir_bindir" \
INSTALL_LIB="\$(INSTALL_TOP)/$dir_libdir" \ INSTALL_LIB="\$(INSTALL_TOP)/$dir_libdir" \
INSTALL_INC="\$(INSTALL_TOP)/$dir_includedir" \
INSTALL_MAN="\$(INSTALL_TOP)/$dir_mandir/man1" \ INSTALL_MAN="\$(INSTALL_TOP)/$dir_mandir/man1" \
INSTALL_LMOD="\$(INSTALL_TOP)/$dir_datadir/$majver" \ INSTALL_LMOD="\$(INSTALL_TOP)/$dir_datadir/$majver" \
INSTALL_CMOD="\$(INSTALL_TOP)/$dir_libdir/$majver" INSTALL_CMOD="\$(INSTALL_TOP)/$dir_libdir/$majver"

3
satellites/luajit.sat

@ -16,6 +16,7 @@ make install \
MULTILIB="$dir_libdir" \ MULTILIB="$dir_libdir" \
INSTALL_BIN="\$(DPREFIX)/$dir_bindir" \ INSTALL_BIN="\$(DPREFIX)/$dir_bindir" \
INSTALL_SHARE="\$(DPREFIX)/$dir_datadir" \ 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: # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:

5
satellites/mpv.sat

@ -10,10 +10,11 @@ header_end
cd "$name-$version" cd "$name-$version"
compile_waf -- \ 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" \ --mandir="/$dir_prefix/$dir_mandir" \
--docdir="/$dir_prefix/$dir_docdir/$name" \ --docdir="/$dir_prefix/$dir_docdir/$name" \
--datadir="/$dir_prefix/$dir_datadir" \
--enable-zsh-comp --enable-zsh-comp
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:

8
satellites/python3.sat

@ -14,9 +14,11 @@ cd "$name-$version"
# Fix paths # Fix paths
sed -i -e "/os.path.join(prefix/s/lib/$(safe_sed "$dir_libdir")/" Lib/site.py 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/" \ 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 -e "s/\/include\/python/$(safe_sed "/$dir_includedir/python")/" \
sed -i -e "/libpython =/!b;n;s/lib/$(safe_sed "$dir_libdir")/" Lib/distutils/sysconfig.py -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 "/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 "/SCRIPTDIR=/s/lib/$(safe_sed "$dir_libdir")/" Makefile.pre.in
sed -i -e "/LIBPL=/s/lib/$(safe_sed "$dir_libdir")/" configure sed -i -e "/LIBPL=/s/lib/$(safe_sed "$dir_libdir")/" configure

8
satellites/qt5-base.sat

@ -28,11 +28,11 @@ for opt in $optional_libraries; do
done 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). # 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" \ -prefix "/$dir_prefix" \
-libdir "/$dir_prefix/$dir_libdir" \ -libdir "/$dir_prefix/$dir_libdir" \
-headerdir "/$dir_prefix/include/$name" \ -headerdir "/$dir_prefix/$dir_includedir/$name" \
-sysconfdir "/$dir_sysconfdir/xdg" \ -sysconfdir "/$dir_prefix/$dir_sysconfdir/xdg" \
-datadir "/$dir_prefix/$dir_datadir/$name" \ -datadir "/$dir_prefix/$dir_datadir/$name" \
-bindir "/$dir_prefix/$dir_libdir/$name/bin" \ -bindir "/$dir_prefix/$dir_libdir/$name/bin" \
-archdatadir "/$dir_prefix/$dir_libdir/$name" \ -archdatadir "/$dir_prefix/$dir_libdir/$name" \
@ -52,7 +52,7 @@ make
make INSTALL_ROOT="$dir_install" install make INSTALL_ROOT="$dir_install" install
mkdir -p "$dir_install/$dir_prefix/$dir_bindir" 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" ln -s "../$dir_libdir/$name/bin/$bin" "$dir_install/$dir_prefix/$dir_bindir/$bin-$name"
done done

2
satellites/qt5-tools.sat

@ -15,7 +15,7 @@ cd "qt$submodule-opensource-src-$version"
compile_qt 5 compile_qt 5
mkdir -p "$dir_install/$dir_prefix/$dir_bindir" 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" ln -s "../$dir_libdir/$name/bin/$bin" "$dir_install/$dir_prefix/$dir_bindir/$bin-$name"
done done

6
satellites/rt8192cu-git.sat

@ -10,9 +10,9 @@ header_end
kver="$(option =kver)" kver="$(option =kver)"
cd "$name" 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 -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" install -Dm644 blacklist-dkms-8192cu.conf "$dir_install/$dir_prefix/$dir_sysconfdir/modprobe.d/$name.conf"
echo 'blacklist rtl8xxxu' >> "$dir_install/$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: # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:

2
satellites/waf.sat

@ -19,7 +19,7 @@ sed -i -e '/dirname =/s/%s-%s-%s/%s-%s/' \
-e '/dirname =/s/, REVISION//' "$name" -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. # 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" -e "s/'\/lib\/'/'$(safe_sed "/$dir_libdir/")'/" "$name"
# Fix the shebang to point to python3 # Fix the shebang to point to python3

5
satellites/yajl.sat

@ -16,9 +16,10 @@ sed -i -e '/yajl_s/d' \
-e '/COMMAND ${CMAKE_COMMAND}/d' src/CMakeLists.txt -e '/COMMAND ${CMAKE_COMMAND}/d' src/CMakeLists.txt
find . -name "CMakeLists.txt" -exec sed -i -e '/TARGET_LINK_LIBRARIES/s/yajl_s/yajl/' '{}' \; 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")\"/" \ 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")\"/" \ sed -i -e "/DESTINATION/s/bin/\"$(safe_sed "$dir_bindir")\"/" \
verify/CMakeLists.txt reformatter/CMakeLists.txt verify/CMakeLists.txt reformatter/CMakeLists.txt

4
satellites/zim.sat

@ -12,8 +12,8 @@ cd "$name-$version"
# Shitty method to fix setup.py for paths # Shitty method to fix setup.py for paths
safe_datadir="$(safe_sed "$dir_datadir")" safe_datadir="$(safe_sed "$dir_datadir")"
sed -i -e "s/share/$safe_datadir/g" setup.py sed -i -e "s/share/$safe_datadir/g" \
sed -i -e "s/$safe_datadir\/man/$(safe_sed "$dir_mandir")/g" setup.py -e "s/$safe_datadir\/man/$(safe_sed "$dir_mandir")/g" setup.py
compile_python 2 --skip-xdg-cmd compile_python 2 --skip-xdg-cmd

2
todo.txt

@ -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.
Loading…
Cancel
Save