pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/57074: sysutils/pv fails to build on modern MacOS, tries to use stat64



>Number:         57074
>Category:       pkg
>Synopsis:       sysutils/pv fails to build on modern MacOS, tries to use stat64
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 25 16:25:00 +0000 2022
>Originator:     Dennis Lindroos
>Release:        
>Organization:
Strangeloop.CC
>Environment:
Darwin StrangeloopM1.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101 arm64
>Description:
PV fails to build on my Apple M1 (aarch64) /MacOS Monterey because there is no "struct stat64":

Xcode version is 14.0.1 Build version 14A400

clang -O2 -I/usr/local/pkg/include -I/usr/local/pkg/include -I./src/include -Isrc/include -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/pkg/share/locale\" -c -o src/pv/cursor.o src/pv/cursor.c
In file included from src/pv/cursor.c:14:
./src/include/pv-internal.h:219:16: error: field has incomplete type 'struct stat64'
        struct stat64 sb_fd;             /* stat of fd symlink */
                      ^
./src/include/pv-internal.h:219:9: note: forward declaration of 'struct stat64'
        struct stat64 sb_fd;             /* stat of fd symlink */
               ^
./src/include/pv-internal.h:220:16: error: field has incomplete type 'struct stat64'
        struct stat64 sb_fd_link;        /* lstat of fd symlink */
                      ^
./src/include/pv-internal.h:219:9: note: forward declaration of 'struct stat64'
        struct stat64 sb_fd;             /* stat of fd symlink */
               ^
2 errors generated.

>How-To-Repeat:
$ cd /home/pkgsrc/sysutils/pv
$ (b)make

>Fix:
GNU Configure seems to find stat64 and think it is ok, so to counteract I added these to Makefile:

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "Darwin" && ${MACHINE_ARCH} == "aarch64"
CONFIGURE_ENV+=         ac_cv_func_stat64=no
.endif

Will this break build on other Darwin's or older Mac's? Maybe checking OPSYS_VERSION > 120000 is a better deal? Unfortunately I don't know much about Mac's and my system is currently 120600.
 
I want to use this opportunity to thank everyone involved with the PKGsrc. Big thanks guys!
Dennis


Home | Main Index | Thread Index | Old Index