From 79351bde34a4ad405c524072c0b6140a5a378d77 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Tue, 30 Dec 2014 17:50:00 +0100 Subject: [PATCH] qhull: add missing pkgconfig file Add backwards compatibility symlinks to /usr/include/qhull. Add patch to fix format string security flaw (via Gentoo). --- srcpkgs/qhull/files/qhull.pc | 11 ++++++ srcpkgs/qhull/patches/64bit-fixes.patch | 29 +++++++++++++++ .../patches/format-string-security.patch | 13 +++++++ srcpkgs/qhull/template | 36 +++++++++++-------- 4 files changed, 75 insertions(+), 14 deletions(-) create mode 100644 srcpkgs/qhull/files/qhull.pc create mode 100644 srcpkgs/qhull/patches/64bit-fixes.patch create mode 100644 srcpkgs/qhull/patches/format-string-security.patch diff --git a/srcpkgs/qhull/files/qhull.pc b/srcpkgs/qhull/files/qhull.pc new file mode 100644 index 00000000000..aea001e5094 --- /dev/null +++ b/srcpkgs/qhull/files/qhull.pc @@ -0,0 +1,11 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: qhull +Description: Computing the convex hull +Version: @VERSION@ +Requires: +Libs: -L${libdir} -lqhull -lm +Cflags: -I${includedir} diff --git a/srcpkgs/qhull/patches/64bit-fixes.patch b/srcpkgs/qhull/patches/64bit-fixes.patch new file mode 100644 index 00000000000..43709893a39 --- /dev/null +++ b/srcpkgs/qhull/patches/64bit-fixes.patch @@ -0,0 +1,29 @@ +diff --git src/libqhull/io.c src/libqhull/io.c +index 09a0079..7ad4b35 100644 +--- src/libqhull/io.c ++++ src/libqhull/io.c +@@ -68,8 +68,8 @@ void qh_produce_output2(void) { + qh_memstatistics(qh ferr); + d_1= sizeof(setT) + (qh hull_dim - 1) * SETelemsize; + qh_fprintf(qh ferr, 8040, "\ +- size in bytes: merge %d ridge %d vertex %d facet %d\n\ +- normal %d ridge vertices %d facet vertices or neighbors %d\n", ++ size in bytes: merge %zd ridge %zd vertex %zd facet %zd\n\ ++ normal %d ridge vertices %d facet vertices or neighbors %zd\n", + (int)sizeof(mergeT), (int)sizeof(ridgeT), + (int)sizeof(vertexT), (int)sizeof(facetT), + qh normal_size, d_1, d_1 + SETelemsize); +diff --git src/libqhull/stat.c src/libqhull/stat.c +index 7dc60b9..5721130 100644 +--- src/libqhull/stat.c ++++ src/libqhull/stat.c +@@ -472,7 +472,7 @@ void qh_initstatistics(void) { + qh_allstatI(); + if (qhstat next > (int)sizeof(qhstat id)) { + qh_fprintf(qhmem.ferr, 6184, "qhull error (qh_initstatistics): increase size of qhstat.id[].\n\ +- qhstat.next %d should be <= sizeof(qhstat id) %d\n", qhstat next, (int)sizeof(qhstat id)); ++ qhstat.next %d should be <= sizeof(qhstat id) %zd\n", qhstat next, (int)sizeof(qhstat id)); + #if 0 /* for locating error, Znumridges should be duplicated */ + for(i=0; i < ZEND; i++) { + int j; + diff --git a/srcpkgs/qhull/patches/format-string-security.patch b/srcpkgs/qhull/patches/format-string-security.patch new file mode 100644 index 00000000000..65e2881ac4e --- /dev/null +++ b/srcpkgs/qhull/patches/format-string-security.patch @@ -0,0 +1,13 @@ +diff --git src/libqhull/io.c src/libqhull/io.c +index 6601ffd..fb1a7fd 100644 +--- src/libqhull/io.c ++++ src/libqhull/io.c +@@ -2238,7 +2238,7 @@ void qh_printfacet3math(FILE *fp, facetT *facet, qh_PRINT format, int notfirst) + qh_memfree(point, qh normal_size); + qh_settempfree(&points); + qh_settempfree(&vertices); +- qh_fprintf(fp, 9110, endfmt); ++ qh_fprintf(fp, 9110, "%s", endfmt); + } /* printfacet3math */ + + diff --git a/srcpkgs/qhull/template b/srcpkgs/qhull/template index fe4ad677b5c..8de1042eb35 100644 --- a/srcpkgs/qhull/template +++ b/srcpkgs/qhull/template @@ -1,30 +1,38 @@ # Template file for 'qhull' -pkgname="qhull" -version="2012.1" -revision=1 +pkgname=qhull +version=2012.1 +revision=2 +build_style=cmake +hostmakedepends="cmake" short_desc="Computes volumes, surface areas and approximations to the convex hull" maintainer="Martin Riese " -license="GPL-3" +license="BSD" homepage="http://www.qhull.org" distfiles="http://www.qhull.org/download/${pkgname}-${version}-src.tgz" -checksum="a35ecaa610550b7f05c3ce373d89c30cf74b059a69880f03080c556daebcff88" -hostmakedepends="cmake" -build_style="cmake" +checksum=a35ecaa610550b7f05c3ce373d89c30cf74b059a69880f03080c556daebcff88 + +post_install() { + install -Dm644 ${FILESDIR}/qhull.pc ${DESTDIR}/usr/lib/pkgconfig/qhull.pc + sed -i "s|@VERSION@|${version}|" ${DESTDIR}/usr/lib/pkgconfig/qhull.pc + # convenience links for backwards compatibility + ln -sf libqhull ${DESTDIR}/usr/include/qhull + ln -sf libqhull.h ${DESTDIR}/usr/include/qhull/qhull.h +} libqhull_package() { - shorst_desc+=" - runtime libraries" + short_desc+=" - runtime libraries" pkg_install() { - vmove "usr/lib/*.so.*" + vmove usr/lib/*.so.* } } libqhull-devel_package() { - depends="${makedepends} libqhull>=${version}_${revision}" + depends="libqhull>=${version}_${revision}" short_desc+=" - development files" pkg_install() { - vmove "usr/include" - vmove "usr/lib/*.a" - vmove "usr/lib/*.so" + vmove usr/include + vmove usr/lib/*.a + vmove usr/lib/*.so + vmove usr/lib/pkgconfig } } -