Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pangolin] Update to 0.6 and also support osx #19840

Merged
merged 14 commits into from
Sep 3, 2021
17 changes: 8 additions & 9 deletions ports/pangolin/add-definition.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9e0baac..bb3ef76 100644
index 49dcf02..d448928 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -287,6 +287,8 @@ if(BUILD_PANGOLIN_VIDEO AND _LINUX_)
message(STATUS "V4L Found and Enabled")
endif()
@@ -384,6 +384,7 @@ endif()

+add_definitions(-DHAVE_FFMPEG_AVPIXELFORMAT)
+
find_package(FFMPEG QUIET)
if(BUILD_PANGOLIN_VIDEO AND FFMPEG_FOUND)
set(HAVE_FFMPEG 1)
option(BUILD_PANGOLIN_FFMPEG "Build support for ffmpeg video input" ON)
if(BUILD_PANGOLIN_FFMPEG AND BUILD_PANGOLIN_VIDEO)
+ add_definitions(-DHAVE_FFMPEG_AVPIXELFORMAT)
find_package(FFMPEG QUIET)
if(FFMPEG_FOUND)
set(HAVE_FFMPEG 1)
69 changes: 0 additions & 69 deletions ports/pangolin/deprecated_constants.patch

This file was deleted.

13 changes: 13 additions & 0 deletions ports/pangolin/fix-build-error-in-vs2019.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/include/mpark/variant.hpp b/include/mpark/variant.hpp
index fb2cf06..6debb99 100644
--- a/include/mpark/variant.hpp
+++ b/include/mpark/variant.hpp
@@ -243,7 +243,7 @@ namespace std {
#endif

#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304
-#define MPARK_CPP14_CONSTEXPR
+//#define MPARK_CPP14_CONSTEXPR
#endif

#if __has_feature(cxx_exceptions) || defined(__cpp_exceptions) || \
11 changes: 5 additions & 6 deletions ports/pangolin/fix-cmake-version.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dd08d31..7f364a7 100644
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e13110..6adf1e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.6)
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.8)
project("Pangolin")
set(PANGOLIN_VERSION_MAJOR 0)
set(PANGOLIN_VERSION_MINOR 5)
set(PANGOLIN_VERSION ${PANGOLIN_VERSION_MAJOR}.${PANGOLIN_VERSION_MINOR})
set(PANGOLIN_VERSION_MINOR 6)
17 changes: 9 additions & 8 deletions ports/pangolin/fix-dependency-python.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7f364a7..9e0baac 100644
index ddeb144..49dcf02 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -213,6 +213,9 @@ endif()
find_package(PythonLibs QUIET)
if(BUILD_PANGOLIN_GUI AND BUILD_PANGOLIN_VARS AND PYTHONLIBS_FOUND AND NOT _WIN_)
set(HAVE_PYTHON 1)
@@ -299,7 +299,9 @@ if(BUILD_PANGOLIN_PYTHON AND BUILD_PANGOLIN_GUI AND BUILD_PANGOLIN_VARS AND NOT

if(pybind11_FOUND)
set(HAVE_PYTHON 1)
-
+ if (UNIX)
+ set(PYTHON_LIBRARY ${PYTHON_LIBRARY} dl util)
+ endif()
list(APPEND HEADERS
${INCDIR}/console/ConsoleInterpreter.h
${INCDIR}/console/ConsoleView.h
file(GLOB pypangolin_SRC "python/pypangolin/*.cpp" )
file(GLOB pypangolin_HDR "python/pypangolin/*.hpp" )
list(APPEND HEADERS
4 changes: 2 additions & 2 deletions ports/pangolin/fix-includepath-error.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dd08d31..7f364a7 100644
index a2c60ea..ddeb144 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -506,7 +506,7 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
@@ -735,7 +735,7 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake @ONLY IMMEDIATE )

# Install tree config
Expand Down
64 changes: 32 additions & 32 deletions ports/pangolin/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
vcpkg_fail_port_install(ON_TARGET "OSX" "UWP")
vcpkg_fail_port_install(ON_TARGET "UWP")

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO stevenlovegrove/Pangolin
REF v0.5
SHA512 7ebeec108f33f1aa8b1ad08e3ca128a837b22d33e3fc580021f981784043b023a1bf563bbfa8b51d46863db770b336d24fc84ee3d836b85e0da1848281b2a5b2
REF dd801d244db3a8e27b7fe8020cd751404aa818fd #v0.6
SHA512 8004ab6f146f319df41e4b8d4bdb6677b8faf6db725e34fea76fcbf065522fa286d334c2426dcb39faf0cfb3332946104f78393d2b2b2418fe02d91450916e78
HEAD_REF master
PATCHES
deprecated_constants.patch # Change from upstream pangolin to address build failures from latest ffmpeg library
fix-includepath-error.patch # include path has one more ../
fix-dependency-python.patch
add-definition.patch
fix-cmake-version.patch
fix-build-error-in-vs2019.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
test BUILD_TESTS
tools BUILD_TOOLS
examples BUILD_EXAMPLES
)

file(REMOVE ${SOURCE_PATH}/CMakeModules/FindGLEW.cmake)
file(REMOVE ${SOURCE_PATH}/CMakeModules/FindFFMPEG.cmake)
file(REMOVE "${SOURCE_PATH}/CMakeModules/FindGLEW.cmake")
file(REMOVE "${SOURCE_PATH}/CMakeModules/FindFFMPEG.cmake")

string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" MSVC_USE_STATIC_CRT)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
-DBUILD_EXTERN_GLEW=OFF
-DBUILD_EXTERN_LIBPNG=OFF
-DBUILD_EXTERN_LIBJPEG=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=ON
NancyLi1013 marked this conversation as resolved.
Show resolved Hide resolved
-DCMAKE_DISABLE_FIND_PACKAGE_TooN=ON
-DCMAKE_DISABLE_FIND_PACKAGE_DC1394=ON
-DCMAKE_DISABLE_FIND_PACKAGE_LibRealSense=ON
Expand All @@ -41,38 +48,31 @@ vcpkg_configure_cmake(
-DCMAKE_DISABLE_FIND_PACKAGE_TIFF=ON
-DCMAKE_DISABLE_FIND_PACKAGE_OpenEXR=ON
-DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT}
MAYBE_UNUSED_VARIABLES
MSVC_USE_STATIC_CRT
)

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Pangolin)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Pangolin)

vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(GLOB EXE ${CURRENT_PACKAGES_DIR}/lib/*.dll)
file(COPY ${EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE ${EXE})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

file(GLOB DEBUG_EXE ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll)
file(COPY ${DEBUG_EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE ${DEBUG_EXE})
if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES Plotter VideoConvert VideoJsonPrint VideoJsonTransform VideoViewer AUTO_CLEAN)
endif()

vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake
"lib/pangolin.dll" "bin/pangolin.dll"
)
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake
"lib/pangolin.dll" "bin/pangolin.dll"
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

if(VCPKG_TARGET_IS_WINDOWS)
# Copy missing header file
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/include/pangolin/pangolin_export.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/pangolin)
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/include/pangolin/pangolin_export.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/pangolin")
endif()

# Put the license file where vcpkg expects it
file(COPY ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/)
file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENCE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
28 changes: 23 additions & 5 deletions ports/pangolin/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "pangolin",
"version-string": "0.5",
"port-version": 15,
"version": "0.6",
"description": "Lightweight GUI Library",
"homepage": "https://github.com/stevenlovegrove/Pangolin",
"supports": "!uwp & !osx",
"supports": "!uwp",
"dependencies": [
"eigen3",
{
Expand All @@ -15,6 +14,25 @@
},
"glew",
"libjpeg-turbo",
"libpng"
]
"libpng",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"examples": {
"description": "Build Examples"
},
"test": {
"description": "Build Tests"
},
"tools": {
"description": "Build Tools"
}
}
}
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4837,8 +4837,8 @@
"port-version": 1
},
"pangolin": {
"baseline": "0.5",
"port-version": 15
"baseline": "0.6",
"port-version": 0
},
"pangomm": {
"baseline": "2.48.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/pangolin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e28a4e1603d5ee1843787223a55dce439b579b94",
"version": "0.6",
"port-version": 0
},
{
"git-tree": "77d0735cc19bbb45a0212a8b15ea101ca3598219",
"version-string": "0.5",
Expand Down