NetBSD Problem Report #54442

From www@netbsd.org  Tue Aug  6 11:02:49 2019
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0CA037A178
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  6 Aug 2019 11:02:49 +0000 (UTC)
Message-Id: <20190806110248.0F0CB7A1C1@mollari.NetBSD.org>
Date: Tue,  6 Aug 2019 11:02:48 +0000 (UTC)
From: clement.bouvier.europe@gmail.com
Reply-To: clement.bouvier.europe@gmail.com
To: gnats-bugs@NetBSD.org
Subject: sysutils/dvdrecord failed to build on darwin macOS
X-Send-Pr-Version: www-1.0

>Number:         54442
>Category:       pkg
>Synopsis:       sysutils/dvdrecord failed to build on darwin macOS
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    macos-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 06 11:05:00 +0000 2019
>Closed-Date:    Sun Aug 18 07:21:24 +0000 2019
>Last-Modified:  Sun Aug 18 07:21:24 +0000 2019
>Originator:     clement bouvier
>Release:        current
>Organization:
>Environment:
macOS Mojave 10.14.6
>Description:
sysutils/dvdrecord failed to build.

An example of failed build is available here:
http://us-east.manta.joyent.com/pkgsrc/public/reports/Darwin/trunk/x86_64/20190802.0934/dvdrecord-0.1.5nb2/build.log
>How-To-Repeat:
Build sysutils/dvdrecord on darwin.
>Fix:
The IOKit headers has changed along the version of macosx about scsi.
Add Corfoundation and IOKitLib frameworks options to the linker.
MacOS does not support the realtime threads scheduling.


The patch changes:
- the IOKit headers locations according the version of macos.
- dvdrecord needs a linking on IOKit and CoreFoundation frameworks.
- It also forces to check that the value of _POSIX_PRIORITY_SCHEDULING is -1 as open group specifies if the option is supported.

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/dvdrecord/Makefile,v
retrieving revision 1.19
diff -u -r1.19 Makefile
--- Makefile	23 Oct 2012 19:50:59 -0000	1.19
+++ Makefile	6 Aug 2019 10:58:04 -0000
@@ -2,7 +2,7 @@

 DISTNAME=	dvdrtools-${VERSION}
 PKGNAME=	${DISTNAME:S/dvdrtools/dvdrecord/}
-PKGREVISION=	2
+PKGREVISION=	3
 CATEGORIES=	sysutils
 MASTER_SITES=	http://freesoftware.fsf.org/download/dvdrtools/dvdrtools.pkg/${VERSION}/
 EXTRACT_SUFX=	.tar.bz2
@@ -17,6 +17,7 @@
 # Override wrong usage of AC_DEFINE_UNQUOTED:
 CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
 LIBS.SunOS+=		-lsocket
+LIBS.Darwin+=	-framework IOKit -framework CoreFoundation
 INSTALLATION_DIRS+=	bin ${PKGMANDIR}/man1

 .include "../../mk/bsd.prefs.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/dvdrecord/distinfo,v
retrieving revision 1.8
diff -u -r1.8 distinfo
--- distinfo	4 Nov 2015 01:32:12 -0000	1.8
+++ distinfo	6 Aug 2019 10:58:04 -0000
@@ -7,3 +7,5 @@
 SHA1 (patch-aa) = 6463dd7852df43089724976c75a24ea41d9a66bc
 SHA1 (patch-ab) = 39b5cf16f3f1c8d191b0de6b25ff8bb2c5eba2da
 SHA1 (patch-ac) = 4fe2505adb6ac24a859dc88cc86f91e9bf28f7da
