mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-06-12 09:25:15 +08:00
[lzfse] new port
This commit is contained in:
parent
d26e890b31
commit
374c3f94c8
3
ports/lzfse/CONTROL
Normal file
3
ports/lzfse/CONTROL
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Source: lzfse
|
||||||
|
Version: 1.0
|
||||||
|
Description: Lempel-Ziv style data compressor using Finite State Entropy coding.
|
51
ports/lzfse/disable-cli-option.patch
Normal file
51
ports/lzfse/disable-cli-option.patch
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 336a68d..96a2a74 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -67,18 +67,20 @@ add_library(lzfse
|
||||||
|
src/lzvn_encode_base.c)
|
||||||
|
lzfse_add_compiler_flags(lzfse -Wall -Wno-unknown-pragmas -Wno-unused-variable)
|
||||||
|
|
||||||
|
-add_executable(lzfse_cli
|
||||||
|
- src/lzfse_main.c)
|
||||||
|
-target_link_libraries(lzfse_cli lzfse)
|
||||||
|
-set_target_properties(lzfse_cli PROPERTIES OUTPUT_NAME lzfse)
|
||||||
|
-lzfse_add_compiler_flags(lzfse_cli -Wall -Wno-unknown-pragmas -Wno-unused-variable)
|
||||||
|
-
|
||||||
|
-if(CMAKE_VERSION VERSION_LESS 3.1 OR CMAKE_C_COMPLIER_ID STREQUAL "Intel")
|
||||||
|
- lzfse_add_compiler_flags(lzfse -std=c99)
|
||||||
|
- lzfse_add_compiler_flags(lzfse_cli -std=c99)
|
||||||
|
-else()
|
||||||
|
- set_property(TARGET lzfse PROPERTY C_STANDARD 99)
|
||||||
|
- set_property(TARGET lzfse_cli PROPERTY C_STANDARD 99)
|
||||||
|
+if(NOT LZFSE_DISABLE_CLI)
|
||||||
|
+ add_executable(lzfse_cli
|
||||||
|
+ src/lzfse_main.c)
|
||||||
|
+ target_link_libraries(lzfse_cli lzfse)
|
||||||
|
+ set_target_properties(lzfse_cli PROPERTIES OUTPUT_NAME lzfse)
|
||||||
|
+ lzfse_add_compiler_flags(lzfse_cli -Wall -Wno-unknown-pragmas -Wno-unused-variable)
|
||||||
|
+
|
||||||
|
+ if(CMAKE_VERSION VERSION_LESS 3.1 OR CMAKE_C_COMPLIER_ID STREQUAL "Intel")
|
||||||
|
+ lzfse_add_compiler_flags(lzfse -std=c99)
|
||||||
|
+ lzfse_add_compiler_flags(lzfse_cli -std=c99)
|
||||||
|
+ else()
|
||||||
|
+ set_property(TARGET lzfse PROPERTY C_STANDARD 99)
|
||||||
|
+ set_property(TARGET lzfse_cli PROPERTY C_STANDARD 99)
|
||||||
|
+ endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_target_properties(lzfse PROPERTIES
|
||||||
|
@@ -95,7 +97,12 @@ endif()
|
||||||
|
if(NOT LZFSE_BUNDLE_MODE)
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
- install(TARGETS lzfse lzfse_cli
|
||||||
|
+ if(NOT LZFSE_DISABLE_CLI)
|
||||||
|
+ install(TARGETS lzfse_cli
|
||||||
|
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
+ endif()
|
||||||
|
+
|
||||||
|
+ install(TARGETS lzfse
|
||||||
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||||
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
37
ports/lzfse/portfile.cmake
Normal file
37
ports/lzfse/portfile.cmake
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
|
||||||
|
message(FATAL_ERROR "ARM build not supported")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(vcpkg_common_functions)
|
||||||
|
vcpkg_from_github(
|
||||||
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
|
REPO lzfse/lzfse
|
||||||
|
REF lzfse-1.0
|
||||||
|
SHA512 9d7ca44e6d3d2bdf4b82b0eb66c14922369b8b6fe2cf891187a77c6708b8d26c2c1b2ccddec6059e85dbbbb37c497419549f02812b5f34d06238ac246a8cf912
|
||||||
|
HEAD_REF master)
|
||||||
|
|
||||||
|
vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH}
|
||||||
|
PATCHES ${CMAKE_CURRENT_LIST_DIR}/disable-cli-option.patch)
|
||||||
|
|
||||||
|
vcpkg_configure_cmake(
|
||||||
|
SOURCE_PATH ${SOURCE_PATH}
|
||||||
|
PREFER_NINJA
|
||||||
|
OPTIONS
|
||||||
|
-DLZFSE_DISABLE_TESTS=ON
|
||||||
|
-DLZFSE_DISABLE_CLI=ON)
|
||||||
|
|
||||||
|
vcpkg_install_cmake()
|
||||||
|
vcpkg_copy_pdbs()
|
||||||
|
|
||||||
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||||
|
|
||||||
|
file(READ ${CURRENT_PACKAGES_DIR}/include/lzfse.h LZFSE_H)
|
||||||
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||||
|
string(REPLACE "defined(LZFSE_DLL)" "1" LZFSE_H "${LZFSE_H}")
|
||||||
|
else()
|
||||||
|
string(REPLACE "defined(LZFSE_DLL)" "0" LZFSE_H "${LZFSE_H}")
|
||||||
|
endif()
|
||||||
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/lzfse.h "${LZFSE_H}")
|
||||||
|
|
||||||
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/lzfse)
|
||||||
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/lzfse/LICENSE ${CURRENT_PACKAGES_DIR}/share/lzfse/copyright)
|
Loading…
Reference in New Issue
Block a user