name=zstd
version=1.5.6
revision=1
tarball_url="https://github.com/facebook/zstd/releases/download/v${version}/zstd-${version}.tar.gz"
tarball_blake2b="fe17cf0950f8ee2cc07bfa2b41e97f36a1832e396386cb94a55bede975dc974920578cf147b39eecbc5b53ff06fe0dc1fe781a4cab9bc9f767ea28c0e786422e"
hostdeps="gcc pkg-config"
deps="core-libs zlib xz"

build() {
    cp -rp "${source_dir}"/. ./

        CC=${OS_TRIPLET}-gcc \
        CXX=${OS_TRIPLET}-g++ \
        AR=${OS_TRIPLET}-ar \
        PREFIX="${prefix}" \
    make -j${parallelism}
}

package() {
        CC=${OS_TRIPLET}-gcc \
        DESTDIR="${dest_dir}" \
        PREFIX="${prefix}" \
    make install

    # Remove static libraries.
    rm -rf "${dest_dir}${prefix}"/lib/*.a

    post_package_strip
}
