From 9699c63e50d4e8b63102a60cd2f6db2b98fd34d5 Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Mon, 4 Mar 2024 09:15:12 -0500 Subject: [PATCH] Write a program to try testing XDG_DATA_DIRS and wrapGAppsHook4 --- Cargo.lock | 4 + Cargo.nix | 2013 ++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 1 + flake.nix | 3 + xdg-test/Cargo.toml | 8 + xdg-test/override.nix | 7 + xdg-test/src/main.rs | 7 + 7 files changed, 2039 insertions(+), 4 deletions(-) create mode 100644 xdg-test/Cargo.toml create mode 100644 xdg-test/override.nix create mode 100644 xdg-test/src/main.rs diff --git a/Cargo.lock b/Cargo.lock index cd0cc8c..ae4b18b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5562,6 +5562,10 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dad7bb64b8ef9c0aa27b6da38b452b0ee9fd82beaf276a87dd796fb55cbae14e" +[[package]] +name = "xdg-test" +version = "0.1.0" + [[package]] name = "yoke" version = "0.7.3" diff --git a/Cargo.nix b/Cargo.nix index 775f882..c7b3d96 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -225,6 +225,16 @@ rec { # File a bug if you depend on any for non-debug work! debug = internal.debugCrate { inherit packageId; }; }; + "l10n" = rec { + packageId = "l10n"; + build = internal.buildRustCrateWithFeatures { + packageId = "l10n"; + }; + + # Debug support which might change between releases. + # File a bug if you depend on any for non-debug work! + debug = internal.debugCrate { inherit packageId; }; + }; "memorycache" = rec { packageId = "memorycache"; build = internal.buildRustCrateWithFeatures { @@ -301,6 +311,16 @@ rec { packageId = "visions"; }; + # Debug support which might change between releases. + # File a bug if you depend on any for non-debug work! + debug = internal.debugCrate { inherit packageId; }; + }; + "xdg-test" = rec { + packageId = "xdg-test"; + build = internal.buildRustCrateWithFeatures { + packageId = "xdg-test"; + }; + # Debug support which might change between releases. # File a bug if you depend on any for non-debug work! debug = internal.debugCrate { inherit packageId; }; @@ -1734,6 +1754,28 @@ rec { }; resolvedDefaultFeatures = [ "glib" "use_glib" ]; }; + "calendrical_calculations" = rec { + crateName = "calendrical_calculations"; + version = "0.1.0"; + edition = "2021"; + sha256 = "0pcsrzx1884pdhbdh5z3az21hm0wfckczndnzpx6fihblp33pzld"; + authors = [ + "The ICU4X Project Developers" + ]; + dependencies = [ + { + name = "core_maths"; + packageId = "core_maths"; + } + { + name = "displaydoc"; + packageId = "displaydoc"; + usesDefaultFeatures = false; + } + ]; + features = { + }; + }; "cc" = rec { crateName = "cc"; version = "1.0.83"; @@ -2339,6 +2381,22 @@ rec { }; resolvedDefaultFeatures = [ "default" "link" ]; }; + "core_maths" = rec { + crateName = "core_maths"; + version = "0.1.0"; + edition = "2015"; + sha256 = "18q9fwy80lk1lccam375skmsslryik00zkhsl850pidqrh2jbc73"; + authors = [ + "Robert Bastian " + ]; + dependencies = [ + { + name = "memchr"; + packageId = "memchr"; + usesDefaultFeatures = false; + } + ]; + features = { + "alloc" = [ "syntax" ]; + "default" = [ "std" "alloc" "syntax" ]; + "fst" = [ "dep:fst" ]; + "log" = [ "dep:log" ]; + "logging" = [ "log" ]; + "regex-syntax" = [ "dep:regex-syntax" ]; + "syntax" = [ "regex-syntax" ]; + "transducer" = [ "fst" ]; + }; + }; + "regex-automata 0.4.3" = rec { crateName = "regex-automata"; version = "0.4.3"; edition = "2021"; @@ -11150,6 +12789,7 @@ rec { features = { "no-panic" = [ "dep:no-panic" ]; }; + resolvedDefaultFeatures = [ "small" ]; }; "safemem" = rec { crateName = "safemem"; @@ -12864,6 +14504,20 @@ rec { }; resolvedDefaultFeatures = [ "any" "json" "migrate" "offline" "serde" ]; }; + "stable_deref_trait" = rec { + crateName = "stable_deref_trait"; + version = "1.2.0"; + edition = "2015"; + sha256 = "1lxjr8q2n534b2lhkxd6l6wcddzjvnksi58zv11f9y0jjmr15wd8"; + authors = [ + "Robert Grosse " + ]; + features = { + "default" = [ "std" ]; + "std" = [ "alloc" ]; + }; + resolvedDefaultFeatures = [ "alloc" ]; + }; "stringprep" = rec { crateName = "stringprep"; version = "0.1.4"; @@ -12977,7 +14631,61 @@ rec { "quote" = [ "dep:quote" ]; "test" = [ "syn-test-suite/all-features" ]; }; - resolvedDefaultFeatures = [ "clone-impls" "default" "derive" "extra-traits" "full" "parsing" "printing" "proc-macro" "quote" "visit" "visit-mut" ]; + resolvedDefaultFeatures = [ "clone-impls" "default" "derive" "extra-traits" "fold" "full" "parsing" "printing" "proc-macro" "quote" "visit" "visit-mut" ]; + }; + "synstructure" = rec { + crateName = "synstructure"; + version = "0.13.1"; + edition = "2018"; + sha256 = "0wc9f002ia2zqcbj0q2id5x6n7g1zjqba7qkg2mr0qvvmdk7dby8"; + authors = [ + "Nika Layzell " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + usesDefaultFeatures = false; + } + { + name = "quote"; + packageId = "quote"; + usesDefaultFeatures = false; + } + { + name = "syn"; + packageId = "syn 2.0.48"; + usesDefaultFeatures = false; + features = [ "derive" "parsing" "printing" "clone-impls" "visit" "extra-traits" ]; + } + ]; + features = { + "default" = [ "proc-macro" ]; + "proc-macro" = [ "proc-macro2/proc-macro" "syn/proc-macro" "quote/proc-macro" ]; + }; + resolvedDefaultFeatures = [ "default" "proc-macro" ]; + }; + "sys-locale" = rec { + crateName = "sys-locale"; + version = "0.3.1"; + edition = "2018"; + sha256 = "1c29m5z9bbg4ix5vy25jma83xlakvmkhs9rxy1qwsv6dkqiwy0g8"; + authors = [ + "1Password" + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + target = { target, features }: ("android" == target."os"); + } + ]; + features = { + "js" = [ "js-sys" "wasm-bindgen" "web-sys" ]; + "js-sys" = [ "dep:js-sys" ]; + "wasm-bindgen" = [ "dep:wasm-bindgen" ]; + "web-sys" = [ "dep:web-sys" ]; + }; }; "system-configuration" = rec { crateName = "system-configuration"; @@ -13427,6 +15135,12 @@ rec { packageId = "displaydoc"; usesDefaultFeatures = false; } + { + name = "zerovec"; + packageId = "zerovec"; + optional = true; + usesDefaultFeatures = false; + } ]; features = { "databake" = [ "dep:databake" ]; @@ -13434,7 +15148,7 @@ rec { "serde" = [ "dep:serde" ]; "zerovec" = [ "dep:zerovec" ]; }; - resolvedDefaultFeatures = [ "alloc" "default" ]; + resolvedDefaultFeatures = [ "alloc" "default" "zerovec" ]; }; "tinyvec" = rec { crateName = "tinyvec"; @@ -14523,6 +16237,26 @@ rec { "Simon Sapin " ]; + }; + "utf16_iter" = rec { + crateName = "utf16_iter"; + version = "1.0.5"; + edition = "2021"; + sha256 = "0ik2krdr73hfgsdzw0218fn35fa09dg2hvbi1xp3bmdfrp9js8y8"; + authors = [ + "Henri Sivonen " + ]; + + }; + "utf8_iter" = rec { + crateName = "utf8_iter"; + version = "1.0.4"; + edition = "2021"; + sha256 = "1gmna9flnj8dbyd8ba17zigrp9c4c3zclngf5lnb5yvz1ri41hdn"; + authors = [ + "Henri Sivonen " + ]; + }; "utf8parse" = rec { crateName = "utf8parse"; @@ -16561,6 +18295,124 @@ rec { "serialization-serde" = [ "transactions" "serde" ]; }; }; + "write16" = rec { + crateName = "write16"; + version = "1.0.0"; + edition = "2021"; + sha256 = "0dnryvrrbrnl7vvf5vb1zkmwldhjkf2n5znliviam7bm4900z2fi"; + features = { + "arrayvec" = [ "dep:arrayvec" ]; + "smallvec" = [ "dep:smallvec" ]; + }; + resolvedDefaultFeatures = [ "alloc" ]; + }; + "writeable" = rec { + crateName = "writeable"; + version = "0.5.4"; + edition = "2021"; + sha256 = "0kp1p9fbavvrvn3nl9xgps1gvs8f5d2qp8vdgfi0m77gp1jbpmys"; + authors = [ + "The ICU4X Project Developers" + ]; + features = { + }; + }; + "xdg-test" = rec { + crateName = "xdg-test"; + version = "0.1.0"; + edition = "2021"; + crateBin = [ + { + name = "xdg-test"; + 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 = ./xdg-test; } + else ./xdg-test; + + }; + "yoke" = rec { + crateName = "yoke"; + version = "0.7.3"; + edition = "2021"; + sha256 = "1r07zy718h27qjhpk4427imp3wx5z2wf4wf6jivlczr89wp1prv5"; + authors = [ + "Manish Goregaokar " + ]; + dependencies = [ + { + name = "serde"; + packageId = "serde 1.0.193"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "stable_deref_trait"; + packageId = "stable_deref_trait"; + usesDefaultFeatures = false; + } + { + name = "yoke-derive"; + packageId = "yoke-derive"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "zerofrom"; + packageId = "zerofrom"; + optional = true; + usesDefaultFeatures = false; + } + ]; + devDependencies = [ + { + name = "serde"; + packageId = "serde 1.0.193"; + } + ]; + features = { + "alloc" = [ "stable_deref_trait/alloc" "serde?/alloc" "zerofrom/alloc" ]; + "default" = [ "alloc" "zerofrom" ]; + "derive" = [ "dep:yoke-derive" "zerofrom/derive" ]; + "serde" = [ "dep:serde" ]; + "zerofrom" = [ "dep:zerofrom" ]; + }; + resolvedDefaultFeatures = [ "alloc" "default" "derive" "zerofrom" ]; + }; + "yoke-derive" = rec { + crateName = "yoke-derive"; + version = "0.7.3"; + edition = "2021"; + sha256 = "1f52qcg6vmqh9l1wfa8i32hccmpmpq8ml90w4250jn74rkq3cscy"; + procMacro = true; + authors = [ + "Manish Goregaokar " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn 2.0.48"; + features = [ "derive" "fold" ]; + } + { + name = "synstructure"; + packageId = "synstructure"; + } + ]; + + }; "zerocopy" = rec { crateName = "zerocopy"; version = "0.7.31"; @@ -16621,6 +18473,58 @@ rec { } ]; + }; + "zerofrom" = rec { + crateName = "zerofrom"; + version = "0.1.3"; + edition = "2021"; + sha256 = "1dq5dmls0gdlbxgzvh56754k0wq7ch60flbq97g9mcf0qla0hnv5"; + authors = [ + "Manish Goregaokar " + ]; + dependencies = [ + { + name = "zerofrom-derive"; + packageId = "zerofrom-derive"; + optional = true; + usesDefaultFeatures = false; + } + ]; + features = { + "default" = [ "alloc" ]; + "derive" = [ "dep:zerofrom-derive" ]; + }; + resolvedDefaultFeatures = [ "alloc" "derive" ]; + }; + "zerofrom-derive" = rec { + crateName = "zerofrom-derive"; + version = "0.1.3"; + edition = "2021"; + sha256 = "1hqq5xw5a55623313p2gs9scbn24kqhvgrn2wvr75lvi0i8lg9p6"; + procMacro = true; + authors = [ + "Manish Goregaokar " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn 2.0.48"; + features = [ "derive" "fold" "visit" ]; + } + { + name = "synstructure"; + packageId = "synstructure"; + } + ]; + }; "zeroize" = rec { crateName = "zeroize"; @@ -16639,6 +18543,107 @@ rec { }; resolvedDefaultFeatures = [ "alloc" "default" ]; }; + "zerotrie" = rec { + crateName = "zerotrie"; + version = "0.1.2"; + edition = "2021"; + sha256 = "182ilnz834gs20sfpfni4dm07k09na55hb69b4qbjkspl0jl2nfh"; + authors = [ + "The ICU4X Project Developers" + ]; + dependencies = [ + { + name = "displaydoc"; + packageId = "displaydoc"; + usesDefaultFeatures = false; + } + { + name = "yoke"; + packageId = "yoke"; + optional = true; + usesDefaultFeatures = false; + features = [ "derive" ]; + } + { + name = "zerofrom"; + packageId = "zerofrom"; + optional = true; + usesDefaultFeatures = false; + } + ]; + features = { + "bench" = [ "litemap" ]; + "databake" = [ "dep:databake" "zerovec?/databake" ]; + "litemap" = [ "dep:litemap" "alloc" ]; + "serde" = [ "dep:serde" "dep:litemap" "alloc" "litemap/serde" "zerovec?/serde" ]; + "yoke" = [ "dep:yoke" ]; + "zerofrom" = [ "dep:zerofrom" ]; + "zerovec" = [ "dep:zerovec" ]; + }; + resolvedDefaultFeatures = [ "yoke" "zerofrom" ]; + }; + "zerovec" = rec { + crateName = "zerovec"; + version = "0.10.1"; + edition = "2021"; + sha256 = "1si71vdxv648pjjzifdddrzd46zmvgrg64mwi8mwgd8zx6d47x7g"; + authors = [ + "The ICU4X Project Developers" + ]; + dependencies = [ + { + name = "yoke"; + packageId = "yoke"; + optional = true; + } + { + name = "zerofrom"; + packageId = "zerofrom"; + usesDefaultFeatures = false; + } + { + name = "zerovec-derive"; + packageId = "zerovec-derive"; + optional = true; + usesDefaultFeatures = false; + } + ]; + features = { + "bench" = [ "serde" "databake" ]; + "databake" = [ "dep:databake" ]; + "derive" = [ "dep:zerovec-derive" ]; + "hashmap" = [ "dep:t1ha" ]; + "serde" = [ "dep:serde" ]; + "yoke" = [ "dep:yoke" ]; + }; + resolvedDefaultFeatures = [ "derive" "yoke" ]; + }; + "zerovec-derive" = rec { + crateName = "zerovec-derive"; + version = "0.10.1"; + edition = "2021"; + sha256 = "081clqqn1girazr4ma1kplg7xr05989fbw7i1rar12gmrfbmjkkv"; + procMacro = true; + authors = [ + "Manish Goregaokar " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn 2.0.48"; + features = [ "derive" "parsing" "extra-traits" ]; + } + ]; + + }; "zune-inflate" = rec { crateName = "zune-inflate"; version = "0.2.54"; diff --git a/Cargo.toml b/Cargo.toml index 4363926..b33659e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,4 +29,5 @@ members = [ "timezone-testing", "tree", "visions/server", + "xdg-test", ] diff --git a/flake.nix b/flake.nix index a84ed8c..11f36ff 100644 --- a/flake.nix +++ b/flake.nix @@ -71,6 +71,7 @@ dashboard = attrs: { nativeBuildInputs = gtkNativeInputs; }; fitnesstrax = import ./fitnesstrax/app/override.nix { gtkNativeInputs = gtkNativeInputs; }; kifu-gtk = import ./kifu/gtk/override.nix { gtkNativeInputs = gtkNativeInputs; }; + xdg-test = import ./xdg-test/override.nix { wrapGAppsHook4 = pkgs.wrapGAppsHook4; }; }; }; @@ -85,6 +86,7 @@ file-service = cargo_nix.workspaceMembers.file-service.build; fitnesstrax = cargo_nix.workspaceMembers.fitnesstrax.build; kifu-gtk = cargo_nix.workspaceMembers.kifu-gtk.build; + xdg-test = cargo_nix.workspaceMembers.xdg-test.build; all = pkgs.symlinkJoin { name = "all"; @@ -94,6 +96,7 @@ file-service fitnesstrax kifu-gtk + xdg-test ]; }; diff --git a/xdg-test/Cargo.toml b/xdg-test/Cargo.toml new file mode 100644 index 0000000..77b923b --- /dev/null +++ b/xdg-test/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "xdg-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/xdg-test/override.nix b/xdg-test/override.nix new file mode 100644 index 0000000..53e5966 --- /dev/null +++ b/xdg-test/override.nix @@ -0,0 +1,7 @@ +{ wrapGAppsHook4 }: +attrs: +let + gsettingsDir = "${attrs.crateName}-${attrs.version}"; +in { + nativeBuildInputs = [ wrapGAppsHook4 ]; +} diff --git a/xdg-test/src/main.rs b/xdg-test/src/main.rs new file mode 100644 index 0000000..5947917 --- /dev/null +++ b/xdg-test/src/main.rs @@ -0,0 +1,7 @@ +use std::env; + +fn main() { + let data_dirs = env::var("XDG_DATA_DIRS"); + + println!("{:?}", data_dirs); +}