diff --git a/astronaut/astronaut b/astronaut/astronaut index ac4dcd3..836df3e 100755 --- a/astronaut/astronaut +++ b/astronaut/astronaut @@ -4,7 +4,8 @@ dir_build="$PWD/build" # Temporary directory to build packages dir_source="$PWD/source" # Directory where the package sources will be placed dir_install="$PWD/install" # Directory where the package will be installed -prefix="/usr" # Prefix directory +dir_sysroot="/" # The root dir (Used for dirs like etc and var) +dir_prefix="$dir_sysroot/usr" # Prefix directory 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 enable_check=true # Run the test suite of packages @@ -30,6 +31,7 @@ Usage: $0 [-sbip ] [-IcCd] -s Set source directory -i Set install directory -p Set prefix directory +-r Set root directory -I Nuke install directory before build -c/C Enable/Disable package checking -d Only download package files @@ -62,7 +64,10 @@ while getopts "h?s:b:i:p:IcCdv" opt; do dir_install="$(realpath "$OPTARG")" ;; p) - prefix="$(realpath "$OPTARG")" + dir_prefix="$(realpath "$OPTARG")" + ;; + r) + dir_sysroot="$(realpath "$OPTARG")" ;; I) _nuke_dir_install=true diff --git a/astronaut/hello.sat b/astronaut/hello.sat index 7007a38..80bfbab 100644 --- a/astronaut/hello.sat +++ b/astronaut/hello.sat @@ -17,7 +17,8 @@ vcs_compile=true # Set this to true if it's a vcs package, and we've just downl # - dir_source (This is handled by the commands detailed below. You should have no use for it.) # "Look, but don't touch"-variables: # - dir_install -# - prefix +# - dir_prefix +# - dir_sysroot # "You'll only make your own life more difficult if you use them wrong, so I don't care what you do"-variables: # (Only use these to change the behaviour of some commands over the whole script.) # - cmd_download @@ -60,7 +61,7 @@ extract "$name-$version.tar.gz" \ # Compilation instructions cd "$name-$version" -./configure --prefix="$prefix" +./configure --prefix="$dir_prefix" make # Know if the user wants the package to be checked diff --git a/astronaut/template.sat b/astronaut/template.sat index 602a118..e2ff2c3 100644 --- a/astronaut/template.sat +++ b/astronaut/template.sat @@ -10,7 +10,7 @@ header_end cd "$name-$version" -./configure --prefix="$prefix" +./configure --prefix="$dir_prefix" make do_check make check make DESTDIR="$dir_install" install diff --git a/satellites/astronaut.sat b/satellites/astronaut.sat index e8f573b..e949f23 100644 --- a/satellites/astronaut.sat +++ b/satellites/astronaut.sat @@ -6,8 +6,8 @@ extrafile "freshnaut" extrafile "xbps-astronaut" header_end -install -D "astronaut" "$dir_install/$prefix/bin/astronaut" -install -D "freshnaut" "$dir_install/$prefix/bin/freshnaut" -install -D "xbps-astronaut" "$dir_install/$prefix/bin/xbps-astronaut" +install -D "astronaut" "$dir_install/$dir_prefix/bin/astronaut" +install -D "freshnaut" "$dir_install/$dir_prefix/bin/freshnaut" +install -D "xbps-astronaut" "$dir_install/$dir_prefix/bin/xbps-astronaut" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/bin/ctrulib.sat b/satellites/bin/ctrulib.sat index da7bf94..d78709c 100644 --- a/satellites/bin/ctrulib.sat +++ b/satellites/bin/ctrulib.sat @@ -7,7 +7,7 @@ download "https://sourceforge.net/projects/devkitpro/files/$libname/$version/$li "2dffb7826ae3d30a32c9ad773b133a07" header_end -mkdir -p "$dir_install/opt/devkitPRO/$libname" -extract "$libname-$version.tar.bz2" "$dir_install/opt/devkitPRO/$libname" +mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO/$libname" +extract "$libname-$version.tar.bz2" "$dir_install/$dir_sysroot/opt/devkitPRO/$libname" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/bin/default_arm7.sat b/satellites/bin/default_arm7.sat index d32e9e2..6f643fe 100644 --- a/satellites/bin/default_arm7.sat +++ b/satellites/bin/default_arm7.sat @@ -7,7 +7,7 @@ download "https://sourceforge.net/projects/devkitpro/files/default arm7/$version "20e3af0f65066cad9a2b948aa5cfd17f" header_end -mkdir -p "$dir_install/opt/devkitPRO/$libname" -extract "$name-$version.tar.bz2" "$dir_install/opt/devkitPRO/$libname" +mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO/$libname" +extract "$name-$version.tar.bz2" "$dir_install/$dir_sysroot/opt/devkitPRO/$libname" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/bin/devkitarm.sat b/satellites/bin/devkitarm.sat index f107080..be00486 100644 --- a/satellites/bin/devkitarm.sat +++ b/satellites/bin/devkitarm.sat @@ -7,8 +7,9 @@ download "https://sourceforge.net/projects/devkitpro/files/$name/${name}_$versio extrafile "devkitarm.sh" header_end -mkdir -p "$dir_install/opt/devkitPRO" -extract "${name}_$version-x86_64-linux.tar.bz2" "$dir_install/opt/devkitPRO" -install -Dm644 devkitarm.sh "$dir_install/etc/profile.d/devkitarm.sh" +mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO" +extract "${name}_$version-x86_64-linux.tar.bz2" "$dir_install/$dir_sysroot/opt/devkitPRO" +sed -i -e "s@%SYSROOT%@$dir_sysroot@g" devkitarm.sh +install -Dm644 devkitarm.sh "$dir_install/$dir_sysroot/etc/profile.d/devkitarm.sh" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/bin/extrafiles/devkitarm/devkitarm.sh b/satellites/bin/extrafiles/devkitarm/devkitarm.sh index ee53818..6443e16 100644 --- a/satellites/bin/extrafiles/devkitarm/devkitarm.sh +++ b/satellites/bin/extrafiles/devkitarm/devkitarm.sh @@ -1,3 +1,3 @@ -export DEVKITPRO=/opt/devkitPRO +export DEVKITPRO="%SYSROOT%/opt/devkitPRO" export DEVKITARM="$DEVKITPRO/devkitARM" export PATH="$DEVKITARM/bin:$PATH" diff --git a/satellites/bin/libfat-nds.sat b/satellites/bin/libfat-nds.sat index 6c3f6a9..7eb2e14 100644 --- a/satellites/bin/libfat-nds.sat +++ b/satellites/bin/libfat-nds.sat @@ -7,7 +7,7 @@ download "https://sourceforge.net/projects/devkitpro/files/libfat/$version/$name "cc1712a56c8b0c133974936c69599f0e" header_end -mkdir -p "$dir_install/opt/devkitPRO/$libname" -extract "$name-$version.tar.bz2" "$dir_install/opt/devkitPRO/$libname" +mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO/$libname" +extract "$name-$version.tar.bz2" "$dir_install/$dir_sysroot/opt/devkitPRO/$libname" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/bin/libnds.sat b/satellites/bin/libnds.sat index f48821d..f0af70a 100644 --- a/satellites/bin/libnds.sat +++ b/satellites/bin/libnds.sat @@ -6,7 +6,7 @@ download "https://sourceforge.net/projects/devkitpro/files/$name/$version/$name- "5928642ff152cf692d8e7167d0e1332b" header_end -mkdir -p "$dir_install/opt/devkitPRO/$name" -extract "$name-$version.tar.bz2" "$dir_install/opt/devkitPRO/$name" +mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO/$name" +extract "$name-$version.tar.bz2" "$dir_install/$dir_sysroot/opt/devkitPRO/$name" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/bin/palemoon.sat b/satellites/bin/palemoon.sat index cf848b1..f3fd6a9 100644 --- a/satellites/bin/palemoon.sat +++ b/satellites/bin/palemoon.sat @@ -7,18 +7,18 @@ download "https://linux.palemoon.org/files/$version/$name-$version.en-US.linux-x extrafile "palemoon.desktop" header_end -mkdir -p "$dir_install/opt" "$dir_install/$prefix/bin" "$dir_install/$prefix/share/applications" \ - "$dir_install/$prefix/share/icons/hicolor/16x16/apps" \ - "$dir_install/$prefix/share/icons/hicolor/32x32/apps" \ - "$dir_install/$prefix/share/icons/hicolor/48x48/apps" \ - "$dir_install/$prefix/share/icons/hicolor/128x128/apps" \ +mkdir -p "$dir_install/$dir_sysroot/opt" "$dir_install/$dir_prefix/bin" "$dir_install/$dir_prefix/share/applications" \ + "$dir_install/$dir_prefix/share/icons/hicolor/16x16/apps" \ + "$dir_install/$dir_prefix/share/icons/hicolor/32x32/apps" \ + "$dir_install/$dir_prefix/share/icons/hicolor/48x48/apps" \ + "$dir_install/$dir_prefix/share/icons/hicolor/128x128/apps" \ -extract "$name-$version.en-US.linux-x86_64.tar.bz2" "$dir_install/opt" -ln -s "/opt/$name/$name" "$dir_install/$prefix/bin/$name" -ln -s "/opt/$name/browser/chrome/icons/default/default16.png" "$dir_install/$prefix/share/icons/hicolor/16x16/apps/$name.png" -ln -s "/opt/$name/browser/chrome/icons/default/default32.png" "$dir_install/$prefix/share/icons/hicolor/32x32/apps/$name.png" -ln -s "/opt/$name/browser/chrome/icons/default/default48.png" "$dir_install/$prefix/share/icons/hicolor/48x48/apps/$name.png" -ln -s "/opt/$name/browser/icons/mozicon128.png" "$dir_install/$prefix/share/icons/hicolor/128x128/apps/$name.png" -cp "palemoon.desktop" "$dir_install/$prefix/share/applications/palemoon.desktop" +extract "$name-$version.en-US.linux-x86_64.tar.bz2" "$dir_install/$dir_sysroot/opt" +ln -s "$dir_sysroot/opt/$name/$name" "$dir_install/$dir_prefix/bin/$name" +ln -s "$dir_sysroot/opt/$name/browser/chrome/icons/default/default16.png" "$dir_install/$dir_prefix/share/icons/hicolor/16x16/apps/$name.png" +ln -s "$dir_sysroot/opt/$name/browser/chrome/icons/default/default32.png" "$dir_install/$dir_prefix/share/icons/hicolor/32x32/apps/$name.png" +ln -s "$dir_sysroot/opt/$name/browser/chrome/icons/default/default48.png" "$dir_install/$dir_prefix/share/icons/hicolor/48x48/apps/$name.png" +ln -s "$dir_sysroot/opt/$name/browser/icons/mozicon128.png" "$dir_install/$dir_prefix/share/icons/hicolor/128x128/apps/$name.png" +cp "palemoon.desktop" "$dir_install/$dir_prefix/share/applications/palemoon.desktop" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/bin/unetbootin.sat b/satellites/bin/unetbootin.sat index 361cdd9..f633486 100644 --- a/satellites/bin/unetbootin.sat +++ b/satellites/bin/unetbootin.sat @@ -6,6 +6,6 @@ dlfile "https://launchpad.net/$name/trunk/$version/+download/$name-linux64-$vers "d5d1cddc144fc64d8291c33ebd4f457b" header_end -install -D $name-linux64-$version.bin "$dir_install/$prefix/bin/$name" +install -D $name-linux64-$version.bin "$dir_install/$dir_prefix/bin/$name" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/functions/compile/cmake.sh b/satellites/functions/compile/cmake.sh index 409e205..4b2f026 100644 --- a/satellites/functions/compile/cmake.sh +++ b/satellites/functions/compile/cmake.sh @@ -1,6 +1,6 @@ compile_cmake_base() { mkdir -p build; cd build - cmake -DCMAKE_INSTALL_PREFIX="$prefix" -DCMAKE_BUILD_TYPE=Release $@ .. + cmake -DCMAKE_INSTALL_PREFIX="$dir_prefix" -DCMAKE_BUILD_TYPE=Release $@ .. make } @@ -12,5 +12,5 @@ compile_cmake() { compile_cmake_installbin() { _func_file="$1"; shift compile_cmake_base $@ - install -D "$_func_file" "$dir_install/$prefix/bin/$_func_file" + install -D "$_func_file" "$dir_install/$dir_prefix/bin/$_func_file" } diff --git a/satellites/functions/compile/python.sh b/satellites/functions/compile/python.sh index a3dc741..72e9eef 100644 --- a/satellites/functions/compile/python.sh +++ b/satellites/functions/compile/python.sh @@ -1,4 +1,4 @@ compile_python() { _func_ver="$1"; shift - python$_func_ver setup.py install --prefix="$prefix" --root="$dir_install" $@ + python$_func_ver setup.py install --prefix="$dir_prefix" --root="$dir_install" $@ } diff --git a/satellites/functions/compile/qt.sh b/satellites/functions/compile/qt.sh index dd500fa..4d211e6 100644 --- a/satellites/functions/compile/qt.sh +++ b/satellites/functions/compile/qt.sh @@ -1,6 +1,6 @@ compile_qt() { _func_ver="$1"; shift - qmake-qt$_func_ver PREFIX="$prefix" build_mode=release build_type=shared $@ + qmake-qt$_func_ver PREFIX="$dir_prefix" build_mode=release build_type=shared $@ make make INSTALL_ROOT="$dir_install" install } diff --git a/satellites/markdown.sat b/satellites/markdown.sat index f80e396..a25042b 100644 --- a/satellites/markdown.sat +++ b/satellites/markdown.sat @@ -9,6 +9,6 @@ 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/$prefix/bin/markdown" +install -D "${name}_$version/$name.pl" "$dir_install/$dir_prefix/bin/markdown" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/vcs/ctr.sat b/satellites/vcs/ctr.sat index 52174fc..2e84bc2 100644 --- a/satellites/vcs/ctr.sat +++ b/satellites/vcs/ctr.sat @@ -7,7 +7,7 @@ header_end getfile vcs; cd vcs -mkdir -p "$dir_install/opt/devkitPRO/devkitARM/arm-none-eabi/include" "$dir_install/opt/devkitPRO/devkitARM/arm-none-eabi/lib" -make DEVKITARM="$dir_install/opt/devkitPRO/devkitARM" install +mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/include" "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/lib" +make DEVKITARM="$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM" install # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/vcs/ctrff.sat b/satellites/vcs/ctrff.sat index 228fb7b..2cfec78 100644 --- a/satellites/vcs/ctrff.sat +++ b/satellites/vcs/ctrff.sat @@ -7,7 +7,7 @@ header_end getfile vcs; cd vcs -mkdir -p "$dir_install/opt/devkitPRO/devkitARM/arm-none-eabi/include" "$dir_install/opt/devkitPRO/devkitARM/arm-none-eabi/lib" -make DEVKITARM="$dir_install/opt/devkitPRO/devkitARM" install +mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/include" "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/lib" +make DEVKITARM="$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM" install # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/vcs/ctrtool.sat b/satellites/vcs/ctrtool.sat index 480b28c..00b8825 100644 --- a/satellites/vcs/ctrtool.sat +++ b/satellites/vcs/ctrtool.sat @@ -8,6 +8,6 @@ header_end getfile vcs; cd vcs/ctrtool make -install -D ctrtool "$dir_install/$prefix/bin/ctrtool" +install -D ctrtool "$dir_install/$dir_prefix/bin/ctrtool" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/vcs/ctrulib-git.sat b/satellites/vcs/ctrulib-git.sat index afc530c..a25945e 100644 --- a/satellites/vcs/ctrulib-git.sat +++ b/satellites/vcs/ctrulib-git.sat @@ -7,6 +7,6 @@ header_end getfile vcs; cd vcs/libctru -make DEVKITPRO="$dir_install/opt/devkitPRO" install +make DEVKITPRO="$dir_install/$dir_sysroot/opt/devkitPRO" install # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/vcs/letsencrypt.sat b/satellites/vcs/letsencrypt.sat index 23c0522..df56a8c 100644 --- a/satellites/vcs/letsencrypt.sat +++ b/satellites/vcs/letsencrypt.sat @@ -7,6 +7,8 @@ vcs_git "https://github.com/letsencrypt/$name" header_end getfile vcs; cd vcs -compile_python 3.4 +compile_python 2 +cd acme +compile_python 2 # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/vcs/makerom.sat b/satellites/vcs/makerom.sat index a8e8e61..a271530 100644 --- a/satellites/vcs/makerom.sat +++ b/satellites/vcs/makerom.sat @@ -8,6 +8,6 @@ header_end getfile vcs; cd vcs/makerom make -install -D makerom "$dir_install/$prefix/bin/makerom" +install -D makerom "$dir_install/$dir_prefix/bin/makerom" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/vcs/neovim-git.sat b/satellites/vcs/neovim-git.sat index eecbe3a..209d281 100644 --- a/satellites/vcs/neovim-git.sat +++ b/satellites/vcs/neovim-git.sat @@ -6,8 +6,8 @@ name=neovim vcs_git "https://github.com/neovim/neovim" header_end -getfile vcs; cd vcs -make CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX='$prefix'" +etfile vcs; cd vcs +make CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX='$dir_prefix'" make DESTDIR="$dir_install" install # vim:set tabstop=4 shiftwidth=4 syntax=sh et: diff --git a/satellites/webfs.sat b/satellites/webfs.sat index 23a4c8e..3e3a853 100644 --- a/satellites/webfs.sat +++ b/satellites/webfs.sat @@ -14,6 +14,6 @@ sed -i -e "s/echo -e/echo/g" mk/Autoconf.mk sed -i -e "s@/etc/mime.types@/dev/null@g" GNUmakefile make -install -D "${name}d" "$dir_install/$prefix/bin/${name}d" +install -D "${name}d" "$dir_install/$dir_prefix/bin/${name}d" # vim:set tabstop=4 shiftwidth=4 syntax=sh et: