Luke Wilde 87d19dfa28 Ports: Update curl port to version 7.81.0 3 lat temu
..
Another-World c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
SDL2 418d69c0ad Ports: Fix dependencies for SDL2 3 lat temu
SDL2-GNUBoy c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
SDL2_gfx c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
SDL2_image c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
SDL2_mixer 2a85abb15d Ports: Fix dynamic load of libmodplug by SDL2_mixer 3 lat temu
SDL2_net c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
SDL2_ttf c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
SDLPoP c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
SDL_sound 3908753347 Ports: Fix issues with the libmodplug and SDL_sound ports 3 lat temu
Super-Mario c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
angband 02446a5431 Ports: Enable SDL support in Angband 3 lat temu
bash ff1b72c95c Ports: Remove obsolete bash locale patch 3 lat temu
bass c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
bc 5241c5f219 Ports: Enable history handling in bc 3 lat temu
binutils c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
bison c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
brogue c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
byacc 9418d4bf25 Ports/byacc: Remove obsolete getopt.h patch 3 lat temu
bzip2 c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
c-ray c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
carl 5911d379a6 Ports: Update checksums to use the SHA256 algorithm 4 lat temu
chester ff4787ad2d Ports/chester: Enable -Werror 3 lat temu
cmake 39b5bb4162 Ports: Upgrade CMake to 3.22.1 3 lat temu
cmatrix 2b5c377781 Ports/cmatrix: Fix hash and update version 3 lat temu
composer c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
curl 87d19dfa28 Ports: Update curl port to version 7.81.0 3 lat temu
dash c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
dialog c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
diffutils c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
dmidecode c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
doom c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
dos2unix a1580a1d00 dos2unix: Swap to official signature validation 3 lat temu
dosbox-staging 939469c831 Ports: Remove wchar patch from dosbox-staging 3 lat temu
drascula c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
dreamweb c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
dropbear c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
dungeonrush c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
ed c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
emu2 d059bafd8a Ports: Include missing signal.h in emu2 3 lat temu
epsilon c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
ffmpeg 8e6de62d57 Ports: Fix typo in ffmpeg dependencies 3 lat temu
figlet c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
fio 4490668af2 Ports: Add `fio` port 3 lat temu
flatbuffers c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
flex c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
fontconfig c1511ebbea Ports: Add Fontconfig port 3 lat temu
fotaq c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
freeciv c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
freedink 3ce4d0f89a Ports: Add FreeDink port 3 lat temu
freetype c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
frotz c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
gawk c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
gcc 84c6d6649e Toolchain: Fix building the aarch64 toolchain 3 lat temu
gdb e308536005 Ports/gdb: Add basic ptrace based native target for SerenityOS/i386 3 lat temu
genemu c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
gettext c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
git c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
glib d1588dc806 Ports: Add a dependency on pcre to glib 3 lat temu
glm 287bbabbc1 Ports: Add OpenGL Mathematics (GLM) port 3 lat temu
glu 02647fd485 Ports: Add Mesa GLU 3 lat temu
gmp c1d915afe6 Ports: byacc+gmp+m4: Split auth_opts strings into array elements 3 lat temu
gnucobol aea2583cde Ports: gnucobol: Build with ncurses and without NLS 3 lat temu
gnupg c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
gnuplot c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
gperf 2876aebb32 Ports: Add GNU gperf port 3 lat temu
grep c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
griffon c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
gsl c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
harfbuzz c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
hatari c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
imgcat c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
indent c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
jot c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
jq c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
klong 5911d379a6 Ports: Update checksums to use the SHA256 algorithm 4 lat temu
less c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libarchive c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libassuan c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libatomic_ops 9e225d2d05 Ports: Add libatomic_ops 4 lat temu
libexpat c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libffi 37543234ce Ports: Bump libffi from version 3.3 to 3.4.2 4 lat temu
libgcrypt c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libgd e570f9abc5 Ports: Add libgd 3 lat temu
libgpg-error c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libiconv c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libicu a28ad600f2 Ports/libicu: Remove obsolete <cmath> header patch 3 lat temu
libjpeg fa902cd5d5 Ports: Fix the sha256sum for libjpeg 3 lat temu
libksba c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libmodplug 2a85abb15d Ports: Fix dynamic load of libmodplug by SDL2_mixer 3 lat temu
libogg 5293832fc3 Ports: Reinstate `config.sub` patch for `libogg` 3 lat temu
liboggz ea90a1ebac Ports: Add liboggz port 3 lat temu
libopenal c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libphysfs c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libpng c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libpuffy 9b2dd0f3b4 Ports: Fix building libpuffy 4 lat temu
libsixel c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libsodium 37aa75c370 Ports: Use immutable tarballs for libsodium 3 lat temu
libssh2 196bd11743 Ports: Add libssh2 port 3 lat temu
libtheora 20f730dc1c Ports/libtheora: Change download link to mirror with TLS1.2 support 3 lat temu
libtiff e9d26fb47d Ports: Update libtiff port to version 4.3.0 and use sha256 3 lat temu
libtool c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libuuid c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libuv dbdb6abdb9 Ports/libuv: Fix build failure due to missing statfs() function 3 lat temu
libvorbis c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
libxml2 5b8098497e Ports/libxml2: Remove obsolete ESHUTDOWN errno patch 3 lat temu
libzip c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
links 39e3c68e94 Ports: Updated links port to version 2.25 3 lat temu
llvm 4dc538da0e Ports: Remove build-crt patch from llvm 3 lat temu
lua 4b47daaadc Ports: Make lua buildable on x86_64 3 lat temu
lure c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
m4 29960faf20 Ports/m4: Remove obsolete wint_t patch 3 lat temu
make c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
mandoc 7893ae4233 Ports/mandoc: Remove obsolete patches 3 lat temu
mawk c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
mbedtls c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
milkytracker c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
mpc c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
mpfr c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
mrsh 1c054ac56e Ports/mrsh: Remove obsolete PIPE_BUF patch 3 lat temu
mruby 0f3f814945 Ports: Add port for mruby 4 lat temu
mysthous c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
nano 262b718912 Ports: Fix nano authentication options splitting 3 lat temu
nasm c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
ncdu c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
ncurses 58ec2f688b Ports/ncurses: Check for proper `tic` version during install 3 lat temu
neofetch c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
nesalizer c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
nethack c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
ninja 43e46df561 Ports: Remove obsolete patches for ninja 4 lat temu
nippon c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
npiet f3b5f03b2a Ports: Add npiet 3 lat temu
npth c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
ntbtls c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
nyancat b8cd6ae02e Ports: Use "launcher_run_in_terminal=true" instead of "Terminal -e ..." 4 lat temu
oksh 55a42906a7 Ports: Remove obsolete /dev/tty patches 3 lat temu
openssh 1145638de5 Ports: Remove wchar parts from openssh patches 3 lat temu
openssl 7110c0ecb0 Ports: Update OpenSSL port to version 1.1.1m 3 lat temu
openttd c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
openttd-opengfx ae32abffe9 Ports: Add openttd 4 lat temu
openttd-opensfx ae32abffe9 Ports: Add openttd 4 lat temu
opentyrian c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
opentyrian-data 971523621c Ports: Add opentyrian and opentyrian-data 4 lat temu
p7zip c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
patch 26a48f3516 Ports: Use GNU patch instead of the OpenBSD version 3 lat temu
pcre 85db9aac49 Ports: Update pcre to 8.45 3 lat temu
pcre2 7391104e5d Ports: Update pcre2 to 10.39 3 lat temu
pfetch 4abc2f669a Ports: Add pfetch utility 3 lat temu
php 11f1753be1 Ports: Unset env vars after configure in `php` 3 lat temu
pkgconf c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
printf c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
pt2-clone c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
pv 2c4db837e7 Ports: Add initial Pipe Viewer (pv) 1.6.20 port 3 lat temu
python3 ba9a525ba6 Ports: Remove obsolete siginfo_t::si_error Python3 patch 3 lat temu
qt6-qtbase ac762c5520 Ports/qt6: Add a very basic Qt6 Base package 3 lat temu
qt6-serenity ddeacce905 Ports/qt6: Add qt6-serenity 3 lat temu
quake 5537334f66 Ports: quake: Do no set PATH environment variable in package.sh 3 lat temu
quake2 c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
r0 c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
radare2 c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
readline c9c3f6c20f Ports: Use sha256 sig check for readline 4 lat temu
rsync c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
ruby 89e52faa22 Ports: Use ruby irb legacy mode 3 lat temu
sam c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
scummvm ce6fd38e5d Ports: Remove ScummVM's SVG patch 3 lat temu
sed c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
sfinx c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
sl c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
soltys c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
sqlite 8b1d4d1b8e Ports: Build an `.so` file for SQLite 4 lat temu
stpuzzles c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
stress-ng e2e9560580 Ports/stress-ng: Remove patches which disable lchown testing 3 lat temu
tcl 7ab68b6c83 Ports: Fix path for the tcl port's patch file 4 lat temu
termcap c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
tinycc c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
tinyscheme 5911d379a6 Ports: Update checksums to use the SHA256 algorithm 4 lat temu
tr d70595c09e Ports/tr: Remove obsolete getopt.h patch 3 lat temu
tuxracer 80626ca51f Ports: Remove unnecessary `-lmodplug` from `tuxracer` 3 lat temu
vim f848d65fd9 Ports/vim: Add symlink 'vi' pointing to target 'vim' 3 lat temu
vitetris c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
vlang 582d74b729 Ports: Bump vlang version to weekly.2021.31 4 lat temu
vttest 5911d379a6 Ports: Update checksums to use the SHA256 algorithm 4 lat temu
wget c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
xz c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
yasm c07f91474d Ports: Make array-like settings actual arrays 3 lat temu
zlib df06552b48 Ports: Fix building zlib with Clang 3 lat temu
zsh d0bed24ca1 Ports: Add ZSH port 4 lat temu
zstd e65052a208 Ports: Update zstd port to version 1.5.1 3 lat temu
.gitignore 404dab5383 Ports: Build most python3 extension modules statically 4 lat temu
.hosted_defs.sh dabd8dbedd Ports: Make it possible to build (some) ports with Clang 3 lat temu
.port_include.sh 28e0aa59a8 Ports: Register all dependencies of ports 3 lat temu
AvailablePorts.md 87d19dfa28 Ports: Update curl port to version 7.81.0 3 lat temu
README.md aa6e5e8cdc Ports: Describe in README that 'depends' is an array 3 lat temu
build_all.sh b220b45c5e Ports: Don't add ports to the "built" list unless successful 3 lat temu
build_installed.sh f318ab6bed Ports: Replace hardcoded Build/ paths with SERENITY_BUILD_DIR 4 lat temu

