Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

318.1. hydrogen-1.2.6

Pattern-based drum machine and sequencer with sample drum kits

Version 1.2.6, release 1
Shelf studio — Music production: DAWs, audio editors, trackers, drum machines and notation
Phase 44_apps (Applications), 371 of 422 in build order
Licence GPL-2.0-or-later
Homepage https://hydrogen-music.org/
Build time 12.9 SBU
Installed size 26.6 MiB in 496 files
Recipe ports/core/studio/hydrogen/kpkgbuild

About

Hydrogen is a pattern-based drum machine: drum kits of samples are played from patterns in a step sequencer, and the patterns are arranged into songs. It is a Qt 6 program, plays through ALSA, PulseAudio or JACK, takes MIDI and OSC control, and loads LADSPA effects. Its user manual and tutorial come from a separate documentation repository, the second source of the recipe.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, librsvg, qt6-qtbase, qt6-qtsvg, qt6-qttools, qt6-qtwayland, libsndfile, libarchive, alsa-lib, libpulse, pipewire, ladspa, lrdf, liblo.

Required by: no port names it.

Patches

build.sh applies these; kpkg applies nothing by itself.

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 hydrogen'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/studio/hydrogen.

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/studio/hydrogen
echo 'efba32610498acde76fa2e147017c91b20c13ec945e05e348cd4183fd1613be1  hydrogen-1.2.6.tar.gz' | sha256sum -c -
echo '375ce7d460a8b33e451042330eff44ceffffd0ad220d50b2c49b057d2b01297f  hydrogen-doc-1.2.6.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/hydrogen
SRC=$SRC_ROOT/hydrogen-1.2.6
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf hydrogen-1.2.6.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf hydrogen-doc-1.2.6.tar.gz -C "$SRC_ROOT"

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/nodevel.patch"
rmdir data/doc
mv "$SRC_ROOT/documentation-$version" data/doc

export CMAKE_CXX_FLAGS="$CXXFLAGS"
cmake -S . -B build -G Ninja \
	-D CMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D CMAKE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D CMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON \
	-D DISPLAY_VERSION_PIPELINE=$version \
	-D WANT_QT6=ON \
	-D WANT_SHARED=ON \
	-D WANT_DEBUG=OFF \
	-D WANT_LIBARCHIVE=ON \
	-D WANT_ALSA=ON \
	-D WANT_PULSEAUDIO=ON \
	-D WANT_LADSPA=ON \
	-D WANT_LRDF=ON \
	-D WANT_OSC=ON \
	-D WANT_JACK=ON \
	-D WANT_PORTAUDIO=OFF \
	-D WANT_PORTMIDI=OFF \
	-D WANT_OSS=OFF \
	-D WANT_LASH=OFF \
	-D WANT_RUBBERBAND=OFF \
	-D WANT_APPIMAGE=OFF \
	-D WANT_CPPUNIT=OFF \
	-D WANT_INTEGRATION_TESTS=OFF \
	-D WANT_CLANG_TIDY=OFF \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

rm -rf "$PKG/usr/share/hydrogen/data/i18n"
rm -f "$PKG"/usr/share/hydrogen/data/doc/tutorial_fr.html \
	"$PKG"/usr/share/hydrogen/data/doc/tutorial_it.html
test -f "$PKG/usr/share/hydrogen/data/doc/manual_en.html"

for _size in 32 48 64 128; do
	install -d "$PKG/usr/share/icons/hicolor/${_size}x${_size}/apps"
	rsvg-convert -w "$_size" -h "$_size" \
		-o "$PKG/usr/share/icons/hicolor/${_size}x${_size}/apps/org.hydrogenmusic.Hydrogen.png" \
		"$PKG/usr/share/icons/hicolor/scalable/apps/org.hydrogenmusic.Hydrogen.svg"
done

cat > "$PKG/usr/share/applications/org.hydrogenmusic.Hydrogen.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Hydrogen
GenericName=Drum Machine
Comment=Create drum patterns and songs
TryExec=hydrogen
Exec=hydrogen %F
Icon=org.hydrogenmusic.Hydrogen
Terminal=false
StartupNotify=true
StartupWMClass=hydrogen
Categories=AudioVideo;Audio;Midi;Sequencer;Qt;
Keywords=audio;sound;drum;drums;machine;sequencer;sampler;beat;hydrogen;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.hydrogenmusic.Hydrogen.desktop"

The switches, and why each is set:

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/hydrogen, 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 hydrogen-1.2.6-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/hydrogen, and runs the triggers its paths call for.

Contents

Installed programs: h2cli, h2player, hydrogen.

Installed libraries: libhydrogen-core-1.2.6.so.

Installed directories: /usr/include/hydrogen, /usr/share/hydrogen, /usr/share/licenses/hydrogen.

Short descriptions

hydrogen a simple drum machine/step sequencer.

Notes

Hydrogen’s CMakeLists.txt builds CMAKE_CXX_FLAGS from the environment variable of that name, not from CXXFLAGS, and empties CMAKE_CXX_FLAGS_RELEASE. build.sh therefore exports CMAKE_CXX_FLAGS="$CXXFLAGS" before the configure; without it the tree’s compiler flags would not reach the compile.

The manual is a git submodule upstream, so the source tarball carries data/doc as an empty directory. build.sh removes it and moves the unpacked documentation tarball into its place, where CMakeLists.txt builds it when data/doc/CMakeLists.txt exists. After the install the French and Italian tutorials and the i18n directory of translations are deleted, and the build checks that manual_en.html was installed. Upstream installs its icon as SVG only, which the panel does not draw, so the recipe rasterises it to PNGs from 32 to 128 pixels. It also writes its own desktop entry: Hydrogen sets no desktop file name, so its Wayland app id is the executable’s name, hydrogen, which the entry names in StartupWMClass, and upstream’s entry claims the text/xml MIME type, every XML file on the system, which the replacement leaves out.