pspdev / psp-packages

https://pspdev.github.io/psp-packages/
The Unlicense
19 stars 13 forks source link

Generate repository index pages #155

Closed tpimh closed 1 week ago

tpimh commented 4 weeks ago

Perhaps a simple table listing all the packages can be generated similar to https://archlinux.org/packages/

Every package can have it's own page like this: https://archlinux.org/packages/extra/x86_64/ppsspp/

Since psp-packages is so much smaller than ArchLinux, the pages can be much simpler. For the table we can only keep "Name", "Version", "Description", "Last Updated".

sharkwouter commented 4 weeks ago

This would kind of fit to my idea to switch to github-pages for hosting packages instead of doing endless releases.

sharkwouter commented 3 weeks ago

Okay, we've now transitioned to hosting on GitHub Pages, so we could integrate this now. It would have to be a solution that spits out static html, though. We cannot host a back-end on GitHub Pages.

tpimh commented 3 weeks ago

Here is my initial take on it:

#!/bin/bash

PSPBUILD_LIST=$(find . -name "PSPBUILD" | sort)

echo "| Name | Version | Description | Last Updated |"
echo "|------|---------|-------------|--------------|"

for PSPBUILD in $PSPBUILD_LIST;
do
    source "${PSPBUILD}"
    UPDATED=$(git log -1 --format=%cd --date=short -- "${PSPBUILD}")
    echo "| ${pkgname} | ${pkgver}-${pkgrel} | ${pkgdesc} | ${UPDATED} |"
done

It outputs markdown, but it can easily be modified (or postprocessed) for HTML output.

Here is an example output:

Name Version Description Last Updated
angelscript 2.28.2-1 A game-oriented interpreted compiled scripting language library 2021-12-23
argtable2 13-2 Argtable is an ANSI C library for parsing GNU style command line options with a minimum of fuss 2024-05-22
bzip2 1.0.8-3 A high-quality data compression library 2023-01-24
cjson 1.7.16-1 Ultralightweight JSON parser in ANSI C. 2023-07-13
curl 7.64.1-7 A library for transferring data with URL syntax 2023-03-31
dumb 2.0.3-2 Dynamic Universal Music Bibliotheque - DUMB - Module/tracker based music format parser and player library 2024-06-05
enet 1.3.18-1 ENet reliable UDP networking library 2024-05-24
expat 2.4.1-3 XML parsing C library 2023-01-25
freetype2 2.11.0-3 a freely available software library to render fonts 2023-01-25
glm 0.9.9-1 OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications. 2024-02-10
googletest 1.14.0-1 GoogleTest - Google Testing and Mocking Framework 2024-06-05
harfbuzz 8.5.0-1 OpenType text shaping engine 2024-06-05
jpeg 3.0.3-4 a free library for JPEG image compression 2024-05-18
jsoncpp 1.9.5-2 a C++ library for interacting with JSON 2023-01-25
kubridge 20220827-1 a bridging library to provide Kernel functions for PSPs in User Mode 2022-08-28
leptonica 1.84.1-1 An open source C library for efficient image processing and image analysis operations 2024-06-10
libbulletml 0.0.5-2 Bullet Markup Language for PSP 2023-08-16
libconfuse 3.3-3 Small configuration file parser library for C 2024-05-19
libeigen 3.4.0-1 C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms 2024-06-05
libintrafont 4.0-1 A bitmap font library using the PSP's internal fonts (firmware pgf and bwfon files) 2021-12-06
libmad 0.15.1-3 MPEG audio decoder library for PSP 2024-05-20
libmikmod 3.3.11.1-4 a portable sound library capable of playing samples as well as module files 2023-01-26
libmodplug 0.8.8.5-1 libmodplug - the library which was part of the Modplug-xmms project 2022-01-02
libogg 1.3.5-2 library for the multimedia container format, and the native file and stream format ogg 2023-01-26
libpng 1.6.43-5 libpng is the official PNG reference library 2024-05-22
libpspexploit 1.2-3 LibPspExploit is a library that allows creating OFW-compatible homebrew with kernel access. 2024-05-20
libpspvram r11.885fd3f-1 Dynamic VRAM allocation manager for the PSP 2023-06-27
libun7zip 19.00-2 A library that provides 7-Zip (.7z) archive handling and extraction 2023-07-06
libvorbis 1.3.7-2 Vorbis audio compression reference implementation 2023-01-27
libxmp-lite 4.6.0-1 Libxmp is a library that renders module files to PCM data 2023-07-06
libxmp 4.5.0-2 Libxmp is a library that renders module files to PCM data 2023-01-26
libyaml 0.2.5-1 LibYAML is a YAML parser and emitter library 2021-11-15
libzip 1.9.2-1 libzip is a C library for reading, creating, and modifying zip archives. 2023-03-14
lua51 5.1.5-1 Lua programming language for PSP 2022-01-02
lua 5.2-2 Lua programming language for PSP 2023-08-17
mbedtls 2.16.12-1 Secure Socket Layer library 2024-05-30
mini18n 0.2.1-1 mini18n is a translation library under GNU GPL. 2023-10-03
minizip 3.0.4-2 fork of the popular zip manipulation library found in the zlib distribution 2024-05-22
openal 1.23.1-1 a cross-platform 3D audio API 2024-06-05
opentri r7.95b040d-4 openTRI is a game engine for the PSP 2024-05-22
pixman 0.40.0-4 Pixman is a low-level software library for pixel manipulation 2024-05-22
pocketpy 1.4.5-1 Python interpreter for game scripting 2024-06-08
pspgl r12-2 OpenGL-ESish library for PSP 2023-08-17
pspirkeyb r1-2 a library for using IRDA keyboards with Playstation Portable 2023-08-17
pspla 2.2.0-1 A VFPU accelerated linear algebra & quaternion library for PSP 2024-06-10
pspuart r14.9bb4add-1 Library for PSP UART hardware communication (ex SioDriver) 2024-06-02
sdl2-gfx 1.0.4-2 SDL2 graphics drawing primitives and other support functions 2023-01-27
sdl2-image 2.6.3-3 a simple library to load images of various formats as SDL surfaces 2024-06-08
sdl2-mixer 2.6.3-7 an audio mixer library based on the SDL2 library 2024-06-08
sdl2-net 2.2.0-2 a wrapper over TCP/IP sockets 2024-06-08
sdl2 2.30.2-4 a library designed to provide low level access to audio, input, and graphics hardware 2024-06-09
sdl2-ttf 2.20.2-3 a companion library to SDL2 for working with TrueType (tm) fonts 2024-06-03
sdl-gfx 2.0.26-2 SDL graphics drawing primitives and other support functions 2023-01-27
sdl-image 1.2.13-4 a simple library to load images of various formats as SDL2 surfaces 2024-06-03
sdl-mixer 1.2.14-5 an audio mixer library based on the SDL library 2024-06-03
sdl-net 1.2.9-1 a wrapper over TCP/IP sockets 2024-05-30
sdl 1.2.15-4 a library designed to provide low level access to audio, input, and graphics hardware 2024-06-03
sdl-ttf 2.0.11-4 a companion library to SDL for working with TrueType (tm) fonts 2024-06-03
smpeg 0.4.5-2 a free MPEG1 video player library with sound support 2021-12-23
sqlite 3.7.4-3 SQLite is a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine 2024-05-22
squirrel 3.1.0-1 Runtime libraries for the Squirrel programming language 2021-12-23
theora 1.2.0git-2 Standard encoder and decoder library for the Theora video compression format 2024-05-19
tremor 1.2.1git-1 Integer-only, fully Ogg Vorbis compliant software decoder library 2024-06-04
wolfssl 5.7.0-2 The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3! 2024-06-05
yaml-cpp 0.8.0git-1 A YAML parser and emitter in C++ 2024-02-26
zlib 1.3.1-3 Compression library implementing the deflate compression method found in gzip and PKZIP 2024-05-21
zziplib 0.13.76-1 provides read access to zipped files in a zip-archive 2024-06-13
sharkwouter commented 3 weeks ago

