Name avisynthplus
Description An improved version of the AviSynth frameserver
Version 3.7.5-3
Package Base avisynthplus
Homepage https://avs-plus.net/
Maintainers ['Daniel Bermond <dbermond@archlinux.org>']
Contributors []
Distro-repo https://gitlab.archlinux.org/archlinux/packaging/packages/avisynthplus
Sources ['010-avisynthplus-fix-symbol-conflict-with-vmaf.patch::https://github.com/AviSynth/AviSynthPlus/commit/d1a32d5229602f181574c95fa0db68bcf1762606.patch', 'avisynthplus.xml', 'https://github.com/AviSynth/AviSynthPlus/archive/v3.7.5/avisynthplus-3.7.5.tar.gz']
Dependencies ['glibc', 'hicolor-icon-theme', 'libgcc', 'libstdc++']
Optional-Dependencies ['devil', 'soundtouch']
Build-Dependencies ['cmake', 'devil', 'soundtouch']
Provides ['libavisynth.so']
Builddate 15-02-2026 16:48:22
Architecture x86_64
Distro-Version
Licenses ['GPL-2.0-or-later']
Hash 52a79ac8078003849af24e51c78612b187b472751c44443c1873aafd837a3b4a
# Maintainer: Daniel Bermond <dbermond@archlinux.org>

pkgname=avisynthplus
pkgver=3.7.5
pkgrel=3
pkgdesc='An improved version of the AviSynth frameserver'
arch=('x86_64')
url='https://avs-plus.net/'
license=('GPL-2.0-or-later')
depends=(
    'glibc'
    'hicolor-icon-theme'
    'libgcc'
    'libstdc++')
optdepends=(
    'devil: for ImageSeq plugin'
    'soundtouch: for TimeStretch plugin')
makedepends=(
    'cmake'
    'devil'
    'soundtouch')
provides=('libavisynth.so')
source=("https://github.com/AviSynth/AviSynthPlus/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
        '010-avisynthplus-fix-symbol-conflict-with-vmaf.patch'::'https://github.com/AviSynth/AviSynthPlus/commit/d1a32d5229602f181574c95fa0db68bcf1762606.patch'
        'avisynthplus.xml')
sha256sums=('2533fafe5b5a8eb9f14d84d89541252a5efd0839ef62b8ae98f40b9f34b3f3d5'
            '30aeed221e21aef5aa1d99687bf49a5543602681e0f05bd857d3cf717343a6ee'
            'c4b270a3df7fbe1c153400215169c4ae4cae3b7a8710c843393e3a6ed0fd8a3e')

prepare() {
    # https://gitlab.archlinux.org/archlinux/packaging/packages/ffmpeg/-/issues/19
    patch -d "AviSynthPlus-${pkgver}" -Np1 -i "${srcdir}/010-avisynthplus-fix-symbol-conflict-with-vmaf.patch"
    rm "AviSynthPlus-${pkgver}/avs_core/include/avisynth.h.orig" # included in the package if not removed
}

build() {
    cmake -B build -S "AviSynthPlus-${pkgver}" \
        -G 'Unix Makefiles' \
        -DCMAKE_BUILD_TYPE:STRING='None' \
        -DCMAKE_INSTALL_PREFIX:PATH='/usr' \
        -Wno-dev
    cmake --build build
}

package() {
    DESTDIR="$pkgdir" cmake --install build
    install -D -m644 avisynthplus.xml -t "${pkgdir}/usr/share/mime/packages"
    
    local _icon
    local _res
    while read -r -d '' _icon
    do
        _res="$(sed 's/[[:alpha:]]*\([0-9]\+\)\.png/\1/' <<< "${_icon##*/}")"
        [ -n "$_res" ] && install -D -m644 "$_icon" \
            "${pkgdir}/usr/share/icons/hicolor/${_res}x${_res}/mimetypes/avisynthplus-script.png"
    done < <(find "AviSynthPlus-${pkgver}/distrib/Icons/Rastered" -type f -name 'AvsPlusIcon*.png' -print0)
}