Merge pull request #2275 from lazyhamster/libmspack

[libmspack] Initial port.
This commit is contained in:
Alexander Karatarakis 2017-12-03 20:37:34 -08:00 committed by GitHub
commit aff69dc6d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 126 additions and 0 deletions

View File

@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.8)
project(libmspack C)
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-DHAVE_CONFIG_H)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
endif()
# List the source files
set(LIB_SRC mspack/cabc.c
mspack/cabd.c
mspack/chmc.c
mspack/chmd.c
mspack/crc32.c
mspack/hlpc.c
mspack/hlpd.c
mspack/kwajc.c
mspack/kwajd.c
mspack/litc.c
mspack/litd.c
mspack/lzssd.c
mspack/lzxc.c
mspack/lzxd.c
mspack/mszipc.c
mspack/mszipd.c
mspack/oabc.c
mspack/oabd.c
mspack/qtmd.c
mspack/system.c
mspack/szddc.c
mspack/szddd.c
)
if(BUILD_SHARED_LIBS)
set(LIB_DEF libmspack.def)
endif()
add_library(libmspack ${LIB_SRC} ${LIB_DEF})
target_include_directories(libmspack PRIVATE . ./mspack)
install(TARGETS libmspack
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(FILES mspack/mspack.h DESTINATION include)

4
ports/libmspack/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: libmspack
Version: 0.6
Build-Depends:
Description: libmspack is a portable library for some loosely related Microsoft compression formats.

8
ports/libmspack/config.h Normal file
View File

@ -0,0 +1,8 @@
#define HAVE_LIMITS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MEMCMP 1
#define HAVE_TOWLOWER 1
#define HAVE_TOLOWER 1

View File

@ -0,0 +1,32 @@
EXPORTS
mspack_create_cab_compressor
mspack_create_chm_compressor
mspack_create_lit_compressor
mspack_create_hlp_compressor
mspack_create_szdd_compressor
mspack_create_kwaj_compressor
mspack_create_oab_compressor
mspack_create_cab_decompressor
mspack_create_chm_decompressor
mspack_create_lit_decompressor
mspack_create_hlp_decompressor
mspack_create_szdd_decompressor
mspack_create_kwaj_decompressor
mspack_create_oab_decompressor
mspack_destroy_cab_compressor
mspack_destroy_cab_decompressor
mspack_destroy_chm_compressor
mspack_destroy_chm_decompressor
mspack_destroy_lit_compressor
mspack_destroy_lit_decompressor
mspack_destroy_hlp_compressor
mspack_destroy_hlp_decompressor
mspack_destroy_szdd_compressor
mspack_destroy_szdd_decompressor
mspack_destroy_kwaj_compressor
mspack_destroy_kwaj_decompressor
mspack_destroy_oab_compressor
mspack_destroy_oab_decompressor

View File

@ -0,0 +1,30 @@
include(vcpkg_common_functions)
set(LIB_NAME libmspack)
set(LIB_VERSION 0.6alpha)
set(LIB_FILENAME ${LIB_NAME}-${LIB_VERSION}.tar.gz)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${LIB_NAME}-${LIB_VERSION})
vcpkg_download_distfile(ARCHIVE
URLS "https://www.cabextract.org.uk/libmspack/${LIB_FILENAME}"
FILENAME "${LIB_FILENAME}"
SHA512 7ba4a584d335c2d703628a3c179bc0d323574632357cdfe04622f960dcc4ef970b5739799397b6802d44a312f7ed9d589b4be223facf044bbfdbfd76d9c7405d
)
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/libmspack.def DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
)
vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# License and man
file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${LIB_NAME} RENAME copyright)
vcpkg_copy_pdbs()