From: Michael Tremer Date: Wed, 6 Oct 2010 12:18:10 +0000 (+0200) Subject: swig: New package. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=839b4e22a444d73185a6e50a934a66ca5e487533;p=ipfire-3.x.git swig: New package. --- diff --git a/pkgs/core/swig/patches/swig-1.3.23-pylib.patch b/pkgs/core/swig/patches/swig-1.3.23-pylib.patch new file mode 100644 index 000000000..85fa1e378 --- /dev/null +++ b/pkgs/core/swig/patches/swig-1.3.23-pylib.patch @@ -0,0 +1,29 @@ +--- SWIG-1.3.23/configure.in.pylib 2004-11-02 00:45:57.000000000 +0100 ++++ SWIG-1.3.23/configure.in 2004-11-23 12:20:12.552926982 +0100 +@@ -574,9 +574,11 @@ + + # Set the include directory + ++ PYLIB=`$PYTHON -c "import sys; print sys.path[[1]]"` ++ + AC_MSG_CHECKING(for Python header files) + if test -r $PYPREFIX/include/$PYVERSION/Python.h; then +- PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config" ++ PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYLIB/config" + fi + if test -z "$PYINCLUDE"; then + if test -r $PYPREFIX/include/Py/Python.h; then +@@ -587,13 +589,6 @@ + + # Set the library directory blindly. This probably won't work with older versions + AC_MSG_CHECKING(for Python library) +- dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR" +- for i in $dirs; do +- if test -d $PYEPREFIX/$PYLIBDIR/$i; then +- PYLIB="$PYEPREFIX/$PYLIBDIR/$i" +- break +- fi +- done + if test -z "$PYLIB"; then + AC_MSG_RESULT(Not found) + else diff --git a/pkgs/core/swig/patches/swig200-rh623854.patch b/pkgs/core/swig/patches/swig200-rh623854.patch new file mode 100644 index 000000000..5665252bb --- /dev/null +++ b/pkgs/core/swig/patches/swig200-rh623854.patch @@ -0,0 +1,92 @@ +diff -up swig-2.0.0/Lib/python/pyrun.swg.rh623854 swig-2.0.0/Lib/python/pyrun.swg +--- swig-2.0.0/Lib/python/pyrun.swg.rh623854 2010-02-28 00:26:02.000000000 +0100 ++++ swig-2.0.0/Lib/python/pyrun.swg 2010-08-17 16:32:16.581604656 +0200 +@@ -45,8 +45,18 @@ + #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg + #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) + #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) +-#define SWIG_fail goto fail ++#define SWIG_fail goto fail + ++/* ++ * Python 2.7 and newer and Python 3.1 and newer should use Capsules API instead of ++ * CObjects API. ++ */ ++#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ ++ (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0)) ++#define USE_CAPSULES ++#define TYPE_POINTER_NAME \ ++ ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) ++#endif + + /* Runtime API implementation */ + +@@ -1356,8 +1366,12 @@ SWIG_Python_GetModule(void) { + #ifdef SWIG_LINK_RUNTIME + type_pointer = SWIG_ReturnGlobalTypeList((void *)0); + #else ++#ifdef USE_CAPSULES ++ type_pointer = PyCapsule_Import(TYPE_POINTER_NAME, 0); ++#else + type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); ++#endif + if (PyErr_Occurred()) { + PyErr_Clear(); + type_pointer = (void *)0; +@@ -1402,9 +1416,14 @@ PyModule_AddObject(PyObject *m, char *na + SWIGRUNTIME void + SWIG_Python_DestroyModule(void *vptr) + { ++ size_t i; ++#ifdef USE_CAPSULES ++ swig_module_info *swig_module = ++ (swig_module_info *) PyCapsule_GetPointer((PyObject *)vptr, TYPE_POINTER_NAME); ++#else + swig_module_info *swig_module = (swig_module_info *) vptr; ++#endif + swig_type_info **types = swig_module->types; +- size_t i; + for (i =0; i < swig_module->size; ++i) { + swig_type_info *ty = types[i]; + if (ty->owndata) { +@@ -1426,9 +1445,18 @@ SWIG_Python_SetModule(swig_module_info * + PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + swig_empty_runtime_method_table); + #endif ++#ifdef USE_CAPSULES ++ PyObject *pointer = PyCapsule_New((void *)swig_module, TYPE_POINTER_NAME, ++ (PyCapsule_Destructor)SWIG_Python_DestroyModule); ++#else + PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); ++#endif + if (pointer && module) { ++#ifdef USE_CAPSULES ++ PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); ++#else + PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); ++#endif + } else { + Py_XDECREF(pointer); + } +@@ -1449,12 +1477,20 @@ SWIG_Python_TypeQuery(const char *type) + PyObject *obj = PyDict_GetItem(cache, key); + swig_type_info *descriptor; + if (obj) { ++#ifdef USE_CAPSULES ++ descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, type); ++#else + descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); ++#endif + } else { + swig_module_info *swig_module = SWIG_Python_GetModule(); + descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); + if (descriptor) { ++#ifdef USE_CAPSULES ++ obj = PyCapsule_New(descriptor, type, NULL); ++#else + obj = PyCObject_FromVoidPtr(descriptor, NULL); ++#endif + PyDict_SetItem(cache, key, obj); + Py_DECREF(obj); + } diff --git a/pkgs/core/swig/swig.nm b/pkgs/core/swig/swig.nm new file mode 100644 index 000000000..8f0d3aaa3 --- /dev/null +++ b/pkgs/core/swig/swig.nm @@ -0,0 +1,57 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include $(PKGROOT)/Include + +PKG_NAME = swig +PKG_VER = 2.0.1 +PKG_REL = 0 + +PKG_MAINTAINER = +PKG_GROUP = Development/Tools +PKG_URL = http://swig.sourceforge.net/ +PKG_LICENSE = GPLv3+ and BSD +PKG_SUMMARY = Connects C/C++/Objective C to some high-level programming \ + languages. + +PKG_BUILD_DEPS+= autoconf automake gcc-c++ pcre-devel perl python-devel + +define PKG_DESCRIPTION + Simplified Wrapper and Interface Generator (SWIG) is a software \ + development tool for connecting C, C++ and Objective C programs with a \ + variety of high-level programming languages. SWIG is primarily used \ + with Perl, Python and Tcl/TK, but it has also been extended to Java, \ + Eiffel and Guile. SWIG is normally used to create high-level \ + interpreted programming environments, systems integration, and as a \ + tool for building user interfaces. +endef + +PKG_TARBALL = $(THISAPP).tar.gz + +CONFIGURE_OPTIONS += \ + --sbindir=/sbin + +define STAGE_PREPARE_CMDS + cd $(DIR_APP) && ./autogen.sh +endef