Skip to content

Instantly share code, notes, and snippets.

@krupkat
Created January 2, 2024 20:06
Show Gist options
  • Save krupkat/e294cfa857328721ba739f0a510cd074 to your computer and use it in GitHub Desktop.
Save krupkat/e294cfa857328721ba739f0a510cd074 to your computer and use it in GitHub Desktop.
[nix Boost environment] #nix #boost #cobalt

custom built Boost 1.84 with c++20 and cobalt support

{ pkgs ? import <nixpkgs> { } }:
let
boost-src = {
version = "1.84.0";
src = pkgs.fetchurl {
url = "https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2";
sha256 = "cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454";
};
};
boost-build = pkgs.boost-build.override {
stdenv = pkgs.gcc13Stdenv;
useBoost = boost-src;
};
boost184 = (pkgs.boost.override {
stdenv = pkgs.gcc13Stdenv;
boost-build = boost-build;
extraB2Args = [ "cxxstd=20" ];
}).overrideAttrs
(finalAttrs: previousAttrs: boost-src);
in
pkgs.gcc13Stdenv.mkDerivation {
name = "boost184-nix-shell";
nativeBuildInputs = with pkgs; [
clang-tools_17
cmake
];
buildInputs = [
boost184
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment