{
 "app_id": "eu.betterbird.Betterbird",
 "source_url": "https://raw.githubusercontent.com/flathub/eu.betterbird.Betterbird/master/eu.betterbird.Betterbird.yml",
 "runtime": "org.freedesktop.Platform",
 "runtime_version": "25.08",
 "sdk": "org.freedesktop.Sdk",
 "finish_args": [
  "--share=ipc",
  "--share=network",
  "--socket=cups",
  "--socket=fallback-x11",
  "--socket=pcsc",
  "--socket=pulseaudio",
  "--socket=wayland",
  "--device=all",
  "--filesystem=xdg-download",
  "--filesystem=/var/spool/mail",
  "--filesystem=xdg-run/gnupg:ro",
  "--filesystem=/run/.heim_org.h5l.kcm-socket",
  "--filesystem=~/.gnupg",
  "--filesystem=xdg-run/speech-dispatcher:ro",
  "--filesystem=/var/mail",
  "--talk-name=org.kde.StatusNotifierWatcher",
  "--talk-name=org.gnome.evolution.dataserver.Calendar8",
  "--talk-name=org.gtk.vfs.*",
  "--talk-name=org.gnome.evolution.dataserver.Sources5",
  "--talk-name=org.a11y.Bus",
  "--own-name=org.mozilla.betterbird.*",
  "--system-talk-name=org.freedesktop.NetworkManager"
 ],
 "module_count": 13,
 "fetched_at": "2026-09-17T16:09:49.070314+00:00",
 "manifest": {
  "id": "eu.betterbird.Betterbird",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "25.08",
  "sdk": "org.freedesktop.Sdk",
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.node24",
   "org.freedesktop.Sdk.Extension.llvm22"
  ],
  "command": "betterbird",
  "finish-args": [
   "--share=ipc",
   "--share=network",
   "--socket=pulseaudio",
   "--socket=wayland",
   "--socket=fallback-x11",
   "--socket=pcsc",
   "--socket=cups",
   "--require-version=0.10.3",
   "--persist=.thunderbird",
   "--env=DICPATH=/usr/share/hunspell",
   "--filesystem=xdg-download:rw",
   "--filesystem=~/.gnupg",
   "--filesystem=xdg-run/gnupg:ro",
   "--filesystem=xdg-run/speech-dispatcher:ro",
   "--filesystem=/run/.heim_org.h5l.kcm-socket",
   "--filesystem=/var/mail",
   "--filesystem=/var/spool/mail",
   "--device=all",
   "--env=MOZ_DBUS_APP_NAME=betterbird",
   "--own-name=org.mozilla.betterbird.*",
   "--talk-name=org.gtk.vfs.*",
   "--talk-name=org.a11y.Bus",
   "--talk-name=org.kde.StatusNotifierWatcher",
   "--talk-name=org.gnome.evolution.dataserver.Calendar8",
   "--talk-name=org.gnome.evolution.dataserver.Sources5",
   "--system-talk-name=org.freedesktop.NetworkManager"
  ],
  "cleanup": [
   "/include",
   "/lib/pkgconfig",
   "/lib/girepository-1.0",
   "/lib/rust",
   "/share/pkgconfig",
   "/share/aclocal",
   "/share/gtk-doc",
   "/share/doc",
   "/share/info",
   "/share/gir-1.0",
   "/share/man",
   "/man",
   "*.la",
   "*.a"
  ],
  "build-options": {
   "no-debuginfo": true,
   "env": {
    "RUSTC_WRAPPER": "/app/bin/sccache",
    "SCCACHE_DIR": "/run/ccache/sccache",
    "SCCACHE_CONF": "/run/ccache/sccache/config"
   }
  },
  "modules": [
   {
    "name": "sccache",
    "buildsystem": "simple",
    "build-commands": [
     "install -Dma+rwx sccache /app/bin/sccache"
    ],
    "cleanup": [
     "/bin/sccache"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/mozilla/sccache/releases/download/v0.18.0/sccache-v0.18.0-x86_64-unknown-linux-musl.tar.gz",
      "sha256": "45f1447fbe231e3037bde351ef70677dd212216c8d62ae7ca409fecc4d6acc89",
      "only-arches": [
       "x86_64"
      ],
      "x-checker-data": {
       "type": "json",
       "url": "https://api.github.com/repos/mozilla/sccache/releases/latest",
       "version-query": ".tag_name",
       "url-query": ".assets[] | select(.name==\"sccache-\" + $version + \"-x86_64-unknown-linux-musl.tar.gz\") | .browser_download_url",
       "url-template": "https://github.com/mozilla/sccache/releases/download/$version/sccache-$version-x86_64-unknown-linux-musl.tar.gz"
      }
     },
     {
      "type": "archive",
      "url": "https://github.com/mozilla/sccache/releases/download/v0.18.0/sccache-v0.18.0-aarch64-unknown-linux-musl.tar.gz",
      "sha256": "2b3284d5da3b46a47dc4229e75bb7b88ac4aa99c8d754fb7d2f84997e5a4354a",
      "only-arches": [
       "aarch64"
      ],
      "x-checker-data": {
       "type": "json",
       "url": "https://api.github.com/repos/mozilla/sccache/releases/latest",
       "version-query": ".tag_name",
       "url-query": ".assets[] | select(.name==\"sccache-\" + $version + \"-aarch64-unknown-linux-musl.tar.gz\") | .browser_download_url",
       "url-template": "https://github.com/mozilla/sccache/releases/download/$version/sccache-$version-aarch64-unknown-linux-musl.tar.gz"
      }
     }
    ]
   },
   "shared-modules/libcanberra/libcanberra.json",
   "shared-modules/intltool/intltool-0.51.json",
   {
    "name": "rust",
    "buildsystem": "simple",
    "sources": [
     {
      "type": "archive",
      "only-arches": [
       "aarch64"
      ],
      "dest": "rust-aarch64-unknown-linux-gnu",
      "url": "https://static.rust-lang.org/dist/rust-1.95.0-aarch64-unknown-linux-gnu.tar.xz",
      "sha256": "094c9c36531911c5cc7dd6ab2d3069ab8dcd744d6239b0bda1387b243dfc391e"
     },
     {
      "type": "archive",
      "only-arches": [
       "x86_64"
      ],
      "dest": "rust-x86_64-unknown-linux-gnu",
      "url": "https://static.rust-lang.org/dist/rust-1.95.0-x86_64-unknown-linux-gnu.tar.xz",
      "sha256": "2e0338f18ecbaa4a0f631b9e80e8b8e26bb6fe77dd5454fba8a70cf96c1e84a1"
     }
    ],
    "build-options": {
     "prefix": "/app/lib/rust",
     "arch": {
      "x86_64": {
       "env": {
        "NATIVE_TARGET": "x86_64-unknown-linux-gnu"
       }
      },
      "aarch64": {
       "env": {
        "NATIVE_TARGET": "aarch64-unknown-linux-gnu"
       }
      }
     }
    },
    "build-commands": [
     "cd \"rust-$NATIVE_TARGET\" && ./install.sh --prefix=/app/lib/rust --without=rust-docs --without=rust-docs-json-preview --disable-ldconfig --verbose"
    ]
   },
   {
    "name": "libdbusmenu",
    "build-options": {
     "cflags": "-Wno-error",
     "env": {
      "HAVE_VALGRIND_FALSE": "#",
      "HAVE_VALGRIND_TRUE": ""
     }
    },
    "cleanup": [
     "/include",
     "/libexec",
     "/lib/pkgconfig",
     "/lib/*.la",
     "/share/doc",
     "/share/libdbusmenu",
     "/share/gtk-doc",
     "/share/gir-1.0"
    ],
    "config-opts": [
     "--disable-static",
     "--disable-gtk-doc",
     "--enable-introspection=no",
     "--disable-vala",
     "--disable-dumper",
     "--disable-tests",
     "--with-gtk=3"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://launchpad.net/libdbusmenu/16.04/16.04.0/+download/libdbusmenu-16.04.0.tar.gz",
      "mirror-urls": [
       "https://sources.suse.com/SUSE:SLFO:Main:Build/libdbusmenu/a5b3e4717f09f90f9cd5568a5f933e8d/libdbusmenu-16.04.0.tar.gz",
       "https://mirror.math.princeton.edu/pub/frugalware/frugalware-2.1/source/xlib/libdbusmenu/libdbusmenu-16.04.0.tar.gz",
       "https://ftp.fr.openbsd.org/pub/OpenBSD/distfiles/libdbusmenu-16.04.0.tar.gz"
      ],
      "sha256": "b9cc4a2acd74509435892823607d966d424bd9ad5d0b00938f27240a1bfa878a",
      "x-checker-data": {
       "type": "html",
       "url": "https://launchpad.net/libdbusmenu/+download",
       "version-pattern": "libdbusmenu-16.04.([\\d\\.]+)\\.tar\\.gz",
       "url-template": "https://launchpad.net/libdbusmenu/16.04/16.04.$version/+download/libdbusmenu-16.04.$version.tar.gz"
      }
     }
    ]
   },
   {
    "name": "pcsc-lite",
    "buildsystem": "meson",
    "config-opts": [
     "-Dlibsystemd=false",
     "-Dlibudev=false",
     "-Dserial=false",
     "-Dusb=false",
     "-Dpolkit=false"
    ],
    "post-install": [
     "rm /app/sbin/pcscd",
     "rmdir /app/sbin || true"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/LudovicRousseau/PCSC.git",
      "tag": "2.5.1",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^([\\d.]+)$"
      },
      "commit": "09138d7f7d02c714b004d9850f28727fbcc48a97"
     }
    ]
   },
   {
    "name": "yasm",
    "build-options": {
     "cflags": "-std=c17"
    },
    "cleanup": [
     "*"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz",
      "sha256": "3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f",
      "x-checker-data": {
       "type": "html",
       "url": "https://www.tortall.net/projects/yasm/releases/",
       "version-pattern": "yasm-([\\d\\.]+)\\.tar\\.gz",
       "url-template": "https://www.tortall.net/projects/yasm/releases/yasm-$version.tar.gz"
      }
     }
    ]
   },
   {
    "name": "sound-theme-freedesktop",
    "sources": [
     {
      "type": "git",
      "url": "https://salsa.debian.org/gnome-team/sound-theme-freedesktop.git",
      "tag": "upstream/0.8",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^upstream/([\\d.]+)$"
      },
      "commit": "3a91d7a2742e5b591badc3443eab9ea5bd7826e5"
     }
    ]
   },
   {
    "name": "krb5",
    "subdir": "src",
    "config-opts": [
     "--localstatedir=/var/lib",
     "--sbindir=${FLATPAK_DEST}/bin",
     "--disable-rpath",
     "--disable-static"
    ],
    "post-install": [
     "install -Dm644 ../krb5.conf -t ${FLATPAK_DEST}/etc/"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://kerberos.org/dist/krb5/1.22/krb5-1.22.tar.gz",
      "sha256": "652be617b4647f3c5dcac21547d47c7097101aad4e306f1778fb48e17b220ba3",
      "x-checker-data": {
       "type": "html",
       "url": "https://kerberos.org/dist/krb5/",
       "version-pattern": "href=\"([\\d\\.]+)/\"",
       "url-template": "https://kerberos.org/dist/krb5/$version/krb5-$version.tar.gz"
      }
     },
     {
      "type": "file",
      "path": "krb5.conf"
     }
    ],
    "cleanup": [
     "/bin",
     "/share/et",
     "/share/examples",
     "/share/man"
    ]
   },
   {
    "name": "libical",
    "cleanup": [
     "/lib/cmake"
    ],
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DCMAKE_INSTALL_LIBDIR:PATH=/app/lib",
     "-DBUILD_SHARED_LIBS=On",
     "-DLIBICAL_BUILD_DOCS=False",
     "-DLIBICAL_CXX_BINDINGS=False",
     "-DLIBICAL_JAVA_BINDINGS=False"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/libical/libical/releases/download/v4.0.5/libical-4.0.5.tar.gz",
      "sha256": "cc09a3ac41d60e6144e644bd3fcf97d47106d659c4a0b8965102581401e67c9c",
      "x-checker-data": {
       "type": "json",
       "url": "https://api.github.com/repos/libical/libical/releases/latest",
       "version-query": ".tag_name | sub(\"^v\"; \"\")",
       "url-query": ".assets[] | select(.name==\"libical-\" + $version + \".tar.gz\") | .browser_download_url"
      }
     }
    ]
   },
   {
    "name": "evolution-data-server",
    "cleanup": [
     "/share/GConf"
    ],
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DENABLE_CANBERRA=OFF",
     "-DENABLE_GOA=OFF",
     "-DENABLE_DOT_LOCKING=OFF",
     "-DENABLE_FILE_LOCKING=fcntl",
     "-DENABLE_GTK=ON",
     "-DENABLE_GTK4=OFF",
     "-DENABLE_GOOGLE=OFF",
     "-DENABLE_VALA_BINDINGS=OFF",
     "-DENABLE_WEATHER=OFF",
     "-DWITH_OPENLDAP=OFF",
     "-DWITH_LIBDB=OFF",
     "-DENABLE_INTROSPECTION=OFF",
     "-DENABLE_INSTALLED_TESTS=OFF",
     "-DENABLE_GTK_DOC=OFF",
     "-DENABLE_EXAMPLES=OFF",
     "-DENABLE_OAUTH2_WEBKITGTK4=OFF",
     "-DENABLE_OAUTH2_WEBKITGTK=OFF"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/GNOME/evolution-data-server.git",
      "tag": "3.62.0",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^([\\d.]+)$"
      },
      "commit": "99edc087f1207979d951295f1a01f9b010e176ca"
     }
    ]
   },
   {
    "name": "cbindgen",
    "buildsystem": "simple",
    "build-commands": [
     "cargo --offline fetch --manifest-path Cargo.toml --verbose",
     "cargo --offline build --release --verbose",
     "install -Dm 755 target/release/cbindgen -t /app/bin"
    ],
    "build-options": {
     "append-path": "/app/lib/rust/bin",
     "env": {
      "CARGO_HOME": "/run/build/cbindgen/cargo"
     }
    },
    "cleanup": [
     "*"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/mozilla/cbindgen.git",
      "tag": "v0.29.4",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^v([\\d.]+)$"
      },
      "commit": "b826cb8911488fe8a209d2b693492c0c673e8cca"
     },
     "cbindgen-sources.json"
    ]
   },
   {
    "name": "betterbird",
    "buildsystem": "simple",
    "build-options": {
     "append-path": "/app/lib/rust/bin:/usr/lib/sdk/node24/bin:/usr/lib/sdk/llvm22/bin",
     "prepend-ld-library-path": "/usr/lib/sdk/llvm22/lib",
     "env": {
      "TERM": "linux",
      "CARGO_HOME": "/run/build/betterbird/cargo",
      "npm_config_nodedir": "/usr/lib/sdk/node24"
     }
    },
    "build-commands": [
     "./make-mozconfig.sh 153",
     "chmod u+x apply-patches.sh",
     "./apply-patches.sh 153",
     "sed -i 's#-I/usr/include#-I/app/include#g' comm/third_party/appindicator/moz.build",
     "export MOZ_BUILD_DATE=$(cat .build-date); ./mach configure; ./mach build -v -j ${FLATPAK_BUILDER_N_JOBS}; ./mach install",
     "rm -rf /app/lib/betterbird/chrome",
     "rm -f /app/bin/betterbird",
     "install -Dm755 betterbird-wrapper /app/bin/betterbird",
     "install -Dm644 distribution.ini /app/lib/betterbird/distribution/distribution.ini",
     "install -Dm644 default-preferences.js /app/lib/betterbird/defaults/pref/default-preferences.js",
     "mkdir -p /app/lib/betterbird/extensions",
     "for xpi in langpacks/*.xpi; do export locale=$(basename -s .xpi $xpi); install -Dm644 -t /app/share/runtime/locale/${locale:9:2}/ $xpi; ln -sf /app/share/runtime/locale/${locale:9:2}/$(basename $xpi) /app/lib/betterbird/extensions/$(basename $xpi); done",
     "for i in 16 22 24 32 48 64 128 256; do install -Dm644 thunderbird-patches/metadata/icons/betterbird${i}.png /app/lib/betterbird/chrome/icons/default/default${i}.png; done",
     "install -Dm644 comm/mail/branding/betterbird/default.svg /app/share/icons/hicolor/scalable/status/eu.betterbird.Betterbird-default.svg",
     "install -Dm644 comm/mail/branding/betterbird/newmail.svg /app/share/icons/hicolor/scalable/status/eu.betterbird.Betterbird-newmail.svg",
     "for i in 16 22 24 32 48 64 128 256; do install -Dm644 thunderbird-patches/metadata/icons/betterbird${i}.png /app/share/icons/hicolor/${i}x${i}/apps/eu.betterbird.Betterbird.png; done",
     "install -Dm644 thunderbird-patches/metadata/icons/betterbird.svg /app/share/icons/hicolor/scalable/apps/eu.betterbird.Betterbird.svg",
     "gtk-update-icon-cache -f -t /app/share/icons/hicolor",
     "install -Dm644 thunderbird-patches/metadata/eu.betterbird.Betterbird.desktop /app/share/applications/eu.betterbird.Betterbird.desktop",
     "install -Dm644 thunderbird-patches/metadata/eu.betterbird.Betterbird.153.appdata.xml /app/share/metainfo/eu.betterbird.Betterbird.appdata.xml",
     "install -Dm644 fonts.conf /app/etc/fonts/local.conf"
    ],
    "sources": [
     "thunderbird-sources.json",
     {
      "type": "file",
      "path": "distribution.ini"
     },
     {
      "type": "file",
      "path": "default-preferences.js"
     },
     {
      "type": "script",
      "dest-filename": "betterbird-wrapper",
      "commands": [
       "export TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"",
       "exec /app/lib/betterbird/betterbird \"$@\""
      ]
     },
     {
      "type": "git",
      "url": "https://github.com/Betterbird/thunderbird-patches.git",
      "commit": "9e4a2790b202c6116fe89e68e41ae447efdd4cfa",
      "dest": "thunderbird-patches",
      "tag": "153.3.0esr-bb9"
     },
     {
      "type": "file",
      "path": "mozconfig-flatpak"
     },
     {
      "type": "file",
      "path": "mozconfig-aarch64"
     },
     {
      "type": "file",
      "path": ".build-date"
     },
     {
      "type": "script",
      "dest-filename": "make-mozconfig.sh",
      "commands": [
       "cat thunderbird-patches/$1/mozconfig-Linux mozconfig-flatpak | sed -r 's/(mk_add_options MOZ_MAKE_FLAGS=\"-j[0-9]+\")/# \\1/' > mozconfig"
      ],
      "only-arches": [
       "x86_64"
      ]
     },
     {
      "type": "script",
      "dest-filename": "make-mozconfig.sh",
      "commands": [
       "cat thunderbird-patches/$1/mozconfig-Linux mozconfig-flatpak mozconfig-aarch64 | sed -r 's/(mk_add_options MOZ_MAKE_FLAGS=\"-j[0-9]+\")/# \\1/' > mozconfig"
      ],
      "only-arches": [
       "aarch64"
      ]
     },
     {
      "type": "file",
      "path": "apply-patches.sh"
     },
     {
      "type": "file",
      "path": "fonts.conf"
     }
    ]
   }
  ]
 }
}