aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2021-04-10 00:59:25 +0800
committerGitHub <noreply@github.com>2021-04-09 09:59:25 -0700
commit59b938ed9ae81700b25b1cb7e2f3e13cd981f700 (patch)
tree20c94fa89ee10c531e944a212c59f0479a698917 /ports
parent06fd7cc3c22f631d2a5acad27b307e3c70a977f9 (diff)
downloadvcpkg-59b938ed9ae81700b25b1cb7e2f3e13cd981f700.tar.gz
vcpkg-59b938ed9ae81700b25b1cb7e2f3e13cd981f700.zip
[fltk] Fix link to system libs (#17094)
* [fltk] Fix link to system libs * update version record
Diffstat (limited to 'ports')
-rw-r--r--ports/fltk/CONTROL6
-rw-r--r--ports/fltk/fix-system-link.patch18
-rw-r--r--ports/fltk/portfile.cmake13
-rw-r--r--ports/fltk/vcpkg.json12
4 files changed, 37 insertions, 12 deletions
diff --git a/ports/fltk/CONTROL b/ports/fltk/CONTROL
deleted file mode 100644
index c6db1c1bb..000000000
--- a/ports/fltk/CONTROL
+++ /dev/null
@@ -1,6 +0,0 @@
-Source: fltk
-Version: 1.3.5
-Port-Version: 3
-Homepage: https://www.fltk.org/
-Description: FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation.
-Build-Depends: zlib, libpng, libjpeg-turbo
diff --git a/ports/fltk/fix-system-link.patch b/ports/fltk/fix-system-link.patch
new file mode 100644
index 000000000..539a38976
--- /dev/null
+++ b/ports/fltk/fix-system-link.patch
@@ -0,0 +1,18 @@
+diff --git a/CMake/macros.cmake b/CMake/macros.cmake
+index 0c2586f..eb77510 100644
+--- a/CMake/macros.cmake
++++ b/CMake/macros.cmake
+@@ -37,6 +37,13 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES)
+ add_library(${LIBRARY_NAME} ${LIBTYPE} ${LIBFILES})
+
+ target_include_directories(${LIBRARY_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
++
++ if (APPLE)
++ find_library(Cocoa Cocoa)
++ target_link_libraries(${LIBRARY_NAME} PUBLIC $<$<PLATFORM_ID:Darwin>:${Cocoa}>)
++ elseif (WIN32)
++ target_link_libraries(${LIBRARY_NAME} PUBLIC gdi32 gdiplus user32 advapi32 ole32 shell32 comdlg32)
++ endif()
+
+ set_target_properties(${LIBRARY_NAME}
+ PROPERTIES
diff --git a/ports/fltk/portfile.cmake b/ports/fltk/portfile.cmake
index 1721c9072..8c999774d 100644
--- a/ports/fltk/portfile.cmake
+++ b/ports/fltk/portfile.cmake
@@ -1,12 +1,12 @@
+# FLTK has many improperly shared global variables that get duplicated into every DLL
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
vcpkg_download_distfile(ARCHIVE
URLS "https://fltk.org/pub/fltk/1.3.5/fltk-1.3.5-source.tar.gz"
FILENAME "fltk-1.3.5.tar.gz"
SHA512 db7ea7c5f3489195a48216037b9371a50f1119ae7692d66f71b6711e5ccf78814670581bae015e408dee15c4bba921728309372c1cffc90113cdc092e8540821
)
-# FLTK has many improperly shared global variables that get duplicated into every DLL
-vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
-
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
@@ -15,6 +15,7 @@ vcpkg_extract_source_archive_ex(
add-link-libraries.patch
config-path.patch
include.patch
+ fix-system-link.patch
)
if (VCPKG_TARGET_ARCHITECTURE MATCHES "arm" OR VCPKG_TARGET_ARCHITECTURE MATCHES "arm64")
@@ -42,6 +43,8 @@ vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/fltk)
+vcpkg_copy_pdbs()
+
if(VCPKG_TARGET_IS_OSX)
vcpkg_copy_tools(TOOL_NAMES fluid.app fltk-config AUTO_CLEAN)
elseif(VCPKG_TARGET_IS_WINDOWS)
@@ -51,8 +54,6 @@ else()
vcpkg_copy_tools(TOOL_NAMES fluid fltk-config AUTO_CLEAN)
endif()
-vcpkg_copy_pdbs()
-
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/bin
@@ -74,4 +75,4 @@ foreach(FILE Fl_Export.H fl_utf8.h)
file(WRITE ${CURRENT_PACKAGES_DIR}/include/FL/${FILE} "${FLTK_HEADER}")
endforeach()
-file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/ports/fltk/vcpkg.json b/ports/fltk/vcpkg.json
new file mode 100644
index 000000000..604805de1
--- /dev/null
+++ b/ports/fltk/vcpkg.json
@@ -0,0 +1,12 @@
+{
+ "name": "fltk",
+ "version": "1.3.5",
+ "port-version": 4,
+ "description": "FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation.",
+ "homepage": "https://www.fltk.org/",
+ "dependencies": [
+ "libjpeg-turbo",
+ "libpng",
+ "zlib"
+ ]
+}