From e70a191e3485bc62674a8d88b831b11a838b86e2 Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Tue, 4 Apr 2023 00:22:22 -0400 Subject: [PATCH] Build the overrides that make kifu-gtk successfully build --- flake.nix | 46 ++++++++++++++++---------------------- kifu/kifu-test/Cargo.toml | 8 +++++++ kifu/kifu-test/src/main.rs | 3 +++ 3 files changed, 30 insertions(+), 27 deletions(-) create mode 100644 kifu/kifu-test/Cargo.toml create mode 100644 kifu/kifu-test/src/main.rs diff --git a/flake.nix b/flake.nix index 86ce662..5dd50ec 100644 --- a/flake.nix +++ b/flake.nix @@ -45,41 +45,33 @@ packages."x86_64-linux" = let pkgs = import nixpkgs { system = "x86_64-linux"; }; + standardOverride = attrs: { + nativeBuildInputs = [ + pkgs.pkg-config + pkgs.gtk4 + ]; + verbose = true; + }; customBuildInfo = pkgs: pkgs.buildRustCrate.override { defaultCrateOverrides = pkgs.defaultCrateOverrides // { - gobject-sys = attrs: { - nativeBuildInputs = [ - pkgs.pkg-config - pkgs.wrapGAppsHook4 - pkgs.gtk4 - pkgs.glib - pkgs.clang - ]; - }; - graphene-sys = attrs: { - nativeBuildInputs = [ - pkgs.pkg-config - pkgs.wrapGAppsHook4 - pkgs.gtk4 - pkgs.glib - pkgs.clang - ]; - }; - cairo-sys = attrs: { - nativeBuildInputs = [ - pkgs.pkg-config - pkgs.wrapGAppsHook4 - pkgs.gtk4 - pkgs.glib - pkgs.clang - ]; - }; + cairo-sys-rs = standardOverride; + graphene-sys = standardOverride; + gobject-sys = standardOverride; + pango-sys = standardOverride; + gio-sys = standardOverride; + gdk-pixbuf-sys = standardOverride; + gdk4-sys = standardOverride; + gsk4-sys = standardOverride; + gtk4-sys = standardOverride; }; }; in { + # gobject-sys = pkgs.buildRustCrate cargo.internal.crates.gobject-sys; kifu-gtk = (import ./kifu/kifu-gtk/Cargo.nix { inherit pkgs; buildRustCrateForPkgs = customBuildInfo; + rootFeatures = [ "screenplay" ]; + release = false; }).rootCrate.build; }; }; diff --git a/kifu/kifu-test/Cargo.toml b/kifu/kifu-test/Cargo.toml new file mode 100644 index 0000000..2c88545 --- /dev/null +++ b/kifu/kifu-test/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "kifu-test" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/kifu/kifu-test/src/main.rs b/kifu/kifu-test/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/kifu/kifu-test/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}