Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ports/freeglut/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ vcpkg_extract_source_archive_ex(
)

if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message("Freeglut currently requires the following libraries from the system package manager:\n opengl\n glu\n libx11\n\nThese can be installed on Ubuntu systems via apt-get install libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev\nOn macOS Xquartz is required.")
message("Freeglut currently requires the following libraries from the system package manager:\n opengl\n glu\n libx11\n xrandr\n xi\n xxf86vm\n\nThese can be installed on Ubuntu systems via apt-get install libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev\nOn macOS Xquartz is required.")
endif()

if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
Expand Down Expand Up @@ -62,3 +62,7 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/freeglut/COPYING ${CURRENT_PACKAGES_DI

vcpkg_copy_pdbs()
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/glut)
endif()
10 changes: 10 additions & 0 deletions ports/freeglut/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
_find_package(${ARGS})
if(GLUT_FOUND)
find_library(XRANDR_LIBRARY NAMES xrandr Xrandr)
if(XRANDR_LIBRARY)
list(APPEND GLUT_LIBRARIES ${XRANDR_LIBRARY})
if(TARGET GLUT::GLUT)
set_property(TARGET GLUT::GLUT APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${XRANDR_LIBRARY})
endif()
endif()
endif()
35 changes: 18 additions & 17 deletions ports/freeimage/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@ include(${CMAKE_TRIPLET_FILE})
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/FreeImage)
vcpkg_download_distfile(ARCHIVE
URLS "https://sourceforge.net/projects/freeimage/files/Source%20Distribution/3.18.0/FreeImage3180.zip/download"
URLS "http://downloads.sourceforge.net/freeimage/FreeImage3180.zip"
FILENAME "FreeImage3180.zip"
SHA512 9d9cc7e2d57552c3115e277aeb036e0455204d389026b17a3f513da5be1fd595421655488bb1ec2f76faebed66049119ca55e26e2a6d37024b3fb7ef36ad4818
)
vcpkg_extract_source_archive(${ARCHIVE})

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/disable-plugins-depending-on-internal-third-party-libraries.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-jpeg.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-jxrlib.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-libtiff.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-openjpeg.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-png-zlib.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-rawlib.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-webp.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-openexr.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-freeimage-config-include.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-function-overload.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-typedef-as-already-declared.patch"
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FreeImageConfig-static.h DESTINATION ${SOURCE_PATH})
Expand All @@ -25,21 +41,6 @@ file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibWebP)
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibRawLite)
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/OpenEXR)

vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/disable-plugins-depending-on-internal-third-party-libraries.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-jpeg.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-jxrlib.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-libtiff.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-openjpeg.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-png-zlib.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-rawlib.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-webp.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-openexr.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-freeimage-config-include.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-function-overload.patch"
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand Down
15 changes: 15 additions & 0 deletions ports/freeimage/use-typedef-as-already-declared.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/Source/FreeImage.h b/Source/FreeImage.h
index 1fd9c2f..59de277 100644
--- a/Source/FreeImage.h
+++ b/Source/FreeImage.h
@@ -160,8 +160,8 @@ typedef uint8_t BYTE;
typedef uint16_t WORD;
typedef uint32_t DWORD;
typedef int32_t LONG;
-typedef int64_t INT64;
-typedef uint64_t UINT64;
+typedef long long int INT64;
+typedef long long unsigned int UINT64;
#else
// MS is not C99 ISO compliant
typedef long BOOL;
8 changes: 6 additions & 2 deletions ports/giflib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

set(GIFLIB_VERSION 5.1.4)
vcpkg_download_distfile(ARCHIVE
URLS "https://nchc.dl.sourceforge.net/project/giflib/giflib-${GIFLIB_VERSION}.tar.bz2"
URLS "https://nchc.dl.sourceforge.net/project/giflib/giflib-${GIFLIB_VERSION}.tar.bz2"
FILENAME "giflib-${GIFLIB_VERSION}.tar.bz2"
SHA512 32b5e342056c210e6478e9cb3b6ceec9594dcfaf34feea1eb4dad633a081ed4465bceee578c19165907cb47cb83912ac359ceea666a8e07dbbb5420f9928f96d
)

