Skip to content

Commit

Permalink
arduino: Fix build failure and housekeeping
Browse files Browse the repository at this point in the history
**Summary**

- Fix build failure (Resolves #2564)
- Patch courtesy of @HarveyDevel
- Add `homepage` key to `package.yml` (Part of #411)
- Add appstream metainfo (Part of #1389)
  • Loading branch information
malfisya committed Jul 1, 2024
1 parent cee3ce4 commit ce0d88f
Show file tree
Hide file tree
Showing 8 changed files with 378 additions and 27 deletions.
1 change: 1 addition & 0 deletions packages/a/arduino/abi_libs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ctags
libastylej.so
liblistSerialsj.so
1 change: 1 addition & 0 deletions packages/a/arduino/abi_symbols
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ctags:error
libastylej.so:
libastylej.so:AStyleGetVersion
libastylej.so:AStyleMain
Expand Down
1 change: 0 additions & 1 deletion packages/a/arduino/abi_used_libs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
libc.so.6
libgcc_s.so.1
libm.so.6
libpthread.so.0
libstdc++.so.6
23 changes: 14 additions & 9 deletions packages/a/arduino/abi_used_symbols
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,19 @@ libc.so.6:opendir
libc.so.6:perror
libc.so.6:poll
libc.so.6:pthread_attr_destroy
libc.so.6:pthread_attr_getstack
libc.so.6:pthread_attr_getstacksize
libc.so.6:pthread_attr_init
libc.so.6:pthread_cond_broadcast
libc.so.6:pthread_cond_wait
libc.so.6:pthread_create
libc.so.6:pthread_detach
libc.so.6:pthread_getattr_np
libc.so.6:pthread_key_create
libc.so.6:pthread_mutex_lock
libc.so.6:pthread_mutex_unlock
libc.so.6:pthread_self
libc.so.6:pthread_setspecific
libc.so.6:pthread_sigmask
libc.so.6:putc
libc.so.6:puts
Expand All @@ -87,10 +99,12 @@ libc.so.6:regerror
libc.so.6:regexec
libc.so.6:regfree
libc.so.6:remove
libc.so.6:res_search
libc.so.6:rewind
libc.so.6:select
libc.so.6:setenv
libc.so.6:setlocale
libc.so.6:sigaction
libc.so.6:sigaddset
libc.so.6:sigemptyset
libc.so.6:sigfillset
Expand Down Expand Up @@ -130,15 +144,6 @@ libc.so.6:unsetenv
libc.so.6:vfprintf
libc.so.6:wcstombs
libc.so.6:write
libpthread.so.0:__errno_location
libpthread.so.0:pthread_attr_getstacksize
libpthread.so.0:pthread_cond_broadcast
libpthread.so.0:pthread_cond_wait
libpthread.so.0:pthread_create
libpthread.so.0:pthread_detach
libpthread.so.0:pthread_mutex_lock
libpthread.so.0:pthread_mutex_unlock
libpthread.so.0:sigaction
libstdc++.so.6:_ZNKSs12find_last_ofEPKcm
libstdc++.so.6:_ZNKSs13find_first_ofEPKcm
libstdc++.so.6:_ZNKSs16find_last_not_ofEPKcm
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
From e549e303cfa9dabdb9c39ede6c5b2f5936269aab Mon Sep 17 00:00:00 2001
From: Maximiliano Sandoval <[email protected]>
Date: Sun, 3 Mar 2024 16:31:54 +0100
Subject: [PATCH] appdata: Improvements for AppStream 1.0

- Add developer
- Add missing releases
- Add launchable
- Use secure URI for arduino.cc
---
build/linux/dist/appdata.xml | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/build/linux/dist/appdata.xml b/build/linux/dist/appdata.xml
index 9f8b32499..ba06ff8f9 100644
--- a/build/linux/dist/appdata.xml
+++ b/build/linux/dist/appdata.xml
@@ -5,6 +5,9 @@
<metadata_license>CC-BY-SA-3.0</metadata_license>
<project_license>LGPL-2.1</project_license>
<developer_name>Arduino LLC</developer_name>
+ <developer id="cc.arduino">
+ <name>Arduino LLC</name>
+ </developer>

<name>Arduino IDE</name>
<summary>Open-source electronics prototyping platform</summary>
@@ -36,6 +39,19 @@
<content_rating type="oars-1.1" />

<releases>
+ <release date="2021-12-16" version="1.8.19">
+ <description>
+ <ul>
+ <li>Removed log4j from IDE. Fix CVE-2021-45105, CVE-2021-45046</li>
+ </ul>
+ </description>
+ </release>
+ <release date="2021-12-16" version="1.8.18"/>
+ <release date="2021-09-27" version="1.8.16"/>
+ <release date="2021-05-14" version="1.8.15"/>
+ <release date="2020-05-12" version="1.8.14"/>
+ <release date="2020-06-16" version="1.8.13"/>
+ <release date="2020-02-13" version="1.8.12"/>
<release date="2020-01-27" version="1.8.11"/>
<release date="2019-09-13" version="1.8.10"/>
<release date="2019-03-15" version="1.8.9"/>
@@ -49,11 +65,12 @@
<release date="2017-01-09" version="1.8.1"/>
</releases>

- <url type="homepage">http://www.arduino.cc/</url>
+ <url type="homepage">https://www.arduino.cc/</url>
<url type="help">https://www.arduino.cc/en/Guide/HomePage</url>
<url type="bugtracker">https://github.com/arduino/Arduino/issues</url>
<url type="translate">https://github.com/arduino/Arduino/tree/master/arduino-core/src/processing/app/i18n</url>
<url type="donation">https://www.arduino.cc/en/Main/Contribute</url>
+ <launchable type="desktop-id">arduino.desktop</launchable>

<update_contact>[email protected]</update_contact>
</component>
--
2.44.0

261 changes: 261 additions & 0 deletions packages/a/arduino/files/fix-for-glibc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
From: Carsten Schoenert <[email protected]>
Date: Tue, 16 Aug 2022 09:18:34 +0200
Subject: Adjust __unused__ macro after glibc changes 2.33++

The build is breaking with glibc >= 2.33 due changes in cdefs.h.
This patch is mostly just a hack and no proper solution, it's taken from
the Gentoo people.

Author: [email protected]
Origin: https://bugs.gentoo.org/828550
Forwarded: no
Last-Update: 2022-08-16
---
eiffel.c | 2 +-
general.h | 2 +-
lregex.c | 30 +++++++++++++++---------------
lua.c | 2 +-
main.c | 2 +-
options.c | 24 ++++++++++++------------
parse.c | 2 +-
python.c | 2 +-
8 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/eiffel.c b/eiffel.c
index e2f5a5c..f1293f1 100644
--- a/build/ctags/eiffel.c
+++ b/build/ctags/eiffel.c
@@ -807,7 +807,7 @@ static void findKeyword (tokenInfo *const token, const keywordId keyword)

static boolean parseType (tokenInfo *const token);

-static void parseGeneric (tokenInfo *const token, boolean declaration __unused__)
+static void parseGeneric (tokenInfo *const token, boolean declaration __arduino_unused__)
{
unsigned int depth = 0;
#ifdef TYPE_REFERENCE_TOOL
diff --git a/general.h b/general.h
index 2d1d629..8282a8b 100644
--- a/build/ctags/general.h
+++ b/build/ctags/general.h
@@ -57,7 +57,7 @@
* to prevent warnings about unused variables.
*/
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !defined (__GNUG__)
-# define __unused__ __attribute__((unused))
+# define __arduino_unused__ __attribute__ ((__unused__))
# define __printf__(s,f) __attribute__((format (printf, s, f)))
#else
# define __unused__
diff --git a/lregex.c b/lregex.c
index 37d7ea0..addf35f 100644
--- a/build/ctags/lregex.c
+++ b/build/ctags/lregex.c
@@ -538,11 +538,11 @@ extern void findRegexTags (void)
#endif /* HAVE_REGEX */

extern void addTagRegex (
- const langType language __unused__,
- const char* const regex __unused__,
- const char* const name __unused__,
- const char* const kinds __unused__,
- const char* const flags __unused__)
+ const langType language __arduino_unused__,
+ const char* const regex __arduino_unused__,
+ const char* const name __arduino_unused__,
+ const char* const kinds __arduino_unused__,
+ const char* const flags __arduino_unused__)
{
#ifdef HAVE_REGEX
Assert (regex != NULL);
@@ -564,10 +564,10 @@ extern void addTagRegex (
}

extern void addCallbackRegex (
- const langType language __unused__,
- const char* const regex __unused__,
- const char* const flags __unused__,
- const regexCallback callback __unused__)
+ const langType language __arduino_unused__,
+ const char* const regex __arduino_unused__,
+ const char* const flags __arduino_unused__,
+ const regexCallback callback __arduino_unused__)
{
#ifdef HAVE_REGEX
Assert (regex != NULL);
@@ -581,7 +581,7 @@ extern void addCallbackRegex (
}

extern void addLanguageRegex (
- const langType language __unused__, const char* const regex __unused__)
+ const langType language __arduino_unused__, const char* const regex __arduino_unused__)
{
#ifdef HAVE_REGEX
if (! regexBroken)
@@ -602,7 +602,7 @@ extern void addLanguageRegex (
*/

extern boolean processRegexOption (const char *const option,
- const char *const parameter __unused__)
+ const char *const parameter __arduino_unused__)
{
boolean handled = FALSE;
const char* const dash = strchr (option, '-');
@@ -624,7 +624,7 @@ extern boolean processRegexOption (const char *const option,
return handled;
}

-extern void disableRegexKinds (const langType language __unused__)
+extern void disableRegexKinds (const langType language __arduino_unused__)
{
#ifdef HAVE_REGEX
if (language <= SetUpper && Sets [language].count > 0)
@@ -639,8 +639,8 @@ extern void disableRegexKinds (const langType language __unused__)
}

extern boolean enableRegexKind (
- const langType language __unused__,
- const int kind __unused__, const boolean mode __unused__)
+ const langType language __arduino_unused__,
+ const int kind __arduino_unused__, const boolean mode __arduino_unused__)
{
boolean result = FALSE;
#ifdef HAVE_REGEX
@@ -660,7 +660,7 @@ extern boolean enableRegexKind (
return result;
}

-extern void printRegexKinds (const langType language __unused__, boolean indent __unused__)
+extern void printRegexKinds (const langType language __arduino_unused__, boolean indent __arduino_unused__)
{
#ifdef HAVE_REGEX
if (language <= SetUpper && Sets [language].count > 0)
diff --git a/lua.c b/lua.c
index d385544..91da6ab 100644
--- a/build/ctags/lua.c
+++ b/build/ctagslua.c
@@ -37,7 +37,7 @@ static kindOption LuaKinds [] = {
*/

/* for debugging purposes */
-static void __unused__ print_string (char *p, char *q)
+static void __arduino_unused__ print_string (char *p, char *q)
{
for ( ; p != q; p++)
fprintf (errout, "%c", *p);
diff --git a/main.c b/main.c
index 79948fe..8dbf31d 100644
--- a/build/ctags/main.c
+++ b/build/ctags/main.c
@@ -522,7 +522,7 @@ static void makeTags (cookedArgs *args)
* Start up code
*/

-extern int main (int __unused__ argc, char **argv)
+extern int main (int __arduino_unused__ argc, char **argv)
{
cookedArgs *args;
#ifdef VMS
diff --git a/options.c b/options.c
index 8f68469..60623e1 100644
--- a/build/ctags/options.c
+++ b/build/ctags/options.c
@@ -731,7 +731,7 @@ static void processEtagsInclude (
}

static void processExcludeOption (
- const char *const option __unused__, const char *const parameter)
+ const char *const option __arduino_unused__, const char *const parameter)
{
const char *const fileName = parameter + 1;
if (parameter [0] == '\0')
@@ -869,7 +869,7 @@ static void processFieldsOption (
}

static void processFilterTerminatorOption (
- const char *const option __unused__, const char *const parameter)
+ const char *const option __arduino_unused__, const char *const parameter)
{
freeString (&Option.filterTerminator);
Option.filterTerminator = stringCopy (parameter);
@@ -931,8 +931,8 @@ static void printProgramIdentification (void)
}

static void processHelpOption (
- const char *const option __unused__,
- const char *const parameter __unused__)
+ const char *const option __arduino_unused__,
+ const char *const parameter __arduino_unused__)
{
printProgramIdentification ();
putchar ('\n');
@@ -1140,8 +1140,8 @@ static void processLanguagesOption (
}

static void processLicenseOption (
- const char *const option __unused__,
- const char *const parameter __unused__)
+ const char *const option __arduino_unused__,
+ const char *const parameter __arduino_unused__)
{
printProgramIdentification ();
puts ("");
@@ -1167,8 +1167,8 @@ static void processListKindsOption (
}

static void processListMapsOption (
- const char *const __unused__ option,
- const char *const __unused__ parameter)
+ const char *const __arduino_unused__ option,
+ const char *const __arduino_unused__ parameter)
{
if (parameter [0] == '\0' || strcasecmp (parameter, "all") == 0)
printLanguageMaps (LANG_AUTO);
@@ -1184,8 +1184,8 @@ static void processListMapsOption (
}

static void processListLanguagesOption (
- const char *const option __unused__,
- const char *const parameter __unused__)
+ const char *const option __arduino_unused__,
+ const char *const parameter __arduino_unused__)
{
printLanguageList ();
exit (0);
@@ -1359,8 +1359,8 @@ static void processIgnoreOption (const char *const list)
}

static void processVersionOption (
- const char *const option __unused__,
- const char *const parameter __unused__)
+ const char *const option __arduino_unused__,
+ const char *const parameter __arduino_unused__)
{
printProgramIdentification ();
exit (0);
diff --git a/parse.c b/parse.c
index 0b5e2c3..4fd4e08 100644
--- a/build/ctags/parse.c
+++ b/build/ctags/parse.c
@@ -376,7 +376,7 @@ extern void freeParserResources (void)
*/

extern void processLanguageDefineOption (
- const char *const option, const char *const parameter __unused__)
+ const char *const option, const char *const parameter __arduino_unused__)
{
#ifdef HAVE_REGEX
if (parameter [0] == '\0')
diff --git a/python.c b/python.c
index bf797de..2eb3d96 100644
--- a/build/ctags/python.c
+++ b/build/ctags/python.c
@@ -135,7 +135,7 @@ static boolean isIdentifierCharacter (int c)
* extract all relevant information and create a tag.
*/
static void makeFunctionTag (vString *const function,
- vString *const parent, int is_class_parent, const char *arglist __unused__)
+ vString *const parent, int is_class_parent, const char *arglist __arduino_unused__)
{
tagEntryInfo tag;
initTagEntry (&tag, vStringValue (function));
Loading

0 comments on commit ce0d88f

Please sign in to comment.