diff --git a/srcpkgs/firejail/files/musl_defs.h b/srcpkgs/firejail/files/musl_defs.h new file mode 100644 index 0000000000..a24e715d84 --- /dev/null +++ b/srcpkgs/firejail/files/musl_defs.h @@ -0,0 +1,33 @@ +#ifndef _MUSL_DEFS_H +#define _MUSL_DEFS_H + +#include + +#define __NEED_FILE +#define __NEED_dev_t +#define __NEED_ino_t +#define __NEED_mode_t +#define __NEED_nlink_t +#define __NEED_uid_t +#define __NEED_gid_t +#define __NEED_off_t +#define __NEED_time_t +#define __NEED_blksize_t +#define __NEED_blkcnt_t +#define __NEED_struct_timespec + +#include +#include + +#ifdef __cplusplus +#define NULL 0L +#else +#define NULL ((void*)0) +#endif + +int printf(const char *format, ...); +int sprintf(char *buffer, const char *format, ...); +char *fgets(char *buffer, int size, FILE *fp); + +#endif + diff --git a/srcpkgs/firejail/template b/srcpkgs/firejail/template index f6e54b7308..3ebe5bfeae 100644 --- a/srcpkgs/firejail/template +++ b/srcpkgs/firejail/template @@ -1,7 +1,7 @@ # Template file for 'firejail' pkgname=firejail -version=0.9.26 -revision=2 +version=0.9.28 +revision=1 build_style=gnu-configure build_pie=yes conf_files=" @@ -34,7 +34,7 @@ maintainer="Duncaen " license="GPL-2" homepage="https://l3net.wordpress.com/projects/firejail/" distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.bz2" -checksum=9195a15365ac73b7aa2c9816b94644e367f25ff58111b6786f94b27caf462561 +checksum=bd91888aff9abbfce0d2963c7d28bedf4362fd29976ca8ede80c6f59a3ac4cad case "$XBPS_TARGET_MACHINE" in arm*) @@ -42,6 +42,20 @@ case "$XBPS_TARGET_MACHINE" in ;; esac +pre_configure() { + case "$XBPS_TARGET_MACHINE" in + *-musl) # XXX: dirty hack - very limited stdio.h definitions + # to avoid redefinition of intercepted libc functions + cp ${FILESDIR}/musl_defs.h ${wrksrc}/src/libtrace + # Include our header instead of stdio.h and sys/stat.h + # Use struct stat instead of struct stat64 (they are equal) + sed -i ${wrksrc}/src/libtrace/libtrace.c \ + -e 's;#include ;#include "musl_defs.h";' \ + -e 's;#include ;;' \ + -e 's;struct stat64;struct stat;g' + esac +} + pre_install() { # remove hardcoded strip(1) sed -i '/strip .*/d' Makefile