community/collectd-apk: fix build with gcc 14

This commit is contained in:
mio 2024-09-09 00:03:33 +00:00 committed by Ariadne Conill
parent e1b05b3abe
commit 289fea1cec
2 changed files with 28 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=collectd-apk
pkgver=0.2.0
pkgrel=2
pkgrel=3
pkgdesc="Collectd plugin that collects information about APK packages"
url="https://github.com/jirutka/collectd-apk"
arch="all"
@ -13,7 +13,9 @@ makedepends="
collectd-dev
json-c-dev
"
source="https://github.com/jirutka/collectd-apk/archive/v$pkgver/collectd-apk-$pkgver.tar.gz"
source="https://github.com/jirutka/collectd-apk/archive/v$pkgver/collectd-apk-$pkgver.tar.gz
gcc14.patch
"
build() {
make
@ -29,4 +31,5 @@ package() {
sha512sums="
f161c2d5abc055f58143531481d4b7d912e24581fe4fa9e38cf1e9e6c7b5f9370da89947c16f94f297f14042e915982331cef95bc2c17a3eb62df894049f574f collectd-apk-0.2.0.tar.gz
49ecead29dfc7a73f1a8307587c61a6fe3f8f590dc961cada0e65b10aa5009c96fe3a222dc59742c2e0556e8c2af51c02af1e9f091a49d999ef13d3908e0a4db gcc14.patch
"

View File

@ -0,0 +1,23 @@
Fix -Wimplicit-function-declaration error with gcc 14.
```
In file included from apk.c:12:
/usr/include/apk/apk_database.h: In function 'apk_name_cmp_display':
/usr/include/apk/apk_database.h:216:16: error: implicit declaration of function
'strcasecmp'; did you mean 'strncmp'? [-Wimplicit-function-declaration]
216 | return strcasecmp(a->name, b->name) ?: strcmp(a->name, b->name);
| ^~~~~~~~~~
| strncmp
```
--- collectd-apk-0.2.0-origin/apk.c
+++ collectd-apk-0.2.0/apk.c
@@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: 2022-present Jakub Jirutka <jakub@jirutka.cz>
// SPDX-License-Identifier: GPL-2.0-or-later
+#define _DEFAULT_SOURCE
+
#include <assert.h>
#include <errno.h>
#include <stddef.h>