Browse Source

Ensure ash compatibility

master
mid-kid 8 years ago
parent
commit
cff049357d
  1. 4
      astronaut/astrohelp
  2. 31
      astronaut/astronaut
  3. 4
      astronaut/astronautpkg
  4. 4
      astronaut/pacman-astronaut
  5. 4
      astronaut/xbps-astronaut
  6. 2
      satellites/devkitarm.sat
  7. 10
      satellites/functions/compile/cmake.sh
  8. 20
      satellites/functions/compile/configure.sh
  9. 9
      satellites/functions/compile/perl.sh
  10. 4
      satellites/functions/compile/waf.sh
  11. 8
      satellites/functions/vcs/git.sh
  12. 4
      satellites/functions/vcs/svn.sh
  13. 3
      satellites/icedtea.sat
  14. 4
      satellites/lua.sat
  15. 11
      satellites/markdown.sat
  16. 2
      satellites/palemoon-umatrix.sat
  17. 2
      satellites/radare2.sat
  18. 4
      satellites/wine.sat

4
astronaut/astrohelp

@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/sh
set -e
# Helper functions for programs that work with satellite files.
show_help() {

31
astronaut/astronaut

@ -1,4 +1,5 @@
#!/bin/sh -e
#!/bin/sh
set -e
# Configuration
@ -34,12 +35,12 @@ cmd_download='curl -# -L -o {dst} {src}' # Command to execute to download files
cmd_extract='tar -x -C {dst} -f {src}' # Command to execute to extract files
# If we can't find the satellite file, we'll look in this directory for it.
unset dir_satellites
dir_satellites=
# Options are comma-separated and parsed from front to back.
# This means that in '!opt,someotheropt,opt', opt is disabled.
unset options # The least-priority global options
options= # The least-priority global options
package_options() { :; } # Per-package options function.
# Example for package_options:
# package_options() {
@ -57,8 +58,14 @@ package_options() { :; } # Per-package options function.
download_only=false
_vcs_only=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
_user_options= # Options specified in the command line get the highest priority
_sat_options= # Options defined by the satellite
# Should be specified in the satellite
name=
version=
update_url=
vcs_compile=false
# Check if running from a wrapper
if [ "$(basename "$0")" != "astronaut" ]; then
@ -69,12 +76,6 @@ else
_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.
@ -141,7 +142,7 @@ while getopts "h?s:b:i:p:IcCdvo:" opt; do
esac
done
shift $((OPTIND-1))
shift $(expr $OPTIND - 1)
[ "$1" = "--" ] && shift
if [ ! "$1" ]; then
@ -164,7 +165,7 @@ download() {
[ "$3" ] && local filename="$3" || local filename="$(basename $(echo "$1" | cut -d? -f1))"
local path="$dir_source/$name/$filename"
[ "$2" -a -f "$path" ] && local checksum="$(_mksum "$path")"
[ "$2" -a -f "$path" ] && local checksum="$(_mksum "$path")" || true
if [ ! -e "$path" -o "$checksum" != "$2" ]; then
_msg "Downloading $filename"
@ -193,7 +194,7 @@ getfile() {
extrafile() {
local dir="$(dirname "$_satellite")"
[ -d "$dir/extrafiles" ] && local dir="$dir/extrafiles/$name"
[ -d "$dir/extrafiles" ] && local dir="$dir/extrafiles/$name" || true
cp -a "$dir/$1" "./$1"
}
@ -276,7 +277,7 @@ option() {
"$@"
fi
else
return $([ "$enabled" = true ])
[ "$enabled" = true ]
fi
}

4
astronaut/astronautpkg

@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/sh
set -e
# A hacky script to generate .t?z files using satellites.
# It's a fairly simple wrapper to astronaut, that generates pkgtools packages.

4
astronaut/pacman-astronaut

@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/sh
set -e
# A hacky script to generate .pkg.tar.?z files using satellites.
# It's a fairly simple wrapper to astronaut, that generates pacman packages.

4
astronaut/xbps-astronaut

@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/sh
set -e
# A hacky script to generate .xbps files using satellites.
# It's a fairly simple wrapper to astronaut, that generates xbps packages.

2
satellites/devkitarm.sat

@ -54,7 +54,7 @@ EOF
# Install
mkdir -p "$dir_install/$dir_prefix/$dir_libdir/devkitPRO"
cp -a "install/$name" "$dir_install/$dir_prefix/$dir_libdir/devkitPRO"
cp -Ta "install/$name" "$dir_install/$dir_prefix/$dir_libdir/devkitPRO/devkitARM"
# Install environment
cat > devkitarm.sh << EOF

10
satellites/functions/compile/cmake.sh

@ -9,8 +9,8 @@ compile_cmake() {
b) local builddir="$OPTARG" ;;
I) local noinstall=true ;;
esac; done
shift $((OPTIND-1))
[ "$1" = '--' ] && shift
shift $(expr $OPTIND - 1)
[ "$1" = '--' ] && shift || true
mkdir -p "$builddir"; cd "$builddir"
cmake "$olddir" \
@ -29,6 +29,10 @@ compile_cmake() {
-DCMAKE_INSTALL_FULL_LOCALEDIR="/$dir_prefix/$dir_localedir" \
"$@"
make
[ "$noinstall" = false ] && make DESTDIR="$dir_install" install
if [ "$noinstall" = false ]; then
make DESTDIR="$dir_install" install
fi
cd "$olddir"
}

20
satellites/functions/compile/configure.sh

@ -16,8 +16,8 @@ compile_configure() {
M) local nomake=true ;;
I) local noinstall=true ;;
esac; done
shift $((OPTIND-1))
[ "$1" = '--' ] && shift
shift $(expr $OPTIND - 1)
[ "$1" = '--' ] && shift || true
if [ "$builddir" ]; then
mkdir -p "$builddir"
@ -25,9 +25,9 @@ compile_configure() {
fi
local cross="$(option =cross)"
[ "$cross" ] && local cross="--host=$cross"
[ "$cross" ] && local cross="--host=$cross" || true
local build="$(option =build)"
[ "$build" ] && local build="--build=$build"
[ "$build" ] && local build="--build=$build" || true
"$olddir/configure" \
--prefix="/$dir_prefix" \
@ -44,8 +44,14 @@ compile_configure() {
--docdir="/$dir_prefix/$dir_docdir/$name" \
$build $cross "$@"
[ "$nomake" = false ] && make $makeflags
[ "$nomake" = false -a "$noinstall" = false ] && make DESTDIR="$dir_install" $makeflags install
if [ "$nomake" = false ]; then
make $makeflags
if [ "$noinstall" = false ]; then
make DESTDIR="$dir_install" $makeflags install
fi
fi
[ "$builddir" ] && cd "$olddir" || true
if [ "$builddir" ]; then
cd "$olddir"
fi
}

9
satellites/functions/compile/perl.sh

@ -6,8 +6,8 @@ compile_perl() {
while getopts 'I' opt; do case "$opt" in
I) local noinstall=true ;;
esac; done
shift $((OPTIND-1))
[ "$1" = '--' ] && shift
shift $(expr $OPTIND - 1)
[ "$1" = '--' ] && shift || true
perl Build.PL --create_packlist=0 \
--prefix="/$dir_prefix" \
@ -19,5 +19,8 @@ compile_perl() {
--install_path libdoc="/$dir_prefix/$dir_mandir/man3" \
"$@"
./Build
[ "$noinstall" = false ] && ./Build install || true
if [ "$noinstall" = false ]; then
./Build install
fi
}

4
satellites/functions/compile/waf.sh

@ -6,8 +6,8 @@ compile_waf() {
while getopts 'b:' opt; do case "$opt" in
b) local binary="$OPTARG" ;;
esac; done
shift $((OPTIND-1))
[ "$1" = '--' ] && shift
shift $(expr $OPTIND - 1)
[ "$1" = '--' ] && shift || true
$binary configure build install \
--prefix="/$dir_prefix" \

8
satellites/functions/vcs/git.sh

@ -10,8 +10,8 @@ vcs_git() {
V) local setver=false ;;
C) local clone=false ;;
esac; done
shift $((OPTIND-1))
[ "$1" = '--' ] && shift
shift $(expr $OPTIND - 1)
[ "$1" = '--' ] && shift || true
local reponame="$(basename "$1")"
local dir="$dir_source/$name/$reponame"
@ -59,8 +59,8 @@ vcs_git_clone() {
while getopts 'r:' opt; do case "$opt" in
r) local rev="$OPTARG" ;;
esac; done
shift $((OPTIND-1))
[ "$1" = '--' ] && shift
shift $(expr $OPTIND - 1)
[ "$1" = '--' ] && shift || true
local reponame="$(basename "$1")"
local dir="$dir_source/$name/$reponame"

4
satellites/functions/vcs/svn.sh

@ -6,8 +6,8 @@ vcs_svn() {
while getopts 'r:' opt; do case "$opt" in
r) local revision="-r $OPTARG" ;;
esac; done
shift $((OPTIND-1))
[ "$1" = '--' ] && shift
shift $(expr $OPTIND - 1)
[ "$1" = '--' ] && shift || true
local reponame="$(basename "$1")"
local dir="$dir_source/$name/$reponame"

3
satellites/icedtea.sat

@ -69,10 +69,9 @@ header_end
# From: https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/multiprocessing.eclass
makeopts_jobs() {
[[ $# -eq 0 ]] && set -- ${MAKEFLAGS}
# This assumes the first .* will be more greedy than the second .*
# since POSIX doesn't specify a non-greedy match (i.e. ".*?").
local jobs=$(echo " $* " | sed -r -n \
local jobs=$(echo " $MAKEFLAGS " | sed -r -n \
-e 's:.*[[:space:]](-j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p' \
-e 's:.*[[:space:]](-j|--jobs)[[:space:]].*:999:p')
echo ${jobs:-1}

4
satellites/lua.sat

@ -48,7 +48,7 @@ rm "install/$dir_bindir/luac"
cc src/luac.o src/lopcodes.o src/ldump.o "install/$dir_libdir/liblua.so" $libs -o "install/$dir_bindir/luac"
# Actually install
mkdir -p "$dir_install/$dir_prefix"
cp -a install/* "$dir_install/$dir_prefix/"
mkdir -p "$dir_install"
cp -Ta install "$dir_install/$dir_prefix"
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:

11
graveyard/unmaintained_satellites/markdown.sat → satellites/markdown.sat

@ -1,14 +1,15 @@
name=Markdown
version=1.0.1
update_url="https://daringfireball.net/projects/markdown/"
update_url='https://daringfireball.net/projects/markdown/'
download "https://daringfireball.net/projects/downloads/${name}_$version.zip" \
"f17b3c2b2830c6fd2fe0098226e59a2f"
'f17b3c2b2830c6fd2fe0098226e59a2f'
header_end
# TODO: Support other formats, such as zip, with the extract command.
extract "${name}_$version.zip" "" \
"unzip -qd {dst} {src}"
install -D "${name}_$version/$name.pl" "$dir_install/$dir_prefix/bin/markdown"
extract "${name}_$version.zip" \
'' \
'unzip -qd {dst} {src}'
install -D "${name}_$version/$name.pl" "$dir_install/$dir_prefix/$dir_bindir/markdown"
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:

2
satellites/palemoon-umatrix.sat

@ -16,7 +16,7 @@ cd "$name-$version"
# Update the assets, as that's something not done in uMatrix for some reason
rm -f assets/checksums.txt
cp -a ../uAssets/thirdparties assets
cp -Ta ../uAssets/thirdparties assets/thirdparties
tools/make-firefox.sh all
install -Dm644 "dist/build/$name.firefox.xpi" "$dir_install/$dir_prefix/$dir_libdir/palemoon/browser/extensions/$name@raymondhill.net.xpi"

2
satellites/radare2.sat

@ -10,7 +10,7 @@ update_url='http://rada.re/r/down.html'
update_names="$name-$version.tar.gz\">$name"
dlextract "http://cloud.radare.org/get/$version/$name-$version.tar.gz" \
'122978ad5b9698717c680e422c1daad4'
'17b6de0edf1d4ba772bbb7c98767619e'
extrafile "$name-$version-docdir.patch"
header_end

4
satellites/wine.sat

@ -13,11 +13,11 @@ header_end
cd "$name-$version"
compile_configure -b ../build -- $([ "$(uname -m)" = 'x86_64' ] && echo --enable-win64)
compile_configure -b build -- $([ "$(uname -m)" = 'x86_64' ] && echo --enable-win64)
wine32="$(option =wine32)"
if [ "$(uname -m)" = 'x86_64' -a "$wine32" ]; then
PKG_CONFIG_PATH="$dir_sysroot/$dir_prefix/$wine32/pkgconfig" compile_configure -b ../build-wine32 -- --with-wine64=../build --libdir="/$dir_prefix/$wine32"
PKG_CONFIG_PATH="$dir_sysroot/$dir_prefix/$wine32/pkgconfig" compile_configure -b build-wine32 -- --with-wine64=../build --libdir="/$dir_prefix/$wine32"
fi
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:

Loading…
Cancel
Save