mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 01:19:00 +08:00
[pangolin] Fix build failure on UNIX (#12515)
* [pangolin] Finx find dependency ffmpeg components * update baseline * [pangolin] Improve portfile.cmake * [pangolin] Drop support with osx * disable static build * Add system libraries to dependency * Update ports/pangolin/CONTROL Co-authored-by: nicole mazzuca <mazzucan@outlook.com> Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
This commit is contained in:
parent
3cab101b18
commit
accd1c870c
@ -1,5 +1,7 @@
|
||||
Source: pangolin
|
||||
Version: 0.5-7
|
||||
Version: 0.5
|
||||
Port-Version: 8
|
||||
Build-Depends: eigen3, glew, libpng, libjpeg-turbo, ffmpeg
|
||||
Homepage: https://github.com/stevenlovegrove/Pangolin
|
||||
Description: Lightweight GUI Library
|
||||
Supports: !uwp & !osx & !(windows&static)
|
||||
|
14
ports/pangolin/fix-dependency-python.patch
Normal file
14
ports/pangolin/fix-dependency-python.patch
Normal file
@ -0,0 +1,14 @@
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 7f364a7..b6567a2 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)
|
||||
+ if (UNIX)
|
||||
+ set(PYTHON_LIBRARY ${PYTHON_LIBRARY} dl)
|
||||
+ endif()
|
||||
list(APPEND HEADERS
|
||||
${INCDIR}/console/ConsoleInterpreter.h
|
||||
${INCDIR}/console/ConsoleView.h
|
50
ports/pangolin/fix-dependeny-ffmpeg.patch
Normal file
50
ports/pangolin/fix-dependeny-ffmpeg.patch
Normal file
@ -0,0 +1,50 @@
|
||||
diff --git a/CMakeModules/FindFFMPEG.cmake b/CMakeModules/FindFFMPEG.cmake
|
||||
index 4f77e5a..151762f 100644
|
||||
--- a/CMakeModules/FindFFMPEG.cmake
|
||||
+++ b/CMakeModules/FindFFMPEG.cmake
|
||||
@@ -21,6 +21,14 @@ FIND_PATH(
|
||||
SWSCALE_INCLUDE_DIR libswscale/swscale.h
|
||||
/usr/include /usr/local/include /opt/local/include
|
||||
)
|
||||
+FIND_PATH(
|
||||
+ AVDEVICE_INCLUDE_DIR libavdevice/avdevice.h
|
||||
+ /usr/include /usr/local/include /opt/local/include
|
||||
+)
|
||||
+FIND_PATH(
|
||||
+ SWRESAMPLE_INCLUDE_DIR libswresample/swresample.h
|
||||
+ /usr/include /usr/local/include /opt/local/include
|
||||
+)
|
||||
|
||||
# Find Library files
|
||||
FIND_LIBRARY(
|
||||
@@ -43,15 +51,28 @@ FIND_LIBRARY(
|
||||
NAMES swscale
|
||||
PATH /usr/lib /usr/local/lib /opt/local/lib
|
||||
)
|
||||
+FIND_LIBRARY(
|
||||
+ AVDEVICE_LIBRARY
|
||||
+ NAMES avdevice
|
||||
+ PATH /usr/lib /usr/local/lib /opt/local/lib
|
||||
+)
|
||||
+FIND_LIBRARY(
|
||||
+ SWRESAMPLE_LIBRARY
|
||||
+ NAMES swresample
|
||||
+ PATH /usr/lib /usr/local/lib /opt/local/lib
|
||||
+)
|
||||
|
||||
IF( EXISTS "${AVUTIL_INCLUDE_DIR}/libavutil/pixdesc.h" )
|
||||
SET( AVUTIL_HAVE_PIXDESC TRUE)
|
||||
endif()
|
||||
|
||||
IF(AVCODEC_INCLUDE_DIR AND AVFORMAT_INCLUDE_DIR AND AVUTIL_INCLUDE_DIR AND SWSCALE_INCLUDE_DIR AND AVCODEC_LIBRARY AND AVFORMAT_LIBRARY AND AVUTIL_LIBRARY AND SWSCALE_LIBRARY AND AVUTIL_HAVE_PIXDESC)
|
||||
+ IF (WIN32)
|
||||
+ SET(AVFORMAT_LIBRARY ${AVFORMAT_LIBRARY} Ws2_32 Secur32 Bcrypt)
|
||||
+ ENDIF()
|
||||
SET(FFMPEG_FOUND TRUE)
|
||||
- SET(FFMPEG_LIBRARIES ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY})
|
||||
- SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR})
|
||||
+ SET(FFMPEG_LIBRARIES ${AVFORMAT_LIBRARY} ${AVDEVICE_LIBRARY} ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY} ${SWRESAMPLE_LIBRARY})
|
||||
+ SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR} ${AVDEVICE_INCLUDE_DIR} ${SWRESAMPLE_INCLUDE_DIR})
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
@ -1,5 +1,3 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
@ -11,6 +9,8 @@ vcpkg_from_github(
|
||||
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-dependeny-ffmpeg.patch
|
||||
fix-dependency-python.patch
|
||||
)
|
||||
|
||||
file(REMOVE ${SOURCE_PATH}/CMakeModules/FindGLEW.cmake)
|
||||
@ -33,7 +33,9 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Pangolin)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
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})
|
||||
@ -42,21 +44,17 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
file(COPY ${DEBUG_EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
file(REMOVE ${DEBUG_EXE})
|
||||
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake PANGOLIN_TARGETS)
|
||||
string(REPLACE "lib/pangolin.dll" "bin/pangolin.dll" PANGOLIN_TARGETS "${PANGOLIN_TARGETS}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake "${PANGOLIN_TARGETS}")
|
||||
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake PANGOLIN_TARGETS)
|
||||
string(REPLACE "lib/pangolin.dll" "bin/pangolin.dll" PANGOLIN_TARGETS "${PANGOLIN_TARGETS}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake "${PANGOLIN_TARGETS}")
|
||||
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"
|
||||
)
|
||||
|
||||
# Copy missing header file
|
||||
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/include/pangolin/pangolin_export.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/pangolin)
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Copy missing header file
|
||||
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/include/pangolin/pangolin_export.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/pangolin)
|
||||
|
||||
# Put the license file where vcpkg expects it
|
||||
file(COPY ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/Pangolin/)
|
||||
file(COPY ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/Pangolin/)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/Pangolin/LICENCE ${CURRENT_PACKAGES_DIR}/share/Pangolin/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)
|
||||
|
@ -1308,10 +1308,6 @@ osgearth:x64-windows-static=fail
|
||||
osg-qt:x64-windows-static=fail
|
||||
paho-mqtt:arm-uwp=fail
|
||||
paho-mqtt:x64-uwp=fail
|
||||
pangolin:x64-linux=fail
|
||||
pangolin:x64-osx=fail
|
||||
pangolin:x64-uwp=fail
|
||||
pangolin:x64-windows-static=fail
|
||||
pangomm:x64-osx=fail
|
||||
pangomm:arm64-windows=fail
|
||||
parmetis:x64-linux=fail
|
||||
|
Loading…
Reference in New Issue
Block a user