aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libgpg-error
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libgpg-error
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libgpg-error')
-rw-r--r--vcpkg/ports/libgpg-error/android.diff12
-rw-r--r--vcpkg/ports/libgpg-error/cross-tools.patch41
-rw-r--r--vcpkg/ports/libgpg-error/gpgrt-config.patch51
-rw-r--r--vcpkg/ports/libgpg-error/mingw.diff15
-rw-r--r--vcpkg/ports/libgpg-error/pkgconfig-libintl.patch11
-rw-r--r--vcpkg/ports/libgpg-error/portfile.cmake65
-rw-r--r--vcpkg/ports/libgpg-error/vcpkg.json33
-rw-r--r--vcpkg/ports/libgpg-error/win32-nls.diff25
8 files changed, 253 insertions, 0 deletions
diff --git a/vcpkg/ports/libgpg-error/android.diff b/vcpkg/ports/libgpg-error/android.diff
new file mode 100644
index 0000000..8138909
--- /dev/null
+++ b/vcpkg/ports/libgpg-error/android.diff
@@ -0,0 +1,12 @@
+diff --git a/configure.ac b/configure.ac
+index ce369af..95cbba2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -633,6 +633,7 @@ if test x"$gl_use_threads" = xno; then
+ AC_MSG_NOTICE([generated src/lock-obj-pub.native.h for $host])
+ elif test x$cross_compiling = xyes; then
+ case $host in
++ *-*-linux-android* | \
+ *-*-gnu* | *-*-linux-gnu* | *-*-linux-musl*)
+ AC_CHECK_TOOL(OBJDUMP, [objdump])
+ if test -n "$OBJDUMP"; then
diff --git a/vcpkg/ports/libgpg-error/cross-tools.patch b/vcpkg/ports/libgpg-error/cross-tools.patch
new file mode 100644
index 0000000..6919273
--- /dev/null
+++ b/vcpkg/ports/libgpg-error/cross-tools.patch
@@ -0,0 +1,41 @@
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 9a86251..00cc2fd 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -17,6 +17,12 @@
+ # License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ # SPDX-License-Identifier: LGPL-2.1+
+
++# Building host tools for native triplet, or not at all
++CPPFLAGS_FOR_BUILD = $(CPPFLAGS)
++CFLAGS_FOR_BUILD = $(CFLAGS)
++LDFLAGS_FOR_BUILD = $(LDFLAGS)
++# Using native tools, either this build or from host triplet
++HOST_TOOLS_PREFIX ?= .
+
+ #
+ # We distribute the generated sources err-sources.h and err-codes.h,
+@@ -261,8 +267,8 @@ mkerrcodes$(EXEEXT_FOR_BUILD): mkerrcodes.c mkerrcodes.h Makefile
+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+ $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c
+
+-code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile
+- ./mkerrcodes$(EXEEXT_FOR_BUILD) | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
++code-from-errno.h: $(HOST_TOOLS_PREFIX)/mkerrcodes$(EXEEXT_FOR_BUILD) Makefile
++ $(HOST_TOOLS_PREFIX)/mkerrcodes$(EXEEXT_FOR_BUILD) | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
+
+ errnos-sym.h: Makefile mkstrtable.awk errnos.in
+ $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
+@@ -306,10 +312,10 @@ endif
+
+ # We also depend on versioninfo.rc because that is build by
+ # config.status and thus has up-to-date version numbers.
+-gpg-error.h: Makefile mkheader$(EXEEXT_FOR_BUILD) $(parts_of_gpg_error_h) \
++gpg-error.h: Makefile $(HOST_TOOLS_PREFIX)/mkheader$(EXEEXT_FOR_BUILD) $(parts_of_gpg_error_h) \
+ versioninfo.rc ../config.h
+ $(pre_mkheader_cmds)
+- ./mkheader$(EXEEXT_FOR_BUILD) $(mkheader_opts) \
++ $(HOST_TOOLS_PREFIX)/mkheader$(EXEEXT_FOR_BUILD) $(mkheader_opts) \
+ $(host_triplet) $(srcdir)/gpg-error.h.in \
+ ../config.h $(PACKAGE_VERSION) $(VERSION_NUMBER) >$@
+
diff --git a/vcpkg/ports/libgpg-error/gpgrt-config.patch b/vcpkg/ports/libgpg-error/gpgrt-config.patch
new file mode 100644
index 0000000..926b88a
--- /dev/null
+++ b/vcpkg/ports/libgpg-error/gpgrt-config.patch
@@ -0,0 +1,51 @@
+diff --git a/src/gpgrt-config.in b/src/gpgrt-config.in
+index bada0f2..8c03a05 100644
+--- a/src/gpgrt-config.in
++++ b/src/gpgrt-config.in
+@@ -78,7 +78,7 @@ substitute_vars () {
+ esac
+ done
+
+- echo "$__result"
++ echo "$__result" | sed -e 's,",,g'
+ }
+
+ #
+@@ -132,7 +132,6 @@ EOF2
+ *:|*:\ ) ;;
+ *)
+ echo "Error reading $_filename: $_line" 1>&2
+- exit 1
+ ;;
+ esac
+ fi
+@@ -166,6 +165,7 @@ read_config_file () {
+ fi
+ exit 1
+ fi
++ VAR_pcfiledir="${RESULT%/*}" \
+ read_config_from_stdin $RESULT < $RESULT
+ }
+
+@@ -540,6 +540,11 @@ while test $# -gt 0; do
+ ;;
+ esac
+ done
++vcpkg_prefix=$(echo "$0" | sed -e 's,^\([a-zA-Z]\):/,/\1/,')
++case "$vcpkg_prefix" in
++*/tools/libgpg-error/debug/bin/gpgrt-config) libdir="${vcpkg_prefix%/*/*/*/*/*}/debug/lib" ;;
++*/tools/libgpg-error/bin/gpgrt-config) libdir="${vcpkg_prefix%/*/*/*/*}/lib" ;;
++esac
+
+ if env | grep '^PKG_CONFIG_LIBDIR=$' >/dev/null 2>&1; then
+ # The variable set as empty, we use PKG_CONFIG_PATH in this case,
+@@ -598,7 +603,8 @@ output=""
+
+ mt="no"
+
+-VAR_list=VAR_pc_sysrootdir
++VAR_list="VAR_pcfiledir VAR_pc_sysrootdir"
++VAR_pcfiledir=""
+ if [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
+ VAR_pc_sysrootdir="/"
+ else
diff --git a/vcpkg/ports/libgpg-error/mingw.diff b/vcpkg/ports/libgpg-error/mingw.diff
new file mode 100644
index 0000000..b1f25c8
--- /dev/null
+++ b/vcpkg/ports/libgpg-error/mingw.diff
@@ -0,0 +1,15 @@
+diff --git a/configure.ac b/configure.ac
+index 4de263a..9aa0f69 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -200,6 +200,10 @@ esac
+ AX_CC_FOR_BUILD
+
+ AH_BOTTOM([
++#if defined(__MINGW32__) && !defined(_WIN32_WINNT)
++#define _WIN32_WINNT 0x0600 /* for STARTUPINFOEX */
++#endif
++
+ /* Force using of NLS for W32 even if no libintl has been found. This is
+ okay because we have our own gettext implementation for W32. */
+ #if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS)
diff --git a/vcpkg/ports/libgpg-error/pkgconfig-libintl.patch b/vcpkg/ports/libgpg-error/pkgconfig-libintl.patch
new file mode 100644
index 0000000..6a95407
--- /dev/null
+++ b/vcpkg/ports/libgpg-error/pkgconfig-libintl.patch
@@ -0,0 +1,11 @@
+diff --git a/src/gpg-error.pc.in b/src/gpg-error.pc.in
+index 970bb6c..a51c9d3 100644
+--- a/src/gpg-error.pc.in
++++ b/src/gpg-error.pc.in
+@@ -11,5 +11,5 @@ Description: GPG Runtime
+ Version: @PACKAGE_VERSION@
+ Cflags: @GPG_ERROR_CONFIG_CFLAGS@
+ Libs: @GPG_ERROR_CONFIG_LIBS@
+-Libs.private: @GPG_ERROR_CONFIG_LIBS_PRIVATE@
++Libs.private: @GPG_ERROR_CONFIG_LIBS_PRIVATE@ @LIBINTL@
+ URL: https://www.gnupg.org/software/libgpg-error/index.html
diff --git a/vcpkg/ports/libgpg-error/portfile.cmake b/vcpkg/ports/libgpg-error/portfile.cmake
new file mode 100644
index 0000000..368513a
--- /dev/null
+++ b/vcpkg/ports/libgpg-error/portfile.cmake
@@ -0,0 +1,65 @@
+vcpkg_download_distfile(tarball
+ URLS
+ "https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-${VERSION}.tar.bz2"
+ "https://mirrors.dotsrc.org/gcrypt/libgpg-error/libgpg-error-${VERSION}.tar.bz2"
+ "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-${VERSION}.tar.bz2"
+ FILENAME "libgpg-error-${VERSION}.tar.bz2"
+ SHA512 d3f6ca9d9abefe81f5cbbc195fbe259d3362119018c535ad2621ee407cad3487011325a9f4c4a15442a9ac5a0fe7ce86dafd7b3d891a446516362ba6b7b9047b
+)
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${tarball}"
+ PATCHES
+ android.diff
+ cross-tools.patch
+ gpgrt-config.patch
+ mingw.diff
+ pkgconfig-libintl.patch
+ win32-nls.diff
+)
+
+vcpkg_list(SET options)
+if("nls" IN_LIST FEATURES)
+ vcpkg_list(APPEND options "--enable-nls")
+else()
+ set(ENV{AUTOPOINT} true) # true, the program
+ vcpkg_list(APPEND options "--disable-nls")
+endif()
+
+if(VCPKG_CROSSCOMPILING)
+ set(ENV{HOST_TOOLS_PREFIX} "${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}")
+endif()
+
+if(VCPKG_TARGET_IS_EMSCRIPTEN)
+ vcpkg_list(APPEND options "--disable-threads")
+endif()
+
+vcpkg_make_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTORECONF
+ OPTIONS
+ ${options}
+ --disable-doc
+ --disable-tests
+)
+
+vcpkg_make_install()
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+if(NOT VCPKG_CROSSCOMPILING)
+ file(INSTALL
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/mkerrcodes${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/mkheader${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}"
+ USE_SOURCE_PERMISSIONS
+ )
+ vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+if(NOT "nls" IN_LIST FEATURES)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/${PORT}/locale")
+endif()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.LIB")
diff --git a/vcpkg/ports/libgpg-error/vcpkg.json b/vcpkg/ports/libgpg-error/vcpkg.json
new file mode 100644
index 0000000..1cf57e7
--- /dev/null
+++ b/vcpkg/ports/libgpg-error/vcpkg.json
@@ -0,0 +1,33 @@
+{
+ "name": "libgpg-error",
+ "version": "1.55",
+ "description": "A runtime library for GnuPG and other software which likes to use it.",
+ "homepage": "https://gnupg.org/software/libgpg-error/",
+ "license": "LGPL-2.1-or-later",
+ "supports": "!windows | mingw",
+ "dependencies": [
+ {
+ "name": "libgpg-error",
+ "host": true
+ },
+ {
+ "name": "vcpkg-make",
+ "host": true
+ }
+ ],
+ "features": {
+ "nls": {
+ "description": "Enable native language support",
+ "dependencies": [
+ {
+ "name": "gettext",
+ "host": true,
+ "features": [
+ "tools"
+ ]
+ },
+ "gettext-libintl"
+ ]
+ }
+ }
+}
diff --git a/vcpkg/ports/libgpg-error/win32-nls.diff b/vcpkg/ports/libgpg-error/win32-nls.diff
new file mode 100644
index 0000000..82f6546
--- /dev/null
+++ b/vcpkg/ports/libgpg-error/win32-nls.diff
@@ -0,0 +1,25 @@
+diff --git a/Makefile.am b/Makefile.am
+index 0f07509..65e058a 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -105,6 +105,7 @@ gen-ChangeLog:
+
+ if HAVE_W32_SYSTEM
+ install-data-hook:
++install-data-hook-orig:
+ set -e; \
+ for i in $$(sed -e '/^#/d' -e 's/#.*//' $(top_srcdir)/po/LINGUAS); do \
+ $(MKDIR_P) "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES" || true; \
+diff --git a/configure.ac b/configure.ac
+index 9aa0f69..ce369af 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -207,7 +207,7 @@ AH_BOTTOM([
+ /* Force using of NLS for W32 even if no libintl has been found. This is
+ okay because we have our own gettext implementation for W32. */
+ #if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS)
+-#define ENABLE_NLS 1
++/* keep NLS controlled by libgpg-error[nls] */
+ #endif
+
+ /* Connect the generic estream-printf.c to our framework. */