diff options
Diffstat (limited to 'dev-python/pycairo')
20 files changed, 2031 insertions, 0 deletions
diff --git a/dev-python/pycairo/Manifest b/dev-python/pycairo/Manifest new file mode 100644 index 000000000000..e1d101db7031 --- /dev/null +++ b/dev-python/pycairo/Manifest @@ -0,0 +1,28 @@ +AUX py2cairo-1.10.0-ppc-darwin.patch 446 SHA256 c957cd14eb2c3fce0169a54b13665522fe1ada1af61a865903aad595afa309b1 SHA512 003e3266542242d349baa522552392aa448738f91a37ef0e6c8dedc3e0c179ca98167ab2ea7d75bd7d708f24f286099440a7a6a784767530eca161486403b033 WHIRLPOOL 0695123f4c9b3e82c22f1ba632243226d1dfe50442ea515abe440632221984c10aff233b8407a0e8dd4f594a1464c4fb7f121e43cfd0d03a2529ed1163e1a649 +AUX py2cairo-1.10.0-svg_check.patch 2912 SHA256 c35d96be5be571c2f4c3415e4016a7e70a5edd6164818af80d16855e4e4efe72 SHA512 e0069738659db0fa3c0532efa7e53fed5f088ee4ce276fd6ddcfcd0ee1e8b4861a09330afe8a30bb45b912c7a93cf6e42dd6057ad7f5adabfdddeb58bc10bbe8 WHIRLPOOL 90ccae77f2641c1f9f4ad6f6497fd7912a952b7b948fe64845e8c60629d4f70c590fd33dd276c54cbc8251d45e8bd201841d7bc3fa04a37a314f1f375b8250c7 +AUX py2cairo-1.10.0-xpyb.patch 952 SHA256 d6809bf00608d007f866040025392174e0cf3efe3ac03277436e00bacdcef54a SHA512 45fa1d32a8a4fc79b10e9221af286eef3f9d2c2b4991c066b1e18bd329feb764d07c4ebc58e1926ae86c4cb4a2ed0fd172f75f7479cec0be51ec5c5da6d4f13d WHIRLPOOL f8818581d471735748b546ffa0f4ac42bc5f623ae0ab383a70cf5977727ba933509497d3071aeb572e764c5e164680c16f8d476b0d8f1b7659dda7190b226cda +AUX pycairo-1.10.0-101_pycairo-region.patch 27745 SHA256 93e189149e85c982607e0eafbb622da0b14f259662c8f81b6b59a1f639a52797 SHA512 5a66da5dc1c0888c423e2f62ae618b1ffbe03df9af249fc026cedc927d1eaff43e31fac38a58e4d59a2876be95e17e4a05679420162aaee111caf4d199a38552 WHIRLPOOL 15bac5be6149e86a3e96a72fe4b73c16d285c6fd555787023c91221ad6ed5c0e6977fb9a89af76806d452bb556395bfc3186ab180eacaa924295366bcf298b2e +AUX pycairo-1.10.0-50_specify-encoding-in-waf.patch 1132 SHA256 611947d3f66fbb3b5a7900a5fb827c21b18ff6c97dad27c874eeef4d8744b842 SHA512 1136413bcecf1e34101d8b7b1930c506a401baa3594c22978e9c6b53eb3d555c40153b608007402428a6a8806348129de6397460a42b219e39f823adcc1951fd WHIRLPOOL d78cc1879a6358f4cfbfe164f75a71a602e1823a25128483727ad2151593016d626124cda293f909944cc76a148a8ed31b81950a3ac6491a195e01f7cd9a3715 +AUX pycairo-1.10.0-80_fix-pickle.patch 1057 SHA256 f42993b81d9c0a7bf2cdd4f23e79f6424a3f6ddd09a096c3a151e396e03f6d1e SHA512 934386e2fb3dd470a067c359e70dc1985a303e9e28a4592e1a482dc253abd80f4933d90448cc4fea10bfaa01a8f3f2b83c865e926db7da699768e05a4e3d53e1 WHIRLPOOL 5792affc16265e7b14cc77ebd7d7ed4c0c5dcd10c8ba280fcc823d429721c9c47b0ce63df52210cff7a6246b9d8758e475d098e3c2811758d53b413d67c0e896 +AUX pycairo-1.10.0-81_pickling-again.patch 973 SHA256 f5445061bb0403edc4d937b3a6842fcbe51a39b278c9fb606e6badd2c2e0d13e SHA512 5379b94ca473541b41af34e8c1f23ff8705a972b87bb1eeba3e21519ca1508be92cc5d603610e89be3188e0dbca1069e19148f54cf8884fe0acb70d934dfd95c WHIRLPOOL 53a67d84f8cdd87059bdf6660a0e669bce6ca9205f14463803c5bf9c44a9ea45be4e13176c7de5cf83939c9f8c16fa319b3246442d9a2ef66c2bb2e7c908542b +AUX pycairo-1.10.0-svg_check.patch 2924 SHA256 f9d2bac70bcca57c523e69403cb7332bf4ade0427998b6a3dc16730bcc17b6c7 SHA512 a05fc725c9c8ac48b262795c6c6e56b3a432f73d69657565763292f74cbd8b3d4eaabc1a5dd5db0b74cad297cc330caed271c40fbb16d459019b4c75ab33ccef WHIRLPOOL ceaf8bf26f9783bd017fbfb6b81f00ece0122d1f57ad6ae3d87f40b39d7a4bbb47bab89891f3f12357f44f26039a6c63bf46b25765fac2412bd079c6e17dd6cf +AUX pycairo-1.10.0-waf-py3_4.patch 511 SHA256 a4c5526c045972087ec12f68192e14f3f6910b2c2ea4e7a7b742dfd8520cd475 SHA512 7f8b76483b8f193ba03b89030f9f418632d6a062e4026534404031612c870f206392c82f52f2c64a9960e3e5b43562155449baedd7e3dbd0562a65f32ab33315 WHIRLPOOL 23a846d28676cded354b1b3a9f3e9010fc955d47b4db7d6d6f3bc9247d37afb98f8b928a203d47e454113a5a69d228de36249b4d07d86eeade112c40cc0f23ea +AUX pycairo-1.10.0-waf-unpack.patch 262 SHA256 ad9f1b924397b5b14fcf2e903f4da9851f06414e25fa4d5fa1a4c36a0586b9ae SHA512 05ff350976729122238d97bf69ec5e55bc489404ec1d8cae478ecb28baa6676a100b520aedc0d3dd6bf77385bc6f34de6cd32d33a5c5b0c593059309e3628d0a WHIRLPOOL b66d080e98a5cb70634b90fb7922c13e7c2bc338b64e1a9f3a38ccd5111592e72668d55e3fbccdcfe904c1296150273005a7b93202b4300ff6f792476873a5f1 +AUX pycairo-1.10.0-xpyb.patch 1112 SHA256 5c6ae65a5f1b6eee0e56fb39f7fade34dc20dc38c7cefa5841a45d8c23bb9a0c SHA512 69c826970b36075b3a1ce63b2db89ac1779902a570af95b28c07536ce91c3c9adce234444a86b6211e9b53b0293a56173de88d76f50f77a0ed3aa17e2aefcfb3 WHIRLPOOL 30d18f9910ed29d798d5eae610f608af76d2b0c1fb89801f25b1ca9b97e58d2a15ab1c948386ad326d249ffe899e0187561c2708b692287b80039e21f5185b88 +DIST py2cairo-1.10.0.tar.bz2 402070 SHA256 d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431 SHA512 cb3d54de9af4134460ce731da8166a3127a642c8a2e6184109437ddec115cd55b8dd2413a5c81700277bfe2f22fcfe268db4f3ba0f7649751e85bb34295f79fc WHIRLPOOL 60b57d55b27f06acd62714ac6ad7973ab973d42995fb536ae800263a2e8c7451a24ccafd96fe30f5bfa26e1ae218934d4fafaafec3e9666a39b33c78672407e2 +DIST pycairo-1.10.0.tar.bz2 246556 SHA256 9aa4078e7eb5be583aeabbe8d87172797717f95e8c4338f0d4a17b683a7253be SHA512 a03db6f04cea504985f390b0734042390f491f32ae2bee1299dabbafd369fde36bb506ebb941d22bbc11b0d008c4f758baeacf309a7336880529455092db829f WHIRLPOOL e779d56d67ef18bbd052d81acb38d8b610ca4bbf787f4b0e3982633de55ff54d6dfa3e5ce1957321fba09f0ec2d12ce12057335de9d5ff3f84c2bc0530415e76 +DIST pycairo-1.13.1.tar.gz 123690 SHA256 d8f58de67ddd01eda9e5112de57599b7d0154d71c9474821e98866c228794641 SHA512 705979aec5166d1e750ddf2938934edb18d5093e340d9e604a70dc02499ec478db7b0c84572f7ff287139c1b3982a31a254c36641123aee183b3053efe299d59 WHIRLPOOL 307e052d632a4591b67776b62ea173b647273151411bb8bfa9cc4d6dd066dbba30b3ea2bd1b066f6c91fe0a7275e76d1a6c0ebcb15c9113ab28a3ceec04e59fa +DIST pycairo-1.15.0.tar.gz 167963 SHA256 b469b782ffabeeeb5973b64ee55e993521f32ac658b24baccbcd3f939c4f44f8 SHA512 e27f1b31225fe6eba7722a412a4eb9c591a3ce4887ba5a7edb738f757efa8372c1e2cd6ecd52386c350bb5058d8fa1806ee1d5ecabc2377d1934ded29b8592c9 WHIRLPOOL fcd5764ba1f71513ae164555eea081f21565c03ebd2a48cf89adfe29b3f7b3bdd364b5b19f403e5ade3109beddfc81bfbcd25666285dec1a2833c11e8559f249 +DIST pycairo-1.15.1.tar.gz 175924 SHA256 987d392270247343595d37591f80639ed902fce7e30bd2f944cb1b0a9093553d SHA512 931b6ca704fcae501b7671dd6cd964746951e08b5d09dc7118e3ff5c3c1f8aba9d211efe7867b77bb30f14f4700f888c7ed297ec5e8afca06d3d7327835c8e1f WHIRLPOOL 3d85ebebfab81a9447e4073f00f77ad0dc204f7f18799cec37b1afde50831faaa8fb01a713548917fa6dc80f7a165a4a032c92224cf09c9837b0b6e47e7bb973 +DIST pycairo-1.15.2.tar.gz 176051 SHA256 a66f30c457736f682162e7b3a33bc5e8915c0f3b31ef9bdb4edf43c81935c914 SHA512 ce0ee0b1775eac75eaee9eddcd9dda21d99a6327bac55e0d2e15ce3a8a1869e4d44c59eada1725ba3cdda16fac4ce33a7c350ffdae3892dac85c5e70033e3ee1 WHIRLPOOL 89d8f9a97c3cd7d5d1b2360641ff361dfca0f2567d01fdc96035f57f5389f49249976c341ff5995d9af515c52171a1e5d0ab222b07d00e4020579b3d35a08a2a +DIST pycairo-1.15.3.tar.gz 177056 SHA256 8642e36cef66acbfc02760d2b40c716f5f183d073fb063ba28fd29a14044719d SHA512 1fc75d193eacb976f2e5a594aa07409a0f80ccb21921065c1794961143785eed48be1966d2d2d3e2d0428f9b4e956994dd851d21f3c3cb91fbc27b007a901ce8 WHIRLPOOL e9248366c8eb541bc70ad73c9c6eea995a2527d189584a1ec6f6b835fdeae57d1aa63e2deaa9f790042d0670e7d07af8867b111ac107b53befd354c3cfc70ca1 +EBUILD pycairo-1.10.0-r4.ebuild 4045 SHA256 922c9a0faabaf52f1badd0694b19f88de7dd7bcb14d4de7c38c59c1a975d35f4 SHA512 d9de003ee4a8412ec1acefd8bbbb0010a53a516ea1385774ac2b8a8864c95e4ed2d14af7ab1a4df9ce07ebf0739637a03e5bcad5e5db0075a03577cf5c6b9ea6 WHIRLPOOL a6ca16158367d3dbdddb04c50d332dfe4fdff9fb8282547c647efe7b9c2018e4eaa7f5036a52dcbaead22032b32aa9652a831277ba5934b405bbb11d6e67ade3 +EBUILD pycairo-1.10.0-r5.ebuild 4495 SHA256 ad07524254a26ee0c98d4a2b84836ceb8b17c69d8d744899431b787e376b2892 SHA512 31bc472872e47ef634111d74e1e2dd38506938fa27415b42068970b8b753d13e71fbd018cae6bf9e0e68c0ae10111dd0ed60e0f735a103ff5bc6fe7faadc8fa4 WHIRLPOOL c3ba51755525740e1d0a75898c1d6acb851c57ce6a3ef33ab414baa52f5d3039dc3f957f68df912419ec2c0d561d06400bb646de53b2e85819b9ec0af1690465 +EBUILD pycairo-1.13.1-r1.ebuild 1582 SHA256 8034147a9892aff7f60de1252278c0dfcb35ee0c32abed19eaf419f82650fe03 SHA512 032b6a99d81593387db6be0014fa29a20a78c87aa1450a0626729fce31b165e6eecec70797686a93a8342fe69c6ed134117876d6e6e007efe81bf8547fad3b92 WHIRLPOOL 7e84775c8126956dbfe8b72f26b99245a9722f92493c23374317fd7847436777acd07d25afcce6e77169c2512cb981be9a7e6b98486736c7f056f684e31373c5 +EBUILD pycairo-1.15.0.ebuild 1616 SHA256 583f9673168578eb903c857d0b57ab5e38ca22235df654e3f4a0f9edce611680 SHA512 f8fc6a76feb2a2544c558965a2004151e8a259de7466195c02a18657e614fd956b94b21c1038a5868a74c904f8fe20f3eb06c9c352b73a83688d6fcf8ff57c0b WHIRLPOOL 1bc5c48d88fa2cb6fb677bc6e0f69fa9097e18c5d327c7d89b3b709bd5a44f65e7dbdf17e7ae44263b53bfe7dd7e9072d50f645f1dc4a9c18ea1e3e10e22d3df +EBUILD pycairo-1.15.1.ebuild 1616 SHA256 583f9673168578eb903c857d0b57ab5e38ca22235df654e3f4a0f9edce611680 SHA512 f8fc6a76feb2a2544c558965a2004151e8a259de7466195c02a18657e614fd956b94b21c1038a5868a74c904f8fe20f3eb06c9c352b73a83688d6fcf8ff57c0b WHIRLPOOL 1bc5c48d88fa2cb6fb677bc6e0f69fa9097e18c5d327c7d89b3b709bd5a44f65e7dbdf17e7ae44263b53bfe7dd7e9072d50f645f1dc4a9c18ea1e3e10e22d3df +EBUILD pycairo-1.15.2.ebuild 1616 SHA256 583f9673168578eb903c857d0b57ab5e38ca22235df654e3f4a0f9edce611680 SHA512 f8fc6a76feb2a2544c558965a2004151e8a259de7466195c02a18657e614fd956b94b21c1038a5868a74c904f8fe20f3eb06c9c352b73a83688d6fcf8ff57c0b WHIRLPOOL 1bc5c48d88fa2cb6fb677bc6e0f69fa9097e18c5d327c7d89b3b709bd5a44f65e7dbdf17e7ae44263b53bfe7dd7e9072d50f645f1dc4a9c18ea1e3e10e22d3df +EBUILD pycairo-1.15.3.ebuild 1616 SHA256 583f9673168578eb903c857d0b57ab5e38ca22235df654e3f4a0f9edce611680 SHA512 f8fc6a76feb2a2544c558965a2004151e8a259de7466195c02a18657e614fd956b94b21c1038a5868a74c904f8fe20f3eb06c9c352b73a83688d6fcf8ff57c0b WHIRLPOOL 1bc5c48d88fa2cb6fb677bc6e0f69fa9097e18c5d327c7d89b3b709bd5a44f65e7dbdf17e7ae44263b53bfe7dd7e9072d50f645f1dc4a9c18ea1e3e10e22d3df +MISC ChangeLog 4405 SHA256 0290ffffd0f0c4c7daa5273929bff3e300f971663f78f268b7e6bcc8fff9b321 SHA512 15f3867446f2e1c27cdd63624c4f8014623162394982fdd10d11176118f099522963cddb461f62a6e2c240de8403dadc1a465ee795084b954f728452b55de8f0 WHIRLPOOL 689ea1a3fdbe13cd1253ff04895afddb70ccc278a7e98de65732bbff55564192bd0811ede6dbdf2f1840ec38bd35367d6864a26dfa20eee9ae68ec108538ad0b +MISC ChangeLog-2015 19702 SHA256 fe08ff0a819ad0b3a356f5f40a1a41df91a1f23b724a40d2f918629c722daccb SHA512 d5a3f9c9798f2a90ddb9ebcaf3883222d2e56fa8836a120ea8ff63890ce46aeeef7dfeb45e0a8c94d93e76aa463c65ca3a965db2a04917169841673eff2120f2 WHIRLPOOL 01e7b92dfefbb54123b9329c032657fc6e63d592b7d6b4d68a4e2a9e506ef0a50c2d680ee16c518d4e07858254a6ed2933260e891da934e3426ee0546fcc9f4e +MISC metadata.xml 246 SHA256 634432e12556106844e569b7ff16962881c6e70887e6fc9650bdd82deb51a834 SHA512 3245fb694492b2f698fb63aac02e66fb8a94fe35eabda45df4790bec043a1ea552e112315334001902f070093bb73e7b741aa3004757404aed97ebdb86cc9fbc WHIRLPOOL 869ef1c8e23bdae0a11b44ccf38ddec23f0dc0ae2573bc83ccbe2d8a2c6bf5a3f9c3c52149aa2e3690dd66f7fc7ec498f2eb6b9d338440fb54c12d5ac0b9fb7a diff --git a/dev-python/pycairo/files/py2cairo-1.10.0-ppc-darwin.patch b/dev-python/pycairo/files/py2cairo-1.10.0-ppc-darwin.patch new file mode 100644 index 000000000000..e921ac34acd2 --- /dev/null +++ b/dev-python/pycairo/files/py2cairo-1.10.0-ppc-darwin.patch @@ -0,0 +1,18 @@ +inspired by: +http://groups.google.com/group/waf-users/browse_thread/thread/2bd6774056c850bc/ +27bfdcac2fb9ec05?lnk=gst#27bfdcac2fb9ec05 + +we cannot "fix" the buildsystem, since it's bzip2-tarred *sigh* + + +--- waf ++++ waf +@@ -154,6 +154,8 @@ + + wafdir = find_lib() + sys.path.insert(0, wafdir) ++from waflib.Tools.c_config import MACRO_TO_DESTOS ++MACRO_TO_DESTOS['__POWERPC__'] = 'darwin' + + if __name__ == '__main__': + import waflib.extras.compat15 diff --git a/dev-python/pycairo/files/py2cairo-1.10.0-svg_check.patch b/dev-python/pycairo/files/py2cairo-1.10.0-svg_check.patch new file mode 100644 index 000000000000..4cd755c8d574 --- /dev/null +++ b/dev-python/pycairo/files/py2cairo-1.10.0-svg_check.patch @@ -0,0 +1,126 @@ +--- src/cairomodule.c ++++ src/cairomodule.c +@@ -127,7 +127,7 @@ + #else + 0, + #endif +-#ifdef CAIRO_HAS_SVG_SURFACE ++#ifdef PYCAIRO_ENABLE_SVG + &PycairoSVGSurface_Type, + #else + 0, +@@ -223,7 +223,7 @@ + if (PyType_Ready(&PycairoPSSurface_Type) < 0) + return; + #endif +-#ifdef CAIRO_HAS_SVG_SURFACE ++#ifdef PYCAIRO_ENABLE_SVG + if (PyType_Ready(&PycairoSVGSurface_Type) < 0) + return; + #endif +@@ -305,7 +305,7 @@ + PyModule_AddObject(m, "PSSurface", (PyObject *)&PycairoPSSurface_Type); + #endif + +-#ifdef CAIRO_HAS_SVG_SURFACE ++#ifdef PYCAIRO_ENABLE_SVG + Py_INCREF(&PycairoSVGSurface_Type); + PyModule_AddObject(m, "SVGSurface", (PyObject *)&PycairoSVGSurface_Type); + #endif +@@ -379,7 +379,7 @@ + #else + PyModule_AddIntConstant(m, "HAS_PS_SURFACE", 0); + #endif +-#if CAIRO_HAS_SVG_SURFACE ++#if PYCAIRO_ENABLE_SVG + PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 1); + #else + PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 0); +--- src/private.h ++++ src/private.h +@@ -86,7 +86,7 @@ + extern PyTypeObject PycairoPSSurface_Type; + #endif + +-#if CAIRO_HAS_SVG_SURFACE ++#if PYCAIRO_ENABLE_SVG + extern PyTypeObject PycairoSVGSurface_Type; + #endif + +--- src/pycairo.h ++++ src/pycairo.h +@@ -182,7 +182,7 @@ + #define PycairoPSSurface_Type *(Pycairo_CAPI->PSSurface_Type) + #endif + +-#if CAIRO_HAS_SVG_SURFACE ++#if PYCAIRO_ENABLE_SVG + #define PycairoSVGSurface_Type *(Pycairo_CAPI->SVGSurface_Type) + #endif + +--- src/surface.c ++++ src/surface.c +@@ -83,7 +83,7 @@ + type = &PycairoPSSurface_Type; + break; + #endif +-#if CAIRO_HAS_SVG_SURFACE ++#if PYCAIRO_ENABLE_SVG + case CAIRO_SURFACE_TYPE_SVG: + type = &PycairoSVGSurface_Type; + break; +@@ -1015,7 +1015,7 @@ + + + /* Class SVGSurface(Surface) ----------------------------------------------- */ +-#ifdef CAIRO_HAS_SVG_SURFACE ++#ifdef PYCAIRO_ENABLE_SVG + #include <cairo-svg.h> + + static PyObject * +@@ -1125,7 +1125,7 @@ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + }; +-#endif /* CAIRO_HAS_SVG_SURFACE */ ++#endif /* PYCAIRO_ENABLE_SVG */ + + + #if CAIRO_HAS_WIN32_SURFACE +--- wscript ++++ wscript +@@ -1,6 +1,7 @@ + # -*- python -*- + + import os ++import subprocess + + top = '.' + out = 'build_directory' +@@ -11,6 +12,17 @@ + cairo_version_required = '1.10.0' + + ++def check_svg(): ++ if os.environ.get('PYCAIRO_DISABLE_SVG', None) is None: ++ return_code = subprocess.call(['pkg-config', '--exists', 'cairo-svg']) ++ if return_code == 0: ++ return True ++ else: ++ return False ++ else: ++ return False ++ ++ + def options(ctx): + print(' %s/options()' %d) + ctx.tool_options('gnu_dirs') +@@ -39,6 +51,8 @@ + ctx.define('PYCAIRO_VERSION_MAJOR', version[0]) + ctx.define('PYCAIRO_VERSION_MINOR', version[1]) + ctx.define('PYCAIRO_VERSION_MICRO', version[2]) ++ if check_svg(): ++ ctx.define('PYCAIRO_ENABLE_SVG', 1) + + ctx.write_config_header('src/config.h') + diff --git a/dev-python/pycairo/files/py2cairo-1.10.0-xpyb.patch b/dev-python/pycairo/files/py2cairo-1.10.0-xpyb.patch new file mode 100644 index 000000000000..c136cb0c39a1 --- /dev/null +++ b/dev-python/pycairo/files/py2cairo-1.10.0-xpyb.patch @@ -0,0 +1,38 @@ +--- py2cairo-1.10.0/wscript ++++ py2cairo-1.10.0/wscript +@@ -10,6 +10,7 @@ + APPNAME='py2cairo' + VERSION='1.10.0' + cairo_version_required = '1.10.0' ++xpyb_version_required = '1.3' + + + def check_svg(): +@@ -23,6 +24,17 @@ + return False + + ++def check_xpyb(): ++ if os.environ.get('PYCAIRO_DISABLE_XPYB', None) is None: ++ return_code = subprocess.call(['pkg-config', '--exists', 'xpyb']) ++ if return_code == 0: ++ return True ++ else: ++ return False ++ else: ++ return False ++ ++ + def options(ctx): + print(' %s/options()' %d) + ctx.tool_options('gnu_dirs') +@@ -41,6 +53,9 @@ + ctx.check_python_headers() + ctx.check_cfg(package='cairo', atleast_version=cairo_version_required, + args='--cflags --libs') ++ if check_xpyb(): ++ ctx.check_cfg(package='xpyb', atleast_version=xpyb_version_required, ++ args='--cflags --libs', mandatory=False) + + # add gcc options + if env['CC_NAME'] == 'gcc': diff --git a/dev-python/pycairo/files/pycairo-1.10.0-101_pycairo-region.patch b/dev-python/pycairo/files/pycairo-1.10.0-101_pycairo-region.patch new file mode 100644 index 000000000000..4143f33cb247 --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.10.0-101_pycairo-region.patch @@ -0,0 +1,917 @@ +Description: Add support for cairo_region_t + This patch fix missing support for cairo_region_t. +Author: Bug Fly +Origin: https://bugs.freedesktop.org/attachment.cgi?id=61553 +Bug-Debian: http://bugs.debian.org/688079 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/py3cairo/+bug/1028115 +Last-Update: 2012-08-20 +Applied-Upstream: http://cgit.freedesktop.org/pycairo/commit/?id=75e82a1b3f495a3abbc78e50a5c66356d320fb15 + +--- py3cairo-1.10.0+dfsg.orig/doc/pycairo_c_api.rst ++++ py3cairo-1.10.0+dfsg/doc/pycairo_c_api.rst +@@ -51,6 +51,8 @@ Objects:: + PycairoGradient + PycairoLinearGradient + PycairoRadialGradient ++ PycairoRectangleInt ++ PycairoRegion + PycairoScaledFont + PycairoSurface + PycairoImageSurface +@@ -78,6 +80,8 @@ Types:: + PyTypeObject *Gradient_Type; + PyTypeObject *LinearGradient_Type; + PyTypeObject *RadialGradient_Type; ++ PyTypeObject *RectangleInt_Type; ++ PyTypeObject *Region_Type; + PyTypeObject *ScaledFont_Type; + PyTypeObject *Surface_Type; + PyTypeObject *ImageSurface_Type; +@@ -115,6 +119,12 @@ Functions + .. c:function:: PyObject * PycairoPattern_FromPattern(cairo_pattern_t *pattern, PyObject *base) + + ++.. c:function:: PyObject * PycairoRectangleInt_FromRectangleInt(const cairo_rectangle_int_t *rectangle_int) ++ ++ ++.. c:function:: PyObject * PycairoRegion_FromRegion(const cairo_region_t *region) ++ ++ + .. c:function:: PyObject * PycairoScaledFont_FromScaledFont(cairo_scaled_font_t *scaled_font) + + +--- py3cairo-1.10.0+dfsg.orig/doc/reference/index.rst ++++ py3cairo-1.10.0+dfsg/doc/reference/index.rst +@@ -15,5 +15,6 @@ Reference + matrix + paths + patterns ++ region + surfaces + text +--- /dev/null ++++ py3cairo-1.10.0+dfsg/doc/reference/region.rst +@@ -0,0 +1,52 @@ ++.. _region: ++ ++****** ++Region ++****** ++Region — Representing a pixel-aligned area ++ ++.. currentmodule:: cairo ++ ++ ++class Region() ++============== ++*Region* is a simple graphical data type representing an area of ++integer-aligned rectangles. They are often used on raster surfaces to track ++areas of interest, such as change or clip areas. ++ ++ ++.. class:: Region([rectangle_int|rectangle_ints]) ++ ++ :param rectangle_int: a rectangle or a list of rectangle ++ :type rectangle_int: :class:`RectangleInt` or [:class:`RectangleInt`] ++ ++ Allocates a new empty region object or a region object with the containing ++ rectangle(s). ++ ++ ++ .. method:: copy() ++ ++ :returns: A newly allocated :class:`Region`. ++ :raises: :exc:`NoMemory` if memory cannot be allocated. ++ ++ Allocates a new *Region* object copying the area from original. ++ ++ ++class RectangleInt() ++==================== ++*RectangleInt* is a data structure for holding a rectangle with integer ++coordinates. ++ ++ ++.. class:: RectangleInt(x=0, y=0, width=0, height=0) ++ ++ :param x: X coordinate of the left side of the rectangle ++ :type x: int ++ :param y: Y coordinate of the the top side of the rectangle ++ :type y: int ++ :param width: width of the rectangle ++ :type width: int ++ :param height: height of the rectangle ++ :type height: int ++ ++ Allocates a new *RectangleInt* object. +--- /dev/null ++++ py3cairo-1.10.0+dfsg/src/region.c +@@ -0,0 +1,598 @@ ++/* -*- mode: C; c-basic-offset: 2 -*- ++ * ++ * Copyright © 2005,2010 Steve Chaplin ++ * ++ * This file is part of pycairo. ++ * ++ * Pycairo is free software: you can redistribute it and/or modify it under ++ * the terms of the GNU Lesser General Public License version 3 as published ++ * by the Free Software Foundation. ++ * ++ * Pycairo 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 Lesser General Public License for ++ * more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with pycairo. If not, see <http://www.gnu.org/licenses/>. ++ */ ++ ++#define PY_SSIZE_T_CLEAN ++#include <Python.h> ++#include "structmember.h" ++ ++#include "config.h" ++#include "private.h" ++ ++/* PycairoRectangleInt_FromRectangleInt ++ * Create a new PycairoRectangleInt from a cairo_rectangle_int_t ++ * rectangle_int - a cairo_rectangle_int_t to 'wrap' into a Python object. ++ * rectangle_int is unreferenced if the PycairoRectangleInt creation ++ * fails. ++ * Return value: New reference or NULL on failure ++ */ ++PyObject * ++PycairoRectangleInt_FromRectangleInt (cairo_rectangle_int_t *rectangle_int) { ++ PyObject *o; ++ ++ assert (rectangle_int != NULL); ++ ++ o = PycairoRectangleInt_Type.tp_alloc (&PycairoRectangleInt_Type, 0); ++ if (o) ++ ((PycairoRectangleInt *)o)->rectangle_int = *rectangle_int; ++ return o; ++} ++ ++static void ++rectangle_int_dealloc(PycairoRectangleInt *o) { ++#ifdef DEBUG ++ printf("rectangle_int_dealloc start\n"); ++#endif ++ //o->ob_type->tp_free((PyObject *)o); ++ Py_TYPE(o)->tp_free(o); ++#ifdef DEBUG ++ printf("rectangle_int_dealloc end\n"); ++#endif ++} ++ ++static PyObject * ++rectangle_int_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { ++ static char *kwlist[] = { "x", "y", "width", "height", NULL }; ++ int x, y, w, h; ++ x = y = w = h = 0; ++ cairo_rectangle_int_t rect; ++ ++ if (!PyArg_ParseTupleAndKeywords(args, kwds, ++ "|iiii:RectangleInt.__new__", kwlist, ++ &x, &y, &w, &h)) ++ return NULL; ++ ++ rect.x = x; ++ rect.y = y; ++ rect.width = w; ++ rect.height = h; ++ ++ return PycairoRectangleInt_FromRectangleInt(&rect); ++} ++ ++static PyObject * ++rectangle_int_str(PycairoRectangleInt *rect_o) { ++ PyObject *s; ++ cairo_rectangle_int_t *rect = &(rect_o->rectangle_int); ++ char buf[80]; ++ PyOS_snprintf(buf, sizeof(buf), "cairo.RectangleInt(%d, %d, %d, %d)", ++ rect->x, rect->y, rect->width, rect->height); ++ s = PyUnicode_FromString(buf); ++ return s; ++} ++ ++static PyObject * ++rectangle_int_richcompare(PycairoRectangleInt *self, ++ PycairoRectangleInt *other, int op) { ++ int res = 0; ++ PyObject *b; ++ ++ if (op != Py_EQ && op != Py_NE) { ++ PyErr_SetString(PyExc_TypeError, "Only support testing for == or !="); ++ return NULL; ++ } ++ if (!PyObject_IsInstance((PyObject*)other, ++ (PyObject*)&PycairoRectangleInt_Type)) { ++ res = 0; ++ } ++ else if ( ++ self->rectangle_int.x == other->rectangle_int.x && ++ self->rectangle_int.y == other->rectangle_int.y && ++ self->rectangle_int.width == other->rectangle_int.width && ++ self->rectangle_int.height == other->rectangle_int.height ++ ) ++ res = 1; ++ res = op == Py_NE ? !res : res; ++ b = res ? Py_True : Py_False; ++ Py_INCREF(b); ++ ++ return b; ++} ++ ++static PyMemberDef RectangleInt_members[] = { ++ {"x", T_INT, sizeof(PyObject), 0, ++ "X coordinate of the left side of the rectangle"}, ++ {"y", T_INT, sizeof(PyObject)+sizeof(int), 0, ++ "Y coordinate of the the top side of the rectangle"}, ++ {"width", T_INT, sizeof(PyObject)+sizeof(int)*2, 0, ++ "width of the rectangle"}, ++ {"height", T_INT, sizeof(PyObject)+sizeof(int)*3, 0, ++ "height of the rectangle"}, ++ {NULL} ++}; ++ ++PyTypeObject PycairoRectangleInt_Type = { ++ PyVarObject_HEAD_INIT(&PyType_Type, 0) ++ "cairo.RectangleInt", /* tp_name */ ++ sizeof(PycairoRectangleInt), /* tp_basicsize */ ++ 0, /* tp_itemsize */ ++ (destructor)rectangle_int_dealloc, /* tp_dealloc */ ++ 0, /* tp_print */ ++ 0, /* tp_getattr */ ++ 0, /* tp_setattr */ ++ 0, /* tp_compare */ ++ 0, /* tp_repr */ ++ 0, /* tp_as_number */ ++ 0, /* tp_as_sequence */ ++ 0, /* tp_as_mapping */ ++ 0, /* tp_hash */ ++ 0, /* tp_call */ ++ (reprfunc)rectangle_int_str, /* tp_str */ ++ 0, /* tp_getattro */ ++ 0, /* tp_setattro */ ++ 0, /* tp_as_buffer */ ++ Py_TPFLAGS_DEFAULT, /* tp_flags */ ++ 0, /* tp_doc */ ++ 0, /* tp_traverse */ ++ 0, /* tp_clear */ ++ (richcmpfunc)rectangle_int_richcompare, /* tp_richcompare */ ++ 0, /* tp_weaklistoffset */ ++ 0, /* tp_iter */ ++ 0, /* tp_iternext */ ++ 0, /* tp_methods */ ++ RectangleInt_members, /* tp_members */ ++ 0, /* tp_getset */ ++ 0, /* tp_base */ ++ 0, /* tp_dict */ ++ 0, /* tp_descr_get */ ++ 0, /* tp_descr_set */ ++ 0, /* tp_dictoffset */ ++ 0, /* tp_init */ ++ 0, /* tp_alloc */ ++ (newfunc)rectangle_int_new, /* tp_new */ ++}; ++ ++/* PycairoRegion_FromRegion ++ * Create a new PycairoRegion from a cairo_region_t ++ * region - a cairo_region_t to 'wrap' into a Python object. ++ * region is unreferenced if the PycairoRegion creation fails, or if ++ * region is in an error status. ++ * Return value: New reference or NULL on failure ++ */ ++PyObject * ++PycairoRegion_FromRegion (cairo_region_t *region) { ++ PyObject *o; ++ ++ assert (region != NULL); ++ ++ if (Pycairo_Check_Status (cairo_region_status(region))) { ++ cairo_region_destroy (region); ++ return NULL; ++ } ++ ++ o = PycairoRegion_Type.tp_alloc (&PycairoRegion_Type, 0); ++ if (o) ++ ((PycairoRegion *)o)->region = region; ++ else ++ cairo_region_destroy (region); ++ return o; ++} ++ ++static void ++region_dealloc(PycairoRegion *o) { ++#ifdef DEBUG ++ printf("region_dealloc start\n"); ++#endif ++ if (o->region) { ++ cairo_region_destroy(o->region); ++ o->region = NULL; ++ } ++ //o->ob_type->tp_free((PyObject *)o); ++ Py_TYPE(o)->tp_free(o); ++#ifdef DEBUG ++ printf("region_dealloc end\n"); ++#endif ++} ++ ++static PyObject * ++region_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { ++ PyObject *s = NULL; ++ PycairoRectangleInt *rect_obj = NULL; ++ cairo_region_t *region = NULL; ++ cairo_rectangle_int_t *rect = NULL; ++ ++ if (PyArg_ParseTuple(args, "|O!:Region.__new__", ++ &PycairoRectangleInt_Type, &rect_obj)) { ++ if (rect_obj != NULL) { ++ region = cairo_region_create_rectangle(&(rect_obj->rectangle_int)); ++ } ++ } else if (!PyArg_ParseTuple(args, "|O:Region.__new__", &s)) { ++ PyErr_SetString(PyExc_TypeError, ++ "argument must be a RectangleInt or a sequence of RectangleInt."); ++ return NULL; ++ } ++ PyErr_Clear(); /* Clear possible err in the 1st arg parser. */ ++ ++ /* list of rectangle_int or no args */ ++ if (s != NULL) { ++ int i; ++ int rect_size; ++ PyObject *seq = NULL; ++ seq = PySequence_Fast (s, ++ "argument must be a RectangleInt or a sequence of RectangleInt."); ++ if (seq == NULL) { ++ return NULL; ++ } ++ rect_size = PySequence_Fast_GET_SIZE(seq); ++ rect = PyMem_Malloc (rect_size * sizeof(cairo_rectangle_int_t)); ++ if (rect == NULL) { ++ Py_DECREF(seq); ++ return PyErr_NoMemory(); ++ } ++ ++ for(i=0; i<rect_size; i++) { ++ PyObject *obj_tmp = PySequence_Fast_GET_ITEM(seq, i); ++ if (PyObject_IsInstance(obj_tmp, ++ (PyObject*)&PycairoRectangleInt_Type) != 1) { ++ Py_DECREF(seq); ++ PyMem_Free(rect); ++ return NULL; ++ } ++ rect_obj = (PycairoRectangleInt*) obj_tmp; ++ rect[i] = rect_obj->rectangle_int; ++ } ++ ++ region = cairo_region_create_rectangles(rect, rect_size); ++ ++ Py_DECREF(seq); ++ PyMem_Free(rect); ++ } ++ ++ if (region == NULL) { ++ region = cairo_region_create(); ++ } ++ ++ RETURN_NULL_IF_CAIRO_REGION_ERROR(region); ++ return PycairoRegion_FromRegion(region); ++} ++ ++PyObject * ++region_copy (PycairoRegion *o) { ++ cairo_region_t *res; ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_copy (o->region); ++ Py_END_ALLOW_THREADS; ++ RETURN_NULL_IF_CAIRO_REGION_ERROR(res); ++ return PycairoRegion_FromRegion(res); ++} ++ ++ ++PyObject * ++region_get_extents (PycairoRegion *o) { ++ cairo_rectangle_int_t rect; ++ Py_BEGIN_ALLOW_THREADS; ++ cairo_region_get_extents(o->region, &rect); ++ Py_END_ALLOW_THREADS; ++ ++ return PycairoRectangleInt_FromRectangleInt(&rect); ++} ++ ++ ++PyObject * ++region_num_rectangles (PycairoRegion *o) { ++ int res; ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_num_rectangles(o->region); ++ Py_END_ALLOW_THREADS; ++ return Py_BuildValue("i", res); ++} ++ ++ ++PyObject * ++region_get_rectangle (PycairoRegion *o, PyObject *args) { ++ cairo_rectangle_int_t rect; ++ int i; ++ int total; ++ if (!PyArg_ParseTuple (args, "i:Region.get_rectangle", &i)) ++ return NULL; ++ total = cairo_region_num_rectangles(o->region); ++ if (i >= total || i < 0) { ++ if ( i < 0) ++ PyErr_SetString(PyExc_ValueError, "index must be a positive number"); ++ else ++ PyErr_SetString(PyExc_ValueError, "index is to big for the region"); ++ return NULL; ++ } ++ Py_BEGIN_ALLOW_THREADS; ++ cairo_region_get_rectangle(o->region, i, &rect); ++ Py_END_ALLOW_THREADS; ++ return PycairoRectangleInt_FromRectangleInt(&rect); ++} ++ ++ ++PyObject * ++region_is_empty (PycairoRegion *o) { ++ cairo_bool_t res; ++ PyObject *b; ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_is_empty(o->region); ++ Py_END_ALLOW_THREADS; ++ b = res ? Py_True : Py_False; ++ Py_INCREF(b); ++ return b; ++} ++ ++ ++PyObject * ++region_contains_point (PycairoRegion *o, PyObject *args) { ++ int x, y; ++ cairo_bool_t res; ++ PyObject *b; ++ if (!PyArg_ParseTuple (args, "ii:Region.contains_point", &x, &y)) ++ return NULL; ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_contains_point(o->region, x, y); ++ Py_END_ALLOW_THREADS; ++ b = res ? Py_True : Py_False; ++ Py_INCREF(b); ++ return b; ++} ++ ++ ++PyObject * ++region_contains_rectangle (PycairoRegion *o, PyObject *args) { ++ cairo_region_overlap_t res; ++ PycairoRectangleInt *rect_int; ++ if (!PyArg_ParseTuple (args, "O!:Region.contains_rectangle", ++ &PycairoRectangleInt_Type, &rect_int)) ++ return NULL; ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_contains_rectangle(o->region, &(rect_int->rectangle_int)); ++ Py_END_ALLOW_THREADS; ++ return Py_BuildValue("i", res); ++} ++ ++ ++PyObject * ++region_equal (PycairoRegion *o, PyObject *args) { ++ cairo_bool_t res; ++ PyObject *b; ++ PycairoRegion *region_obj; ++ if (!PyArg_ParseTuple (args, "O!:Region.equal", ++ &PycairoRegion_Type, ®ion_obj)) ++ return NULL; ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_equal (o->region, region_obj->region); ++ Py_END_ALLOW_THREADS; ++ b = res ? Py_True : Py_False; ++ Py_INCREF(b); ++ return b; ++} ++ ++static PyObject * ++region_richcompare(PycairoRegion *self, PycairoRegion *other, int op) { ++ int res = 0; ++ PyObject *b; ++ ++ if (op != Py_EQ && op != Py_NE) { ++ PyErr_SetString(PyExc_TypeError, "Only support testing for == or !="); ++ return NULL; ++ } ++ if (!PyObject_IsInstance((PyObject*)other, (PyObject*)&PycairoRegion_Type)) { ++ res = 0; ++ } else { ++ res = cairo_region_equal (self->region, other->region); ++ } ++ ++ res = op == Py_NE ? !res : res; ++ b = res ? Py_True : Py_False; ++ Py_INCREF(b); ++ ++ return b; ++} ++ ++PyObject * ++region_translate (PycairoRegion *o, PyObject *args) { ++ int x, y; ++ if (!PyArg_ParseTuple (args, "ii:Region.translate", &x, &y)) ++ return NULL; ++ Py_BEGIN_ALLOW_THREADS; ++ cairo_region_translate (o->region, x, y); ++ Py_END_ALLOW_THREADS; ++ Py_RETURN_NONE; ++} ++ ++ ++PyObject * ++region_intersect (PycairoRegion *o, PyObject *args) { ++ cairo_status_t res; ++ PyObject *other; ++ if (!PyArg_ParseTuple (args, "O:Region.intersect", &other)) ++ return NULL; ++ ++ if (PyObject_IsInstance(other, (PyObject*)&PycairoRegion_Type) == 1) { ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_intersect(o->region, ++ ((PycairoRegion *)other)->region); ++ Py_END_ALLOW_THREADS; ++ } else if (PyObject_IsInstance(other, ++ (PyObject*)&PycairoRectangleInt_Type) == 1) { ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_intersect_rectangle(o->region, ++ &(((PycairoRectangleInt *)other)->rectangle_int)); ++ Py_END_ALLOW_THREADS; ++ } else { ++ PyErr_SetString(PyExc_TypeError, ++ "argument must be a Region or a RectangleInt."); ++ return NULL; ++ } ++ ++ RETURN_NULL_IF_CAIRO_ERROR(res); ++ Py_RETURN_NONE; ++} ++ ++PyObject * ++region_subtract (PycairoRegion *o, PyObject *args) { ++ cairo_status_t res; ++ PyObject *other; ++ if (!PyArg_ParseTuple (args, "O:Region.subtract", &other)) ++ return NULL; ++ ++ if (PyObject_IsInstance(other, (PyObject*)&PycairoRegion_Type) == 1) { ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_subtract(o->region, ++ ((PycairoRegion *)other)->region); ++ Py_END_ALLOW_THREADS; ++ } else if (PyObject_IsInstance(other, ++ (PyObject*)&PycairoRectangleInt_Type) == 1) { ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_subtract_rectangle(o->region, ++ &(((PycairoRectangleInt *)other)->rectangle_int)); ++ Py_END_ALLOW_THREADS; ++ } else { ++ PyErr_SetString(PyExc_TypeError, ++ "argument must be a Region or a RectangleInt."); ++ return NULL; ++ } ++ RETURN_NULL_IF_CAIRO_ERROR(res); ++ Py_RETURN_NONE; ++} ++ ++PyObject * ++region_union (PycairoRegion *o, PyObject *args) { ++ cairo_status_t res; ++ PyObject *other; ++ if (!PyArg_ParseTuple (args, "O:Region.union", &other)) ++ return NULL; ++ ++ if (PyObject_IsInstance(other, (PyObject*)&PycairoRegion_Type) == 1) { ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_union(o->region, ++ ((PycairoRegion *)other)->region); ++ Py_END_ALLOW_THREADS; ++ } else if (PyObject_IsInstance(other, ++ (PyObject*)&PycairoRectangleInt_Type) == 1) { ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_union_rectangle(o->region, ++ &(((PycairoRectangleInt *)other)->rectangle_int)); ++ Py_END_ALLOW_THREADS; ++ } else { ++ PyErr_SetString(PyExc_TypeError, ++ "argument must be a Region or a RectangleInt."); ++ return NULL; ++ } ++ RETURN_NULL_IF_CAIRO_ERROR(res); ++ Py_RETURN_NONE; ++} ++ ++PyObject * ++region_xor (PycairoRegion *o, PyObject *args) { ++ cairo_status_t res; ++ PyObject *other; ++ if (!PyArg_ParseTuple (args, "O:Region.xorg", &other)) ++ return NULL; ++ ++ if (PyObject_IsInstance(other, (PyObject*)&PycairoRegion_Type) == 1) { ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_xor(o->region, ++ ((PycairoRegion *)other)->region); ++ Py_END_ALLOW_THREADS; ++ } else if (PyObject_IsInstance(other, ++ (PyObject*)&PycairoRectangleInt_Type) == 1) { ++ Py_BEGIN_ALLOW_THREADS; ++ res = cairo_region_xor_rectangle(o->region, ++ &(((PycairoRectangleInt *)other)->rectangle_int)); ++ Py_END_ALLOW_THREADS; ++ } else { ++ PyErr_SetString(PyExc_TypeError, ++ "argument must be a Region or a RectangleInt."); ++ return NULL; ++ } ++ RETURN_NULL_IF_CAIRO_ERROR(res); ++ Py_RETURN_NONE; ++} ++ ++static PyMethodDef region_methods[] = { ++ /* methods never exposed in a language binding: ++ * cairo_region_destroy() ++ * cairo_region_get_type() ++ * cairo_region_reference() ++ * ++ * cairo_region_status() ++ * - not needed since Pycairo handles status checking ++ * ++ * _(intersect/subtract/union/xor)_rectangle are merged with the region ++ * ones. ++ */ ++ {"copy", (PyCFunction)region_copy, METH_NOARGS }, ++ {"get_extents", (PyCFunction)region_get_extents, METH_NOARGS }, ++ {"num_rectangles", (PyCFunction)region_num_rectangles, METH_NOARGS }, ++ {"get_rectangle", (PyCFunction)region_get_rectangle, METH_VARARGS }, ++ {"is_empty", (PyCFunction)region_is_empty, METH_NOARGS }, ++ {"contains_point", (PyCFunction)region_contains_point, METH_VARARGS }, ++ {"contains_rectangle", (PyCFunction)region_contains_rectangle, ++ METH_VARARGS }, ++ {"equal", (PyCFunction)region_equal, METH_VARARGS }, ++ {"translate", (PyCFunction)region_translate, METH_VARARGS }, ++ {"intersect", (PyCFunction)region_intersect, METH_VARARGS }, ++ {"subtract", (PyCFunction)region_subtract, METH_VARARGS }, ++ {"union", (PyCFunction)region_union, METH_VARARGS }, ++ {"xor", (PyCFunction)region_xor, METH_VARARGS }, ++ {NULL, NULL, 0, NULL}, ++}; ++ ++PyTypeObject PycairoRegion_Type = { ++ PyVarObject_HEAD_INIT(&PyType_Type, 0) ++ "cairo.Region", /* tp_name */ ++ sizeof(PycairoRegion), /* tp_basicsize */ ++ 0, /* tp_itemsize */ ++ (destructor)region_dealloc, /* tp_dealloc */ ++ 0, /* tp_print */ ++ 0, /* tp_getattr */ ++ 0, /* tp_setattr */ ++ 0, /* tp_compare */ ++ 0, /* tp_repr */ ++ 0, /* tp_as_number */ ++ 0, /* tp_as_sequence */ ++ 0, /* tp_as_mapping */ ++ 0, /* tp_hash */ ++ 0, /* tp_call */ ++ 0, /* tp_str */ ++ 0, /* tp_getattro */ ++ 0, /* tp_setattro */ ++ 0, /* tp_as_buffer */ ++ Py_TPFLAGS_DEFAULT, /* tp_flags */ ++ 0, /* tp_doc */ ++ 0, /* tp_traverse */ ++ 0, /* tp_clear */ ++ (richcmpfunc)region_richcompare, /* tp_richcompare */ ++ 0, /* tp_weaklistoffset */ ++ 0, /* tp_iter */ ++ 0, /* tp_iternext */ ++ region_methods, /* tp_methods */ ++ 0, /* tp_members */ ++ 0, /* tp_getset */ ++ 0, /* tp_base */ ++ 0, /* tp_dict */ ++ 0, /* tp_descr_get */ ++ 0, /* tp_descr_set */ ++ 0, /* tp_dictoffset */ ++ 0, /* tp_init */ ++ 0, /* tp_alloc */ ++ (newfunc)region_new, /* tp_new */ ++}; +--- py3cairo-1.10.0+dfsg.orig/src/py3cairo.h ++++ py3cairo-1.10.0+dfsg/src/py3cairo.h +@@ -67,6 +67,16 @@ typedef struct { + + typedef struct { + PyObject_HEAD ++ cairo_rectangle_int_t rectangle_int; ++} PycairoRectangleInt; ++ ++typedef struct { ++ PyObject_HEAD ++ cairo_region_t *region; ++} PycairoRegion; ++ ++typedef struct { ++ PyObject_HEAD + cairo_scaled_font_t *scaled_font; + } PycairoScaledFont; + +@@ -129,6 +139,14 @@ typedef struct { + + /* misc functions */ + int (*Check_Status)(cairo_status_t status); ++ ++ PyTypeObject *RectangleInt_Type; ++ PyObject *(*RectangleInt_FromRectangleInt)( ++ const cairo_rectangle_int_t *rectangle_int); ++ ++ PyTypeObject *Region_Type; ++ PyObject *(*Region_FromRegion)(const cairo_region_t *region); ++ + } Pycairo_CAPI_t; + + +@@ -156,6 +174,13 @@ typedef struct { + #define PycairoRadialGradient_Type *(Pycairo_CAPI->RadialGradient_Type) + #define PycairoPattern_FromPattern (Pycairo_CAPI->Pattern_FromPattern) + ++#define PycairoRectangleInt_Type *(Pycairo_CAPI->RectangleInt_Type) ++#define PycairoRectangleInt_FromRectangleInt \ ++ (Pycairo_CAPI->RectangleInt_FromRectangleInt) ++ ++#define PycairoRegion_Type *(Pycairo_CAPI->Region_Type) ++#define PycairoRegion_FromRegion (Pycairo_CAPI->Region_FromRegion) ++ + #define PycairoScaledFont_Type *(Pycairo_CAPI->ScaledFont_Type) + #define PycairoScaledFont_FromScaledFont \ + (Pycairo_CAPI->ScaledFont_FromScaledFont) +--- py3cairo-1.10.0+dfsg.orig/src/cairomodule.c ++++ py3cairo-1.10.0+dfsg/src/cairomodule.c +@@ -141,6 +141,12 @@ static Pycairo_CAPI_t CAPI = { + PycairoSurface_FromSurface, + + Pycairo_Check_Status, ++ ++ &PycairoRectangleInt_Type, ++ PycairoRectangleInt_FromRectangleInt, ++ ++ &PycairoRegion_Type, ++ PycairoRegion_FromRegion, + }; + + static PyObject * +@@ -230,6 +236,12 @@ PyInit__cairo(void) + if (PyType_Ready(&PycairoRadialGradient_Type) < 0) + return NULL; + ++ if (PyType_Ready(&PycairoRectangleInt_Type) < 0) ++ return NULL; ++ ++ if (PyType_Ready(&PycairoRegion_Type) < 0) ++ return NULL; ++ + if (PyType_Ready(&PycairoScaledFont_Type) < 0) + return NULL; + +@@ -315,6 +327,12 @@ PyInit__cairo(void) + PyModule_AddObject(m, "RadialGradient", + (PyObject *)&PycairoRadialGradient_Type); + ++ Py_INCREF(&PycairoRectangleInt_Type); ++ PyModule_AddObject(m, "RectangleInt", (PyObject *)&PycairoRectangleInt_Type); ++ ++ Py_INCREF(&PycairoRegion_Type); ++ PyModule_AddObject(m, "Region", (PyObject *)&PycairoRegion_Type); ++ + Py_INCREF(&PycairoScaledFont_Type); + PyModule_AddObject(m, "ScaledFont", (PyObject *)&PycairoScaledFont_Type); + +@@ -519,6 +537,10 @@ PyInit__cairo(void) + CONSTANT(PS_LEVEL_3); + #endif + ++ CONSTANT(REGION_OVERLAP_IN); ++ CONSTANT(REGION_OVERLAP_OUT); ++ CONSTANT(REGION_OVERLAP_PART); ++ + CONSTANT(SUBPIXEL_ORDER_DEFAULT); + CONSTANT(SUBPIXEL_ORDER_RGB); + CONSTANT(SUBPIXEL_ORDER_BGR); +--- py3cairo-1.10.0+dfsg.orig/src/wscript ++++ py3cairo-1.10.0+dfsg/src/wscript +@@ -25,6 +25,7 @@ def build(ctx): + 'font.c', + 'path.c', + 'pattern.c', ++ 'region.c', + 'matrix.c', + 'surface.c', + ], +--- py3cairo-1.10.0+dfsg.orig/src/private.h ++++ py3cairo-1.10.0+dfsg/src/private.h +@@ -60,6 +60,13 @@ extern PyTypeObject PycairoLinearGradien + extern PyTypeObject PycairoRadialGradient_Type; + PyObject *PycairoPattern_FromPattern (cairo_pattern_t *pattern, + PyObject *base); ++ ++extern PyTypeObject PycairoRectangleInt_Type; ++PyObject *PycairoRectangleInt_FromRectangleInt ( ++ cairo_rectangle_int_t *rectangle_int); ++ ++extern PyTypeObject PycairoRegion_Type; ++PyObject *PycairoRegion_FromRegion (cairo_region_t *region); + + extern PyTypeObject PycairoScaledFont_Type; + PyObject *PycairoScaledFont_FromScaledFont (cairo_scaled_font_t *scaled_font); +@@ -153,6 +160,15 @@ int Pycairo_Check_Status (cairo_status_t + if (status != CAIRO_STATUS_SUCCESS) { \ + Pycairo_Check_Status (status); \ + return NULL; \ ++ } \ ++ } while (0) ++ ++#define RETURN_NULL_IF_CAIRO_REGION_ERROR(region) \ ++ do { \ ++ cairo_status_t status = cairo_region_status (region); \ ++ if (status != CAIRO_STATUS_SUCCESS) { \ ++ Pycairo_Check_Status (status); \ ++ return NULL; \ + } \ + } while (0) + +--- py3cairo-1.10.0+dfsg.orig/test/api_test.py ++++ py3cairo-1.10.0+dfsg/test/api_test.py +@@ -84,3 +84,65 @@ def test_surface(): + + def test_text(): + pass ++ ++ ++def test_region(): ++ a = cairo.Region() ++ assert a.is_empty() == True ++ assert a.num_rectangles() == 0 ++ ++ b = cairo.RectangleInt(1, 2, 10, 12) ++ d = cairo.RectangleInt(1, 1, 10, 12) ++ e = cairo.RectangleInt(1, 3, 8, 12) ++ assert (b.x, b.y, b.width, b.height) == (1, 2, 10, 12) ++ c = cairo.Region((b, e)) ++ assert not c.is_empty() ++ assert c.num_rectangles() == 2 ++ assert c.get_rectangle(1).y == 14 ++ ++ ex = c.get_extents() ++ assert ex == cairo.RectangleInt(1, 2, 10, 13) ++ assert c.contains_rectangle(d) == cairo.REGION_OVERLAP_PART ++ ++ c.translate(10, 20) ++ assert c.contains_rectangle(d) == cairo.REGION_OVERLAP_OUT ++ assert c.get_rectangle(1) == cairo.RectangleInt(11, 34, 8, 1) ++ ++ cp = c.copy() ++ assert c.num_rectangles() == cp.num_rectangles() ++ assert c.get_rectangle(0) == cp.get_rectangle(0) ++ assert c == cp ++ assert 3 != c ++ assert c != "test" ++ ++ c = cairo.Region((b, e)) ++ c.intersect(d) ++ assert c.num_rectangles() == 1 ++ assert c.get_rectangle(0) == cairo.RectangleInt(1, 2, 10, 11) ++ ++ c = cairo.Region((b, e)) ++ c.subtract(d) ++ assert c.num_rectangles() == 2 ++ assert c == cairo.Region([ ++ cairo.RectangleInt(1, 13, 10, 1), cairo.RectangleInt(1, 14, 8, 1) ]) ++ ++ d = cairo.Region(d) ++ c = cairo.Region((b, e)) ++ c.subtract(d) ++ assert c.num_rectangles() == 2 ++ assert c.get_rectangle(0) == cairo.RectangleInt(1, 13, 10, 1) ++ ++ c = cairo.Region((b, e)) ++ c.union(d) ++ assert c.num_rectangles() == 2 ++ assert c == cairo.Region([ ++ cairo.RectangleInt(1, 1, 10, 13), cairo.RectangleInt(1, 14, 8, 1) ]) ++ ++ c = cairo.Region((b, e)) ++ c.xor(d) ++ assert c.num_rectangles() == 3 ++ assert c == cairo.Region([ ++ cairo.RectangleInt(1, 1, 10, 1), ++ cairo.RectangleInt(1, 14, 8, 1), ++ cairo.RectangleInt(1, 13, 10, 1), ++ ]) diff --git a/dev-python/pycairo/files/pycairo-1.10.0-50_specify-encoding-in-waf.patch b/dev-python/pycairo/files/pycairo-1.10.0-50_specify-encoding-in-waf.patch new file mode 100644 index 000000000000..5356554e75fa --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.10.0-50_specify-encoding-in-waf.patch @@ -0,0 +1,32 @@ +Description: specify encoding in waf + This patch specifies utf-8 as the encoding in waf library, because python 3.3 + doesn't fallback to utf-8 on default. +Author: Matthias Klose <doko@ubuntu.com> +Origin: http://launchpadlibrarian.net/120606963/py3cairo_1.10.0%2Bdfsg-3~exp2_1.10.0%2Bdfsg-3~exp2ubuntu1.diff.gz +Bug-Debian: http://bugs.debian.org/691241 +Last-Update: 2012-10-28 + +--- py3cairo-1.10.0+dfsg.orig/waflib/Utils.py ++++ py3cairo-1.10.0+dfsg/waflib/Utils.py +@@ -77,8 +77,8 @@ except ImportError: + return value + is_win32=sys.platform=='win32' + indicator=is_win32 and'\x1b[A\x1b[K%s%s%s\r'or'\x1b[K%s%s%s\r' +-def readf(fname,m='r'): +- f=open(fname,m) ++def readf(fname,m='r',enc=None): ++ f=open(fname,m,encoding=enc) + try: + txt=f.read() + finally: +--- py3cairo-1.10.0+dfsg.orig/waflib/Tools/c_preproc.py ++++ py3cairo-1.10.0+dfsg/waflib/Tools/c_preproc.py +@@ -44,7 +44,7 @@ def repl(m): + return' ' + return m.group(3)or'' + def filter_comments(filename): +- code=Utils.readf(filename) ++ code=Utils.readf(filename, enc='utf-8') + if use_trigraphs: + for(a,b)in trig_def:code=code.split(a).join(b) + code=re_nl.sub('',code) diff --git a/dev-python/pycairo/files/pycairo-1.10.0-80_fix-pickle.patch b/dev-python/pycairo/files/pycairo-1.10.0-80_fix-pickle.patch new file mode 100644 index 000000000000..3e0cdc3e61f4 --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.10.0-80_fix-pickle.patch @@ -0,0 +1,30 @@ +Description: During the build process, a Context instance is pickled, or at + least attempted to be. This fails because self.node_class is assigned to a + class which is nested inside the __init__() method. Because Python cannot + find this class at unpickling time (i.e. it cannot be imported), Python + refuses to pickle the Context instance, leading to a FTBFS. Since there's no + obvious reason why the class has to be so nested, moving it to a module + global solves the build failure. +Author: Barry Warsaw <barry@debian.org> +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=91561 + +--- a/waflib/Context.py ++++ b/waflib/Context.py +@@ -51,6 +51,8 @@ + global classes + classes.insert(0,cls) + ctx=store_context('ctx',(object,),{}) ++class node_class(waflib.Node.Node): ++ pass + class Context(ctx): + errors=Errors + tools={} +@@ -60,8 +62,6 @@ + except KeyError: + global run_dir + rd=run_dir +- class node_class(waflib.Node.Node): +- pass + self.node_class=node_class + self.node_class.__module__="waflib.Node" + self.node_class.__name__="Nod3" diff --git a/dev-python/pycairo/files/pycairo-1.10.0-81_pickling-again.patch b/dev-python/pycairo/files/pycairo-1.10.0-81_pickling-again.patch new file mode 100644 index 000000000000..3aad32593b3c --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.10.0-81_pickling-again.patch @@ -0,0 +1,37 @@ +Description: Follow up to 80_fix-pickle.patch. Just disable pickling + altogether since the previous patch doesn't really fix the problem, and not + storing the pickle seems to have no adverse effects on the build, while + avoiding the observed traceback. +Author: Barry Warsaw <barry@debian.org> +Forwarded: no + +--- a/waflib/Build.py ++++ b/waflib/Build.py +@@ -151,6 +151,7 @@ + f.close() + self.init_dirs() + def store(self): ++ return + data={} + for x in SAVED_ATTRS: + data[x]=getattr(self,x) +--- a/waflib/Context.py ++++ b/waflib/Context.py +@@ -51,8 +51,6 @@ + global classes + classes.insert(0,cls) + ctx=store_context('ctx',(object,),{}) +-class node_class(waflib.Node.Node): +- pass + class Context(ctx): + errors=Errors + tools={} +@@ -62,6 +60,8 @@ + except KeyError: + global run_dir + rd=run_dir ++ class node_class(waflib.Node.Node): ++ pass + self.node_class=node_class + self.node_class.__module__="waflib.Node" + self.node_class.__name__="Nod3" diff --git a/dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch b/dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch new file mode 100644 index 000000000000..572a5f6cc717 --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch @@ -0,0 +1,126 @@ +--- src/cairomodule.c ++++ src/cairomodule.c +@@ -116,7 +116,7 @@ + #else + 0, + #endif +-#ifdef CAIRO_HAS_SVG_SURFACE ++#ifdef PYCAIRO_ENABLE_SVG + &PycairoSVGSurface_Type, + #else + 0, +@@ -247,7 +247,7 @@ + if (PyType_Ready(&PycairoPSSurface_Type) < 0) + return NULL; + #endif +-#ifdef CAIRO_HAS_SVG_SURFACE ++#ifdef PYCAIRO_ENABLE_SVG + if (PyType_Ready(&PycairoSVGSurface_Type) < 0) + return NULL; + #endif +@@ -337,7 +337,7 @@ + PyModule_AddObject(m, "PSSurface", (PyObject *)&PycairoPSSurface_Type); + #endif + +-#ifdef CAIRO_HAS_SVG_SURFACE ++#ifdef PYCAIRO_ENABLE_SVG + Py_INCREF(&PycairoSVGSurface_Type); + PyModule_AddObject(m, "SVGSurface", (PyObject *)&PycairoSVGSurface_Type); + #endif +@@ -399,7 +399,7 @@ + #else + PyModule_AddIntConstant(m, "HAS_PS_SURFACE", 0); + #endif +-#if CAIRO_HAS_SVG_SURFACE ++#if PYCAIRO_ENABLE_SVG + PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 1); + #else + PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 0); +--- src/private.h ++++ src/private.h +@@ -75,7 +75,7 @@ + extern PyTypeObject PycairoPSSurface_Type; + #endif + +-#if CAIRO_HAS_SVG_SURFACE ++#if PYCAIRO_ENABLE_SVG + extern PyTypeObject PycairoSVGSurface_Type; + #endif + +--- src/py3cairo.h ++++ src/py3cairo.h +@@ -171,7 +171,7 @@ + #define PycairoPSSurface_Type *(Pycairo_CAPI->PSSurface_Type) + #endif + +-#if CAIRO_HAS_SVG_SURFACE ++#if PYCAIRO_ENABLE_SVG + #define PycairoSVGSurface_Type *(Pycairo_CAPI->SVGSurface_Type) + #endif + +--- src/surface.c ++++ src/surface.c +@@ -72,7 +72,7 @@ + type = &PycairoPSSurface_Type; + break; + #endif +-#if CAIRO_HAS_SVG_SURFACE ++#if PYCAIRO_ENABLE_SVG + case CAIRO_SURFACE_TYPE_SVG: + type = &PycairoSVGSurface_Type; + break; +@@ -1022,7 +1022,7 @@ + + + /* Class SVGSurface(Surface) ----------------------------------------------- */ +-#ifdef CAIRO_HAS_SVG_SURFACE ++#ifdef PYCAIRO_ENABLE_SVG + #include <cairo-svg.h> + + static PyObject * +@@ -1133,7 +1133,7 @@ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + }; +-#endif /* CAIRO_HAS_SVG_SURFACE */ ++#endif /* PYCAIRO_ENABLE_SVG */ + + + #if CAIRO_HAS_WIN32_SURFACE +--- wscript ++++ wscript +@@ -1,6 +1,7 @@ + # -*- python -*- + + import os ++import subprocess + + top = '.' + out = 'build_directory' +@@ -11,6 +12,17 @@ + cairo_version_required = '1.10.0' + + ++def check_svg(): ++ if os.environ.get('PYCAIRO_DISABLE_SVG', None) is None: ++ return_code = subprocess.call(['pkg-config', '--exists', 'cairo-svg']) ++ if return_code == 0: ++ return True ++ else: ++ return False ++ else: ++ return False ++ ++ + def options(ctx): + print(' %s/options()' %d) + ctx.tool_options('gnu_dirs') +@@ -39,6 +51,8 @@ + ctx.define('PYCAIRO_VERSION_MAJOR', version[0]) + ctx.define('PYCAIRO_VERSION_MINOR', version[1]) + ctx.define('PYCAIRO_VERSION_MICRO', version[2]) ++ if check_svg(): ++ ctx.define('PYCAIRO_ENABLE_SVG', 1) + + ctx.write_config_header('src/config.h') + diff --git a/dev-python/pycairo/files/pycairo-1.10.0-waf-py3_4.patch b/dev-python/pycairo/files/pycairo-1.10.0-waf-py3_4.patch new file mode 100644 index 000000000000..6e79db9ba272 --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.10.0-waf-py3_4.patch @@ -0,0 +1,11 @@ +--- a/waflib/Tools/python.py ++++ b/waflib/Tools/python.py +@@ -169,7 +169,7 @@ + conf.find_program('python-config-%s'%num,var='PYTHON_CONFIG',mandatory=False) + includes=[] + if conf.env.PYTHON_CONFIG: +- for incstr in conf.cmd_and_log(conf.env.PYTHON+[conf.env.PYTHON_CONFIG,'--includes']).strip().split(): ++ for incstr in conf.cmd_and_log([conf.env.PYTHON_CONFIG,'--includes']).strip().split(): + if(incstr.startswith('-I')or incstr.startswith('/I')): + incstr=incstr[2:] + if incstr not in includes: diff --git a/dev-python/pycairo/files/pycairo-1.10.0-waf-unpack.patch b/dev-python/pycairo/files/pycairo-1.10.0-waf-unpack.patch new file mode 100644 index 000000000000..7d54ba160d68 --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.10.0-waf-unpack.patch @@ -0,0 +1,12 @@ +--- a/waf ++++ b/waf +@@ -153,6 +153,9 @@ + return dir + + wafdir = find_lib() ++if sys.argv[1:] == ['unpack']: ++ print(wafdir) ++ exit() + sys.path.insert(0, wafdir) + from waflib.Tools.c_config import MACRO_TO_DESTOS + MACRO_TO_DESTOS['__POWERPC__'] = 'darwin' diff --git a/dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch b/dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch new file mode 100644 index 000000000000..33de2692f838 --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch @@ -0,0 +1,41 @@ +--- pycairo-1.10.0/wscript ++++ pycairo-1.10.0/wscript +@@ -10,6 +10,7 @@ + APPNAME='pycairo' + VERSION='1.10.0' + cairo_version_required = '1.10.0' ++xpyb_version_required = '1.3' # optional + + + def check_svg(): +@@ -23,6 +24,17 @@ + return False + + ++def check_xpyb(): ++ if os.environ.get('PYCAIRO_DISABLE_XPYB', None) is None: ++ return_code = subprocess.call(['pkg-config', '--exists', 'xpyb']) ++ if return_code == 0: ++ return True ++ else: ++ return False ++ else: ++ return False ++ ++ + def options(ctx): + print(' %s/options()' %d) + ctx.tool_options('gnu_dirs') +@@ -42,6 +54,12 @@ + ctx.check_cfg(package='cairo', atleast_version=cairo_version_required, + args='--cflags --libs') + ++# xpyb for Python 3 is not available yet. ++# the Python 3 version should probably have a different name than 'xpyb' ++# if check_xpyb(): ++# ctx.check_cfg(package='xpyb', atleast_version=xpyb_version_required, ++# args='--cflags --libs', mandatory=False) ++ + # add gcc options + if env['CC_NAME'] == 'gcc': + env.append_unique('CCFLAGS', ['-std=c99', '-Wall']) diff --git a/dev-python/pycairo/metadata.xml b/dev-python/pycairo/metadata.xml new file mode 100644 index 000000000000..e24dd86faa2a --- /dev/null +++ b/dev-python/pycairo/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>python@gentoo.org</email> + <name>Python</name> + </maintainer> +</pkgmetadata> diff --git a/dev-python/pycairo/pycairo-1.10.0-r4.ebuild b/dev-python/pycairo/pycairo-1.10.0-r4.ebuild new file mode 100644 index 000000000000..4c9419103d4b --- /dev/null +++ b/dev-python/pycairo/pycairo-1.10.0-r4.ebuild @@ -0,0 +1,137 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" +PYTHON_COMPAT=( python{2_7,3_4} ) +PYTHON_REQ_USE='threads(+)' + +inherit eutils python-r1 waf-utils toolchain-funcs + +PYCAIRO_PYTHON2_VERSION="${PV}" +PYCAIRO_PYTHON3_VERSION="${PV}" + +DESCRIPTION="Python bindings for the cairo library" +HOMEPAGE="http://cairographics.org/pycairo/ https://pypi.python.org/pypi/pycairo" +SRC_URI="http://cairographics.org/releases/py2cairo-${PYCAIRO_PYTHON2_VERSION}.tar.bz2 + http://cairographics.org/releases/pycairo-${PYCAIRO_PYTHON3_VERSION}.tar.bz2" + +# LGPL-3 for pycairo 1.10.0. +# || ( LGPL-2.1 MPL-1.1 ) for pycairo 1.8.10. +LICENSE="LGPL-3 || ( LGPL-2.1 MPL-1.1 )" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc examples +svg test xcb" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +# Note: xpyb is used as the C header, not Python modules +RDEPEND="${PYTHON_DEPS} + >=x11-libs/cairo-1.10.0[svg?,xcb?] + xcb? ( x11-libs/xpyb )" +DEPEND="${RDEPEND} + virtual/pkgconfig + test? ( dev-python/pytest[${PYTHON_USEDEP}] ) +" + +src_prepare() { + + pushd "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" > /dev/null + rm -f src/config.h || die + epatch "${FILESDIR}/${PN}-1.10.0-svg_check.patch" + epatch "${FILESDIR}/${PN}-1.10.0-xpyb.patch" + epatch "${FILESDIR}/${PN}-1.10.0-waf-unpack.patch" + epatch "${FILESDIR}"/py2cairo-1.10.0-ppc-darwin.patch + popd > /dev/null + + pushd "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" > /dev/null + rm -f src/config.h || die + epatch "${FILESDIR}/py2cairo-1.10.0-svg_check.patch" + epatch "${FILESDIR}/py2cairo-1.10.0-xpyb.patch" + epatch "${FILESDIR}"/py2cairo-1.10.0-ppc-darwin.patch + popd > /dev/null + + preparation() { + if python_is_python3; then + cp -r -l "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" "${BUILD_DIR}" || die + pushd "${BUILD_DIR}" > /dev/null + wafdir="$(./waf unpack)" + pushd "${wafdir}" > /dev/null + epatch "${FILESDIR}/${PN}-1.10.0-waf-py3_4.patch" + popd > /dev/null + popd > /dev/null + else + cp -r -l "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" "${BUILD_DIR}" || die + fi + } + python_foreach_impl preparation +} + +src_configure() { + if ! use svg; then + export PYCAIRO_DISABLE_SVG=1 + fi + + if ! use xcb; then + export PYCAIRO_DISABLE_XPYB=1 + fi + + tc-export PKG_CONFIG + # Also export the var with the slightly diff name that waf uses for no good reason. + export PKGCONFIG=${PKG_CONFIG} + + # Added by grobian: + # If WAF_BINARY is an absolute path, the configure is different and fails to + # find Python.h due to a compiler misconfiguration. If WAF_BINARY is just + # ./waf or python waf, it works fine. Hooray for reinvented buildsystems + + # floppym: + # pycairo and py2cairo bundle different versions of waf (bug 447856) + WAF_BINARY="./waf" + python_foreach_impl run_in_build_dir waf-utils_src_configure --nopyc --nopyo +} + +src_compile() { + python_foreach_impl run_in_build_dir waf-utils_src_compile +} + +src_test() { + test_installation() { + ./waf install --destdir="${T}/tests/${BUILD_DIR}" + PYTHONPATH="${T}/tests/${BUILD_DIR}$(python_get_sitedir)" py.test -v + } + python_foreach_impl run_in_build_dir test_installation +} + +src_install() { + python_foreach_impl run_in_build_dir waf-utils_src_install + + dodoc AUTHORS NEWS README + + if use doc; then + pushd doc/_build/html > /dev/null || die + dohtml -r [a-z]* _static + popd > /dev/null || die + fi + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins -r examples/* + fi + + if [[ ${CHOST} == *-darwin* ]] ; then + # fix install_names; next to waf producing dylibs (not bundles) and + # calling them .bundle, it also has no idea what it should do to create + # proper ones (dylibs) + fix_darwin_install_names() { + local x="$(python_get_sitedir)/cairo/_cairo.bundle" + install_name_tool -id "${x}" "${ED}${x}" + } + python_foreach_impl fix_darwin_install_names + fi +} + +run_in_build_dir() { + pushd "${BUILD_DIR}" > /dev/null || die + "$@" + popd > /dev/null || die +} diff --git a/dev-python/pycairo/pycairo-1.10.0-r5.ebuild b/dev-python/pycairo/pycairo-1.10.0-r5.ebuild new file mode 100644 index 000000000000..7a63fcf48d49 --- /dev/null +++ b/dev-python/pycairo/pycairo-1.10.0-r5.ebuild @@ -0,0 +1,148 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) +PYTHON_REQ_USE='threads(+)' + +inherit eutils python-r1 waf-utils toolchain-funcs + +PYCAIRO_PYTHON2_VERSION="${PV}" +PYCAIRO_PYTHON3_VERSION="${PV}" + +DESCRIPTION="Python bindings for the cairo library" +HOMEPAGE="http://cairographics.org/pycairo/ https://pypi.python.org/pypi/pycairo" +SRC_URI=" + http://cairographics.org/releases/py2cairo-${PYCAIRO_PYTHON2_VERSION}.tar.bz2 + http://cairographics.org/releases/pycairo-${PYCAIRO_PYTHON3_VERSION}.tar.bz2" + +# LGPL-3 for pycairo 1.10.0. +# || ( LGPL-2.1 MPL-1.1 ) for pycairo 1.8.10. +LICENSE="LGPL-3 || ( LGPL-2.1 MPL-1.1 )" +SLOT="0" +KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc examples +svg test xcb" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +# Note: xpyb is used as the C header, not Python modules +RDEPEND="${PYTHON_DEPS} + >=x11-libs/cairo-1.10.0[svg?,xcb?] + xcb? ( x11-libs/xpyb )" +DEPEND="${RDEPEND} + virtual/pkgconfig + test? ( dev-python/pytest[${PYTHON_USEDEP}] ) +" + +src_prepare() { + pushd "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" > /dev/null || die + rm -f src/config.h || die + epatch \ + "${FILESDIR}/${PN}-1.10.0-svg_check.patch" \ + "${FILESDIR}/${PN}-1.10.0-xpyb.patch" \ + "${FILESDIR}/${PN}-1.10.0-waf-unpack.patch" \ + "${FILESDIR}"/py2cairo-1.10.0-ppc-darwin.patch \ + "${FILESDIR}"/pycairo-1.10.0-101_pycairo-region.patch + popd > /dev/null + + pushd "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" > /dev/null || die + rm -f src/config.h || die + epatch \ + "${FILESDIR}/py2cairo-1.10.0-svg_check.patch" \ + "${FILESDIR}/py2cairo-1.10.0-xpyb.patch" \ + "${FILESDIR}"/py2cairo-1.10.0-ppc-darwin.patch + popd > /dev/null + + preparation() { + if python_is_python3; then + cp -r -l "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" "${BUILD_DIR}" || die + pushd "${BUILD_DIR}" > /dev/null || die + wafdir="$(./waf unpack)" + pushd "${wafdir}" > /dev/null || die + epatch \ + "${FILESDIR}/${PN}-1.10.0-waf-py3_4.patch" \ + "${FILESDIR}"/pycairo-1.10.0-50_specify-encoding-in-waf.patch \ + "${FILESDIR}"/pycairo-1.10.0-80_fix-pickle.patch \ + "${FILESDIR}"/pycairo-1.10.0-81_pickling-again.patch + + popd > /dev/null + popd > /dev/null + else + cp -r -l "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" "${BUILD_DIR}" || die + fi + } + python_foreach_impl preparation +} + +src_configure() { + if ! use svg; then + export PYCAIRO_DISABLE_SVG=1 + fi + + if ! use xcb; then + export PYCAIRO_DISABLE_XPYB=1 + fi + + tc-export PKG_CONFIG + # Also export the var with the slightly diff name that waf uses for no good reason. + export PKGCONFIG=${PKG_CONFIG} + + # Added by grobian: + # If WAF_BINARY is an absolute path, the configure is different and fails to + # find Python.h due to a compiler misconfiguration. If WAF_BINARY is just + # ./waf or python waf, it works fine. Hooray for reinvented buildsystems + + # floppym: + # pycairo and py2cairo bundle different versions of waf (bug 447856) + WAF_BINARY="./waf" + python_foreach_impl run_in_build_dir waf-utils_src_configure --nopyc --nopyo +} + +src_compile() { + python_foreach_impl run_in_build_dir waf-utils_src_compile +} + +src_test() { + test_installation() { + ./waf install --destdir="${T}/tests/${BUILD_DIR}" + PYTHONPATH="${T}/tests/${BUILD_DIR}$(python_get_sitedir)" py.test -v + } + python_foreach_impl run_in_build_dir test_installation +} + +src_install() { + python_foreach_impl run_in_build_dir waf-utils_src_install + + dodoc AUTHORS NEWS README + + if use doc; then + pushd doc/_build/html > /dev/null || die + dohtml -r [a-z]* _static + popd > /dev/null || die + fi + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins -r examples/* + fi + + if [[ ${CHOST} == *-darwin* ]] ; then + # fix install_names; next to waf producing dylibs (not bundles) and + # calling them .bundle, it also has no idea what it should do to create + # proper ones (dylibs) + fix_darwin_install_names() { + local suffix=$("${PYTHON}" -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))') + [[ -z ${suffix} || ${suffix} == "None" ]] && suffix=".bundle" + local x="$(python_get_sitedir)/cairo/_cairo${suffix}" + install_name_tool -id "${x}" "${D}${x}" + } + python_foreach_impl fix_darwin_install_names + fi +} + +run_in_build_dir() { + pushd "${BUILD_DIR}" > /dev/null || die + "$@" + popd > /dev/null || die +} diff --git a/dev-python/pycairo/pycairo-1.13.1-r1.ebuild b/dev-python/pycairo/pycairo-1.13.1-r1.ebuild new file mode 100644 index 000000000000..30b7fc97e0c4 --- /dev/null +++ b/dev-python/pycairo/pycairo-1.13.1-r1.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 + +DESCRIPTION="Python bindings for the cairo library" +HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo" +SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="|| ( LGPL-2.1 MPL-1.1 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc examples test xcb" + +# Note: xpyb is used as the C header, not Python modules +RDEPEND=" + >=x11-libs/cairo-1.12.0[svg,xcb?] +" +DEPEND="${RDEPEND} + xcb? ( $(python_gen_cond_dep '>=x11-libs/xpyb-1.3' 'python2*') ) + doc? ( dev-python/sphinx ) + test? ( dev-python/pytest[${PYTHON_USEDEP}] ) +" + +python_prepare_all() { + # Fix pkgconfig path + sed -i -e "/libdir =/s:\"lib\":\"$(get_libdir)\":" setup.py || die + distutils-r1_python_prepare_all +} + +python_compile() { + local enable_xpyb + python_is_python3 || enable_xpyb=$(usex xcb "--enable-xpyb" "") + + esetup.py build ${enable_xpyb} +} + +python_compile_all() { + use doc && emake -C docs +} + +python_test() { + local enable_xpyb + [[ ${EPYTHON} == python2* ]] && enable_xpyb=$(usex xcb "--enable-xpyb" "") + + esetup.py test ${enable_xpyb} +} + +python_install_all() { + use doc && local HTML_DOCS=( docs/_build/. ) + + if use examples; then + dodoc -r examples + fi + + distutils-r1_python_install_all +} diff --git a/dev-python/pycairo/pycairo-1.15.0.ebuild b/dev-python/pycairo/pycairo-1.15.0.ebuild new file mode 100644 index 000000000000..77146c084dc0 --- /dev/null +++ b/dev-python/pycairo/pycairo-1.15.0.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 + +DESCRIPTION="Python bindings for the cairo library" +HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo" +SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="|| ( LGPL-2.1 MPL-1.1 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc examples test xcb" + +# Note: xpyb is used as the C header, not Python modules +RDEPEND=" + >=x11-libs/cairo-1.13.1[svg,xcb?] +" +DEPEND="${RDEPEND} + xcb? ( $(python_gen_cond_dep '>=x11-libs/xpyb-1.3' 'python2*') ) + doc? ( dev-python/sphinx ) + test? ( + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/hypothesis[${PYTHON_USEDEP}] + ) +" + +python_prepare_all() { + # Fix pkgconfig path + sed -i -e "/libdir =/s:\"lib\":\"$(get_libdir)\":" setup.py || die + distutils-r1_python_prepare_all +} + +python_compile() { + local enable_xpyb + python_is_python3 || enable_xpyb=$(usex xcb "--enable-xpyb" "") + + esetup.py build ${enable_xpyb} +} + +python_compile_all() { + use doc && emake -C docs +} + +python_test() { + local enable_xpyb + python_is_python3 || enable_xpyb=$(usex xcb "--enable-xpyb" "") + + esetup.py test ${enable_xpyb} +} + +python_install_all() { + use doc && local HTML_DOCS=( docs/_build/. ) + + if use examples; then + dodoc -r examples + fi + + distutils-r1_python_install_all +} diff --git a/dev-python/pycairo/pycairo-1.15.1.ebuild b/dev-python/pycairo/pycairo-1.15.1.ebuild new file mode 100644 index 000000000000..77146c084dc0 --- /dev/null +++ b/dev-python/pycairo/pycairo-1.15.1.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 + +DESCRIPTION="Python bindings for the cairo library" +HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo" +SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="|| ( LGPL-2.1 MPL-1.1 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc examples test xcb" + +# Note: xpyb is used as the C header, not Python modules +RDEPEND=" + >=x11-libs/cairo-1.13.1[svg,xcb?] +" +DEPEND="${RDEPEND} + xcb? ( $(python_gen_cond_dep '>=x11-libs/xpyb-1.3' 'python2*') ) + doc? ( dev-python/sphinx ) + test? ( + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/hypothesis[${PYTHON_USEDEP}] + ) +" + +python_prepare_all() { + # Fix pkgconfig path + sed -i -e "/libdir =/s:\"lib\":\"$(get_libdir)\":" setup.py || die + distutils-r1_python_prepare_all +} + +python_compile() { + local enable_xpyb + python_is_python3 || enable_xpyb=$(usex xcb "--enable-xpyb" "") + + esetup.py build ${enable_xpyb} +} + +python_compile_all() { + use doc && emake -C docs +} + +python_test() { + local enable_xpyb + python_is_python3 || enable_xpyb=$(usex xcb "--enable-xpyb" "") + + esetup.py test ${enable_xpyb} +} + +python_install_all() { + use doc && local HTML_DOCS=( docs/_build/. ) + + if use examples; then + dodoc -r examples + fi + + distutils-r1_python_install_all +} diff --git a/dev-python/pycairo/pycairo-1.15.2.ebuild b/dev-python/pycairo/pycairo-1.15.2.ebuild new file mode 100644 index 000000000000..77146c084dc0 --- /dev/null +++ b/dev-python/pycairo/pycairo-1.15.2.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 + +DESCRIPTION="Python bindings for the cairo library" +HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo" +SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="|| ( LGPL-2.1 MPL-1.1 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc examples test xcb" + +# Note: xpyb is used as the C header, not Python modules +RDEPEND=" + >=x11-libs/cairo-1.13.1[svg,xcb?] +" +DEPEND="${RDEPEND} + xcb? ( $(python_gen_cond_dep '>=x11-libs/xpyb-1.3' 'python2*') ) + doc? ( dev-python/sphinx ) + test? ( + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/hypothesis[${PYTHON_USEDEP}] + ) +" + +python_prepare_all() { + # Fix pkgconfig path + sed -i -e "/libdir =/s:\"lib\":\"$(get_libdir)\":" setup.py || die + distutils-r1_python_prepare_all +} + +python_compile() { + local enable_xpyb + python_is_python3 || enable_xpyb=$(usex xcb "--enable-xpyb" "") + + esetup.py build ${enable_xpyb} +} + +python_compile_all() { + use doc && emake -C docs +} + +python_test() { + local enable_xpyb + python_is_python3 || enable_xpyb=$(usex xcb "--enable-xpyb" "") + + esetup.py test ${enable_xpyb} +} + +python_install_all() { + use doc && local HTML_DOCS=( docs/_build/. ) + + if use examples; then + dodoc -r examples + fi + + distutils-r1_python_install_all +} diff --git a/dev-python/pycairo/pycairo-1.15.3.ebuild b/dev-python/pycairo/pycairo-1.15.3.ebuild new file mode 100644 index 000000000000..77146c084dc0 --- /dev/null +++ b/dev-python/pycairo/pycairo-1.15.3.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 + +DESCRIPTION="Python bindings for the cairo library" +HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo" +SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="|| ( LGPL-2.1 MPL-1.1 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc examples test xcb" + +# Note: xpyb is used as the C header, not Python modules +RDEPEND=" + >=x11-libs/cairo-1.13.1[svg,xcb?] +" +DEPEND="${RDEPEND} + xcb? ( $(python_gen_cond_dep '>=x11-libs/xpyb-1.3' 'python2*') ) + doc? ( dev-python/sphinx ) + test? ( + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/hypothesis[${PYTHON_USEDEP}] + ) +" + +python_prepare_all() { + # Fix pkgconfig path + sed -i -e "/libdir =/s:\"lib\":\"$(get_libdir)\":" setup.py || die + distutils-r1_python_prepare_all +} + +python_compile() { + local enable_xpyb + python_is_python3 || enable_xpyb=$(usex xcb "--enable-xpyb" "") + + esetup.py build ${enable_xpyb} +} + +python_compile_all() { + use doc && emake -C docs +} + +python_test() { + local enable_xpyb + python_is_python3 || enable_xpyb=$(usex xcb "--enable-xpyb" "") + + esetup.py test ${enable_xpyb} +} + +python_install_all() { + use doc && local HTML_DOCS=( docs/_build/. ) + + if use examples; then + dodoc -r examples + fi + + distutils-r1_python_install_all +} |