Attempt to build from the results of crate2nix

This commit is contained in:
Savanni D'Gerinel 2023-04-02 15:48:12 -04:00
parent 4ad20dd1dc
commit 2c1ea95f0f
3 changed files with 3781 additions and 113 deletions

View File

@ -1,43 +1,6 @@
{ {
"nodes": { "nodes": {
"crane": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1679811681,
"narHash": "sha256-gc0lwuQxtKnUzdyfmHT6wKEuSdvn5KlRcXNkWT1/4hs=",
"owner": "ipetkov",
"repo": "crane",
"rev": "72fa29510a9ce61ea7455b4469507808684f5673",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1650374568, "lastModified": 1650374568,
@ -54,21 +17,6 @@
} }
}, },
"flake-utils": { "flake-utils": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": { "locked": {
"lastModified": 1653893745, "lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
@ -84,22 +32,6 @@
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1677655566,
"narHash": "sha256-I8G8Lmpp3YduYl4+pkiIJFGT1WKw+8ZMH2QwANkTu2U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ae8bdd2de4c23b239b5a771501641d2ef5e027d0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1679748960, "lastModified": 1679748960,
"narHash": "sha256-BP8XcYHyj1NxQi04RpyNW8e7KiXSoI+Fy1tXIK2GfdA=", "narHash": "sha256-BP8XcYHyj1NxQi04RpyNW8e7KiXSoI+Fy1tXIK2GfdA=",
@ -114,13 +46,13 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_3": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1654275867, "lastModified": 1672580127,
"narHash": "sha256-pt14ZE4jVPGvfB2NynGsl34pgXfOqum5YJNpDK4+b9E=", "narHash": "sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7a20c208aacf4964c19186dcad51f89165dc7ed0", "rev": "0874168639713f547c05947c76124f78441ea46c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -132,10 +64,10 @@
}, },
"pkgs-cargo2nix": { "pkgs-cargo2nix": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat",
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay_2" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1655189312, "lastModified": 1655189312,
@ -153,38 +85,12 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"crane": "crane", "nixpkgs": "nixpkgs",
"nixpkgs": "nixpkgs_2",
"pkgs-cargo2nix": "pkgs-cargo2nix", "pkgs-cargo2nix": "pkgs-cargo2nix",
"unstable": "unstable" "unstable": "unstable"
} }
}, },
"rust-overlay": { "rust-overlay": {
"inputs": {
"flake-utils": [
"crane",
"flake-utils"
],
"nixpkgs": [
"crane",
"nixpkgs"
]
},
"locked": {
"lastModified": 1677812689,
"narHash": "sha256-EakqhgRnjVeYJv5+BJx/NZ7/eFTMBxc4AhICUNquhUg=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "e53e8853aa7b0688bc270e9e6a681d22e01cf299",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
"pkgs-cargo2nix", "pkgs-cargo2nix",

View File

@ -5,14 +5,12 @@
nixpkgs.url = "nixpkgs/nixos-22.11"; nixpkgs.url = "nixpkgs/nixos-22.11";
unstable.url = "nixpkgs/nixos-unstable"; unstable.url = "nixpkgs/nixos-unstable";
pkgs-cargo2nix.url = "github:cargo2nix/cargo2nix"; pkgs-cargo2nix.url = "github:cargo2nix/cargo2nix";
crane.url = "github:ipetkov/crane";
}; };
outputs = { self, nixpkgs, unstable, pkgs-cargo2nix, crane, ... }: outputs = { self, nixpkgs, unstable, pkgs-cargo2nix, ... }:
let let
version = builtins.string 0 8 self.lastModifiedDate; version = builtins.string 0 8 self.lastModifiedDate;
supportedSystems = [ "x86_64-linux" ]; supportedSystems = [ "x86_64-linux" ];
craneLib = crane.lib."x86_64-linux";
in in
{ {
devShell."x86_64-linux" = devShell."x86_64-linux" =
@ -40,16 +38,46 @@
pkgs.pkg-config pkgs.pkg-config
pkgs.sqlite pkgs.sqlite
pkgs.rustup pkgs.rustup
pkgs.crate2nix
]; ];
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib"; LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
}; };
packages."x86_64-linux" = { packages."x86_64-linux" =
kifu-core = craneLib.buildPackage { let
src = craneLib.cleanCargoSource (craneLib.path ./kifu/kifu-core); pkgs = import nixpkgs { system = "x86_64-linux"; };
customBuildInfo = pkgs: pkgs.buildRustCrate.override {
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
gobject-sys = attrs: {
nativeBuildInputs = [
pkgs.pkg-config
pkgs.wrapGAppsHook4
pkgs.gtk4
pkgs.glib
];
};
graphene-sys = attrs: {
nativeBuildInputs = [
pkgs.pkg-config
pkgs.wrapGAppsHook4
pkgs.gtk4
pkgs.glib
];
};
cairo-sys = attrs: {
nativeBuildInputs = [
pkgs.pkg-config
pkgs.wrapGAppsHook4
pkgs.gtk4
pkgs.glib
];
};
};
};
in {
kifu-gtk = (import ./kifu/kifu-gtk/Cargo.nix {
inherit pkgs;
buildRustCrateForPkgs = customBuildInfo;
}).rootCrate.build;
}; };
kifu-gtk = craneLib.buildPackage {
src = craneLib.cleanCargoSource (craneLib.path ./kifu/kifu-gtk);
};
};
}; };
} }

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

File diff suppressed because it is too large Load Diff