summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD50
-rw-r--r--lpsolve-CMakeLists.txt142
3 files changed, 213 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..df88f3292e6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+# Generated by mksrcinfo v8
+# Sat Apr 1 06:19:51 UTC 2017
+pkgbase = mingw-w64-lpsolve
+ pkgdesc = a Mixed Integer Linear Programming (MILP) solver (mingw-w64)
+ pkgver = 5.5.2.5
+ pkgrel = 1
+ url = http://lpsolve.sourceforge.net/
+ arch = any
+ license = LGPL2.1
+ makedepends = mingw-w64-cmake
+ depends = mingw-w64-crt
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ source = http://downloads.sourceforge.net/project/lpsolve/lpsolve/5.5.2.5/lp_solve_5.5.2.5_source.tar.gz
+ source = lpsolve-CMakeLists.txt
+ sha1sums = 232ce8edb073c7c9b6d9100abf77038d989c45c8
+ sha1sums = SKIP
+
+pkgname = mingw-w64-lpsolve
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..31865988a51
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+pkgname=mingw-w64-lpsolve
+_origname=lp_solve
+pkgver=5.5.2.5
+_mainver=5.5
+pkgrel=1
+pkgdesc="a Mixed Integer Linear Programming (MILP) solver (mingw-w64)"
+arch=('any')
+url="http://lpsolve.sourceforge.net/"
+license=('LGPL2.1')
+makedepends=('mingw-w64-cmake')
+depends=('mingw-w64-crt')
+options=('!strip' '!buildflags' 'staticlibs')
+source=("http://downloads.sourceforge.net/project/lpsolve/lpsolve/${pkgver}/lp_solve_${pkgver}_source.tar.gz"
+ lpsolve-CMakeLists.txt)
+sha1sums=('232ce8edb073c7c9b6d9100abf77038d989c45c8'
+ SKIP)
+
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+
+prepare() {
+ cd ${_origname}_${_mainver}
+
+ # https://github.com/PADrend/ThirdParty/blob/master/lpsolve-CMakeLists.txt
+ cp $srcdir/lpsolve-CMakeLists.txt CMakeLists.txt
+}
+
+build() {
+ cd ${_origname}_${_mainver}
+ for _arch in ${_architectures}; do
+ mkdir -p build-${_arch}-static && pushd build-${_arch}-static
+ ${_arch}-cmake -DBUILD_SHARED_LIBS=OFF ..
+ make
+ popd
+ mkdir -p build-${_arch} && pushd build-${_arch}
+ ${_arch}-cmake ..
+ make
+ popd
+ done
+}
+
+package() {
+ for _arch in ${_architectures}; do
+ cd "${srcdir}/${_origname}_${_mainver}/build-${_arch}-static"
+ make DESTDIR="$pkgdir" install
+ cd "${srcdir}/${_origname}_${_mainver}/build-${_arch}"
+ make DESTDIR="$pkgdir" install
+ ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
+ ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
+ done
+}
diff --git a/lpsolve-CMakeLists.txt b/lpsolve-CMakeLists.txt
new file mode 100644
index 00000000000..41c59463a73
--- /dev/null
+++ b/lpsolve-CMakeLists.txt
@@ -0,0 +1,142 @@
+#
+# CMakeLists.txt for "lp_solve_5.5.2.0_source.tar.gz"
+#
+# Copyright 2012-2013 Benjamin Eikel
+# License: Public Domain
+#
+
+cmake_minimum_required(VERSION 2.8.11)
+
+if (NOT DEFINED CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
+endif ()
+
+project(lpsolve C)
+
+set(LPSOLVE_VERSION_MAJOR 5)
+set(LPSOLVE_VERSION_MINOR 5)
+set(LPSOLVE_VERSION_PATCH 2)
+set(LPSOLVE_VERSION ${LPSOLVE_VERSION_MAJOR}.${LPSOLVE_VERSION_MINOR}.${LPSOLVE_VERSION_PATCH})
+
+# Set up install directories
+include(GNUInstallDirs)
+set(CMAKE_INSTALL_CMAKECONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/lpsolve)
+
+add_library(lpsolve55
+ lp_MDO.c
+ shared/commonlib.c
+ shared/mmio.c
+ shared/myblas.c
+ ini.c
+ fortify.c
+ colamd/colamd.c
+ lp_rlp.c
+ lp_crash.c
+ bfp/bfp_LUSOL/lp_LUSOL.c
+ bfp/bfp_LUSOL/LUSOL/lusol.c
+ lp_Hash.c
+ lp_lib.c
+ lp_wlp.c
+ lp_matrix.c
+ lp_mipbb.c
+ lp_MPS.c
+ lp_params.c
+ lp_presolve.c
+ lp_price.c
+ lp_pricePSE.c
+ lp_report.c
+ lp_scale.c
+ lp_simplex.c
+ lp_SOS.c
+ lp_utils.c
+ yacc_read.c
+)
+
+set_property(TARGET lpsolve55 PROPERTY PUBLIC_HEADER
+ lp_bit.h
+ lp_crash.h
+ lp_explicit.h
+ lp_fortify.h
+ lp_Hash.h
+ lp_lib.h
+ lp_matrix.h
+ lp_MDO.h
+ lp_mipbb.h
+ lp_MPS.h
+ lp_presolve.h
+ lp_price.h
+ lp_pricePSE.h
+ lp_report.h
+ lp_rlp.h
+ lp_scale.h
+ lp_simplex.h
+ lp_solveDLL.h
+ lp_SOS.h
+ lp_types.h
+ lp_utils.h
+ lp_wlp.h
+)
+
+target_include_directories(lpsolve55 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/shared"
+ "${CMAKE_CURRENT_SOURCE_DIR}/bfp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/bfp/bfp_LUSOL"
+ "${CMAKE_CURRENT_SOURCE_DIR}/bfp/bfp_LUSOL/LUSOL"
+ "${CMAKE_CURRENT_SOURCE_DIR}/colamd"
+)
+
+target_compile_definitions(lpsolve55 PUBLIC
+ YY_NEVER_INTERACTIVE
+ PARSER_LP
+ INVERSE_ACTIVE=INVERSE_LUSOL
+ RoleIsExternalInvEngine
+)
+
+if(WIN32)
+ target_compile_definitions(lpsolve55 PUBLIC
+ INLINE=static
+ _USRDLL
+ WIN32
+ )
+endif()
+
+include(CheckSymbolExists)
+check_symbol_exists(isnan math.h HAVE_ISNAN)
+if(NOT HAVE_ISNAN)
+ set_property(TARGET lpsolve55 APPEND PROPERTY COMPILE_DEFINITIONS NOISNAN)
+endif()
+
+# Set version of library
+set_target_properties(lpsolve55 PROPERTIES VERSION ${LPSOLVE_VERSION}
+ SOVERSION ${LPSOLVE_VERSION_MAJOR})
+
+# Install the library
+install(TARGETS lpsolve55 EXPORT LibraryExport
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lpsolve
+)
+
+# Set include directories for users of this library
+target_include_directories(lpsolve55 INTERFACE ${CMAKE_INSTALL_FULL_INCLUDEDIR}/lpsolve)
+
+# Library export
+install(EXPORT LibraryExport DESTINATION ${CMAKE_INSTALL_CMAKECONFIGDIR} FILE lpsolveTargets.cmake)
+
+# # Create the configuration files
+# include(CMakePackageConfigHelpers)
+# get_property(LPSOLVE_DEFINITIONS TARGET lpsolve55 PROPERTY COMPILE_DEFINITIONS)
+# configure_package_config_file(lpsolveConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/lpsolveConfig.cmake
+# INSTALL_DESTINATION ${CMAKE_INSTALL_CMAKECONFIGDIR}
+# PATH_VARS CMAKE_INSTALL_CMAKECONFIGDIR
+# NO_SET_AND_CHECK_MACRO
+# NO_CHECK_REQUIRED_COMPONENTS_MACRO)
+# write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/lpsolveConfigVersion.cmake
+# VERSION ${LPSOLVE_VERSION}
+# COMPATIBILITY SameMajorVersion)
+#
+# # Install the configuration files
+# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lpsolveConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/lpsolveConfigVersion.cmake
+# DESTINATION ${CMAKE_INSTALL_CMAKECONFIGDIR})