Skip to content
cccskills
FreePublished on GitHub

meson

Package a Meson/Ninja project for corepkgs. Use when a source tree has a meson.build — covers mesonFlags, auto features, cross-compilation, and diagnosing Meson setup failures.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94 stars(GitHub 94 + cccskills 0)

Run score Not tested

See how to install

Files included (1)

  • SKILL.md2.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Meson Build System

Minimal Example

{
  lib,
  stdenv,
  fetchFromGitHub,
  meson,
  ninja,
  pkg-config,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "example";
  version = "1.0.0";

  src = fetchFromGitHub {
    owner = "example";
    repo = "example";
    tag = "v${finalAttrs.version}";
    hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
  };

  nativeBuildInputs = [
    meson
    meson.configurePhaseHook  # Required
    ninja                      # Required
    pkg-config
  ];

  meta = {
    description = "Example Meson package";
    license = lib.licenses.mit;
  };
})

Essential Requirements

Always include:

  • meson.configurePhaseHook - Sets up configure phase
  • ninja - Required (Meson generates Ninja files)
  • pkg-config - Usually needed for dependencies

Common Patterns

With Dependencies

nativeBuildInputs = [
  meson
  meson.configurePhaseHook
  ninja
  pkg-config
];

buildInputs = [
  glib
  libcap
];

Meson Entries (Preferred)

Use mesonEntries to specify Meson -D options as a structured attrset. Booleans are automatically converted to true/false.

mesonEntries = {
  docs = false;
  man = true;
  wrap_mode = "nodownload";
};

Meson Features

Use mesonFeatures for Meson feature type options (those that accept enabled/disabled/auto). Booleans are automatically converted to enabled/disabled.

mesonFeatures = {
  introspection = withIntrospection;
  tests = false;
};

Both mesonEntries and mesonFeatures are merged into the same set of -D flags. If a key appears in both, mesonFeatures wins.

Meson Flags (Legacy)

mesonFlags still works for string-based flags and non--D flags:

mesonFlags = [
  "-Ddocs=false"
  "-Dtests=false"
  "-Dsystemd=disabled"
  "-Dman=true"
];

Both can be used together. mesonFlags values override mesonEntries for the same key (meson uses last-wins for -D flags). Use mesonFlags for non--D flags like --cross-file.

Cross-Compilation

strictDeps = true;

nativeBuildInputs = [ meson meson.configurePhaseHook ninja pkg-config ];
buildInputs = [ glib ];
depsBuildBuild = [ pkg-config ];

Troubleshooting

Dependency not found:

mesonFeatures = { optional_feature = false; };

Disable subproject downloads:

mesonEntries = { wrap_mode = "nodownload"; };

Disable documentation:

mesonEntries = {
  docs = false;
  gtk_doc = false;
  man = false;
};

Force library directory:

mesonEntries = { libdir = "lib"; };

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Review a package expression for best-practices compliance. Use when reviewing PRs or auditing existing packages — checks meta completeness, build-system idioms (cmakeEntries, mesonEntries, pyproject), dependency placement, and packaging conventions.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

cmake

Free

Package a CMake-based project for corepkgs. Use when a source tree has a CMakeLists.txt — covers the minimal derivation, cmakeEntries, cross-compilation, and diagnosing CMake configure failures.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

Fix all broken package builds in the repository. Runs a full build of ci/packages.nix in the background while iterating on failures in the foreground until everything builds.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

go

Free

Package a Go module for corepkgs. Use when writing or editing a buildGoModule derivation — covers vendorHash, ldflags, subPackages, tags, env.CGO_ENABLED, proxyVendor, shell completions, and pinning a Go version.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

Work with multi-version packages under pkgs-many (guile, go, erlang, perl, openssl, ...). Use when adding or changing a package that ships several versions side by side — covers the default.nix/variants.nix/generic.nix three-file pattern, the packageOlder/packageAtLeast version helpers, and mkVariantPassthru.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

corepkgs packaging conventions. Use when writing or reviewing any pkgs/<name>/default.nix — covers package organization (auto-registration, top-level.nix, alternative implementations), the finalAttrs pattern, meta attributes, where each kind of dependency belongs, fetchers, patching, install phases, multiple outputs, and passthru.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

See all skills by ekala-project

Report a problem with this skill