aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/solid3/CONTROL3
-rw-r--r--ports/solid3/disable-examples.patch13
-rw-r--r--ports/solid3/portfile.cmake41
-rw-r--r--ports/solid3/potentially-uninitialized-local-pointer-variable.patch26
4 files changed, 83 insertions, 0 deletions
diff --git a/ports/solid3/CONTROL b/ports/solid3/CONTROL
new file mode 100644
index 000000000..7dce173ee
--- /dev/null
+++ b/ports/solid3/CONTROL
@@ -0,0 +1,3 @@
+Source: solid3
+Version: 3.5.8
+Description: Software Library for Interference Detection
diff --git a/ports/solid3/disable-examples.patch b/ports/solid3/disable-examples.patch
new file mode 100644
index 000000000..5af3b2645
--- /dev/null
+++ b/ports/solid3/disable-examples.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0303a8f..be43838 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -97,7 +97,7 @@ if(UNIX)
+ endif(UNIX)
+
+ add_subdirectory(src)
+-add_subdirectory(examples)
++#add_subdirectory(examples)
+ #add_subdirectory(doc)
+
+ include(CMakePackageConfigHelpers)
diff --git a/ports/solid3/portfile.cmake b/ports/solid3/portfile.cmake
new file mode 100644
index 000000000..dc61a5654
--- /dev/null
+++ b/ports/solid3/portfile.cmake
@@ -0,0 +1,41 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO dtecta/solid3
+ REF c53f6bb1eaaafb1cfb305ef71b1c3a2edb4844e6
+ SHA512 ae42ba75f5309fecba836e5786d4cb81eeb1240f6fd7c458c6d1329d8e1075021504b927ea0aedb66162deeb79ad674cacb0190385afe456420c0d9184596f1f
+ HEAD_REF master
+ PATCHES
+ disable-examples.patch
+ potentially-uninitialized-local-pointer-variable.patch
+)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ set(DYNAMIC_SOLID OFF)
+else()
+ set(DYNAMIC_SOLID ON)
+endif()
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DDYNAMIC_SOLID=${DYNAMIC_SOLID}
+)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/solid3)
+
+file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/solid3)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/solid3/README.md ${CURRENT_PACKAGES_DIR}/share/solid3/copyright)
+file(COPY ${SOURCE_PATH}/LICENSE_GPL.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/solid3)
+file(COPY ${SOURCE_PATH}/LICENSE_QPL.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/solid3)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
+endif()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
diff --git a/ports/solid3/potentially-uninitialized-local-pointer-variable.patch b/ports/solid3/potentially-uninitialized-local-pointer-variable.patch
new file mode 100644
index 000000000..baec56793
--- /dev/null
+++ b/ports/solid3/potentially-uninitialized-local-pointer-variable.patch
@@ -0,0 +1,26 @@
+diff --git a/src/qhull/geom2.c b/src/qhull/geom2.c
+index bd58ce1..c4798d2 100644
+--- a/src/qhull/geom2.c
++++ b/src/qhull/geom2.c
+@@ -2080,7 +2080,7 @@ boolT qh_sharpnewfacets () {
+ pointT *qh_voronoi_center (int dim, setT *points) {
+ pointT *point, **pointp, *point0;
+ pointT *center= (pointT*)qh_memalloc (qh center_size);
+- setT *simplex;
++ setT *simplex= NULL;
+ int i, j, k, size= qh_setsize(points);
+ coordT *gmcoord;
+ realT *diffp, sum2, *sum2row, *sum2p, det, factor;
+diff --git a/src/qhull/io.c b/src/qhull/io.c
+index 79ca799..41c18bc 100644
+--- a/src/qhull/io.c
++++ b/src/qhull/io.c
+@@ -3740,7 +3740,7 @@ coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc) {
+ coordT *points, *coords, *infinity= NULL;
+ realT paraboloid, maxboloid= -REALmax, value;
+ realT *coordp= NULL, *offsetp= NULL, *normalp= NULL;
+- char *s, *t, firstline[qh_MAXfirst+1];
++ char *s= NULL, *t, firstline[qh_MAXfirst+1];
+ int diminput=0, numinput=0, dimfeasible= 0, newnum, k, tempi;
+ int firsttext=0, firstshort=0, firstlong=0, firstpoint=0;
+ int tokcount= 0, linecount=0, maxcount, coordcount=0;