README.md

Ports for SerenityOS

What's this?

Serenity has software patched to run on it. These shell scripts will allow you to build that sort of software, easily. Note that you must have already built Serenity, and be in a Serenity build environment.

Available ports

A list of all available ports can be found here.

Using ports scripts

Each port has a script called package.sh which defines a name and version, its dependencies, the required files that will be downloaded as well as configuration/compilation options, and some other things (see Writing ports scripts for details).

  • To install a certain port, cd into its directory and run ./package.sh
  • To install all available ports, run the build_all.sh script in this directory. Pass clean as first argument to remove old build files beforehand.
  • To reinstall all currently installed ports, run the build_installed.sh script in this directory. This is sometimes required when LibC changes, for example. Pass clean as first argument to remove old build files beforehand.

Installed ports are being tracked in Build/i686/Root/usr/Ports/packages.db (a simple text file). You can delete this file at any time, in fact it must be edited or removed when clearing the build directory as port dependencies may not be installed again otherwise.

Not giving an option is equivalent to installdepends, fetch, patch, configure, build and install, in that order. This is recommended for a regular install.

Options

The following options are available:

fetch

By default, download, verify, and extract the port's files.

patch

Apply the port's patches (patches/*.patch). A file .foo_applied is created in workdir upon success to ensure a certain patch is only applied once.

