307.2. goxel-0.15.1
3D voxel editor, drawn with OpenGL through GLFW and no toolkit
| Version | 0.15.1, release 1 |
| Shelf | 3d — 3D modelling, animation, voxel and mesh tools and libraries, and scientific visualisation |
| Phase | 44_apps (Applications), 2 of 422 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://goxel.xyz |
| Build time | 2.6 SBU |
| Installed size | 5.3 MiB in 11 files |
| Recipe | ports/core/3d/goxel/kpkgbuild |
About
Goxel is a 3D voxel editor: a model is built out of cubes on a grid, painted, and exported to formats such as glTF, OBJ, PLY, MagicaVoxel .vox and PNG slices. It draws its whole interface itself with OpenGL through glfw, so it links no toolkit, and it builds with scons.
Sources
goxel-0.15.1.tar.gz(4.1 MiB)
sha25601c9601ac9d8d38e29d3adff4b79a26c2b9fea4c2d2cb1d134471e499f8c4a84
upstream: https://github.com/guillaumechereau/goxel/archive/refs/tags/v0.15.1.tar.gz
archive copy: sources-1/3d--goxel-0.15.1.tar.gz
Dependencies
Depends on: scons, pkgconf, glfw, libglvnd, mesa, dbus, libpng.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
goxel-app-id.patch— Insrc/main.c, before the window is created, sets the GLFW hintsGLFW_WAYLAND_APP_IDandGLFW_X11_CLASS_NAMEtogoxel. Without the first, GLFW gives the Wayland window an empty app id, and the panel cannot match the window togoxel.desktop(seekdos appid). GLFW uses the X11 class only when an instance name is set as well, so on X11 the second hint changes nothing.goxel-maximized.patch— Open the main window maximizedThe window is created at the primary monitor's full mode size, which with the compositor's title bar is taller than the work area and puts the bottom of the interface under the panel. Maximized, the compositor sizes it to the work area.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install goxel'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/3d/goxel.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/3d/goxel
echo '01c9601ac9d8d38e29d3adff4b79a26c2b9fea4c2d2cb1d134471e499f8c4a84 goxel-0.15.1.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/goxel
SRC=$SRC_ROOT/goxel-0.15.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf goxel-0.15.1.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/goxel-app-id.patch"
patch -p1 -i "$PORT_SRC/goxel-maximized.patch"
scons -j"$KDOS_JOBS" mode=release werror=false nfd_backend=portal sound=false
make PREFIX=/usr DESTDIR=$PKG install
cat > "$PKG/usr/share/applications/goxel.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Goxel
GenericName=Voxel Editor
Comment=Build 3D models out of voxels
TryExec=goxel
Exec=goxel %f
Icon=goxel
Terminal=false
StartupWMClass=goxel
Categories=Graphics;3DGraphics;
Keywords=voxel;3d;model;editor;pixel;goxel;
DESKTOP
chmod 644 "$PKG/usr/share/applications/goxel.desktop"
The switches, and why each is set:
mode=release— Upstream’s default mode isdebug, which compiles with-O0and links AddressSanitizer and UndefinedBehaviorSanitizer into the program.releasedrops both and compiles withNDEBUGand-Ofast. The SConstruct itself appends the exportedCFLAGS,CXXFLAGSandLDFLAGS(see the release flags). SCons puts itsCCFLAGS, where-Ofastis, afterCFLAGSandCXXFLAGSon each compile line, so-Ofastoverrides the exported-O2.werror=false— Upstream’s default istrue, which adds-Werror, so any warning the tree’s compiler raises that upstream’s did not would stop the build.nfd_backend=portal— The open and save dialogs go through the desktop’s FileChooser portal over D-Bus (upstream’snfd_portal.cpp, linked against dbus) instead of the defaultgtkbackend, which links GTK 3 to draw its own dialog. On KDOS the portal opens the desktop’s own file chooser, andgtk3is not independs.sound=false— No sound effects, so no link to OpenAL. This is upstream’s default; naming it keeps OpenAL out of the link whatever that default becomes.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/goxel, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf goxel-0.15.1-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/goxel, and runs the triggers its paths call for.
Contents
Installed programs: goxel.
Installed directories: /usr/share/licenses/goxel.
Notes
goxel-maximized.patch sets the GLFW hint GLFW_MAXIMIZED. Goxel sizes its window to the primary monitor’s full resolution, which with the compositor’s title bar is taller than the work area and puts the bottom of the interface under the panel; maximized, the compositor fits it to the work area.
make install is upstream’s Makefile, which takes PREFIX and DESTDIR; it installs the binary, the hicolor icons, the AppStream file and upstream’s desktop entry. build.sh then writes its own goxel.desktop over that entry, with %f in Exec, TryExec, StartupWMClass=goxel and search keywords.