[graphicsmagick] Fix (#46839)

This commit is contained in:
Kai Pastor 2025-08-11 20:01:16 +02:00 committed by GitHub
parent d30fdf55cf
commit 8ffb41ffcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 340 additions and 234 deletions

View File

@ -0,0 +1,217 @@
diff --git a/configure.ac b/configure.ac
index bc9acc9..94449f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1876,12 +1876,12 @@ then
fi
AC_CHECK_HEADER([zconf.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([zlib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
- AC_CHECK_LIB([z],[compress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
- AC_CHECK_LIB([z],[uncompress],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
- AC_CHECK_LIB([z],[deflate],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
- AC_CHECK_LIB([z],[inflate],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
- AC_CHECK_LIB([z],[gzseek],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
- AC_CHECK_LIB([z],[gztell],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([compress],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([uncompress],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([deflate],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([inflate],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([gzseek],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([gztell],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if ZLIB package is complete])
if test $passed -gt 0
then
@@ -1895,8 +1895,7 @@ then
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
- LIB_ZLIB='-lz'
- pkg_config_to_flags 'zlib' "${LIB_ZLIB}" ''
+ LIB_ZLIB=''
AC_DEFINE([HasZLIB],[1],[Define if you have zlib compression library])
AC_MSG_RESULT([yes])
have_zlib='yes'
@@ -1922,8 +1921,10 @@ then
failed=0
passed=0
found_libbz=0
+ PKG_CHECK_MODULES([BZIP2], [bzip2], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
+ pkg_config_to_flags 'bzip2' "${BZIP2_LIBS}" "${BZIP2_CFLAGS}"
AC_CHECK_HEADER([bzlib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
- AC_CHECK_LIB([bz2],[BZ2_bzDecompress],[found_libbz=`expr $found_libbz + 1`],,)
+ AC_SEARCH_LIBS([BZ2_bzDecompress],[],[found_libbz=`expr $found_libbz + 1`],,)
if test "$native_win32_build" = 'yes'
then
# Under MinGW, libbz2 obfuscates its functions by declaring them
@@ -1931,7 +1932,7 @@ then
# somehow include bzlib.h during the test but Autoconf does not
# make that possible. We check for BZ2_decompress since that is
# one of the few functions exported from the DLL (very strange).
- AC_CHECK_LIB([bz2],[_imp__BZ2_decompress],[found_libbz=`expr $found_libbz + 1`],,)
+ :
fi
if test $found_libbz -gt 0
then
@@ -1950,8 +1951,7 @@ then
AC_MSG_RESULT([no -- some components failed test])
have_bzlib='no (failed tests)'
else
- LIB_BZLIB='-lbz2'
- LIBS="$LIB_BZLIB $LIBS"
+ LIB_BZLIB=''
AC_DEFINE([HasBZLIB],[1],[Define if you have the bzip2 library])
AC_MSG_RESULT([yes])
have_bzlib='yes'
@@ -2391,7 +2391,18 @@ then
if test "x${var}" = 'x' ; then
pnglib='png'
else
- pnglib="png1${var}"
+ case "${PNG_LIBS}" in
+ *-lpng1${var}d*)
+ pnglib="png1${var}d"
+ ;;
+ *-lpng1${var}*)
+ pnglib="png1${var}"
+ ;;
+ *)
+ # don't pick system lib
+ pnglib="NOT_IN_PC_FILE"
+ ;;
+ esac
fi
if test "$have_png" = 'no'
then
@@ -2457,8 +2468,7 @@ return 0;
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
- LIB_PNG="-l${pnglib}"
- pkg_config_to_flags 'libpng' "${LIB_PNG}" ''
+ LIB_PNG=''
#LIBS="$LIB_PNG $LIBS"
AC_DEFINE([HasPNG],[1],[Define if you have PNG library])
AC_MSG_RESULT([yes])
@@ -2515,7 +2525,7 @@ then
AC_CHECK_HEADER([jerror.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([jmorecfg.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([jpeglib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
- AC_CHECK_LIB([jpeg],[jpeg_read_header],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([jpeg_read_header],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if JPEG package is complete])
if test $passed -gt 0
then
@@ -2527,8 +2537,7 @@ then
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
- LIB_JPEG='-ljpeg'
- pkg_config_to_flags 'libjpeg' "${LIB_JPEG}" ''
+ LIB_JPEG=''
#LIBS="$LIB_JPEG $LIBS"
AC_DEFINE([HasJPEG],[1],[Define if you have JPEG library])
AC_MSG_RESULT([yes])
@@ -2624,7 +2633,7 @@ then
fi
dnl First see if there is a library
- AC_CHECK_LIB([freetype],[FT_Init_FreeType],[LIB_TTF="-lfreetype"],[LIB_TTF=''],[])
+ AC_SEARCH_LIBS([FT_Init_FreeType],[],[LIB_TTF="-lfreetype"],[LIB_TTF=''],[])
if test "$LIB_TTF" != ''
then
passed=`expr $passed + 1`
@@ -2665,7 +2674,7 @@ dnl Now test for the headers
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
- pkg_config_to_flags 'freetype2' "${LIB_TTF}" ''
+ LIB_TTF=''
#LIBS="$LIB_TTF $LIBS"
AC_DEFINE([HasTTF],[1],[Define if you have FreeType (TrueType font) library])
if test "$ac_cv_header_ft2build_h" = 'yes'
@@ -2718,7 +2727,6 @@ then
printf "WEBPMUX_LIBS=${WEBPMUX_LIBS}\n"
printf "WEBPMUX_CFLAGS=${WEBPMUX_CFLAGS}\n"
fi
- pkg_config_to_flags 'libwebpmux' "${WEBPMUX_LIBS}" "${WEBPMUX_CFLAGS}"
else
if test -n "${WEBPMUX_PKG_ERRORS}"
then
@@ -2742,7 +2750,7 @@ then
# pkg-config libwebp --static --libs
#-L/work/lib -lwebp -lm -lsharpyuv -lm
- PKG_CHECK_MODULES([WEBP], [libwebp], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
+ PKG_CHECK_MODULES([WEBP], [libwebp libwebpmux], [passed=`expr $passed + 1`], [failed=`expr $failed + 1`])
if test $failed -eq 0 ; then
if test -n "$VERBOSE"
then
@@ -2760,9 +2768,9 @@ then
AC_CHECK_HEADER([webp/decode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
AC_CHECK_HEADER([webp/encode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
- AC_CHECK_LIB([webp],[WebPDecodeRGB],[passed=`expr $passed + 1`; LIB_WEBP='-lwebp'],[failed=`expr $failed + 1`],[])
- AC_CHECK_LIB([webpmux],[WebPMuxSetImage],[LIB_WEBP="$LIB_WEBP -lwebpmux"],[],[-lwebp])
- AC_CHECK_LIB([sharpyuv],[SharpYuvConvert],[LIB_WEBP="$LIB_WEBP -lsharpyuv"],[],[])
+ AC_SEARCH_LIBS([WebPDecodeRGB],[],[passed=`expr $passed + 1`; LIB_WEBP='-lwebp'],[failed=`expr $failed + 1`],[])
+ AC_SEARCH_LIBS([WebPMuxSetImage],[],[LIB_WEBP="$LIB_WEBP -lwebpmux"],[],[])
+ AC_SEARCH_LIBS([SharpYuvConvert],[],[LIB_WEBP="$LIB_WEBP -lsharpyuv"],[],[])
AC_MSG_CHECKING([if WEBP package is complete])
if test $passed -gt 0
then
@@ -2774,7 +2782,7 @@ then
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
- pkg_config_to_flags 'libwebp' "${LIB_WEBP}" ''
+ LIB_WEBP=''
# LIBS="$LIB_WEBP $LIBS"
AC_DEFINE([HasWEBP],[1],[Define if you have WEBP library])
AC_MSG_RESULT([yes])
@@ -2918,11 +2926,11 @@ then
#set +x
AC_CHECK_HEADER([tiff.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_HEADER([tiffio.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
- AC_CHECK_LIB([tiff],[TIFFOpen],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
- AC_CHECK_LIB([tiff],[TIFFClientOpen],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
- AC_CHECK_LIB([tiff],[TIFFIsByteSwapped],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
- AC_CHECK_LIB([tiff],[TIFFReadRGBATile],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
- AC_CHECK_LIB([tiff],[TIFFReadRGBAStrip],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([TIFFOpen],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([TIFFClientOpen],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([TIFFIsByteSwapped],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([TIFFReadRGBATile],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
+ AC_SEARCH_LIBS([TIFFReadRGBAStrip],[],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
AC_MSG_CHECKING([if TIFF package is complete])
if test $passed -gt 0
then
@@ -2934,8 +2942,7 @@ then
CPPFLAGS=$OLD_CPPFLAGS
LIBS=$OLD_LIBS
else
- LIB_TIFF='-ltiff'
- pkg_config_to_flags 'libtiff-4' "${LIB_TIFF}" ''
+ LIB_TIFF=''
#LIBS="$LIB_TIFF $LIBS"
AC_DEFINE([HasTIFF],[1],[Define if you have TIFF library])
AC_MSG_RESULT([yes])
@@ -4266,7 +4273,7 @@ MAGICK_EXTRA_DEP_LIBS=`echo $MAGICK_EXTRA_DEP_LIBS | sed -e 's/ */ /g'`
MAGICK_API_CFLAGS=$CFLAGS
MAGICK_API_CPPFLAGS=`echo $MAGICK_API_CPPFLAGS | sed -e 's/ */ /g'`
-MAGICK_API_LDFLAGS="-L$LIB_DIR $LDFLAGS"
+MAGICK_API_LDFLAGS="-L$LIB_DIR"
MAGICK_API_DEP_LIBS="$MAGICK_DEP_LIBS"
MAGICK_API_LIBS="-lGraphicsMagick $MAGICK_API_DEP_LIBS $MAGICK_EXTRA_DEP_LIBS"
diff --git a/magick/GraphicsMagick.pc.in b/magick/GraphicsMagick.pc.in
index e968715..6b7c404 100644
--- a/magick/GraphicsMagick.pc.in
+++ b/magick/GraphicsMagick.pc.in
@@ -9,5 +9,5 @@ Version: @PACKAGE_VERSION@
Description: GraphicsMagick image processing library
URL: http://www.graphicsmagick.org/
Libs: -L${libdir} -lGraphicsMagick
-Libs.private: @LDFLAGS@ @MAGICK_API_DEP_LIBS@ @MAGICK_EXTRA_DEP_LIBS@
+Libs.private: @MAGICK_API_DEP_LIBS@ @MAGICK_EXTRA_DEP_LIBS@
Cflags: -I${includedir} @MAGICK_API_PC_CPPFLAGS@

View File

@ -1,13 +0,0 @@
diff --git a/magick/nt_base.h b/magick/nt_base.h
index 964695960..dca2ee89b 100644
--- a/magick/nt_base.h
+++ b/magick/nt_base.h
@@ -375,7 +375,7 @@ extern MagickExport const GhostscriptVectors
/*
Directory access functions
*/
-#if !defined(HAVE_DIRENT_H) || defined(__MINGW32__) || defined(__MINGW64__)
+#if !defined(HAVE_DIRENT_H) || defined(__MINGW32__) || defined(__MINGW64__) || defined(WIN32)
struct dirent
{
char

View File

@ -1,16 +0,0 @@
--- a/magick/studio.h 2019-12-24 13:18:50.000000000 -0200
+++ b/magick/studio.h 2020-01-08 20:43:08.325889700 -0200
@@ -470,10 +470,10 @@
*/
#if defined(HasLTDL)
-# define SupportMagickModules
+//# define SupportMagickModules
#elif !defined(__MINGW32__) && !defined(__MINGW64__)
# if defined(MSWINDOWS) && defined(_DLL)
-# define SupportMagickModules
+//# define SupportMagickModules
# endif
#endif

View File

@ -1,20 +0,0 @@
From: Josue Andrade Gomes <josuegomes@gmail.com>
Date: Tue, 18 Apr 2017 09:56:53 -0300
Subject: [PATCH] dynamic bzip2 only if dynamic gm
---
diff -ur a/magick/nt_base.h b/magick/nt_base.h
--- a/magick/nt_base.h Mon May 30 14:19:55 2016
+++ b/magick/nt_base.h Mon Apr 17 15:10:01 2017
@@ -275,7 +275,9 @@
*/
#if defined(HasBZLIB)
# if defined(_WIN32)
-# define BZ_IMPORT 1
+# if defined(_DLL) // For vcpkg. Building GM DLL requires BZIP2 DLL too, otherwise static
+# define BZ_IMPORT 1
+# endif
# endif
#endif /* defined(HasBZLIB) */

View File

@ -1,15 +0,0 @@
diff --git a/configure.ac b/configure.ac
index bc9acc914..d267d2b57 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2457,8 +2457,8 @@ return 0;
LDFLAGS=$OLD_LDFLAGS
LIBS=$OLD_LIBS
else
- LIB_PNG="-l${pnglib}"
- pkg_config_to_flags 'libpng' "${LIB_PNG}" ''
+ # LIB_PNG="-l${pnglib}"
+ # pkg_config_to_flags 'libpng' "${LIB_PNG}" ''
#LIBS="$LIB_PNG $LIBS"
AC_DEFINE([HasPNG],[1],[Define if you have PNG library])
AC_MSG_RESULT([yes])

View File

@ -0,0 +1,13 @@
diff --git a/magick/magick_types.h.in b/magick/magick_types.h.in
index 106ac97..a9f8a9a 100644
--- a/magick/magick_types.h.in
+++ b/magick/magick_types.h.in
@@ -108,8 +108,6 @@ extern "C" {
# define MAGICK_SIZE_T unsigned long
# define MAGICK_SSIZE_T_F ""
# define MAGICK_SSIZE_T int
- typedef long magick_ptrdiff_t
- typedef unsigned long magick_uintptr_t;
# endif // defined(WIN64)
#endif /* if defined(MAGICK_IMPLEMENTATION) */

View File

@ -1,133 +0,0 @@
/*
Copyright (C) 2003 - 2012 GraphicsMagick Group
This program is covered by multiple licenses, which are described in
Copyright.txt. You should have received a copy of Copyright.txt with this
package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.
GraphicsMagick types typedefs.
GraphicsMagick is expected to compile with any C '89 ANSI C compiler
supporting at least 16-bit 'short', 32-bit 'int', and 32-bit 'long'.
It is also expected to take advantage of 64-bit LP64 and Windows
WIN64 LLP64. We use C '99 style types but declare our own types so
as to not depend on C '99 header files, and take care to depend only
on C '89 library functions, POSIX, or well-known extensions. Any C
'99 syntax used is removed if the compiler does not support it.
*/
#ifndef _MAGICK_TYPES_H
#define _MAGICK_TYPES_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/*
Assign ANSI C stdint.h-like typedefs based on the sizes of native types
magick_int8_t -- -128 to 127
magick_uint8_t -- 0 to 255
magick_int16_t -- -32,768 to 32,767
magick_uint16_t -- 0 to 65,535
magick_int32_t -- -2,147,483,648 to 2,147,483,647
magick_uint32_t -- 0 to 4,294,967,295
magick_int64_t -- -9,223,372,036,854,775,807 to 9,223,372,036,854,775,807
magick_uint64_t -- 0 to 18,446,744,073,709,551,615
magick_uintmax_t -- largest native unsigned integer type ("%ju")
0 to UINTMAX_MAX
UINTMAX_C(value) declares constant value
magick_uintptr_t -- unsigned type for storing a pointer value ("%tu")
0 to UINTPTR_MAX
ANSI C '99 stddef.h-like types
size_t -- unsigned type representing sizes of objects ("%zu")
0 to SIZE_MAX
magick_ptrdiff_t -- signed type for subtracting two pointers ("%td")
PTRDIFF_MIN to PTRDIFF_MAX
EEE Std 1003.1, 2004 types
ssize_t -- signed type for a count of bytes or an error indication ("%zd")
? to SSIZE_MAX
*/
#if (defined(WIN32) || defined(WIN64)) && \
!defined(__MINGW32__) && !defined(__MINGW64__)
/* The following typedefs are used for WIN32 & WIN64 (without
configure) */
typedef signed char magick_int8_t;
typedef unsigned char magick_uint8_t;
typedef signed short magick_int16_t;
typedef unsigned short magick_uint16_t;
typedef signed int magick_int32_t;
# define MAGICK_INT32_F ""
typedef unsigned int magick_uint32_t;
# define MAGICK_UINT32_F ""
typedef signed __int64 magick_int64_t;
# define MAGICK_INT64_F "I64"
typedef unsigned __int64 magick_uint64_t;
# define MAGICK_UINT64_F "I64"
typedef magick_uint64_t magick_uintmax_t;
# if defined(WIN32)
typedef unsigned long magick_uintptr_t;
# define MAGICK_SIZE_T_F "l"
# define MAGICK_SIZE_T unsigned long
# define MAGICK_SSIZE_T_F "l"
# define MAGICK_SSIZE_T long
# elif defined(WIN64)
/* WIN64 uses the LLP64 model */
typedef unsigned long long magick_uintptr_t;
# define MAGICK_SIZE_T_F "I64"
# define MAGICK_SIZE_T unsigned __int64
# define MAGICK_SSIZE_T_F "I64"
# define MAGICK_SSIZE_T signed __int64
# endif
#else
/* The following typedefs are subtituted when using Unixish configure */
typedef signed char magick_int8_t;
typedef unsigned char magick_uint8_t;
typedef signed short magick_int16_t;
typedef unsigned short magick_uint16_t;
typedef signed int magick_int32_t;
# define MAGICK_INT32_F ""
typedef unsigned int magick_uint32_t;
# define MAGICK_UINT32_F ""
typedef signed long magick_int64_t;
# define MAGICK_INT64_F "l"
typedef unsigned long magick_uint64_t;
# define MAGICK_UINT64_F "l"
typedef unsigned long magick_uintmax_t;
# define MAGICK_UINTMAX_F "l"
typedef unsigned long magick_uintptr_t;
# define MAGICK_UINTPTR_F "l"
# define MAGICK_SIZE_T_F "l"
# define MAGICK_SIZE_T unsigned long
# define MAGICK_SSIZE_T_F "l"
# define MAGICK_SSIZE_T signed long
#endif
/* 64-bit file and blob offset type */
typedef magick_int64_t magick_off_t;
#define MAGICK_OFF_F MAGICK_INT64_F
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif /* defined(__cplusplus) || defined(c_plusplus) */
#endif /* _MAGICK_TYPES_H */

View File

@ -7,59 +7,63 @@ vcpkg_from_gitlab(
REF ${graphicsmagick_version}
SHA512 e64842dbbe2026e7d75b4004f615f32b4e2d57ce8dbd9bc90f87ee6e180d7e2feb61da6c25d404c43ac8d7661f94f7be3bd2882928dbd0e276b5c9040690f6f4
PATCHES
# GM always requires a dynamic BZIP2. This patch makes this dependent if _DLL is defined
dynamic_bzip2.patch
# Bake GM's own modules into the .dll itself. This fixes a bug whereby
# 'vcpkg install graphicsmagick' did not lead to a copy of GM that could
# load either PNG or JPEG files (due to missing GM Modules, with names
# matching "IM_*.DLL").
disable_graphicsmagick_modules.patch
fix-png.patch
dirnet.patch
dependencies.diff
magick-types.diff
)
configure_file ("${CMAKE_CURRENT_LIST_DIR}/magick_types.h" "${SOURCE_PATH}/magick/magick_types.h.in" COPYONLY)
set(options "")
if(VCPKG_TARGET_IS_WINDOWS)
set(options ac_cv_header_dirent_dirent_h=no)
endif()
vcpkg_make_configure(
SOURCE_PATH "${SOURCE_PATH}"
AUTORECONF
OPTIONS
VERBOSE=yes
${options}
# Before enabling another lib, make sure that the build does not
# hard-code the library name and dependencies (cf. dependencies.diff).
--with-heif=no
--with-fpx=no ###
--with-gs=no
--with-jbig=no
--with-jp2=no
--with-jxl=no
--with-lcms2=no
--with-libzip=no
--with-lzma=no
--with-modules=no
--with-mpeg2=no
--with-trio=no
--with-x=no
--with-xml=no
--with-wmf=no
--with-zstd=no
)
vcpkg_make_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
# copy config
file(COPY "${SOURCE_PATH}/config/colors.mgk" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/config")
file(COPY "${SOURCE_PATH}/config/log.mgk" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/config")
file(COPY "${SOURCE_PATH}/config/modules.mgk" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/config")
file(REMOVE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/gm${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
file(READ "${SOURCE_PATH}/config/type-windows.mgk.in" TYPE_MGK)
string(REPLACE "@windows_font_dir@" "$ENV{SYSTEMROOT}/Fonts/" TYPE_MGK "${TYPE_MGK}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/graphicsmagick/config/type.mgk" "${TYPE_MGK}")
configure_file("${SOURCE_PATH}/config/delegates.mgk.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/config/delegates.mgk" @ONLY)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
set(FILE_LIST
"GraphicsMagick++-config"
"GraphicsMagick-config"
"GraphicsMagickWand-config"
set(config_scripts
"GraphicsMagick++-config"
"GraphicsMagick-config"
"GraphicsMagickWand-config"
)
foreach(filename ${FILE_LIST})
string(REGEX REPLACE "^([A-Za-z]):/" "/\\1/" literal_prefix "${CURRENT_INSTALLED_DIR}")
foreach(filename IN LISTS config_scripts)
set(file "${CURRENT_PACKAGES_DIR}/tools/graphicsmagick/bin/${filename}")
vcpkg_replace_string("${file}" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../.." IGNORE_UNCHANGED)
vcpkg_replace_string("${file}" "${literal_prefix}" "'\"\${prefix}\"'")
vcpkg_replace_string("${file}" "while test" "prefix=$(CDPATH= cd -- \"$(dirname -- \"$0\")/../../..\" && pwd -P)\n\nwhile test")
if(NOT VCPKG_BUILD_TYPE)
set(debug_file "${CURRENT_PACKAGES_DIR}/tools/graphicsmagick/debug/bin/${filename}")
vcpkg_replace_string("${debug_file}" "${CURRENT_INSTALLED_DIR}/debug" "`dirname $0`/../../../../debug" IGNORE_UNCHANGED)
vcpkg_replace_string("${debug_file}" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../../../debug" IGNORE_UNCHANGED)
vcpkg_replace_string("${debug_file}" "${literal_prefix}" "'\"\${prefix}\"'")
vcpkg_replace_string("${debug_file}" "while test" "prefix=$(CDPATH= cd -- \"$(dirname -- \"$0\")/../../../..\" && pwd -P)\n\nwhile test")
endif()
endforeach()
# copy license
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/Copyright.txt")

View File

@ -1,12 +1,16 @@
{
"name": "graphicsmagick",
"version": "1.3.45",
"port-version": 1,
"description": "Image processing library",
"homepage": "http://www.graphicsmagick.org/",
"license": "MIT",
"dependencies": [
"bzip2",
"freetype",
{
"name": "freetype",
"default-features": false
},
"libjpeg-turbo",
"libpng",
"libwebp",

View File

@ -0,0 +1,14 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
vcpkg_find_acquire_program(PKGCONFIG)
vcpkg_cmake_configure(
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
OPTIONS
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
OPTIONS_RELEASE
"-DGM_CONFIG=${CURRENT_INSTALLED_DIR}/tools/graphicsmagick/bin/GraphicsMagick-config"
OPTIONS_DEBUG
"-DGM_CONFIG=${CURRENT_INSTALLED_DIR}/tools/graphicsmagick/debug/bin/GraphicsMagick-config"
)
vcpkg_cmake_build()

View File

@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.30)
project(graphicsmagick-test C)
find_package(PkgConfig REQUIRED)
pkg_check_modules(graphicsmagick_pc GraphicsMagick REQUIRED IMPORTED_TARGET)
add_executable(main-pkgconfig main.c)
target_link_libraries(main-pkgconfig PRIVATE PkgConfig::graphicsmagick_pc)
find_program(GM_CONFIG NAMES GraphicsMagick-config REQUIRED)
if(NOT CMAKE_HOST_WIN32)
execute_process(COMMAND "${GM_CONFIG}" --cppflags --cflags OUTPUT_VARIABLE gm-config-cflags OUTPUT_STRIP_TRAILING_WHITESPACE)
separate_arguments(gm-config-cflags UNIX_COMMAND "${gm-config-cflags}")
execute_process(COMMAND "${GM_CONFIG}" --ldflags --libs OUTPUT_VARIABLE gm-config-libs OUTPUT_STRIP_TRAILING_WHITESPACE)
separate_arguments(gm-config-libs UNIX_COMMAND "${gm-config-libs}")
string(REGEX REPLACE "(^-|;-)framework;" "\\1framework " gm-config-libs "${gm-config-libs}")
add_executable(main-gm-config main.c)
target_compile_options(main-gm-config PRIVATE ${gm-config-cflags})
target_link_libraries(main-gm-config PRIVATE ${gm-config-libs})
endif()

View File

@ -0,0 +1,8 @@
#include <magick/api.h>
int main()
{
InitializeMagick(NULL);
DestroyMagick();
return 0;
}

View File

@ -0,0 +1,17 @@
{
"name": "vcpkg-ci-graphicsmagick",
"version-string": "ci",
"description": "Port to force features of certain ports within CI",
"homepage": "https://github.com/microsoft/vcpkg",
"license": "MIT",
"dependencies": [
{
"name": "graphicsmagick",
"default-features": false
},
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -3410,7 +3410,7 @@
},
"graphicsmagick": {
"baseline": "1.3.45",
"port-version": 0
"port-version": 1
},
"graphite2": {
"baseline": "1.3.14",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b20dba25b2bef81317c206bdb2f3015831712041",
"version": "1.3.45",
"port-version": 1
},
{
"git-tree": "21002a0b08502cf2620c0a5544b0a9ba4c6ece9a",
"version": "1.3.45",