#!/bin/sh # Build script for tint2 (CMake, Ninja generator). # Deps: cairo, pango, glib2, libX11, libXinerama, libXrandr, libXrender, # libXcomposite, libXdamage, imlib2 (all ported). # # CMake doesn't recognize Hammerhead and won't set UNIX=TRUE / pick the # right shared-lib conventions without a Platform module (same gotcha as # base/libjpeg-turbo's cmake build) - map it to the SunOS platform module. # # ENABLE_BATTERY=OFF: no battery in a VM (task brief). # ENABLE_TINT2CONF=OFF: tint2conf is a GTK+2 theme configurator - NO GTK # anywhere per the toolkit-durability decision, and GTK+2 isn't ported. # ENABLE_RSVG=OFF / ENABLE_SN=OFF: librsvg / libstartup-notification are # not ported; both are optional (launcher SVG icons / startup-notification # only) and tint2's CMakeLists gates them cleanly behind these options. set -e cd "$SRCDIR" # GOTCHA (found 2026-07-22): src/util/window.c and src/util/timer.c use the # BSD u_int32_t/u_int64_t typedefs, which illumos's does NOT # provide (unlike glibc, which defines them unconditionally) - not even # behind __EXTENSIONS__. window.c already includes , so just # swap the type names to their POSIX/C99 uintNN_t equivalents; timer.c # needs the #include added too. sed -i -e 's/u_int64_t/uint64_t/g' -e 's/u_int32_t/uint32_t/g' src/util/window.c sed -i -e 's/u_int64_t/uint64_t/g' src/util/timer.c { printf '#include \n'; cat src/util/timer.c; } > src/util/timer.c.new mv src/util/timer.c.new src/util/timer.c # bzero() lives in illumos's (BSD legacy function, not # ) - several tint2 files call it without including that header, # an implicit-declaration error under GCC 14. Prepend the include to every # file that uses bzero() but doesn't already pull in strings.h. for f in src/util/common.c src/util/area.c src/util/timer.c \ src/util/gradient.c src/battery/battery.c; do if grep -q 'bzero(' "$f" && ! grep -q 'strings\.h' "$f"; then { printf '#include \n'; cat "$f"; } > "$f.new" mv "$f.new" "$f" fi done mkdir -p "$SRCDIR/.cmake/Platform" echo 'include(Platform/SunOS)' > "$SRCDIR/.cmake/Platform/Hammerhead.cmake" export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH" cmake -B build -G Ninja \ -DCMAKE_MODULE_PATH="$SRCDIR/.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="$PREFIX" \ -DCMAKE_INSTALL_RPATH="$PREFIX/lib" \ -DCMAKE_C_FLAGS="-D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS" \ -DENABLE_BATTERY=OFF \ -DENABLE_TINT2CONF=OFF \ -DENABLE_RSVG=OFF \ -DENABLE_SN=OFF cmake --build build -j${JOBS:-1} DESTDIR="$PKGDIR" cmake --install build # tint2 - lightweight X11 panel/taskbar/systray # https://gitlab.com/o9000/tint2 (mirror: https://github.com/o9000/tint2) [package] name = "tint2" version = "16.2" release = 1 description = "Lightweight panel/taskbar for X11 window managers" url = "https://github.com/o9000/tint2" license = "GPL-2.0-or-later" maintainer = "Chris Tusa " arch = "x86_64" [dependencies] runtime = ["cairo", "pango", "glib2", "libX11", "libXinerama", "libXrandr", "libXrender", "libXcomposite", "libXdamage", "imlib2"] build = ["cairo", "pango", "glib2", "libX11", "libXinerama", "libXrandr", "libXrender", "libXcomposite", "libXdamage", "imlib2"] [[source]] file = "tint2-16.2.tar.gz" urls = ["https://github.com/o9000/tint2/archive/refs/tags/v16.2.tar.gz"] checksum = "a95c8a22d4cc117335b3157c7de48da91c8721fc97f86d0353c545eed2598ce8" [build] parallel = true