diff --git a/astronaut/astrohelp b/astronaut/astrohelp index 9cdb8b4..26953cf 100755 --- a/astronaut/astrohelp +++ b/astronaut/astrohelp @@ -7,7 +7,8 @@ Usage: $0 [arguments] Functions: variable | Get variable set in the header -downloads | Get all download urls" +downloads | Get all download urls +options | List all available options and their descriptions" } if [ $# -lt 2 ]; then @@ -18,6 +19,13 @@ fi satellite="$(realpath "$1")" function="$2" +# Functions reused in different wrappers +func_import=$(printf ' + import() { + . "%s/functions/$1.sh" + } +' "$(dirname "$satellite")") + if [ "$function" = "variable" ]; then name="$3" if [ ! "$name" ]; then @@ -25,7 +33,7 @@ if [ "$function" = "variable" ]; then exit 1 fi - printf ' + printf "$func_import"' header_end() { variable="$%s" [ "$variable" ] && echo "$variable" @@ -34,7 +42,7 @@ if [ "$function" = "variable" ]; then . %s ' "$name" "$satellite" | PATH= /bin/sh 2> /dev/null elif [ "$function" = "downloads" ]; then - printf ' + printf "$func_import"' download() { [ "$1" ] && echo "$1" } @@ -47,6 +55,14 @@ elif [ "$function" = "downloads" ]; then header_end() { exit 0; } . %s ' "$satellite" | PATH= /bin/sh 2> /dev/null +elif [ "$function" = "options" ]; then + printf "$func_import"' + define_option() { + echo "$1" + } + header_end() { exit 0; } + . %s + ' "$satellite" | PATH= /bin/sh 2> /dev/null else show_help exit 1 diff --git a/astronaut/astronaut b/astronaut/astronaut index 62be10b..1607592 100755 --- a/astronaut/astronaut +++ b/astronaut/astronaut @@ -3,9 +3,9 @@ # Configuration # Build/install-time directories -dir_build='/var/tmp/astronaut/build' # Temporary directory to build packages -dir_source='/var/tmp/astronaut/source' # Directory where the package sources will be placed -dir_install='/var/tmp/astronaut/install' # Directory where the package will be installed +dir_build='/tmp/astronaut/build' # Temporary directory to build packages +dir_source='/tmp/astronaut/source' # Directory where the package sources will be placed +dir_install='/tmp/astronaut/install' # Directory where the package will be installed # The source directory will have subdirs for each different $name, # specified inside the satellite file. # The $dir_install variable will have '{pkg}' replaced with $_satname, @@ -243,7 +243,7 @@ option() { if [ "$option" = "$check" ]; then if [ "$variable" = true -a "$option_variable" = false ]; then - _msg 'Tip: Define the option as option=value.' + _msg 'Tip: Define the option as option=value.' 1>&2 _exiterr "Satellite requested a variable option, but there was no value for option: '$option'." fi @@ -254,7 +254,7 @@ option() { done if [ "$found" = false ]; then - _msg 'Tip: Make sure to define every option you use in the satellite.' + _msg 'Tip: Make sure to define every option you use in the satellite.' 1>&2 _exiterr "Option '$check' was nowhere to be found." fi diff --git a/astronaut/astronautpkg b/astronaut/astronautpkg index 60f8da5..234f599 100755 --- a/astronaut/astronautpkg +++ b/astronaut/astronautpkg @@ -20,10 +20,13 @@ _nuke_dir_install=true . "$_astronaut" # Gzip man and info pages -[ -d "$dir_install/$dir_prefix/$dir_mandir" ] && gzip -9 -r "$dir_install/$dir_prefix/$dir_mandir" +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 [ -d "$dir_install/$dir_prefix/$dir_infodir" ] && gzip -9 -r "$dir_install/$dir_prefix/$dir_infodir" # _dir_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" -PATH=$PATH:/sbin "$_fakeroot" makepkg -l y -c n "$dir_wrapper_pkgtools/$name-$version-$(uname -m)-astro.tgz" +PATH=$PATH:/sbin "$_fakeroot" makepkg -l y -c n "$dir_wrapper_pkgtools/$_satname-$version-$(uname -m)-astro.tgz" diff --git a/graveyard/unmaintained_satellites/minitube.sat b/graveyard/unmaintained_satellites/minitube.sat index cbc82b9..184bfdc 100644 --- a/graveyard/unmaintained_satellites/minitube.sat +++ b/graveyard/unmaintained_satellites/minitube.sat @@ -1,4 +1,4 @@ -import "compile/qt" +import 'compile/qt' name=minitube version=2.5.2 @@ -6,10 +6,10 @@ update_url="https://github.com/flaviotordini/$name/releases" update_names="archive/$version.tar.gz" dlextract "https://github.com/flaviotordini/$name/archive/$version.tar.gz" \ - "9545f0e9bf70bcb648b25af4813338cb" + '9545f0e9bf70bcb648b25af4813338cb' header_end cd "$name-$version" -compile_qt 5 DEFINES+="APP_GOOGLE_API_KEY=AIzaSyBzMj41taMuHLAF95-y9cTXL4JpPGqMORk" # API key provided by Gottox (https://raw.githubusercontent.com/voidlinux/void-packages/master/srcpkgs/minitube/template) +compile_qt 5 DEFINES+='APP_GOOGLE_API_KEY=AIzaSyBzMj41taMuHLAF95-y9cTXL4JpPGqMORk' # API key provided by Gottox (https://raw.githubusercontent.com/voidlinux/void-packages/master/srcpkgs/minitube/template) # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/bam-0.4.sat b/satellites/bam-0.4.sat new file mode 100644 index 0000000..bb56c81 --- /dev/null +++ b/satellites/bam-0.4.sat @@ -0,0 +1,19 @@ +# NOTE: This program includes lua 5.1 in it's source code. Due to how it's built, it's hard to link it against the system libs instead. + +name=bam +version=0.4.0 +update_url="https://matricks.github.io/$name/" + +dlextract "http://github.com/downloads/matricks/$name/$name-$version.tar.bz2" \ + 'f8b62ad553c3615a725a034df4fb4257' +header_end + +cd "$name-$version" + +# Allow for custom cflags +sed -i -e "s/-rdynamic/& $(safe_sed "$CFLAGS")/" make_unix.sh + +./make_unix.sh +install -Dm755 "$name" "$dir_install/$dir_prefix/$dir_bindir/$name-0.4" + +# vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/bam.sat b/satellites/bam.sat new file mode 100644 index 0000000..b14b54e --- /dev/null +++ b/satellites/bam.sat @@ -0,0 +1,19 @@ +name=bam +version=0.5.0 +update_url="https://github.com/matricks/$name/releases" + +dlextract "https://github.com/matricks/$name/archive/v$version.tar.gz" \ + '08db8dfc32fb817947c39000092a55d4' +header_end + +cd "$name-$version" +# Fix parallel make +cat >> Makefile << EOF +src/internal_base.h: src/tools/txt2c +src/main.o: src/internal_base.h +EOF + +make +install -Dm755 "$name" "$dir_install/$dir_prefix/$dir_bindir/$name" + +# vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/graveyard/unmaintained_satellites/broadcom-wl.sat b/satellites/broadcom-wl.sat similarity index 100% rename from graveyard/unmaintained_satellites/broadcom-wl.sat rename to satellites/broadcom-wl.sat diff --git a/satellites/extrafiles/teeworlds/teeworlds.desktop b/satellites/extrafiles/teeworlds/teeworlds.desktop new file mode 100644 index 0000000..ec8b77c --- /dev/null +++ b/satellites/extrafiles/teeworlds/teeworlds.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=Teeworlds +Comment=A retro multiplayer shooter +Exec=teeworlds +Icon=teeworlds +Terminal=false +Categories=Game;ArcadeGame; diff --git a/satellites/fakeroot.sat b/satellites/fakeroot.sat index 36596a7..139b39a 100644 --- a/satellites/fakeroot.sat +++ b/satellites/fakeroot.sat @@ -1,18 +1,23 @@ import 'compile/configure' name=fakeroot -version=1.21 +version=1.20.2 +#version=1.21 update_url="http://http.debian.net/debian/pool/main/f/$name/" -dlextract "http://http.debian.net/debian/pool/main/f/$name/${name}_$version.orig.tar.gz" \ - 'be5c9a0e516869fca4a6758105968e5a' +dlextract "http://http.debian.net/debian/pool/main/f/$name/${name}_$version.orig.tar.bz2" \ + 'a4b4564a75024aa96c86e4d1017ac786' +#dlextract "http://http.debian.net/debian/pool/main/f/$name/${name}_$version.orig.tar.gz" \ + #'be5c9a0e516869fca4a6758105968e5a' header_end -cd "$name-$version/doc" -po4a -k 0 --rm-backups --variable 'srcdir=../doc/' po4a/po4a.cfg -cd .. +cd "$name-$version" -./bootstrap -compile_configure --disable-static +#cd doc +#po4a -k 0 --rm-backups --variable 'srcdir=../doc/' po4a/po4a.cfg +#cd .. + +#./bootstrap +compile_configure -- --disable-static # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/functions/compile/configure.sh b/satellites/functions/compile/configure.sh index 61f3f8d..bb2933b 100644 --- a/satellites/functions/compile/configure.sh +++ b/satellites/functions/compile/configure.sh @@ -1,5 +1,33 @@ +define_option 'cross=: Cross compile a program to run on the specified target triplet.' +define_option "build=: Explicity specify the host machine's target triplet." + compile_configure() { - ./configure \ + local builddir="" + local noinstall=false + local olddir="$PWD" + local makeflags="" + + local OPTIND=1 + local opt + while getopts "b:c:m:I" opt; do case "$opt" in + b) local builddir="$OPTARG" ;; + I) local noinstall=true ;; + m) local makeflags="$OPTARG" ;; + esac; done + shift $((OPTIND-1)) + [ "$1" = "--" ] && shift + + if [ "$builddir" ]; then + mkdir -p "$builddir" + cd "$builddir" + fi + + local cross="$(option =cross)" + [ "$cross" ] && local cross="--host=$cross" + local build="$(option =build)" + [ "$build" ] && local build="--build=$build" + + "$olddir/configure" \ --prefix="/$dir_prefix" \ --sysconfdir="/$dir_sysconfdir" \ --bindir="/$dir_prefix/$dir_bindir" \ @@ -11,7 +39,10 @@ compile_configure() { --docdir="/$dir_prefix/$dir_docdir/$name" \ --infodir="/$dir_prefix/$dir_infodir" \ --localedir="/$dir_prefix/$dir_localedir" \ - $@ - make - make DESTDIR="$dir_install/" install + $build $cross $@ + + make $makeflags + [ "$noinstall" = false ] && make DESTDIR="$dir_install" $makeflags install + + [ "$builddir" ] && cd "$olddir" || true } diff --git a/satellites/functions/compile/python.sh b/satellites/functions/compile/python.sh index a9cd020..c98f4db 100644 --- a/satellites/functions/compile/python.sh +++ b/satellites/functions/compile/python.sh @@ -1,4 +1,4 @@ compile_python() { local ver="$1"; shift - python$ver setup.py install --prefix="/$dir_prefix" --root="$dir_install" $@ + python$ver setup.py install --prefix="/$dir_prefix" --root="$dir_install" --optimize=2 $@ } diff --git a/satellites/functions/compile/qt.sh b/satellites/functions/compile/qt.sh index 733da26..8314279 100644 --- a/satellites/functions/compile/qt.sh +++ b/satellites/functions/compile/qt.sh @@ -1,6 +1,23 @@ compile_qt() { local ver="$1"; shift - qmake-qt$ver PREFIX="/$dir_prefix" build_mode=release build_type=shared $@ + + $(compile_qt_get_cmd qmake "$ver") PREFIX="/$dir_prefix" build_mode=release build_type=shared $@ make make INSTALL_ROOT="$dir_install" install } + +compile_qt_get_cmd() { + local cmd="$1"; shift + local ver="$1" + + # Some machines don't have cmd-qt4, and use cmd instead. + if [ "$ver" = "4" ]; then + if command -v "$cmd-qt$ver" > /dev/null; then + echo "$cmd-qt$ver" + else + echo "$cmd" + fi + else + echo "$cmd-qt$ver" + fi +} diff --git a/satellites/functions/compile/qt5source.sh b/satellites/functions/compile/qt5source.sh deleted file mode 100644 index 98cb88b..0000000 --- a/satellites/functions/compile/qt5source.sh +++ /dev/null @@ -1,15 +0,0 @@ -compile_qt5source() { - ./configure -v -confirm-license -opensource \ - -prefix "/$dir_prefix" \ - -libdir "/$dir_prefix/$dir_libdir" \ - -headerdir "/$dir_prefix/include/qt5" \ - -sysconfdir "/$dir_sysconfdir/xdg" \ - -datadir "/$dir_prefix/$dir_datadir/qt5" \ - -bindir "/$dir_prefix/$dir_libdir/qt5/bin" \ - -archdatadir "/$dir_prefix/$dir_libdir/qt5" \ - -docdir "/$dir_prefix/$dir_docdir/qt5" \ - -examplesdir "/$dir_prefix/$dir_docdir/qt5/examples" \ - $@ - make - make INSTALL_ROOT="$dir_install" install -} diff --git a/satellites/libtorrent-rasterbar.sat b/satellites/libtorrent-rasterbar.sat new file mode 100644 index 0000000..26349f6 --- /dev/null +++ b/satellites/libtorrent-rasterbar.sat @@ -0,0 +1,18 @@ +import 'compile/configure' + +name=libtorrent-rasterbar +version=1.1.0 +update_url='https://github.com/arvidn/libtorrent/releases' + +dlextract "https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_1/$name-$version.tar.gz" \ + '3a291044b5b33fec3e30b22a94fda31f' +header_end + +cd "$name-$version" + +# Fix compilation error with qBittorrent (https://github.com/qbittorrent/qBittorrent/issues/5265#issuecomment-220007436) +export CXXFLAGS="$CXXFLAGS -std=c++11" + +compile_configure -- --disable-static --with-libiconv + +# vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/libxkbcommon.sat b/satellites/libxkbcommon.sat index 5197a6b..bb22ea0 100644 --- a/satellites/libxkbcommon.sat +++ b/satellites/libxkbcommon.sat @@ -9,6 +9,6 @@ dlextract "http://xkbcommon.org/download/$name-$version.tar.xz" \ header_end cd "$name-$version" -compile_configure --disable-static +compile_configure -- --disable-static # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/lua.sat b/satellites/lua.sat index 95cf4fd..a85273a 100644 --- a/satellites/lua.sat +++ b/satellites/lua.sat @@ -1,24 +1,53 @@ -# TODO: Install shared library, remove static library. - name=lua majver=5.3 version=$majver.3 update_url="http://www.lua.org/download.html" dlextract "http://www.lua.org/ftp/$name-$version.tar.gz" \ - "703f75caa4fdf4a911c1a72e67a27498" + '703f75caa4fdf4a911c1a72e67a27498' header_end cd "$name-$version" + +# Fix paths in luaconf.h +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 + make linux \ MYLIBS="-lncurses" \ - MYCFLAGS="$CFLAGS" + MYCFLAGS="$CFLAGS -fPIC" \ + MYLDFLAGS="$LDFLAGS" make install \ - INSTALL_TOP="$dir_install/$dir_prefix" \ - INSTALL_BIN="$dir_install/$dir_prefix/$dir_bindir" \ - INSTALL_LIB="$dir_install/$dir_prefix/$dir_libdir" \ - INSTALL_MAN="$dir_install/$dir_prefix/$dir_mandir" \ - INSTALL_CMOD="$dir_install/$dir_prefix/$dir_libdir/$majver" + INSTALL_TOP="$PWD/install" \ + INSTALL_BIN="\$(INSTALL_TOP)/$dir_bindir" \ + INSTALL_LIB="\$(INSTALL_TOP)/$dir_libdir" \ + INSTALL_MAN="\$(INSTALL_TOP)/$dir_mandir/man1" \ + INSTALL_LMOD="\$(INSTALL_TOP)/$dir_datadir/$majver" \ + INSTALL_CMOD="\$(INSTALL_TOP)/$dir_libdir/$majver" + +# Check the build log to find this +libs="-lm -Wl,-E -ldl -lreadline -lncurses" + +# Build the shared library +( cd "install/$dir_libdir" + ar x liblua.a + rm liblua.a + cc -shared "-Wl,-soname,liblua.so.$majver" *.o $libs -o "liblua.so.$version" + rm *.o + ln -s "liblua.so.$version" "liblua.so.$majver" + ln -s "liblua.so.$version" liblua.so +) + +# Link the binary against the shared library +rm "install/$dir_bindir/lua" +gcc src/lua.o "install/$dir_libdir/liblua.so" $libs -o "install/$dir_bindir/lua" +rm "install/$dir_bindir/luac" +gcc 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/" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/nxengine.sat b/satellites/nxengine.sat index 495b3a3..5cf1b51 100644 --- a/satellites/nxengine.sat +++ b/satellites/nxengine.sat @@ -10,9 +10,9 @@ dlextract "http://nxengine.sourceforge.net/dl/nx-src-$version.tar.bz2" \ download "http://www.cavestory.org/downloads/cavestoryen.zip" \ '5aad47f1cb72185d6e7f4c8c392f6b6e' -extrafile 'nxengine.sh' -extrafile 'nxengine.desktop' -extrafile 'nxengine.png' +extrafile "$name.sh" +extrafile "$name.desktop" +extrafile "$name.png" header_end extract 'cavestoryen.zip' '' 'unzip -qd {dst} {src}' @@ -29,12 +29,11 @@ sed -i -e '/g++/s/-o/$(CFLAGS) -o/g' nx/Makefile make -C nx # Install the nxengine executable -install -Dm755 nx/nx "$dir_install/$dir_prefix/$dir_libdir/nxengine/nx" +install -Dm755 nx/nx "$dir_install/$dir_prefix/$dir_libdir/$name/nx" # Install the necessary data -mkdir -p "$dir_install/$dir_prefix/share/nxengine" -install -m644 nx/font.ttf nx/smalfont.bmp nx/sprites.sif nx/tilekey.dat CaveStory/Doukutsu.exe "$dir_install/$dir_prefix/share/nxengine/" -cp -r CaveStory/data "$dir_install/$dir_prefix/share/nxengine/data" +install -Dm644 -t "$dir_install/$dir_prefix/$dir_datadir/$name" nx/font.ttf nx/smalfont.bmp nx/sprites.sif nx/tilekey.dat CaveStory/Doukutsu.exe +cp -a CaveStory/data "$dir_install/$dir_prefix/$dir_datadir/$name/data" # Install the run script # Where the files will be copied to on runtime. @@ -44,10 +43,10 @@ sed -i -e "s/%PREFIX%/$(safe_sed "$dir_prefix")/" \ -e "s/%LIBDIR%/$(safe_sed "$dir_libdir")/" \ -e "s/%DATADIR%/$(safe_sed "$dir_datadir")/" \ nxengine.sh -install -Dm755 nxengine.sh "$dir_install/$dir_prefix/$dir_bindir/nxengine" +install -Dm755 "$name.sh" "$dir_install/$dir_prefix/$dir_bindir/$name" # Install desktop file and icon -install -Dm644 nxengine.png "$dir_install/$dir_prefix/share/pixmaps/nxengine.png" -install -Dm644 nxengine.desktop "$dir_install/$dir_prefix/share/applications/nxengine.desktop" +install -Dm644 "$name.png" "$dir_install/$dir_prefix/$dir_datadir/pixmaps/$name.png" +install -Dm644 "$name.desktop" "$dir_install/$dir_prefix/$dir_datadir/applications/$name.desktop" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/p7zip.sat b/satellites/p7zip.sat new file mode 100644 index 0000000..0ae7002 --- /dev/null +++ b/satellites/p7zip.sat @@ -0,0 +1,25 @@ +name=p7zip +version=16.02 +update_url="https://sourceforge.net/projects/$name/files/$name/" +update_names="> unetbootin.pro << EOF +QMAKE_CXXFLAGS += \$\$(CXXFLAGS) +QMAKE_CFLAGS += \$\$(CFLAGS) +QMAKE_LFLAGS += \$\$(LDFLAGS) +EOF + +$(compile_qt_get_cmd lupdate 4) unetbootin.pro +$(compile_qt_get_cmd lrelease 4) unetbootin.pro +compile_qt 4 + +# Install the program +install -Dm755 "$name" "$dir_install/$dir_prefix/$dir_bindir/$name" + +# Install the translations +install -Dm644 -t "$dir_install/$dir_prefix/$dir_datadir/$name" "$name"_*.qm + +# Fix the desktop file +sed -i -e "/Exec=/cExec=$name" "$name.desktop" + +# Install the desktop file and icons +install -Dm644 "$name.desktop" "$dir_install/$dir_prefix/$dir_datadir/applications/$name.desktop" +for x in 16 22 24 32 48 64 128 192 256 512; do + install -Dm644 "${name}_$x.png" "$dir_install/$dir_prefix/$dir_datadir/icons/hicolor/${x}x$x/apps/$name.png" +done +install -Dm644 "${name}_icons.svg" "$dir_install/$dir_prefix/$dir_datadir/icons/scalable/apps/$name.svg" + +# vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/volumeicon.sat b/satellites/volumeicon.sat index d695ed3..78ef3f9 100644 --- a/satellites/volumeicon.sat +++ b/satellites/volumeicon.sat @@ -10,6 +10,6 @@ header_end cd "$name-$version" sed -i -e 's/-DCOMPILEWITH_NOTIFY/ &/' ./configure -compile_configure --enable-notify +compile_configure -- --enable-notify # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/zim.sat b/satellites/zim.sat new file mode 100644 index 0000000..8979823 --- /dev/null +++ b/satellites/zim.sat @@ -0,0 +1,20 @@ +import 'compile/python' + +name=zim +version=0.65 +update_url='http://zim-wiki.org/downloads/' + +dlextract "http://zim-wiki.org/downloads/$name-$version.tar.gz" \ + '63ab7a2070e6d1d3fb32700a851d7b8b' +header_end + +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 + +compile_python 2 --skip-xdg-cmd + +# vim:set tabstop=4 shiftwidth=4 syntax=sh et: