fixup! Add ports to the Sortix repository.

This commit is contained in:
Jonas 'Sortie' Termansen 2022-01-30 23:40:03 +01:00
parent c86b3d202d
commit b761560716
3 changed files with 39 additions and 34 deletions

View File

@ -9,26 +9,26 @@ NAME_REGEXP="$(echo "$NAME" | sed -E 's,\+,\\+,g')"
case "$NAME" in
ag)
UPSTREAM_VERSION_PAGE="https://geoff.greer.fm/ag/"
RELEASE_SEARCH_PAGE="https://geoff.greer.fm/ag/"
;;
bochs)
UPSTREAM_VERSION_PAGE="https://sourceforge.net/projects/bochs/files/bochs/"
SEARCH_REGEX="([0-9]+\.[0-9]+(\.[0-9]+)*)/"
RELEASE_SEARCH_PAGE="https://sourceforge.net/projects/bochs/files/bochs/"
RELEASE_SEARCH_REGEX="([0-9]+\.[0-9]+(\.[0-9]+)*)/"
UPSTREAM_SITE_TEMPLATE="https://sourceforge.net/projects/bochs/files/bochs/%v"
;;
e2fsprogs)
UPSTREAM_VERSION_PAGE="https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/"
SEARCH_REGEX="v([0-9]+\.[0-9]+(\.[0-9]+)*)/"
RELEASE_SEARCH_PAGE="https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/"
RELEASE_SEARCH_REGEX="v([0-9]+\.[0-9]+(\.[0-9]+)*)/"
UPSTREAM_SITE_TEMPLATE="https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v%v"
;;
binutils|gcc|grub|libstdc++)
VERSION_REGEX="sortix-$NAME_REGEXP-([0-9]+\.[0-9]+(\.[0-9]+)*(-rc[0-9]+)?)"
VERSION_REGEX="([0-9]+\.[0-9]+(\.[0-9]+)*(-rc[0-9]+)?)"
;;
libcurses)
UPSTREAM_SITE="https://ftp.barfooze.de/pub/sabotage/tarballs"
;;
libevent)
VERSION_REGEX="libevent-([0-9]+\\.[0-9]+(\\.[0-9]+)*-stable)"
VERSION_REGEX="([0-9]+\\.[0-9]+(\\.[0-9]+)*-stable)"
UPSTREAM_SITE_TEMPLATE="https://github.com/libevent/libevent/releases/download/release-%v"
UPSTREAM_ARCHIVE_TEMPLATE="libevent-%v%e"
;;
@ -38,55 +38,60 @@ libexpat)
libjpeg)
UPSTREAM_SITE="https://www.ijg.org/files"
# TODO: The last letter is optional but sort -V before the first release.
VERSION_REGEX="jpegsrc.v([0-9]+[a-z])"
VERSION_REGEX="([0-9]+[a-z])"
RELEASE_REGEX="jpegsrc\.v$VERSION_REGEX"
UPSTREAM_ARCHIVE_TEMPLATE="jpegsrc.v%v%e"
;;
libgmp)
VERSION_REGEX=$(echo "$UPSTREAM_ARCHIVE" |
sed -E 's,([0-9]+\.[0-9]+(\.[0-9]+)*a?)(\.tar.*),([0-9]+\\.[0-9]+(\\.[0-9]+)*a?),')
# TODO: Remove after upgrading past 6.0.0a.
VERSION_REGEX="([0-9]+\.[0-9]+(\.[0-9]+)*a?)"
;;
libpcre)
UPSTREAM_VERSION_PAGE="https://sourceforge.net/projects/pcre/files/pcre/"
SEARCH_REGEX="([0-9]+\.[0-9]+(\.[0-9]+)*)/"
RELEASE_SEARCH_PAGE="https://sourceforge.net/projects/pcre/files/pcre/"
RELEASE_SEARCH_REGEX="([0-9]+\.[0-9]+(\.[0-9]+)*)/"
UPSTREAM_SITE_TEMPLATE="https://sourceforge.net/projects/pcre/files/pcre/%v"
;;
libpng)
UPSTREAM_VERSION_PAGE="http://libpng.org/pub/png/libpng.html"
# TODO: Switch to this upstream site since it also works for older versions.
UPSTREAM_SITE="https://download.sourceforge.net/libpng"
RELEASE_SEARCH_PAGE="http://libpng.org/pub/png/libpng.html"
;;
nasm)
UPSTREAM_VERSION_PAGE="https://www.nasm.us/pub/nasm/releasebuilds/"
SEARCH_REGEX="([0-9]+\.[0-9]+(\.[0-9]+)*)/"
RELEASE_SEARCH_PAGE="https://www.nasm.us/pub/nasm/releasebuilds/"
RELEASE_SEARCH_REGEX="([0-9]+\.[0-9]+(\.[0-9]+)*)/"
UPSTREAM_SITE_TEMPLATE="https://www.nasm.us/pub/nasm/releasebuilds/%v"
;;
nyancat)
UPSTREAM_VERSION_PAGE="https://github.com/klange/nyancat/tags"
RELEASE_SEARCH_PAGE="https://github.com/klange/nyancat/tags"
;;
python)
UPSTREAM_VERSION_PAGE="https://www.python.org/downloads/source/"
SEARCH_REGEX="Python-([0-9]+\.[0-9]+(\.[0-9]+)*)(\.tar(\.(gz|bz2|xz)))"
RELEASE_SEARCH_PAGE="https://www.python.org/downloads/source/"
RELEASE_SEARCH_REGEX="Python-([0-9]+\.[0-9]+(\.[0-9]+)*)(\.tar(\.(gz|bz2|xz)))"
UPSTREAM_SITE_TEMPLATE="https://www.python.org/ftp/python/%v"
;;
esac
# TODO: Inaccurate.
escape_regex() {
echo "$1" | sed -E 's,[\\+*?.{}<>],\\\0,g'
}
TAR_REGEX="(\.tar(\.(gz|bz2|xz)))"
if [ -z "$UPSTREAM_VERSION_PAGE" ]; then
if [ -z "$RELEASE_SEARCH_PAGE" ]; then
case "$UPSTREAM_SITE" in
https://github.com/*/releases/*)
UPSTREAM_VERSION_PAGE=$(echo "$UPSTREAM_SITE" | grep -Eo '.*/releases/');;
*) UPSTREAM_VERSION_PAGE="$UPSTREAM_SITE/";;
RELEASE_SEARCH_PAGE=$(echo "$UPSTREAM_SITE" | grep -Eo '.*/releases/');;
*) RELEASE_SEARCH_PAGE="$UPSTREAM_SITE/";;
esac
fi
if [ -z "$VERSION_REGEX" ]; then
VERSION_REGEX=$(echo "$UPSTREAM_ARCHIVE" |
sed -E 's,([0-9]+\.[0-9]+(\.[0-9]+)*)(\.tar.*),([0-9]+\\.[0-9]+(\\.[0-9]+)*),')
VERSION_REGEX="([0-9]+\.[0-9]+(\.[0-9]+)*)"
fi
if [ -z "$VERSION" ]; then
VERSION=$(echo "$UPSTREAM_ARCHIVE" | sed -E "s,$VERSION_REGEX,\1")
if [ -z "$RELEASE_REGEX" ]; then
RELEASE_REGEX=$(echo "$UPSTREAM_ARCHIVE" |
sed -E 's,\+,\\+,g' |
sed -E "s,$VERSION_REGEX(\.tar.*),$(escape_regex "$VERSION_REGEX"),")
fi
if [ -z "$UPSTREAM_SITE_TEMPLATE" ]; then
@ -98,8 +103,8 @@ if [ -z "$UPSTREAM_ARCHIVE_TEMPLATE" ]; then
sed -E 's,([0-9]+\.[0-9]+(\.[0-9]+)*)(\.tar.*),%v%e,')
fi
if [ -z "$SEARCH_REGEX" ]; then
SEARCH_REGEX="\<$VERSION_REGEX$TAR_REGEX\>"
if [ -z "$RELEASE_SEARCH_REGEX" ]; then
RELEASE_SEARCH_REGEX="\<$RELEASE_REGEX$TAR_REGEX\>"
fi
case "$UPSTREAM_ARCHIVE" in
@ -121,17 +126,17 @@ instantiate() {
# git tag search
LATEST=$(curl -Ls "$UPSTREAM_VERSION_PAGE" | grep -Eo "$SEARCH_REGEX" | sort -Vu | tail -1)
LATEST=$(curl -Ls "$RELEASE_SEARCH_PAGE" | grep -Eo "$RELEASE_SEARCH_REGEX" | sort -Vu | tail -1)
case "$LATEST" in
*.tar) EXTENSION=.tar;;
*.tar.gz) EXTENSION=.tar.gz;;
*.tar.bz2) EXTENSION=.tar.bz2;;
*.tar.xz) EXTENSION=.tar.xz;;
esac
NEW_VERSION="$(echo "$LATEST" | sed -E "s,$SEARCH_REGEX,\1,")"
NEW_VERSION="$(echo "$LATEST" | sed -E "s,$RELEASE_SEARCH_REGEX,\1,")"
if [ -z "$NEW_VERSION" ]; then
echo "\e[91m$UPSTREAM_ARCHIVE failed to find available versions: $NEW_VERSION_REGEX on $UPSTREAM_VERSION_PAGE\e[m"
echo "\e[91m$UPSTREAM_ARCHIVE failed to find available versions: $RELEASE_SEARCH_PAGE | grep -E '$RELEASE_SEARCH_REGEX'\e[m"
exit 1
fi

