aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Pastor <dg0yt@darc.de>2021-07-23 18:02:46 +0200
committerGitHub <noreply@github.com>2021-07-23 09:02:46 -0700
commit635361d801244215606e992310b4203ea14a228e (patch)
tree8e5e27643166d3579e2e2240f3cd63d2fc1d1889
parentcdd51899f6ae3736bfbe936f9e387f86d4a63a58 (diff)
downloadvcpkg-635361d801244215606e992310b4203ea14a228e.tar.gz
vcpkg-635361d801244215606e992310b4203ea14a228e.zip
[giflib] Update to 5.2.1 (#18836)
* Update to 5.2.1 * Modernize portfile * Enable shared lib * Handle system reallocarray * x-add-version * Disable GifDrawBoxedText8x8 on windows * Update git-tree * Add separate patch for GifDrawBoxedText8x8 * Update git-tree
-rw-r--r--ports/giflib/CMakeLists.txt31
-rw-r--r--ports/giflib/CONTROL4
-rw-r--r--ports/giflib/disable-GifDrawBoxedText8x8-win32.patch36
-rw-r--r--ports/giflib/exports.def55
-rw-r--r--ports/giflib/fix-compile-error.patch31
-rw-r--r--ports/giflib/msvc-guard-unistd-h.patch48
-rw-r--r--ports/giflib/portfile.cmake27
-rw-r--r--ports/giflib/vcpkg.json12
-rw-r--r--versions/baseline.json2
-rw-r--r--versions/g-/giflib.json5
10 files changed, 165 insertions, 86 deletions
diff --git a/ports/giflib/CMakeLists.txt b/ports/giflib/CMakeLists.txt
index a5b084ffc..a5c69381a 100644
--- a/ports/giflib/CMakeLists.txt
+++ b/ports/giflib/CMakeLists.txt
@@ -2,23 +2,36 @@ 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
- lib/gif_lib.h
+ gif_lib.h
)
set(GIFLIB_SOURCES
- lib/dgif_lib.c
- lib/egif_lib.c
- lib/gif_err.c
- lib/gif_font.c
- lib/gif_hash.c
- lib/gifalloc.c
- lib/openbsd-reallocarray.c
- lib/quantize.c
+ 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)
diff --git a/ports/giflib/CONTROL b/ports/giflib/CONTROL
deleted file mode 100644
index 5361fc185..000000000
--- a/ports/giflib/CONTROL
+++ /dev/null
@@ -1,4 +0,0 @@
-Source: giflib
-Version: 5.1.4-6
-Homepage: https://sourceforge.net/projects/giflib/
-Description: A library for reading and writing gif images.
diff --git a/ports/giflib/disable-GifDrawBoxedText8x8-win32.patch b/ports/giflib/disable-GifDrawBoxedText8x8-win32.patch
new file mode 100644
index 000000000..095edb3ce
--- /dev/null
+++ b/ports/giflib/disable-GifDrawBoxedText8x8-win32.patch
@@ -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
+ }
diff --git a/ports/giflib/exports.def b/ports/giflib/exports.def
new file mode 100644
index 000000000..d38549373
--- /dev/null
+++ b/ports/giflib/exports.def
@@ -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
diff --git a/ports/giflib/fix-compile-error.patch b/ports/giflib/fix-compile-error.patch
index 93cf467ff..970b05576 100644
--- a/ports/giflib/fix-compile-error.patch
+++ b/ports/giflib/fix-compile-error.patch
@@ -1,8 +1,8 @@
-diff --git a/lib/dgif_lib.c b/lib/dgif_lib.c
-index fddc0d2..7a6ab9c 100644
---- a/lib/dgif_lib.c
-+++ b/lib/dgif_lib.c
-@@ -54,7 +54,7 @@ DGifOpenFileName(const char *FileName, int *Error)
+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;
@@ -11,7 +11,7 @@ index fddc0d2..7a6ab9c 100644
if (Error != NULL)
*Error = D_GIF_ERR_OPEN_FAILED;
return NULL;
-@@ -81,7 +81,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
+@@ -85,7 +85,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
if (GifFile == NULL) {
if (Error != NULL)
*Error = D_GIF_ERR_NOT_ENOUGH_MEM;
@@ -20,7 +20,7 @@ index fddc0d2..7a6ab9c 100644
return NULL;
}
-@@ -95,7 +95,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
+@@ -99,7 +99,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
if (Private == NULL) {
if (Error != NULL)
*Error = D_GIF_ERR_NOT_ENOUGH_MEM;
@@ -29,7 +29,7 @@ index fddc0d2..7a6ab9c 100644
free((char *)GifFile);
return NULL;
}
-@@ -106,7 +106,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
+@@ -110,7 +110,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
_setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
#endif /* _WIN32 */
@@ -38,11 +38,11 @@ index fddc0d2..7a6ab9c 100644
/*@-mustfreeonly@*/
GifFile->Private = (void *)Private;
-diff --git a/lib/egif_lib.c b/lib/egif_lib.c
-index f30b61b..18dc4a2 100644
---- a/lib/egif_lib.c
-+++ b/lib/egif_lib.c
-@@ -60,10 +60,10 @@ EGifOpenFileName(const char *FileName, const bool TestExistence, int *Error)
+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)
@@ -55,7 +55,7 @@ index f30b61b..18dc4a2 100644
S_IREAD | S_IWRITE);
if (FileHandle == -1) {
-@@ -73,7 +73,7 @@ EGifOpenFileName(const char *FileName, const bool TestExistence, int *Error)
+@@ -80,7 +80,7 @@ EGifOpenFileName(const char *FileName, const bool TestExistence, int *Error)
}
GifFile = EGifOpenFileHandle(FileHandle, Error);
if (GifFile == (GifFileType *) NULL)
@@ -64,7 +64,7 @@ index f30b61b..18dc4a2 100644
return GifFile;
}
-@@ -118,7 +118,7 @@ EGifOpenFileHandle(const int FileHandle, int *Error)
+@@ -125,7 +125,7 @@ EGifOpenFileHandle(const int FileHandle, int *Error)
_setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
#endif /* _WIN32 */
@@ -73,4 +73,3 @@ index f30b61b..18dc4a2 100644
GifFile->Private = (void *)Private;
Private->FileHandle = FileHandle;
-
diff --git a/ports/giflib/msvc-guard-unistd-h.patch b/ports/giflib/msvc-guard-unistd-h.patch
index 5140e6ee3..36cef4491 100644
--- a/ports/giflib/msvc-guard-unistd-h.patch
+++ b/ports/giflib/msvc-guard-unistd-h.patch
@@ -1,46 +1,8 @@
-diff -Naur a/lib/dgif_lib.c b/lib/dgif_lib.c
---- a/lib/dgif_lib.c 2016-04-02 21:34:00.000000000 +0600
-+++ b/lib/dgif_lib.c 2017-04-21 07:06:48.781271400 +0700
-@@ -12,7 +12,9 @@
- #include <limits.h>
- #include <stdint.h>
- #include <fcntl.h>
-+#ifndef _MSC_VER
- #include <unistd.h>
-+#endif
- #include <stdio.h>
- #include <string.h>
-
-diff -Naur a/lib/egif_lib.c b/lib/egif_lib.c
---- a/lib/egif_lib.c 2016-01-22 16:36:36.000000000 +0600
-+++ b/lib/egif_lib.c 2017-04-21 07:07:08.728159900 +0700
-@@ -8,7 +8,9 @@
-
- *****************************************************************************/
-
-+#ifndef _MSC_VER
- #include <unistd.h>
-+#endif
- #include <stdint.h>
- #include <stdlib.h>
- #include <stdio.h>
-diff -Naur a/lib/gif_hash.c b/lib/gif_hash.c
---- a/lib/gif_hash.c 2014-05-16 17:46:53.000000000 +0700
-+++ b/lib/gif_hash.c 2017-04-21 07:07:17.718719500 +0700
-@@ -11,7 +11,9 @@
-
- *****************************************************************************/
-
-+#ifndef _MSC_VER
- #include <unistd.h>
-+#endif
- #include <stdint.h>
- #include <stdlib.h>
- #include <fcntl.h>
-diff -Naur a/lib/gif_hash.h b/lib/gif_hash.h
---- a/lib/gif_hash.h 2014-05-16 17:46:53.000000000 +0700
-+++ b/lib/gif_hash.h 2017-04-21 07:07:32.316346800 +0700
-@@ -7,7 +7,9 @@
+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_
diff --git a/ports/giflib/portfile.cmake b/ports/giflib/portfile.cmake
index dfca62d51..8a58b690a 100644
--- a/ports/giflib/portfile.cmake
+++ b/ports/giflib/portfile.cmake
@@ -1,31 +1,32 @@
-vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
-
-set(GIFLIB_VERSION 5.1.4)
+set(GIFLIB_VERSION 5.2.1)
+set(EXTRA_PATCHES "")
if (VCPKG_TARGET_IS_WINDOWS)
- set(ADDITIONAL_PATCH "fix-compile-error.patch")
+ list(APPEND EXTRA_PATCHES fix-compile-error.patch)
endif()
vcpkg_from_sourceforge(
OUT_SOURCE_PATH SOURCE_PATH
REPO "giflib"
- FILENAME "giflib-${GIFLIB_VERSION}.tar.bz2"
- SHA512 32b5e342056c210e6478e9cb3b6ceec9594dcfaf34feea1eb4dad633a081ed4465bceee578c19165907cb47cb83912ac359ceea666a8e07dbbb5420f9928f96d
+ FILENAME "giflib-${GIFLIB_VERSION}.tar.gz"
+ SHA512 4550e53c21cb1191a4581e363fc9d0610da53f7898ca8320f0d3ef6711e76bdda2609c2df15dc94c45e28bff8de441f1227ec2da7ea827cb3c0405af4faa4736
PATCHES
msvc-guard-unistd-h.patch
- ${ADDITIONAL_PATCH}
+ disable-GifDrawBoxedText8x8-win32.patch # MSVC doesn't have strtok_r
+ ${EXTRA_PATCHES}
)
-file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
-vcpkg_configure_cmake(
- SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ "-DGIFLIB_EXPORTS=${CMAKE_CURRENT_LIST_DIR}/exports.def"
OPTIONS_DEBUG
-DGIFLIB_SKIP_HEADERS=ON
)
-vcpkg_install_cmake()
+vcpkg_cmake_install()
vcpkg_copy_pdbs()
-file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/giflib RENAME copyright)
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/ports/giflib/vcpkg.json b/ports/giflib/vcpkg.json
new file mode 100644
index 000000000..965fa663b
--- /dev/null
+++ b/ports/giflib/vcpkg.json
@@ -0,0 +1,12 @@
+{
+ "name": "giflib",
+ "version": "5.2.1",
+ "description": "A library for reading and writing gif images.",
+ "homepage": "https://sourceforge.net/projects/giflib/",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}
diff --git a/versions/baseline.json b/versions/baseline.json
index bf1dbe32a..8d56c4d02 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2285,7 +2285,7 @@
"port-version": 0
},
"giflib": {
- "baseline": "5.1.4-6",
+ "baseline": "5.2.1",
"port-version": 0
},
"ginkgo": {
diff --git a/versions/g-/giflib.json b/versions/g-/giflib.json
index 31565c99e..8c2fdd37c 100644
--- a/versions/g-/giflib.json
+++ b/versions/g-/giflib.json
@@ -1,6 +1,11 @@
{
"versions": [
{
+ "git-tree": "7cfc37d67d8662dd5fa5bf698a61ebbd657060cc",
+ "version": "5.2.1",
+ "port-version": 0
+ },
+ {
"git-tree": "053e7dd7e20392f9168d982e026a7fd71afbefe3",
"version-string": "5.1.4-6",
"port-version": 0