+SHA1 (patch-cdrecord_cdrecord.c) = 312245a5db7060b326002e4552703ccabc8a8ed8
+SHA1 (patch-libscg_scsi-mac-iokit.c) = a6f04eb9520952f72fd34a1ca57c6a4684f6c80d
Index: patches/patch-cdrecord_cdrecord.c
===================================================================
RCS file: patches/patch-cdrecord_cdrecord.c
diff -N patches/patch-cdrecord_cdrecord.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-cdrecord_cdrecord.c	6 Aug 2019 10:58:04 -0000
@@ -0,0 +1,15 @@
+$NetBSD$
+
+- _POSIX_PRIORITY_SCHEDULING is set to -1 if options is not supported (like on darwin)
+
+--- cdrecord/cdrecord.c.orig	2003-06-12 19:05:46.000000000 +0000
++++ cdrecord/cdrecord.c
+@@ -2935,7 +2935,7 @@ EXPORT	void raisepri(int pri)
+ 
+ #else	/* HAVE_SYS_PRIOCNTL_H */
+ 
+-#if defined(_POSIX_PRIORITY_SCHEDULING)
++#if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING != (-1))
+ /*
+  * XXX Ugly but needed because of a typo in /usr/iclude/sched.h on Linux.
+  * XXX This should be removed as soon as we are sure that Linux-2.0.29 is gone.
Index: patches/patch-libscg_scsi-mac-iokit.c
===================================================================
RCS file: patches/patch-libscg_scsi-mac-iokit.c
diff -N patches/patch-libscg_scsi-mac-iokit.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-libscg_scsi-mac-iokit.c	6 Aug 2019 10:58:04 -0000
@@ -0,0 +1,29 @@
+$NetBSD$
+
+- IOkit header location location changes with the macos version.
+  IOKit/scsi from macosx Snow Leopard.
+
+--- libscg/scsi-mac-iokit.c.orig	2002-01-29 17:23:22.000000000 +0000
++++ libscg/scsi-mac-iokit.c
+@@ -50,12 +50,21 @@ LOCAL	char	_scg_trans_version[] = "scsi-
+ #define	MAX_TGT		16
+ #define	MAX_LUN		8
+ 
++#include <AvailabilityMacros.h>
+ #include <statdefs.h>
+ #include <mach/mach.h>
+ #include <Carbon/Carbon.h>
+ #include <IOKit/IOKitLib.h>
+ #include <IOKit/IOCFPlugIn.h>
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
++#define COLLISION_VERSION VERSION
++#undef VERSION
++#include <IOKit/scsi/SCSITaskLib.h>
++#define VERSION COLLISION_VERSION
++#undef COLLISION_VERSION
++#else
+ #include <IOKit/scsi-commands/SCSITaskLib.h>
++#endif
+ #include <mach/mach_error.h>
+ 
+ struct scg_local { 


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->macos-pkg-people
Responsible-Changed-By: leot@NetBSD.org
Responsible-Changed-When: Tue, 06 Aug 2019 11:08:16 +0000
Responsible-Changed-Why:
macOS problem


From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54442 CVS commit: pkgsrc/sysutils/dvdrecord
Date: Sun, 18 Aug 2019 07:19:47 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Sun Aug 18 07:19:47 UTC 2019

 Modified Files:
 	pkgsrc/sysutils/dvdrecord: Makefile distinfo
 Added Files:
 	pkgsrc/sysutils/dvdrecord/patches: patch-cdrecord_cdrecord.c
 	    patch-libscg_scsi-mac-iokit.c

 Log Message:
 dvdread: fix build on darwin.

 XXX: I'm not sure that Darwin is reading the POSIX recommendations correctly
 in defining _POSIX_PRIORITY_SCHEDULING to -1.

 From clement bouvier in PR pkg/54442.


 To generate a diff of this commit:
 cvs rdiff -u -r1.19 -r1.20 pkgsrc/sysutils/dvdrecord/Makefile
 cvs rdiff -u -r1.8 -r1.9 pkgsrc/sysutils/dvdrecord/distinfo
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/sysutils/dvdrecord/patches/patch-cdrecord_cdrecord.c \
     pkgsrc/sysutils/dvdrecord/patches/patch-libscg_scsi-mac-iokit.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sun, 18 Aug 2019 07:21:24 +0000
State-Changed-Why:
Applied, thanks!
It might be good to ask Apple not to define _POSIX_PRIORITY_SCHEDULING to -1.
https://pubs.opengroup.org/onlinepubs/007908799/xsh/feature.html doesn't seem to describe this as a valid choice.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.