View File

@ -4,5 +4,5 @@ VERSION='1.5.13'
DISTNAME='libpng-1.5.13'
ARCHIVE='libpng-1.5.13.tar.xz'
SHA256SUM='b843f9cb01d10ae22acd9aaf58aceaa4a6aeb9cf78943b41588004b271257aee'
UPSTREAM_SITE='https://sourceforge.net/projects/libpng/files/libpng15/older-releases/1.5.13'
UPSTREAM_SITE='https://download.sourceforge.net/libpng'
UPSTREAM_ARCHIVE='libpng-1.5.13.tar.xz'

View File

@ -150,7 +150,7 @@ for port in $ports; do
libjpeg) mirrors="https://pub.sortix.org/mirror/libjpeg";;
libogg|libtheora|libvorbis) mirrors="https://ftp.osuosl.org/pub/xiph/releases/$nolib";;
libpcre) mirrors="https://sourceforge.net/projects/pcre/files/pcre/$version";;
libpng) mirrors="https://sourceforge.net/projects/libpng/files/libpng${version_major}${version_minor}/older-releases/$version";;
libpng) mirrors="https://download.sourceforge.net/libpng";;
#libSDL) mirrors="https://www.libsdl.org/release";;
libSDL) mirrors="https://pub.sortix.org/fork/libSDL";;
libssl) mirrors="https://ftp.openbsd.org/pub/OpenBSD/LibreSSL";;