configure

By default, run the port's configscript (usually configure) with configopts.

build

By default, run make with the port's makeopts.

install

By default, run make install with the port's installopts.

shell

Open a shell in the $workdir with the build environment set.

installdepends

Install all ports from the port's depends list.

clean

By default, remove all .out files from the port's workdir.

clean_dist

By default, remove everything that's been downloaded from the port's files list.

clean_all

By default, clean and clean_dist combined.

uninstall

Remove the port's files from the Serenity build directory, if it has a plist file.

--auto

Same as no option, but mark the port as having been installed automatically. This is used for dependencies.

Writing ports scripts

The package.sh file is a simple Bash script that's required for each port. Patches and other files are optional. The most basic version of such a port script simply defines some well-known variables and looks like this:

#!/usr/bin/env -S bash ../.port_include.sh

port="foo"
version="1.2.3"
useconfigure="true"
files="https://example.com/foo-${version}.tar.gz foo-${version}.tar.gz"
depends=("bar" "baz")

The script in the shebang, .port_include.sh, is where all the magic happens.

Variables

The following variables have special functionality:

auth_import_key

PGP key to import (from keyserver.ubuntu.com) when auth_type is sig.

auth_opts

Options passed to gpg --verify when auth_type is sig.

Usually used like this:

auth_opts="foo-${version}.tar.xz.asc foo-${version}.tar.xz"

