spec2flatpak

Created 7 years ago
Maintained by pingou
Simple utility tool to convert a spec file to a flatpak module
Members 1
Pierre-Yves Chibon committed 7 years ago

spec2flatpak

This project provides a simple utility script to help you write the JSON files of the modules you may need when building a flatpak.

This relies on the information provided on the master branch of the git repositories used for build Fedora's RPMs.

This is how it looks like when working:

$ python3 spec2flatpak.py libgit2
http://pkgs.fedoraproject.org/cgit/rpms/libgit2.git/plain/libgit2.spec
retrieving sources https://github.com/libgit2/libgit2/archive/v0.24.2.tar.gz#/libgit2-0.24.2.tar.gz
Sha256 of the sources: 00f0a7403143fba69601accc80cacf49becc568b890ba232f300c1b2a37475e6
Move the source into .flatpak-builder/downloads
Generating file libgit2.json

Which generates the following JSON file:

$ cat libgit2.json
{
    "cmake": true,
    "name": "libgit2",
    "sources": [
        {
            "sha256": "00f0a7403143fba69601accc80cacf49becc568b890ba232f300c1b2a37475e6",
            "type": "archive",
            "url": "https://github.com/libgit2/libgit2/archive/v0.24.2.tar.gz#/libgit2-0.24.2.tar.gz"
        }
    ]
}

You can then simply include this JSON file in the modules section of your flatpak.