Skip to content

Commit

Permalink
Add a couple of ports to fix iOS and windows building
Browse files Browse the repository at this point in the history
nirvn committed Jan 16, 2025
1 parent 9eb4f41 commit eb47018
Showing 4 changed files with 88 additions and 0 deletions.
29 changes: 29 additions & 0 deletions vcpkg/ports/libb2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO BLAKE2/libb2
REF 2c5142f12a2cd52f3ee0a43e50a3a76f75badf85
SHA512 cf29cf9391ae37a978eb6618de6f856f3defa622b8f56c2d5a519ab34fd5e4d91f3bb868601a44e9c9164a2992e80dde188ccc4d1605dffbdf93687336226f8d
HEAD_REF master
)

set(OPTIONS)
if(CMAKE_HOST_WIN32)
set(OPTIONS --disable-native) # requires cpuid
endif()

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
ax_cv_check_cflags___O3=no # see https://github.com/microsoft/vcpkg/pull/17912#issuecomment-840514179
${OPTIONS}
)
vcpkg_install_make()
vcpkg_fixup_pkgconfig()


file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

vcpkg_copy_pdbs()

file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
8 changes: 8 additions & 0 deletions vcpkg/ports/libb2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "libb2",
"version": "0.98.1",
"port-version": 6,
"description": "C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp",
"homepage": "https://github.com/BLAKE2/libb2",
"supports": "!windows"
}
34 changes: 34 additions & 0 deletions vcpkg/ports/nu-book-zxing-cpp/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO zxing-cpp/zxing-cpp
REF "v${VERSION}"
SHA512 f1de8df783061a152a18cd9102ac0c579c40c76ab4a5ba9f30bcb8ddb532f3fac08736840a631adbf7c30a7fa00ce8d65625c8cd695288620601708e8f256a53
HEAD_REF master
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_BLACKBOX_TESTS=OFF
-DBUILD_EXAMPLES=OFF
)

vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()

vcpkg_cmake_config_fixup(
CONFIG_PATH lib/cmake/ZXing
PACKAGE_NAME ZXing
)

file(READ "${CURRENT_PACKAGES_DIR}/share/ZXing/ZXingConfig.cmake" _contents)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/ZXing/ZXingConfig.cmake" "
include(CMakeFindDependencyMacro)
find_dependency(Threads)
${_contents}")

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
17 changes: 17 additions & 0 deletions vcpkg/ports/nu-book-zxing-cpp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "nu-book-zxing-cpp",
"version": "2.2.1",
"description": "Barcode detection and decoding library.",
"homepage": "https://github.com/zxing-cpp/zxing-cpp",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

0 comments on commit eb47018

Please sign in to comment.