community/catimg: fix build with gcc 14

This commit is contained in:
mio 2024-08-17 16:01:19 +00:00 committed by omni
parent b4072b3409
commit d9c096bd59
2 changed files with 30 additions and 4 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=catimg
pkgver=2.7.0
pkgrel=2
pkgrel=3
pkgdesc="terminal image renderer"
url="https://github.com/posva/catimg"
arch="all"
@ -10,16 +10,18 @@ license="MIT"
makedepends="cmake samurai"
options="!check" # no tests
subpackages="$pkgname-doc"
source="catimg-$pkgver.tar.gz::https://github.com/posva/catimg/archive/$pkgver.tar.gz"
source="catimg-$pkgver.tar.gz::https://github.com/posva/catimg/archive/$pkgver.tar.gz
gcc14.patch
"
build() {
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
cmake_crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
cmake -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=None \
$CMAKE_CROSSOPTS
$cmake_crossopts
cmake --build build
}
@ -29,4 +31,5 @@ package() {
sha512sums="
85b19183a2dc666aeb5655d6b66a40d325160d6ac8b5d38c00bad14ee79d69f2277ba0378af6ea84570a0d41c10d52950d658c0872dc1007e7ae17da7b6abdec catimg-2.7.0.tar.gz
36b5e3de493fc3189e86856f81f64238e55ca15cb652311580858137e1f2e685093f418ed2b0036dcc76580a40767b8a00ae588f59ec133434a61e98184d0b6d gcc14.patch
"

View File

@ -0,0 +1,23 @@
--- catimg-2.7.0-origin/src/catimg.c
+++ catimg-2.7.0/src/catimg.c
@@ -3,6 +3,8 @@
#include <string.h>
#include "sh_image.h"
#include "sh_utils.h"
+// Enable usleep()
+#define _GNU_SOURCE
#include <unistd.h>
#include <signal.h>
#include <sys/ioctl.h>
--- catimg-2.7.0-origin/src/sh_utils.c
+++ catimg-2.7.0/src/sh_utils.c
@@ -11,6 +11,9 @@
#include <unistd.h>
#endif
+// Enable fileno()
+#define _POSIX_C_SOURCE
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>