auth_type

The type of file validation to use, can be one of:

  • md5: Use MD5 hashes defined in files
  • sha256: Use SHA256 hashes defined in files
  • sha1: Use SHA1 hashes defined in files
  • sig: Use PGP signatures (see auth_opts)

Defaults to md5, most ports use sig though as .asc files are widely available.

configopts

Options passed to the port's configscript in the default configure function.

--host=i686-pc-serenity is always passed, override the configure function if that's undesirable.

configscript

Name of the script that will be run in the default configure function when useconfigure is true.

Defaults to configure.

depends

An array of other SerenityOS ports the port depends on and which will be installed during the installdepends step.

For example:

depends=("ncurses" "gettext")

files

A list of external files required by the port, one per line. The format of each line is as follows:

URL NAME HASH

Where URL is the URL from where the file will be downloaded (using curl), NAME is the output name of the downloaded file, and HASH is an optional MD5, SHA1, or SHA256 hash that will be used for verification when auth_type is set to either of those hash functions.

For example:

files="https://example.com/foo-${version}.tar.xz foo-${version}.tar.xz
https://example.com/foo-${version}.tar.xz.asc foo-${version}.tar.xz.asc"

If a file is a compressed tar archive, a gzip compressed file or a zip compressed file, it will be extracted.

If a file is an .asc file (PGP signature) it will be imported into gpg's keyring and can later be used for verification using auth_opts.

icon_file

The file to use for the port launcher icon. The icon file is assumed to have a 16x16 as well as a 32x32 layer.

installopts

Options passed to make install in the default install function.

DESTDIR="${SERENITY_INSTALL_ROOT}" ("${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}/Root") is always passed, override the install function if that's undesirable.

makeopts

Options passed to make in the default build function.

Defaults to -j$(nproc).

patchlevel

The value for patch's -p / --strip option, see man patch for details.

Defaults to 1.

port

The "package name" of the port, usually the same as the directory this script is placed in.

prefix

The location of the ports directory, only used for the package.db file for now. Don't override this in ports contributed to Serenity.

Defaults to $SERENITY_SOURCE_DIR/Ports.

useconfigure

The configure step will run pre_configure and configure when this is set to true, and simply skip them otherwise.

Defaults to false.

version

The version of the port. Written to package.db, and usually used with variable interpolation in files where the version is part of the filename.

workdir

The working directory used for executing other commands via run as well as cleanup. Usually the directory name of the upacked source archive.

Defaults to $port-$version.

Functions

The various steps of the port installation process are split into individual Bash functions, some of which can be overridden to provide custom behaviour, like this:

build() {
    run mybuildtool --foo --bar
}

The following can be overridden, the names should be self-explanatory as they mostly match the available options:

  • pre_fetch
  • post_fetch
  • pre_configure
  • configure.
  • build
  • install
  • post_install
  • clean
  • clean_dist
  • clean_all

A few (non-overridable) util functions are available as well:

run

Log the command and run it in the port's workdir.

run_nocd

Log the command and run it in the current working directory (i.e. Ports/$port).

run_replace_in_file

Replace something in a file (using a Perl regular expression), like this:

run_replace_in_file "s/define FOO 1/undef FOO/" config.h

How do I contribute?

You can either:

  • Add new ports - just get the software to build and add the necessary patches and package.sh script
  • Update an existing port: bumping its version, getting functionality to work that wasn't available so far etc. Make sure to update the patches accordingly.

Some videos of Andreas adding new ports can be found on YouTube, they might help you understand how this usually works: