1
0
mirror of https://github.com/slendidev/smath.git synced 2026-03-17 02:26:50 +02:00
Files
smath/flake.nix
2026-03-12 02:35:04 +02:00

91 lines
2.2 KiB
Nix

{
description = "Single-file linear algebra math library for C++23.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
system = system;
};
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
cmake
ninja
clang-tools
lldb
pkg-config
doxygen
];
};
packages.default = pkgs.stdenv.mkDerivation {
pname = "smath";
version = "master";
src = ./.;
nativeBuildInputs = with pkgs; [
cmake
gtest
copyPkgconfigItems
];
pkgconfigItems = [
(pkgs.makePkgconfigItem rec {
name = "smath";
version = "1";
cflags = [ "-I${variables.includedir}" ];
variables = rec {
prefix = "${placeholder "out"}";
includedir = "${prefix}/include";
};
description = "Single-file linear algebra math library for C++23.";
})
];
extraCMakeFlags = [
"-DSMATH_INSTALL_INTEROP_HEADERS=ON"
];
installPhase = ''
runHook preInstall
mkdir -p $out/include/
cp -r ../include/smath/ $out/include/
runHook postInstall
'';
dontBuild = false;
doCheck = true;
meta = with pkgs.lib; {
description = "Single-file linear algebra math library for C++23.";
homepage = "https://github.com/slendidev/smath";
license = licenses.asl20;
platforms = platforms.all;
maintainers = [
{
name = "Slendi";
email = "slendi@socopon.com";
github = "slendidev";
githubId = 32436619;
}
];
};
};
}
);
}