Files
haikuports/media-gfx/asymptote/asymptote-3.04.recipe
2026-01-28 11:00:34 +01:00

190 lines
5.9 KiB
Bash

SUMMARY="2D & 3D TeX-Aware Vector Graphics Language"
DESCRIPTION="Asymptote is a powerful descriptive vector graphics language that provides a natural \
coordinate-based framework for technical drawing. Labels and equations are typeset with LaTeX, \
the de-facto standard for typesetting mathematics.
A major advantage of Asymptote over other graphics packages is that it is a programming language, \
as opposed to just a graphics program.
Features of Asymptote:
- provides a portable standard for typesetting mathematical figures, just as TeX/LaTeX has become \
the standard for typesetting equations;
- generates high-quality PostScript, OpenGL, PDF, SVG, WebGL, V3D, and PRC vector graphics;
- embeds 3D vector WebGL graphics within HTML files;
- embeds 3D vector PRC graphics within PDF files;
- inspired by MetaPost, with a much cleaner, powerful C++-like programming syntax and IEEE \
floating-point numerics;
- runs on all major platforms (UNIX, MacOS, Microsoft Windows);
- mathematically oriented (e.g. rotation of vectors by complex multiplication);
- LaTeX typesetting of labels (for document consistency);
- uses the simplex method and deferred drawing to solve overall size constraint issues between \
fixed-sized objects (labels and arrowheads) and objects that should scale with figure size;
- fully generalizes MetaPost path construction algorithms to three dimensions;
- compiles commands into virtual machine code for speed without sacrificing portability;
- high-level graphics commands are implemented in the Asymptote language itself, allowing them to \
be tailored to specific applications."
HOMEPAGE="https://asymptote.sourceforge.io/"
COPYRIGHT="2004-25 Andy Hammerlindl, John Bowman, and Tom Prince"
LICENSE="GNU GPL v3
GNU LGPL v3"
REVISION="1"
SOURCE_URI="https://downloads.sourceforge.net/project/asymptote/$portVersion/asymptote-$portVersion.src.tgz"
CHECKSUM_SHA256="f93d27d925fd0bc333d056febe49f2d71f935844c2f8d37aecc8df0fee93c32b"
PATCHES="asymptote-$portVersion.patchset"
ADDITIONAL_FILES="xasy.rdef.in"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
commandBinDir=$binDir
commandSuffix=$secondaryArchSuffix
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
pythonPackage=python310
USER_SETTINGS_FILES="
settings/asy directory
"
PROVIDES="
asymptote$secondaryArchSuffix = $portVersion
cmd:asy$commandSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libboost_filesystem$secondaryArchSuffix
lib:libboost_thread$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libedit$secondaryArchSuffix
lib:libfftw3$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libgsl$secondaryArchSuffix
lib:libgslcblas$secondaryArchSuffix
lib:libncursesw$secondaryArchSuffix
lib:libsigsegv$secondaryArchSuffix
lib:libtirpc$secondaryArchSuffix
lib:libz$secondaryArchSuffix
tex:asymptote
"
PROVIDES_gui="
asymptote${secondaryArchSuffix}_gui = $portVersion
cmd:xasy$commandSuffix = $portVersion
"
REQUIRES_gui="
asymptote$secondaryArchSuffix == $portVersion base
cson_$pythonPackage
numpy_$pythonPackage
pyqt5_$pythonPackage
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
glm${secondaryArchSuffix}_devel
devel:eigen$secondaryArchSuffix
devel:libboost_filesystem$secondaryArchSuffix >= 1.87.0
devel:libboost_thread$secondaryArchSuffix >= 1.87.0
devel:libcurl$secondaryArchSuffix
devel:libedit$secondaryArchSuffix
devel:libfftw3$secondaryArchSuffix
devel:libGL$secondaryArchSuffix
devel:libGLU$secondaryArchSuffix
devel:libgsl$secondaryArchSuffix
devel:libgslcblas$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libncursesw$secondaryArchSuffix
devel:libsigsegv$secondaryArchSuffix
devel:libtirpc$secondaryArchSuffix
devel:libz$secondaryArchSuffix
pyqt5_$pythonPackage
tex:asymptote
tex:latex
tex:type1cm
# The following TeX packages are needed for creating tex formats:
# (because of texlive packaging, all hyphenation patterns are needed,
# the list contains one package from each collection)
tex:hyphen_afrikaans
tex:hyphen_ancientgreek
tex:hyphen_arabic
tex:hyphen_basque
tex:hyphen_belarusian
tex:hyphen_catalan
tex:hyphen_chinese
tex:hyphen_croatian
tex:hyphen_czech
tex:hyphen_english
tex:hyphen_german
tex:hyphen_italian
tex:hyphen_polish
tex:hyphen_portuguese
"
BUILD_PREREQUIRES="
cmd:awk
cmd:bison$secondaryArchSuffix
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:gs
cmd:flex
cmd:kpsewhich
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:python3
cmd:texi2dvi
"
defineDebugInfoPackage asymptote$secondaryArchSuffix \
"$commandBinDir"/asy
BUILD()
{
mkdir -p $(finddir B_USER_SETTINGS_DIRECTORY)
export LDFLAGS="-lbe -lnetwork"
runConfigure --omit-dirs "binDir" ./configure \
--bindir=$commandBinDir \
--with-latex=$portPackageLinksDir/tex~asymptote/data/texlive/texmf-dist/tex/latex \
--with-context=$portPackageLinksDir/tex~asymptote/data/texlive/texmf-dist/tex/context/third \
--with-docdir=$docDir \
--disable-gc # it tries to use its own copy of Boehm GC, which fails, no easy way to use system package
make $jobArgs usinggit=no # because of HaikuPorter's git repo
}
INSTALL()
{
make install-notexhash usinggit=no
# Preparing the attributes
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|${MINOR:-0}|" \
$portDir/additional-files/xasy.rdef.in > xasy.rdef
# Installing extra-attribs
rc xasy.rdef
settype -t application/x-vnd.Be-elfexecutable $dataDir/asymptote/GUI/xasy.py
resattr -o $dataDir/asymptote/GUI/xasy.py xasy.rsrc
packageEntries gui \
$commandBinDir/xasy \
$dataDir/asymptote/GUI \
$manDir/man1/xasy.1x
}
TEST()
{
# 1 test (the Ghostscript test) fails
#export ASYMPTOTE_EPSDRIVER=eps2write
# doesn't help, this is apparently the default anyway
make -k check usinggit=no
}