Skip to content

support for distro packaging #420

@midnightveil

Description

@midnightveil

If the SDK were to be packaged as a distro package, the bin/microkit and board folder is not colocated in the way the SDK expects.

e.g.

$ microkit --help
Error: SDK directory '/usr' does not have a 'board' sub-directory.
$ MICROKIT_SDK=/usr/share/microkit-sdk microkit --help
usage: microkit [-h] [-o OUTPUT] [--image-type {binary,elf,uimage}] [-r REPORT] --board BOARD --config CONFIG [--capdl-json CAPDL_SPEC] --search-path [SEARCH_PATH ...] system

The traditional way this is handled for distro packaging is passing something like ./configure --libdir <blah> and that passes information through the build system to the build C program with the define. We don't have a way to do this, except by packaging a wrapper script that sets MICROKIT_SDK. (this might work?)

LLVM/clang compilers pass through the relative path from the clang binary to the lib true: https://github.com/llvm/llvm-project/blob/main/clang/lib/Options/OptionUtils.cpp#L209-L237.

Example fedora (rpm) .spec package

Build with rpmbuild -bb microkit-sdk.spec. This generates a package with /usr/bin/microkit (for the tool) and /usr/share/microkit-sdk/board, /usr/share/microkit-sdk/example, /usr/share/licenses/microkit-sdk/LICENSE.md and /usr/share/doc/microkit-sdk/microkit_user_manual.pdf.

%define __spec_install_post %{nil}
%define __os_install_post %{nil}
%define debug_package %{nil}

Name:       microkit-sdk
Version:    2.1.0
Release:    1%{?dist}
Summary:    A simple operating system framework for the seL4 microkernel
BuildArch:  x86_64

Group:      System
URL:        https://github.com/au-ts/microkit

%define SEL4_VERSION 14.0.0

# https://github.com/seL4/microkit/releases/download/2.1.0/microkit-sdk-2.1.0-linux-x86-64.tar.gz
# https://github.com/seL4/microkit/releases/download/2.1.0/microkit-sdk-2.1.0-linux-aarch64.tar.gz
Source:    microkit-sdk-%{version}-linux-x86-64.tar.gz
License:    BSD AND CC-BY-SA-4.0 AND GPL-2.0-only

%description
A simple operating system framework for the seL4 microkernel

%prep
%autosetup

%build
# nothing

%install
if [[ "%{version}" != "$(< VERSION)" ]]; then
    echo "version mismatch" >&2
    exit 1
fi

mkdir -p %{buildroot}/%{_bindir}
install -m 0755 bin/microkit %{buildroot}%{_bindir}/microkit

mkdir -p %{buildroot}%{_datadir}/%{name}
cp -ar board/ example/ %{buildroot}%{_datadir}/%{name}

%files
%license LICENSE.md
%doc doc/microkit_user_manual.pdf
%{_bindir}/microkit
%{_datadir}/%{name}/*


%changelog
* Wed Feb 11 2026 Julia Vassiliki <julia.vassiliki@unsw.edu.au>
- Init

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions