Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • icshwi/yocto-mirrors/meta-openembedded
1 result
Show changes
Commits on Source (9)
  • Markus Volk's avatar
    gegl: update 0.4.56 -> 0.4.58 · c36cf6f8
    Markus Volk authored
    
    Signed-off-by: default avatarMarkus Volk <f_l_k@t-online.de>
    Signed-off-by: default avatarKhem Raj <raj.khem@gmail.com>
    c36cf6f8
  • Mingli Yu's avatar
    python3-pyzmq: Upgrade 25.1.2 -> 26.3.0 · dfdd110a
    Mingli Yu authored
    * LICENSE update:
      pyzmq no longer ships an LGPL core, it is BSD-only [1].
    
      The LICENSE.BSD is renamed to LICENSE.md [2].
    
    * The new version switches to scikit-build-core backend and build
      with cmake.
    
    [1] https://github.com/zeromq/pyzmq/commit/2f461c578b0cf188652e3ada843094cb5d24a02a
    [2] https://github.com/zeromq/pyzmq/commit/1f4bc04f433b34f95dd703d6fe018042a65e2903
    
    
    
    Signed-off-by: default avatarMingli Yu <mingli.yu@windriver.com>
    Signed-off-by: default avatarKhem Raj <raj.khem@gmail.com>
    dfdd110a
  • Khem Raj's avatar
    Revert "jq: fix build with gcc-15" · 930dff60
    Khem Raj authored
    This reverts commit ec9a5598.
    930dff60
  • Khem Raj's avatar
    jq: Stick to C17 until next release · 992194e0
    Khem Raj authored
    
    Patches are sprinkled in master branch of jq but the backports
    regresses tests, so its better to keep it at C17 for now.
    
    Signed-off-by: default avatarKhem Raj <raj.khem@gmail.com>
    Cc: Martin Jansa <martin.jansa@gmail.com>
    992194e0
  • Markus Volk's avatar
    gimp: update 2.10.38 - 3.0.2 · 23c668d6
    Markus Volk authored
    
                       ------------------------------
                       GNU Image Manipulation Program
                             Development Branch
                       ------------------------------
    
    Overview of Changes from GIMP 3.0.0 to GIMP 3.0.2
    =================================================
    
    This is a bug-fix only release.
    
    Core:
    
      - Mark some strings translatable.
      - Fix crash when choosing a brush in grid view.
      - Windows: temporary revert of some Input Device handling code which
        was breaking pressure sensitivity for some graphics tablets (though
        this revert may make issues with the eraser tip).
      - Fix crash when choosing a non-existing font in text tool options.
    
    Tools:
    
      - Reorder Line Art Detection options per design decision.
    
    Graphical User Interface:
    
      - Keep headerbar color consistent when out of focus.
      - Histogram uses the luminance value of the foreground color as a
        threshold to lighten or darken the border color for contrast with
        the histogram itself.
      - Improve separation between panels in dark theme.
      - Add default response for GimpQueryBox dialogues.
      - Spacing between toolbox widgets improved.
      - GimpSpinScale slider colors inverted.
      - New icons: "gimp-toggle-on" and "gimp-toggle-off" and using them in
        the Search Action's list as icons for toggle actions.
    
    Plug-ins:
    
      - Python Console uses the luminance of the background color for error
        text.
      - Metadata Editor: fix buffer overflow.
      - Gradient Flare: fix crash when setting the size to 0.
      - Screenshot: X11 implementation is bypassed (in favor of portals)
        when running on XWayland.
    
    Build:
    
      - Various packaging fixes and cleanup.
      - The Windows installer now prompts (only in user installation) about
        deleting GIMP config files when uninstalling.
      - GEGL 0.4.58 is now our minimum requirement.
      - Windows installer: create Restore Point on system-wide install.
    
    Signed-off-by: default avatarMarkus Volk <f_l_k@t-online.de>
    Signed-off-by: default avatarKhem Raj <raj.khem@gmail.com>
    23c668d6
  • mark.yang's avatar
    gpm: fix build with gcc-15 · 7abaf36d
    mark.yang authored
    
    * fix build with gcc-15
    
    lib/libcurses.c:46:5: error: conflicting types for 'Gpm_Wgetch'; have 'int(WINDOW *)' {aka 'int(struct _win_st *)'}
       46 | int Gpm_Wgetch(WINDOW *win)
          |     ^~~~~~~~~~
    In file included from gpm/1.99.7+gite82d1a653ca94aa4ed12441424da6ce780b1e530/git/src/headers/gpmInt.h:28,
                     from lib/libcurses.c:30:
    gpm/1.99.7+gite82d1a653ca94aa4ed12441424da6ce780b1e530/git/src/headers/gpm.h:271:12: note: previous declaration of 'Gpm_Wgetch' with type 'int(void)'
      271 | extern int Gpm_Wgetch();
          |            ^~~~~~~~~~
    
    Signed-off-by: default avatarmark.yang <mark.yang@lge.com>
    Signed-off-by: default avatarKhem Raj <raj.khem@gmail.com>
    7abaf36d
  • mark.yang's avatar
    poco: fix build with gcc-15.0.1 · a8bfe90c
    mark.yang authored
    * 0001-SimpleRowFormatter.h-fix-the-build-on-gcc-15-unsatis.patch
      backport fix from:
      https://github.com/pocoproject/poco/commit/03c35cf
    
    In file included from poco/1.13.3/git/Data/src/SimpleRowFormatter.cpp:15:
    poco/1.13.3/git/Data/include/Poco/Data/SimpleRowFormatter.h:114:21: error: declaration of 'std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) noexcept [with _Tp = Poco::Data::SimpleRowFormatter; _Require<__not_<__is_tuple_like<_Tp> >, is_move_constructible<_Tp>, is_move_assignable<_Tp> > = void]' has a different exception specifier
      114 |         inline void swap<Poco::Data::SimpleRowFormatter>(Poco::Data::SimpleRowFormatter& s1,
          |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from poco/1.13.3/recipe-sysroot/usr/include/c++/15.0.1/bits/new_allocator.h:36,
                     from poco/1.13.3/recipe-sysroot/usr/include/c++/15.0.1/aarch64-VENDOR-linux/bits/c++allocator.h:33,
                     from poco/1.13.3/recipe-sysroot/usr/include/c++/15.0.1/bits/allocator.h:46,
                     from poco/1.13.3/recipe-sysroot/usr/include/c++/15.0.1/string:45,
                     from poco/1.13.3/git/Foundation/include/Poco/Foundation.h:94,
                     from poco/1.13.3/git/Data/include/Poco/Data/Data.h:23,
                     from poco/1.13.3/git/Data/include/Poco/Data/SimpleRowFormatter.h:21:
    
    * 0002-fix-Foundation-Build-error-with-GCC-15-class-Poco-Pr.patch
      backport fix from:
      https://github.com/pocoproject/poco/commit/6faf907
    
    
    
    In file included from poco/1.13.3/git/Foundation/testsuite/src/PriorityEventTest.cpp:15:
    poco/1.13.3/git/Foundation/include/Poco/PriorityDelegate.h: In member function 'Poco::PriorityDelegate<TObj, void, true>& Poco::PriorityDelegate<TObj, void, true>::operator=(const Poco::PriorityDelegate<TObj, void, true>&)':
    poco/1.13.3/git/Foundation/include/Poco/PriorityDelegate.h:203:31: error: 'class Poco::PriorityDelegate<TObj, void, true>' has no member named '_pTarget' [-Wtemplate-body]
      203 |                         this->_pTarget        = delegate._pTarget;
          |                               ^~~~~~~~
    poco/1.13.3/git/Foundation/include/Poco/PriorityDelegate.h:203:58: error: 'const class Poco::PriorityDelegate<TObj, void, true>' has no member named '_pTarget' [-Wtemplate-body]
      203 |                         this->_pTarget        = delegate._pTarget;
          |                                                          ^~~~~~~~
    poco/1.13.3/git/Foundation/include/Poco/PriorityDelegate.h: In member function 'Poco::PriorityDelegate<TObj, void, false>& Poco::PriorityDelegate<TObj, void, false>::operator=(const Poco::PriorityDelegate<TObj, void, false>&)':
    poco/1.13.3/git/Foundation/include/Poco/PriorityDelegate.h:277:31: error: 'class Poco::PriorityDelegate<TObj, void, false>' has no member named '_pTarget' [-Wtemplate-body]
      277 |                         this->_pTarget        = delegate._pTarget;
          |                               ^~~~~~~~
    poco/1.13.3/git/Foundation/include/Poco/PriorityDelegate.h:277:58: error: 'const class Poco::PriorityDelegate<TObj, void, false>' has no member named '_pTarget' [-Wtemplate-body]
      277 |                         this->_pTarget        = delegate._pTarget;
          |                                                          ^~~~~~~~
    
    Signed-off-by: default avatarmark.yang <mark.yang@lge.com>
    Signed-off-by: default avatarKhem Raj <raj.khem@gmail.com>
    a8bfe90c
  • mark.yang's avatar
    daemonize: fix build with gcc-15 · eb7ee2aa
    mark.yang authored
    * fix build with gcc-15.0.1
      submitted to upstream: https://github.com/bmc/daemonize/pull/37
    
    
    
      following error:
    ../git/getopt.c: In function 'x_getopt':
    ../git/getopt.c:51:16: error: too many arguments to function 'write'; expected 0, have 3
    51 | (void) write(2, argv[0], (unsigned)strlen(argv[0]));
    | ^~~~~ ~
    ../git/getopt.c:78:17: note: in expansion of macro 'ERR'
    78 | ERR(": illegal option -- ", c);
    | ^~~
    ../git/getopt.c:48:20: note: declared here
    48 | extern int write();
    | ^~~~~
    
    Signed-off-by: default avatarmark.yang <mark.yang@lge.com>
    Signed-off-by: default avatarKhem Raj <raj.khem@gmail.com>
    eb7ee2aa
  • Erik Schumacher's avatar
    image_types_verity.bbclass: Optionally create hash data in separate file · e984ca3c
    Erik Schumacher authored
    
    On some setups, the verity partition and the corresponding hash data are
    handled separately. To account for this, a HASHDEV_SUFFIX is introduced
    to divert the hash data to a separate image artifact. By default, this
    suffix is equal to the image suffix, meaning that the hash data is
    appended to the verity image, like before.
    
    When the hash data is written to a separate file, the verity image is
    padded with zeroes until its size is a multiple of block_size.
    
    Signed-off-by: default avatarErik Schumacher <erik.schumacher@iris-sensing.com>
    Signed-off-by: default avatarKhem Raj <raj.khem@gmail.com>
    e984ca3c
Showing
with 659 additions and 934 deletions
......@@ -28,7 +28,7 @@ ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
SHPV = "${@gnome_verdir("${PV}")}"
SRC_URI = "https://download.gimp.org/pub/${BPN}/${SHPV}/${BP}.tar.xz"
SRC_URI[sha256sum] = "a04a64b90f9b5ac9ae5643401c7d5eb3cb41f42c52ce9787089b5d2a2dd3cc5c"
SRC_URI[sha256sum] = "d5678bbd5fe535941b82f965b97fcc9385ce936f70c982bd565a53d5519d1bff"
PACKAGECONFIG ??= "gexiv2 libraw librsvg pango poppler sdl2"
PACKAGECONFIG:class-native = "librsvg"
......
From 5711ccfab40e304ced7f5be39a4083e3fcecff91 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 24 May 2023 22:22:41 -0700
Subject: [PATCH] configure: Keep first line of compiler version string
Full output of cc -v may contain additional information which could
contain build path information, which is unnessasary
Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/926]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index c25415d..68707a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -599,7 +599,7 @@ fi
for CC_VERSION_OPT in $CC_VERSION_OPTS; do
# We run $CC, and escape and format its output, in a single step,
# since some shells expand escape sequences in "echo" arguments.
- CC_VERSION="`$CC $CC_VERSION_OPT 2>&1 | sed -e 's/\\\\/\\\\\\\\\\\\\\\\/g;s/^/\\\\t/;s/$/\\\\n/' | tr -d '\n'`"
+ CC_VERSION="`$CC $CC_VERSION_OPT 2>&1 | head -1 | sed -e 's/\\\\/\\\\\\\\\\\\\\\\/g;s/^/\\\\t/;s/$/\\\\n/' | tr -d '\n'`"
if test $? -eq 0; then
break
fi
--
2.40.1
From a2458f1528e5733574bb26ff5452b1329116e6db Mon Sep 17 00:00:00 2001
From: Simon Budig <simon@budig.de>
Date: Sat, 20 May 2023 18:40:41 +0200
Subject: [PATCH] file-tiff-load: fix mismatching variable type
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gimp/-/commit/a2458f1528e5733574bb26ff5452b1329116e6db]
Signed-off-by: Khem Raj <raj.khem@gmai.com>
---
plug-ins/file-tiff/file-tiff-load.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/plug-ins/file-tiff/file-tiff-load.c
+++ b/plug-ins/file-tiff/file-tiff-load.c
@@ -1301,8 +1301,8 @@ load_image (GFile *file,
/* any resolution info in the file? */
{
- gfloat xres = 72.0;
- gfloat yres = 72.0;
+ gdouble xres = 72.0;
+ gdouble yres = 72.0;
gushort read_unit;
GimpUnit unit = GIMP_UNIT_PIXEL; /* invalid unit */
From a7e40e19d17404cf5ec4135fc1becd5a90f5e1e1 Mon Sep 17 00:00:00 2001
From: Markus Volk <f_l_k@t-online.de>
Date: Wed, 25 Dec 2024 07:27:04 +0100
Subject: [PATCH] gimp: cross-compile fix for bz2
autotools bzip2 build does not create pkgconfig files so looking for the dependency fails.
Signed-off-by: Markus Volk <f_l_k@t-online.de>
Upstream-Status: Inappropriate [can probably be removed once bzip2 is built with meson or cmake]
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 4e48f8c64c..d5dce47015 100644
--- a/meson.build
+++ b/meson.build
@@ -765,7 +765,7 @@ zlib = dependency('zlib')
MIMEtypes += 'image/x-psp'
# Compiler-provided headers can't be found in crossroads environment
-if not meson.is_cross_build()
+if true
bz2 = cc.find_library('bz2')
else
bz2 = dependency('bzip2')
--
2.47.1
From 7e5b986cb7797a6535fe2471b9a5fb7c00821f51 Mon Sep 17 00:00:00 2001
From: Yoann Congal <yoann.congal@smile.fr>
Date: Sun, 13 Oct 2024 01:00:10 +0200
Subject: [PATCH] gimptool: allow default CC override
From: Yoann Congal <yoann.congal@smile.fr>
In OE, CC contains sysroot path. Storing CC in binary then leads to
non-reproducibility.
This commit add a new configure option "--with-default-cc='cmd'" for
force the CC stored in gimptool to a reproducible value.
Upstream-Status: Inappropriate [does not apply on master (upstream has moved to meson)]
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
app-tools/Makefile.am | 2 +-
configure.ac | 13 +++++++++++++
tools/Makefile.am | 2 +-
tools/gimptool.c | 2 +-
4 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/app-tools/Makefile.am b/app-tools/Makefile.am
index a7cd4ce..81a3a00 100644
--- a/app-tools/Makefile.am
+++ b/app-tools/Makefile.am
@@ -67,7 +67,7 @@ AM_CPPFLAGS = \
-DMANDIR=\""$(mandir)"\" \
-DGIMPPLUGINDIR=\""$(gimpplugindir)"\" \
-DGIMPDATADIR=\""$(gimpdatadir)"\" \
- -DCC=\""$(CC)"\" \
+ -DDEFAULT_CC=\""@DEFAULT_CC@"\" \
-DGIMPDIR=\""$(gimpdir)"\" \
-DGIMP_PLUGIN_VERSION=\""$(GIMP_PLUGIN_VERSION)"\" \
-I$(top_srcdir) \
diff --git a/configure.ac b/configure.ac
index a88b7cc..d90b6db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2457,6 +2457,19 @@ fi
AM_CONDITIONAL(DESKTOP_DATADIR, test "x$with_desktop_dir" != xno)
AC_SUBST(DESKTOP_DATADIR)
+######################
+# Determine default CC
+######################
+
+AC_ARG_WITH(default-cc, [ --with-default-cc="cmd" default CC to print in gimptool (default=CC)])
+
+if test "x$with_default_cc" != x; then
+ DEFAULT_CC=$with_default_cc
+else
+ DEFAULT_CC=CC
+fi
+
+AC_SUBST(DEFAULT_CC)
#####################
# Check for XML tools
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 420b9b1..ccabde8 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -87,7 +87,7 @@ AM_CPPFLAGS = \
-DMANDIR=\""$(mandir)"\" \
-DGIMPPLUGINDIR=\""$(gimpplugindir)"\" \
-DGIMPDATADIR=\""$(gimpdatadir)"\" \
- -DCC=\""$(CC)"\" \
+ -DDEFAULT_CC=\""@DEFAULT_CC@"\" \
-DGIMPDIR=\""$(gimpdir)"\" \
-DGIMP_PLUGIN_VERSION=\""$(GIMP_PLUGIN_VERSION)"\" \
-I$(top_srcdir) \
diff --git a/tools/gimptool.c b/tools/gimptool.c
index 21fc043..bbf3fa5 100644
--- a/tools/gimptool.c
+++ b/tools/gimptool.c
@@ -280,7 +280,7 @@ find_out_env_flags (void)
else if (msvc_syntax)
env_cc = "cl -MD";
else
- env_cc = CC;
+ env_cc = DEFAULT_CC;
if (g_ascii_strncasecmp (env_cc, "cl", 2) == 0 &&
g_ascii_strncasecmp (env_cc, "clang", 5) != 0)
From c720df90dfe3a3e92e34bfb36a04cc792064a501 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 24 May 2023 22:39:02 -0700
Subject: [PATCH] libtool: Do not add build time library paths to
LD_LIBRARY_PATH
This does not serve much purpose on cross builds as it will add build
time paths which are only useful when trying to run these tools from
build area but when they are cross built this is not possible to run
them like this.
Upstream-Status: Inappropriate [Cross-compile specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
ltmain.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ltmain.sh b/ltmain.sh
index 134902c..068d74a 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -5748,7 +5748,7 @@ func_exec_program ()
if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$ECHO "\
# Add our own library path to $shlibpath_var
- $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+ $shlibpath_var=\"$shlibpath_var\"
# Some systems cannot cope with colon-terminated $shlibpath_var
# The second colon is a workaround for a bug in BeOS R4 sed
--
2.40.1
From 51311f913d9f417d121f59b83d560c7b4b853d1c Mon Sep 17 00:00:00 2001
From: Simon Budig <simon@budig.de>
Date: Sat, 20 May 2023 22:25:40 +0200
Subject: [PATCH] metadata: shut up a weird warning
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gimp/-/commit/51311f913d9f417d121f59b83d560c7b4b853d1c]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
plug-ins/metadata/metadata-editor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/plug-ins/metadata/metadata-editor.c
+++ b/plug-ins/metadata/metadata-editor.c
@@ -2140,7 +2140,7 @@ metadata_dialog_editor_set_metadata (GEx
}
else
{
- if (! g_strv_contains (values, equiv_values[evi]))
+ if (! g_strv_contains ((const gchar * const *) values, equiv_values[evi]))
{
gchar *tmpvalue;
From bf19c5687703769e406a8086036d4ed6421c33cb Mon Sep 17 00:00:00 2001
From: Markus Volk <f_l_k@t-online.de>
Date: Mon, 13 Jan 2025 10:04:33 +0100
Subject: [PATCH] meson.build: reproducibility fix
Signed-off-by: Markus Volk <f_l_k@t-online.de>
Upstream-Status: Inappropriate [oe-specific]
---
meson.build | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/meson.build b/meson.build
index 97cd621780..e47180db87 100644
--- a/meson.build
+++ b/meson.build
@@ -1599,23 +1599,23 @@ conf.set('HAVE_FUNC_ATTRIBUTE_DESTRUCTOR',
conf.set_quoted('CC', cc.get_id())
cc_version=''
-if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
- cc_cmd = run_command(cc, '-v', check: false)
+#if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
+# cc_cmd = run_command(cc, '-v', check: false)
# Note: the call might actually fail when using ccache.
# See: https://github.com/mesonbuild/meson/issues/6174
- if cc_cmd.returncode() == 0
- cc_version = cc_cmd.stdout() + cc_cmd.stderr()
- endif
-else
+# if cc_cmd.returncode() == 0
+# cc_version = cc_cmd.stdout() + cc_cmd.stderr()
+# endif
+#else
# Various compilers have various options. Try most common ones. This
# list of options comes from autotools checks.
- foreach arg : [ '--version', '-v', '-V', '-qversion' ]
- cc_cmd = run_command(cc, arg, check: false)
- if cc_cmd.returncode() == 0
- cc_version = cc_cmd.stdout()
- endif
- endforeach
-endif
+# foreach arg : [ '--version', '-v', '-V', '-qversion' ]
+# cc_cmd = run_command(cc, arg, check: false)
+# if cc_cmd.returncode() == 0
+# cc_version = cc_cmd.stdout()
+# endif
+# endforeach
+#endif
if cc_version == ''
# We didn't manage to get a meaningful verbose version from the
# compiler. Just save its name and version.
--
2.47.1
SUMMARY = "The GIMP is the GNU Image Manipulation Program"
HOMEPAGE = "http://www.gimp.org"
SECTION = "x11/graphics"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=c678957b0c8e964aa6c70fd77641a71e"
DEPENDS = " \
alsa-lib \
atk \
cairo \
fontconfig \
freetype \
gdk-pixbuf-native \
intltool-native \
libxslt-native \
gegl-native \
dbus-glib \
gtk+ \
babl \
gegl \
libmypaint \
mypaint-brushes-1.0 \
gexiv2 \
jpeg \
libmng \
libpng \
libexif \
tiff \
lcms \
poppler \
poppler-data \
jasper \
bzip2 \
libgudev \
libmng \
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxmu libxpm', '', d)} \
"
DEPENDS:append:libc-musl = " libexecinfo"
GNOMEBASEBUILDCLASS = "autotools"
inherit features_check gnomebase gtk-icon-cache gtk-doc mime-xdg
REQUIRED_DISTRO_FEATURES = "x11"
SHPV = "${@gnome_verdir("${PV}")}"
SRC_URI = "https://download.gimp.org/pub/${BPN}/v${SHPV}/${BP}.tar.bz2 \
file://0001-configure-Keep-first-line-of-compiler-version-string.patch \
file://0001-libtool-Do-not-add-build-time-library-paths-to-LD_LI.patch \
file://0001-file-tiff-load-fix-mismatching-variable-type.patch \
file://0001-metadata-shut-up-a-weird-warning.patch \
file://0001-gimptool-allow-default-CC-override.patch \
"
SRC_URI[sha256sum] = "50a845eec11c8831fe8661707950f5b8446e35f30edfb9acf98f85c1133f856e"
EXTRA_OECONF = "--disable-python \
--without-webkit \
--disable-check-update \
--without-wmf"
EXTRA_OECONF += "${@oe.utils.conditional('SITEINFO_BITS', '32', ' --disable-vector-icons', '', d)}"
do_configure:append() {
find ${B} -name Makefile | xargs sed -i s:'-I$(includedir)':'-I.':g
find ${B} -name Makefile | xargs sed -i s:'-I/usr/include':'-I${STAGING_INCDIR}':g
}
do_compile:prepend() {
# Let native babl/gegl find their plugins
export BABL_PATH=`find ${STAGING_LIBDIR_NATIVE} -maxdepth 1 -name 'babl-*'`
export GEGL_PATH=`find ${STAGING_LIBDIR_NATIVE} -maxdepth 1 -name 'gegl-*'`
}
FILES:${PN} += "${datadir}/metainfo"
RDEPENDS:${PN} += "mypaint-brushes-1.0"
# gimptool
# gimptool needs a CC definition, use current CC without sysroot
python __anonymous() {
import shlex
CC_WITHOUT_SYSROOT = shlex.join(filter(lambda x: not x.startswith("--sysroot="), shlex.split(d.getVar("CC"))))
d.setVar("CC_WITHOUT_SYSROOT", CC_WITHOUT_SYSROOT)
}
EXTRA_OECONF += "--with-default-cc='${CC_WITHOUT_SYSROOT}'"
# Split gimptool in its own package
PACKAGE_BEFORE_PN += "${PN}-gimptool"
FILES:${PN}-gimptool += "${bindir}/gimptool-2.0"
# gimptool depends on gimp .pc file being installed and tools to build the plugin.
RDEPENDS:${PN}-gimptool += "${PN}-dev packagegroup-core-buildessential"
INSANE_SKIP:${PN}-gimptool += "dev-deps"
CVE_STATUS[CVE-2007-3741] = "not-applicable-platform: This only applies for Mandriva Linux"
CVE_STATUS[CVE-2009-0581] = "cpe-incorrect: The current version (2.10.38) is not affected."
CVE_STATUS[CVE-2009-0723] = "cpe-incorrect: The current version (2.10.38) is not affected."
CVE_STATUS[CVE-2009-0733] = "cpe-incorrect: The current version (2.10.38) is not affected."
SUMMARY = "The GIMP is the GNU Image Manipulation Program"
HOMEPAGE = "http://www.gimp.org"
SECTION = "graphics"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=c678957b0c8e964aa6c70fd77641a71e"
DEPENDS = " \
appstream-glib \
atk \
babl \
bzip2 \
bison-native \
cairo \
fontconfig \
freetype \
gdk-pixbuf-native \
gegl \
gexiv2 \
glib-2.0 \
glib-2.0-native \
gtk+3 \
harfbuzz \
iso-codes \
jpeg \
json-glib \
lcms \
libarchive \
libexif \
libmypaint \
libpng \
librsvg \
librsvg-native \
libxmu \
libxslt-native \
mypaint-brushes-1.0 \
pango \
poppler \
poppler-data \
python3-pygobject-native \
tiff \
xz \
zlib \
"
DEPENDS:append:libc-musl = " libexecinfo"
inherit meson gtk-icon-cache mime-xdg pkgconfig gettext gobject-introspection vala
GIR_MESON_OPTION = 'can-crosscompile-gir'
VALA_MESON_OPTION = "vala"
VALA_MESON_ENABLE_FLAG = "enabled"
VALA_MESON_DISABLE_FLAG = "disabled"
GIDOCGEN_MESON_OPTION = "gi-docgen"
GIDOCGEN_MESON_ENABLE_FLAG = "enabled"
GIDOCGEN_MESON_DISABLE_FLAG = "disabled"
SRC_URI = "https://download.gimp.org/gimp/v${@oe.utils.trim_version('${PV}', 2)}/gimp-${PV}.tar.xz"
SRC_URI += "file://0001-gimp-cross-compile-fix-for-bz2.patch"
SRC_URI += "file://0002-meson.build-reproducibility-fix.patch"
SRC_URI[sha256sum] = "546ddc30cb2d0e79123c7fcb4d78211e1ee7a6aace91a6a0ad8cbcbf6ea571a2"
PACKAGECONFIG[aa] = "-Daa=enabled,-Daa=disabled,aalib"
PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib"
PACKAGECONFIG[appdata-test] = "-Dappdata-test=enabled,-Dappdata-test=disabled,appstream-glib-native"
PACKAGECONFIG[cairo-pdf] = "-Dcairo-pdf=enabled,-Dcairo-pdf=disabled"
PACKAGECONFIG[check-update] = "-Dcheck-update=yes,-Dcheck-update=no"
PACKAGECONFIG[ghostscript] = "-Dghostscript=enabled,-Dghostscript=disabled,ghostscript,ghostscript"
PACKAGECONFIG[gudev] = "-Dgudev=enabled,-Dgudev=disabled,libgudev"
PACKAGECONFIG[heif] = "-Dheif=enabled,-Dheif=disabled,libheif"
PACKAGECONFIG[javascript] = "-Djavascript=enabled,-Djavascript=disabled,,gjs"
PACKAGECONFIG[jpeg2000] = "-Djpeg2000=enabled,-Djpeg2000=disabled,jasper"
PACKAGECONFIG[jpeg-xl] = "-Djpeg-xl=enabled,-Djpeg-xl=disabled,libjxl"
PACKAGECONFIG[libunwind] = "-Dlibunwind=true,-Dlibunwind=false,libunwind"
PACKAGECONFIG[libbacktrace] = "-Dlibbacktrace=true,-Dlibbacktrace=false,libbacktrace"
PACKAGECONFIG[lua] = "-Dlua=true,-Dlua=false,,luajit lua-lgi"
PACKAGECONFIG[mng] = "-Dmng=enabled,-Dmng=disabled,libmng"
PACKAGECONFIG[openmp] = "-Dopenmp=enabled,-Dopenmp=disabled,gcc-runtime"
PACKAGECONFIG[vector-icons] = "-Dvector-icons=true,-Dvector-icons=false,librsvg shared-mime-info"
PACKAGECONFIG[webp] = "-Dwebp=enabled,-Dwebp=disabled,libwebp"
PACKAGECONFIG[xcursor] = "-Dxcursor=enabled,-Dxcursor=disabled,libxcursor"
PACKAGECONFIG[x11] = "-Dxpm=enabled,-Dxpm=disabled,libxpm libxext libxfixes"
PACKAGECONFIG ?= " \
alsa \
cairo-pdf \
ghostscript \
gudev \
javascript \
jpeg2000 \
jpeg-xl \
lua \
mng \
webp \
${@oe.utils.conditional('SITEINFO_BITS', '32', '', 'vector-icons', d)} \
${@bb.utils.contains('LICENSE_FLAGS_ACCEPTED', 'commercial', 'heif', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcursor', '', d)} \
"
PACKAGECONFIG:remove:riscv32 = "lua"
PACKAGECONFIG:remove:riscv64 = "lua"
PACKAGECONFIG:remove:powerpc64 = "lua"
PACKAGECONFIG:remove:powerpc64le = "lua"
EXTRA_OEMESON += " \
-Dshmem-type=posix \
-Dlinux-input=enabled \
--buildtype release \
--cross-file=${WORKDIR}/meson-${PN}.cross \
"
do_write_config:append() {
cat >${WORKDIR}/meson-${PN}.cross <<EOF
[binaries]
gjs = '${bindir}/gjs'
luajit = '${bindir}/luajit'
EOF
}
do_configure:append () {
sed -i -e "s|build_by_default: true|build_by_default: false|" ${S}/gimp-data/images/meson.build
}
do_install:prepend() {
sed -i -e "s|${B}||" ${B}/app/widgets/gimplanguagestore-data.h
sed -i -e "s|${B}||" ${B}/plug-ins/file-bmp/huffman.h
}
FILES:${PN} += "${datadir}/metainfo"
RDEPENDS:${PN} = "mypaint-brushes-1.0 glib-networking python3-pygobject"
......@@ -26,6 +26,10 @@
# should be the same blockdevice in the command shown above while <dm_dev_name>
# is the name of the to be created dm-verity-device.
#
# By specifying a different VERITY_IMAGE_HASHDEV_SUFFIX, the hash tree data can
# be created in a separate file. In this case, <dev> is just zero padded to a
# multiple of VERITY_BLOCK_SIZE. <hash_dev> will be a separate file.
#
# The root hash is calculated using a salt to make attacks more difficult. Thus,
# please grant each image recipe its own salt which could be generated e.g. via
#
......@@ -42,6 +46,7 @@ VERITY_SALT ?= "${CLASS_VERITY_SALT}"
VERITY_BLOCK_SIZE ?= "4096"
VERITY_IMAGE_FSTYPE ?= "ext4"
VERITY_IMAGE_SUFFIX ?= ".verity"
VERITY_IMAGE_HASHDEV_SUFFIX ?= "${VERITY_IMAGE_SUFFIX}"
VERITY_INPUT_IMAGE ?= "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${VERITY_IMAGE_FSTYPE}"
IMAGE_TYPEDEP:verity = "${VERITY_IMAGE_FSTYPE}"
......@@ -56,6 +61,7 @@ python __anonymous() {
}
python do_image_verity () {
import io
import os
import subprocess
import shutil
......@@ -66,6 +72,9 @@ python do_image_verity () {
verity_image_suffix = d.getVar('VERITY_IMAGE_SUFFIX')
verity = '{}{}'.format(image, verity_image_suffix)
verity_image_hashdev_suffix = d.getVar('VERITY_IMAGE_HASHDEV_SUFFIX')
verity_hashdev = '{}{}'.format(image, verity_image_hashdev_suffix)
# For better readability the parameter VERITY_BLOCK_SIZE is specified in
# bytes. It must be a multiple of the logical sector size which is 512 bytes
# in Linux. Make sure that this is the case as otherwise the resulting
......@@ -87,9 +96,9 @@ python do_image_verity () {
bb.debug(1, f"data_size_blocks: {data_size_blocks}, {data_size_rest}")
bb.debug(1, f"data_size: {data_size}")
# Create verity image
try:
output = subprocess.check_output([
if verity == verity_hashdev:
# creating self-contained dm-verity image
veritysetup_command = [
'veritysetup', 'format',
'--no-superblock',
'--salt={}'.format(salt),
......@@ -98,7 +107,27 @@ python do_image_verity () {
'--hash-block-size={}'.format(block_size),
'--hash-offset={}'.format(data_size),
verity, verity,
])
]
else:
# creating separate dm-verity and hash device image
veritysetup_command = [
'veritysetup', 'format',
'--salt={}'.format(salt),
'--data-blocks={}'.format(data_blocks),
'--data-block-size={}'.format(block_size),
'--hash-block-size={}'.format(block_size),
verity, verity_hashdev,
]
# veritysetup expects the data device size to be a multiple of block_size
# when creating a separate hashdev file, zero pad verity file if needed
if data_size_rest:
with open(verity, 'rb+') as verityfile:
verityfile.seek(0, io.SEEK_END)
verityfile.write(b'\x00' * (block_size - data_size_rest))
# Create verity image
try:
output = subprocess.check_output(veritysetup_command)
except subprocess.CalledProcessError as err:
bb.fatal('%s returned with %s (%s)' % (err.cmd, err.returncode, err.output))
......@@ -128,7 +157,11 @@ python do_image_verity () {
bb.fatal('Unexpected error %s' % err)
# Create symlinks
for suffix in [ verity_image_suffix, '.verity-info', '.verity-params' ]:
suffix_list = [ verity_image_suffix, '.verity-info', '.verity-params' ]
if verity != verity_hashdev:
suffix_list.append(verity_image_hashdev_suffix)
for suffix in suffix_list:
try:
os.remove(link + suffix)
except FileNotFoundError:
......
From 8707f8764dfc470d1974eb1d613f5a4bec3610ac Mon Sep 17 00:00:00 2001
From: Emanuele Torre <torreemanuele6@gmail.com>
Date: Fri, 26 Jan 2024 04:42:11 +0100
Subject: [PATCH] builtin.c: fix build with -Woverlength-strings
C99 only allows string literals long at most 4095 characters.
jq_builtins was a lot longer than that.
I rewrote all the optional libm error stubs in C so the value of
jq_builtins is not build dependent.
I replaced the command that generates builtin.inc with a POSIX compliant
od|sed command that encodes builtin.jq as a comma delimited list of
octal numbers (that can be embedded in C using a {} literal).
I also added -Woverlength-strings to AM_CFLAGS to verify that the
problem is fixed.
Fixes #1481
Upstream-Status: Backport [605836b builtin.c: fix build with -Woverlength-strings]
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
Makefile.am | 10 ++++--
src/builtin.c | 86 ++++++++++++++++++++++++---------------------------
2 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 76e35df..f1f9f2e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,8 @@ LIBJQ_SRC = src/builtin.c src/bytecode.c src/compile.c src/execute.c \
### C build options
-AM_CFLAGS = -Wextra -Wall -Wno-unused-parameter -Wno-unused-function
+AM_CFLAGS = -Wextra -Wall -Wno-unused-parameter -Wno-unused-function \
+ -Woverlength-strings
if WIN32
AM_CFLAGS += -municode
@@ -119,7 +120,12 @@ src/main.c: src/version.h src/config_opts.inc
src/builtin.inc: $(srcdir)/src/builtin.jq
mkdir -p src
- $(AM_V_GEN) sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $(srcdir)/src/builtin.jq > $@
+ $(AM_V_GEN) od -v -A n -t o1 -- $< | \
+ sed -e 's/$$/ /' \
+ -e 's/\([0123456789]\) /\1, /g' \
+ -e 's/ $$//' \
+ -e 's/ 0/ 0/g' \
+ -e 's/ \([123456789]\)/ 0\1/g' > $@
src/builtin.o: src/builtin.inc
CLEANFILES = src/version.h .remake-version-h src/builtin.inc src/config_opts.inc
diff --git a/src/builtin.c b/src/builtin.c
index 902490d..a3ce7e4 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -155,7 +155,11 @@ static jv f_ ## name(jq_state *jq, jv input) { \
jv_free(input); \
return ret; \
}
-#define LIBM_DD_NO(name)
+#define LIBM_DD_NO(name) \
+static jv f_ ## name(jq_state *jq, jv input) { \
+ jv error = jv_string("Error: " #name "/0 not found at build time"); \
+ return ret_error(input, error); \
+}
#define LIBM_DDD(name) \
static jv f_ ## name(jq_state *jq, jv input, jv a, jv b) { \
@@ -173,7 +177,12 @@ static jv f_ ## name(jq_state *jq, jv input, jv a, jv b) { \
jv_free(b); \
return ret; \
}
-#define LIBM_DDD_NO(name)
+#define LIBM_DDD_NO(name) \
+static jv f_ ## name(jq_state *jq, jv input, jv a, jv b) { \
+ jv_free(b); \
+ jv error = jv_string("Error: " #name "/2 not found at build time"); \
+ return ret_error2(input, a, error); \
+}
#define LIBM_DDDD(name) \
static jv f_ ## name(jq_state *jq, jv input, jv a, jv b, jv c) { \
@@ -199,7 +208,14 @@ static jv f_ ## name(jq_state *jq, jv input, jv a, jv b, jv c) { \
jv_free(c); \
return ret; \
}
-#define LIBM_DDDD_NO(name)
+#define LIBM_DDDD_NO(name) \
+static jv f_ ## name(jq_state *jq, jv input, jv a, jv b, jv c) { \
+ jv_free(c) \
+ jv_free(b); \
+ jv error = jv_string("Error: " #name "/3 not found at build time"); \
+ return ret_error2(input, a, error); \
+}
+
#include "libm.h"
#undef LIBM_DDDD_NO
#undef LIBM_DDD_NO
@@ -226,6 +242,11 @@ static jv f_frexp(jq_state *jq, jv input) {
jv_free(input);
return ret;
}
+#else
+static jv f_frexp(jq_state *jq, jv input) {
+ jv error = jv_string("Error: frexp/0 not found at build time");
+ return ret_error(input, error);
+}
#endif
#ifdef HAVE_MODF
static jv f_modf(jq_state *jq, jv input) {
@@ -237,6 +258,11 @@ static jv f_modf(jq_state *jq, jv input) {
jv_free(input);
return jv_array_append(ret, jv_number(i));
}
+#else
+static jv f_modf(jq_state *jq, jv input) {
+ jv error = jv_string("Error: modf/0 not found at build time");
+ return ret_error(input, error);
+}
#endif
#ifdef HAVE_LGAMMA_R
static jv f_lgamma_r(jq_state *jq, jv input) {
@@ -248,6 +274,11 @@ static jv f_lgamma_r(jq_state *jq, jv input) {
jv_free(input);
return jv_array_append(ret, jv_number(sign));
}
+#else
+static jv f_lgamma_r(jq_state *jq, jv input) {
+ jv error = jv_string("Error: lgamma_r/0 not found at build time");
+ return ret_error(input, error);
+}
#endif
static jv f_negate(jq_state *jq, jv input) {
@@ -1703,27 +1734,21 @@ static jv f_current_line(jq_state *jq, jv a) {
#define LIBM_DD(name) \
{f_ ## name, #name, 1},
-#define LIBM_DD_NO(name)
+#define LIBM_DD_NO(name) LIBM_DD(name)
#define LIBM_DDD(name) \
{f_ ## name, #name, 3},
-#define LIBM_DDD_NO(name)
+#define LIBM_DDD_NO(name) LIBM_DDD(name)
#define LIBM_DDDD(name) \
{f_ ## name, #name, 4},
-#define LIBM_DDDD_NO(name)
+#define LIBM_DDDD_NO(name) LIBM_DDDD(name)
static const struct cfunction function_list[] = {
#include "libm.h"
-#ifdef HAVE_FREXP
{f_frexp,"frexp", 1},
-#endif
-#ifdef HAVE_MODF
{f_modf,"modf", 1},
-#endif
-#ifdef HAVE_LGAMMA_R
{f_lgamma_r,"lgamma_r", 1},
-#endif
{f_negate, "_negate", 1},
#define BINOP(name) {f_ ## name, "_" #name, 3},
BINOPS
@@ -1838,42 +1863,11 @@ static block bind_bytecoded_builtins(block b) {
return BLOCK(builtins, b);
}
-static const char jq_builtins[] =
+static const char jq_builtins[] = {
/* Include jq-coded builtins */
#include "src/builtin.inc"
-
-/* Include unsupported math functions next */
-#define LIBM_DD(name)
-#define LIBM_DDD(name)
-#define LIBM_DDDD(name)
-#define LIBM_DD_NO(name) "def " #name ": \"Error: " #name "/0 not found at build time\"|error;"
-#define LIBM_DDD_NO(name) "def " #name "(a;b): \"Error: " #name "/2 not found at build time\"|error;"
-#define LIBM_DDDD_NO(name) "def " #name "(a;b;c): \"Error: " #name "/3 not found at build time\"|error;"
-#include "libm.h"
-#ifndef HAVE_FREXP
- "def frexp: \"Error: frexp/0 not found at build time\"|error;"
-#endif
-#ifndef HAVE_MODF
- "def modf: \"Error: modf/0 not found at build time\"|error;"
-#endif
-#ifndef HAVE_LGAMMA_R
- "def lgamma_r: \"Error: lgamma_r/0 not found at build time\"|error;"
-#endif
-;
-
-#undef LIBM_DDDD_NO
-#undef LIBM_DDD_NO
-#undef LIBM_DD_NO
-#undef LIBM_DDDD
-#undef LIBM_DDD
-#undef LIBM_DD
-
-#ifdef __APPLE__
-#undef HAVE_GAMMA
-#undef HAVE_EXP10
-#undef HAVE_DREM
-#undef HAVE_SIGNIFICAND
-#endif
+ '\0',
+};
static block gen_builtin_list(block builtins) {
jv list = jv_array_append(block_list_funcs(builtins, 1), jv_string("builtins/0"));
From c65e6fa48e6da30727c87ccdd88d8fb6a7a70f20 Mon Sep 17 00:00:00 2001
From: Emanuele Torre <torreemanuele6@gmail.com>
Date: Fri, 26 Jan 2024 11:26:57 +0100
Subject: [PATCH] libm.h+builtin.c: add and use LIBM_DA and LIBM_DA_NO macros
For functions that from one double return an array with two numbers.
Upstream-Status: Backport [bd3c828 libm.h+builtin.c: add and use LIBM_DA and LIBM_DA_NO macros]
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
src/builtin.c | 78 ++++++++++++++++-----------------------------------
src/libm.h | 15 ++++++++++
2 files changed, 39 insertions(+), 54 deletions(-)
diff --git a/src/builtin.c b/src/builtin.c
index a3ce7e4..9b71bca 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -216,13 +216,32 @@ static jv f_ ## name(jq_state *jq, jv input, jv a, jv b, jv c) { \
return ret_error2(input, a, error); \
}
+#define LIBM_DA(name, type) \
+static jv f_ ## name(jq_state *jq, jv input) { \
+ if (jv_get_kind(input) != JV_KIND_NUMBER) { \
+ return type_error(input, "number required"); \
+ } \
+ type value; \
+ double d = name(jv_number_value(input), &value); \
+ jv ret = JV_ARRAY(jv_number(d), jv_number(value)); \
+ jv_free(input); \
+ return ret; \
+}
+#define LIBM_DA_NO(name, type) \
+static jv f_ ## name(jq_state *jq, jv input) { \
+ jv error = jv_string("Error: " #name "/0 not found at build time"); \
+ return ret_error(input, error); \
+}
+
#include "libm.h"
#undef LIBM_DDDD_NO
#undef LIBM_DDD_NO
#undef LIBM_DD_NO
+#undef LIBM_DA_NO
#undef LIBM_DDDD
#undef LIBM_DDD
#undef LIBM_DD
+#undef LIBM_DA
#ifdef __APPLE__
#undef gamma
@@ -231,56 +250,6 @@ static jv f_ ## name(jq_state *jq, jv input, jv a, jv b, jv c) { \
#undef exp10
#endif
-#ifdef HAVE_FREXP
-static jv f_frexp(jq_state *jq, jv input) {
- if (jv_get_kind(input) != JV_KIND_NUMBER) {
- return type_error(input, "number required");
- }
- int exp;
- double d = frexp(jv_number_value(input), &exp);
- jv ret = JV_ARRAY(jv_number(d), jv_number(exp));
- jv_free(input);
- return ret;
-}
-#else
-static jv f_frexp(jq_state *jq, jv input) {
- jv error = jv_string("Error: frexp/0 not found at build time");
- return ret_error(input, error);
-}
-#endif
-#ifdef HAVE_MODF
-static jv f_modf(jq_state *jq, jv input) {
- if (jv_get_kind(input) != JV_KIND_NUMBER) {
- return type_error(input, "number required");
- }
- double i;
- jv ret = JV_ARRAY(jv_number(modf(jv_number_value(input), &i)));
- jv_free(input);
- return jv_array_append(ret, jv_number(i));
-}
-#else
-static jv f_modf(jq_state *jq, jv input) {
- jv error = jv_string("Error: modf/0 not found at build time");
- return ret_error(input, error);
-}
-#endif
-#ifdef HAVE_LGAMMA_R
-static jv f_lgamma_r(jq_state *jq, jv input) {
- if (jv_get_kind(input) != JV_KIND_NUMBER) {
- return type_error(input, "number required");
- }
- int sign;
- jv ret = JV_ARRAY(jv_number(lgamma_r(jv_number_value(input), &sign)));
- jv_free(input);
- return jv_array_append(ret, jv_number(sign));
-}
-#else
-static jv f_lgamma_r(jq_state *jq, jv input) {
- jv error = jv_string("Error: lgamma_r/0 not found at build time");
- return ret_error(input, error);
-}
-#endif
-
static jv f_negate(jq_state *jq, jv input) {
if (jv_get_kind(input) != JV_KIND_NUMBER) {
return type_error(input, "cannot be negated");
@@ -1733,8 +1702,10 @@ static jv f_current_line(jq_state *jq, jv a) {
}
#define LIBM_DD(name) \
- {f_ ## name, #name, 1},
+ {f_ ## name, #name, 1},
#define LIBM_DD_NO(name) LIBM_DD(name)
+#define LIBM_DA(name, type) LIBM_DD(name)
+#define LIBM_DA_NO(name, type) LIBM_DD(name)
#define LIBM_DDD(name) \
{f_ ## name, #name, 3},
@@ -1746,9 +1717,6 @@ static jv f_current_line(jq_state *jq, jv a) {
static const struct cfunction function_list[] = {
#include "libm.h"
- {f_frexp,"frexp", 1},
- {f_modf,"modf", 1},
- {f_lgamma_r,"lgamma_r", 1},
{f_negate, "_negate", 1},
#define BINOP(name) {f_ ## name, "_" #name, 3},
BINOPS
@@ -1813,9 +1781,11 @@ BINOPS
#undef LIBM_DDDD_NO
#undef LIBM_DDD_NO
#undef LIBM_DD_NO
+#undef LIBM_DA_NO
#undef LIBM_DDDD
#undef LIBM_DDD
#undef LIBM_DD
+#undef LIBM_DA
struct bytecoded_builtin { const char* name; block code; };
static block bind_bytecoded_builtins(block b) {
diff --git a/src/libm.h b/src/libm.h
index 8efc1c5..7332bd8 100644
--- a/src/libm.h
+++ b/src/libm.h
@@ -289,3 +289,18 @@ LIBM_DDD(ldexp)
#else
LIBM_DDD_NO(ldexp)
#endif
+#ifdef HAVE_MODF
+LIBM_DA(modf, double)
+#else
+LIBM_DA_NO(modf, double)
+#endif
+#ifdef HAVE_FREXP
+LIBM_DA(frexp, int)
+#else
+LIBM_DA_NO(frexp, int)
+#endif
+#ifdef HAVE_LGAMMA_R
+LIBM_DA(lgamma_r, int)
+#else
+LIBM_DA_NO(lgamma_r, int)
+#endif
From 98839759a92e3ad41870bfc7415f0ecf320b5097 Mon Sep 17 00:00:00 2001
From: Emanuele Torre <torreemanuele6@gmail.com>
Date: Mon, 25 Nov 2024 07:47:14 +0100
Subject: [PATCH] builtin.c: typecheck builtin cfunctions in function_list
In C23 (default C standard used by GCC 15), jv (*fptr)(); has become
equivalent to jv (*fptr)(void); so we can no longer assign builtin
implemenations directly to the fptr member of cfunctions without
generating a compile error.
Since there does not seem to be any straight-forward way to tell
autoconf to force the compiler to use C99 short of explicitly adding
-std=c99 to CFLAGS, it is probably a cleaner solution to just make the
code C23 compatible.
A possible solution could have been to just redeclare cfunction.fptr
as void*, but then the functions' return type would not have been type
checked (e.g. if you tried to add a {printf, "printf", 2}, where printf
is a function that does not return jv, the compiler wouldn't have
complained.)
We were already not typechecking the arguments of the functions, so e.g.
{binop_plus, "_plus", 3}, /* instead of {f_plus, "_plus, 3}, */
{f_setpath, "setpath", 4}, /* instead of {f_setpath, "setpath", 3}, */
compile without errors despite not having the correct prototype.
So I thought of instead improving the situation by redefining
cfunction.fptr as a union of function pointers with the prototypes that
the jq bytecode interpreter can call, and use a macro to add the builtin
functions to function_list using to the arity argument to assign the
implementation function to the appropriate union member.
Now the code won't compile if the wrong arity, or an arity not supported
by the bytecode interpreter (>5 = 1input+4arguments), or a prototype not
jallable by the bytecode interpreter (e.g. binop_plus that doesn't
expect a jq_state* argument).
Also, the code now compiles with gcc -std=c23.
Fixes #3206
Upstream-Status: Backport [0b82b38 builtin.c: typecheck builtin cfunctions in function_list]
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
src/builtin.c | 126 +++++++++++++++++++++++++------------------------
src/bytecode.h | 11 +++--
src/execute.c | 11 ++---
3 files changed, 78 insertions(+), 70 deletions(-)
diff --git a/src/builtin.c b/src/builtin.c
index 9b71bca..6ba6511 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -1701,82 +1701,83 @@ static jv f_current_line(jq_state *jq, jv a) {
return jq_util_input_get_current_line(jq);
}
+#define CFUNC(func, name, arity) \
+ {.fptr = { .a ## arity = func }, name, arity}
+
#define LIBM_DD(name) \
- {f_ ## name, #name, 1},
+ CFUNC(f_ ## name, #name, 1),
#define LIBM_DD_NO(name) LIBM_DD(name)
#define LIBM_DA(name, type) LIBM_DD(name)
#define LIBM_DA_NO(name, type) LIBM_DD(name)
#define LIBM_DDD(name) \
- {f_ ## name, #name, 3},
+ CFUNC(f_ ## name, #name, 3),
#define LIBM_DDD_NO(name) LIBM_DDD(name)
#define LIBM_DDDD(name) \
- {f_ ## name, #name, 4},
+ CFUNC(f_ ## name, #name, 4),
#define LIBM_DDDD_NO(name) LIBM_DDDD(name)
static const struct cfunction function_list[] = {
#include "libm.h"
- {f_negate, "_negate", 1},
-#define BINOP(name) {f_ ## name, "_" #name, 3},
+ CFUNC(f_negate, "_negate", 1),
+#define BINOP(name) CFUNC(f_ ## name, "_" #name, 3),
BINOPS
#undef BINOP
- {f_dump, "tojson", 1},
- {f_json_parse, "fromjson", 1},
- {f_tonumber, "tonumber", 1},
- {f_tostring, "tostring", 1},
- {f_keys, "keys", 1},
- {f_keys_unsorted, "keys_unsorted", 1},
- {f_startswith, "startswith", 2},
- {f_endswith, "endswith", 2},
- {f_ltrimstr, "ltrimstr", 2},
- {f_rtrimstr, "rtrimstr", 2},
- {f_string_split, "split", 2},
- {f_string_explode, "explode", 1},
- {f_string_implode, "implode", 1},
- {f_string_indexes, "_strindices", 2},
- {f_setpath, "setpath", 3}, // FIXME typechecking
- {f_getpath, "getpath", 2},
- {f_delpaths, "delpaths", 2},
- {f_has, "has", 2},
- {f_contains, "contains", 2},
- {f_length, "length", 1},
- {f_utf8bytelength, "utf8bytelength", 1},
- {f_type, "type", 1},
- {f_isinfinite, "isinfinite", 1},
- {f_isnan, "isnan", 1},
- {f_isnormal, "isnormal", 1},
- {f_infinite, "infinite", 1},
- {f_nan, "nan", 1},
- {f_sort, "sort", 1},
- {f_sort_by_impl, "_sort_by_impl", 2},
- {f_group_by_impl, "_group_by_impl", 2},
- {f_min, "min", 1},
- {f_max, "max", 1},
- {f_min_by_impl, "_min_by_impl", 2},
- {f_max_by_impl, "_max_by_impl", 2},
- {f_error, "error", 1},
- {f_format, "format", 2},
- {f_env, "env", 1},
- {f_halt, "halt", 1},
- {f_halt_error, "halt_error", 2},
- {f_get_search_list, "get_search_list", 1},
- {f_get_prog_origin, "get_prog_origin", 1},
- {f_get_jq_origin, "get_jq_origin", 1},
- {f_match, "_match_impl", 4},
- {f_modulemeta, "modulemeta", 1},
- {f_input, "input", 1},
- {f_debug, "debug", 1},
- {f_stderr, "stderr", 1},
- {f_strptime, "strptime", 2},
- {f_strftime, "strftime", 2},
- {f_strflocaltime, "strflocaltime", 2},
- {f_mktime, "mktime", 1},
- {f_gmtime, "gmtime", 1},
- {f_localtime, "localtime", 1},
- {f_now, "now", 1},
- {f_current_filename, "input_filename", 1},
- {f_current_line, "input_line_number", 1},
+ CFUNC(f_dump, "tojson", 1),
+ CFUNC(f_json_parse, "fromjson", 1),
+ CFUNC(f_tonumber, "tonumber", 1),
+ CFUNC(f_tostring, "tostring", 1),
+ CFUNC(f_keys, "keys", 1),
+ CFUNC(f_keys_unsorted, "keys_unsorted", 1),
+ CFUNC(f_startswith, "startswith", 2),
+ CFUNC(f_endswith, "endswith", 2),
+ CFUNC(f_string_split, "split", 2),
+ CFUNC(f_string_explode, "explode", 1),
+ CFUNC(f_string_implode, "implode", 1),
+ CFUNC(f_string_indexes, "_strindices", 2),
+ CFUNC(f_setpath, "setpath", 3),
+ CFUNC(f_getpath, "getpath", 2),
+ CFUNC(f_delpaths, "delpaths", 2),
+ CFUNC(f_has, "has", 2),
+ CFUNC(f_contains, "contains", 2),
+ CFUNC(f_length, "length", 1),
+ CFUNC(f_utf8bytelength, "utf8bytelength", 1),
+ CFUNC(f_type, "type", 1),
+ CFUNC(f_isinfinite, "isinfinite", 1),
+ CFUNC(f_isnan, "isnan", 1),
+ CFUNC(f_isnormal, "isnormal", 1),
+ CFUNC(f_infinite, "infinite", 1),
+ CFUNC(f_nan, "nan", 1),
+ CFUNC(f_sort, "sort", 1),
+ CFUNC(f_sort_by_impl, "_sort_by_impl", 2),
+ CFUNC(f_group_by_impl, "_group_by_impl", 2),
+ CFUNC(f_min, "min", 1),
+ CFUNC(f_max, "max", 1),
+ CFUNC(f_min_by_impl, "_min_by_impl", 2),
+ CFUNC(f_max_by_impl, "_max_by_impl", 2),
+ CFUNC(f_error, "error", 1),
+ CFUNC(f_format, "format", 2),
+ CFUNC(f_env, "env", 1),
+ CFUNC(f_halt, "halt", 1),
+ CFUNC(f_halt_error, "halt_error", 2),
+ CFUNC(f_get_search_list, "get_search_list", 1),
+ CFUNC(f_get_prog_origin, "get_prog_origin", 1),
+ CFUNC(f_get_jq_origin, "get_jq_origin", 1),
+ CFUNC(f_match, "_match_impl", 4),
+ CFUNC(f_modulemeta, "modulemeta", 1),
+ CFUNC(f_input, "input", 1),
+ CFUNC(f_debug, "debug", 1),
+ CFUNC(f_stderr, "stderr", 1),
+ CFUNC(f_strptime, "strptime", 2),
+ CFUNC(f_strftime, "strftime", 2),
+ CFUNC(f_strflocaltime, "strflocaltime", 2),
+ CFUNC(f_mktime, "mktime", 1),
+ CFUNC(f_gmtime, "gmtime", 1),
+ CFUNC(f_localtime, "localtime", 1),
+ CFUNC(f_now, "now", 1),
+ CFUNC(f_current_filename, "input_filename", 1),
+ CFUNC(f_current_line, "input_line_number", 1),
};
#undef LIBM_DDDD_NO
#undef LIBM_DDD_NO
diff --git a/src/bytecode.h b/src/bytecode.h
index 1501985..a4055f5 100644
--- a/src/bytecode.h
+++ b/src/bytecode.h
@@ -2,7 +2,7 @@
#define BYTECODE_H
#include <stdint.h>
-#include "jv.h"
+#include "jq.h"
typedef enum {
#define OP(name, imm, in, out) name,
@@ -44,9 +44,14 @@ struct opcode_description {
const struct opcode_description* opcode_describe(opcode op);
-#define MAX_CFUNCTION_ARGS 10
+#define MAX_CFUNCTION_ARGS 4
struct cfunction {
- jv (*fptr)();
+ union {
+ jv (*a1)(jq_state *, jv);
+ jv (*a2)(jq_state *, jv, jv);
+ jv (*a3)(jq_state *, jv, jv, jv);
+ jv (*a4)(jq_state *, jv, jv, jv, jv);
+ } fptr;
const char* name;
int nargs;
};
diff --git a/src/execute.c b/src/execute.c
index 9ef8368..62404db 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -913,14 +913,13 @@ jv jq_next(jq_state *jq) {
}
struct cfunction* function = &frame_current(jq)->bc->globals->cfunctions[*pc++];
switch (function->nargs) {
- case 1: top = ((jv (*)(jq_state *, jv))function->fptr)(jq, in[0]); break;
- case 2: top = ((jv (*)(jq_state *, jv, jv))function->fptr)(jq, in[0], in[1]); break;
- case 3: top = ((jv (*)(jq_state *, jv, jv, jv))function->fptr)(jq, in[0], in[1], in[2]); break;
- case 4: top = ((jv (*)(jq_state *, jv, jv, jv, jv))function->fptr)(jq, in[0], in[1], in[2], in[3]); break;
- case 5: top = ((jv (*)(jq_state *, jv, jv, jv, jv, jv))function->fptr)(jq, in[0], in[1], in[2], in[3], in[4]); break;
+ case 1: top = function->fptr.a1(jq, in[0]); break;
+ case 2: top = function->fptr.a2(jq, in[0], in[1]); break;
+ case 3: top = function->fptr.a3(jq, in[0], in[1], in[2]); break;
+ case 4: top = function->fptr.a4(jq, in[0], in[1], in[2], in[3]); break;
// FIXME: a) up to 7 arguments (input + 6), b) should assert
// because the compiler should not generate this error.
default: return jv_invalid_with_msg(jv_string("Function takes too many arguments"));
}
if (jv_is_valid(top)) {
......@@ -10,9 +10,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=488f4e0b04c0456337fb70d1ac1758ba"
GITHUB_BASE_URI = "https://github.com/jqlang/${BPN}/releases/"
SRC_URI = "${GITHUB_BASE_URI}/download/${BPN}-${PV}/${BPN}-${PV}.tar.gz \
file://0001-builtin.c-fix-build-with-Woverlength-strings.patch \
file://0002-libm.h-builtin.c-add-and-use-LIBM_DA-and-LIBM_DA_NO-.patch \
file://0003-builtin.c-typecheck-builtin-cfunctions-in-function_l.patch \
file://run-ptest \
"
SRC_URI[sha256sum] = "478c9ca129fd2e3443fe27314b455e211e0d8c60bc8ff7df703873deeee580c2"
......@@ -29,6 +26,9 @@ PACKAGECONFIG[oniguruma] = "--with-oniguruma,--without-oniguruma,onig"
# enable if you want ptest running under valgrind
PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind"
# Gets going with gcc-15 but See if it can be removed with next upgrade
CFLAGS += "-std=gnu17"
do_configure:append() {
sed -i -e "/^ac_cs_config=/ s:${WORKDIR}::g" ${B}/config.status
}
......
From c47fdcc0a900aea93b1967c20db42743171ab1ac Mon Sep 17 00:00:00 2001
From: "mark.yang" <mark.yang@lge.com>
Date: Thu, 27 Mar 2025 16:46:42 +0900
Subject: [PATCH] fix getopt.c too many arguments to function 'write' error in
gcc-15.0.1
In the original code, write() was declared as 'extern int write();',
which is interpreted as a function taking no parameters.
This caused errors when actually calling it with 3 parameters.
The current fix to declare it as 'extern int write(int, const void *, unsigned);'
is the correct solution.
This properly defines the write function to accept 3 parameters.
../git/getopt.c: In function 'x_getopt':
../git/getopt.c:51:16: error: too many arguments to function 'write'; expected 0, have 3
51 | (void) write(2, argv[0], (unsigned)strlen(argv[0]));\
| ^~~~~ ~
../git/getopt.c:78:17: note: in expansion of macro 'ERR'
78 | ERR(": illegal option -- ", c);
| ^~~
../git/getopt.c:48:20: note: declared here
48 | extern int write();\
| ^~~~~
Upstream-Status: Submitted [https://github.com/bmc/daemonize/pull/37]
Signed-off-by: mark.yang <mark.yang@lge.com>
---
getopt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/getopt.c b/getopt.c
index 3f37c55..f298da7 100644
--- a/getopt.c
+++ b/getopt.c
@@ -45,7 +45,7 @@
#include <string.h>
#define ERR(s, c) if(x_opterr){\
- extern int write();\
+ extern int write(int, const void *, unsigned);\
char errbuf[2];\
errbuf[0] = c; errbuf[1] = '\n';\
(void) write(2, argv[0], (unsigned)strlen(argv[0]));\
--
2.34.1
......@@ -7,7 +7,9 @@ PV = "1.7.8"
inherit autotools
SRCREV = "18869a797dab12bf1c917ba3b4782fef484c407c"
SRC_URI = "git://github.com/bmc/daemonize.git;branch=master;protocol=https \
SRC_URI = " \
git://github.com/bmc/daemonize.git;branch=master;protocol=https \
file://0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch \
"
S = "${WORKDIR}/git"
......
From 8acd38879bcdeb34700ab1989e0dd6245af04706 Mon Sep 17 00:00:00 2001
From: NHOrus <jy6x2b32pie9@yahoo.com>
Date: Tue, 11 Feb 2025 18:42:47 +0400
Subject: [PATCH 1/3] Avoid shadowing ncurses functions. This fails with GCC-15
and other compilers implementing C23 Added prefix gpm_ to raw() and noraw()
used in two files because they are implemented in same two files, and are
static. Same with scr_dump() and src_restore() in yacc source file
Upstream-Status: Submitted [https://github.com/telmich/gpm/pull/49]
Signed-off-by: mark.yang <mark.yang@lge.com>
---
src/prog/gpm-root.y | 10 +++++-----
src/prog/hltest.c | 11 +++++------
src/prog/mouse-test.c | 24 ++++++++++++------------
3 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y
index 76c896c..800e51b 100644
--- a/src/prog/gpm-root.y
+++ b/src/prog/gpm-root.y
@@ -941,7 +941,7 @@ static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4};
static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1;
/*------------*/
-static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc)
+static inline void gpm_scr_dump(int fd, FILE *f, unsigned char *buffer, int vc)
{
int dumpfd;
char dumpname[20];
@@ -960,7 +960,7 @@ static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc)
}
/*------------*/
-static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
+static inline void gpm_scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
{
int dumpfd;
char dumpname[20];
@@ -1002,7 +1002,7 @@ Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console)
if (!new) return NULL;
new->draw=draw;
new->dump=dump=malloc(opt_buf);
- scr_dump(fd,f,dump,console);
+ gpm_scr_dump(fd,f,dump,console);
lines=dump[0]; columns=dump[1];
i=(columns*dump[3]+dump[2])*2+1; /* where to get it */
if (i<0) i=1;
@@ -1060,7 +1060,7 @@ Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console)
for (i=0; i<draw->width; i++) PUTC(HORLINE,draw->bord,draw->back);
PUTC(LRCORNER,draw->bord,draw->back);
- scr_restore(fd,f,dump,console);
+ gpm_scr_restore(fd,f,dump,console);
free(dump);
#undef PUTC
@@ -1077,7 +1077,7 @@ Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc)
{
Posted *prev=which->prev;
- scr_restore(fd,f,which->dump, vc);
+ gpm_scr_restore(fd,f,which->dump, vc);
ioctl(fd,TCXONC,TCOON); /* activate the console */
free(which->dump);
free(which);
diff --git a/src/prog/hltest.c b/src/prog/hltest.c
index cce0abc..a916873 100644
--- a/src/prog/hltest.c
+++ b/src/prog/hltest.c
@@ -80,7 +80,6 @@ int wid,hei,vcsize;
unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4};
unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1;
-
static inline int scrdump(char *buf)
{
clear_sel_arg[0]=2; /* clear_selection */
@@ -99,7 +98,7 @@ static inline int scrrestore(char *buf)
/* I don't like curses, so I'm doing low level stuff here */
-static void raw(void)
+static void gpm_raw(void)
{
struct termios it;
@@ -115,7 +114,7 @@ tcsetattr(fileno(stdin),TCSANOW,&it);
}
-static void noraw(void)
+static void gpm_noraw(void)
{
struct termios it;
@@ -136,7 +135,7 @@ void killed(int signo)
{
CLEAR;
fprintf(stderr,"hltest: killed by signal %i\r\n",signo);
- noraw();
+ gpm_noraw();
exit(0);
}
@@ -525,7 +524,7 @@ int main(int argc, char **argv)
gpm_roi_handler=xhandler;
gpm_roi_data=NULL;
- raw();
+ gpm_raw();
newmsg(0,NULL); /* init data structures */
while((c=Gpm_Getchar())!=EOF) {
char s[32];
@@ -538,6 +537,6 @@ int main(int argc, char **argv)
newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s);
}
- noraw();
+ gpm_noraw();
exit(0);
}
diff --git a/src/prog/mouse-test.c b/src/prog/mouse-test.c
index d7d1027..0db3560 100644
--- a/src/prog/mouse-test.c
+++ b/src/prog/mouse-test.c
@@ -106,7 +106,7 @@ return 0;
/*-----------------------------------------------------------------------------
Place the description here.
-----------------------------------------------------------------------------*/
-static void raw(void)
+static void gpm_raw(void)
{
struct termios it;
@@ -125,7 +125,7 @@ static void raw(void)
/*-----------------------------------------------------------------------------
Place the description here.
-----------------------------------------------------------------------------*/
-static void noraw(void)
+static void gpm_noraw(void)
{
struct termios it;
@@ -144,7 +144,7 @@ static void noraw(void)
void killed(int signo)
{
fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo);
- noraw();
+ gpm_noraw();
exit(0);
}
@@ -196,7 +196,7 @@ int mousereopen(int oldfd, const char *name, Gpm_Type *type)
int noneofthem(void)
{
- noraw();
+ gpm_noraw();
printf("\n\nSomething went wrong, I didn't manage to detect your"
"protocol\n\nFeel free to report your problems to the author\n");
exit(1);
@@ -336,7 +336,7 @@ int main(int argc, char **argv)
I_serial=mice->init; /* the first one has I_serial */
signal(SIGINT,killed); /* control-C kills us */
- raw();
+ gpm_raw();
/*====================================== First of all, detect the device */
@@ -568,7 +568,7 @@ int main(int argc, char **argv)
/* why checking and not using return value ??? */
CHECKFAIL(typecount);
if (typecount==1) {
- noraw();
+ gpm_noraw();
printf("\n\n\nWell, it seems like your mouse is already detected:\n"
"it is on the device \"%s\", and speaks the protocol \"%s\"\n",
mousename,list->this->name);
@@ -587,7 +587,7 @@ int main(int argc, char **argv)
} while(i!='y' && i!='n');
if (i=='n') {
- noraw();
+ gpm_noraw();
printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n",
mousename);
exit(0);
@@ -634,7 +634,7 @@ int main(int argc, char **argv)
for (pending=0,i=0;i<got-16;i++)
if(!memcmp(buf+i,buf+i+8,8)) pending++;
if (pending > 3) {
- noraw();
+ gpm_noraw();
printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n",
mousename,pending);
exit(0);
@@ -660,7 +660,7 @@ int main(int argc, char **argv)
continue;
}
if (pending>3) {
- noraw();
+ gpm_noraw();
printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n",
cur->this->name,mousename,pending);
exit(0);
@@ -695,7 +695,7 @@ int main(int argc, char **argv)
for (pending=0,i=0;i<got-20;i++)
if(!memcmp(buf+i,buf+i+10,10)) pending++;
if (pending>3) {
- noraw();
+ gpm_noraw();
printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n"
"gpm gets '-o %s' on it command line, and X gets\n"
"%s in XF86Config\nThe device is \"%s\"",
@@ -726,7 +726,7 @@ int main(int argc, char **argv)
for (pending=0,i=0;i<got-20;i++)
if(!memcmp(buf+i,buf+i+10,10)) pending++;
if (pending>3) {
- noraw();
+ gpm_noraw();
printf("\nWorked. You should keep the button pressed every time the\n"
"computer boots, and run gpm in '-R' mode in order to ignore\n"
"such hassle when starting X\n\nStill better, but a better mouse\n"
@@ -734,7 +734,7 @@ int main(int argc, char **argv)
exit(0);
}
- noraw();
+ gpm_noraw();
printf("\nI'm lost. Can't tell you how to use your middle button\n");
return 0;
}
From 155873ed357a94f06e7e7032e27acba58bba8214 Mon Sep 17 00:00:00 2001
From: NHOrus <jy6x2b32pie9@yahoo.com>
Date: Tue, 11 Feb 2025 19:01:48 +0400
Subject: [PATCH 2/3] Fix function definition in yacc source file until valid
C23. Fill empty argument lists with values. Add 0 as third argument for
two-argument function, it will be ignored at call site.
Upstream-Status: Submitted [https://github.com/telmich/gpm/pull/49]
Signed-off-by: mark.yang <mark.yang@lge.com>
---
src/prog/gpm-root.y | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y
index 800e51b..f06872c 100644
--- a/src/prog/gpm-root.y
+++ b/src/prog/gpm-root.y
@@ -128,7 +128,7 @@ typedef struct DrawItem {
char *name;
char *arg; /* a cmd string */
void *clientdata; /* a (Draw *) for menus or whatever */
- int (*fun)();
+ int (*fun)(int, struct DrawItem *, int);
struct DrawItem *next;
} DrawItem;
@@ -159,7 +159,7 @@ int yyerror(char *s);
int yylex(void);
DrawItem *cfg_cat(DrawItem *, DrawItem *);
-DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail);
+DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(int, DrawItem *, int), void *detail);
/*===================================================================*
@@ -195,7 +195,7 @@ int f_pipe(int mode, DrawItem *self, int uid);
char *string;
Draw *draw;
DrawItem *item;
- int (*fun)();
+ int (*fun)(int, DrawItem *, int);
}
%token <string> T_STRING
@@ -284,7 +284,7 @@ struct tokenName tokenList[] = {
struct funcName {
char *name;
int token;
- int (*fun)();
+ int (*fun)(int, DrawItem *, int);
};
struct funcName funcList[] = {
{"f.debug",T_FUNC,f_debug},
@@ -390,7 +390,7 @@ Draw *cfg_alloc(void)
/*---------------------------------------------------------------------*/
/* malloc an empty DrawItem and fill it */
-DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail)
+DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(int, DrawItem *, int), void *detail)
{
DrawItem *new=calloc(1,sizeof(DrawItem));
@@ -405,7 +405,7 @@ DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail)
case 'F': /* a function without args */
new->fun=fun;
- if (fun) fun(F_CREATE,new);
+ if (fun) fun(F_CREATE,new,0);
break;
case 'M':
@@ -1047,7 +1047,7 @@ Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console)
}
/* sides and items */
for (item=draw->menu; y++, item; item=item->next) {
- if (item->fun) (*(item->fun))(F_POST,item);
+ if (item->fun) (*(item->fun))(F_POST,item,0);
GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back);
for (i=0;i<item->pad;i++) PUTC(' ',draw->fore,draw->back);
PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name);
From d8224863233ae64310a1ee91b9f4e77daf9cfd10 Mon Sep 17 00:00:00 2001
From: NHOrus <jy6x2b32pie9@yahoo.com>
Date: Sat, 22 Feb 2025 01:12:32 +0400
Subject: [PATCH 3/3] Add incomplete type definition for WINDOW in Gpm_Wgetch()
Window handle is an opaque pointer that Gpm_Wgetch() passes
through straight to ncurses if it's not null and calls getch
if it's null. Code doesn't care what's inside the handle
as long as it agrees with curses definition.
Upstream-Status: Submitted [https://github.com/telmich/gpm/pull/49]
Signed-off-by: mark.yang <mark.yang@lge.com>
---
src/headers/gpm.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/headers/gpm.h b/src/headers/gpm.h
index fe52e53..b944d4b 100644
--- a/src/headers/gpm.h
+++ b/src/headers/gpm.h
@@ -268,7 +268,14 @@ Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after);
/* libcurses.c */
/* #include <curses.h> Hmm... seems risky */
-extern int Gpm_Wgetch();
+/* Window handle is an opaque pointer that Gpm_Wgetch()
+ * passes through to ncurses if it's not null and calls getch
+ * if it's null. Code doesn't care what's inside the handle
+ * as long as it agrees with curses definition.
+*/
+typedef struct _win_st WINDOW;
+
+extern int Gpm_Wgetch(WINDOW *);
#define Gpm_Getch() (Gpm_Wgetch(NULL))
/* libxtra.c */