flatpak-rs
Flatpak library for Rust.
This library offers functions to parse and dump flatpak application,
module or source manifests. The goal of the library is to be compliant with what
flatpak-builder
supports.
See the API documentation for this library.
Installation
Add the library to your Cargo.toml
:
flatpak = "0"
Note that this library is aliased as both flatpak
and flatpak-rs
on crates.io.
Usage
All three denominations of Flatpak manifests can be parsed using this library,
using the FlatpakApplication
, FlatpakModule
and FlatpakSource
structs.
Parse from a string
use FlatpakApplication;
use FlatpakManifestFormat;
let manifest = r###"
app-id: net.louib.flatpak-rs
runtime: org.gnome.Platform
runtime-version: "3.36"
sdk: org.gnome.Sdk
command: flatpak-rs
tags: ["nightly"]
modules:
-
name: "flatpak-rs"
buildsystem: simple
cleanup: [ "*" ]
config-opts: []
sources:
-
type: git
url: https://github.com/louib/flatpak-rs.git
branch: master
-
"shared-modules/linux-audio/lv2.json"
"###;
let application = parse.unwrap;
assert_eq!;
assert_eq!;
println!;
Parse from a file
use env;
use FlatpakApplication;
License
MIT