Skip to content

Commit

Permalink
tolua: custom vcpkg overlay
Browse files Browse the repository at this point in the history
TODO: move custom ports to their own repo?
  • Loading branch information
ennorehling committed Dec 8, 2024
1 parent 47e2962 commit bfc0590
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
74 changes: 74 additions & 0 deletions custom-overlay/tolua/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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 = <C:\path\to\current\vcpkg>
# 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}")
4 changes: 4 additions & 0 deletions custom-overlay/tolua/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tolua provides CMake targets:

find_package(tolua CONFIG REQUIRED)
target_link_libraries(main PRIVATE tolua::tolua)
13 changes: 13 additions & 0 deletions custom-overlay/tolua/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}

0 comments on commit bfc0590

Please sign in to comment.