name=freeglut
version=3.4.0
revision=1
tarball_url="https://github.com/FreeGLUTProject/freeglut/releases/download/v${version}/freeglut-${version}.tar.gz"
tarball_blake2b="47b073c4e81473417358452ede3891b6fc36e324f66eec42fcbbadebb2144680e3b52caded504135239e170fd8f30a1fe8b6666a746b06d48cd7226c98a8114e"
imagedeps="gcc ninja python git"
hostdeps="gcc cmake pkg-config"
deps="core-libs libxi mesa glu"

build() {
    cmake \
        -GNinja \
        -DCMAKE_TOOLCHAIN_FILE=${base_dir}/build-support/CMakeToolchain.txt \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=ON \
        -DFREEGLUT_BUILD_DEMOS=OFF \
        -DFREEGLUT_BUILD_STATIC_LIBS=OFF \
        ${source_dir}

    ninja -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" ninja install

    post_package_strip
}
