aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/isal
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/isal')
-rw-r--r--vcpkg/ports/isal/isalConfig.cmake15
-rw-r--r--vcpkg/ports/isal/osx-asm-sysroot.patch32
-rw-r--r--vcpkg/ports/isal/portfile.cmake91
-rw-r--r--vcpkg/ports/isal/unofficial-isal-config.cmake18
-rw-r--r--vcpkg/ports/isal/usage4
-rw-r--r--vcpkg/ports/isal/vcpkg.json8
6 files changed, 168 insertions, 0 deletions
diff --git a/vcpkg/ports/isal/isalConfig.cmake b/vcpkg/ports/isal/isalConfig.cmake
new file mode 100644
index 0000000..78b47f2
--- /dev/null
+++ b/vcpkg/ports/isal/isalConfig.cmake
@@ -0,0 +1,15 @@
+message(WARNING "'find_package(isal CONFIG)' is deprecated. Please use 'find_package(unofficial-isal CONFIG)' instead.")
+
+include(CMakeFindDependencyMacro)
+find_dependency(unofficial-isal)
+if(NOT TARGET unofficial::isal::isal)
+ set(isal_FOUND FALSE)
+elseif(TARGET ISAL::isa-l OR TARGET ISAL::isal)
+ # done
+elseif ("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
+ add_library(ISAL::isa-l INTERFACE IMPORTED)
+ set_target_properties(ISAL::isa-l PROPERTIES INTERFACE_LINK_LIBRARIES unofficial::isal::isal)
+else()
+ add_library(ISAL::isal INTERFACE IMPORTED)
+ set_target_properties(ISAL::isal PROPERTIES INTERFACE_LINK_LIBRARIES unofficial::isal::isal)
+endif()
diff --git a/vcpkg/ports/isal/osx-asm-sysroot.patch b/vcpkg/ports/isal/osx-asm-sysroot.patch
new file mode 100644
index 0000000..ece55e8
--- /dev/null
+++ b/vcpkg/ports/isal/osx-asm-sysroot.patch
@@ -0,0 +1,32 @@
+diff --git a/tools/nasm-filter.sh b/tools/nasm-filter.sh
+index 5ec9ba3..fcc4971 100755
+--- a/tools/nasm-filter.sh
++++ b/tools/nasm-filter.sh
+@@ -15,6 +15,11 @@ while [ -n "$*" ]; do
+ shift
+ shift
+ ;;
++ -isysroot )
++ # Unsupported options with arg
++ shift
++ shift
++ ;;
+ --prefix* )
+ # Supported options without arg
+ options="$options $1"
+diff --git a/tools/yasm-filter.sh b/tools/yasm-filter.sh
+index c33952a..b99bfc3 100755
+--- a/tools/yasm-filter.sh
++++ b/tools/yasm-filter.sh
+@@ -10,6 +10,11 @@ while [ -n "$*" ]; do
+ shift
+ shift
+ ;;
++ -isysroot )
++ # Unsupported options with arg
++ shift
++ shift
++ ;;
+ -I* | -i* | --prefix* )
+ # Supported options without arg
+ options="$options $1"
diff --git a/vcpkg/ports/isal/portfile.cmake b/vcpkg/ports/isal/portfile.cmake
new file mode 100644
index 0000000..9a9a1ef
--- /dev/null
+++ b/vcpkg/ports/isal/portfile.cmake
@@ -0,0 +1,91 @@
+if(EXISTS "${CURRENT_INSTALLED_DIR}/share/spdk-isal/copyright")
+ message(FATAL_ERROR "'${PORT}' conflicts with 'spdk-isal'. Please remove spdk-isal:${TARGET_TRIPLET}, and try to install ${PORT}:${TARGET_TRIPLET} again.")
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO intel/isa-l
+ REF v2.30.0
+ SHA512 d3ecfb7326097534b06a74b584100336509525ae7cadc6112d0c27e3d8704f3810e18f583d3cc33fa266bfec96db023607622b22ddbf17988ec4bf1bb3b3b9b2
+ HEAD_REF master
+ PATCHES
+ osx-asm-sysroot.patch
+)
+
+if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ vcpkg_find_acquire_program(NASM)
+ get_filename_component(NASM_PATH "${NASM}" DIRECTORY)
+ vcpkg_add_to_path("${NASM_PATH}")
+endif()
+
+if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ set(NMAKE_TARGET dll)
+ else()
+ set(NMAKE_TARGET static)
+ endif()
+
+ vcpkg_build_nmake(
+ SOURCE_PATH "${SOURCE_PATH}"
+ PROJECT_NAME Makefile.nmake
+ TARGET ${NMAKE_TARGET}
+ OPTIONS
+ CFLAGS_REL=
+ )
+
+ if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ set(NMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
+ if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ file(INSTALL "${NMAKE_BINARY_DIR}/isa-l.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
+ file(INSTALL "${NMAKE_BINARY_DIR}/isa-l.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
+ else()
+ file(INSTALL "${NMAKE_BINARY_DIR}/isa-l_static.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
+ endif()
+ endif()
+
+ if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ set(NMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
+ if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ file(INSTALL "${NMAKE_BINARY_DIR}/isa-l.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
+ file(INSTALL "${NMAKE_BINARY_DIR}/isa-l.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+ else()
+ file(INSTALL "${NMAKE_BINARY_DIR}/isa-l_static.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+ endif()
+ endif()
+
+ file(GLOB ISAL_HDRS "${SOURCE_PATH}/include/*")
+ file(INSTALL ${ISAL_HDRS} DESTINATION "${CURRENT_PACKAGES_DIR}/include/isal")
+ file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/isa-l.def" DESTINATION "${CURRENT_PACKAGES_DIR}/include/isal")
+
+else()
+ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ vcpkg_find_acquire_program(YASM)
+ get_filename_component(YASM_PATH "${NASM}" DIRECTORY)
+ vcpkg_add_to_path("${YASM_PATH}")
+ endif()
+
+ vcpkg_list(SET options)
+ if(VCPKG_TARGET_IS_MINGW)
+ # There is only a .def file used by nmake, no declspec(...)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+ # isal forces yasm for mingw, but stumbles over feature level detection
+ vcpkg_list(APPEND options AS=)
+ endif()
+
+ vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${options}
+ # No rpl_malloc provided, and probably not depending on ‘malloc (0)’ returning a valid pointer
+ ac_cv_func_malloc_0_nonnull=yes
+ )
+ vcpkg_install_make()
+ vcpkg_fixup_pkgconfig()
+
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+endif()
+
+configure_file("${CMAKE_CURRENT_LIST_DIR}/unofficial-isal-config.cmake" "${CURRENT_PACKAGES_DIR}/share/unofficial-isal/unofficial-isal-config.cmake" @ONLY)
+configure_file("${CMAKE_CURRENT_LIST_DIR}/isalConfig.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/isalConfig.cmake" @ONLY) # legacy
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/isal/unofficial-isal-config.cmake b/vcpkg/ports/isal/unofficial-isal-config.cmake
new file mode 100644
index 0000000..6d38fe8
--- /dev/null
+++ b/vcpkg/ports/isal/unofficial-isal-config.cmake
@@ -0,0 +1,18 @@
+if(NOT TARGET unofficial::isal::isal)
+ add_library(unofficial::isal::isal UNKNOWN IMPORTED)
+ get_filename_component(z_vcpkg_isal_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
+ get_filename_component(z_vcpkg_isal_prefix "${z_vcpkg_isal_prefix}" PATH)
+ get_filename_component(z_vcpkg_isal_prefix "${z_vcpkg_isal_prefix}" PATH)
+ find_library(Z_VCPKG_ISAL_LIBRARY_RELEASE NAMES isal isa-l_static isa-l PATHS "${z_vcpkg_isal_prefix}/lib" NO_DEFAULT_PATH REQUIRED)
+ set_target_properties(unofficial::isal::isal PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${z_vcpkg_isal_prefix}/include"
+ IMPORTED_CONFIGURATIONS RELEASE
+ IMPORTED_LOCATION_RELEASE "${Z_VCPKG_ISAL_LIBRARY_RELEASE}"
+ )
+ if("@VCPKG_BUILD_TYPE@" STREQUAL "")
+ find_library(Z_VCPKG_ISAL_LIBRARY_DEBUG NAMES isal isa-l_static isa-l PATHS "${z_vcpkg_isal_prefix}/debug/lib" NO_DEFAULT_PATH REQUIRED)
+ set_property(TARGET unofficial::isal::isal APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(unofficial::isal::isal PROPERTIES IMPORTED_LOCATION_DEBUG "${Z_VCPKG_ISAL_LIBRARY_DEBUG}")
+ endif()
+ unset(z_vcpkg_isal_prefix)
+endif()
diff --git a/vcpkg/ports/isal/usage b/vcpkg/ports/isal/usage
new file mode 100644
index 0000000..1bcbccc
--- /dev/null
+++ b/vcpkg/ports/isal/usage
@@ -0,0 +1,4 @@
+The package isal provides CMake targets:
+
+ find_package(unofficial-isal CONFIG REQUIRED)
+ target_link_libraries(main unofficial::isal::isal)
diff --git a/vcpkg/ports/isal/vcpkg.json b/vcpkg/ports/isal/vcpkg.json
new file mode 100644
index 0000000..8052408
--- /dev/null
+++ b/vcpkg/ports/isal/vcpkg.json
@@ -0,0 +1,8 @@
+{
+ "name": "isal",
+ "version": "2.30.0",
+ "description": "Intel(R) Intelligent Storage Acceleration Library",
+ "homepage": "https://github.com/intel/isa-l",
+ "license": "BSD-3-Clause",
+ "supports": "!uwp & (x64 | (arm64 & linux))"
+}