mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 03:30:05 +02:00
Qhull: new recipe (#6761)
This commit is contained in:
@@ -1,191 +0,0 @@
|
||||
# Unix Makefile for qhull and rbox
|
||||
#
|
||||
# see README.txt
|
||||
# the Unix distribution contains a configure Makefile
|
||||
#
|
||||
# make to produce qhull qconvex qdelaunay qhalf qvoronoi rbox
|
||||
# make qvoronoi to produce qvoronoi (etc.)
|
||||
# make qhullx to produce qhull qconvex etc. w/o using libqhull.a
|
||||
# make doc to print documentation
|
||||
# make install to copy qhull, rbox, qhull.1, rbox.1 to BINDIR, MANDIR
|
||||
# make new to rebuild qhull and rbox from source
|
||||
#
|
||||
# make printall to print all files
|
||||
# make user_eg to produce user_eg
|
||||
# make user_eg2 to produce user_eg2
|
||||
# make clean to remove object files and core
|
||||
# make cleanall to remove all generated files
|
||||
#
|
||||
# PRINTMAN -- command for printing manual pages
|
||||
# PRINTC -- command for printing C files
|
||||
# BINDIR -- directory where to copy executables
|
||||
# MANDIR -- directory where to copy manual pages
|
||||
# CC -- ANSI C or C++ compiler
|
||||
# CCOPTS1 - options used to compile .c files
|
||||
# CCOPTS2 -- options used to link .o files
|
||||
#
|
||||
# CFILES -- .c files for printing
|
||||
# HFILES -- .h files for printing
|
||||
# DFILES -- documentation files
|
||||
# MFILES -- man pages and html files
|
||||
# TFILES -- .txt versions of html html files
|
||||
# FILES -- all other files
|
||||
# OBJS -- specifies the object files of libqhull.a
|
||||
#
|
||||
BINDIR = /boot/common/bin
|
||||
MANDIR = /boot/common/man/man1
|
||||
|
||||
# if you do not have enscript, try a2ps or just use lpr. The files are text.
|
||||
PRINTMAN = enscript -2rl
|
||||
PRINTC = enscript -2r
|
||||
# PRINTMAN = lpr
|
||||
# PRINTC = lpr
|
||||
|
||||
#for Gnu's gcc compiler -O2 for optimization, -g for debugging, -Wall for check
|
||||
#
|
||||
CC = gcc
|
||||
CCOPTS1 = -O2 -ansi
|
||||
|
||||
# for Sun's cc compiler, -fast or O2 for optimization, -g for debugging, -Xc for ANSI
|
||||
#CC = cc
|
||||
#CCOPTS1 = -Xc -v -fast
|
||||
|
||||
# for Silicon Graphics cc compiler, -O2 for optimization, -g for debugging
|
||||
#CC = cc
|
||||
#CCOPTS1 = -ansi -O2
|
||||
|
||||
# for Next cc compiler with fat executable
|
||||
#CC = cc
|
||||
#CCOPTS1 = -ansi -O2 -arch m68k -arch i386 -arch hppa
|
||||
|
||||
# for loader, ld
|
||||
CCOPTS2 = $(CCOPTS1)
|
||||
|
||||
# OBJS in execution frequency order. CFILES after qhull.c are alphabetical
|
||||
OBJS = user.o global.o stat.o io.o geom2.o poly2.o \
|
||||
merge.o qhull.o geom.o poly.o qset.o mem.o
|
||||
|
||||
CFILES= unix.c qhull.c geom.c geom2.c global.c io.c mem.c merge.c poly.c \
|
||||
poly2.c qset.c stat.c user.c qconvex.c qdelaun.c qhalf.c qvoronoi.c
|
||||
HFILES= user.h qhull.h qhull_a.h geom.h io.h mem.h merge.h poly.h qset.h stat.h
|
||||
TXTFILES= ../Announce.txt ../REGISTER.txt ../COPYING.txt ../README.txt Changes.txt
|
||||
DOCFILES= ../html/rbox.txt ../html/qhull.txt
|
||||
FILES= Makefile rbox.c user_eg.c ../eg/q_test ../eg/q_egtest ../eg/q_eg
|
||||
HTMFILES= qhull.man rbox.man qh-in.htm qh-optg.htm qh-optt.htm qh-optp.htm \
|
||||
index.htm qh-quick.htm qh-impre.htm qh-eg.htm \
|
||||
qh-optc.htm qh-opto.htm qh-optf.htm qh-optq.htm \
|
||||
qh-c.htm qh-faq.htm qhull.htm qconvex.htm qdelaun.htm \
|
||||
qh-geom.htm qh-globa.htm qh-io.htm qh-mem.htm qh-merge.htm \
|
||||
qh-poly.htm qh-qhull.htm qh-set.htm qh-stat.htm qh-user.htm \
|
||||
qdelau_f.htm qhalf.htm qvoronoi.htm qvoron_f.htm rbox.htm
|
||||
|
||||
all: rbox qconvex qdelaunay qhalf qvoronoi qhull
|
||||
|
||||
unix.o: qhull.h user.h mem.h
|
||||
qconvex.o: qhull.h user.h mem.h
|
||||
qdelaun.o: qhull.h user.h mem.h
|
||||
qhalf.o: qhull.h user.h mem.h
|
||||
qvoronoi.o: qhull.h user.h mem.h
|
||||
qhull.o: $(HFILES)
|
||||
geom.o: $(HFILES)
|
||||
geom2.o: $(HFILES)
|
||||
global.o: $(HFILES)
|
||||
io.o: $(HFILES)
|
||||
mem.o: mem.h
|
||||
merge.o: $(HFILES)
|
||||
poly.o: $(HFILES)
|
||||
poly2.o: $(HFILES)
|
||||
qset.o: qset.h mem.h
|
||||
stat.o: $(HFILES)
|
||||
user.o: $(HFILES)
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CCOPTS1) $<
|
||||
|
||||
clean:
|
||||
rm -f *.o ../core qconvex qdelaunay qhalf qvoronoi qhull libqhull.a \
|
||||
*.exe
|
||||
|
||||
cleanall: clean
|
||||
rm -f *~ ../rbox ../qhull ../qhalf ../qconvex ../qdelaunay ../qhalf\
|
||||
../qvoronoi ../user_eg ../user_eg2 ../*.exe >/dev/null
|
||||
|
||||
doc:
|
||||
$(PRINTMAN) $(TXTFILES) $(DOCFILES)
|
||||
|
||||
install: all
|
||||
cp ../qconvex $(BINDIR)/qconvex
|
||||
cp ../qdelaunay $(BINDIR)/qdelaunay
|
||||
cp ../qhalf $(BINDIR)/qhalf
|
||||
cp ../qhull $(BINDIR)/qhull
|
||||
cp ../qvoronoi $(BINDIR)/qvoronoi
|
||||
cp ../rbox $(BINDIR)/rbox
|
||||
cp ../html/qhull.man $(MANDIR)/qhull.1
|
||||
cp ../html/rbox.man $(MANDIR)/rbox.1
|
||||
|
||||
new: cleanall all
|
||||
|
||||
printall: doc printh printc printf
|
||||
|
||||
printh:
|
||||
$(PRINTC) $(HFILES)
|
||||
|
||||
printc:
|
||||
$(PRINTC) $(CFILES)
|
||||
|
||||
printf:
|
||||
$(PRINTC) $(FILES)
|
||||
|
||||
libqhull.a: $(OBJS)
|
||||
@echo if 'ar' or 'ranlib' fails, try 'make qhullx'
|
||||
ar r libqhull.a $(OBJS)
|
||||
@echo the next line may need to be removed.
|
||||
-test -x ranlib -o -x ranlib && ranlib libqhull.a
|
||||
|
||||
# don't use ../qconvex. Does not work on Red Hat Linux
|
||||
qconvex: qconvex.o libqhull.a
|
||||
$(CC) -o qconvex $(CCOPTS2) qconvex.o -L. -lqhull
|
||||
cp qconvex ..
|
||||
|
||||
qdelaunay: qdelaun.o libqhull.a
|
||||
$(CC) -o qdelaunay $(CCOPTS2) qdelaun.o -L. -lqhull
|
||||
cp qdelaunay ..
|
||||
|
||||
qhalf: qhalf.o libqhull.a
|
||||
$(CC) -o qhalf $(CCOPTS2) qhalf.o -L. -lqhull
|
||||
cp qhalf ..
|
||||
|
||||
qvoronoi: qvoronoi.o libqhull.a
|
||||
$(CC) -o qvoronoi $(CCOPTS2) qvoronoi.o -L. -lqhull
|
||||
cp qvoronoi ..
|
||||
|
||||
qhull: unix.o libqhull.a
|
||||
$(CC) -o qhull $(CCOPTS2) unix.o -L. -lqhull
|
||||
cp qhull ..
|
||||
-chmod +x ../eg/q_test ../eg/q_eg ../eg/q_egtest
|
||||
-cd ..; ./rbox D4 | ./qhull
|
||||
|
||||
# compile qhull without using libqhull.a
|
||||
qhullx: qconvex.o qdelaun.o qhalf.o qvoronoi.o unix.o $(OBJS)
|
||||
$(CC) -o qconvex $(CCOPTS2) qconvex.o $(OBJS)
|
||||
$(CC) -o qdelaunay $(CCOPTS2) qdelaun.o $(OBJS)
|
||||
$(CC) -o qhalf $(CCOPTS2) qhalf.o $(OBJS)
|
||||
$(CC) -o qvoronoi $(CCOPTS2) qvoronoi.o $(OBJS)
|
||||
$(CC) -o qhull $(CCOPTS2) unix.o $(OBJS)
|
||||
cp qconvex qdelaunay qhalf qvoronoi qhull ..
|
||||
-chmod +x ../eg/q_test ../eg/q_eg ../eg/q_egtest
|
||||
-cd ..; ./rbox D4 | ./qhull
|
||||
|
||||
rbox: rbox.o
|
||||
$(CC) -o rbox rbox.o $(CCOPTS2)
|
||||
cp rbox ..
|
||||
|
||||
user_eg: user_eg.o libqhull.a
|
||||
$(CC) -o user_eg $(CCOPTS2) user_eg.o -L. -lqhull
|
||||
cp user_eg ..
|
||||
|
||||
user_eg2: user_eg2.o libqhull.a
|
||||
$(CC) -o user_eg2 $(CCOPTS2) user_eg2.o -L. -lqhull
|
||||
cp user_eg2 ..
|
||||
|
||||
# end of Makefile
|
||||
96
media-libs/qhull/qhull-8.0.2.recipe
Normal file
96
media-libs/qhull/qhull-8.0.2.recipe
Normal file
@@ -0,0 +1,96 @@
|
||||
SUMMARY="A geometry library for computing convex hulls and related structures"
|
||||
DESCRIPTION="Qhull computes convex hulls, Delaunay triangulations, halfspace \
|
||||
intersections about a point, Voronoi diagrams, furthest-site Delaunay \
|
||||
triangulations, and furthest-site Voronoi diagrams. Qhull works with 2-d, \
|
||||
3-d, 4-d, 5-d, and higher dimensions. It computes volumes, surface areas, and \
|
||||
approximations."
|
||||
HOMEPAGE="http://www.qhull.org/"
|
||||
COPYRIGHT="2009-2020 Sony Pictures Imageworks Inc."
|
||||
LICENSE="BSD (3-clause)"
|
||||
REVISION="1"
|
||||
SOURCE_URI="$HOMEPAGE/download/qhull-2020-src-$portVersion.tgz"
|
||||
CHECKSUM_SHA256="b5c2d7eb833278881b952c8a52d20179eab87766b00b865000469a45c1838b7e"
|
||||
SOURCE_DIR="qhull-2020.2"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
|
||||
commandSuffix=$secondaryArchSuffix
|
||||
commandBinDir=$binDir
|
||||
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
||||
commandSuffix=
|
||||
commandBinDir=$prefix/bin
|
||||
fi
|
||||
|
||||
libVersion="8.0.2"
|
||||
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
|
||||
|
||||
PROVIDES="
|
||||
qhull$secondaryArchSuffix = $portVersion
|
||||
cmd:qconvex$commandSuffix
|
||||
cmd:qdelaunay$commandSuffix
|
||||
cmd:qhalf$commandSuffix
|
||||
cmd:qhull$commandSuffix
|
||||
cmd:qvoronoi$commandSuffix
|
||||
cmd:rbox$commandSuffix
|
||||
lib:libqhull_r$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
qhull${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libqhull_r$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES_devel="
|
||||
qhull$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cmake
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
"
|
||||
|
||||
defineDebugInfoPackage qhull$secondaryArchSuffix \
|
||||
$libDir/libqhull_r.so.$libVersion
|
||||
|
||||
BUILD()
|
||||
{
|
||||
cmake -B build -S . \
|
||||
$cmakeDirArgs \
|
||||
-DLINK_APPS_SHARED=ON \
|
||||
-DBUILD_STATIC_LIBS=OFF \
|
||||
-DCMAKE_INSTALL_BINDIR=$commandBinDir \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DBIN_INSTALL_DIR=$commandBinDir \
|
||||
-DLIB_INSTALL_DIR=$libDir \
|
||||
-DINCLUDE_INSTALL_DIR=$includeDir \
|
||||
-DDOC_INSTALL_DIR=$docDir \
|
||||
-DMAN_INSTALL_DIR=$manDir
|
||||
|
||||
make -C build $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make -C build install
|
||||
|
||||
prepareInstalledDevelLib libqhull_r
|
||||
|
||||
fixPkgconfig
|
||||
|
||||
packageEntries devel \
|
||||
$developDir \
|
||||
$libDir/cmake
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
make -C build test
|
||||
}
|
||||
Reference in New Issue
Block a user