diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-09-24 11:22:25 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-09-24 11:22:25 +0100 |
commit | 6a851e4f7c23c15c4b7853e6c34b0a0b9bc68482 (patch) | |
tree | 027421c2b8ddbc8c802c488ba086753da35fcfad /app-office/scribus/files | |
parent | fcf991edcc1b310199e4e829a3706bc1c267d1db (diff) |
gentoo auto-resync : 24:09:2023 - 11:22:25
Diffstat (limited to 'app-office/scribus/files')
-rw-r--r-- | app-office/scribus/files/scribus-1.5.8-python-3.12.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app-office/scribus/files/scribus-1.5.8-python-3.12.patch b/app-office/scribus/files/scribus-1.5.8-python-3.12.patch new file mode 100644 index 000000000000..ba30cb3eb467 --- /dev/null +++ b/app-office/scribus/files/scribus-1.5.8-python-3.12.patch @@ -0,0 +1,32 @@ +Backport of https://github.com/scribusproject/scribus/commit/065459990d1fe097d4339653c7ba600cc3547523 to fix +https://bugzilla.redhat.com/show_bug.cgi?id=2155514: Fails to build with Python 3.12: error: 'PyUnicode_AS_UNICODE' +was not declared in this scope. + +--- scribus-1.5.8/scribus/plugins/scriptplugin/cmdgetsetprop.cpp 2022-01-23 17:16:04.000000000 +0100 ++++ scribus-1.5.8/scribus/plugins/scriptplugin/cmdgetsetprop.cpp.python-3.12 2023-06-17 23:59:35.497937156 +0200 +@@ -409,10 +409,8 @@ + success = obj->setProperty(propertyName, QString::fromUtf8(PyBytes_AsString(objValue))); + else if (PyUnicode_Check(objValue)) + { +- // Get a pointer to the internal buffer of the Py_Unicode object, which is UCS2 formatted +- const unsigned short * ucs2Data = (const unsigned short *) PyUnicode_AS_UNICODE(objValue); +- // and make a new QString from it (the string is copied) +- success = obj->setProperty(propertyName, QString::fromUtf16(ucs2Data)); ++ QString qStrValue = PyUnicode_asQString(objValue); ++ success = obj->setProperty(propertyName, qStrValue); + } + else + matched = false; +@@ -429,10 +427,8 @@ + } + else if (PyUnicode_Check(objValue)) + { +- // Get a pointer to the internal buffer of the Py_Unicode object, which is UCS2 formatted +- const unsigned short * utf16Data = (const unsigned short *)PyUnicode_AS_UNICODE(objValue); +- // and make a new QString from it (the string is copied) +- success = obj->setProperty(propertyName, QString::fromUtf16(utf16Data).toLatin1()); ++ QString qStrValue = PyUnicode_asQString(objValue); ++ success = obj->setProperty(propertyName, qStrValue.toLatin1()); + } + else + matched = false; |