glib-build-tools-0.20.0/.cargo_vcs_info.json0000644000000001560000000000100142650ustar { "git": { "sha1": "184abe83f5ccf36b80687b9ff2ed4764faf5dd88" }, "path_in_vcs": "glib-build-tools" }glib-build-tools-0.20.0/COPYRIGHT000064400000000000000000000012131046102023000143430ustar 00000000000000The gtk-rs Project is licensed under the MIT license, see the LICENSE file or . Copyrights in the gtk-rs Project project are retained by their contributors. No copyright assignment is required to contribute to the gtk-rs Project project. For full authorship information, see the version control history. This project provides interoperability with various GNOME libraries but doesn't distribute any parts of them. Distributing compiled libraries and executables that link to those libraries may be subject to terms of the GNU LGPL or other licenses. For more information check the license of each GNOME library. glib-build-tools-0.20.0/Cargo.toml0000644000000020230000000000100122560ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70" name = "glib-build-tools" version = "0.20.0" authors = ["The gtk-rs Project Developers"] exclude = ["gir-files/*"] description = "Rust bindings for the Gio library, build script utils crate" homepage = "https://gtk-rs.org/" documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib_build_tools" readme = "README.md" keywords = [ "glib", "gio", "gtk-rs", "gnome", "build-dependencies", ] license = "MIT" repository = "https://github.com/gtk-rs/gtk-rs-core" [dependencies.gio] version = "0.20" glib-build-tools-0.20.0/Cargo.toml.orig000064400000000000000000000010231046102023000157360ustar 00000000000000[package] name = "glib-build-tools" keywords = ["glib", "gio", "gtk-rs", "gnome", "build-dependencies"] readme = "README.md" documentation = "https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib_build_tools" description = "Rust bindings for the Gio library, build script utils crate" authors.workspace = true edition.workspace = true exclude.workspace = true homepage.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true [dependencies] gio.workspace = trueglib-build-tools-0.20.0/LICENSE000064400000000000000000000020001046102023000140500ustar 00000000000000Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. glib-build-tools-0.20.0/README.md000064400000000000000000000006411046102023000143330ustar 00000000000000# GIO build helpers Crate containing helpers for building GIO-based applications. ## Minimum supported Rust version Currently, the minimum supported Rust version is `1.70.0`. ## Documentation * [Stable API](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib-build-tools) * [Development API](https://gtk-rs.org/gtk-rs-core/git/latest/docs/glib-build-tools) ### See Also * [gio](http://crates.io/crates/gio) glib-build-tools-0.20.0/src/lib.rs000064400000000000000000000033361046102023000147630ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. #![doc = include_str!("../README.md")] use std::{env, path::Path, process::Command}; // rustdoc-stripper-ignore-next /// Call to run `glib-compile-resources` to generate compiled gresources to embed /// in binary with [`gio::resources_register_include`]. `target` is relative to `OUT_DIR`. /// /// ```no_run /// glib_build_tools::compile_resources( /// &["resources"], /// "resources/resources.gresource.xml", /// "compiled.gresource", /// ); /// ``` pub fn compile_resources>(source_dirs: &[P], gresource: &str, target: &str) { let out_dir = env::var("OUT_DIR").unwrap(); let out_dir = Path::new(&out_dir); let mut command = Command::new("glib-compile-resources"); for source_dir in source_dirs { command.arg("--sourcedir").arg(source_dir.as_ref()); } let output = command .arg("--target") .arg(out_dir.join(target)) .arg(gresource) .output() .unwrap(); assert!( output.status.success(), "glib-compile-resources failed with exit status {} and stderr:\n{}", output.status, String::from_utf8_lossy(&output.stderr) ); println!("cargo:rerun-if-changed={gresource}"); let mut command = Command::new("glib-compile-resources"); for source_dir in source_dirs { command.arg("--sourcedir").arg(source_dir.as_ref()); } let output = command .arg("--generate-dependencies") .arg(gresource) .output() .unwrap() .stdout; let output = String::from_utf8(output).unwrap(); for dep in output.split_whitespace() { println!("cargo:rerun-if-changed={dep}"); } }