From 482064760e0c30c966dbfdf0deb3dc358a70ae12 Mon Sep 17 00:00:00 2001 From: Yuri Victorovich Date: Thu, 8 Aug 2019 04:06:03 +0000 Subject: [PATCH] science/simbody: Add the option EXAMPLE_PROGRAMS that builds and installs example programs --- science/simbody/Makefile | 12 +++++++---- .../files/patch-examples_CMakeLists.txt | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 science/simbody/files/patch-examples_CMakeLists.txt diff --git a/science/simbody/Makefile b/science/simbody/Makefile index ba6c70fca795..f85906763258 100644 --- a/science/simbody/Makefile +++ b/science/simbody/Makefile @@ -3,7 +3,7 @@ PORTNAME= simbody DISTVERSIONPREFIX= Simbody- DISTVERSION= 3.6.1 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= science biology PATCH_SITES= https://github.com/${PORTNAME}/${PORTNAME}/commit/ @@ -22,10 +22,10 @@ USES= blaslapack:openblas cmake compiler:c++11-lang fortran # fortran only for USE_GITHUB= yes USE_LDCONFIG= yes -CMAKE_OFF= BUILD_TESTING BUILD_EXAMPLES -CMAKE_ARGS= -DBLAS_LIBRARIES:STRING=${LOCALBASE}/lib/libopenblas.so -DLAPACK_LIBRARIES:STRING=${LOCALBASE}/lib/libopenblas.so +CMAKE_OFF= BUILD_TESTING +CMAKE_ARGS= -DBLAS_LIBRARIES:STRING=${LOCALBASE}/lib/libopenblas.so -DLAPACK_LIBRARIES:STRING=${LOCALBASE}/lib/libopenblas.so -DFREEBSD_EXAMPLESDIR=${EXAMPLESDIR} -OPTIONS_DEFINE= DOCS VISUALIZER +OPTIONS_DEFINE= DOCS VISUALIZER EXAMPLE_PROGRAMS # EXAMPLE_PROGRAMS significanly increases the build time and package size, so it is not called EXAMPLES to prevent it from being installed by default OPTIONS_DEFAULT= VISUALIZER OPTIONS_SUB= yes @@ -36,7 +36,11 @@ VISUALIZER_CMAKE_BOOL= BUILD_VISUALIZER VISUALIZER_USES= gl VISUALIZER_USE= GL=gl,glu,glut XORG=xi,xmu +EXAMPLE_PROGRAMS_DESC= Build and install example programs +EXAMPLE_PROGRAMS_CMAKE_BOOL= BUILD_EXAMPLES + PORTDOCS= * +# this port installs examples into ${EXAMPLESDIR} when EXAMPLE_PROGRAMS=ON, but check-plist doesn't complain for some reason post-install-DOCS-on: # https://github.com/simbody/simbody/issues/652 @${RMDIR} ${STAGEDIR}${DOCSDIR}/api diff --git a/science/simbody/files/patch-examples_CMakeLists.txt b/science/simbody/files/patch-examples_CMakeLists.txt new file mode 100644 index 000000000000..600efcb37ee9 --- /dev/null +++ b/science/simbody/files/patch-examples_CMakeLists.txt @@ -0,0 +1,20 @@ +--- examples/CMakeLists.txt.orig 2018-06-12 01:04:33 UTC ++++ examples/CMakeLists.txt +@@ -67,7 +67,7 @@ if(WIN32) + set(EXAMPLES_INSTALL_BIN examples/bin/) + set(EXAMPLES_INSTALL_SRC examples/src/) + else() +- set(EXAMPLES_INSTALL_BIN ${CMAKE_INSTALL_LIBDIR}/simbody/examples/) # if this changes, change the corresponding ++ set(EXAMPLES_INSTALL_BIN ${FREEBSD_EXAMPLESDIR}) # if this changes, change the corresponding + # FULL version in file(RELATIVE_PATH ) command + set(EXAMPLES_INSTALL_SRC ${CMAKE_INSTALL_DOCDIR}/examples/src/) + # Use full paths for the following as it will be used to create a symlink +@@ -75,7 +75,7 @@ else() + set(EXAMPLES_SYMLINK_BIN ${CMAKE_INSTALL_FULL_DOCDIR}/examples) + file(RELATIVE_PATH EXAMPLE_INSTALL_BIN_REL_TO_DOC + ${EXAMPLES_SYMLINK_BIN} +- ${CMAKE_INSTALL_FULL_LIBDIR}/simbody/examples/) ++ ${FREEBSD_EXAMPLESDIR}) + endif() + + # Set RPATH for all example targets in this directory and in subdirectories.