use scikit_build_core as build system

This commit is contained in:
vls committed 2026-06-01 14:02:34 +02:00
1 parent 5221d6721e
commit cc7ae6d49a
7 files changed
+75 -57

No files matched your search

+9 -51
View File
@@ -1,5 +1,5 @@
{
description = "auto-opt-cpp";
description = "slopefit";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
@@ -16,66 +16,24 @@
system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkg =
{
stdenv,
cmake,
ninja,
lib,
eigen,
gtest,
python313,
python313Packages,
withTests ? false,
}:
let
fs = lib.fileset;
in
stdenv.mkDerivation {
pname = "autoopt-cpp";
version = "0.1.0";
src = fs.toSource {
root = ./.;
fileset = fs.unions [
./include
./CMakeLists.txt
./tests
./src
./pysrc
];
};
buildInputs = lib.optionals withTests [ gtest ];
nativeBuildInputs = [
cmake
ninja
eigen
(python313.withPackages (
ps: with ps; [
nanobind
matplotlib
numpy
]
))
];
};
pkg = import ./build.nix;
in
rec {
packages = rec {
autoopt-cpp = pkgs.callPackage pkg { };
autoopt-cpp-with-tests = pkgs.callPackage pkg { withTests = true; };
default = autoopt-cpp;
slopefit = pkgs.callPackage pkg { };
slopefit-with-tests = pkgs.callPackage pkg { };
default = slopefit;
};
devShells = {
default = pkgs.mkShell {
inputsFrom = [
packages.autoopt-cpp-with-tests
packages.slopefit-with-tests
];
buildInputs = [ pkgs.python3Packages.pip ];
shellHook = ''
echo "Development shell for autoopt-cpp"
echo "Development shell for slopefit"
'';
};
};