diff mbox series

ghostscript: avoid neon on unsupported machines

Message ID 20230904084937.4135164-1-bbara93@gmail.com
State Accepted, archived
Commit 22d40fcb984849bc8735bf03b306c3a3b11eb779
Headers show
Series ghostscript: avoid neon on unsupported machines | expand

Commit Message

Benjamin Bara Sept. 4, 2023, 8:49 a.m. UTC
From: Benjamin Bara <benjamin.bara@skidata.com>

Disable neon if the machine does not support it.

Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
---
 meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Alexander Kanavin Sept. 4, 2023, 9:04 a.m. UTC | #1
On Mon, 4 Sept 2023 at 10:49, Benjamin Bara <bbara93@gmail.com> wrote:
> +do_configure:prepend () {
> +    if ! [ "${@bb.utils.filter('TUNE_FEATURES', 'neon', d)}" ]; then
> +        # unset the neon-specific variables if no neon available
> +        sed -i 's/HAVE_NEON=".*"/HAVE_NEON=""/g' ${S}/configure.ac
> +        sed -i 's/TESS_NEON=".*"/TESS_NEON=""/g' ${S}/configure.ac

Ad hoc patching with sed should be avoided if possible because it's
difficult to understand and is prone to silent breakage (e.g. no
longer doing what it was meant to). Can you make a proper patch please
and submit upstream as well? Perhaps add an explicit option?

Alex
Benjamin Bara Sept. 4, 2023, 10:53 a.m. UTC | #2
Hi Alex,

On Mon, 4 Sept 2023 at 11:04, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
> On Mon, 4 Sept 2023 at 10:49, Benjamin Bara <bbara93@gmail.com> wrote:
> > +do_configure:prepend () {
> > +    if ! [ "${@bb.utils.filter('TUNE_FEATURES', 'neon', d)}" ]; then
> > +        # unset the neon-specific variables if no neon available
> > +        sed -i 's/HAVE_NEON=".*"/HAVE_NEON=""/g' ${S}/configure.ac
> > +        sed -i 's/TESS_NEON=".*"/TESS_NEON=""/g' ${S}/configure.ac
>
> Ad hoc patching with sed should be avoided if possible because it's
> difficult to understand and is prone to silent breakage (e.g. no
> longer doing what it was meant to). Can you make a proper patch please
> and submit upstream as well? Perhaps add an explicit option?

Sure, I will post a v2 of this patch as soon as I found out how to contribute
to ghostscript :D

Thanks,
Benjamin
diff mbox series

Patch

diff --git a/meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb b/meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb
index 0ddf708f93..e149efe0f9 100644
--- a/meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb
+++ b/meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb
@@ -56,6 +56,14 @@  prune_sources() {
 }
 do_unpack[postfuncs] += "prune_sources"
 
+do_configure:prepend () {
+    if ! [ "${@bb.utils.filter('TUNE_FEATURES', 'neon', d)}" ]; then
+        # unset the neon-specific variables if no neon available
+        sed -i 's/HAVE_NEON=".*"/HAVE_NEON=""/g' ${S}/configure.ac
+        sed -i 's/TESS_NEON=".*"/TESS_NEON=""/g' ${S}/configure.ac
+    fi
+}
+
 do_install:append () {
     mkdir -p ${D}${datadir}/ghostscript/${PV}/
     cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/