Skip to content

Commit

Permalink
WIP: mister-downloader wrapping
Browse files Browse the repository at this point in the history
BUG=#20
  • Loading branch information
amstan committed May 4, 2022
1 parent a0cb01d commit 5bc12d6
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions mister-downloader/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Downloader_Mister/
36 changes: 36 additions & 0 deletions mister-downloader/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Downloader_MiSTer
# Maintainer: Alexandru M Stan <[email protected]>

# 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"
}
24 changes: 24 additions & 0 deletions mister-downloader/mister-downloader
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5bc12d6

Please sign in to comment.