split servicepoint_binding_uniffi into own crate
Some checks failed
Rust / build (push) Has been cancelled

This commit is contained in:
Vinzenz Schroeter 2025-02-16 13:13:54 +01:00
parent 2f7a2dfd62
commit 21931f847f
94 changed files with 158 additions and 9856 deletions

View file

@ -34,100 +34,12 @@
);
in
rec {
packages = forAllSystems (
{ pkgs, ... }:
let
naersk' = pkgs.callPackage naersk { };
nativeBuildInputs = with pkgs; [
pkg-config
makeWrapper
];
buildInputs = with pkgs; [
xe
xz
];
makeExample =
{
package,
example,
features ? "",
}:
naersk'.buildPackage {
pname = example;
cargoBuildOptions =
x:
x
++ [
"--package"
package
];
src = ./.;
inherit nativeBuildInputs buildInputs;
strictDeps = true;
gitSubmodules = true;
overrideMain = old: {
preConfigure = ''
cargo_build_options="$cargo_build_options --example ${example} ${
if features == "" then "" else "--features " + features
}"
'';
};
};
makePackage =
package:
let
package-param = [
"--package"
package
];
in
naersk'.buildPackage {
pname = package;
cargoBuildOptions = x: x ++ package-param;
cargoTestOptions = x: x ++ package-param;
src = ./.;
doCheck = true;
strictDeps = true;
inherit nativeBuildInputs buildInputs;
};
in
rec {
servicepoint = makePackage "servicepoint";
announce = makeExample {
package = "servicepoint";
example = "announce";
};
game-of-life = makeExample {
package = "servicepoint";
example = "game_of_life";
features = "rand";
};
moving-line = makeExample {
package = "servicepoint";
example = "moving_line";
};
random-brightness = makeExample {
package = "servicepoint";
example = "random_brightness";
features = "rand";
};
wiping-clear = makeExample {
package = "servicepoint";
example = "wiping_clear";
};
}
);
legacyPackages = packages;
devShells = forAllSystems (
{ pkgs, system }:
{
default = pkgs.mkShell rec {
inputsFrom = [ self.packages.${system}.servicepoint ];
packages = with pkgs; [
(pkgs.symlinkJoin
{
(pkgs.symlinkJoin {
name = "rust-toolchain";
paths = with pkgs; [
rustc
@ -143,8 +55,10 @@
dotnet-sdk_8
gcc
gnumake
xe
xz
pkg-config
];
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath (builtins.concatMap (d: d.buildInputs) inputsFrom)}";
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
}