hvif_tools: add recipe

This commit is contained in:
Gerasim Troeglazov
2025-09-05 13:59:43 +10:00
parent 7bdbda2304
commit 5ecddfc519

View File

@@ -0,0 +1,56 @@
SUMMARY="A toolkit for converting Haiku Vector Icon Format (HVIF) icons to SVG and back"
DESCRIPTION="A small set of commandline tools to work with the Haiku Vector Icon Format (HVIF).
hvif2svg:
Parses .hvif with header validation.
Renders paths (points/curves), shapes, and styles (solid colors and gradients).
Supports fills and strokes (via HVIF transformers STROKE/CONTOUR).
Linear and radial gradients with gradientTransform; proper stop opacity.
Uses HVIFs internal grid (viewBox 0 0 6528 6528 = 64 × 102 units).
svg2hvif:
SVG parsing via NanoSVG (headeronly).
Normalizes coordinates to HVIFs 64 × 64 space and centers content.
Converts fill and stroke (caps/joins/miter limit), stroke widths, and opacity.
Linear and radial gradients with calculated HVIF gradient transforms.
CLI and buffertobuffer example for embedding into apps/pipelines.
Crossplatform: Linux, macOS, Windows and Haiku"
HOMEPAGE="https://github.com/threedeyes/hvif-tools/"
COPYRIGHT="2005 Gerasim Troeglazov"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/threedeyes/hvif-tools/releases/download/$portVersion/hvif-tools-$portVersion.tar.gz"
CHECKSUM_SHA256="5388262c4aeb046fe17795c551bed1adacdbfb869750add42f84022f622c9b8e"
SOURCE_DIR="hvif-tools-$portVersion"
ARCHITECTURES="all"
PROVIDES="
hvif_tools = $portVersion
cmd:hvif2svg = $portVersion
cmd:svg2hvif = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc
cmd:make
"
BUILD()
{
cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release $cmakeDirArgs
make -C build $jobArgs
}
INSTALL()
{
make -C build install
}