community/daemontools-encore: fix call to undeclared functions

This commit is contained in:
mio 2024-08-17 23:54:47 +00:00 committed by omni
parent 0a6b5e7315
commit a60f07052b
2 changed files with 56 additions and 4 deletions

View File

@ -2,22 +2,24 @@
# Maintainer: omni <omni+alpine@hack.org>
pkgname=daemontools-encore
pkgver=1.11
pkgrel=1
pkgrel=2
pkgdesc="Enhanced collection of tools for managing UNIX services"
url="http://untroubled.org/daemontools-encore/"
arch="all !riscv64" # ftbfs
license="MIT"
subpackages="$pkgname-doc"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://untroubled.org/daemontools-encore/daemontools-encore-$pkgver.tar.gz
add-missing-setuser-man-page.patch
use-posix-complaint-functions.patch
svscan.initd
"
options="!check" # no tests
prepare() {
echo "$pkgdir/usr/bin" > conf-bin
echo "$pkgdir/usr/share/man" > conf-man
echo "${CC:-"gcc"} ${CFLAGS}" > conf-cc
echo "${CC:-"gcc"} ${LDFLAGS}" > conf-ld
echo "${CC:-"gcc"} $CFLAGS" > conf-cc
echo "${CC:-"gcc"} $LDFLAGS" > conf-ld
default_prepare
}
@ -35,5 +37,6 @@ package() {
sha512sums="
1e1a96a948d551bfc38496740eaa85b7cae0d2469419293b133533da75ca03657fe6108129703ad7b773925c58ce84a4f242eb612133fb0c499f47ae50423a8a daemontools-encore-1.11.tar.gz
2fa48512b13faf6df16b955e496dfebc0c7bf7acfd0fe73530dec3af94a49f2adf95875550d7e48eeb9e78aad065e383a6ecdc678a5af3e474a751dd470205cb add-missing-setuser-man-page.patch
6e4f56b59fdb416121a0f4c5902695537f37f741b249e9f30a7ab188c659424cd565cb2e037e4d9e138ad78dc8d232794c0e6131eea1228a572bcaa687ad5e99 use-posix-complaint-functions.patch
cfe2d3ef118262f86d5c91a76ffac2f51564e748c4e9392b42ee9f9e13d90729a795c4dfeba5bc3c5793b988fac62a9ca1fb33e685200bf4fcd354d5872d9d1d svscan.initd
"

View File

@ -0,0 +1,49 @@
https://github.com/bruceg/daemontools-encore/pull/66
From: Brahmajit Das <brahmajit.xyz@gmail.com>
Date: Tue, 13 Jun 2023 04:27:36 +0000
Subject: [PATCH] sig_block.c: use posix complaint functions on non glibc
systems
This build error came while building on musl /w clang-16.
In contrast to glibc, musl is not having the "legacy" BSD functions and only POSIX sigprocmask.
The exact error was:
sig_block.c:15:3: error: call to undeclared function 'sigblock'; ISO C99 and later do not
support implicit function declarations [-Wimplicit-function-declaration]
sigblock(1 << (sig - 1));
^
sig_block.c:15:3: note: did you mean 'sig_block'?
sig_block.c:7:6: note: 'sig_block' declared here
void sig_block(int sig)
^
1 warning generated.
sig_block.c:27:3: error: call to undeclared function 'sigsetmask'; ISO C99 and later do not
support implicit function declarations [-Wimplicit-function-declaration]
sigsetmask(sigsetmask(~0) & ~(1 << (sig - 1)));
^
sig_block.c:38:3: error: call to undeclared function 'sigsetmask'; ISO C99 and later do not
support implicit function declarations [-Wimplicit-function-declaration]
sigsetmask(0);
^
This patch should fix the error
Bug: https://bugs.gentoo.org/898852
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
--- a/sig_block.c
+++ b/sig_block.c
@@ -4,6 +4,11 @@
#include "sig.h"
#include "hassgprm.h"
+// Use POSIX complaint functions when using non-Glibc system
+#ifndef __GLIBC__
+#define HASSIGPROCMASK 0
+#endif
+
void sig_block(int sig)
{
#ifdef HASSIGPROCMASK
--
2.41.0