Skip to content

Commit

Permalink
[chmlib] support on arm
Browse files Browse the repository at this point in the history
  • Loading branch information
autoantwort committed Oct 4, 2022
1 parent 5f14417 commit 6046f2e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 13 deletions.
20 changes: 20 additions & 0 deletions ports/chmlib/all-platforms.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/src/chm_lib.c b/src/chm_lib.c
index 6c6736c..d532691 100644
--- a/src/chm_lib.c
+++ b/src/chm_lib.c
@@ -175,8 +175,13 @@ typedef unsigned long UInt64;

#else

-/* yielding an error is preferable to yielding incorrect behavior */
-#error "Please define the sized types for your platform in chm_lib.c"
+typedef unsigned char UChar;
+typedef int16_t Int16;
+typedef uint16_t UInt16;
+typedef int32_t Int32;
+typedef uint32_t UInt32;
+typedef int64_t Int64;
+typedef uint64_t UInt64;
#endif

/* GCC */
18 changes: 9 additions & 9 deletions ports/chmlib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ vcpkg_download_distfile(

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
ARCHIVE "${ARCHIVE}"
PATCHES
all-platforms.patch
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_RELEASE -DBUILD_TOOLS=ON
OPTIONS_DEBUG -DBUILD_TOOLS=OFF
)

vcpkg_install_cmake()
vcpkg_cmake_install()

file(INSTALL ${SOURCE_PATH}/src/chm_lib.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(INSTALL "${SOURCE_PATH}/src/chm_lib.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")

file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/chmlib)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/chmlib/COPYING ${CURRENT_PACKAGES_DIR}/share/chmlib/copyright)
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
13 changes: 10 additions & 3 deletions ports/chmlib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"name": "chmlib",
"version-string": "0.40",
"port-version": 5,
"version": "0.40",
"port-version": 6,
"description": "CHMLIB is a library for dealing with Microsoft ITSS/CHM format files. Right now, it is a very simple library, but sufficient for dealing with all of the .chm files I've come across. Due to the fairly well-designed indexing built into this particular file format, even a small library is able to gain reasonably good performance indexing into ITSS archives.",
"homepage": "https://www.jedrea.com/chmlib/"
"homepage": "http://www.jedrea.com/chmlib/",
"license": "LGPL-2.1-or-later",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@
},
"chmlib": {
"baseline": "0.40",
"port-version": 5
"port-version": 6
},
"chromaprint": {
"baseline": "1.5.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/chmlib.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "eb8f888eae3c5747154d09844daadc5c117a8c38",
"version": "0.40",
"port-version": 6
},
{
"git-tree": "44371d51f30e27d0ccda47b2069b194c3c570ea4",
"version-string": "0.40",
Expand Down

0 comments on commit 6046f2e

Please sign in to comment.