early-access version 2853
This commit is contained in:
44
externals/vcpkg/ports/giflib/CMakeLists.txt
vendored
Executable file
44
externals/vcpkg/ports/giflib/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,44 @@
|
||||
cmake_minimum_required(VERSION 3.4)
|
||||
|
||||
project(giflib C)
|
||||
|
||||
set(GIFLIB_EXPORTS "NOTFOUND" CACHE FILEPATH "The path of the DEF file listing the DLL exports.")
|
||||
|
||||
set(GIFLIB_HEADERS
|
||||
gif_lib.h
|
||||
)
|
||||
|
||||
set(GIFLIB_SOURCES
|
||||
dgif_lib.c
|
||||
egif_lib.c
|
||||
gifalloc.c
|
||||
gif_err.c
|
||||
gif_font.c
|
||||
gif_hash.c
|
||||
openbsd-reallocarray.c
|
||||
)
|
||||
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
include(CheckSymbolExists)
|
||||
check_symbol_exists(reallocarray "stdlib.h" HAVE_REALLOCARRAY)
|
||||
if(HAVE_REALLOCARRAY)
|
||||
add_definitions(-DHAVE_REALLOCARRAY)
|
||||
endif()
|
||||
|
||||
add_library(gif ${GIFLIB_SOURCES})
|
||||
if(BUILD_SHARED_LIBS AND WIN32)
|
||||
target_sources(gif PRIVATE "${GIFLIB_EXPORTS}")
|
||||
else()
|
||||
set(UNUSED "${GIFLIB_EXPORTS}")
|
||||
endif()
|
||||
|
||||
if (NOT GIFLIB_SKIP_HEADERS)
|
||||
install(FILES ${GIFLIB_HEADERS} DESTINATION include)
|
||||
endif ()
|
||||
|
||||
install(TARGETS gif
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
36
externals/vcpkg/ports/giflib/disable-GifDrawBoxedText8x8-win32.patch
vendored
Executable file
36
externals/vcpkg/ports/giflib/disable-GifDrawBoxedText8x8-win32.patch
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
diff --git a/gif_font.c b/gif_font.c
|
||||
index d90783c..b682c7a 100644
|
||||
--- a/gif_font.c
|
||||
+++ b/gif_font.c
|
||||
@@ -204,6 +204,7 @@ GifDrawRectangle(SavedImage *Image,
|
||||
memset(bp + (i * Image->ImageDesc.Width), color, (size_t)w);
|
||||
}
|
||||
|
||||
+#if !defined(_WIN32)
|
||||
void
|
||||
GifDrawBoxedText8x8(SavedImage *Image,
|
||||
const int x, const int y,
|
||||
@@ -257,5 +258,6 @@ GifDrawBoxedText8x8(SavedImage *Image,
|
||||
border + LineCount * GIF_FONT_HEIGHT + border, fg);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
/* end */
|
||||
diff --git a/gif_lib.h b/gif_lib.h
|
||||
index ebdbd3c..41bf7a2 100644
|
||||
--- a/gif_lib.h
|
||||
+++ b/gif_lib.h
|
||||
@@ -290,10 +290,12 @@ extern void GifDrawRectangle(SavedImage *Image,
|
||||
const int x, const int y,
|
||||
const int w, const int d, const int color);
|
||||
|
||||
+#if !defined(_WIN32)
|
||||
extern void GifDrawBoxedText8x8(SavedImage *Image,
|
||||
const int x, const int y,
|
||||
const char *legend,
|
||||
const int border, const int bg, const int fg);
|
||||
+#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
55
externals/vcpkg/ports/giflib/exports.def
vendored
Executable file
55
externals/vcpkg/ports/giflib/exports.def
vendored
Executable file
@@ -0,0 +1,55 @@
|
||||
EXPORTS
|
||||
DGifCloseFile @1
|
||||
DGifExtensionToGCB @2
|
||||
DGifGetCode @3
|
||||
DGifGetCodeNext @4
|
||||
DGifGetExtension @5
|
||||
DGifGetExtensionNext @6
|
||||
DGifGetImageDesc @7
|
||||
DGifGetLZCodes @8
|
||||
DGifGetLine @9
|
||||
DGifGetPixel @10
|
||||
DGifGetRecordType @11
|
||||
DGifGetScreenDesc @12
|
||||
DGifOpen @13
|
||||
DGifOpenFileHandle @14
|
||||
DGifOpenFileName @15
|
||||
DGifSavedExtensionToGCB @16
|
||||
DGifSlurp @17
|
||||
EGifCloseFile @18
|
||||
EGifGCBToExtension @19
|
||||
EGifGCBToSavedExtension @20
|
||||
EGifGetGifVersion @21
|
||||
EGifOpen @22
|
||||
EGifOpenFileHandle @23
|
||||
EGifOpenFileName @24
|
||||
EGifPutCode @25
|
||||
EGifPutCodeNext @26
|
||||
EGifPutComment @27
|
||||
EGifPutExtension @28
|
||||
EGifPutExtensionBlock @29
|
||||
EGifPutExtensionLeader @30
|
||||
EGifPutExtensionTrailer @31
|
||||
EGifPutImageDesc @32
|
||||
EGifPutLine @33
|
||||
EGifPutPixel @34
|
||||
EGifPutScreenDesc @35
|
||||
EGifSetGifVersion @36
|
||||
EGifSpew @37
|
||||
FreeLastSavedImage @38
|
||||
GifAddExtensionBlock @39
|
||||
GifApplyTranslation @40
|
||||
GifAsciiTable8x8 @41 DATA
|
||||
GifBitSize @42
|
||||
GifDrawBox @43
|
||||
; needs strtok_r: GifDrawBoxedText8x8 @44
|
||||
GifDrawRectangle @45
|
||||
GifDrawText8x8 @46
|
||||
GifErrorString @47
|
||||
GifFreeExtensions @48
|
||||
GifFreeMapObject @49
|
||||
GifFreeSavedImages @50
|
||||
GifMakeMapObject @51
|
||||
GifMakeSavedImage @52
|
||||
GifUnionColorMap @53
|
||||
openbsd_reallocarray @54
|
||||
75
externals/vcpkg/ports/giflib/fix-compile-error.patch
vendored
Executable file
75
externals/vcpkg/ports/giflib/fix-compile-error.patch
vendored
Executable file
@@ -0,0 +1,75 @@
|
||||
diff --git a/dgif_lib.c b/dgif_lib.c
|
||||
index 82fc097..3bb302b 100644
|
||||
--- a/dgif_lib.c
|
||||
+++ b/dgif_lib.c
|
||||
@@ -58,7 +58,7 @@ DGifOpenFileName(const char *FileName, int *Error)
|
||||
int FileHandle;
|
||||
GifFileType *GifFile;
|
||||
|
||||
- if ((FileHandle = open(FileName, O_RDONLY)) == -1) {
|
||||
+ if ((FileHandle = _open(FileName, O_RDONLY)) == -1) {
|
||||
if (Error != NULL)
|
||||
*Error = D_GIF_ERR_OPEN_FAILED;
|
||||
return NULL;
|
||||
@@ -85,7 +85,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
|
||||
if (GifFile == NULL) {
|
||||
if (Error != NULL)
|
||||
*Error = D_GIF_ERR_NOT_ENOUGH_MEM;
|
||||
- (void)close(FileHandle);
|
||||
+ (void)_close(FileHandle);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
|
||||
if (Private == NULL) {
|
||||
if (Error != NULL)
|
||||
*Error = D_GIF_ERR_NOT_ENOUGH_MEM;
|
||||
- (void)close(FileHandle);
|
||||
+ (void)_close(FileHandle);
|
||||
free((char *)GifFile);
|
||||
return NULL;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
|
||||
_setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
- f = fdopen(FileHandle, "rb"); /* Make it into a stream: */
|
||||
+ f = _fdopen(FileHandle, "rb"); /* Make it into a stream: */
|
||||
|
||||
/*@-mustfreeonly@*/
|
||||
GifFile->Private = (void *)Private;
|
||||
diff --git a/egif_lib.c b/egif_lib.c
|
||||
index 6219af0..8ddda1b 100644
|
||||
--- a/egif_lib.c
|
||||
+++ b/egif_lib.c
|
||||
@@ -67,10 +67,10 @@ EGifOpenFileName(const char *FileName, const bool TestExistence, int *Error)
|
||||
GifFileType *GifFile;
|
||||
|
||||
if (TestExistence)
|
||||
- FileHandle = open(FileName, O_WRONLY | O_CREAT | O_EXCL,
|
||||
+ FileHandle = _open(FileName, O_WRONLY | O_CREAT | O_EXCL,
|
||||
S_IREAD | S_IWRITE);
|
||||
else
|
||||
- FileHandle = open(FileName, O_WRONLY | O_CREAT | O_TRUNC,
|
||||
+ FileHandle = _open(FileName, O_WRONLY | O_CREAT | O_TRUNC,
|
||||
S_IREAD | S_IWRITE);
|
||||
|
||||
if (FileHandle == -1) {
|
||||
@@ -80,7 +80,7 @@ EGifOpenFileName(const char *FileName, const bool TestExistence, int *Error)
|
||||
}
|
||||
GifFile = EGifOpenFileHandle(FileHandle, Error);
|
||||
if (GifFile == (GifFileType *) NULL)
|
||||
- (void)close(FileHandle);
|
||||
+ (void)_close(FileHandle);
|
||||
return GifFile;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ EGifOpenFileHandle(const int FileHandle, int *Error)
|
||||
_setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
- f = fdopen(FileHandle, "wb"); /* Make it into a stream: */
|
||||
+ f = _fdopen(FileHandle, "wb"); /* Make it into a stream: */
|
||||
|
||||
GifFile->Private = (void *)Private;
|
||||
Private->FileHandle = FileHandle;
|
||||
14
externals/vcpkg/ports/giflib/msvc-guard-unistd-h.patch
vendored
Executable file
14
externals/vcpkg/ports/giflib/msvc-guard-unistd-h.patch
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
diff --git a/gif_hash.h b/gif_hash.h
|
||||
index 6a1b585..e6712e8 100644
|
||||
--- a/gif_hash.h
|
||||
+++ b/gif_hash.h
|
||||
@@ -9,7 +9,9 @@ SPDX-License-Identifier: MIT
|
||||
#ifndef _GIF_HASH_H_
|
||||
#define _GIF_HASH_H_
|
||||
|
||||
+#ifndef _MSC_VER
|
||||
#include <unistd.h>
|
||||
+#endif
|
||||
#include <stdint.h>
|
||||
|
||||
#define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */
|
||||
32
externals/vcpkg/ports/giflib/portfile.cmake
vendored
Executable file
32
externals/vcpkg/ports/giflib/portfile.cmake
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
set(GIFLIB_VERSION 5.2.1)
|
||||
|
||||
set(EXTRA_PATCHES "")
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
list(APPEND EXTRA_PATCHES fix-compile-error.patch)
|
||||
endif()
|
||||
|
||||
vcpkg_from_sourceforge(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO "giflib"
|
||||
FILENAME "giflib-${GIFLIB_VERSION}.tar.gz"
|
||||
SHA512 4550e53c21cb1191a4581e363fc9d0610da53f7898ca8320f0d3ef6711e76bdda2609c2df15dc94c45e28bff8de441f1227ec2da7ea827cb3c0405af4faa4736
|
||||
PATCHES
|
||||
msvc-guard-unistd-h.patch
|
||||
disable-GifDrawBoxedText8x8-win32.patch # MSVC doesn't have strtok_r
|
||||
${EXTRA_PATCHES}
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
"-DGIFLIB_EXPORTS=${CMAKE_CURRENT_LIST_DIR}/exports.def"
|
||||
OPTIONS_DEBUG
|
||||
-DGIFLIB_SKIP_HEADERS=ON
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
14
externals/vcpkg/ports/giflib/vcpkg.json
vendored
Executable file
14
externals/vcpkg/ports/giflib/vcpkg.json
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "giflib",
|
||||
"version": "5.2.1",
|
||||
"port-version": 2,
|
||||
"description": "A library for reading and writing gif images.",
|
||||
"homepage": "https://sourceforge.net/projects/giflib/",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user