# vim: filetype=yaml sw=2
version: '[% c("abbrev") %]'
filename: 'firefox-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %]'
git_hash: 'tor-browser-[% c("var/firefox_version") %]-[% c("var/torbrowser_branch") %]-1-build3'
tag_gpg_id: 1
git_url: https://git.torproject.org/tor-browser.git
git_submodule: 1
gpg_keyring: torbutton.gpg

var:
  firefox_platform_version: 78.11.0
  firefox_version: '[% c("var/firefox_platform_version") %]esr'
  torbrowser_branch: 10.5
  branding_directory: 'browser/branding/alpha'
  copyright_year: '[% exec("git show -s --format=%ci").remove("-.*") %]'
  deps:
    - build-essential
    - unzip
    - zip
    - autoconf2.13
    - yasm
    # We are building our own version of Python 3.6, which is required
    # for the build. However mach still requires Python 2.7, so we
    # install this version using the package.
    - python
    - pkg-config
  container:
    use_container: 1

steps:
  src-tarballs:
    filename: 'src-[% project %]-[% c("version") %].tar.xz'
    version: '[% c("git_hash") %]'
    input_files: []
    var:
      container:
        use_container: 0
    targets:
      nightly:
        version: '[% c("abbrev") %]'

targets:
  release:
    var:
      branding_directory: 'browser/branding/official'

  nightly:
    git_hash: 'tor-browser-[% c("var/firefox_version") %]-[% c("var/torbrowser_branch") %]-1'
    tag_gpg_id: 0
    var:
      branding_directory: 'browser/branding/nightly'

  linux-x86_64:
    var:
      martools_filename: mar-tools-linux64.zip
      arch_deps:
        - libgtk2.0-dev
        - libgtk-3-dev
        - libdbus-glib-1-dev
        - libxt-dev
        - hardening-wrapper
        # To pass configure since ESR 31.
        - libpulse-dev
        # To pass configure since ESR 52
        - libx11-xcb-dev
        # To support Wayland mode
        - libdrm-dev

  linux-i686:
    var:
      martools_filename: mar-tools-linux32.zip
      sort_deps: 0
      arch_deps:
        - libgtk2.0-dev:i386
        - libgtk-3-dev:i386
        - libdbus-glib-1-dev:i386
        - libxt-dev:i386
        - hardening-wrapper
        # To pass configure since ESR 31.
        - libpulse-dev:i386
        # To pass configure since ESR 52
        - libx11-xcb-dev:i386
        # To support Wayland mode
        - libdrm-dev:i386

  linux-arm64:
    var:
      martools_filename: mar-tools-linux-arm64.zip
      arch_deps:
        - libgtk2.0-dev
        - libgtk-3-dev
        - libdbus-glib-1-dev
        - libxt-dev
          #- hardening-wrapper
        # To pass configure since ESR 31.
        - libpulse-dev
        # To pass configure since ESR 52
        - libx11-xcb-dev
        # To support Wayland mode
        - libdrm-dev

  linux-armhf:
    var:
      martools_filename: mar-tools-linux-armhf.zip
      arch_deps:
        - libgtk2.0-dev
        - libgtk-3-dev
        - libdbus-glib-1-dev
        - libxt-dev
        - hardening-wrapper
        # To pass configure since ESR 31.
        - libpulse-dev
        # To pass configure since ESR 52
        - libx11-xcb-dev
        # To support Wayland mode
        - libdrm-dev

  osx-x86_64:
    var:
      martools_filename: mar-tools-mac64.zip
      arch_deps:
        - rsync

  windows:
    var:
      arch_deps:
        - wine
      compiler: mingw-w64-clang

  windows-i686:
    var:
      martools_filename: mar-tools-win32.zip

  windows-x86_64:
    var:
      martools_filename: mar-tools-win64.zip

input_files:
  - project: container-image
  - name: '[% c("var/compiler") %]'
    project: '[% c("var/compiler") %]'
  - filename: get-moz-build-date
  - filename: 'mozconfig-[% c("var/osname") %][% IF c("var/asan") %]-asan[% END %]'
    name: mozconfig
  - project: binutils
    name: binutils
    enable: '[% c("var/linux") %]'
  - filename: fix-info-plist.py
    enable: '[% c("var/osx") %]'
  - filename: nsis-uninstall.patch
    enable: '[% c("var/windows") %]'
  - filename: 1526653.patch
    enable: '[% c("var/linux-armhf") %]'
  - project: rust
    name: rust
  - project: cbindgen
    name: cbindgen
  - project: wasi-sysroot
    name: wasi-sysroot
    enable: '[% c("var/rlbox") %]'
  - project: lucetc
    name: lucetc
    enable: '[% c("var/rlbox") %]'
  - project: node
    name: node
  - project: nasm
    name: nasm
  - project: python
    name: python
  - project: clang
    name: clang
  - project: fxc2
    name: fxc2
    enable: '[% c("var/windows") %]'
    target_prepend:
      - torbrowser-windows-x86_64
  - name: mingw-w64
    project: mingw-w64
    enable: '[% c("var/windows") %]'
  - filename: abicheck.cc
    enable: '[% c("var/linux") %]'
  - filename: start-firefox
    enable: '[% c("var/linux") %]'
  - project: tor-launcher
    name: tor-launcher
  - filename: namecoin-torbutton.patch
    enable: '[% c("var/namecoin") %]'
    # TorButton patch authored by Arthur Edelstein, from https://github.com/arthuredelstein/torbutton/ branch 2.1.10-namecoin
  - filename: namecoin-etld.patch
    enable: '[% c("var/namecoin") %]'
