Skip to content

Commit

Permalink
[new-package] ixion 0.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed Jan 10, 2024
1 parent 6acf751 commit 0111944
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 0 deletions.
67 changes: 67 additions & 0 deletions mingw-w64-ixion/001-fix-build-on-mingw.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,10 @@
_os=Darwin
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
+ mingw*)
+ _os=
+ LDFLAGS="$LDFLAGS -lpthread"
+ ;;
*)
_os=
LDFLAGS="$LDFLAGS -Wl,--no-as-needed -pthread -ldl"
--- a/include/ixion/env.hpp
+++ b/include/ixion/env.hpp
@@ -9,10 +9,7 @@
#define INCLUDED_IXION_ENV_HPP

#if defined _WIN32 || defined __CYGWIN__
- #if defined __MINGW32__
- #define IXION_DLLPUBLIC
- #define IXION_DLLPUBLIC_VAR extern
- #elif defined IXION_BUILD
+ #if defined IXION_BUILD
#ifdef DLL_EXPORT
#define IXION_DLLPUBLIC __declspec(dllexport)
#define IXION_DLLPUBLIC_VAR extern __declspec(dllexport)
--- a/src/libixion/Makefile.am
+++ b/src/libixion/Makefile.am
@@ -2,6 +2,7 @@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/include \
+ -D_USE_MATH_DEFINES \
-DIXION_BUILD \
$(MDDS_CFLAGS) \
$(BOOST_CPPFLAGS)
@@ -114,7 +115,6 @@

libixion_@IXION_API_VERSION@_la_LDFLAGS = \
-no-undefined \
- -Wl,-rpath,'$$ORIGIN' -Wl,-rpath,'$$ORIGIN/$(PACKAGE)' \
$(BOOST_FILESYSTEM_LDFLAGS)

libixion_@IXION_API_VERSION@_la_LIBADD = \
--- a/src/python/Makefile.am
+++ b/src/python/Makefile.am
@@ -12,7 +2,7 @@
sheet.hpp \
sheet.cpp

-ixion_la_LDFLAGS = -module -avoid-version -export-symbols-regex PyInit_ixion
+ixion_la_LDFLAGS = -no-undefined -module -avoid-version -export-symbols-regex PyInit_ixion
ixion_la_CPPFLAGS = -I$(top_srcdir)/include $(PYTHON_CFLAGS) $(MDDS_CFLAGS)
ixion_la_LIBADD = \
../libixion/libixion-@[email protected] \
--- a/src/python/python.cpp
+++ b/src/python/python.cpp
@@ -141,7 +141,7 @@

extern "C" {

-IXION_DLLPUBLIC PyObject* PyInit_ixion()
+PyObject* PyInit_ixion()
{
PyTypeObject* doc_type = ixion::python::get_document_type();
if (PyType_Ready(doc_type) < 0)
58 changes: 58 additions & 0 deletions mingw-w64-ixion/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Contributor: Mehdi Chinoune <[email protected]>

_realname=ixion
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.19.0
pkgrel=1
pkgdesc="A general purpose formula parser & interpreter. (mingw-w64)"
arch=('any')
mingw_arch=('ucrt64' 'clang64' 'clangarm64')
url='https://gitlab.com/ixion/ixion'
msys2_references=(
'archlinux: libixion'
)
license=('spdx:MPL-2.0')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-boost"
"${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-mdds")
source=("https://gitlab.com/ixion/ixion/-/archive/${pkgver}/${_realname}-${pkgver}.tar.bz2"
"001-fix-build-on-mingw.patch")
sha256sums=('c8b6315bae2d33a0e18b60004d625e4a5ea8a7326364f9f0b51cd6b49bdf93e8'
'5e7949e70a0f9c86411f75d9755a06ca56cad58e059d1d7af078d836a4b1f277')

prepare() {
cd ${_realname}-${pkgver}
patch -p1 -i "${srcdir}"/001-fix-build-on-mingw.patch

autoreconf -fiv
}

build() {
mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM}

../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX}

make
}

check() {
cd "${srcdir}/build-${MSYSTEM}"

make check || true
}

package() {
cd "${srcdir}/build-${MSYSTEM}"

DESTDIR="${pkgdir}" make install

# remove unused import library
rm -f "${pkgdir}${MINGW_PREFIX}"/lib/python3.11/site-packages/ixion.dll.a

install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}

0 comments on commit 0111944

Please sign in to comment.