summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Narváez <david.narvaez@computer.org>2012-10-17 23:23:23 -0500
committerDavid Narváez <david.narvaez@computer.org>2012-10-17 23:23:23 -0500
commita166d0fc263d24d2f17fbd80be7999d823644262 (patch)
tree7950870ae08029313cfc9d3acf14d02ccef2f949 /dev-util
parentAdding txt2tags to the overlay to have Python support (diff)
downloaddMaggot-a166d0fc263d24d2f17fbd80be7999d823644262.tar.gz
dMaggot-a166d0fc263d24d2f17fbd80be7999d823644262.tar.bz2
dMaggot-a166d0fc263d24d2f17fbd80be7999d823644262.zip
Adding gcc-python-plugin-0.10
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/gcc-python-plugin/Manifest17
-rw-r--r--dev-util/gcc-python-plugin/files/gcc-python-plugin-cpp-compilation.diff107
-rw-r--r--dev-util/gcc-python-plugin/gcc-python-plugin-0.10.ebuild105
3 files changed, 222 insertions, 7 deletions
diff --git a/dev-util/gcc-python-plugin/Manifest b/dev-util/gcc-python-plugin/Manifest
index 891903c..7ad5eac 100644
--- a/dev-util/gcc-python-plugin/Manifest
+++ b/dev-util/gcc-python-plugin/Manifest
@@ -1,7 +1,10 @@
-AUX gcc-python-plugin-man-target.diff 425 RMD160 890bd6749bfc56d323eea820c5f7156d242bdf3b SHA1 29376f2b096431a7091ce0628d4d4c5e3632e129 SHA256 a4d2b1270e5f41a669e657cb1b04814f23e38dce05de4cb2748104e051e3f159
-AUX gcc-python-plugin-python3-docs.diff 1103 RMD160 9cdbd35167ec565d5bc1852e708359f6122693fa SHA1 62115e8bdf6127c5b5dc1b04987f493a0c75d27a SHA256 111ef08f5bc6bc37d8db661a11e8105dcd8ee107178165dc0d7e0ffad72973e5
-AUX gcc-with-python 127 RMD160 03cd9b0b45e0f4527f36e160e373b827645a08e3 SHA1 9a866473ca1accc9409a69fa5ec1c9e46fd6d71f SHA256 9b3e8c17f64b6cd59310069628238dce65c0aaba91d55b8b976dd3ab2f876617
-DIST gcc-python-plugin-0.9.tar.gz 660168 RMD160 57bec9e6c0672236ec3a749144864a7522db0afa SHA1 5d3d7eaf7c81721daa4764a519286aa874c46fc9 SHA256 4559d5c31fdb3394563931f1dfd4f69f35b48ec0ad8b3d0d9921389429cbe82a
-EBUILD gcc-python-plugin-0.9.ebuild 2089 RMD160 588d9f41d8cf34931307f1dd215b7e970bfaa39b SHA1 b7e1382321a182508f8c211797799657edd10b7c SHA256 9ac645782c845f852f7763e923d8f5d61ba0aebaa7fe00791b3c162172955973
-EBUILD gcc-python-plugin-9999.ebuild 1934 RMD160 c463b2ebd30d6a7e3c55d4b83500649327d948a7 SHA1 46f695975a61d51c1e55efc76371dbdd64efb0ed SHA256 2abe5332c50d51a6f3455886735b24df57cceedbd26284e76a7d2fbd20b63efd
-MISC ChangeLog 318 RMD160 9b4ea87aff581352b4595322fe2a4df1e73dead7 SHA1 3cb16c7dc657f663e8f3cfe77283530b8ad2fa43 SHA256 3064b62e222e92ce3d5e2c81a72a20667d12444025acdd2bcf933070eaf16f8f
+AUX gcc-python-plugin-cpp-compilation.diff 3437 SHA256 43d2b86ac9b1645a0b050bd0da54d7804f8909fefe181d215ec0c07ee5c403ad SHA512 a9f463dedc1a2016cbc38f48e12c8ee6092274fe151e8e551bd9d7ae7b4b97433d07a54f35a48184d52596b9a0071a9faffca746edf7289449071a3976eba4be WHIRLPOOL af53d4d21814f744ef1ab1f183ee209987d4ca7de96671030471e60a9de6c11314bf978972097a2f98bc01d135b2437b31ad334b63cca4ed1a351ca5ad88937b
+AUX gcc-python-plugin-man-target.diff 425 SHA256 a4d2b1270e5f41a669e657cb1b04814f23e38dce05de4cb2748104e051e3f159 SHA512 484c4600c8a70dfe2e455d14ad2d70f773f3091894259af8ffaa433c676c0fd8dd55f8e83455d257173686bb724402ed7471bc0eff88f62cba03336bd5d5019c WHIRLPOOL ac6755859918827a73f9331b228644dd32ba97075597522e7f90ecfca82a54f2f4138800fc87dbcc519e9972f42854e6422af4232926a0e00d15af44ceb848cb
+AUX gcc-python-plugin-python3-docs.diff 1103 SHA256 111ef08f5bc6bc37d8db661a11e8105dcd8ee107178165dc0d7e0ffad72973e5 SHA512 e498673528d0c3af1ea7ff141fc308eef455be69f2531e65241cc67b1b532be48b79b57971264e3e8c7622abc2df15fa5ac1fee3710e29392b7d63e34ad5f661 WHIRLPOOL 1a191d3a5d29c37d97c74b2c99a960cd855145ce2a6dfaaf91ab108c62f98eed312ad841d220c4fc74b3f22aa80f00d1f28016bb0cfce5b6aa421a707ff6b652
+AUX gcc-with-python 127 SHA256 9b3e8c17f64b6cd59310069628238dce65c0aaba91d55b8b976dd3ab2f876617 SHA512 7005cfd21e60129ccb00e9c9bb7de5f02c8315b403c680b88ec05fd75622c783ebaeeb4778ec60792dba74eb7e14f5b2fff6c180a9b16826cb81f3380d2b94f3 WHIRLPOOL d5aa88eef40bd975478fc668ad0a5d155eb430e9216ea1508f6a97ab4e41f171aca8eba86704859d2cb92cde7424ef8dfaee9386af38ef7232812475a1e99c4d
+DIST gcc-python-plugin-0.10.tar.gz 836437 SHA256 1f12bb252394cb3ea6218e76fca126820b4c65d0abe16d94345cb66a50018ab8 SHA512 fae932f2ee1956eb36b3a68977823279f3f7192c7cb617ca1d5dc1b51cbfc7dad71bec0f69c3b897c49446d444625c8c6736fcbb1aae93262202b9d74dc229ad WHIRLPOOL 08c3e642f195f95dcb35960fe8bd79d6a3bd5daab67812f355b90d11584602cb8952e15fce54197d8dc408ef57661515cca3946759c3f3e2a7ecfef864f25f4d
+DIST gcc-python-plugin-0.9.tar.gz 660168 SHA256 4559d5c31fdb3394563931f1dfd4f69f35b48ec0ad8b3d0d9921389429cbe82a
+EBUILD gcc-python-plugin-0.10.ebuild 2181 SHA256 2fe5d35bcf2d1be069dc0aebe0921d30e4aeec8fa2b3593963d5e968f443ff6e SHA512 9ced3cd44bf91d3bfe723747f1f0d6217e717353bd542caae68968018c2fd7919ba0e50e832afe65a81de261bc3251a28f486a6d971aa34f58cc3bd8ab65d47a WHIRLPOOL 86cbeeadad33d009277815a3e80ba9c17ac6f4a3649805d85b1f0ebbab2fc01b4f8f734f78a739c1aebd44fa89289af4973c1dd70cbadebecc726237b7aab8f5
+EBUILD gcc-python-plugin-0.9.ebuild 2089 SHA256 9ac645782c845f852f7763e923d8f5d61ba0aebaa7fe00791b3c162172955973 SHA512 0a54144e81022a4405fac1d368025d444434dc75b5e54b8d8b8fd1451d40edf1b900f3c220ea6556efe553625e4c30c4f84cd0ee4ede114a576c809ab162b3df WHIRLPOOL d10c48e228400f75098cb8597afab60f06e42907aaa8b7ea657c21fb1b956639e768f00237ea04568f7b46037de2f973abec48661986bed59463465c5e6030ad
+EBUILD gcc-python-plugin-9999.ebuild 1934 SHA256 2abe5332c50d51a6f3455886735b24df57cceedbd26284e76a7d2fbd20b63efd SHA512 0144a856487aaccbad8ec54616ed2658ea22b681a15bd0e22d3e16b97c2eda9207aa2736084e05085ed888c32beadedd3ef9085618e66f160dad455b46439f1c WHIRLPOOL 804420b6bd877cfb035696beda38b5e83c04f529818dcb20ba88c230d98d348aaf1b1141fd5c85edbe6523e62970cf51dd8f52dfe01564068a741500d6043571
+MISC ChangeLog 318 SHA256 3064b62e222e92ce3d5e2c81a72a20667d12444025acdd2bcf933070eaf16f8f SHA512 8e0d39c3da4cb18fe3b949b5c683b8a1cf51de52d9e1049238aab6f00b94bcfc3676b7605c58530841dcd40a152ef58e1163b1f3bf6178f42c01194a4dcd3bcb WHIRLPOOL b687d35f034541df7f898a80987e9c9006b10432b51954daad340c54bafcafc7ac9021c1acc5245e30a01bf7bda5c294e160c3d7bcd9a5ca956ae48ddac509b1
diff --git a/dev-util/gcc-python-plugin/files/gcc-python-plugin-cpp-compilation.diff b/dev-util/gcc-python-plugin/files/gcc-python-plugin-cpp-compilation.diff
new file mode 100644
index 0000000..f020425
--- /dev/null
+++ b/dev-util/gcc-python-plugin/files/gcc-python-plugin-cpp-compilation.diff
@@ -0,0 +1,107 @@
+diff --git a/Makefile b/Makefile
+index 05c147b..56c0321 100644
+--- a/Makefile
++++ b/Makefile
+@@ -102,9 +102,9 @@ GCC_PYTHON_PLUGIN_SO := python.so
+ CPPFLAGS+= -I$(GCCPLUGINS_DIR)/include -I$(GCCPLUGINS_DIR)/include/c-family -I. $(PYTHON_INCLUDES)
+ # Allow user to pick optimization, choose whether warnings are fatal,
+ # and choose debugging information level.
+-CFLAGS?=-O2 -Werror -g
++CFLAGS?=-O2 -g
+ # Force these settings
+-CFLAGS+= -fPIC -fno-strict-aliasing -Wall
++CFLAGS+= -fPIC -fno-strict-aliasing -Wno-write-strings -fpermissive
+ LIBS+= $(PYTHON_LIBS)
+ ifneq "$(PLUGIN_PYTHONPATH)" ""
+ CPPFLAGS+= -DPLUGIN_PYTHONPATH='"$(PLUGIN_PYTHONPATH)"'
+diff --git a/gcc-python-wrapper.c b/gcc-python-wrapper.c
+index 93feb58..c8b6ed0 100644
+--- a/gcc-python-wrapper.c
++++ b/gcc-python-wrapper.c
+@@ -136,10 +136,55 @@ PyTypeObject PyGccWrapperMetaType = {
+ "gcc.WrapperMeta", /*tp_name*/
+ sizeof(PyGccWrapperTypeObject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+-
+- .tp_flags = Py_TPFLAGS_DEFAULT,
+- .tp_base = &PyType_Type,
+- .tp_new = gcc_python_wrapper_meta_tp_new,
++ NULL, /* tp_dealloc */
++ NULL, /* tp_print */
++ NULL, /* tp_getattr */
++ NULL, /* tp_setattr */
++#if PY_MAJOR_VERSION < 3
++ 0, /*tp_compare*/
++#else
++ 0, /*reserved*/
++#endif
++ NULL, /* tp_repr */
++ NULL, /* tp_as_number */
++ NULL, /* tp_as_sequence */
++ NULL, /* tp_as_mapping */
++ NULL, /* tp_hash */
++ NULL, /* tp_call */
++ NULL, /* tp_str */
++ NULL, /* tp_getattro */
++ NULL, /* tp_setattro */
++ NULL, /* tp_as_buffer */
++ Py_TPFLAGS_DEFAULT, /* tp_flags */
++ 0, /*tp_doc*/
++ NULL, /* tp_traverse */
++ NULL, /* tp_clear */
++ NULL, /* tp_richcompare */
++ 0, /* tp_weaklistoffset */
++ NULL, /* tp_iter */
++ NULL, /* tp_iternext */
++ NULL, /* tp_methods */
++ NULL, /* tp_members */
++ NULL, /* tp_getset */
++ &PyType_Type, /* tp_base */
++ NULL, /* tp_dict */
++ NULL, /* tp_descr_get */
++ NULL, /* tp_descr_set */
++ 0, /* tp_dictoffset */
++ NULL, /* tp_init */
++ NULL, /* tp_alloc */
++ gcc_python_wrapper_meta_tp_new, /* tp_new */
++ NULL, /* tp_free */
++ NULL, /* tp_is_gc */
++ NULL, /* tp_bases */
++ NULL, /* tp_mro */
++ NULL, /* tp_cache */
++ NULL, /* tp_subclasses */
++ NULL, /* tp_weaklist */
++ NULL, /* tp_del */
++#if PY_VERSION_HEX >= 0x02060000
++ 0, /*tp_version_tag*/
++#endif
+ };
+
+ /* Maintain a circular linked list of PyGccWrapper instances: */
+diff --git a/gcc-python.c b/gcc-python.c
+index f037988..5421181 100644
+--- a/gcc-python.c
++++ b/gcc-python.c
+@@ -81,11 +81,11 @@ gcc_python_define_macro(PyObject *self,
+ PyObject *args, PyObject *kwargs)
+ {
+ const char *macro;
+- char *keywords[] = {"macro",
++ const char *keywords[] = {"macro",
+ NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+- "s:define_preprocessor_name", keywords,
++ "s:define_preprocessor_name", (char**)keywords,
+ &macro)) {
+ return NULL;
+ }
+@@ -463,7 +463,7 @@ static struct PyModuleDef gcc_module_def = {
+ };
+ #endif
+
+-static PyMODINIT_FUNC PyInit_gcc(void)
++PyMODINIT_FUNC PyInit_gcc(void)
+ {
+ #if PY_MAJOR_VERSION == 3
+ PyObject *m;
diff --git a/dev-util/gcc-python-plugin/gcc-python-plugin-0.10.ebuild b/dev-util/gcc-python-plugin/gcc-python-plugin-0.10.ebuild
new file mode 100644
index 0000000..267ab24
--- /dev/null
+++ b/dev-util/gcc-python-plugin/gcc-python-plugin-0.10.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+
+SUPPORT_PYTHON_ABIS="1"
+PYTHON_DEPEND="*"
+PYTHON_EXPORT_PHASE_FUNCTIONS="1"
+
+inherit python toolchain-funcs versionator eutils
+
+DESCRIPTION="GCC Python plugin for static analysis"
+HOMEPAGE="https://fedorahosted.org/gcc-python-plugin"
+SRC_URI="https://fedorahosted.org/releases/g/c/gcc-python-plugin/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="doc"
+
+DEPEND="${DEPEND}
+>=sys-devel/gcc-4.6
+dev-python/six
+dev-python/pygments
+media-gfx/graphviz
+doc? (
+ dev-python/sphinx
+ dev-python/pycairo
+)
+"
+
+RDEPEND="${DEPEND}"
+
+DEPEND="${DEPEND}
+doc? (
+ dev-python/sphinx
+ dev-python/pycairo
+)
+"
+
+src_configure() {
+ return
+}
+
+src_prepare() {
+ if $(version_is_at_least 4.7 $(gcc-version)); then
+ CC=g++
+ einfo "Patching for C++ compilation"
+ epatch "${FILESDIR}/${PN}-cpp-compilation.diff"
+ fi
+
+ python_src_prepare
+}
+
+src_compile() {
+ rename_items() {
+ PLUGIN_NAME="python$(python_get_version --major)"
+ GCC_WITH_PYTHON_SCRIPT_NAME="gcc-with-${PLUGIN_NAME}"
+
+ cp python.so "${PLUGIN_NAME}.so"
+ cp gcc-with-python "${GCC_WITH_PYTHON_SCRIPT_NAME}"
+ sed -i -e"s|-fplugin=[^ ]*|-fplugin=${PLUGIN_NAME}|" "${GCC_WITH_PYTHON_SCRIPT_NAME}"
+ sed -i -e"s|-fplugin-arg-python-script|-fplugin-arg-${PLUGIN_NAME}-script|" "${GCC_WITH_PYTHON_SCRIPT_NAME}"
+ }
+
+ python_execute_function -d -s plugin
+ python_execute_function -s rename_items
+
+ cd "${WORKDIR}/${P}-$(python_get_version -f)"
+
+ emake man
+
+ if use doc; then
+ emake html
+ fi
+}
+
+src_test() {
+ emake testcpybuilder test-suite testcpychecker
+}
+
+src_install() {
+ GCC_PLUGIN_DIR="$(gcc --print-file-name=plugin)"
+
+ install_plugin_files() {
+ dobin "gcc-with-python$(python_get_version --major)"
+ insinto "${GCC_PLUGIN_DIR}"
+ doins "python$(python_get_version --major).so"
+ insinto "$(python_get_sitedir)"
+ doins gccutils.py
+ doins -r libcpychecker
+ }
+
+ python_execute_function -s install_plugin_files
+ dobin "${FILESDIR}/gcc-with-python"
+
+ cd "${WORKDIR}/${P}-$(python_get_version -f)"
+
+ doman docs/_build/man/*
+
+ if use doc; then
+ dodoc -r examples
+ dodoc -r docs/_build/html
+ fi
+}