Ticket #64573: Portfile-helix.diff

File Portfile-helix.diff, 1.4 KB (added by gkoller (Guido Kollerie), 2 years ago)

Patch to Portfile for installing helix runtime files

  • Portfile

    old new  
    2626# Helix does not build well using frozen deps
    2727build.pre_args      --release -v -j${build.jobs}
    2828
     29notes "
     30    Helix also needs it's runtime files so make sure to copy/symlink the
     31    ${prefix}/share/${name}/runtime/ directory into your config directory
     32    (for example ~/.config/helix/runtime). This location can be overriden
     33    via the HELIX_RUNTIME environment variable.
     34"
     35
     36
    2937post-extract {
    3038    system -W ${worksrcpath} "git submodule update --init"
    3139}
     
    3442    xinstall -m 0755 \
    3543        ${worksrcpath}/target/[cargo.rust_platform]/release/hx \
    3644        ${destroot}${prefix}/bin/
    37 }
     45
     46    # Install runtime files (tree-sitter grammers, queries, etc)
     47    xinstall -d -m 755 ${destroot}${prefix}/share/${name}/runtime
     48    fs-traverse f_or_d ${worksrcpath}/runtime {
     49        set subpath [strsed ${f_or_d} "s|${worksrcpath}/runtime/||"]
     50        if { ${subpath} ne "" } {
     51            if { [file isdirectory ${f_or_d}] } {
     52                xinstall -d \
     53                    ${destroot}${prefix}/share/${name}/runtime/${subpath}
     54            } elseif { [file isfile ${f_or_d}] } {
     55                xinstall -m 0644 ${f_or_d} \
     56                    ${destroot}${prefix}/share/${name}/runtime/${subpath}
     57            }
     58        }
     59    }
     60 }