I’m trying to build a C++ project using the meson build system but it’s having trouble building it as it can’t find boost
flake.nix
{
description = "A build for <> on NixOS";
inputs = {
nixpkgs.url = "nixpkgs/nixos-22.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs { inherit system; };
in {
packages = {
default = pkgs.stdenv.mkDerivation {
name = "project";
src = ./.;
nativeBuildInputs = with pkgs; [
pkg-config
meson
ninja
cmake
];
buildInputs = with pkgs; [
boost18x
pipewire
opencv
openssl
ffmpeg
SDL2
openxr-loader
zlib
];
};
};
});
}
The relevant part of the meson.build
boost = dependency(
'boost',
modules: ['system', 'log', 'log_setup', 'thread', 'unit_test_framework'],
)
But when I call nix run
I get this as an error
last 10 log lines:
> Host machine cpu: x86_64
> Library rt found: YES
> Library dl found: YES
> Run-time dependency threads found: YES
> Found pkg-config: /nix/store/kkxx963z7a6ihb3xhvxlqaziyb18zc84-pkg-config-wrapper-0.29.2/bin/pkg-config (0.29.2)
> Run-time dependency Boost (missing: log, log_setup, system, thread, unit_test_framework) found: NO (tried system)
>
> meson.build:34:0: ERROR: Dependency "boost" not found, tried system
>
> A full log can be found at /build/na32db13m9yqwgsmsjj7plbbb7pivh54-source/build/meson-logs/meson-log.txt
For full logs, run 'nix log /nix/store/v2hin2i6l2mhcw9zbl58vb9vbn0p3qk0-module-GC.drv'.
I’m new to nix and NixOS and am trying to figure this all out. Thanks!