-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* install license Co-authored-by: Juergen Fuhrmann <[email protected]>
- Loading branch information
Showing
1 changed file
with
20 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,46 @@ | ||
using BinaryBuilder | ||
|
||
name = "Triangle" | ||
version = v"1.6.0" | ||
version = v"1.6.1" | ||
|
||
# Collection of sources required to build Triangle by J. Shewchuk | ||
# | ||
# More info: | ||
# https://www.cs.cmu.edu/~quake/triangle.html | ||
# https://github.com/JuliaGeometry/Triangulate.jl | ||
# | ||
# | ||
# Please be aware that triunsuitable.c is not part of the original Triangle distribution. | ||
# It provides the possibility to pass a cfunction created in Julia as user refinement callback. | ||
# For this reason at least triunsiutable.c must be downloaded from Triangulate.jl repo, and | ||
# for simplicity, we do this for the whole code. | ||
# We also patch the code in order to replace exit() calls in the C code so that we can | ||
# throw an error instead. | ||
sources = [ | ||
GitSource("https://github.com/JuliaGeometry/Triangulate.jl.git","b2ffb23ca7d89c567fd31367882bd216757cdb9c") | ||
] | ||
|
||
script = raw""" | ||
cd $WORKSPACE/srcdir/Triangulate.jl/deps/src | ||
mkdir -p "${libdir}" | ||
# Patch the code in order to replace exit() calls in the C code so that we can | ||
# throw an error instead. | ||
sed -e "s/ exit/extern void error_exit(int); error_exit/g" triangle/triangle.c > triangle_patched.c | ||
$CC -Itriangle -DREAL=double -DTRILIBRARY -O3 -fPIC -DNDEBUG -DNO_TIMER -DEXTERNAL_TEST $LDFLAGS --shared -o "${libdir}/libtriangle.${dlext}" triangle_patched.c triwrap.c | ||
# Concerning the suppression of int - pointer cast warnings, | ||
# see the following comment in triangle.c: | ||
# | ||
# encode() compresses an oriented triangle into a single pointer. It | ||
# relies on the assumption that all triangles are aligned to four-byte | ||
# boundaries, so the two least significant bits of (otri).tri are zero. | ||
# | ||
# So there is an inherent hack in the code which we have to allow and hope things keep working. | ||
$CC -Itriangle -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -DREAL=double -DTRILIBRARY -O3 -fPIC -DNDEBUG -DNO_TIMER -DEXTERNAL_TEST $LDFLAGS --shared -o "${libdir}/libtriangle.${dlext}" triangle_patched.c triwrap.c | ||
install_license triangle/README | ||
""" | ||
|
||
platforms = supported_platforms() | ||
products = [ | ||
LibraryProduct("libtriangle", :libtriangle) | ||
] | ||
platforms = supported_platforms(; experimental=true) | ||
products = [LibraryProduct("libtriangle", :libtriangle)] | ||
dependencies = Dependency[] | ||
|
||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) | ||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies, julia_compat="1.6") | ||
|