flatpak:
    id: org.fedoraproject.Sdk.Extension.llvm20
    branch: f42
    build-extension: true
    runtime: org.fedoraproject.Sdk
    runtime-version: f42
    sdk: org.fedoraproject.Sdk
    name: f42/llvm20
    component: llvm20-flatpak
    packages:
    - clang
    - clang-analyzer
    - clang-devel
    - clang-libs
    - clang-tools-extra
    - clang-tools-extra-devel
    - compiler-rt
    - git-clang-format
    - libcxx
    - libcxx-devel
    - libcxxabi
    - libcxxabi-devel
    - libomp
    - libomp-devel
    - lld
    - lld-devel
    - lld-libs
    - lldb
    - lldb-devel
    - llvm
    - name: llvm-bolt
      platforms:
          only: [aarch64, x86_64]
    - llvm-cmake-utils
    - llvm-devel
    - llvm-googletest
    - llvm-libs
    - llvm-libunwind
    - llvm-libunwind-devel
    - llvm-test
    - mlir
    - mlir-devel
    - polly
    - polly-devel
    - python3-clang
    - python3-lit
    - python3-lldb
    - python3-mlir
    - llvm20-flatpak-config
    # for cleanup-commands (part of runtime)
    - coreutils-single
    cleanup-commands: |
        find /app -mindepth 1 -type d -empty -delete
        mkdir -p /app/bin /app/lib/clang /app/libexec /app/share
        mv /usr/lib64/llvm20/ /app/lib/
        pushd /app/bin ; ln -s ../lib/llvm20/bin/* . ; popd
        pushd /app/lib ; ln -s llvm20/lib/* . ; popd
        pushd /app/share ; ln -s ../lib/llvm20/share/* . ; popd
        mv /usr/lib/clang/20 /app/lib/clang/
        mkdir -p /app/include/c++
        mv /usr/include/c++/v1 /app/include/c++/
        mv /usr/include/llvm-libunwind/ /app/include/
        mv /usr/lib64/libc++* /app/lib/
        mv /usr/lib64/libunwind* /app/lib/
        ln -s libunwind.so.1 /app/lib/libunwind.so
        mv /usr/lib/python*/ /app/lib/
        find /app/lib/python*/site-packages/{_distutils_hack,pkg_resources,setuptools*} -delete
        mv /usr/lib64/python*/site-packages/[^_]* /app/lib/python*/site-packages/
        ln -sfn ../../../../lib/liblldb.so /app/lib/python*/site-packages/lldb/_lldb.so
        ln -sfn ../lib/llvm20/share/clang/clang-format-diff.py /app/bin/clang-format-diff
        ln -s lib /app/lib64
        rm -f /app/bin/ld
