Build Tools #37

Merged
savanni merged 4 commits from feature/build-tools into main 2023-04-05 12:48:24 +00:00
5 changed files with 5063 additions and 7 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ target
.direnv/
node_modules
dist
result

View File

@ -1,12 +1,43 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1680122840,
"narHash": "sha256-zCQ/9iFHzCW5JMYkkHMwgK1/1/kTMgCMHq4THPINpAU=",
"lastModified": 1680498889,
"narHash": "sha256-4nGFBm+oILOO6DPoKTPxVlfkZSxCOY4W25zSRHESK48=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a575c243c23e2851b78c00e9fa245232926ec32f",
"rev": "799d153e4f316143a9db0eb869ecf44d8d4c0356",
"type": "github"
},
"original": {
@ -15,19 +46,82 @@
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1654275867,
"narHash": "sha256-pt14ZE4jVPGvfB2NynGsl34pgXfOqum5YJNpDK4+b9E=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7a20c208aacf4964c19186dcad51f89165dc7ed0",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"pkgs-cargo2nix": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1655189312,
"narHash": "sha256-gpJ57OgIebUpO+7F00VltxSEy6dz2x6HeJ5BcRM8rDA=",
"owner": "cargo2nix",
"repo": "cargo2nix",
"rev": "c149357cc3d17f2849c73eb7a09d07a307cdcfe8",
"type": "github"
},
"original": {
"owner": "cargo2nix",
"repo": "cargo2nix",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"pkgs-cargo2nix": "pkgs-cargo2nix",
"unstable": "unstable"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"pkgs-cargo2nix",
"flake-utils"
],
"nixpkgs": [
"pkgs-cargo2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1653878966,
"narHash": "sha256-T51Gck/vrJZi1m+uTbhEFTRgZmE59sydVONadADv358=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "8526d618af012a923ca116be9603e818b502a8db",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"unstable": {
"locked": {
"lastModified": 1680125544,
"narHash": "sha256-mlqo1r+TZUOuypWdrZHluxWL+E5WzXlUXNZ9Y0WLDFU=",
"lastModified": 1680398059,
"narHash": "sha256-qtbKRe+pWuf5nNINdiCgn6EwOIQZxj0Ig/wybBpFNkQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9a6aabc4740790ef3bbb246b86d029ccf6759658",
"rev": "7c656856e9eb863c4d21c83e2601dd77f95f6941",
"type": "github"
},
"original": {

View File

@ -4,9 +4,10 @@
inputs = {
nixpkgs.url = "nixpkgs/nixos-22.11";
unstable.url = "nixpkgs/nixos-unstable";
pkgs-cargo2nix.url = "github:cargo2nix/cargo2nix";
};
outputs = { self, nixpkgs, unstable }:
outputs = { self, nixpkgs, unstable, pkgs-cargo2nix, ... }:
let
version = builtins.string 0 8 self.lastModifiedDate;
supportedSystems = [ "x86_64-linux" ];
@ -16,6 +17,7 @@
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
pkgs-unstable = import unstable { system = "x86_64-linux"; };
cargo2nix = pkgs-cargo2nix.packages."x86_64-linux";
in
pkgs.mkShell {
name = "ld-tools-devshell";
@ -36,8 +38,46 @@
pkgs.pkg-config
pkgs.sqlite
pkgs.rustup
pkgs.crate2nix
];
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
};
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 // {
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;
kifu-gtk = attrs: {
nativeBuildInputs = [
pkgs.glib
];
};
};
};
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;
};
};
}

4918
kifu/kifu-gtk/Cargo.nix Normal file

File diff suppressed because it is too large Load Diff

3
rust-toolchain.toml Normal file
View File

@ -0,0 +1,3 @@
[toolchain]
channel = "1.68.2"
components = ["rust-src"]