feat: Removed useless deps

This commit is contained in:
uttarayan21
2024-06-16 22:36:02 +05:30
parent d96fd68357
commit 9454e41c53
4 changed files with 75 additions and 46 deletions
+53 -10
View File
@@ -34,19 +34,26 @@
stableToolchainWithRustAnalyzer = pkgs.rust-bin.stable.latest.default.override {
extensions = ["rust-src" "rust-analyzer"];
# Extra targets if required
# targets = [
# "x86_64-unknown-linux-gnu"
# "x86_64-unknown-linux-musl"
# "x86_64-apple-darwin"
# "aarch64-apple-darwin"
# ];
targets = [
"wasm32-unknown-unknown"
# "x86_64-unknown-linux-gnu"
# "x86_64-unknown-linux-musl"
# "x86_64-apple-darwin"
# "aarch64-apple-darwin"
];
};
craneLib = (crane.mkLib pkgs).overrideToolchain stableToolchain;
src = craneLib.cleanCargoSource (craneLib.path ./.);
commonArgs = {
inherit src;
buildInputs = with pkgs;
[]
[
alsa-lib
# wayland
# xorg.libX11
# xorg.libXi
# libGL
]
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
libiconv
# pkgs.darwin.apple_sdk.frameworks.CoreServices
@@ -63,25 +70,60 @@
# LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
# For using pkg-config that many libraries require
# PKG_CONFIG_PATH = lib.makeSearchPath "lib/pkgconfig" (with pkgs;[ openssl.dev zlib.dev ]);
LD_LIBRARY_PATH = builtins.concatStringsSep ":" [
"${pkgs.xorg.libX11}/lib"
"${pkgs.xorg.libXi}/lib"
"${pkgs.libGL}/lib"
"${pkgs.wayland}/lib"
];
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
in {
checks = {
hello-clippy = craneLib.cargoClippy (commonArgs
tadventure-clippy = craneLib.cargoClippy (commonArgs
// {
inherit cargoArtifacts;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
});
hello-fmt = craneLib.cargoFmt {
tadventure-fmt = craneLib.cargoFmt {
inherit src;
};
hello-nextest = craneLib.cargoNextest (commonArgs
tadventure-nextest = craneLib.cargoNextest (commonArgs
// {
inherit cargoArtifacts;
partitions = 1;
partitionType = "count";
});
};
packages = rec {
tadventure-unwrapped = pkgs.rustPlatform.buildRustPackage {
pname = "tadventure";
version = "0.1.0";
cargoLock = {
lockFile = "${src}/Cargo.lock";
};
inherit src;
};
tadventure = pkgs.buildFHSEnv {
name = "tadventure";
targetPkgs = pkgs:
with pkgs; [
tadventure-unwrapped
xorg.libX11
xorg.libXi
libGL
egl-wayland
];
multiPkgs = pkgs:
with pkgs; [
alsa-lib
];
runScript = ''
${tadventure-unwrapped}/bin/tadventure
'';
};
default = tadventure;
};
devShells.default = (craneLib.overrideToolchain stableToolchainWithRustAnalyzer).devShell (commonArgs
// {
@@ -90,6 +132,7 @@
packages = with pkgs; [
cargo-nextest
cargo-criterion
trunk
];
});
}