resources_demo/Cargo.nix

3012 lines
91 KiB
Nix
Raw Permalink Normal View History

2024-01-25 17:07:38 +00:00
# This file was @generated by crate2nix 0.11.0 with the command:
# "generate"
# See https://github.com/kolloch/crate2nix for more info.
{ nixpkgs ? <nixpkgs>
, pkgs ? import nixpkgs { config = {}; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, buildRustCrateForPkgs ? pkgs: pkgs.buildRustCrate
# This is used as the `crateOverrides` argument for `buildRustCrate`.
, defaultCrateOverrides ? pkgs.defaultCrateOverrides
# The features to enable for the root_crate or the workspace_members.
, rootFeatures ? [ "default" ]
# If true, throw errors instead of issueing deprecation warnings.
, strictDeprecation ? false
# Used for conditional compilation based on CPU feature detection.
, targetFeatures ? []
# Whether to perform release builds: longer compile times, faster binaries.
, release ? true
# Additional crate2nix configuration if it exists.
, crateConfig
? if builtins.pathExists ./crate-config.nix
then pkgs.callPackage ./crate-config.nix {}
else {}
}:
rec {
#
# "public" attributes that we attempt to keep stable with new versions of crate2nix.
#
rootCrate = rec {
packageId = "resources_demo";
# Use this attribute to refer to the derivation building your root crate package.
# You can override the features with rootCrate.build.override { features = [ "default" "feature1" ... ]; }.
build = internal.buildRustCrateWithFeatures {
inherit packageId;
};
# Debug support which might change between releases.
# File a bug if you depend on any for non-debug work!
debug = internal.debugCrate { inherit packageId; };
};
# Refer your crate build derivation by name here.
# You can override the features with
# workspaceMembers."${crateName}".build.override { features = [ "default" "feature1" ... ]; }.
workspaceMembers = {
"resources_demo" = rec {
packageId = "resources_demo";
build = internal.buildRustCrateWithFeatures {
packageId = "resources_demo";
};
# Debug support which might change between releases.
# File a bug if you depend on any for non-debug work!
debug = internal.debugCrate { inherit packageId; };
};
};
# A derivation that joins the outputs of all workspace members together.
allWorkspaceMembers = pkgs.symlinkJoin {
name = "all-workspace-members";
paths =
let members = builtins.attrValues workspaceMembers;
in builtins.map (m: m.build) members;
};
#
# "internal" ("private") attributes that may change in every new version of crate2nix.
#
internal = rec {
# Build and dependency information for crates.
# Many of the fields are passed one-to-one to buildRustCrate.
#
# Noteworthy:
# * `dependencies`/`buildDependencies`: similar to the corresponding fields for buildRustCrate.
# but with additional information which is used during dependency/feature resolution.
# * `resolvedDependencies`: the selected default features reported by cargo - only included for debugging.
# * `devDependencies` as of now not used by `buildRustCrate` but used to
# inject test dependencies into the build
crates = {
"anyhow" = rec {
crateName = "anyhow";
version = "1.0.79";
edition = "2018";
sha256 = "1ji5irqiwr8yprgqj8zvnli7zd7fz9kzaiddq44jnrl2l289h3h8";
authors = [
"David Tolnay <dtolnay@gmail.com>"
];
features = {
"backtrace" = [ "dep:backtrace" ];
"default" = [ "std" ];
};
resolvedDefaultFeatures = [ "default" "std" ];
};
"autocfg" = rec {
crateName = "autocfg";
version = "1.1.0";
edition = "2015";
sha256 = "1ylp3cb47ylzabimazvbz9ms6ap784zhb6syaz6c1jqpmcmq0s6l";
authors = [
"Josh Stone <cuviper@gmail.com>"
];
};
"bitflags" = rec {
crateName = "bitflags";
version = "2.4.2";
edition = "2021";
sha256 = "1pqd142hyqlzr7p9djxq2ff0jx07a2sb2xp9lhw69cbf80s0jmzd";
authors = [
"The Rust Project Developers"
];
features = {
"arbitrary" = [ "dep:arbitrary" ];
"bytemuck" = [ "dep:bytemuck" ];
"compiler_builtins" = [ "dep:compiler_builtins" ];
"core" = [ "dep:core" ];
"rustc-dep-of-std" = [ "core" "compiler_builtins" ];
"serde" = [ "dep:serde" ];
};
};
"cairo-rs" = rec {
crateName = "cairo-rs";
version = "0.18.5";
edition = "2021";
sha256 = "1qjfkcq3mrh3p01nnn71dy3kn99g21xx3j8xcdvzn8ll2pq6x8lc";
libName = "cairo";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "bitflags";
packageId = "bitflags";
}
{
name = "cairo-sys-rs";
packageId = "cairo-sys-rs";
rename = "ffi";
}
{
name = "glib";
packageId = "glib";
optional = true;
}
{
name = "libc";
packageId = "libc";
}
{
name = "once_cell";
packageId = "once_cell";
}
{
name = "thiserror";
packageId = "thiserror";
}
];
features = {
"default" = [ "use_glib" ];
"freetype" = [ "ffi/freetype" "freetype-rs" ];
"freetype-rs" = [ "dep:freetype-rs" ];
"glib" = [ "dep:glib" ];
"pdf" = [ "ffi/pdf" ];
"png" = [ "ffi/png" ];
"ps" = [ "ffi/ps" ];
"script" = [ "ffi/script" ];
"svg" = [ "ffi/svg" ];
"use_glib" = [ "glib" "ffi/use_glib" ];
"v1_16" = [ "ffi/v1_16" ];
"v1_18" = [ "v1_16" "ffi/v1_18" ];
"win32-surface" = [ "ffi/win32-surface" ];
"xcb" = [ "ffi/xcb" ];
"xlib" = [ "ffi/xlib" ];
};
resolvedDefaultFeatures = [ "default" "glib" "use_glib" ];
};
"cairo-sys-rs" = rec {
crateName = "cairo-sys-rs";
version = "0.18.2";
edition = "2021";
sha256 = "0lfsxl7ylw3phbnwmz3k58j1gnqi6kc2hdc7g3bb7f4hwnl9yp38";
libName = "cairo_sys";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "glib-sys";
packageId = "glib-sys";
rename = "glib";
optional = true;
}
{
name = "libc";
packageId = "libc";
}
];
buildDependencies = [
{
name = "system-deps";
packageId = "system-deps";
}
];
features = {
"glib" = [ "dep:glib" ];
"use_glib" = [ "glib" ];
"v1_18" = [ "v1_16" ];
"win32-surface" = [ "winapi" ];
"winapi" = [ "dep:winapi" ];
"x11" = [ "dep:x11" ];
"xlib" = [ "x11" ];
};
resolvedDefaultFeatures = [ "glib" "use_glib" ];
};
"cfg-expr" = rec {
crateName = "cfg-expr";
version = "0.15.6";
edition = "2021";
sha256 = "06m4hbpzgjn8m2r8sy5xywrd6ja8d1sjgjwmimwl1610nrbvq031";
authors = [
"Embark <opensource@embark-studios.com>"
"Jake Shadle <jake.shadle@embark-studios.com>"
];
dependencies = [
{
name = "smallvec";
packageId = "smallvec";
}
{
name = "target-lexicon";
packageId = "target-lexicon";
optional = true;
}
];
features = {
"target-lexicon" = [ "dep:target-lexicon" ];
"targets" = [ "target-lexicon" ];
};
resolvedDefaultFeatures = [ "default" "target-lexicon" "targets" ];
};
"equivalent" = rec {
crateName = "equivalent";
version = "1.0.1";
edition = "2015";
sha256 = "1malmx5f4lkfvqasz319lq6gb3ddg19yzf9s8cykfsgzdmyq0hsl";
};
"field-offset" = rec {
crateName = "field-offset";
version = "0.3.6";
edition = "2015";
sha256 = "0zq5sssaa2ckmcmxxbly8qgz3sxpb8g1lwv90sdh1z74qif2gqiq";
authors = [
"Diggory Blake <diggsey@googlemail.com>"
];
dependencies = [
{
name = "memoffset";
packageId = "memoffset";
}
];
buildDependencies = [
{
name = "rustc_version";
packageId = "rustc_version";
}
];
};
"futures-channel" = rec {
crateName = "futures-channel";
version = "0.3.30";
edition = "2018";
sha256 = "0y6b7xxqdjm9hlcjpakcg41qfl7lihf6gavk8fyqijsxhvbzgj7a";
dependencies = [
{
name = "futures-core";
packageId = "futures-core";
usesDefaultFeatures = false;
}
];
features = {
"alloc" = [ "futures-core/alloc" ];
"default" = [ "std" ];
"futures-sink" = [ "dep:futures-sink" ];
"sink" = [ "futures-sink" ];
"std" = [ "alloc" "futures-core/std" ];
};
resolvedDefaultFeatures = [ "alloc" "default" "std" ];
};
"futures-core" = rec {
crateName = "futures-core";
version = "0.3.30";
edition = "2018";
sha256 = "07aslayrn3lbggj54kci0ishmd1pr367fp7iks7adia1p05miinz";
features = {
"default" = [ "std" ];
"portable-atomic" = [ "dep:portable-atomic" ];
"std" = [ "alloc" ];
};
resolvedDefaultFeatures = [ "alloc" "std" ];
};
"futures-executor" = rec {
crateName = "futures-executor";
version = "0.3.30";
edition = "2018";
sha256 = "07dh08gs9vfll2h36kq32q9xd86xm6lyl9xikmmwlkqnmrrgqxm5";
dependencies = [
{
name = "futures-core";
packageId = "futures-core";
usesDefaultFeatures = false;
}
{
name = "futures-task";
packageId = "futures-task";
usesDefaultFeatures = false;
}
{
name = "futures-util";
packageId = "futures-util";
usesDefaultFeatures = false;
}
];
features = {
"default" = [ "std" ];
"num_cpus" = [ "dep:num_cpus" ];
"std" = [ "futures-core/std" "futures-task/std" "futures-util/std" ];
"thread-pool" = [ "std" "num_cpus" ];
};
resolvedDefaultFeatures = [ "default" "std" ];
};
"futures-io" = rec {
crateName = "futures-io";
version = "0.3.30";
edition = "2018";
sha256 = "1hgh25isvsr4ybibywhr4dpys8mjnscw4wfxxwca70cn1gi26im4";
features = {
"default" = [ "std" ];
};
resolvedDefaultFeatures = [ "default" "std" ];
};
"futures-macro" = rec {
crateName = "futures-macro";
version = "0.3.30";
edition = "2018";
sha256 = "1b49qh9d402y8nka4q6wvvj0c88qq91wbr192mdn5h54nzs0qxc7";
procMacro = true;
dependencies = [
{
name = "proc-macro2";
packageId = "proc-macro2";
}
{
name = "quote";
packageId = "quote";
}
{
name = "syn";
packageId = "syn 2.0.48";
features = [ "full" ];
}
];
};
"futures-task" = rec {
crateName = "futures-task";
version = "0.3.30";
edition = "2018";
sha256 = "013h1724454hj8qczp8vvs10qfiqrxr937qsrv6rhii68ahlzn1q";
features = {
"default" = [ "std" ];
"std" = [ "alloc" ];
};
resolvedDefaultFeatures = [ "alloc" "std" ];
};
"futures-util" = rec {
crateName = "futures-util";
version = "0.3.30";
edition = "2018";
sha256 = "0j0xqhcir1zf2dcbpd421kgw6wvsk0rpxflylcysn1rlp3g02r1x";
dependencies = [
{
name = "futures-core";
packageId = "futures-core";
usesDefaultFeatures = false;
}
{
name = "futures-macro";
packageId = "futures-macro";
optional = true;
usesDefaultFeatures = false;
}
{
name = "futures-task";
packageId = "futures-task";
usesDefaultFeatures = false;
}
{
name = "pin-project-lite";
packageId = "pin-project-lite";
}
{
name = "pin-utils";
packageId = "pin-utils";
}
{
name = "slab";
packageId = "slab";
optional = true;
}
];
features = {
"alloc" = [ "futures-core/alloc" "futures-task/alloc" ];
"async-await-macro" = [ "async-await" "futures-macro" ];
"channel" = [ "std" "futures-channel" ];
"compat" = [ "std" "futures_01" ];
"default" = [ "std" "async-await" "async-await-macro" ];
"futures-channel" = [ "dep:futures-channel" ];
"futures-io" = [ "dep:futures-io" ];
"futures-macro" = [ "dep:futures-macro" ];
"futures-sink" = [ "dep:futures-sink" ];
"futures_01" = [ "dep:futures_01" ];
"io" = [ "std" "futures-io" "memchr" ];
"io-compat" = [ "io" "compat" "tokio-io" ];
"memchr" = [ "dep:memchr" ];
"portable-atomic" = [ "futures-core/portable-atomic" ];
"sink" = [ "futures-sink" ];
"slab" = [ "dep:slab" ];
"std" = [ "alloc" "futures-core/std" "futures-task/std" "slab" ];
"tokio-io" = [ "dep:tokio-io" ];
"unstable" = [ "futures-core/unstable" "futures-task/unstable" ];
"write-all-vectored" = [ "io" ];
};
resolvedDefaultFeatures = [ "alloc" "async-await" "async-await-macro" "default" "futures-macro" "slab" "std" ];
};
"gdk-pixbuf" = rec {
crateName = "gdk-pixbuf";
version = "0.18.5";
edition = "2021";
sha256 = "1v7svvl0g7zybndmis5inaqqgi1mvcc6s1n8rkb31f5zn3qzbqah";
libName = "gdk_pixbuf";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "gdk-pixbuf-sys";
packageId = "gdk-pixbuf-sys";
rename = "ffi";
}
{
name = "gio";
packageId = "gio";
}
{
name = "glib";
packageId = "glib";
}
{
name = "libc";
packageId = "libc";
}
{
name = "once_cell";
packageId = "once_cell";
}
];
features = {
"v2_40" = [ "ffi/v2_40" ];
"v2_42" = [ "v2_40" "ffi/v2_42" ];
};
};
"gdk-pixbuf-sys" = rec {
crateName = "gdk-pixbuf-sys";
version = "0.18.0";
edition = "2021";
sha256 = "1xya543c4ffd2n7aiwwrdxsyc9casdbasafi6ixcknafckm3k61z";
libName = "gdk_pixbuf_sys";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "gio-sys";
packageId = "gio-sys";
rename = "gio";
}
{
name = "glib-sys";
packageId = "glib-sys";
rename = "glib";
}
{
name = "gobject-sys";
packageId = "gobject-sys";
rename = "gobject";
}
{
name = "libc";
packageId = "libc";
}
];
buildDependencies = [
{
name = "system-deps";
packageId = "system-deps";
}
];
features = {
"v2_42" = [ "v2_40" ];
};
};
"gdk4" = rec {
crateName = "gdk4";
version = "0.7.3";
edition = "2021";
sha256 = "1xiacc63p73apr033gjrb9dsk0y4yxnsljwfxbwfry41snd03nvy";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "cairo-rs";
packageId = "cairo-rs";
}
{
name = "gdk-pixbuf";
packageId = "gdk-pixbuf";
}
{
name = "gdk4-sys";
packageId = "gdk4-sys";
rename = "ffi";
}
{
name = "gio";
packageId = "gio";
features = [ "v2_66" ];
}
{
name = "glib";
packageId = "glib";
features = [ "v2_66" ];
}
{
name = "libc";
packageId = "libc";
}
{
name = "pango";
packageId = "pango";
features = [ "v1_46" ];
}
];
features = {
"gl" = [ "dep:gl" ];
"v4_10" = [ "ffi/v4_10" "v4_8" ];
"v4_12" = [ "ffi/v4_12" "v4_10" ];
"v4_2" = [ "ffi/v4_2" ];
"v4_4" = [ "ffi/v4_4" "v4_2" ];
"v4_6" = [ "ffi/v4_6" "v4_4" ];
"v4_8" = [ "ffi/v4_8" "v4_6" ];
};
resolvedDefaultFeatures = [ "v4_10" "v4_2" "v4_4" "v4_6" "v4_8" ];
};
"gdk4-sys" = rec {
crateName = "gdk4-sys";
version = "0.7.2";
edition = "2021";
sha256 = "1w7yvir565sjrrw828lss07749hfpfsr19jdjzwivkx36brl7ayv";
libName = "gdk4_sys";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "cairo-sys-rs";
packageId = "cairo-sys-rs";
rename = "cairo";
}
{
name = "gdk-pixbuf-sys";
packageId = "gdk-pixbuf-sys";
rename = "gdk_pixbuf";
}
{
name = "gio-sys";
packageId = "gio-sys";
rename = "gio";
}
{
name = "glib-sys";
packageId = "glib-sys";
rename = "glib";
}
{
name = "gobject-sys";
packageId = "gobject-sys";
rename = "gobject";
}
{
name = "libc";
packageId = "libc";
}
{
name = "pango-sys";
packageId = "pango-sys";
rename = "pango";
}
];
buildDependencies = [
{
name = "pkg-config";
packageId = "pkg-config";
}
{
name = "system-deps";
packageId = "system-deps";
}
];
features = {
"v4_10" = [ "v4_8" ];
"v4_12" = [ "v4_10" ];
"v4_4" = [ "v4_2" ];
"v4_6" = [ "v4_4" ];
"v4_8" = [ "v4_6" ];
};
resolvedDefaultFeatures = [ "v4_10" "v4_2" "v4_4" "v4_6" "v4_8" ];
};
"gio" = rec {
crateName = "gio";
version = "0.18.4";
edition = "2021";
sha256 = "0wsc6mnx057s4ailacg99dwgna38dbqli5x7a6y9rdw75x9qzz6l";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "futures-channel";
packageId = "futures-channel";
}
{
name = "futures-core";
packageId = "futures-core";
usesDefaultFeatures = false;
}
{
name = "futures-io";
packageId = "futures-io";
}
{
name = "futures-util";
packageId = "futures-util";
usesDefaultFeatures = false;
}
{
name = "gio-sys";
packageId = "gio-sys";
rename = "ffi";
}
{
name = "glib";
packageId = "glib";
}
{
name = "libc";
packageId = "libc";
}
{
name = "once_cell";
packageId = "once_cell";
}
{
name = "pin-project-lite";
packageId = "pin-project-lite";
}
{
name = "smallvec";
packageId = "smallvec";
}
{
name = "thiserror";
packageId = "thiserror";
}
];
devDependencies = [
{
name = "futures-util";
packageId = "futures-util";
features = [ "io" ];
}
];
features = {
"v2_58" = [ "ffi/v2_58" "glib/v2_58" ];
"v2_60" = [ "v2_58" "ffi/v2_60" "glib/v2_60" ];
"v2_62" = [ "v2_60" "ffi/v2_62" "glib/v2_62" ];
"v2_64" = [ "v2_62" "ffi/v2_64" "glib/v2_64" ];
"v2_66" = [ "v2_64" "ffi/v2_66" "glib/v2_66" ];
"v2_68" = [ "v2_66" "ffi/v2_68" "glib/v2_68" ];
"v2_70" = [ "v2_68" "ffi/v2_70" "glib/v2_70" ];
"v2_72" = [ "v2_70" "ffi/v2_72" "glib/v2_72" ];
"v2_74" = [ "v2_72" "ffi/v2_74" "glib/v2_74" ];
"v2_76" = [ "v2_74" "ffi/v2_76" "glib/v2_76" ];
"v2_78" = [ "v2_76" "ffi/v2_78" "glib/v2_78" ];
};
resolvedDefaultFeatures = [ "v2_58" "v2_60" "v2_62" "v2_64" "v2_66" ];
};
"gio-sys" = rec {
crateName = "gio-sys";
version = "0.18.1";
edition = "2021";
sha256 = "1lip8z35iy9d184x2qwjxlbxi64q9cpayy7v1p5y9xdsa3w6smip";
libName = "gio_sys";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "glib-sys";
packageId = "glib-sys";
rename = "glib";
}
{
name = "gobject-sys";
packageId = "gobject-sys";
rename = "gobject";
}
{
name = "libc";
packageId = "libc";
}
{
name = "winapi";
packageId = "winapi";
target = { target, features }: (target."windows" or false);
features = [ "ws2def" "winsock2" ];
}
];
buildDependencies = [
{
name = "system-deps";
packageId = "system-deps";
}
];
features = {
"v2_60" = [ "v2_58" ];
"v2_62" = [ "v2_60" ];
"v2_64" = [ "v2_62" ];
"v2_66" = [ "v2_64" ];
"v2_68" = [ "v2_66" ];
"v2_70" = [ "v2_68" ];
"v2_72" = [ "v2_70" ];
"v2_74" = [ "v2_72" ];
"v2_76" = [ "v2_74" ];
"v2_78" = [ "v2_76" ];
};
resolvedDefaultFeatures = [ "v2_58" "v2_60" "v2_62" "v2_64" "v2_66" ];
};
"glib" = rec {
crateName = "glib";
version = "0.18.5";
edition = "2021";
sha256 = "1r8fw0627nmn19bgk3xpmcfngx3wkn7mcpq5a8ma3risx3valg93";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "bitflags";
packageId = "bitflags";
}
{
name = "futures-channel";
packageId = "futures-channel";
}
{
name = "futures-core";
packageId = "futures-core";
usesDefaultFeatures = false;
}
{
name = "futures-executor";
packageId = "futures-executor";
}
{
name = "futures-task";
packageId = "futures-task";
usesDefaultFeatures = false;
}
{
name = "futures-util";
packageId = "futures-util";
}
{
name = "gio-sys";
packageId = "gio-sys";
rename = "gio_ffi";
optional = true;
}
{
name = "glib-macros";
packageId = "glib-macros";
}
{
name = "glib-sys";
packageId = "glib-sys";
rename = "ffi";
}
{
name = "gobject-sys";
packageId = "gobject-sys";
rename = "gobject_ffi";
}
{
name = "libc";
packageId = "libc";
}
{
name = "memchr";
packageId = "memchr";
}
{
name = "once_cell";
packageId = "once_cell";
}
{
name = "smallvec";
packageId = "smallvec";
features = [ "union" "const_generics" "const_new" ];
}
{
name = "thiserror";
packageId = "thiserror";
}
];
features = {
"default" = [ "gio" ];
"gio" = [ "gio_ffi" ];
"gio_ffi" = [ "dep:gio_ffi" ];
"log" = [ "rs-log" ];
"log_macros" = [ "log" ];
"rs-log" = [ "dep:rs-log" ];
"v2_58" = [ "ffi/v2_58" "gobject_ffi/v2_58" ];
"v2_60" = [ "v2_58" "ffi/v2_60" ];
"v2_62" = [ "v2_60" "ffi/v2_62" "gobject_ffi/v2_62" ];
"v2_64" = [ "v2_62" "ffi/v2_64" ];
"v2_66" = [ "v2_64" "ffi/v2_66" "gobject_ffi/v2_66" ];
"v2_68" = [ "v2_66" "ffi/v2_68" "gobject_ffi/v2_68" ];
"v2_70" = [ "v2_68" "ffi/v2_70" "gobject_ffi/v2_70" ];
"v2_72" = [ "v2_70" "ffi/v2_72" "gobject_ffi/v2_72" ];
"v2_74" = [ "v2_72" "ffi/v2_74" "gobject_ffi/v2_74" ];
"v2_76" = [ "v2_74" "ffi/v2_76" "gobject_ffi/v2_76" ];
"v2_78" = [ "v2_76" "ffi/v2_78" "gobject_ffi/v2_78" ];
};
resolvedDefaultFeatures = [ "default" "gio" "gio_ffi" "v2_58" "v2_60" "v2_62" "v2_64" "v2_66" ];
};
"glib-build-tools" = rec {
crateName = "glib-build-tools";
version = "0.18.0";
edition = "2021";
sha256 = "0p5c2ayiam5bkp9wvq9f9ihwp06nqs5j801npjlwnhrl8rpwac9l";
authors = [
"The gtk-rs Project Developers"
];
features = {
"gio" = [ "dep:gio" ];
};
};
"glib-macros" = rec {
crateName = "glib-macros";
version = "0.18.5";
edition = "2021";
sha256 = "1p5cla53fcp195zp0hkqpmnn7iwmkdswhy7xh34002bw8y7j5c0b";
procMacro = true;
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "heck";
packageId = "heck";
}
{
name = "proc-macro-crate";
packageId = "proc-macro-crate 2.0.1";
}
{
name = "proc-macro-error";
packageId = "proc-macro-error";
}
{
name = "proc-macro2";
packageId = "proc-macro2";
}
{
name = "quote";
packageId = "quote";
}
{
name = "syn";
packageId = "syn 2.0.48";
features = [ "full" ];
}
];
};
"glib-sys" = rec {
crateName = "glib-sys";
version = "0.18.1";
edition = "2021";
sha256 = "164qhsfmlzd5mhyxs8123jzbdfldwxbikfpq5cysj3lddbmy4g06";
libName = "glib_sys";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "libc";
packageId = "libc";
}
];
buildDependencies = [
{
name = "system-deps";
packageId = "system-deps";
}
];
features = {
"v2_60" = [ "v2_58" ];
"v2_62" = [ "v2_60" ];
"v2_64" = [ "v2_62" ];
"v2_66" = [ "v2_64" ];
"v2_68" = [ "v2_66" ];
"v2_70" = [ "v2_68" ];
"v2_72" = [ "v2_70" ];
"v2_74" = [ "v2_72" ];
"v2_76" = [ "v2_74" ];
"v2_78" = [ "v2_76" ];
};
resolvedDefaultFeatures = [ "v2_58" "v2_60" "v2_62" "v2_64" "v2_66" ];
};
"gobject-sys" = rec {
crateName = "gobject-sys";
version = "0.18.0";
edition = "2021";
sha256 = "0i6fhp3m6vs3wkzyc22rk2cqj68qvgddxmpaai34l72da5xi4l08";
libName = "gobject_sys";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "glib-sys";
packageId = "glib-sys";
rename = "glib";
}
{
name = "libc";
packageId = "libc";
}
];
buildDependencies = [
{
name = "system-deps";
packageId = "system-deps";
}
];
features = {
"v2_62" = [ "v2_58" ];
"v2_66" = [ "v2_62" ];
"v2_68" = [ "v2_66" ];
"v2_70" = [ "v2_68" ];
"v2_72" = [ "v2_70" ];
"v2_74" = [ "v2_72" ];
"v2_76" = [ "v2_74" ];
"v2_78" = [ "v2_74" ];
};
resolvedDefaultFeatures = [ "v2_58" "v2_62" "v2_66" ];
};
"graphene-rs" = rec {
crateName = "graphene-rs";
version = "0.18.1";
edition = "2021";
sha256 = "00f4q1ra4haap5i7lazwhkdgnb49fs8adk2nm6ki6mjhl76jh8iv";
libName = "graphene";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "glib";
packageId = "glib";
}
{
name = "graphene-sys";
packageId = "graphene-sys";
rename = "ffi";
}
{
name = "libc";
packageId = "libc";
}
];
features = {
"v1_12" = [ "ffi/v1_12" ];
};
};
"graphene-sys" = rec {
crateName = "graphene-sys";
version = "0.18.1";
edition = "2021";
sha256 = "0n8zlg7z26lwpnvlqp1hjlgrs671skqwagdpm7r8i1zwx3748hfc";
libName = "graphene_sys";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "glib-sys";
packageId = "glib-sys";
rename = "glib";
}
{
name = "libc";
packageId = "libc";
}
];
buildDependencies = [
{
name = "pkg-config";
packageId = "pkg-config";
}
{
name = "system-deps";
packageId = "system-deps";
}
];
features = {
};
};
"gsk4" = rec {
crateName = "gsk4";
version = "0.7.3";
edition = "2021";
sha256 = "0zhzs2dkgiinhgc11akpn2harq3x5n1iq21dnc4h689g3lsqx58d";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "cairo-rs";
packageId = "cairo-rs";
}
{
name = "gdk4";
packageId = "gdk4";
rename = "gdk";
}
{
name = "glib";
packageId = "glib";
features = [ "v2_66" ];
}
{
name = "graphene-rs";
packageId = "graphene-rs";
rename = "graphene";
}
{
name = "gsk4-sys";
packageId = "gsk4-sys";
rename = "ffi";
}
{
name = "libc";
packageId = "libc";
}
{
name = "pango";
packageId = "pango";
features = [ "v1_46" ];
}
];
features = {
"broadway" = [ "ffi/broadway" ];
"v4_10" = [ "ffi/v4_10" "gdk/v4_10" "v4_6" ];
"v4_14" = [ "ffi/v4_14" "v4_10" ];
"v4_2" = [ "ffi/v4_2" "gdk/v4_2" ];
"v4_4" = [ "ffi/v4_4" "gdk/v4_4" "v4_2" ];
"v4_6" = [ "ffi/v4_6" "gdk/v4_6" "v4_4" ];
"vulkan" = [ "ffi/vulkan" ];
};
resolvedDefaultFeatures = [ "v4_10" "v4_2" "v4_4" "v4_6" ];
};
"gsk4-sys" = rec {
crateName = "gsk4-sys";
version = "0.7.3";
edition = "2021";
sha256 = "0mbdlm9qi1hql48rr29vsj9vlqwc7gxg67wg1q19z67azwz9xg8j";
libName = "gsk4_sys";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "cairo-sys-rs";
packageId = "cairo-sys-rs";
rename = "cairo";
}
{
name = "gdk4-sys";
packageId = "gdk4-sys";
rename = "gdk";
}
{
name = "glib-sys";
packageId = "glib-sys";
rename = "glib";
}
{
name = "gobject-sys";
packageId = "gobject-sys";
rename = "gobject";
}
{
name = "graphene-sys";
packageId = "graphene-sys";
rename = "graphene";
}
{
name = "libc";
packageId = "libc";
}
{
name = "pango-sys";
packageId = "pango-sys";
rename = "pango";
}
];
buildDependencies = [
{
name = "system-deps";
packageId = "system-deps";
}
];
features = {
"v4_10" = [ "v4_6" ];
"v4_14" = [ "v4_10" ];
"v4_4" = [ "v4_2" ];
"v4_6" = [ "v4_4" ];
};
resolvedDefaultFeatures = [ "v4_10" "v4_2" "v4_4" "v4_6" ];
};
"gtk4" = rec {
crateName = "gtk4";
version = "0.7.3";
edition = "2021";
sha256 = "0hh8nzglmz94v1m1h6vy8z12m6fr7ia467ry0md5fa4p7sm53sss";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "cairo-rs";
packageId = "cairo-rs";
}
{
name = "field-offset";
packageId = "field-offset";
}
{
name = "futures-channel";
packageId = "futures-channel";
}
{
name = "gdk-pixbuf";
packageId = "gdk-pixbuf";
}
{
name = "gdk4";
packageId = "gdk4";
rename = "gdk";
}
{
name = "gio";
packageId = "gio";
features = [ "v2_66" ];
}
{
name = "glib";
packageId = "glib";
features = [ "v2_66" ];
}
{
name = "graphene-rs";
packageId = "graphene-rs";
rename = "graphene";
}
{
name = "gsk4";
packageId = "gsk4";
rename = "gsk";
}
{
name = "gtk4-macros";
packageId = "gtk4-macros";
}
{
name = "gtk4-sys";
packageId = "gtk4-sys";
rename = "ffi";
}
{
name = "libc";
packageId = "libc";
}
{
name = "pango";
packageId = "pango";
features = [ "v1_46" ];
}
];
features = {
"blueprint" = [ "gtk4-macros/blueprint" ];
"gnome_42" = [ "v4_6" "cairo-rs/v1_16" "gdk-pixbuf/v2_42" "gio/v2_72" ];
"gnome_43" = [ "v4_8" "cairo-rs/v1_16" "gdk-pixbuf/v2_42" "gio/v2_74" ];
"gnome_44" = [ "v4_10" "cairo-rs/v1_16" "gdk-pixbuf/v2_42" "gio/v2_76" ];
"gnome_45" = [ "v4_12" "cairo-rs/v1_16" "pango/v1_52" "gdk-pixbuf/v2_42" "gio/v2_78" ];
"v4_10" = [ "ffi/v4_10" "v4_8" "gdk/v4_10" "gsk/v4_10" ];
"v4_12" = [ "ffi/v4_12" "v4_10" "gdk/v4_12" ];
"v4_14" = [ "ffi/v4_14" "v4_12" "gsk/v4_14" ];
"v4_2" = [ "ffi/v4_2" "gdk/v4_2" "gsk/v4_2" ];
"v4_4" = [ "ffi/v4_4" "v4_2" "gdk/v4_4" "gsk/v4_4" ];
"v4_6" = [ "ffi/v4_6" "v4_4" "gdk/v4_6" "gsk/v4_6" "pango/v1_50" ];
"v4_8" = [ "ffi/v4_8" "v4_6" "gdk/v4_8" ];
"xml_validation" = [ "gtk4-macros/xml_validation" ];
};
resolvedDefaultFeatures = [ "v4_10" "v4_2" "v4_4" "v4_6" "v4_8" ];
};
"gtk4-macros" = rec {
crateName = "gtk4-macros";
version = "0.7.2";
edition = "2021";
sha256 = "0bw3cchiycf7dw1bw4p8946gv38azxy05a5w0ndgcmxnz6fc8znm";
procMacro = true;
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "anyhow";
packageId = "anyhow";
}
{
name = "proc-macro-crate";
packageId = "proc-macro-crate 1.3.1";
}
{
name = "proc-macro-error";
packageId = "proc-macro-error";
}
{
name = "proc-macro2";
packageId = "proc-macro2";
}
{
name = "quote";
packageId = "quote";
}
{
name = "syn";
packageId = "syn 1.0.109";
features = [ "full" ];
}
];
features = {
"quick-xml" = [ "dep:quick-xml" ];
"xml_validation" = [ "quick-xml" ];
};
resolvedDefaultFeatures = [ "default" ];
};
"gtk4-sys" = rec {
crateName = "gtk4-sys";
version = "0.7.3";
edition = "2021";
sha256 = "1f2ylskyqkjdik9fij2m46pra4jagnif5xyalbxfk3334fmc9n2l";
libName = "gtk4_sys";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "cairo-sys-rs";
packageId = "cairo-sys-rs";
rename = "cairo";
}
{
name = "gdk-pixbuf-sys";
packageId = "gdk-pixbuf-sys";
rename = "gdk_pixbuf";
}
{
name = "gdk4-sys";
packageId = "gdk4-sys";
rename = "gdk";
}
{
name = "gio-sys";
packageId = "gio-sys";
rename = "gio";
}
{
name = "glib-sys";
packageId = "glib-sys";
rename = "glib";
}
{
name = "gobject-sys";
packageId = "gobject-sys";
rename = "gobject";
}
{
name = "graphene-sys";
packageId = "graphene-sys";
rename = "graphene";
}
{
name = "gsk4-sys";
packageId = "gsk4-sys";
rename = "gsk";
}
{
name = "libc";
packageId = "libc";
}
{
name = "pango-sys";
packageId = "pango-sys";
rename = "pango";
}
];
buildDependencies = [
{
name = "system-deps";
packageId = "system-deps";
}
];
features = {
"v4_10" = [ "v4_8" ];
"v4_12" = [ "v4_10" ];
"v4_14" = [ "v4_12" ];
"v4_4" = [ "v4_2" ];
"v4_6" = [ "v4_4" ];
"v4_8" = [ "v4_6" ];
};
resolvedDefaultFeatures = [ "v4_10" "v4_2" "v4_4" "v4_6" "v4_8" ];
};
"hashbrown" = rec {
crateName = "hashbrown";
version = "0.14.3";
edition = "2021";
sha256 = "012nywlg0lj9kwanh69my5x67vjlfmzfi9a0rq4qvis2j8fil3r9";
authors = [
"Amanieu d'Antras <amanieu@gmail.com>"
];
features = {
"ahash" = [ "dep:ahash" ];
"alloc" = [ "dep:alloc" ];
"allocator-api2" = [ "dep:allocator-api2" ];
"compiler_builtins" = [ "dep:compiler_builtins" ];
"core" = [ "dep:core" ];
"default" = [ "ahash" "inline-more" "allocator-api2" ];
"equivalent" = [ "dep:equivalent" ];
"nightly" = [ "allocator-api2?/nightly" "bumpalo/allocator_api" ];
"rayon" = [ "dep:rayon" ];
"rkyv" = [ "dep:rkyv" ];
"rustc-dep-of-std" = [ "nightly" "core" "compiler_builtins" "alloc" "rustc-internal-api" ];
"serde" = [ "dep:serde" ];
};
resolvedDefaultFeatures = [ "raw" ];
};
"heck" = rec {
crateName = "heck";
version = "0.4.1";
edition = "2018";
sha256 = "1a7mqsnycv5z4z5vnv1k34548jzmc0ajic7c1j8jsaspnhw5ql4m";
authors = [
"Without Boats <woboats@gmail.com>"
];
features = {
"unicode" = [ "unicode-segmentation" ];
"unicode-segmentation" = [ "dep:unicode-segmentation" ];
};
resolvedDefaultFeatures = [ "default" ];
};
"indexmap" = rec {
crateName = "indexmap";
version = "2.1.0";
edition = "2021";
sha256 = "07rxrqmryr1xfnmhrjlz8ic6jw28v6h5cig3ws2c9d0wifhy2c6m";
dependencies = [
{
name = "equivalent";
packageId = "equivalent";
usesDefaultFeatures = false;
}
{
name = "hashbrown";
packageId = "hashbrown";
usesDefaultFeatures = false;
features = [ "raw" ];
}
];
features = {
"arbitrary" = [ "dep:arbitrary" ];
"default" = [ "std" ];
"quickcheck" = [ "dep:quickcheck" ];
"rayon" = [ "dep:rayon" ];
"rustc-rayon" = [ "dep:rustc-rayon" ];
"serde" = [ "dep:serde" ];
};
resolvedDefaultFeatures = [ "default" "std" ];
};
"libc" = rec {
crateName = "libc";
version = "0.2.152";
edition = "2015";
sha256 = "1rsnma7hnw22w7jh9yqg43slddvfbnfzrvm3s7s4kinbj1jvzqqk";
authors = [
"The Rust Project Developers"
];
features = {
"default" = [ "std" ];
"rustc-dep-of-std" = [ "align" "rustc-std-workspace-core" ];
"rustc-std-workspace-core" = [ "dep:rustc-std-workspace-core" ];
"use_std" = [ "std" ];
};
resolvedDefaultFeatures = [ "default" "std" ];
};
"memchr" = rec {
crateName = "memchr";
version = "2.7.1";
edition = "2021";
sha256 = "0jf1kicqa4vs9lyzj4v4y1p90q0dh87hvhsdd5xvhnp527sw8gaj";
authors = [
"Andrew Gallant <jamslam@gmail.com>"
"bluss"
];
features = {
"compiler_builtins" = [ "dep:compiler_builtins" ];
"core" = [ "dep:core" ];
"default" = [ "std" ];
"logging" = [ "dep:log" ];
"rustc-dep-of-std" = [ "core" "compiler_builtins" ];
"std" = [ "alloc" ];
"use_std" = [ "std" ];
};
resolvedDefaultFeatures = [ "alloc" "default" "std" ];
};
"memoffset" = rec {
crateName = "memoffset";
version = "0.9.0";
edition = "2015";
sha256 = "0v20ihhdzkfw1jx00a7zjpk2dcp5qjq6lz302nyqamd9c4f4nqss";
authors = [
"Gilad Naaman <gilad.naaman@gmail.com>"
];
buildDependencies = [
{
name = "autocfg";
packageId = "autocfg";
}
];
features = {
};
resolvedDefaultFeatures = [ "default" ];
};
"once_cell" = rec {
crateName = "once_cell";
version = "1.19.0";
edition = "2021";
sha256 = "14kvw7px5z96dk4dwdm1r9cqhhy2cyj1l5n5b29mynbb8yr15nrz";
authors = [
"Aleksey Kladov <aleksey.kladov@gmail.com>"
];
features = {
"alloc" = [ "race" ];
"atomic-polyfill" = [ "critical-section" ];
"critical-section" = [ "dep:critical-section" "portable-atomic" ];
"default" = [ "std" ];
"parking_lot" = [ "dep:parking_lot_core" ];
"portable-atomic" = [ "dep:portable-atomic" ];
"std" = [ "alloc" ];
};
resolvedDefaultFeatures = [ "alloc" "default" "race" "std" ];
};
"pango" = rec {
crateName = "pango";
version = "0.18.3";
edition = "2021";
sha256 = "1r5ygq7036sv7w32kp8yxr6vgggd54iaavh3yckanmq4xg0px8kw";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "gio";
packageId = "gio";
}
{
name = "glib";
packageId = "glib";
}
{
name = "libc";
packageId = "libc";
}
{
name = "once_cell";
packageId = "once_cell";
}
{
name = "pango-sys";
packageId = "pango-sys";
rename = "ffi";
}
];
features = {
"v1_42" = [ "ffi/v1_42" ];
"v1_44" = [ "v1_42" "ffi/v1_44" ];
"v1_46" = [ "v1_44" "ffi/v1_46" ];
"v1_48" = [ "v1_46" "ffi/v1_48" ];
"v1_50" = [ "v1_48" "ffi/v1_50" ];
"v1_52" = [ "v1_50" "ffi/v1_52" ];
};
resolvedDefaultFeatures = [ "v1_42" "v1_44" "v1_46" "v1_48" "v1_50" ];
};
"pango-sys" = rec {
crateName = "pango-sys";
version = "0.18.0";
edition = "2021";
sha256 = "1iaxalcaaj59cl9n10svh4g50v8jrc1a36kd7n9yahx8j7ikfrs3";
libName = "pango_sys";
authors = [
"The gtk-rs Project Developers"
];
dependencies = [
{
name = "glib-sys";
packageId = "glib-sys";
rename = "glib";
}
{
name = "gobject-sys";
packageId = "gobject-sys";
rename = "gobject";
}
{
name = "libc";
packageId = "libc";
}
];
buildDependencies = [
{
name = "system-deps";
packageId = "system-deps";
}
];
features = {
"v1_44" = [ "v1_42" ];
"v1_46" = [ "v1_44" ];
"v1_48" = [ "v1_46" ];
"v1_50" = [ "v1_48" ];
"v1_52" = [ "v1_50" ];
};
resolvedDefaultFeatures = [ "v1_42" "v1_44" "v1_46" "v1_48" "v1_50" ];
};
"pin-project-lite" = rec {
crateName = "pin-project-lite";
version = "0.2.13";
edition = "2018";
sha256 = "0n0bwr5qxlf0mhn2xkl36sy55118s9qmvx2yl5f3ixkb007lbywa";
};
"pin-utils" = rec {
crateName = "pin-utils";
version = "0.1.0";
edition = "2018";
sha256 = "117ir7vslsl2z1a7qzhws4pd01cg2d3338c47swjyvqv2n60v1wb";
authors = [
"Josef Brandl <mail@josefbrandl.de>"
];
};
"pkg-config" = rec {
crateName = "pkg-config";
version = "0.3.29";
edition = "2015";
sha256 = "1jy6158v1316khkpmq2sjj1vgbnbnw51wffx7p0k0l9h9vlys019";
authors = [
"Alex Crichton <alex@alexcrichton.com>"
];
};
"proc-macro-crate 1.3.1" = rec {
crateName = "proc-macro-crate";
version = "1.3.1";
edition = "2021";
sha256 = "069r1k56bvgk0f58dm5swlssfcp79im230affwk6d9ck20g04k3z";
authors = [
"Bastian Köcher <git@kchr.de>"
];
dependencies = [
{
name = "once_cell";
packageId = "once_cell";
}
{
name = "toml_edit";
packageId = "toml_edit 0.19.15";
}
];
};
"proc-macro-crate 2.0.1" = rec {
crateName = "proc-macro-crate";
version = "2.0.1";
edition = "2021";
sha256 = "06jbv5w6s04dbjbwq0iv7zil12ildf3w8dvvb4pqvhig4gm5zp4p";
authors = [
"Bastian Köcher <git@kchr.de>"
];
dependencies = [
{
name = "toml_datetime";
packageId = "toml_datetime";
}
{
name = "toml_edit";
packageId = "toml_edit 0.20.2";
}
];
};
"proc-macro-error" = rec {
crateName = "proc-macro-error";
version = "1.0.4";
edition = "2018";
sha256 = "1373bhxaf0pagd8zkyd03kkx6bchzf6g0dkwrwzsnal9z47lj9fs";
authors = [
"CreepySkeleton <creepy-skeleton@yandex.ru>"
];
dependencies = [
{
name = "proc-macro-error-attr";
packageId = "proc-macro-error-attr";
}
{
name = "proc-macro2";
packageId = "proc-macro2";
}
{
name = "quote";
packageId = "quote";
}
{
name = "syn";
packageId = "syn 1.0.109";
optional = true;
usesDefaultFeatures = false;
}
];
buildDependencies = [
{
name = "version_check";
packageId = "version_check";
}
];
features = {
"default" = [ "syn-error" ];
"syn" = [ "dep:syn" ];
"syn-error" = [ "syn" ];
};
resolvedDefaultFeatures = [ "default" "syn" "syn-error" ];
};
"proc-macro-error-attr" = rec {
crateName = "proc-macro-error-attr";
version = "1.0.4";
edition = "2018";
sha256 = "0sgq6m5jfmasmwwy8x4mjygx5l7kp8s4j60bv25ckv2j1qc41gm1";
procMacro = true;
authors = [
"CreepySkeleton <creepy-skeleton@yandex.ru>"
];
dependencies = [
{
name = "proc-macro2";
packageId = "proc-macro2";
}
{
name = "quote";
packageId = "quote";
}
];
buildDependencies = [
{
name = "version_check";
packageId = "version_check";
}
];
};
"proc-macro2" = rec {
crateName = "proc-macro2";
version = "1.0.78";
edition = "2021";
sha256 = "1bjak27pqdn4f4ih1c9nr3manzyavsgqmf76ygw9k76q8pb2lhp2";
authors = [
"David Tolnay <dtolnay@gmail.com>"
"Alex Crichton <alex@alexcrichton.com>"
];
dependencies = [
{
name = "unicode-ident";
packageId = "unicode-ident";
}
];
features = {
"default" = [ "proc-macro" ];
};
resolvedDefaultFeatures = [ "default" "proc-macro" ];
};
"quote" = rec {
crateName = "quote";
version = "1.0.35";
edition = "2018";
sha256 = "1vv8r2ncaz4pqdr78x7f138ka595sp2ncr1sa2plm4zxbsmwj7i9";
authors = [
"David Tolnay <dtolnay@gmail.com>"
];
dependencies = [
{
name = "proc-macro2";
packageId = "proc-macro2";
usesDefaultFeatures = false;
}
];
features = {
"default" = [ "proc-macro" ];
"proc-macro" = [ "proc-macro2/proc-macro" ];
};
resolvedDefaultFeatures = [ "default" "proc-macro" ];
};
"resources_demo" = rec {
crateName = "resources_demo";
version = "0.1.0";
edition = "2021";
crateBin = [
{
name = "resources_demo";
path = "src/main.rs";
requiredFeatures = [ ];
}
];
# We can't filter paths with references in Nix 2.4
# See https://github.com/NixOS/nix/issues/5410
src = if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion ))
then lib.cleanSourceWith { filter = sourceFilter; src = ./.; }
else ./.;
dependencies = [
{
name = "gtk4";
packageId = "gtk4";
rename = "gtk";
features = [ "v4_10" ];
}
];
buildDependencies = [
{
name = "glib-build-tools";
packageId = "glib-build-tools";
}
];
};
"rustc_version" = rec {
crateName = "rustc_version";
version = "0.4.0";
edition = "2018";
sha256 = "0rpk9rcdk405xhbmgclsh4pai0svn49x35aggl4nhbkd4a2zb85z";
authors = [
"Dirkjan Ochtman <dirkjan@ochtman.nl>"
"Marvin Löbel <loebel.marvin@gmail.com>"
];
dependencies = [
{
name = "semver";
packageId = "semver";
}
];
};
"semver" = rec {
crateName = "semver";
version = "1.0.21";
edition = "2018";
sha256 = "1c49snqlfcx93xym1cgwx8zcspmyyxm37xa2fyfgjx1vhalxfzmr";
authors = [
"David Tolnay <dtolnay@gmail.com>"
];
features = {
"default" = [ "std" ];
"serde" = [ "dep:serde" ];
};
resolvedDefaultFeatures = [ "default" "std" ];
};
"serde" = rec {
crateName = "serde";
version = "1.0.195";
edition = "2018";
sha256 = "00kbc86kgaihpza0zdglcd2qq5468yg0dvvdmkli2y660bs1s9k3";
authors = [
"Erick Tryzelaar <erick.tryzelaar@gmail.com>"
"David Tolnay <dtolnay@gmail.com>"
];
dependencies = [
{
name = "serde_derive";
packageId = "serde_derive";
optional = true;
}
{
name = "serde_derive";
packageId = "serde_derive";
target = { target, features }: false;
}
];
devDependencies = [
{
name = "serde_derive";
packageId = "serde_derive";
}
];
features = {
"default" = [ "std" ];
"derive" = [ "serde_derive" ];
"serde_derive" = [ "dep:serde_derive" ];
};
resolvedDefaultFeatures = [ "default" "std" ];
};
"serde_derive" = rec {
crateName = "serde_derive";
version = "1.0.195";
edition = "2015";
sha256 = "0b7ag1qm9q3fgwlmyk2ap5gjbqa9vyf2wfmj4xish6yq0f38zzj6";
procMacro = true;
authors = [
"Erick Tryzelaar <erick.tryzelaar@gmail.com>"
"David Tolnay <dtolnay@gmail.com>"
];
dependencies = [
{
name = "proc-macro2";
packageId = "proc-macro2";
}
{
name = "quote";
packageId = "quote";
}
{
name = "syn";
packageId = "syn 2.0.48";
}
];
features = {
};
resolvedDefaultFeatures = [ "default" ];
};
"serde_spanned" = rec {
crateName = "serde_spanned";
version = "0.6.5";
edition = "2021";
sha256 = "1hgh6s3jjwyzhfk3xwb6pnnr1misq9nflwq0f026jafi37s24dpb";
dependencies = [
{
name = "serde";
packageId = "serde";
optional = true;
}
];
devDependencies = [
{
name = "serde";
packageId = "serde";
}
];
features = {
"serde" = [ "dep:serde" ];
};
resolvedDefaultFeatures = [ "serde" ];
};
"slab" = rec {
crateName = "slab";
version = "0.4.9";
edition = "2018";
sha256 = "0rxvsgir0qw5lkycrqgb1cxsvxzjv9bmx73bk5y42svnzfba94lg";
authors = [
"Carl Lerche <me@carllerche.com>"
];
buildDependencies = [
{
name = "autocfg";
packageId = "autocfg";
}
];
features = {
"default" = [ "std" ];
"serde" = [ "dep:serde" ];
};
resolvedDefaultFeatures = [ "default" "std" ];
};
"smallvec" = rec {
crateName = "smallvec";
version = "1.13.1";
edition = "2018";
sha256 = "1mzk9j117pn3k1gabys0b7nz8cdjsx5xc6q7fwnm8r0an62d7v76";
authors = [
"The Servo Project Developers"
];
features = {
"arbitrary" = [ "dep:arbitrary" ];
"const_new" = [ "const_generics" ];
"drain_keep_rest" = [ "drain_filter" ];
"serde" = [ "dep:serde" ];
};
resolvedDefaultFeatures = [ "const_generics" "const_new" "union" ];
};
"syn 1.0.109" = rec {
crateName = "syn";
version = "1.0.109";
edition = "2018";
sha256 = "0ds2if4600bd59wsv7jjgfkayfzy3hnazs394kz6zdkmna8l3dkj";
authors = [
"David Tolnay <dtolnay@gmail.com>"
];
dependencies = [
{
name = "proc-macro2";
packageId = "proc-macro2";
usesDefaultFeatures = false;
}
{
name = "quote";
packageId = "quote";
optional = true;
usesDefaultFeatures = false;
}
{
name = "unicode-ident";
packageId = "unicode-ident";
}
];
features = {
"default" = [ "derive" "parsing" "printing" "clone-impls" "proc-macro" ];
"printing" = [ "quote" ];
"proc-macro" = [ "proc-macro2/proc-macro" "quote/proc-macro" ];
"quote" = [ "dep:quote" ];
"test" = [ "syn-test-suite/all-features" ];
};
resolvedDefaultFeatures = [ "clone-impls" "default" "derive" "full" "parsing" "printing" "proc-macro" "quote" ];
};
"syn 2.0.48" = rec {
crateName = "syn";
version = "2.0.48";
edition = "2021";
sha256 = "0gqgfygmrxmp8q32lia9p294kdd501ybn6kn2h4gqza0irik2d8g";
authors = [
"David Tolnay <dtolnay@gmail.com>"
];
dependencies = [
{
name = "proc-macro2";
packageId = "proc-macro2";
usesDefaultFeatures = false;
}
{
name = "quote";
packageId = "quote";
optional = true;
usesDefaultFeatures = false;
}
{
name = "unicode-ident";
packageId = "unicode-ident";
}
];
features = {
"default" = [ "derive" "parsing" "printing" "clone-impls" "proc-macro" ];
"printing" = [ "quote" ];
"proc-macro" = [ "proc-macro2/proc-macro" "quote/proc-macro" ];
"quote" = [ "dep:quote" ];
"test" = [ "syn-test-suite/all-features" ];
};
resolvedDefaultFeatures = [ "clone-impls" "default" "derive" "full" "parsing" "printing" "proc-macro" "quote" ];
};
"system-deps" = rec {
crateName = "system-deps";
version = "6.2.0";
edition = "2018";
sha256 = "0c836abhh3k8yn5ymg8wx383ay7n731gkrbbp3gma352yq7mhb9a";
authors = [
"Guillaume Desmottes <guillaume.desmottes@collabora.com>"
"Josh Triplett <josh@joshtriplett.org>"
];
dependencies = [
{
name = "cfg-expr";
packageId = "cfg-expr";
features = [ "targets" ];
}
{
name = "heck";
packageId = "heck";
}
{
name = "pkg-config";
packageId = "pkg-config";
}
{
name = "toml";
packageId = "toml";
usesDefaultFeatures = false;
features = [ "parse" ];
}
{
name = "version-compare";
packageId = "version-compare";
}
];
};
"target-lexicon" = rec {
crateName = "target-lexicon";
version = "0.12.13";
edition = "2018";
sha256 = "1bmgpdq766zn61f16py0x9139fv314d054xkrkj9iw3q5vd8nxb9";
authors = [
"Dan Gohman <sunfish@mozilla.com>"
];
features = {
"serde" = [ "dep:serde" ];
"serde_support" = [ "serde" "std" ];
};
resolvedDefaultFeatures = [ "default" ];
};
"thiserror" = rec {
crateName = "thiserror";
version = "1.0.56";
edition = "2021";
sha256 = "1b9hnzngjan4d89zjs16i01bcpcnvdwklyh73lj16xk28p37hhym";
authors = [
"David Tolnay <dtolnay@gmail.com>"
];
dependencies = [
{
name = "thiserror-impl";
packageId = "thiserror-impl";
}
];
};
"thiserror-impl" = rec {
crateName = "thiserror-impl";
version = "1.0.56";
edition = "2021";
sha256 = "0w9ldp8fa574ilz4dn7y7scpcq66vdjy59qal8qdpwsh7faal3zs";
procMacro = true;
authors = [
"David Tolnay <dtolnay@gmail.com>"
];
dependencies = [
{
name = "proc-macro2";
packageId = "proc-macro2";
}
{
name = "quote";
packageId = "quote";
}
{
name = "syn";
packageId = "syn 2.0.48";
}
];
};
"toml" = rec {
crateName = "toml";
version = "0.8.2";
edition = "2021";
sha256 = "0g9ysjaqvm2mv8q85xpqfn7hi710hj24sd56k49wyddvvyq8lp8q";
authors = [
"Alex Crichton <alex@alexcrichton.com>"
];
dependencies = [
{
name = "serde";
packageId = "serde";
}
{
name = "serde_spanned";
packageId = "serde_spanned";
features = [ "serde" ];
}
{
name = "toml_datetime";
packageId = "toml_datetime";
features = [ "serde" ];
}
{
name = "toml_edit";
packageId = "toml_edit 0.20.2";
optional = true;
features = [ "serde" ];
}
];
devDependencies = [
{
name = "serde";
packageId = "serde";
features = [ "derive" ];
}
];
features = {
"default" = [ "parse" "display" ];
"display" = [ "dep:toml_edit" ];
"indexmap" = [ "dep:indexmap" ];
"parse" = [ "dep:toml_edit" ];
"preserve_order" = [ "indexmap" ];
};
resolvedDefaultFeatures = [ "parse" ];
};
"toml_datetime" = rec {
crateName = "toml_datetime";
version = "0.6.3";
edition = "2021";
sha256 = "0jsy7v8bdvmzsci6imj8fzgd255fmy5fzp6zsri14yrry7i77nkw";
authors = [
"Alex Crichton <alex@alexcrichton.com>"
];
dependencies = [
{
name = "serde";
packageId = "serde";
optional = true;
}
];
features = {
"serde" = [ "dep:serde" ];
};
resolvedDefaultFeatures = [ "serde" ];
};
"toml_edit 0.19.15" = rec {
crateName = "toml_edit";
version = "0.19.15";
edition = "2021";
sha256 = "08bl7rp5g6jwmfpad9s8jpw8wjrciadpnbaswgywpr9hv9qbfnqv";
authors = [
"Andronik Ordian <write@reusable.software>"
"Ed Page <eopage@gmail.com>"
];
dependencies = [
{
name = "indexmap";
packageId = "indexmap";
features = [ "std" ];
}
{
name = "toml_datetime";
packageId = "toml_datetime";
}
{
name = "winnow";
packageId = "winnow";
}
];
features = {
"perf" = [ "dep:kstring" ];
"serde" = [ "dep:serde" "toml_datetime/serde" "dep:serde_spanned" ];
};
resolvedDefaultFeatures = [ "default" ];
};
"toml_edit 0.20.2" = rec {
crateName = "toml_edit";
version = "0.20.2";
edition = "2021";
sha256 = "0f7k5svmxw98fhi28jpcyv7ldr2s3c867pjbji65bdxjpd44svir";
authors = [
"Andronik Ordian <write@reusable.software>"
"Ed Page <eopage@gmail.com>"
];
dependencies = [
{
name = "indexmap";
packageId = "indexmap";
features = [ "std" ];
}
{
name = "serde";
packageId = "serde";
optional = true;
}
{
name = "serde_spanned";
packageId = "serde_spanned";
optional = true;
features = [ "serde" ];
}
{
name = "toml_datetime";
packageId = "toml_datetime";
}
{
name = "winnow";
packageId = "winnow";
}
];
features = {
"perf" = [ "dep:kstring" ];
"serde" = [ "dep:serde" "toml_datetime/serde" "dep:serde_spanned" ];
};
resolvedDefaultFeatures = [ "default" "serde" ];
};
"unicode-ident" = rec {
crateName = "unicode-ident";
version = "1.0.12";
edition = "2018";
sha256 = "0jzf1znfpb2gx8nr8mvmyqs1crnv79l57nxnbiszc7xf7ynbjm1k";
authors = [
"David Tolnay <dtolnay@gmail.com>"
];
};
"version-compare" = rec {
crateName = "version-compare";
version = "0.1.1";
edition = "2018";
sha256 = "0acg4pmjdbmclg0m7yhijn979mdy66z3k8qrcnvn634f1gy456jp";
authors = [
"Tim Visee <3a4fb3964f@sinenomine.email>"
];
};
"version_check" = rec {
crateName = "version_check";
version = "0.9.4";
edition = "2015";
sha256 = "0gs8grwdlgh0xq660d7wr80x14vxbizmd8dbp29p2pdncx8lp1s9";
authors = [
"Sergio Benitez <sb@sergio.bz>"
];
};
"winapi" = rec {
crateName = "winapi";
version = "0.3.9";
edition = "2015";
sha256 = "06gl025x418lchw1wxj64ycr7gha83m44cjr5sarhynd9xkrm0sw";
authors = [
"Peter Atashian <retep998@gmail.com>"
];
dependencies = [
{
name = "winapi-i686-pc-windows-gnu";
packageId = "winapi-i686-pc-windows-gnu";
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "i686-pc-windows-gnu");
}
{
name = "winapi-x86_64-pc-windows-gnu";
packageId = "winapi-x86_64-pc-windows-gnu";
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "x86_64-pc-windows-gnu");
}
];
features = {
"debug" = [ "impl-debug" ];
};
resolvedDefaultFeatures = [ "winsock2" "ws2def" ];
};
"winapi-i686-pc-windows-gnu" = rec {
crateName = "winapi-i686-pc-windows-gnu";
version = "0.4.0";
edition = "2015";
sha256 = "1dmpa6mvcvzz16zg6d5vrfy4bxgg541wxrcip7cnshi06v38ffxc";
authors = [
"Peter Atashian <retep998@gmail.com>"
];
};
"winapi-x86_64-pc-windows-gnu" = rec {
crateName = "winapi-x86_64-pc-windows-gnu";
version = "0.4.0";
edition = "2015";
sha256 = "0gqq64czqb64kskjryj8isp62m2sgvx25yyj3kpc2myh85w24bki";
authors = [
"Peter Atashian <retep998@gmail.com>"
];
};
"winnow" = rec {
crateName = "winnow";
version = "0.5.34";
edition = "2021";
sha256 = "05lwgfbd2i3016hh4yff7m9qy4mf75x7ki4wsv5xq65kb6v4gkxp";
dependencies = [
{
name = "memchr";
packageId = "memchr";
optional = true;
usesDefaultFeatures = false;
}
];
features = {
"debug" = [ "dep:anstream" "dep:anstyle" "dep:is-terminal" "dep:terminal_size" ];
"default" = [ "std" ];
"simd" = [ "dep:memchr" ];
"std" = [ "alloc" "memchr?/std" ];
"unstable-doc" = [ "alloc" "std" "simd" ];
};
resolvedDefaultFeatures = [ "alloc" "default" "std" ];
};
};
#
# crate2nix/default.nix (excerpt start)
#
/* Target (platform) data for conditional dependencies.
This corresponds roughly to what buildRustCrate is setting.
*/
makeDefaultTarget = platform: {
unix = platform.isUnix;
windows = platform.isWindows;
fuchsia = true;
test = false;
/* We are choosing an arbitrary rust version to grab `lib` from,
which is unfortunate, but `lib` has been version-agnostic the
whole time so this is good enough for now.
*/
os = pkgs.rust.lib.toTargetOs platform;
arch = pkgs.rust.lib.toTargetArch platform;
family = pkgs.rust.lib.toTargetFamily platform;
env = "gnu";
endian =
if platform.parsed.cpu.significantByte.name == "littleEndian"
then "little" else "big";
pointer_width = toString platform.parsed.cpu.bits;
vendor = platform.parsed.vendor.name;
debug_assertions = false;
};
/* Filters common temp files and build files. */
# TODO(pkolloch): Substitute with gitignore filter
sourceFilter = name: type:
let
baseName = builtins.baseNameOf (builtins.toString name);
in
! (
# Filter out git
baseName == ".gitignore"
|| (type == "directory" && baseName == ".git")
# Filter out build results
|| (
type == "directory" && (
baseName == "target"
|| baseName == "_site"
|| baseName == ".sass-cache"
|| baseName == ".jekyll-metadata"
|| baseName == "build-artifacts"
)
)
# Filter out nix-build result symlinks
|| (
type == "symlink" && lib.hasPrefix "result" baseName
)
# Filter out IDE config
|| (
type == "directory" && (
baseName == ".idea" || baseName == ".vscode"
)
) || lib.hasSuffix ".iml" baseName
# Filter out nix build files
|| baseName == "Cargo.nix"
# Filter out editor backup / swap files.
|| lib.hasSuffix "~" baseName
|| builtins.match "^\\.sw[a-z]$$" baseName != null
|| builtins.match "^\\..*\\.sw[a-z]$$" baseName != null
|| lib.hasSuffix ".tmp" baseName
|| lib.hasSuffix ".bak" baseName
|| baseName == "tests.nix"
);
/* Returns a crate which depends on successful test execution
of crate given as the second argument.
testCrateFlags: list of flags to pass to the test exectuable
testInputs: list of packages that should be available during test execution
*/
crateWithTest = { crate, testCrate, testCrateFlags, testInputs, testPreRun, testPostRun }:
assert builtins.typeOf testCrateFlags == "list";
assert builtins.typeOf testInputs == "list";
assert builtins.typeOf testPreRun == "string";
assert builtins.typeOf testPostRun == "string";
let
# override the `crate` so that it will build and execute tests instead of
# building the actual lib and bin targets We just have to pass `--test`
# to rustc and it will do the right thing. We execute the tests and copy
# their log and the test executables to $out for later inspection.
test =
let
drv = testCrate.override
(
_: {
buildTests = true;
}
);
# If the user hasn't set any pre/post commands, we don't want to
# insert empty lines. This means that any existing users of crate2nix
# don't get a spurious rebuild unless they set these explicitly.
testCommand = pkgs.lib.concatStringsSep "\n"
(pkgs.lib.filter (s: s != "") [
testPreRun
"$f $testCrateFlags 2>&1 | tee -a $out"
testPostRun
]);
in
pkgs.runCommand "run-tests-${testCrate.name}"
{
inherit testCrateFlags;
buildInputs = testInputs;
} ''
set -e
export RUST_BACKTRACE=1
# recreate a file hierarchy as when running tests with cargo
# the source for test data
${pkgs.xorg.lndir}/bin/lndir ${crate.src}
# build outputs
testRoot=target/debug
mkdir -p $testRoot
# executables of the crate
# we copy to prevent std::env::current_exe() to resolve to a store location
for i in ${crate}/bin/*; do
cp "$i" "$testRoot"
done
chmod +w -R .
# test harness executables are suffixed with a hash, like cargo does
# this allows to prevent name collision with the main
# executables of the crate
hash=$(basename $out)
for file in ${drv}/tests/*; do
f=$testRoot/$(basename $file)-$hash
cp $file $f
${testCommand}
done
'';
in
pkgs.runCommand "${crate.name}-linked"
{
inherit (crate) outputs crateName;
passthru = (crate.passthru or { }) // {
inherit test;
};
} ''
echo tested by ${test}
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'';
/* A restricted overridable version of builtRustCratesWithFeatures. */
buildRustCrateWithFeatures =
{ packageId
, features ? rootFeatures
, crateOverrides ? defaultCrateOverrides
, buildRustCrateForPkgsFunc ? null
, runTests ? false
, testCrateFlags ? [ ]
, testInputs ? [ ]
# Any command to run immediatelly before a test is executed.
, testPreRun ? ""
# Any command run immediatelly after a test is executed.
, testPostRun ? ""
}:
lib.makeOverridable
(
{ features
, crateOverrides
, runTests
, testCrateFlags
, testInputs
, testPreRun
, testPostRun
}:
let
buildRustCrateForPkgsFuncOverriden =
if buildRustCrateForPkgsFunc != null
then buildRustCrateForPkgsFunc
else
(
if crateOverrides == pkgs.defaultCrateOverrides
then buildRustCrateForPkgs
else
pkgs: (buildRustCrateForPkgs pkgs).override {
defaultCrateOverrides = crateOverrides;
}
);
builtRustCrates = builtRustCratesWithFeatures {
inherit packageId features;
buildRustCrateForPkgsFunc = buildRustCrateForPkgsFuncOverriden;
runTests = false;
};
builtTestRustCrates = builtRustCratesWithFeatures {
inherit packageId features;
buildRustCrateForPkgsFunc = buildRustCrateForPkgsFuncOverriden;
runTests = true;
};
drv = builtRustCrates.crates.${packageId};
testDrv = builtTestRustCrates.crates.${packageId};
derivation =
if runTests then
crateWithTest
{
crate = drv;
testCrate = testDrv;
inherit testCrateFlags testInputs testPreRun testPostRun;
}
else drv;
in
derivation
)
{ inherit features crateOverrides runTests testCrateFlags testInputs testPreRun testPostRun; };
/* Returns an attr set with packageId mapped to the result of buildRustCrateForPkgsFunc
for the corresponding crate.
*/
builtRustCratesWithFeatures =
{ packageId
, features
, crateConfigs ? crates
, buildRustCrateForPkgsFunc
, runTests
, makeTarget ? makeDefaultTarget
} @ args:
assert (builtins.isAttrs crateConfigs);
assert (builtins.isString packageId);
assert (builtins.isList features);
assert (builtins.isAttrs (makeTarget stdenv.hostPlatform));
assert (builtins.isBool runTests);
let
rootPackageId = packageId;
mergedFeatures = mergePackageFeatures
(
args // {
inherit rootPackageId;
target = makeTarget stdenv.hostPlatform // { test = runTests; };
}
);
# Memoize built packages so that reappearing packages are only built once.
builtByPackageIdByPkgs = mkBuiltByPackageIdByPkgs pkgs;
mkBuiltByPackageIdByPkgs = pkgs:
let
self = {
crates = lib.mapAttrs (packageId: value: buildByPackageIdForPkgsImpl self pkgs packageId) crateConfigs;
target = makeTarget pkgs.stdenv.hostPlatform;
build = mkBuiltByPackageIdByPkgs pkgs.buildPackages;
};
in
self;
buildByPackageIdForPkgsImpl = self: pkgs: packageId:
let
features = mergedFeatures."${packageId}" or [ ];
crateConfig' = crateConfigs."${packageId}";
crateConfig =
builtins.removeAttrs crateConfig' [ "resolvedDefaultFeatures" "devDependencies" ];
devDependencies =
lib.optionals
(runTests && packageId == rootPackageId)
(crateConfig'.devDependencies or [ ]);
dependencies =
dependencyDerivations {
inherit features;
inherit (self) target;
buildByPackageId = depPackageId:
# proc_macro crates must be compiled for the build architecture
if crateConfigs.${depPackageId}.procMacro or false
then self.build.crates.${depPackageId}
else self.crates.${depPackageId};
dependencies =
(crateConfig.dependencies or [ ])
++ devDependencies;
};
buildDependencies =
dependencyDerivations {
inherit features;
inherit (self.build) target;
buildByPackageId = depPackageId:
self.build.crates.${depPackageId};
dependencies = crateConfig.buildDependencies or [ ];
};
dependenciesWithRenames =
let
buildDeps = filterEnabledDependencies {
inherit features;
inherit (self) target;
dependencies = crateConfig.dependencies or [ ] ++ devDependencies;
};
hostDeps = filterEnabledDependencies {
inherit features;
inherit (self.build) target;
dependencies = crateConfig.buildDependencies or [ ];
};
in
lib.filter (d: d ? "rename") (hostDeps ++ buildDeps);
# Crate renames have the form:
#
# {
# crate_name = [
# { version = "1.2.3"; rename = "crate_name01"; }
# ];
# # ...
# }
crateRenames =
let
grouped =
lib.groupBy
(dependency: dependency.name)
dependenciesWithRenames;
versionAndRename = dep:
let
package = crateConfigs."${dep.packageId}";
in
{ inherit (dep) rename; version = package.version; };
in
lib.mapAttrs (name: choices: builtins.map versionAndRename choices) grouped;
in
buildRustCrateForPkgsFunc pkgs
(
crateConfig // {
# https://github.com/NixOS/nixpkgs/issues/218712
dontStrip = stdenv.hostPlatform.isDarwin;
src = crateConfig.src or (
pkgs.fetchurl rec {
name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz";
# https://www.pietroalbini.org/blog/downloading-crates-io/
# Not rate-limited, CDN URL.
url = "https://static.crates.io/crates/${crateConfig.crateName}/${crateConfig.crateName}-${crateConfig.version}.crate";
sha256 =
assert (lib.assertMsg (crateConfig ? sha256) "Missing sha256 for ${name}");
crateConfig.sha256;
}
);
extraRustcOpts = lib.lists.optional (targetFeatures != [ ]) "-C target-feature=${lib.concatMapStringsSep "," (x: "+${x}") targetFeatures}";
inherit features dependencies buildDependencies crateRenames release;
}
);
in
builtByPackageIdByPkgs;
/* Returns the actual derivations for the given dependencies. */
dependencyDerivations =
{ buildByPackageId
, features
, dependencies
, target
}:
assert (builtins.isList features);
assert (builtins.isList dependencies);
assert (builtins.isAttrs target);
let
enabledDependencies = filterEnabledDependencies {
inherit dependencies features target;
};
depDerivation = dependency: buildByPackageId dependency.packageId;
in
map depDerivation enabledDependencies;
/* Returns a sanitized version of val with all values substituted that cannot
be serialized as JSON.
*/
sanitizeForJson = val:
if builtins.isAttrs val
then lib.mapAttrs (n: v: sanitizeForJson v) val
else if builtins.isList val
then builtins.map sanitizeForJson val
else if builtins.isFunction val
then "function"
else val;
/* Returns various tools to debug a crate. */
debugCrate = { packageId, target ? makeDefaultTarget stdenv.hostPlatform }:
assert (builtins.isString packageId);
let
debug = rec {
# The built tree as passed to buildRustCrate.
buildTree = buildRustCrateWithFeatures {
buildRustCrateForPkgsFunc = _: lib.id;
inherit packageId;
};
sanitizedBuildTree = sanitizeForJson buildTree;
dependencyTree = sanitizeForJson
(
buildRustCrateWithFeatures {
buildRustCrateForPkgsFunc = _: crate: {
"01_crateName" = crate.crateName or false;
"02_features" = crate.features or [ ];
"03_dependencies" = crate.dependencies or [ ];
};
inherit packageId;
}
);
mergedPackageFeatures = mergePackageFeatures {
features = rootFeatures;
inherit packageId target;
};
diffedDefaultPackageFeatures = diffDefaultPackageFeatures {
inherit packageId target;
};
};
in
{ internal = debug; };
/* Returns differences between cargo default features and crate2nix default
features.
This is useful for verifying the feature resolution in crate2nix.
*/
diffDefaultPackageFeatures =
{ crateConfigs ? crates
, packageId
, target
}:
assert (builtins.isAttrs crateConfigs);
let
prefixValues = prefix: lib.mapAttrs (n: v: { "${prefix}" = v; });
mergedFeatures =
prefixValues
"crate2nix"
(mergePackageFeatures { inherit crateConfigs packageId target; features = [ "default" ]; });
configs = prefixValues "cargo" crateConfigs;
combined = lib.foldAttrs (a: b: a // b) { } [ mergedFeatures configs ];
onlyInCargo =
builtins.attrNames
(lib.filterAttrs (n: v: !(v ? "crate2nix") && (v ? "cargo")) combined);
onlyInCrate2Nix =
builtins.attrNames
(lib.filterAttrs (n: v: (v ? "crate2nix") && !(v ? "cargo")) combined);
differentFeatures = lib.filterAttrs
(
n: v:
(v ? "crate2nix")
&& (v ? "cargo")
&& (v.crate2nix.features or [ ]) != (v."cargo".resolved_default_features or [ ])
)
combined;
in
builtins.toJSON {
inherit onlyInCargo onlyInCrate2Nix differentFeatures;
};
/* Returns an attrset mapping packageId to the list of enabled features.
If multiple paths to a dependency enable different features, the
corresponding feature sets are merged. Features in rust are additive.
*/
mergePackageFeatures =
{ crateConfigs ? crates
, packageId
, rootPackageId ? packageId
, features ? rootFeatures
, dependencyPath ? [ crates.${packageId}.crateName ]
, featuresByPackageId ? { }
, target
# Adds devDependencies to the crate with rootPackageId.
, runTests ? false
, ...
} @ args:
assert (builtins.isAttrs crateConfigs);
assert (builtins.isString packageId);
assert (builtins.isString rootPackageId);
assert (builtins.isList features);
assert (builtins.isList dependencyPath);
assert (builtins.isAttrs featuresByPackageId);
assert (builtins.isAttrs target);
assert (builtins.isBool runTests);
let
crateConfig = crateConfigs."${packageId}" or (builtins.throw "Package not found: ${packageId}");
expandedFeatures = expandFeatures (crateConfig.features or { }) features;
enabledFeatures = enableFeatures (crateConfig.dependencies or [ ]) expandedFeatures;
depWithResolvedFeatures = dependency:
let
packageId = dependency.packageId;
features = dependencyFeatures enabledFeatures dependency;
in
{ inherit packageId features; };
resolveDependencies = cache: path: dependencies:
assert (builtins.isAttrs cache);
assert (builtins.isList dependencies);
let
enabledDependencies = filterEnabledDependencies {
inherit dependencies target;
features = enabledFeatures;
};
directDependencies = map depWithResolvedFeatures enabledDependencies;
foldOverCache = op: lib.foldl op cache directDependencies;
in
foldOverCache
(
cache: { packageId, features }:
let
cacheFeatures = cache.${packageId} or [ ];
combinedFeatures = sortedUnique (cacheFeatures ++ features);
in
if cache ? ${packageId} && cache.${packageId} == combinedFeatures
then cache
else
mergePackageFeatures {
features = combinedFeatures;
featuresByPackageId = cache;
inherit crateConfigs packageId target runTests rootPackageId;
}
);
cacheWithSelf =
let
cacheFeatures = featuresByPackageId.${packageId} or [ ];
combinedFeatures = sortedUnique (cacheFeatures ++ enabledFeatures);
in
featuresByPackageId // {
"${packageId}" = combinedFeatures;
};
cacheWithDependencies =
resolveDependencies cacheWithSelf "dep"
(
crateConfig.dependencies or [ ]
++ lib.optionals
(runTests && packageId == rootPackageId)
(crateConfig.devDependencies or [ ])
);
cacheWithAll =
resolveDependencies
cacheWithDependencies "build"
(crateConfig.buildDependencies or [ ]);
in
cacheWithAll;
/* Returns the enabled dependencies given the enabled features. */
filterEnabledDependencies = { dependencies, features, target }:
assert (builtins.isList dependencies);
assert (builtins.isList features);
assert (builtins.isAttrs target);
lib.filter
(
dep:
let
targetFunc = dep.target or (features: true);
in
targetFunc { inherit features target; }
&& (
!(dep.optional or false)
|| builtins.any (doesFeatureEnableDependency dep) features
)
)
dependencies;
/* Returns whether the given feature should enable the given dependency. */
doesFeatureEnableDependency = dependency: feature:
let
name = dependency.rename or dependency.name;
prefix = "${name}/";
len = builtins.stringLength prefix;
startsWithPrefix = builtins.substring 0 len feature == prefix;
in
feature == name || feature == "dep:" + name || startsWithPrefix;
/* Returns the expanded features for the given inputFeatures by applying the
rules in featureMap.
featureMap is an attribute set which maps feature names to lists of further
feature names to enable in case this feature is selected.
*/
expandFeatures = featureMap: inputFeatures:
assert (builtins.isAttrs featureMap);
assert (builtins.isList inputFeatures);
let
expandFeaturesNoCycle = oldSeen: inputFeatures:
if inputFeatures != [ ]
then
let
# The feature we're currently expanding.
feature = builtins.head inputFeatures;
# All the features we've seen/expanded so far, including the one
# we're currently processing.
seen = oldSeen // { ${feature} = 1; };
# Expand the feature but be careful to not re-introduce a feature
# that we've already seen: this can easily cause a cycle, see issue
# #209.
enables = builtins.filter (f: !(seen ? "${f}")) (featureMap."${feature}" or [ ]);
in
[ feature ] ++ (expandFeaturesNoCycle seen (builtins.tail inputFeatures ++ enables))
# No more features left, nothing to expand to.
else [ ];
outFeatures = expandFeaturesNoCycle { } inputFeatures;
in
sortedUnique outFeatures;
/* This function adds optional dependencies as features if they are enabled
indirectly by dependency features. This function mimics Cargo's behavior
described in a note at:
https://doc.rust-lang.org/nightly/cargo/reference/features.html#dependency-features
*/
enableFeatures = dependencies: features:
assert (builtins.isList features);
assert (builtins.isList dependencies);
let
additionalFeatures = lib.concatMap
(
dependency:
assert (builtins.isAttrs dependency);
let
enabled = builtins.any (doesFeatureEnableDependency dependency) features;
in
if (dependency.optional or false) && enabled
then [ (dependency.rename or dependency.name) ]
else [ ]
)
dependencies;
in
sortedUnique (features ++ additionalFeatures);
/*
Returns the actual features for the given dependency.
features: The features of the crate that refers this dependency.
*/
dependencyFeatures = features: dependency:
assert (builtins.isList features);
assert (builtins.isAttrs dependency);
let
defaultOrNil =
if dependency.usesDefaultFeatures or true
then [ "default" ]
else [ ];
explicitFeatures = dependency.features or [ ];
additionalDependencyFeatures =
let
name = dependency.rename or dependency.name;
stripPrefixMatch = prefix: s:
if lib.hasPrefix prefix s
then lib.removePrefix prefix s
else null;
extractFeature = feature: lib.findFirst
(f: f != null)
null
(map (prefix: stripPrefixMatch prefix feature) [
(name + "/")
(name + "?/")
]);
dependencyFeatures = lib.filter (f: f != null) (map extractFeature features);
in
dependencyFeatures;
in
defaultOrNil ++ explicitFeatures ++ additionalDependencyFeatures;
/* Sorts and removes duplicates from a list of strings. */
sortedUnique = features:
assert (builtins.isList features);
assert (builtins.all builtins.isString features);
let
outFeaturesSet = lib.foldl (set: feature: set // { "${feature}" = 1; }) { } features;
outFeaturesUnique = builtins.attrNames outFeaturesSet;
in
builtins.sort (a: b: a < b) outFeaturesUnique;
deprecationWarning = message: value:
if strictDeprecation
then builtins.throw "strictDeprecation enabled, aborting: ${message}"
else builtins.trace message value;
#
# crate2nix/default.nix (excerpt end)
#
};
}