id: com.gexperts.Tilix
branch: master
runtime: org.gnome.Platform
runtime-version: '3.30'
sdk: org.gnome.Sdk
command: tilix
finish-args:
  - --share=ipc
  - --socket=x11
  - --socket=wayland
  - --filesystem=xdg-run/dconf
  - --filesystem=~/.config/dconf:ro
  - --talk-name=ca.desrt.dconf
  - --env=DCONF_USER_CONFIG_DIR=.config/dconf
  - --own-name=com.gexperts.Tilix
  - --talk-name=org.freedesktop.Flatpak
  - --talk-name=org.freedesktop.secrets
  - --device=all
cleanup:
  # - '/bin/ldc*'
  # - '/bin/ldmd2'
  - '/bin/dmd*'
  - '/bin/po4a*'
  - '/bin/vte*'
  - '/ldc-0.17'
  - '/etc/bash_completion.d'
  - '/include'
  - '/lib/cmake'
  - '/lib/debug'
  - '/lib/pkgconfig'
  - '/share/gtk-doc'
  - '/share/man'
  - '/src'
  - '*.la'
  - '*.a'
build-options:
  env:
    PERLLIB: '/app/lib'
modules:
  - name: termcap
    buildsystem: autotools
    sources:
      - type: archive
        url: https://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz
        sha256: 91a0e22e5387ca4467b5bcb18edf1c51b930262fd466d5fda396dd9d26719100 
  - name: ncurses
    buildsystem: autotools
    config-opts:
      - '--with-shared'
    sources:
      - type: archive
        url: https://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz
        sha256: aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17
  - name: libconfig
    buildsystem: autotools
    sources:
      - type: archive
        url: https://hyperrealm.github.io/libconfig/dist/libconfig-1.7.2.tar.gz
        sha256: 7c3c7a9c73ff3302084386e96f903eb62ce06953bb1666235fac74363a16fad9
  - name: libedit
    buildsystem: autotools
    sources:
      - type: archive
        url: https://thrysoee.dk/editline/libedit-20181209-3.1.tar.gz
        sha256: 2811d70c0b000f2ca91b7cb1a37203134441743c4fcc9c37b0b687f328611064
  - name: ldc-0.17
    buildsystem: cmake-ninja
    config-opts:
      - '-DCMAKE_SYSTEM_PREFIX_PATH=/app'
      - '-DCMAKE_INSTALL_PREFIX:PATH=/app/ldc-0.17'
    sources:
      - type: archive
        url: https://github.com/ldc-developers/ldc/releases/download/v0.17.5/ldc-0.17.5-src.tar.gz
        sha256: 7aa540a135f9fa1ee9722cad73100a8f3600a07f9a11d199d8be68887cc90008
      - type: patch
        path: disable-ldc-completions.patch
  - name: dmd
    buildsystem: simple
    build-commands:
      - 'make -j2 -C dmd -f posix.mak install HOST_DMD=/app/ldc-0.17/bin/ldmd2 INSTALL_DIR=$PWD/install'
      - 'make -j2 -C phobos -f posix.mak install INSTALL_DIR=$PWD/install'
      - 'cp -rv install/linux/bin* /app/bin'
      - 'cp -v dmd.conf /app/bin'
      - 'cp -rv install/linux/lib* /app'
      - 'install -d /app/src'
      - 'cp -rv druntime phobos /app/src'
    sources:
      - type: git
        url: https://github.com/dlang/dmd
        tag: v2.081.1
        dest: dmd
      - type: git
        url: https://github.com/dlang/druntime
        tag: v2.081.1
        dest: druntime
      - type: git
        url: https://github.com/dlang/tools
        tag: v2.081.1
        dest: tools
      - type: git
        url: https://github.com/dlang/phobos
        tag: v2.081.1
        dest: phobos
      - type: file
        path: dmd.conf
  # - name: ldc
  #   buildsystem: cmake-ninja
  #   config-opts:
  #     - '-DD_COMPILER=/app/ldc-0.17/bin/ldmd2'
  #   sources:
  #     - type: archive
  #       url: https://github.com/ldc-developers/ldc/releases/download/v1.11.0-beta2/ldc-1.11.0-beta2-src.tar.gz
  #       sha256: 49ef9009238859275e80afa20ee6d37b6797a1b2b41923a2a5922b6381efb14c
  - name: gtkd
    buildsystem: simple
    build-commands:
      - 'make -j2 prefix=/app install-gtkd install-vte'
    sources:
      - type: archive
        url: https://gtkd.org/Downloads/sources/GtkD-3.8.4.zip
        sha256: b9686f30c48df58909c9845dcf7fb6a40745e47b6db412f8eb9ad2c655fd6136
        strip-components: 0
  - name: po4a
    buildsystem: simple
    build-commands:
      - 'install -m 755 po4a /app/bin'
      - 'install -m 755 po4a-gettextize /app/bin'
      - 'install -m 755 po4a-normalize /app/bin'
      - 'install -m 755 po4a-translate /app/bin'
      - 'install -m 755 po4a-updatepo /app/bin'
      - 'cp -r lib/* /app/lib'
    sources:
      - type: archive
        url: https://github.com/mquinson/po4a/releases/download/v0.54/po4a-0.54.tar.gz
        sha256: 596f7621697f9dd12709958c229e256b56683d25997ac73c9625a2cc0c603d51
  - name: libvte-patched
    buildsystem: autotools
    config-opts:
      - '--disable-introspection'
      - '--disable-vala'
    sources:
      - type: archive
        url: https://ftp.gnome.org/pub/GNOME/sources/vte/0.53/vte-0.53.0.tar.xz
        sha256: c319eb34e9c64c78cd4940cde0892bd18784bcdcaaa7a23a9c8ec6052317a130
      - type: patch
        path: vte291-command-notify-scroll-speed.patch
  - name: toolbox
    buildsystem: simple
    build-commands:
      - 'gcc -static -o /app/bin/tilix-flatpak-toolbox tilix-flatpak-toolbox.c'
    sources:
      - type: file
        path: tilix-flatpak-toolbox.c
  - name: tilix
    buildsystem: meson
    sources:
      - type: git
        url: https://github.com/gnunn1/tilix.git
