diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-06-09 22:26:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-09 22:26:42 -0700 |
| commit | 0532d22eee968521ed23def7bdc83c1152c0191a (patch) | |
| tree | 006c71ae849c580f4766051185cfd268fa93fdd0 | |
| parent | b7281d0038e6a8141882a607e4e6aa184dfc0cd1 (diff) | |
| parent | 29681a5773be9b6be55b0d021b51aef01cebffec (diff) | |
| download | vcpkg-0532d22eee968521ed23def7bdc83c1152c0191a.tar.gz vcpkg-0532d22eee968521ed23def7bdc83c1152c0191a.zip | |
Merge pull request #1239 from TheCycoONE/lpeg
Add package for lpeg
| -rw-r--r-- | ports/lpeg/CMakeLists.txt | 28 | ||||
| -rw-r--r-- | ports/lpeg/CONTROL | 4 | ||||
| -rw-r--r-- | ports/lpeg/lpeg.def | 3 | ||||
| -rw-r--r-- | ports/lpeg/portfile.cmake | 32 |
4 files changed, 67 insertions, 0 deletions
diff --git a/ports/lpeg/CMakeLists.txt b/ports/lpeg/CMakeLists.txt new file mode 100644 index 000000000..f5a72fad4 --- /dev/null +++ b/ports/lpeg/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.0) +project(lpeg) + +if(NOT WIN32) + message(FATAL_ERROR "Written for windows only") +endif() + +find_path(LUA_INCLUDE_DIR lua.h PATH_SUFFIXES lua) +find_library(LUA_LIBRARY lua) +set(LPEG_INCLUDES ${LUA_INCLUDE_DIR}) +set(LPEG_LIBRARIES ${LUA_LIBRARY}) + +add_library(lpeg + lpvm.c + lptree.c + lpprint.c + lpcap.c + lpcode.c + lpeg.def) + +target_include_directories(lpeg PRIVATE ${LPEG_INCLUDES}) +target_link_libraries(lpeg PRIVATE ${LPEG_LIBRARIES}) + +install(TARGETS lpeg + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +install(FILES re.lua DESTINATION share/lua) diff --git a/ports/lpeg/CONTROL b/ports/lpeg/CONTROL new file mode 100644 index 000000000..edb3e1712 --- /dev/null +++ b/ports/lpeg/CONTROL @@ -0,0 +1,4 @@ +Source: lpeg +Version: 1.0.1-1 +Description: LPeg is a pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs). +Build-Depends: lua diff --git a/ports/lpeg/lpeg.def b/ports/lpeg/lpeg.def new file mode 100644 index 000000000..c4c1285b7 --- /dev/null +++ b/ports/lpeg/lpeg.def @@ -0,0 +1,3 @@ +LIBRARY lpeg +EXPORTS + luaopen_lpeg diff --git a/ports/lpeg/portfile.cmake b/ports/lpeg/portfile.cmake new file mode 100644 index 000000000..8b8af69d2 --- /dev/null +++ b/ports/lpeg/portfile.cmake @@ -0,0 +1,32 @@ +#cmake-only scripts +include(vcpkg_common_functions) + +set(LPEG_VER 1.0.1) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lpeg-${LPEG_VER}) + +vcpkg_download_distfile(ARCHIVE + URLS "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-${LPEG_VER}.tar.gz" + FILENAME "lpeg-${LPEG_VER}.tar.gz" + SHA512 7b43fbee7eff443000986684bc56bba6d2796a31cf860740746c70e155bdea1b62a46b93f97e2747e3ef0f63e965148778ac2985d0f2d83e1e37ec4ebbabf4aa +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/lpeg.def DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +# Remove debug share +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(COPY ${SOURCE_PATH}/lpeg DESTINATION ${CURRENT_PACKAGES_DIR}/share/lpeg) + +# Allow empty include directory +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) |