if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME)
set(ADDITIONAL_PATCH "fix-compile-error.patch")
endif()

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${GIFLIB_VERSION}
PATCHES
msvc-guard-unistd-h.patch
fix-compile-error.patch
${ADDITIONAL_PATCH}
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
Expand Down
4 changes: 3 additions & 1 deletion ports/libwebp/0001-build-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 499ddce..895fda9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -159,6 +159,10 @@ add_definitions(-DHAVE_CONFIG_H)
@@ -159,6 +159,12 @@ add_definitions(-DHAVE_CONFIG_H)
if(MSVC)
# avoid security warnings for e.g., fopen() used in the examples.
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+ add_definitions(-DWEBP_HAVE_JUST_SDL_H)
+ if(BUILD_SHARED_LIBS)
+ add_definitions(-DWEBP_EXTERN=__declspec\(dllexport\))
+ else()
+ add_definitions(-DFREEGLUT_STATIC)
+ endif()
else()
add_definitions(-Wall)
Expand Down
13 changes: 13 additions & 0 deletions ports/libwebp/0003-remove-missing-symbol.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/examples/gifdec.c b/examples/gifdec.c
index 4219352..ab0592a 100644
--- a/examples/gifdec.c
+++ b/examples/gifdec.c
@@ -310,7 +310,7 @@ void GIFDisplayError(const GifFileType* const gif, int gif_error) {
#else
(void)gif;
fprintf(stderr, "GIFLib Error %d: ", gif_error);
- PrintGifError();
+ //PrintGifError();
fprintf(stderr, "\n");
#endif
}
15 changes: 15 additions & 0 deletions ports/libwebp/0004-add-missing-linked-library.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a98540c..a3697cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -479,6 +479,10 @@ if(WEBP_BUILD_VWEBP)
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/src
${OPENGL_INCLUDE_DIR})
+ if(UNIX AND NOT(ANDROID OR BLACKBERRY OR APPLE))
+ find_package(X11 REQUIRED)
+ target_link_libraries(vwebp ${X11_LIBRARIES} ${X11_Xxf86vm_LIB})
+ endif()
install(TARGETS vwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
check_c_compiler_flag("-Wno-deprecated-declarations" HAS_NO_DEPRECATED)
4 changes: 2 additions & 2 deletions ports/libwebp/CONTROL
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Source: libwebp
Version: 1.0.2-2
Version: 1.0.2-3
Description: Lossy compression of digital photographic images.
Build-Depends: opengl

Feature: all
Description: enable all webp features
Build-Depends: giflib, libjpeg-turbo, zlib, libpng, tiff, freeglut, sdl1
Build-Depends: giflib, libjpeg-turbo, zlib, libpng, tiff, freeglut (!osx), sdl1 (windows)
65 changes: 49 additions & 16 deletions ports/libwebp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ vcpkg_from_github(
PATCHES
0001-build-fixes.patch
0002-cmake-config-add-backwards-compatibility.patch
0003-remove-missing-symbol.patch
0004-add-missing-linked-library.patch
)

set(WEBP_BUILD_ANIM_UTILS OFF)
Expand All @@ -30,6 +32,10 @@ if("all" IN_LIST FEATURES)
set(WEBP_BUILD_EXTRAS ON)
endif()

if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
message("WebP currently requires the following library from the system package manager:\n Xxf86vm\n\nThis can be installed on Ubuntu systems via apt-get install libxxf86vm-dev")
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand Down Expand Up @@ -59,26 +65,53 @@ vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/WebP/cmake/" TARGET_PATH "share/WebP/")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

#somehow the native CMAKE_EXECUTABLE_SUFFIX does not work, so here we emulate it
if(CMAKE_HOST_WIN32)
set(EXECUTABLE_SUFFIX ".exe")
else()
set(EXECUTABLE_SUFFIX "")
endif()

if("all" IN_LIST FEATURES)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/get_disto.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/gif2webp.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/img2webp.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vwebp.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vwebp_sdl.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/webpinfo.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/webpmux.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/webp_quality.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/get_disto${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/gif2webp${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/img2webp${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vwebp${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vwebp_sdl${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/webpinfo${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/webpmux${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/webp_quality${EXECUTABLE_SUFFIX})
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/libwebp/)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/get_disto.exe ${CURRENT_PACKAGES_DIR}/tools/libwebp/get_disto.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/gif2webp.exe ${CURRENT_PACKAGES_DIR}/tools/libwebp/gif2webp.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/img2webp.exe ${CURRENT_PACKAGES_DIR}/tools/libwebp/img2webp.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vwebp.exe ${CURRENT_PACKAGES_DIR}/tools/libwebp/vwebp.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vwebp_sdl.exe ${CURRENT_PACKAGES_DIR}/tools/libwebp/vwebp_sdl.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/webpinfo.exe ${CURRENT_PACKAGES_DIR}/tools/libwebp/webpinfo.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/webpmux.exe ${CURRENT_PACKAGES_DIR}/tools/libwebp/webpmux.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/webp_quality.exe ${CURRENT_PACKAGES_DIR}/tools/libwebp/webp_quality.exe)
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/get_disto${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/get_disto${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/get_disto${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/gif2webp${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/gif2webp${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/gif2webp${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/img2webp${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/img2webp${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/img2webp${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/vwebp${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vwebp${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/vwebp${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/vwebp_sdl${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vwebp_sdl${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/vwebp_sdl${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/webpinfo${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/webpinfo${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/webpinfo${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/webpmux${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/webpmux${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/webpmux${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/webp_quality${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/webp_quality${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/webp_quality${EXECUTABLE_SUFFIX})
endif()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/libwebp)
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()

file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebp)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libwebp/COPYING ${CURRENT_PACKAGES_DIR}/share/libwebp/copyright)