aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/hunspell
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/hunspell')
-rw-r--r--vcpkg/ports/hunspell/0005-autotools-subdirs.patch36
-rw-r--r--vcpkg/ports/hunspell/portfile.cmake69
-rw-r--r--vcpkg/ports/hunspell/vcpkg.json32
3 files changed, 137 insertions, 0 deletions
diff --git a/vcpkg/ports/hunspell/0005-autotools-subdirs.patch b/vcpkg/ports/hunspell/0005-autotools-subdirs.patch
new file mode 100644
index 0000000..0a4320d
--- /dev/null
+++ b/vcpkg/ports/hunspell/0005-autotools-subdirs.patch
@@ -0,0 +1,36 @@
+diff --git a/Makefile.am b/Makefile.am
+index c0aae53..769aef5 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,6 +1,6 @@
+ ACLOCAL_AMFLAGS = -I m4
+
+-SUBDIRS= po src man tests
++SUBDIRS= po src
+
+ pkgconfdir = $(libdir)/pkgconfig
+ pkgconf_DATA = hunspell.pc
+diff --git a/configure.ac b/configure.ac
+index 358cb1d..152adef 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -38,6 +38,9 @@ dnl internationalization macros
+ AM_GNU_GETTEXT_VERSION(0.18)
+ AM_GNU_GETTEXT([external])
+
++AC_ARG_ENABLE(tools,[])
++AM_CONDITIONAL(DISABLE_TOOLS, test x$enable_tools != xyes)
++
+ AC_ARG_WITH(warnings,[ --with-warnings compile with warning messages],[
+ AC_DEFINE(HUNSPELL_WARNING_ON,1,"Define if you need warning messages")
+ ])
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 45b7703..27700af 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1 +1,5 @@
++if DISABLE_TOOLS
++SUBDIRS=hunspell
++else
+ SUBDIRS=hunspell parsers tools
++endif
diff --git a/vcpkg/ports/hunspell/portfile.cmake b/vcpkg/ports/hunspell/portfile.cmake
new file mode 100644
index 0000000..0311f4b
--- /dev/null
+++ b/vcpkg/ports/hunspell/portfile.cmake
@@ -0,0 +1,69 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO hunspell/hunspell
+ REF "v${VERSION}"
+ SHA512 d007edc8cb7ff95048361418b088bb062962973247c940aa826c9859a5ef90a9734100bffe7c7ac9a774f2e233605e814efb9e7fd3fc8c4ef4b978e9ec990cba
+ HEAD_REF master
+ PATCHES
+ 0005-autotools-subdirs.patch
+)
+
+file(REMOVE "${SOURCE_PATH}/README") #README is a symlink
+configure_file("${SOURCE_PATH}/README.md" "${SOURCE_PATH}/README" COPYONLY)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -DHUNSPELL_STATIC")
+ set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -DHUNSPELL_STATIC")
+endif()
+
+vcpkg_list(SET options)
+
+if("tools" IN_LIST FEATURES)
+ vcpkg_list(APPEND options "--enable-tools")
+endif()
+
+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()
+
+vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTOCONFIG
+ ADDITIONAL_MSYS_PACKAGES gzip
+ OPTIONS
+ ${options}
+ OPTIONS_DEBUG
+ --disable-tools
+)
+
+if("nls" IN_LIST FEATURES)
+ vcpkg_build_make(BUILD_TARGET dist LOGFILE_ROOT build-dist)
+endif()
+
+vcpkg_install_make()
+
+vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
+
+vcpkg_fixup_pkgconfig()
+
+set(HUNSPELL_EXPORT_HDR "${CURRENT_PACKAGES_DIR}/include/hunspell/hunvisapi.h")
+
+if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ vcpkg_replace_string("${HUNSPELL_EXPORT_HDR}" "#if defined(HUNSPELL_STATIC)" "#if 1")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_install_copyright(
+ COMMENT "Hunspell is licensed under LGPL/GPL/MPL tri-license."
+ FILE_LIST
+ "${SOURCE_PATH}/license.hunspell"
+ "${SOURCE_PATH}/license.myspell"
+ "${SOURCE_PATH}/COPYING.MPL"
+ "${SOURCE_PATH}/COPYING"
+ "${SOURCE_PATH}/COPYING.LESSER"
+)
diff --git a/vcpkg/ports/hunspell/vcpkg.json b/vcpkg/ports/hunspell/vcpkg.json
new file mode 100644
index 0000000..25e66db
--- /dev/null
+++ b/vcpkg/ports/hunspell/vcpkg.json
@@ -0,0 +1,32 @@
+{
+ "name": "hunspell",
+ "version": "1.7.2",
+ "port-version": 1,
+ "description": "The most popular spellchecking library.",
+ "homepage": "https://github.com/hunspell/hunspell",
+ "license": "MPL-1.1 OR LGPL-2.1-or-later OR GPL-2.0-or-later",
+ "supports": "!uwp & !xbox",
+ "dependencies": [
+ "libiconv"
+ ],
+ "features": {
+ "nls": {
+ "description": "Enable native language support",
+ "supports": "!windows | mingw",
+ "dependencies": [
+ "gettext",
+ {
+ "name": "gettext",
+ "host": true,
+ "features": [
+ "tools"
+ ]
+ }
+ ]
+ },
+ "tools": {
+ "description": "Build hunspell tools",
+ "supports": "!windows | mingw"
+ }
+ }
+}