name: mpv-files
build-commands: []
buildsystem: simple
modules:
  # MPV and MPV deps
  # This is basically copied from the mpv flatpak
  - name: lmdb
    sources:
      - sha256: f3927859882eb608868c8c31586bb7eb84562a40a6bf5cc3e13b6b564641ea28
        type: archive
        url: https://github.com/LMDB/lmdb/archive/LMDB_0.9.22.tar.gz
    make-install-args:
      - prefix=/app
    no-autogen: true
    subdir: libraries/liblmdb

  - name: parse-yapp
    buildsystem: simple
    build-commands:
      - perl Makefile.PL INSTALL_BASE=/app
      - make
      - make install
    sources:
      - type: archive
        url: https://cpan.metacpan.org/authors/id/W/WB/WBRASWELL/Parse-Yapp-1.21.tar.gz
        sha256: 3810e998308fba2e0f4f26043035032b027ce51ce5c8a52a8b8e340ca65f13e5

  - name: smbclient
    config-opts:
      - --without-json
      - --without-ad-dc
      - --without-ldap
      - --without-ads
      - --without-pam
      - --disable-python
      - --disable-cups
      - --disable-iprint
      - --without-systemd
      - --bindir=.
      - --sbindir=.
      - --sysconfdir=.
    cleanup:
      - /lib/perl5
    build-options:
      env:
        PERL5LIB: /app/lib/perl5
    buildsystem: autotools
    sources:
      - type: archive
        archive-type: tar
        url: https://download.samba.org/pub/samba/stable/samba-4.20.2.tar.gz
        sha256: f969ffed58ccf3e85cbbcc0e33a1726d025c2b40f42a653b1125b82b92d2e0e5
        x-checker-data:
          type: html
          url: https://download.samba.org/pub/samba/stable/?C=M;O=D
          version-pattern: samba-(\d+\.\d+\.\d+).tar.gz
          url-template: https://download.samba.org/pub/samba/stable/samba-$version.tar.gz

  - name: libXmu
    buildsystem: autotools
    sources:
      - type: git
        url: https://gitlab.freedesktop.org/xorg/lib/libxmu.git
        tag: libXmu-1.2.1
        commit: 792f80402ee06ce69bca3a8f2a84295999c3a170
        x-checker-data:
          type: git
          tag-pattern: ^libXmu-([\d.]+)$

  - name: xclip
    buildsystem: autotools
    sources:
      - type: git
        url: https://github.com/astrand/xclip.git
        tag: '0.13'
        commit: 9aa7090c3b8b437c6489edca32ae43d82e0c1281
        x-checker-data:
          type: git
          tag-pattern: ^(\d+\.\d+)$

  - name: libXpresent
    buildsystem: autotools
    sources:
      - type: git
        url: https://gitlab.freedesktop.org/xorg/lib/libxpresent.git
        tag: libXpresent-1.0.1
        commit: 37507b5f44332accfb1064ee69a4f6a833994747
        x-checker-data:
          type: git
          tag-pattern: ^libXpresent-([\d.]+)$

  - name: luajit
    no-autogen: true
    cleanup:
      - /bin
      - /include
      - /lib/pkgconfig
      - /share/man
    sources:
      - type: git
        url: https://github.com/LuaJIT/LuaJIT.git
        mirror-urls:
          - https://luajit.org/git/luajit.git
        disable-shallow-clone: true
        commit: 04dca7911ea255f37be799c18d74c305b921c1a6
        x-checker-data:
          type: json
          url: https://api.github.com/repos/LuaJIT/LuaJIT/commits
          commit-query: first( .[].sha )
          version-query: first( .[].sha )
          timestamp-query: first( .[].commit.committer.date )
      - type: shell
        commands:
          - sed -i 's|/usr/local|/app|' ./Makefile

  - name: yt-dlp
    no-autogen: true
    no-make-install: true
    make-args:
      - yt-dlp
      - PYTHON=/usr/bin/python3
    post-install:
      - install yt-dlp /app/bin
    sources:
      - type: archive
        url: https://github.com/yt-dlp/yt-dlp/releases/download/2024.07.07/yt-dlp.tar.gz
        sha256: c44daee08ec77efd64f31361511fcef5136b35458b3fac474434cdd25df65d98
        x-checker-data:
          type: json
          url: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
          version-query: .tag_name
          url-query: .assets[] | select(.name=="yt-dlp.tar.gz") | .browser_download_url

  - name: uchardet
    buildsystem: cmake-ninja
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      - -DBUILD_STATIC=0
    cleanup:
      - /bin
      - /include
      - /lib/pkgconfig
      - /share/man
    sources:
      - type: archive
        url: https://www.freedesktop.org/software/uchardet/releases/uchardet-0.0.8.tar.xz
        sha256: e97a60cfc00a1c147a674b097bb1422abd9fa78a2d9ce3f3fdcc2e78a34ac5f0
        x-checker-data:
          type: html
          url: https://www.freedesktop.org/software/uchardet/releases/
          version-pattern: uchardet-(\d\.\d+\.?\d*).tar.xz
          url-template: https://www.freedesktop.org/software/uchardet/releases/uchardet-$version.tar.xz

  - name: libass
    cleanup:
      - /include
      - /lib/pkgconfig
    config-opts:
      - --disable-static
    sources:
      - type: git
        url: https://github.com/libass/libass.git
        tag: 0.17.3
        commit: e46aedea0a0d17da4c4ef49d84b94a7994664ab5
        x-checker-data:
          type: git
          tag-pattern: ^(\d\.\d{1,3}\.\d{1,2})$

  - name: libv4l2
    buildsystem: meson
    cleanup:
      - /include
      - /lib/pkgconfig
      - /share/man
    config-opts:
      - -Ddoxygen-html=false
      - -Ddoxygen-doc=disabled
      - -Dbpf=disabled
      - -Dudevdir=/app/lib/udev
    sources:
      - type: git
        url: https://git.linuxtv.org/v4l-utils.git
        mirror-urls:
          - https://github.com/gjasny/v4l-utils.git
        tag: v4l-utils-1.26.1
        commit: 4aee01a027923cab1e40969f56f8ba58d3e6c0d1
        x-checker-data:
          type: git
          tag-pattern: ^v4l-utils-([\d.]+)$

  - name: libcdio
    config-opts:
      - --disable-static
      - --disable-example-progs
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - type: archive
        url: https://ftp.gnu.org/gnu/libcdio/libcdio-2.1.0.tar.bz2
        mirror-urls:
          - https://mirrors.kernel.org/gnu/libcdio/libcdio-2.1.0.tar.bz2
          - https://mirrors.ocf.berkeley.edu/gnu/libcdio/libcdio-2.1.0.tar.bz2
          - https://ftpmirror.gnu.org/gnu/libcdio/libcdio-2.1.0.tar.bz2
        sha256: 8550e9589dbd594bfac93b81ecf129b1dc9d0d51e90f9696f1b2f9b2af32712b
        x-checker-data:
          type: html
          url: https://ftp.gnu.org/gnu/libcdio/
          version-pattern: libcdio-(\d\.\d+\.?\d*).tar.bz2
          url-template: https://ftp.gnu.org/gnu/libcdio/libcdio-$version.tar.bz2

  - name: libcdio-paranoia
    config-opts:
      - --disable-static
      - --disable-example-progs
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - type: archive
        url: https://ftp.gnu.org/gnu/libcdio/libcdio-paranoia-10.2+2.0.1.tar.bz2
        mirror-urls:
          - https://mirrors.kernel.org/gnu/libcdio/libcdio-paranoia-10.2+2.0.1.tar.bz2
          - https://mirrors.ocf.berkeley.edu/gnu/libcdio/libcdio-paranoia-10.2+2.0.1.tar.bz2
          - https://ftpmirror.gnu.org/gnu/libcdio/libcdio-paranoia-10.2+2.0.1.tar.bz2
        sha256: 33b1cf305ccfbfd03b43936975615000ce538b119989c4bec469577570b60e8a
        x-checker-data:
          type: html
          url: https://ftp.gnu.org/gnu/libcdio/
          version-pattern: libcdio-paranoia-([\d\.\+-]+).tar.bz2
          url-template: https://ftp.gnu.org/gnu/libcdio/libcdio-paranoia-$version.tar.bz2

  - name: libdvdread
    config-opts:
      - --disable-static
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - type: archive
        url: https://download.videolan.org/pub/videolan/libdvdread/6.1.3/libdvdread-6.1.3.tar.bz2
        mirror-urls:
          - https://videolan.mirror.ba/libdvdread/6.1.3/libdvdread-6.1.3.tar.bz2
          - https://videolan.c3sl.ufpr.br/libdvdread/6.1.3/libdvdread-6.1.3.tar.bz2
        sha256: ce35454997a208cbe50e91232f0e73fb1ac3471965813a13b8730a8f18a15369
        x-checker-data:
          type: html
          url: https://www.videolan.org/developers/libdvdnav.html
          version-pattern: The latest version of <code>libdvdread</code> is <b>([\d\-\.]+)<
          url-template: https://download.videolan.org/pub/videolan/libdvdread/$version/libdvdread-$version.tar.bz2

  - name: libdvdnav
    config-opts:
      - --disable-static
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - type: archive
        url: https://download.videolan.org/pub/videolan/libdvdnav/6.1.1/libdvdnav-6.1.1.tar.bz2
        mirror-urls:
          - https://videolan.mirror.ba/libdvdnav/6.1.1/libdvdnav-6.1.1.tar.bz2
          - https://videolan.c3sl.ufpr.br/libdvdnav/6.1.1/libdvdnav-6.1.1.tar.bz2
        sha256: c191a7475947d323ff7680cf92c0fb1be8237701885f37656c64d04e98d18d48
        x-checker-data:
          type: html
          url: https://www.videolan.org/developers/libdvdnav.html
          version-pattern: The latest version of <code>libdvdnav</code> is <b>([\d\-\.]+)</b>\.
          url-template: https://download.videolan.org/pub/videolan/libdvdnav/$version/libdvdnav-$version.tar.bz2

  - name: libaacs
    config-opts:
      - --disable-static
      - --disable-bdjava-jar
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - sha256: a88aa0ebe4c98a77f7aeffd92ab3ef64ac548c6b822e8248a8b926725bea0a39
        type: archive
        url: https://download.videolan.org/pub/videolan/libaacs/0.11.1/libaacs-0.11.1.tar.bz2
        mirror-urls:
          - https://videolan.mirror.ba/libaacs/0.11.1/libaacs-0.11.1.tar.bz2
          - https://videolan.c3sl.ufpr.br/libaacs/0.11.1/libaacs-0.11.1.tar.bz2
        x-checker-data:
          type: html
          url: https://www.videolan.org/developers/libaacs.html
          version-pattern: Latest release is <b>libaacs (\d\.\d+\.?\d*)</b>
          url-template: https://download.videolan.org/pub/videolan/libaacs/$version/libaacs-$version.tar.bz2

  - name: libbluray
    config-opts:
      - --disable-static
      - --disable-bdjava-jar
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - sha256: 478ffd68a0f5dde8ef6ca989b7f035b5a0a22c599142e5cd3ff7b03bbebe5f2b
        type: archive
        url: https://download.videolan.org/pub/videolan/libbluray/1.3.4/libbluray-1.3.4.tar.bz2
        mirror-urls:
          - https://videolan.mirror.ba/libbluray/1.3.4/libbluray-1.3.4.tar.bz2
          - https://videolan.c3sl.ufpr.br/libbluray/1.3.4/libbluray-1.3.4.tar.bz2
        x-checker-data:
          type: html
          url: https://www.videolan.org/developers/libbluray.html
          version-pattern: Latest release is <b>libbluray (\d\.\d+\.?\d*)</b>\.
          url-template: https://download.videolan.org/pub/videolan/libbluray/$version/libbluray-$version.tar.bz2

  - name: zimg
    config-opts:
      - --disable-static
    cleanup:
      - /include
      - /lib/pkgconfig
      - /share/doc
    sources:
      - type: archive
        archive-type: tar
        url: https://api.github.com/repos/sekrit-twc/zimg/tarball/release-3.0.5
        sha256: 1b8998f03f4a49e4d730033143722b32bc28a5306ef809ccfb3b4bbb29e4b784
        x-checker-data:
          type: json
          url: https://api.github.com/repos/sekrit-twc/zimg/releases/latest
          url-query: .tarball_url
          version-query: .tag_name | sub("^release-"; "")
          timestamp-query: .published_at

  - name: rubberband
    buildsystem: meson
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - type: git
        url: https://github.com/breakfastquay/rubberband.git
        mirror-urls:
          - https://hg.sr.ht/~breakfastquay/rubberband
        tag: v3.3.0
        commit: 2be46b0dffb13273a67396c77bc9278736bb03d2
        x-checker-data:
          type: git
          tag-pattern: ^v([\d.]+)$

  - name: mujs
    buildsystem: autotools
    no-autogen: true
    make-args:
      - release
    make-install-args:
      - prefix=/app
      - install-shared
    cleanup:
      - /bin
      - /include
      - /lib/pkgconfig
    sources:
      - type: git
        url: https://github.com/ccxvii/mujs.git
        mirror-urls:
          - http://git.ghostscript.com/mujs.git
        tag: 1.3.5
        commit: 0df0707f2f10187127e36acfbc3ba9b9ca5b5cf0
        x-checker-data:
          type: git
          url: https://api.github.com/repos/ccxvii/mujs/tags
          tag-pattern: ^([\d.]+)$

  - name: nv-codec-headers
    cleanup:
      - '*'
    no-autogen: true
    make-install-args:
      - PREFIX=/app
    sources:
      - type: git
        url: https://github.com/FFmpeg/nv-codec-headers.git
        mirror-urls:
          - https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
        tag: n12.2.72.0
        commit: c69278340ab1d5559c7d7bf0edf615dc33ddbba7
        x-checker-data:
          type: git
          tag-pattern: ^n([\d.]+)$

  - name: x264
    cleanup:
      - /include
      - /lib/pkgconfig
      - /share/man
    config-opts:
      - --disable-cli
      - --enable-shared
    sources:
      - type: git
        url: https://github.com/jpsdr/x264
        mirror-urls:
          - https://code.videolan.org/videolan/x264.git
        commit: 4613ac3c15fd75cebc4b9f65b7fb95e70a3acce1
        # Every commit to the master branch is considered a release
        # https://code.videolan.org/videolan/x264/-/issues/35
        x-checker-data:
          type: json
          url: https://code.videolan.org/api/v4/projects/536/repository/commits
          commit-query: first( .[].id )
          version-query: first( .[].id )
          timestamp-query: first( .[].committed_date )

  - name: x265
    buildsystem: cmake
    subdir: source
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      - -DBUILD_STATIC=0
    cleanup:
      - /include
      - /lib/pkgconfig
      - /share/man
    sources:
      - type: git
        url: https://bitbucket.org/multicoreware/x265_git.git
        tag: '3.6'
        commit: aa7f602f7592eddb9d87749be7466da005b556ee
        x-checker-data:
          type: git
          tag-pattern: ^([\d.]+)$

  - name: libmysofa
    buildsystem: cmake
    config-opts:
      - -DBUILD_TESTS=OFF
    sources:
      - type: git
        commit: 33974839677da7044ef5a70be7ad5550735aae6e
        tag: v1.3.2
        url: https://github.com/hoene/libmysofa.git
        x-checker-data:
          type: git
          tag-pattern: ^v([\d.]+)$

  - name: libbs2b
    buildsystem: autotools
    config-opts:
      - --disable-static
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - type: archive
        archive-type: tar
        url: https://downloads.sourceforge.net/sourceforge/bs2b/libbs2b-3.1.0.tar.gz
        sha256: 6aaafd81aae3898ee40148dd1349aab348db9bfae9767d0e66e0b07ddd4b2528
        x-checker-data:
          type: html
          url: https://sourceforge.net/projects/bs2b/files/libbs2b/
          version-pattern: projects/bs2b/files/libbs2b/(\d+\.\d+\.\d+)
          url-template: https://downloads.sourceforge.net/sourceforge/bs2b/libbs2b-$version.tar.gz
      # https://src.fedoraproject.org/rpms/libbs2b/blob/rawhide/f/libbs2b.spec#_40
      - type: shell
        commands:
          - sed -i -e 's/lzma/xz/g' configure.ac
          - autoreconf -vif

  - name: libjxl
    buildsystem: cmake
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      - -DBUILD_TESTING=OFF
    sources:
      - type: git
        url: https://github.com/libjxl/libjxl.git
        tag: v0.10.3
        commit: 4a3b22d2600f92d8706fb72d85d52bfee2acbd54
        disable-shallow-clone: true
        x-checker-data:
          type: git
          tag-pattern: ^v([\d.]+)$

  - name: vulkan-headers
    buildsystem: cmake-ninja
    sources:
      - type: archive
        url: https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.3.286.tar.gz
        sha256: a82a6982efe5e603e23505ca19b469e8f3d876fc677c46b7bfb6177f517bf8fe

  - name: ffmpeg
    cleanup:
      - /include
      - /lib/pkgconfig
      - /share/ffmpeg/examples
    config-opts:
      - --disable-debug
      - --disable-doc
      - --disable-static
      - --enable-encoder=png
      - --enable-gnutls
      - --enable-gpl
      - --enable-shared
      - --enable-version3
      - --enable-libaom
      - --enable-libass
      - --enable-libbs2b
      - --enable-libdav1d
      - --enable-libfreetype
      - --enable-libmp3lame
      - --enable-libopus
      - --enable-libjxl
      - --enable-libmysofa
      - --enable-libtheora
      - --enable-libv4l2
      - --enable-libvorbis
      - --enable-libvpx
      - --enable-libx264
      - --enable-libx265
      - --enable-libwebp
      - --enable-libsmbclient
      - --enable-libxml2
      - --enable-vulkan

    sources:
      - type: git
        url: https://github.com/FFmpeg/FFmpeg.git
        mirror-urls:
          - https://git.ffmpeg.org/ffmpeg.git
        commit: af25a4bfd2503caf3ee485b27b99b620302f5718
        tag: n7.0.1
        x-checker-data:
          type: git
          tag-pattern: ^n([\d.]{3,7})$

  - name: libsixel
    buildsystem: meson
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - type: archive
        archive-type: tar
        url: https://api.github.com/repos/libsixel/libsixel/tarball/refs/tags/v1.10.3
        sha256: 7be774befba882d53701e131b6657836118f6cdb15a7515f92345c7bb6e2bb5c
        x-checker-data:
          type: json
          url: https://api.github.com/repos/libsixel/libsixel/tags
          url-query: .[0].tarball_url
          version-query: .[0].name

  - name: vapoursynth
    config-opts:
      - --disable-static
      - --with-python_prefix=/app
    sources:
      - type: git
        url: https://github.com/vapoursynth/vapoursynth.git
        tag: R69
        commit: 2804ed7a4926863f4a12e879d95155c4b05ecdf3
        x-checker-data:
          type: git
          tag-pattern: ^R([\d.]+)$

  - name: libplacebo
    buildsystem: meson
    config-opts:
      - -Dvulkan=enabled
      - -Dshaderc=enabled
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - type: git
        url: https://github.com/haasn/libplacebo.git
        mirror-urls:
          - https://code.videolan.org/videolan/libplacebo.git
        tag: v7.349.0
        commit: 1fd3c7bde7b943fe8985c893310b5269a09b46c5
        x-checker-data:
          type: git
          tag-pattern: ^v([\d.]+)$
    modules:
      - name: shaderc
        buildsystem: cmake-ninja
        builddir: true
        config-opts:
          - -DSHADERC_SKIP_COPYRIGHT_CHECK=ON
          - -DSHADERC_SKIP_EXAMPLES=ON
          - -DSHADERC_SKIP_TESTS=ON
          - -DSPIRV_SKIP_EXECUTABLES=ON
          - -DENABLE_GLSLANG_BINARIES=OFF
        cleanup:
          - /bin
          - /include
          - /lib/cmake
          - /lib/pkgconfig
        sources:
          - type: git
            url: https://github.com/google/shaderc.git
            #tag: v2023.7
            commit: 40bced4e1e205ecf44630d2dfa357655b6dabd04
            #x-checker-data:
            #  type: git
            #  tag-pattern: ^v(\d{4}\.\d{1,2})$
          - type: git
            url: https://github.com/KhronosGroup/SPIRV-Tools.git
            tag: v2024.1
            commit: 04896c462d9f3f504c99a4698605b6524af813c1
            dest: third_party/spirv-tools
            #x-checker-data:
            #  type: git
            #  tag-pattern: ^v(\d{4}\.\d{1})$
          - type: git
            url: https://github.com/KhronosGroup/SPIRV-Headers.git
            #tag: sdk-1.3.250.1
            commit: 4f7b471f1a66b6d06462cd4ba57628cc0cd087d7
            dest: third_party/spirv-headers
            #x-checker-data:
            #  type: git
            #  tag-pattern: ^sdk-([\d.]+)$
          - type: git
            url: https://github.com/KhronosGroup/glslang.git
            tag: 14.3.0
            commit: fa9c3deb49e035a8abcabe366f26aac010f6cbfb
            dest: third_party/glslang
            x-checker-data:
              type: git
              tag-pattern: ^(\d{1,2}\.\d{1,2}\.\d{1,4})$

  - name: mpv
    buildsystem: meson
    config-opts:
      - -Dbuild-date=false
      - -Dlibmpv=true
      - -Dmanpage-build=disabled
      - -Dcdda=enabled
      - -Ddvbin=enabled
      - -Ddvdnav=enabled
      - -Dlibarchive=enabled
      - -Dsdl2=enabled
      #- -Dshaderc=enabled
      - -Dvulkan=enabled
      - -Dvulkan-interop=enabled
    cleanup:
      - /include
      - /lib/pkgconfig
    sources:
      - type: git
        url: https://github.com/mpv-player/mpv.git
        tag: v0.38.0
        commit: 02254b92dd237f03aa0a151c2a68778c4ea848f9
        x-checker-data:
          type: git
          tag-pattern: ^v([\d.]+)$