That looks pretty good. I think I'd convert it to an html table. Then we can use envsubst to put it into an html template.

sharkwouter commented 2 weeks ago

This should work:

#!/bin/bash

PSPBUILD_LIST=$(find . -name "PSPBUILD" | sort)

echo "<table>"
echo "<tr><th>Name</th><th>Version</th><th>Description</th><th>Last Updated</th></tr>"

for PSPBUILD in $PSPBUILD_LIST;
do
    source "${PSPBUILD}"
    UPDATED=$(git log -1 --format=%cd --date=short -- "${PSPBUILD}")
    URL="${pkgname}-${pkgver}-${pkgrel}-${arch}.pkg.tar.gz"
    echo "<tr><td><a href=\"${URL}\">${pkgname}</a></td><td>${pkgver}-${pkgrel}</td><td>${pkgdesc}</td><td>${UPDATED}</td></tr>"
done
echo "</table>"
tpimh commented 2 weeks ago

Looks neat. Instead of linking directly to the packages, I would prefer to generate individual pages for each package.

This is what I came up with so far (mostly mimicking arch linux package pages):

package_page() {
  echo "# ${pkgname} ${pkgver}-${pkgrel}"
  echo "Architecture: ${arch}"
  echo "Description: ${pkgdesc}"
  echo "Upstream URL: ${url}"
  echo "License: ${license}"

  FILENAME="${pkgname}/${pkgname}-${pkgver}-${pkgrel}-${arch}.pkg.tar.gz"
  GZSTATS="$(gzip -l $FILENAME | tail -n 1 | tr -s ' ')"
  PKGSIZE=$(echo $GZSTATS | cut -d ' ' -f 1 | numfmt --to=iec --suffix=B --format="%.2f")
  INSTSIZE=$(echo $GZSTATS | cut -d ' ' -f 2 | numfmt --to=iec --suffix=B --format="%.2f")

  echo "Package Size: ${PKGSIZE}"
  echo "Installed Size: ${INSTSIZE}"

  echo "## Dependencies"
  for DEP in $depends; do
    echo "- ${DEP}"
  done

  CONTENTS=$(tar tzf $FILENAME | grep -v '\.BUILDINFO\|\.MTREE\|\.PKGINFO')

  echo "## Package Contents"
  for FILE in $CONTENTS; do
    echo "- ${FILE}"
  done
}
tpimh commented 1 week ago

@sharkwouter maybe add a link to the index page to the repo description which says "No description, website, or topics provided." now?

sharkwouter commented 1 week ago

@fjtrujy could you add the link to https://pspdev.github.io/psp-packages/ to the about part of the GitHub repo? I don't have the right to do so

sharkwouter commented 1 week ago

This has now been added, thanks @fjtrujy!

fjtrujy commented 1 week ago

Anytime!