diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libunistring | |
Diffstat (limited to 'vcpkg/ports/libunistring')
| -rw-r--r-- | vcpkg/ports/libunistring/copyright | 18 | ||||
| -rw-r--r-- | vcpkg/ports/libunistring/disable-gnulib-fetch.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/libunistring/disable-subdirs.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/libunistring/msvc-use-stdint.patch | 11 | ||||
| -rw-r--r-- | vcpkg/ports/libunistring/parallelize-symbol-collection.patch | 46 | ||||
| -rw-r--r-- | vcpkg/ports/libunistring/portfile.cmake | 57 | ||||
| -rw-r--r-- | vcpkg/ports/libunistring/vcpkg.json | 12 |
7 files changed, 169 insertions, 0 deletions
diff --git a/vcpkg/ports/libunistring/copyright b/vcpkg/ports/libunistring/copyright new file mode 100644 index 0000000..6bab2fe --- /dev/null +++ b/vcpkg/ports/libunistring/copyright @@ -0,0 +1,18 @@ +The libunistring library and its header files are dual-licensed under +"the GNU LGPLv3+ or the GNU GPLv2". This means, you can use it under either + - the terms of the GNU Lesser General Public License (LGPL) version 3 or + (at your option) any later version, or + - the terms of the GNU General Public License (GPL) version 2, or + - the same dual license "the GNU LGPLv3+ or the GNU GPLv2". + +You find the GNU LGPL version 3 in the file COPYING.LIB. This license is +based on the GNU GPL version 3, see file COPYING. + +You can find the GNU GPL version 2 at +<https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>. + +Note: This dual license makes it possible for the libunistring library +to be used by packages under GPLv2 or GPLv2+ licenses, in particular. See +the table in <https://www.gnu.org/licenses/gpl-faq.html#AllCompatibility>. + +The documentation is under another license; see in the documentation. diff --git a/vcpkg/ports/libunistring/disable-gnulib-fetch.patch b/vcpkg/ports/libunistring/disable-gnulib-fetch.patch new file mode 100644 index 0000000..51b4e28 --- /dev/null +++ b/vcpkg/ports/libunistring/disable-gnulib-fetch.patch @@ -0,0 +1,12 @@ +diff --git a/autogen.sh b/autogen.sh +index 3e89ebe..8dade84 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -44,6 +44,7 @@ while :; do + *) break ;; + esac + done ++skip_gnulib=true + + TEXINFO_VERSION=6.5 + diff --git a/vcpkg/ports/libunistring/disable-subdirs.patch b/vcpkg/ports/libunistring/disable-subdirs.patch new file mode 100644 index 0000000..612f9b3 --- /dev/null +++ b/vcpkg/ports/libunistring/disable-subdirs.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.am b/Makefile.am +index 8c05275..f27b232 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -19,7 +19,7 @@ + AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies + ACLOCAL_AMFLAGS = -I m4 -I gnulib-m4 + +-SUBDIRS = doc gnulib-local lib tests ++SUBDIRS = gnulib-local lib + + EXTRA_DIST = \ + version.sh BUGS DEPENDENCIES HACKING JOIN-GNU \ diff --git a/vcpkg/ports/libunistring/msvc-use-stdint.patch b/vcpkg/ports/libunistring/msvc-use-stdint.patch new file mode 100644 index 0000000..3486361 --- /dev/null +++ b/vcpkg/ports/libunistring/msvc-use-stdint.patch @@ -0,0 +1,11 @@ +--- a/lib/Makefile.am 2025-09-18 14:31:56.883185700 +0100 ++++ b/lib/Makefile.am 2025-09-18 14:32:34.860321900 +0100 +@@ -101,7 +101,7 @@ + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#include <stddef.h>'; \ +- echo '#if __GLIBC__ >= 2'; \ ++ echo '#if __GLIBC__ >= 2 || (defined(_MSC_VER) && _MSC_VER >= 1600)'; \ + echo '#include <stdint.h>'; \ + echo '#else'; \ + if test -f /usr/include/stdint.h; then \ diff --git a/vcpkg/ports/libunistring/parallelize-symbol-collection.patch b/vcpkg/ports/libunistring/parallelize-symbol-collection.patch new file mode 100644 index 0000000..f0e1be6 --- /dev/null +++ b/vcpkg/ports/libunistring/parallelize-symbol-collection.patch @@ -0,0 +1,46 @@ +diff --git a/lib/Makefile.am b/lib/Makefile.am +index 382d2bc..d9f0144 100644 +--- a/lib/Makefile.am ++++ b/lib/Makefile.am +@@ -274,6 +274,25 @@ endif + # But don't hide symbols that start with "libintl_locale", for the reason + # stated in localename-table.h. + all check install: config.h ++%_exported: ++ @d=`echo "$@" | sed -e 's,/[^/]*$$,,'`; \ ++ test "$$d" = "$@" || mkdir -p "$$d" ; \ ++ true >"$@" || exit 1 ; \ ++ f=`echo "$@" | sed -e 's,_exported$$,,'`; \ ++ case $$f in \ ++ *.res.lo ) ;; \ ++ *.c | *.$(OBJEXT) | *.lo ) \ ++ sf=`echo "$$f" | sed -e 's,\\.[^.]*$$,,'`.c; \ ++ test -f $$sf || sf=$(srcdir)/$$sf; \ ++ of=`echo "$$f" | sed -e 's,^.*/,,' -e 's,\\.[^.]*$$,,'`.$(OBJEXT); \ ++ echo "$(COMPILE) -c $$sf && sh ./exported.sh $$of 1>>$@" ; \ ++ $(COMPILE) -c $$sf || exit 1; \ ++ sh ./exported.sh $$of 1>>"$@"; \ ++ rm -f $$of `echo "$$of" | sed -e 's,\\.$(OBJEXT)$$,.lo,'`; \ ++ ;; \ ++ esac ++libunistring_la_EXPORTED = $(libunistring_la_SOURCES:%=%_exported) $(libunistring_la_LIBADD:%=%_exported) ++exported: $(libunistring_la_EXPORTED) + config.h: $(BUILT_SOURCES) $(srcdir)/libunistring.sym + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + : "Avoid double inclusion, to avoid a warning about redefinitions."; \ +@@ -285,10 +304,14 @@ config.h: $(BUILT_SOURCES) $(srcdir)/libunistring.sym + echo '#endif /* UNISTRING_CONFIG_H */'; \ + } > config.h && \ + if test -n "$(NAMESPACING)" && test -n "$(HAVE_GLOBAL_SYMBOL_PIPE)"; then \ ++ echo "Collecting symbols to be renamed"; \ ++ $(MAKE) exported && \ + { \ + { \ +- for f in $(libunistring_la_SOURCES) $(libunistring_la_LIBADD); do \ ++ for f in $(libunistring_la_EXPORTED); do \ + case $$f in \ ++ *_exported ) cat $$f 1>&5; ;; \ ++ * ) ;; \ + *.res.lo ) ;; \ + *.c | *.$(OBJEXT) | *.lo ) \ + sf=`echo "$$f" | sed -e 's,\\.[^.]*$$,,'`.c; \ diff --git a/vcpkg/ports/libunistring/portfile.cmake b/vcpkg/ports/libunistring/portfile.cmake new file mode 100644 index 0000000..6f6b9f4 --- /dev/null +++ b/vcpkg/ports/libunistring/portfile.cmake @@ -0,0 +1,57 @@ +set(LIBUNISTRING_FILENAME "libunistring-${VERSION}.tar.xz") + +vcpkg_download_distfile(ARCHIVE + URLS + "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libunistring/${LIBUNISTRING_FILENAME}" + "https://ftp.gnu.org/gnu/libunistring/${LIBUNISTRING_FILENAME}" + FILENAME "${LIBUNISTRING_FILENAME}" + SHA512 5fbb5a0a864db73a6d18cdea7b31237da907fff0ef288f3a8db6ebdba8ef61ad8855e5fc780c2bbf632218d8fa59dd119734e5937ca64dc77f53f30f13b80b17 +) + +if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND OPTIONS + # On windows during configure tests iconv is properly linked, + # but iconv-2.dll missing from the directory where check program is built + # causes one of the tests to fail and in result builds libunistring + # without iconv support, this flag allows to bypass the test. + # + # The failing test is "checking for working iconv", while in previous + # test "checking for iconv", configure only checks linking, in + # "checking for working iconv" it also runs resulting test application. + am_cv_func_iconv_works=yes + ) +endif() + +vcpkg_extract_source_archive(SOURCE_PATH + ARCHIVE "${ARCHIVE}" + SOURCE_BASE "v${VERSION}" + PATCHES + disable-gnulib-fetch.patch + disable-subdirs.patch + parallelize-symbol-collection.patch + msvc-use-stdint.patch +) + +vcpkg_configure_make( + SOURCE_PATH "${SOURCE_PATH}" + AUTOCONFIG + USE_WRAPPERS + OPTIONS + ${OPTIONS} + OPTIONS + "--with-libiconv-prefix=${CURRENT_INSTALLED_DIR}" +) + +vcpkg_install_make() +vcpkg_fixup_pkgconfig() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_install_copyright( + COMMENT [[ +The libunistring library and its header files are dual-licensed under +"the GNU LGPLv3+ or the GNU GPLv2+". +]] + FILE_LIST + "${SOURCE_PATH}/COPYING.LIB" + "${SOURCE_PATH}/COPYING" +) diff --git a/vcpkg/ports/libunistring/vcpkg.json b/vcpkg/ports/libunistring/vcpkg.json new file mode 100644 index 0000000..c9ab302 --- /dev/null +++ b/vcpkg/ports/libunistring/vcpkg.json @@ -0,0 +1,12 @@ +{ + "name": "libunistring", + "version": "1.2", + "port-version": 3, + "description": "GNU libunistring provides functions for manipulating Unicode strings and for manipulating C strings according to the Unicode standard.", + "homepage": "https://www.gnu.org/software/libunistring/", + "license": "LGPL-3.0-or-later OR GPL-2.0-or-later", + "supports": "!xbox", + "dependencies": [ + "libiconv" + ] +} |