mirror of https://github.com/microsoft/vcpkg.git
[libnsgif]: add new port (#53204)
This commit is contained in:
parent
0a71ccaab8
commit
9db9ee4daf
|
|
@ -0,0 +1,34 @@
|
|||
cmake_minimum_required(VERSION 3.15)
|
||||
project(libnsgif VERSION 1.0.0 LANGUAGES C)
|
||||
|
||||
add_library(nsgif src/gif.c src/lzw.c)
|
||||
|
||||
target_compile_definitions(nsgif PRIVATE NSGIF_NAME=nsgif NSGIF_VERSION=1.0.0)
|
||||
target_include_directories(nsgif PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
|
||||
"$<INSTALL_INTERFACE:include>")
|
||||
|
||||
install(TARGETS nsgif
|
||||
EXPORT nsgif_targets
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
install(FILES include/nsgif.h DESTINATION include)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
set(PACKAGE_CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-libnsgif-config.cmake")
|
||||
set(INSTALL_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-libnsgif")
|
||||
|
||||
configure_package_config_file(unofficial-libnsgif-config.cmake.in
|
||||
"${PACKAGE_CONFIG_FILE}"
|
||||
INSTALL_DESTINATION "${INSTALL_CONFIG_DIR}"
|
||||
)
|
||||
|
||||
install(EXPORT nsgif_targets
|
||||
NAMESPACE unofficial::libnsgif::
|
||||
FILE unofficial-libnsgif-targets.cmake
|
||||
DESTINATION "${INSTALL_CONFIG_DIR}"
|
||||
)
|
||||
|
||||
install(FILES "${PACKAGE_CONFIG_FILE}" DESTINATION "${INSTALL_CONFIG_DIR}")
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
diff --git a/include/nsgif.h b/include/nsgif.h
|
||||
index 9c9e13d..1b72c18 100644
|
||||
--- a/include/nsgif.h
|
||||
+++ b/include/nsgif.h
|
||||
@@ -16,6 +16,7 @@
|
||||
#ifndef NSNSGIF_H
|
||||
#define NSNSGIF_H
|
||||
|
||||
+#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO netsurf-browser/libnsgif
|
||||
REF release/1.0.0
|
||||
SHA512 66f89247de14d8b2a0d53acea3114aec861a08e589a8431b18f707b4b41b5e6b2b4bcc47a7bd4028a6f10174fd037adf7707b2cad524c21c62fa88b103306d77
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
add-stddef-include.patch
|
||||
)
|
||||
|
||||
file(COPY
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/unofficial-libnsgif-config.cmake.in"
|
||||
DESTINATION "${SOURCE_PATH}"
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libnsgif CONFIG_PATH lib/cmake/unofficial-libnsgif)
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
@PACKAGE_INIT@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-libnsgif-targets.cmake")
|
||||
check_required_components("nsgif")
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "libnsgif",
|
||||
"version": "1.0.0",
|
||||
"description": "GIF image decompression library written in C",
|
||||
"homepage": "https://www.netsurf-browser.org/projects/libnsgif/",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
|
||||
)
|
||||
vcpkg_cmake_build()
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.22)
|
||||
project(libnsgif-test LANGUAGES C)
|
||||
find_package(unofficial-libnsgif CONFIG REQUIRED)
|
||||
add_executable(main main.c)
|
||||
target_link_libraries(main PRIVATE unofficial::libnsgif::nsgif)
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
#include <nsgif.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
const nsgif_bitmap_cb_vt bitmap_vt = { 0 };
|
||||
nsgif_t *gif = NULL;
|
||||
const nsgif_error err = nsgif_create(&bitmap_vt, NSGIF_BITMAP_FMT_R8G8B8A8, &gif);
|
||||
if (err != NSGIF_OK) {
|
||||
return 1;
|
||||
}
|
||||
nsgif_destroy(gif);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"name": "vcpkg-ci-libnsgif",
|
||||
"version-string": "ci",
|
||||
"description": "Validates libnsgif",
|
||||
"dependencies": [
|
||||
"libnsgif",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -5428,6 +5428,10 @@
|
|||
"baseline": "0.8.8",
|
||||
"port-version": 0
|
||||
},
|
||||
"libnsgif": {
|
||||
"baseline": "1.0.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"libobfuscate": {
|
||||
"baseline": "2024-07-10",
|
||||
"port-version": 0
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "e4f72b099011b39e92fc6162483745b54ac293bd",
|
||||
"version": "1.0.0",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue