aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/glpk
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/glpk')
-rw-r--r--vcpkg/ports/glpk/configure.ac.patch23
-rw-r--r--vcpkg/ports/glpk/glpk.pc.in12
-rw-r--r--vcpkg/ports/glpk/portfile.cmake67
-rw-r--r--vcpkg/ports/glpk/vcpkg.json58
4 files changed, 160 insertions, 0 deletions
diff --git a/vcpkg/ports/glpk/configure.ac.patch b/vcpkg/ports/glpk/configure.ac.patch
new file mode 100644
index 0000000..e05600a
--- /dev/null
+++ b/vcpkg/ports/glpk/configure.ac.patch
@@ -0,0 +1,23 @@
+--- configure.ac.original 2022-12-15 13:46:24.222223600 -0500
++++ configure.ac 2022-12-28 09:30:59.301984700 -0500
+@@ -114,6 +114,12 @@
+ LIBODBC="libodbc.dylib"
+ LIBMYSQL="libmysqlclient.dylib"
+ ;;
++ cygwin* | mingw*)
++ LIBIODBC="odbc32.dll"
++ LIBODBC="odbc32.dll"
++ LIBMYSQL="libmysql.dll"
++ AC_DEFINE([__WOE__], [1], [N/A])
++ ;;
+ *)
+ LIBIODBC="libiodbc.so"
+ LIBODBC="libodbc.so"
+@@ -145,7 +151,6 @@
+ AC_MSG_ERROR([--enable-mysql requires --enable-dl])
+ fi
+ AC_MSG_RESULT([yes])
+- CPPFLAGS="-I/usr/include/mysql $CPPFLAGS"
+ AC_DEFINE_UNQUOTED([MYSQL_DLNAME], ["$LIBMYSQL"], [N/A])
+ else
+ AC_MSG_RESULT([no])
diff --git a/vcpkg/ports/glpk/glpk.pc.in b/vcpkg/ports/glpk/glpk.pc.in
new file mode 100644
index 0000000..b1ac851
--- /dev/null
+++ b/vcpkg/ports/glpk/glpk.pc.in
@@ -0,0 +1,12 @@
+prefix=${pcfiledir}/../..
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: glpk
+Description: The GNU Linear Programming Kit (GLPK) solves large-scale linear programming (LP), mixed integer programming (MIP), and related problems.
+Version: @VERSION@
+Libs: -L${libdir} -l@libname@
+Libs.private: @libs@
+Cflags: -I${includedir}
+Requires.private: @requires@
diff --git a/vcpkg/ports/glpk/portfile.cmake b/vcpkg/ports/glpk/portfile.cmake
new file mode 100644
index 0000000..9fd4a88
--- /dev/null
+++ b/vcpkg/ports/glpk/portfile.cmake
@@ -0,0 +1,67 @@
+set(DISTFILE_SHA512_HASH 4e92195fa058c707146f2690f3a38b46c33add948c852f67659ca005a6aa980bbf97be96528b0f8391690facb880ac2126cd60198c6c175e7f3f06cca7e29f9d)
+
+vcpkg_download_distfile(
+ DISTFILE
+ FILENAME "glpk.tar.gz"
+ URLS "https://ftpmirror.gnu.org/gnu/glpk/glpk-${VERSION}.tar.gz" "https://ftp.gnu.org/gnu/glpk/glpk-${VERSION}.tar.gz"
+ SHA512 ${DISTFILE_SHA512_HASH}
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${DISTFILE}"
+ PATCHES
+ configure.ac.patch
+)
+
+vcpkg_list(SET CONFIGURE_OPTIONS)
+if("dl" IN_LIST FEATURES)
+ vcpkg_list(APPEND CONFIGURE_OPTIONS --enable-dl=dlfcn "LIBS=-ldl \$LIBS")
+else()
+ vcpkg_list(APPEND CONFIGURE_OPTIONS --disable-dl)
+endif()
+
+if("gmp" IN_LIST FEATURES)
+ vcpkg_list(APPEND CONFIGURE_OPTIONS --with-gmp)
+ string(APPEND requires " gmp")
+else()
+ vcpkg_list(APPEND CONFIGURE_OPTIONS --without-gmp)
+endif()
+
+if("mysql" IN_LIST FEATURES)
+ vcpkg_list(APPEND CONFIGURE_OPTIONS
+ --enable-mysql
+ "CPPFLAGS=-I${CURRENT_INSTALLED_DIR}/include/mysql \$CPPFLAGS"
+ )
+ string(APPEND libs " -lmysql")
+else()
+ vcpkg_list(APPEND CONFIGURE_OPTIONS --disable-mysql)
+endif()
+
+if("odbc" IN_LIST FEATURES)
+ vcpkg_list(APPEND CONFIGURE_OPTIONS --enable-odbc)
+else()
+ vcpkg_list(APPEND CONFIGURE_OPTIONS --disable-odbc)
+endif()
+
+vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTOCONFIG
+ NO_ADDITIONAL_PATHS
+ DETERMINE_BUILD_TRIPLET
+ OPTIONS
+ ${CONFIGURE_OPTIONS}
+)
+
+vcpkg_install_make()
+set(libname glpk)
+configure_file("${CMAKE_CURRENT_LIST_DIR}/glpk.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/glpk.pc" @ONLY)
+if(NOT VCPKG_BUILD_TYPE)
+ configure_file("${CMAKE_CURRENT_LIST_DIR}/glpk.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/glpk.pc" @ONLY)
+endif()
+vcpkg_fixup_pkgconfig()
+
+vcpkg_copy_pdbs()
+vcpkg_copy_tools(TOOL_NAMES glpsol AUTO_CLEAN)
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/glpk/vcpkg.json b/vcpkg/ports/glpk/vcpkg.json
new file mode 100644
index 0000000..58e820d
--- /dev/null
+++ b/vcpkg/ports/glpk/vcpkg.json
@@ -0,0 +1,58 @@
+{
+ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
+ "name": "glpk",
+ "version": "5.0",
+ "port-version": 3,
+ "maintainers": "Fabio A. Correa Duran",
+ "description": [
+ "The GNU Linear Programming Kit (GLPK) solves large-scale linear programming (LP), mixed integer programming (MIP), and related problems.",
+ "GLPK includes the following main components:",
+ "Primal and dual simplex methods",
+ "Primal-dual interior-point method",
+ "Branch-and-cut method",
+ "Translator for GNU MathProg",
+ "Application program interface (API)",
+ "Stand-alone LP/MIP solver "
+ ],
+ "homepage": "https://www.gnu.org/software/glpk/",
+ "documentation": "https://www.gnu.org/software/glpk/#documentation",
+ "license": "GPL-3.0-or-later",
+ "supports": "!xbox",
+ "features": {
+ "dl": {
+ "description": "Enable shared library support",
+ "dependencies": [
+ "dlfcn-win32"
+ ]
+ },
+ "gmp": {
+ "description": "Use the GNU Multiple Precision Arithmetic Library",
+ "dependencies": [
+ "gmp"
+ ]
+ },
+ "mysql": {
+ "description": "Sharing between MathProg objects and MySQL databases (libmysql)",
+ "dependencies": [
+ {
+ "name": "glpk",
+ "features": [
+ "dl"
+ ]
+ },
+ "libmysql"
+ ]
+ },
+ "odbc": {
+ "description": "Sharing between MathProg objects and databases through ODBC (libiodbc)",
+ "dependencies": [
+ {
+ "name": "glpk",
+ "features": [
+ "dl"
+ ]
+ }
+ ]
+ }
+ }
+}