{
    "app-id": "sm.puri.Chatty",
    "runtime": "org.gnome.Platform",
    "runtime-version": "master",
    "sdk": "org.gnome.Sdk",
    "command": "chatty",
    "finish-args": [
        "--share=network",
        "--share=ipc",
        "--socket=fallback-x11",
        "--socket=wayland",
        "--talk-name=org.sigxcpu.Feedback",
        "--system-talk-name=org.freedesktop.ModemManager1",
        "--talk-name=org.gnome.evolution.dataserver.AddressBook10",
        "--talk-name=org.gnome.evolution.dataserver.Sources5",
        "--talk-name=im.pidgin.purple.PurpleService",
        "--talk-name=org.gnome.evolution.dataserver.Subprocess.Backend.*"
    ],
    "cleanup-commands": [ "rm -rf /app/lib/debug/ /app/include/boost" ],
    "cleanup": [
        "/include",
        "/lib/pkgconfig",
        "/man",
        "/share/doc",
        "/share/gtk-doc",
        "/share/man",
        "/share/pkgconfig",
        "/share/aclocal",
        "/share/vala",
        "*.la",
        "*.a"
    ],
    "modules": [
        {
            "name": "intltool",
            "cleanup": [
                "*"
            ],
            "sources": [
                {
                    "type": "archive",
                    "url": "https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz",
                    "sha256": "67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd"
                }
            ]
        },
        {
            "name": "libpurple",
            "config-opts": [
                "--disable-dbus",
                "--disable-gtkui",
                "--disable-consoleui",
                "--disable-vv",
                "--disable-idn",
                "--disable-avahi",
                "--disable-meanwhile",
                "--disable-tcl",
                "--disable-nm",
                "--disable-perl"
            ],
            "sources": [
                {
                    "type": "archive",
                    "url": "http://downloads.sourceforge.net/pidgin/pidgin-2.13.0.tar.bz2",
                    "sha256": "2747150c6f711146bddd333c496870bfd55058bab22ffb7e4eb784018ec46d8f"
                }
            ]
        },
        {
            "name": "libical",
            "cleanup": [
                "/lib/cmake"
            ],
            "buildsystem": "cmake-ninja",
            "config-opts": [
                "-DCMAKE_BUILD_TYPE=Release",
                "-DCMAKE_INSTALL_LIBDIR=lib",
                "-DBUILD_SHARED_LIBS:BOOL=ON",
                "-DICAL_GLIB=true",
                "-DGOBJECT_INTROSPECTION=true",
                "-DICAL_GLIB_VAPI=true",
                "-DICAL_BUILD_DOCS=false"
            ],
            "sources": [
                {
                    "type": "git",
                    "url": "https://github.com/libical/libical.git"
                }
            ]
        },
        {
            "name": "boost",
            "buildsystem": "simple",
            "sources": [
                {
                    "type": "archive",
                    "url": "https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.bz2",
                    "sha256": "2684c972994ee57fc5632e03bf044746f6eb45d4920c343937a465fd67a5adba"
                }
            ],
            "build-commands": [
                "./bootstrap.sh --prefix=${FLATPAK_DEST} --with-libraries=date_time,thread,system",
                "./b2 -j ${FLATPAK_BUILDER_N_JOBS} install"
            ],
            "cleanup": [
                "*"
            ]
        },
        {
            "name": "GTest",
            "buildsystem": "cmake-ninja",
            "cleanup": [
                "*"
            ],
            "sources": [
                {
                    "type": "archive",
                    "url": "http://archive.ubuntu.com/ubuntu/pool/universe/g/googletest/googletest_1.8.0.orig.tar.gz",
                    "md5": "16877098823401d1bf2ed7891d7dce36"
                }
            ]
        },
        {
            "name": "protobuf",
            "cleanup": [
                "protoc",
                "/bin",
                "/doc",
                "/lib/plugins"
            ],
            "sources": [
                {
                    "type": "archive",
                    "url": "https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-cpp-3.6.1.tar.gz",
                    "sha256": "b3732e471a9bb7950f090fd0457ebd2536a9ba0891b7f3785919c654fe2a2529"
                }
            ]
        },
        {
            "name": "libphonenumber",
            "buildsystem": "cmake-ninja",
            "sources": [
                {
                    "type": "archive",
                    "url": "https://github.com/google/libphonenumber/archive/v8.10.22.tar.gz",
                    "sha256": "1d43a94502c875cb44f9bd464c5898bca6db9a54e18288892921e985268a3fb4"
                },
                {
                    "type": "shell",
                    "commands": [
                        "sed -i -e 's/\${\${NAME}_BIN}-NOTFOUND/\${NAME}_BIN-NOTFOUND/' cpp/CMakeLists.txt"
                    ]
                },
                {
                    "type" : "patch",
                    "path" : "0001-Remove-java-dep-and-fix-build-issue.patch"
                }
            ],
            "subdir": "cpp"
        },
        {
            "name": "evolution-data-server",
            "cleanup": [
                "/share/GConf",
                "/lib/cmake",
                "/lib/evolution-data-server/*-backends",
                "/libexec",
                "/share/dbus-1/services"
            ],
            "buildsystem": "cmake-ninja",
            "config-opts": [
                "-DENABLE_GTK=ON",
                "-DENABLE_GOA=OFF",
                "-DENABLE_UOA=OFF",
                "-DENABLE_GOOGLE_AUTH=OFF",
                "-DENABLE_GOOGLE=OFF",
                "-DENABLE_VALA_BINDINGS=ON",
                "-DENABLE_WEATHER=OFF",
                "-DWITH_PHONENUMBER=ON",
                "-DWITH_OPENLDAP=OFF",
                "-DWITH_LIBDB=OFF",
                "-DENABLE_INTROSPECTION=ON",
                "-DENABLE_INSTALLED_TESTS=OFF",
                "-DENABLE_GTK_DOC=OFF",
                "-DENABLE_EXAMPLES=OFF",
                "-DENABLE_CANBERRA=OFF"
            ],
            "sources": [
                {
                    "type": "git",
                    "url": "https://gitlab.gnome.org/GNOME/evolution-data-server.git"
                }
            ]
        },
        {
            "name": "libfeedback",
            "buildsystem": "meson",
            "config-opts": [
                "-Dtests=false",
                "-Ddaemon=false"
            ],
            "sources": [
                {
                    "type": "git",
                    "url": "https://source.puri.sm/Librem5/feedbackd.git"
                }
            ]
        },
        {
          "name": "olm",
          "buildsystem": "cmake-ninja",
          "sources": [
            {
              "type": "git",
              "tag" : "3.2.4",
              "url": "https://gitlab.matrix.org/matrix-org/olm.git"
            }
          ]
        },
        {
            "name" : "gspell",
            "config-opts" : [
                "--disable-gtk-doc",
                "--disable-gtk-doc-html"
            ],
            "cleanup" : [
                "/bin",
                "/include",
                "/lib/pkgconfig",
                "*.la",
                "/share"
            ],
            "sources" : [
                {
                    "type" : "archive",
                    "url" : "https://download.gnome.org/sources/gspell/1.8/gspell-1.8.1.tar.xz",
		    "sha256" : "819a1d23c7603000e73f5e738bdd284342e0cd345fb0c7650999c31ec741bbe5"
                }
            ]
        },
        {
            "name" : "gudev",
            "buildsystem" : "meson",
            "config-opts" : [
                "-Dtests=disabled",
                "-Dintrospection=disabled"
            ],
            "sources" : [
                {
                    "type" : "git",
                    "url" : "https://gitlab.gnome.org/GNOME/libgudev.git"
                }
            ]
        },
        {
            "name" : "ModemManager",
            "buildsystem" : "autotools",
            "config-opts" : [
                "--disable-introspection",
                "--disable-vala",
                "--with-udev-base-dir=/app/lib",
                "--with-systemdsystemunitdir=/app/lib/systemd/system",
                "--without-mbim",
                "--without-qmi"
            ],
            "sources" : [
                {
                    "type" : "git",
                    "url" : "git://anongit.freedesktop.org/ModemManager/ModemManager"
                }
            ]
        },
        {
            "name": "purism-chatty",
            "buildsystem": "meson",
            "builddir": true,
            "sources": [
                {
                    "type": "git",
                    "url": "https://source.puri.sm/Librem5/chatty.git"
                }
            ]
        }
    ]
}
