From bfc0590f22cbeed645281e13c8615325858d3eaa Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 8 Dec 2024 10:36:09 +0100 Subject: [PATCH] tolua: custom vcpkg overlay TODO: move custom ports to their own repo? --- custom-overlay/tolua/portfile.cmake | 74 +++++++++++++++++++++++++++++ custom-overlay/tolua/usage | 4 ++ custom-overlay/tolua/vcpkg.json | 13 +++++ 3 files changed, 91 insertions(+) create mode 100644 custom-overlay/tolua/portfile.cmake create mode 100644 custom-overlay/tolua/usage create mode 100644 custom-overlay/tolua/vcpkg.json diff --git a/custom-overlay/tolua/portfile.cmake b/custom-overlay/tolua/portfile.cmake new file mode 100644 index 000000000..201a2433f --- /dev/null +++ b/custom-overlay/tolua/portfile.cmake @@ -0,0 +1,74 @@ +# Common Ambient Variables: +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} +# CURRENT_INSTALLED_DIR = ${VCPKG_ROOT_DIR}\installed\${TRIPLET} +# DOWNLOADS = ${VCPKG_ROOT_DIR}\downloads +# PORT = current port name (zlib, etc) +# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) +# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) +# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) +# VCPKG_ROOT_DIR = +# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) +# VCPKG_TOOLCHAIN = ON OFF +# TRIPLET_SYSTEM_ARCH = arm x86 x64 +# BUILD_ARCH = "Win32" "x64" "ARM" +# MSBUILD_PLATFORM = "Win32"/"x64"/${TRIPLET_SYSTEM_ARCH} +# DEBUG_CONFIG = "Debug Static" "Debug Dll" +# RELEASE_CONFIG = "Release Static"" "Release DLL" +# VCPKG_TARGET_IS_WINDOWS +# VCPKG_TARGET_IS_UWP +# VCPKG_TARGET_IS_LINUX +# VCPKG_TARGET_IS_OSX +# VCPKG_TARGET_IS_FREEBSD +# VCPKG_TARGET_IS_ANDROID +# VCPKG_TARGET_IS_MINGW +# VCPKG_TARGET_EXECUTABLE_SUFFIX +# VCPKG_TARGET_STATIC_LIBRARY_SUFFIX +# VCPKG_TARGET_SHARED_LIBRARY_SUFFIX +# +# See additional helpful variables in /docs/maintainers/vcpkg_common_definitions.md + +# # Specifies if the port install should fail immediately given a condition +# vcpkg_fail_port_install(MESSAGE "tolua currently only supports Linux and Mac platforms" ON_TARGET "Windows") + +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ennorehling/tolua + REF 097c40f49d0391851d800ce2be747eaf45af99b9 + SHA512 9ae24deee8e10c993a21c209e70795ee9216d7d629a69456924825e8fefd74d9bc1e08d75e8ff51f29e03d4c160d638385cd431cb76df32276f79fdea2234e28 + HEAD_REF master +) + +# # Check if one or more features are a part of a package installation. +# # See /docs/maintainers/vcpkg_check_features.md for more details +# vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +# FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used +# tbb WITH_TBB +# INVERTED_FEATURES +# tbb ROCKSDB_IGNORE_PACKAGE_TBB +# ) + +vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + DISABLE_PARALLEL_CONFIGURE +) +vcpkg_cmake_install( + ADD_BIN_TO_PATH +) +vcpkg_copy_tools(TOOL_NAMES tolua AUTO_CLEAN) +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" +) + +# # Moves all .cmake files from /debug/share/tolua/ to /share/tolua/ +# # See /docs/maintainers/vcpkg_fixup_cmake_targets.md for more details +# vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/tolua) + +# # Handle copyright + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/custom-overlay/tolua/usage b/custom-overlay/tolua/usage new file mode 100644 index 000000000..2ad31ad79 --- /dev/null +++ b/custom-overlay/tolua/usage @@ -0,0 +1,4 @@ +tolua provides CMake targets: + +find_package(tolua CONFIG REQUIRED) +target_link_libraries(main PRIVATE tolua::tolua) diff --git a/custom-overlay/tolua/vcpkg.json b/custom-overlay/tolua/vcpkg.json new file mode 100644 index 000000000..44e1ddf51 --- /dev/null +++ b/custom-overlay/tolua/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "tolua", + "version-string": "5.2.5", + "description": "tolua is a tool that greatly simplifies the integration of C/C++ code with Lua.", + "homepage": "http://webserver2.tecgraf.puc-rio.br/~celes/tolua/", + "dependencies": [ + "lua", + { + "name": "vcpkg-cmake", + "host": true + } + ] +}