diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/basisu | |
Diffstat (limited to 'vcpkg/ports/basisu')
| -rw-r--r-- | vcpkg/ports/basisu/examples.diff | 22 | ||||
| -rw-r--r-- | vcpkg/ports/basisu/export-cmake-config.diff | 58 | ||||
| -rw-r--r-- | vcpkg/ports/basisu/portfile.cmake | 41 | ||||
| -rw-r--r-- | vcpkg/ports/basisu/skip-strip.diff | 12 | ||||
| -rw-r--r-- | vcpkg/ports/basisu/vcpkg.json | 18 |
5 files changed, 151 insertions, 0 deletions
diff --git a/vcpkg/ports/basisu/examples.diff b/vcpkg/ports/basisu/examples.diff new file mode 100644 index 0000000..0fa0479 --- /dev/null +++ b/vcpkg/ports/basisu/examples.diff @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e2c7a1d..d143ecf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 3.5) + project(basisu) + option(STATIC "static linking" FALSE) + option(SAN "sanitize" FALSE) ++option(EXAMPLES "Build examples" FALSE) + + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) + +@@ -176,6 +177,9 @@ target_link_libraries(basisu PRIVATE basisu_encoder) + # Create the new example executable and link against the static library + add_executable(examples example/example.cpp) + target_link_libraries(examples PRIVATE basisu_encoder) ++if(NOT EXAMPLES) ++ set_target_properties(examples PROPERTIES EXCLUDE_FROM_ALL 1) ++endif() + + if (ZSTD) + target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=1) diff --git a/vcpkg/ports/basisu/export-cmake-config.diff b/vcpkg/ports/basisu/export-cmake-config.diff new file mode 100644 index 0000000..c7d5246 --- /dev/null +++ b/vcpkg/ports/basisu/export-cmake-config.diff @@ -0,0 +1,58 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d143ecf..31c8c09 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -169,6 +169,10 @@ endif() + + # Create the static library + add_library(basisu_encoder STATIC ${ENCODER_LIB_SRC_LIST}) ++target_include_directories(basisu_encoder PUBLIC ++ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/transcoder> ++ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/encoder> ++ $<INSTALL_INTERFACE:include>) + + # Create the basisu executable and link against the static library + add_executable(basisu basisu_tool.cpp) +@@ -256,3 +260,31 @@ if (MSVC) + RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + ) + endif() ++ ++# Target Installation ++install(TARGETS basisu_encoder basisu EXPORT basisu-targets) ++install(DIRECTORY "./transcoder" DESTINATION "include/basisu/" ++ FILES_MATCHING PATTERN "*.h" PATTERN "*.inc" ++) ++install(DIRECTORY "./encoder" DESTINATION "include/basisu/" ++ FILES_MATCHING PATTERN "*.h" ++) ++ ++# CMake Export ++include(CMakePackageConfigHelpers) ++include(GNUInstallDirs) ++configure_package_config_file( ++ ${PROJECT_SOURCE_DIR}/basisu-config.cmake.in ++ ${PROJECT_BINARY_DIR}/basisu-config.cmake ++ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/basisu) ++export( ++ TARGETS basisu_encoder basisu ++ NAMESPACE basisu:: ++ FILE ${PROJECT_BINARY_DIR}/basisu-targets.cmake) ++install( ++ FILES ${PROJECT_BINARY_DIR}/basisu-config.cmake ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/basisu) ++install( ++ EXPORT basisu-targets ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/basisu ++ NAMESPACE basisu::) +diff --git a/basisu-config.cmake.in b/basisu-config.cmake.in +new file mode 100644 +index 0000000..15c0d7e +--- /dev/null ++++ b/basisu-config.cmake.in +@@ -0,0 +1,5 @@ ++@PACKAGE_INIT@ ++ ++include("${CMAKE_CURRENT_LIST_DIR}/basisu-targets.cmake") ++ ++check_required_components(basisu) diff --git a/vcpkg/ports/basisu/portfile.cmake b/vcpkg/ports/basisu/portfile.cmake new file mode 100644 index 0000000..d935575 --- /dev/null +++ b/vcpkg/ports/basisu/portfile.cmake @@ -0,0 +1,41 @@ +vcpkg_download_distfile(ambiguous_safe_shift_left_patch + URLS https://github.com/BinomialLLC/basis_universal/commit/b738655c40efca3e0dc8c435617178fec9f7f13e.diff + FILENAME BinomialLLC_basis_universal_safe_shift_left.diff + SHA512 654ac6fbfc884396c1f34eee8057db796aafa811230373edc56e3d5a66ace4289a9d4f1981e1267dda7b320dc59e983b81b1bd930607f5337678246cb5d005ec +) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO BinomialLLC/basis_universal + REF "v1_60" + SHA512 9464a944b2eaad5574e5f54b5d528be29d498f53463db1e00791ed61f0c497d4f1b9f8f78dba0e99c979ce70a894f8786b5ebef4b7741bfd244c7b56b7fb04fe + HEAD_REF master + PATCHES + ${ambiguous_safe_shift_left_patch} + examples.diff + export-cmake-config.diff + skip-strip.diff +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DCMAKE_CXX_STANDARD=17 +) +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/basisu) + +vcpkg_copy_tools(TOOL_NAMES "basisu" AUTO_CLEAN) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(COMMENT [[ +basis_universal is provided under Apache-2.0 license terms. +But it includes third-party components with different licenses.]] + FILE_LIST + "${SOURCE_PATH}/.reuse/dep5" + "${SOURCE_PATH}/LICENSE" + "${SOURCE_PATH}/LICENSES/BSD-3-clause.txt" + "${SOURCE_PATH}/LICENSES/MIT.txt" +) diff --git a/vcpkg/ports/basisu/skip-strip.diff b/vcpkg/ports/basisu/skip-strip.diff new file mode 100644 index 0000000..afca5c5 --- /dev/null +++ b/vcpkg/ports/basisu/skip-strip.diff @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 31c8c09..135b35e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -232,6 +232,7 @@ endif() + if (NOT EMSCRIPTEN) + if (UNIX) + if (CMAKE_BUILD_TYPE STREQUAL Release) ++ elseif(0) + if (APPLE) + add_custom_command(TARGET basisu POST_BUILD COMMAND strip -X -x ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/basisu) + #message("strip command: strip -X -x ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/basisu") diff --git a/vcpkg/ports/basisu/vcpkg.json b/vcpkg/ports/basisu/vcpkg.json new file mode 100644 index 0000000..d5e5a4a --- /dev/null +++ b/vcpkg/ports/basisu/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "basisu", + "version": "1.60", + "description": "Basis Universal is a supercompressed GPU texture and video compression format that outputs a highly compressed intermediate file format (.basis) that can be quickly transcoded to a wide variety of GPU texture compression formats.", + "homepage": "https://github.com/BinomialLLC/basis_universal", + "license": null, + "supports": "(x86 | x64) & !android", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |