-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yuxuan Shui <[email protected]>
- Loading branch information
Showing
3 changed files
with
3,599 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
inputs.fenix = { | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
url = github:nix-community/fenix; | ||
}; | ||
inputs.rust-manifest = { | ||
flake = false; | ||
url = "https://static.rust-lang.org/dist/2024-02-29/channel-rust-nightly.toml"; | ||
}; | ||
inputs.flake-utils.url = github:numtide/flake-utils; | ||
description = "runa - wayland compositor toolkit"; | ||
|
||
outputs = { self, nixpkgs, fenix, flake-utils, ... } @ inputs: flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { inherit system; overlays = [ fenix.overlays.default ]; }; | ||
rust-toolchain = (pkgs.fenix.fromManifestFile inputs.rust-manifest).withComponents [ | ||
"rustfmt" | ||
"rust-src" | ||
"clippy" | ||
"rustc" | ||
"cargo" | ||
]; | ||
rustPlatform = pkgs.makeRustPlatform { | ||
cargo = rust-toolchain; | ||
rustc = rust-toolchain; | ||
}; | ||
in | ||
with pkgs; { | ||
packages = rec { | ||
crescent = rustPlatform.buildRustPackage rec { | ||
pname = "crescent"; | ||
version = "0.1.0"; | ||
src = ./.; | ||
buildInputs = [ libxkbcommon ]; | ||
postUnpack = '' | ||
echo $(pwd) | ||
ls $sourceRoot/runa-wayland-protocols/spec | ||
cp -v ${cargoLock.lockFile} $sourceRoot/Cargo.lock | ||
''; | ||
cargoLock.lockFile = ./nix/Cargo.lock; | ||
LIBCLANG_PATH = lib.makeLibraryPath [ llvmPackages_17.libclang.lib ]; | ||
BINDGEN_EXTRA_CLANG_ARGS = | ||
# Includes with normal include path | ||
(builtins.map (a: ''-I"${a}/include"'') [ | ||
linuxHeaders | ||
]) ++ [ | ||
''-isystem "${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${lib.versions.major pkgs.llvmPackages_latest.libclang.version}/include"'' | ||
''-isystem "${glibc.dev}/include"'' | ||
]; | ||
}; | ||
default = crescent; | ||
}; | ||
devShells.default = mkShell { | ||
nativeBuildInputs = [ pkg-config cmake rust-toolchain ]; | ||
buildInputs = [ libxkbcommon ]; | ||
shellHook = '' | ||
export LD_LIBRARY_PATH="${lib.makeLibraryPath [ libglvnd vulkan-loader ]}:$LD_LIBRARY_PATH" | ||
''; | ||
LIBCLANG_PATH = lib.makeLibraryPath [ llvmPackages_17.libclang.lib ]; | ||
|
||
BINDGEN_EXTRA_CLANG_ARGS = | ||
# Includes with normal include path | ||
(builtins.map (a: ''-I"${a}/include"'') [ | ||
linuxHeaders | ||
]) ++ [ | ||
''-isystem "${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${lib.versions.major pkgs.llvmPackages_latest.libclang.version}/include"'' | ||
''-isystem "${glibc.dev}/include"'' | ||
]; | ||
}; | ||
}); | ||
} |
Oops, something went wrong.