diff --git a/mister-downloader/.gitignore b/mister-downloader/.gitignore new file mode 100644 index 0000000..b01cdc3 --- /dev/null +++ b/mister-downloader/.gitignore @@ -0,0 +1 @@ +Downloader_Mister/ diff --git a/mister-downloader/PKGBUILD b/mister-downloader/PKGBUILD new file mode 100644 index 0000000..d0c6d64 --- /dev/null +++ b/mister-downloader/PKGBUILD @@ -0,0 +1,36 @@ +# Downloader_MiSTer +# Maintainer: Alexandru M Stan + +# This would normally have a -git suffix to conform to Arch guidelines, +# but upstream's release process involves auto-updating to the latest version +# every execution anyway, so it's not like there exists a non "-git" version, +# so let's just simplify the name! + +buildarch=4 + +pkgname=mister-downloader +pkgver=r112.gc02ec68 +pkgrel=1 +pkgdesc="Tool to install and update all the cores and other extra files for your MiSTer" +arch=('any') # This can be installed on x86 arch too! +url='https://github.com/MiSTer-devel/Downloader_MiSTer' +_repo_name=Downloader_MiSTer +license=('GPL3') +depends=("zip" "unzip" "curl") +source=("git+https://github.com/MiSTer-devel/Downloader_MiSTer.git" + "mister-downloader") +sha256sums=('SKIP' + '3f3257b96a879e234fb9f79515679df4f2a79e7a18fe936327e1399cb20bf56e') + +pkgver() { + cd "$srcdir/$_repo_name" + git describe --long --tags | sed 's/^latest-//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +package() { + install -D "$_repo_name/src/__main__.py" -t "${pkgdir}/usr/lib/mister-downloader" + cp -r "$_repo_name/src/downloader/" "${pkgdir}/usr/lib/mister-downloader" + + install -Dm755 mister-downloader -t "${pkgdir}/usr/bin/" + sed -i "s/INSERT_pkgver_HERE/$pkgver/g" "${pkgdir}/usr/bin/mister-downloader" +} diff --git a/mister-downloader/mister-downloader b/mister-downloader/mister-downloader new file mode 100644 index 0000000..8078a33 --- /dev/null +++ b/mister-downloader/mister-downloader @@ -0,0 +1,24 @@ +#!/bin/bash +# MiSTerArch wrapper for Downloader_MiSTer +# We're going to call __main__.py directly and not call upstream's download.sh +# or dontdownload.sh so we bypass the meta updater updating. + +if [ $# == 0 ]; then + echo "Usage: $0 base_path [tags]" + echo "* base_path: location you want to install stuff in, perhaps /media/fat/" + echo "* tags: filter what to download. See https://github.com/MiSTer-devel/Distribution_MiSTer#tags-that-you-may-use-with-download-filters-feature" + exit 1 +fi + +export COMMIT="misterarch-INSERT_pkgver_HERE" + +export DEFAULT_BASE_PATH="$1" +export DEBUG=true # Allows us to use non /media/ paths + +export CURL_SSL="" # on Arch curl has sane SSL defaults, no need to override them + +export UPDATE_LINUX=false # Managed by pacman +export ALLOW_REBOOT=0 # This decision needs to happen at a higher level/user + +shift +DOWNLOADER_INI_PATH=<(echo "[mister]"; echo "filter=$@ !essential !linux") /usr/lib/mister-downloader/__main__.py