diff options
author | yuri <yuri@FreeBSD.org> | 2018-01-27 07:23:18 +0800 |
---|---|---|
committer | yuri <yuri@FreeBSD.org> | 2018-01-27 07:23:18 +0800 |
commit | 98f85203ee6bf375c56407e05c28cc20bd911ef6 (patch) | |
tree | 5097d9f12290ded4ec46336e51c81c7ab4bbd6cf /x11-toolkits | |
parent | 1e49040934c960347c948358e4c6be74307c56cb (diff) | |
download | freebsd-ports-gnome-98f85203ee6bf375c56407e05c28cc20bd911ef6.tar.gz freebsd-ports-gnome-98f85203ee6bf375c56407e05c28cc20bd911ef6.tar.zst freebsd-ports-gnome-98f85203ee6bf375c56407e05c28cc20bd911ef6.zip |
New port: x11-toolkits/nanogui: Minimalistic GUI library for OpenGL
NanoGUI is a graphics toolkit with its own distinctive look-and-feel.
Please see the screenshot of one of their examples here:
https://github.com/wjakob/nanogui/raw/master/resources/screenshot.png
Approved by: tcberner (mentor)
Differential Revision: D13667
Diffstat (limited to 'x11-toolkits')
-rw-r--r-- | x11-toolkits/Makefile | 1 | ||||
-rw-r--r-- | x11-toolkits/nanogui/Makefile | 44 | ||||
-rw-r--r-- | x11-toolkits/nanogui/distinfo | 5 | ||||
-rw-r--r-- | x11-toolkits/nanogui/files/patch-CMakeLists.txt | 96 | ||||
-rw-r--r-- | x11-toolkits/nanogui/pkg-descr | 5 | ||||
-rw-r--r-- | x11-toolkits/nanogui/pkg-plist | 46 |
6 files changed, 197 insertions, 0 deletions
diff --git a/x11-toolkits/Makefile b/x11-toolkits/Makefile index 18efa29e1529..767c18c5fe99 100644 --- a/x11-toolkits/Makefile +++ b/x11-toolkits/Makefile @@ -129,6 +129,7 @@ SUBDIR += mygui-dummy SUBDIR += mygui-ogre SUBDIR += mygui-opengl + SUBDIR += nanogui SUBDIR += neXtaw SUBDIR += ntk SUBDIR += nucleo diff --git a/x11-toolkits/nanogui/Makefile b/x11-toolkits/nanogui/Makefile new file mode 100644 index 000000000000..302440bfd65b --- /dev/null +++ b/x11-toolkits/nanogui/Makefile @@ -0,0 +1,44 @@ +# $FreeBSD$ + +PORTNAME= nanogui +DISTVERSIONPREFIX= v +DISTVERSION= g20171202 +CATEGORIES= x11-toolkits + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Minimalistic GUI library for OpenGL + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE.txt + +LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ + libfreetype.so:print/freetype2 \ + libglfw.so:graphics/glfw + +USES= cmake:outsource compiler:c++14-lang eigen:3,build,run +USE_GITHUB= yes +GH_ACCOUNT= wjakob +GH_TAGNAME= 3e0b2c8 +GH_TUPLE= wjakob:nanovg:ab38df8:nanovg/ext/nanovg +USE_GL= gl +USE_XORG= x11 xcursor xi xinerama xrandr xxf86vm +USE_LDCONFIG= yes +CMAKE_OFF= NANOGUI_BUILD_EXAMPLE GLFW_BUILD_EXAMPLES + +OPTIONS_DEFINE= PYTHON +OPTIONS_DEFAULT= PYTHON +OPTIONS_SUB= yes + +PYTHON_CMAKE_BOOL= NANOGUI_BUILD_PYTHON +PYTHON_USES= python +PYTHON_BUILD_DEPENDS= ${LOCALBASE}/include/pybind11/pybind11.h:devel/pybind11 +PYTHON_RUN_DEPENDS= pybind11>0:devel/pybind11 + +post-install: + ${INSTALL_DATA} ${WRKSRC}/ext/nanovg/src/*.h ${STAGEDIR}${PREFIX}/include/nanogui/ # bundled dependency headers aren't installed + +post-install-PYTHON-on: + @${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} + ${MV} ${STAGEDIR}${PREFIX}/lib/nanogui.so ${STAGEDIR}${PYTHON_SITELIBDIR} + +.include <bsd.port.mk> diff --git a/x11-toolkits/nanogui/distinfo b/x11-toolkits/nanogui/distinfo new file mode 100644 index 000000000000..406b671b5fa0 --- /dev/null +++ b/x11-toolkits/nanogui/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1514452444 +SHA256 (wjakob-nanogui-vg20171202-3e0b2c8_GH0.tar.gz) = 04a7e1628ae7507fd0a3482f096205bccd0c667caef104eafb7c3b57f0a57f18 +SIZE (wjakob-nanogui-vg20171202-3e0b2c8_GH0.tar.gz) = 2742665 +SHA256 (wjakob-nanovg-ab38df8_GH0.tar.gz) = 4919c34f84eefaea556130906e1a1e0733562c96de1b46715ed31b5d15fc5eca +SIZE (wjakob-nanovg-ab38df8_GH0.tar.gz) = 2014812 diff --git a/x11-toolkits/nanogui/files/patch-CMakeLists.txt b/x11-toolkits/nanogui/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..52309b54fbea --- /dev/null +++ b/x11-toolkits/nanogui/files/patch-CMakeLists.txt @@ -0,0 +1,96 @@ +--- CMakeLists.txt.orig 2017-12-02 22:40:58 UTC ++++ CMakeLists.txt +@@ -6,11 +6,11 @@ if (POLICY CMP0058) + cmake_policy(SET CMP0058 NEW) + endif() + +-if (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ext/glfw/src") +- message(FATAL_ERROR "The NanoGUI dependency repositories (GLFW, etc.) are missing! " +- "You probably did not clone the project with --recursive. It is possible to recover " +- "by calling \"git submodule update --init --recursive\"") +-endif() ++#if (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ext/glfw/src") ++# message(FATAL_ERROR "The NanoGUI dependency repositories (GLFW, etc.) are missing! " ++# "You probably did not clone the project with --recursive. It is possible to recover " ++# "by calling \"git submodule update --init --recursive\"") ++#endif() + + if (WIN32) + set(NANOGUI_USE_GLAD_DEFAULT ON) +@@ -18,6 +18,8 @@ else() + set(NANOGUI_USE_GLAD_DEFAULT OFF) + endif() + ++include_directories(${CMAKE_INSTALL_PREFIX}/include/eigen3) ++ + option(NANOGUI_BUILD_EXAMPLE "Build NanoGUI example application?" ON) + option(NANOGUI_BUILD_SHARED "Build NanoGUI as a shared library?" ON) + option(NANOGUI_BUILD_PYTHON "Build a Python plugin for NanoGUI?" ON) +@@ -73,7 +75,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations") + endif() + +-add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/glfw" "ext_build/glfw") ++#add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/glfw" "ext_build/glfw") + + # Python support: add NANOGUI_PYTHON flag to all targets + if (NANOGUI_BUILD_PYTHON) +@@ -243,6 +245,9 @@ elseif(CMAKE_SYSTEM MATCHES "Linux" OR C + if(CMAKE_SYSTEM MATCHES "Linux") + list(APPEND NANOGUI_EXTRA_LIBS dl) + endif() ++ if(CMAKE_SYSTEM MATCHES "FreeBSD") ++ list(APPEND NANOGUI_EXTRA_LIBS glfw) ++ endif() + endif() + + include_directories(${NANOGUI_EIGEN_INCLUDE_DIR} ext/glfw/include ext/nanovg/src include ${CMAKE_CURRENT_BINARY_DIR}) +@@ -282,7 +287,7 @@ else() + set(NANOGUI_LIBRARY_TYPE "STATIC") + endif() + +-if (APPLE OR CMAKE_SYSTEM MATCHES "Linux") ++if (APPLE OR CMAKE_SYSTEM MATCHES "Linux|FreeBSD") + # Include coroutine support for running the mainloop in detached mode + add_definitions(-DCORO_SJLJ) + include_directories(ext/coro) +@@ -343,7 +348,7 @@ add_library(nanogui-obj OBJECT + + add_library(nanogui ${NANOGUI_LIBRARY_TYPE} + $<TARGET_OBJECTS:nanogui-obj> +- $<TARGET_OBJECTS:glfw_objects> ++ #$<TARGET_OBJECTS:glfw_objects> + ) + + if (NANOGUI_BUILD_SHARED) +@@ -415,7 +420,7 @@ if (NANOGUI_BUILD_PYTHON) + # Detect Python + + # Try to autodetect Python (can be overridden manually if needed) +- list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/ext/pybind11/tools") ++ list(APPEND CMAKE_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/share/cmake/pybind11/") + set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4) + find_package(PythonLibsNew ${NANOGUI_PYTHON_VERSION}) + if (NOT PYTHONLIBS_FOUND) +@@ -430,7 +435,7 @@ endif() + if (NANOGUI_BUILD_PYTHON) + # Need PIC code in libnanogui even when compiled as a static library + set_target_properties(nanogui-obj PROPERTIES POSITION_INDEPENDENT_CODE ON) +- set_target_properties(glfw_objects PROPERTIES POSITION_INDEPENDENT_CODE ON) ++ #set_target_properties(glfw_objects PROPERTIES POSITION_INDEPENDENT_CODE ON) + + include_directories("ext/pybind11/include" ${PYTHON_INCLUDE_DIR}) + add_library(nanogui-python-obj OBJECT +@@ -489,9 +494,9 @@ if (NANOGUI_BUILD_PYTHON) + endif() + elseif(UNIX) + # Optimize for size +- if (U_CMAKE_BUILD_TYPE MATCHES REL) +- set_property(TARGET nanogui-python-obj APPEND PROPERTY COMPILE_OPTIONS "-Os") +- endif() ++ #if (U_CMAKE_BUILD_TYPE MATCHES REL) ++ # set_property(TARGET nanogui-python-obj APPEND PROPERTY COMPILE_OPTIONS "-Os") ++ #endif() + + # Strip unnecessary sections of the binary on Linux/Mac OS + if(APPLE) diff --git a/x11-toolkits/nanogui/pkg-descr b/x11-toolkits/nanogui/pkg-descr new file mode 100644 index 000000000000..d698bb0639e5 --- /dev/null +++ b/x11-toolkits/nanogui/pkg-descr @@ -0,0 +1,5 @@ +NTK is a fork of FLTK 1.3.0 which adds graphics rendering via +Cairo, support for transparent/overlapping widgets, streamlining +of internals, and some new/improved widgets. + +WWW: https://github.com/original-male/ntk diff --git a/x11-toolkits/nanogui/pkg-plist b/x11-toolkits/nanogui/pkg-plist new file mode 100644 index 000000000000..b1296b5b1dc1 --- /dev/null +++ b/x11-toolkits/nanogui/pkg-plist @@ -0,0 +1,46 @@ +include/nanogui/button.h +include/nanogui/checkbox.h +include/nanogui/colorpicker.h +include/nanogui/colorwheel.h +include/nanogui/combobox.h +include/nanogui/common.h +include/nanogui/compat.h +include/nanogui/entypo.h +include/nanogui/fontstash.h +include/nanogui/formhelper.h +include/nanogui/glcanvas.h +include/nanogui/glutil.h +include/nanogui/graph.h +include/nanogui/imagepanel.h +include/nanogui/imageview.h +include/nanogui/label.h +include/nanogui/layout.h +include/nanogui/messagedialog.h +include/nanogui/nanogui.h +include/nanogui/nanovg.h +include/nanogui/nanovg_gl.h +include/nanogui/nanovg_gl_utils.h +include/nanogui/object.h +include/nanogui/opengl.h +include/nanogui/popup.h +include/nanogui/popupbutton.h +include/nanogui/progressbar.h +include/nanogui/python.h +include/nanogui/screen.h +include/nanogui/serializer/core.h +include/nanogui/serializer/opengl.h +include/nanogui/serializer/sparse.h +include/nanogui/slider.h +include/nanogui/stackedwidget.h +include/nanogui/stb_image.h +include/nanogui/stb_truetype.h +include/nanogui/tabheader.h +include/nanogui/tabwidget.h +include/nanogui/textbox.h +include/nanogui/theme.h +include/nanogui/toolbutton.h +include/nanogui/vscrollpanel.h +include/nanogui/widget.h +include/nanogui/window.h +lib/libnanogui.so +%%PYTHON%%%%PYTHON_SITELIBDIR%%/nanogui.so |