NetBSD Problem Report #30172

From www@netbsd.org  Sun May  8 07:38:41 2005
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
	id 396C363B117; Sun,  8 May 2005 07:38:41 +0000 (UTC)
Message-Id: <20050508073841.396C363B117@narn.netbsd.org>
Date: Sun,  8 May 2005 07:38:41 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@consolidated.net
To: gnats-bugs@netbsd.org
Subject: games/xjewel build, install failures on MacOS X
X-Send-Pr-Version: www-1.0

>Number:         30172
>Notify-List:    jdbaker@consolidated.net
>Category:       pkg
>Synopsis:       games/xjewel build, install failures on MacOS X
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    dholland
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 08 07:39:01 +0000 2005
>Closed-Date:    Fri May 12 09:06:36 +0000 2023
>Last-Modified:  Fri May 12 09:06:36 +0000 2023
>Originator:     John D. Baker
>Release:        MacOS X 10.2.8
>Organization:
>Environment:
Darwin ed.local. 6.8 Darwin Kernel Version 6.8: Wed Sep 10 15:20:55 PDT 2003; root:xnu/xnu-344.49.obj~2/RELEASE_PPC  Power Macintosh powerpc

>Description:
Several failure points building and installing xjewel on MacOS X 10.2.8.

First:

[...]
===> Configuring for xjewel-1.6nb1
imake -DUseInstalled -I/usr/pkg/lib/X11/config -I/usr/X11R6/lib/X11/config
make Makefiles
make includes
make depend
gccmakedep  --   -I/usr/pkg/include -I/usr/X11R6/include   -D__DARWIN__ -DNO_ALL
OCA -DX_LOCALE     -DHSCORE_FILE=\"/var/games/xjewel.scores\"  -DICON_WINDOW -DG
ETPWENT  -DUSE_MAKEDEPEND -- xw.c jewel.c logic.c panel.c xhscore.c hscore.c gam
e.c intro.c help.c
In file included from xw.c:34:
xw.h:50:36: stropts.h: No such file or directory
xw.h:51:33: poll.h: No such file or directory
In file included from jewel.c:26:
xw.h:50:36: stropts.h: No such file or directory
xw.h:51:33: poll.h: No such file or directory
In file included from xhscore.c:21:
xw.h:50:36: stropts.h: No such file or directory
xw.h:51:33: poll.h: No such file or directory
In file included from game.c:24:
xw.h:50:36: stropts.h: No such file or directory
xw.h:51:33: poll.h: No such file or directory
In file included from intro.c:22:
xw.h:50:36: stropts.h: No such file or directory
xw.h:51:33: poll.h: No such file or directory
In file included from help.c:21:
xw.h:50:36: stropts.h: No such file or directory
xw.h:51:33: poll.h: No such file or directory
===> Building for xjewel-1.6nb1
gcc -pipe -O -Wall -Wpointer-arith -no-cpp-precomp     -I/usr/pkg/include -I/usr
/X11R6/include   -D__DARWIN__ -DNO_ALLOCA -DX_LOCALE     -DHSCORE_FILE=\"/var/ga
mes/xjewel.scores\"  -DICON_WINDOW -DGETPWENT  -no-cpp-precomp -I/usr/pkg/includ
e -c xw.c
In file included from xw.c:34:
xw.h:50:36: stropts.h: No such file or directory
xw.h:51:33: poll.h: No such file or directory
xw.c: In function `xw_sync_sleep':
xw.c:120: warning: implicit declaration of function `poll'
xw.c: In function `xw_main_loop':
xw.c:162: error: storage size of `fds' isn't known
xw.c:165: error: `POLLIN' undeclared (first use in this function)
xw.c:165: error: (Each undeclared identifier is reported only once
xw.c:165: error: for each function it appears in.)
xw.c:165: error: `POLLPRI' undeclared (first use in this function)
xw.c:162: warning: unused variable `fds'
xw.c: In function `xw_init':
xw.c:402: warning: implicit declaration of function `toupper'
*** Error code 1

Stop.
bmake: stopped in /Volumes/NetBSD/pkgsrc/games/xjewel/work/xjewel-1.6
[...]


Second:
Installation fails as follows:

[ed:pkgsrc/games/xjewel] jdbaker% bmake install
===> *** No /Volumes/NetBSD/pkgsrc/distfiles/pkg-vulnerabilities file found,
===> *** skipping vulnerability checks. To fix, install
===> *** the pkgsrc/security/audit-packages package and run
===> *** '/usr/pkg/sbin/download-vulnerability-list'.
===> Installing for xjewel-1.6nb1
===> Becoming root@ed.local. to install xjewel.
/usr/bin/sudo Password:
install -c -o root -g wheel -s -m 2555 -o root -g games  xjewel /usr/pkg/bin/xje
wel
install: unknown group games
*** Error code 67

Stop.
bmake: stopped in /Volumes/NetBSD/pkgsrc/games/xjewel/work/xjewel-1.6
[...]


Third:
[ed:pkgsrc/games/xjewel] jdbaker% bmake install
===> *** No /Volumes/NetBSD/pkgsrc/distfiles/pkg-vulnerabilities file found,
===> *** skipping vulnerability checks. To fix, install
===> *** the pkgsrc/security/audit-packages package and run
===> *** '/usr/pkg/sbin/download-vulnerability-list'.
===> Installing for xjewel-1.6nb1
===> Becoming root@ed.local. to install xjewel.
/usr/bin/sudo Password:
install -c -o root -g wheel -s -m 2555 -o root -g games  xjewel /usr/pkg/bin/xje
wel
touch /var/games/xjewel.scores
touch: /var/games/xjewel.scores: No such file or directory
*** Error code 1

Stop.
bmake: stopped in /Volumes/NetBSD/pkgsrc/games/xjewel/work/xjewel-1.6
[...]


Fourth:
[ed:pkgsrc/games/xjewel] jdbaker% bmake install
===> *** No /Volumes/NetBSD/pkgsrc/distfiles/pkg-vulnerabilities file found,
===> *** skipping vulnerability checks. To fix, install
===> *** the pkgsrc/security/audit-packages package and run
===> *** '/usr/pkg/sbin/download-vulnerability-list'.
===> Installing for xjewel-1.6nb1
===> Becoming root@ed.local. to install xjewel.
/usr/bin/sudo install -c -o root -g wheel -s -m 2555 -o root -g games  xjewel /u
sr/pkg/bin/xjewel
touch /var/games/xjewel.scores
chown games:games /var/games/xjewel.scores
chmod 664 /var/games/xjewel.scores
install in . done
+ install -c -o root -g wheel -m 0444 xjewel.6.html /usr/pkg/lib/X11/doc/html/xj
ewel.6.html
install: xjewel.6.html: No such file or directory
*** Error code 71

Stop.
bmake: stopped in /Volumes/NetBSD/pkgsrc/games/xjewel/work/xjewel-1.6
[...]


Fifth:
[ed:pkgsrc/games/xjewel] jdbaker% bmake install
===> *** No /Volumes/NetBSD/pkgsrc/distfiles/pkg-vulnerabilities file found,
===> *** skipping vulnerability checks. To fix, install
===> *** the pkgsrc/security/audit-packages package and run
===> *** '/usr/pkg/sbin/download-vulnerability-list'.
===> Installing for xjewel-1.6nb1
===> Becoming root@ed.local. to install xjewel.
/usr/bin/sudo Password:
install -c -o root -g wheel -s -m 2555 -o root -g games  xjewel /usr/pkg/bin/xje
wel
touch /var/games/xjewel.scores
chown games:games /var/games/xjewel.scores
chmod 664 /var/games/xjewel.scores
install in . done
+ install -c -o root -g wheel -m 0444 xjewel.1.html /usr/pkg/lib/X11/doc/html/xj
ewel.6.html
install -c -o root -g wheel -m 0444 xjewel._man /usr/pkg/man/man6/xjewel.6
install.man in . done
/bin/ls: /usr/pkg/man/man6/xjewel.1: No such file or directory
===> Registering installation for xjewel-1.6nb1
/usr/pkg/sbin/pkg_create: can't stat `/usr/pkg/man/man6/xjewel.1'

>How-To-Repeat:
First:

cd .../pkgsrc/games/xjewel
bmake

Second and subsequent:

bmake install


>Fix:
First:

MacOS X, being a BSD-based system, provides select() rather than poll().

Workaround:

    bmake patch
    edit work/xjewel-1.6/Imakefile to add "|| defined(DarwinArchitecture)
      to the conditional expression turning on "-DUSE_SELECT".


Second:

Workaround:  Use NetInfoManager to manually create user/group "games".

Suggested fix:  check for specified user/group and create if necessary
using sysutils/user_darwin


Third:

MacOS X does not have a /var/games directory by default.

Workaround:  Manually create /var/games.

Suggested fix:  check existence of full path, or install relative to
$LOCALBASE (usually /usr/pkg).  E.g., /usr/pkg/var/games/...


Fourth:

The html documentation supplied is actually 'xjewel.1.html', but the
patches define MANSUFFIX=6.  This is correct for the manual section,
but the transformation is being applied to the source file as well, causing
install to fail to find the file.

Workaround:  edit the Makefile to explicitly install 'xjewel.1.html' in
the specified location.

----
         $(INSTALL) $(INSTALLFLAGS) $(INSTMANFLAGS) xjewel.1.html $(DESTDIR)$(DO
CHTMLDIR)/xjewel.$$SUF.html)
----


Fifth:

Something's still not right.  Now it's looking for the installed
'xjewel.6' in the right directory, but by the wrong name.
Unfortunately, it's this incorrect name that gets recorded in the
pkgdb.  Not sure how to get around this one.  

(Hack the pkgdb to contain the correct filename...)

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->jdc
Responsible-Changed-By: obache@netbsd.org
Responsible-Changed-When: Sat, 28 Jul 2007 02:40:38 +0000
Responsible-Changed-Why:
Over to maintainer.
 Second: should respect ${GAMEOWN}, ${GAMEGRP} and ${GAMEDATAMODE}
 Third:  should respect ${VARBASE}


State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 25 Oct 2010 03:59:36 +0000
State-Changed-Why:
Does this affect recent versions of MacOS?


From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/30172 (games/xjewel build, install failures on MacOS X)
Date: Mon, 25 Oct 2010 11:12:46 -0500 (CDT)

 On Mon, 25 Oct 2010, dholland@NetBSD.org wrote:

 > Does this affect recent versions of MacOS?

 On MacOS X 10.4.11 (PPC), the first part still does, although in an
 abbreviated form:

 [...]
 make depend
 makedepend  --   -I/usr/pkg/include    -D__powerpc__ -D__DARWIN__                                 -DNO_ALLOCA -DCSRG_BASED      -DHSCORE_FILE=\"/var/games/xjewel.scores\"  -DICON_WINDOW -DGETPWENT  -DUSE_MAKEDEPEND -- xw.c jewel.c logic.c panel.c xhscore.c hscore.c game.c intro.c help.c
 makedepend: warning:  xw.c (reading xw.h, line 50): cannot find include file "stropts.h"
  	not in /usr/pkg/include/stropts.h
  	not in /usr/include/stropts.h
 ===> Building for xjewel-1.6nb2
 gcc -O -Wall -Wpointer-arith -no-cpp-precomp     -I/usr/pkg/include    -D__powerpc__ -D__DARWIN__                                 -DNO_ALLOCA -DCSRG_BASED      -DHSCORE_FILE=\"/var/games/xjewel.scores\"  -DICON_WINDOW -DGETPWENT  -no-cpp-precomp -isystem /usr/include -I/usr/pkg/include -c xw.c
 In file included from xw.c:34:
 xw.h:50:23: error: stropts.h: No such file or directory
 xw.c: In function 'xw_sync_sleep':
 xw.c:120: warning: passing argument 1 of 'poll' from incompatible pointer type
 xw.c: In function 'xw_init':
 xw.c:402: warning: implicit declaration of function 'toupper'
 *** Error code 1

 Stop.
 bmake: stopped in /Volumes/d0/tmp/pkgsrc/games/xjewel/work/xjewel-1.6
 *** Error code 1

 Stop.
 bmake: stopped in /usr/pkgsrc/games/xjewel
 *** Error code 1

 Stop.
 bmake: stopped in /usr/pkgsrc/games/xjewel
 [...]

 The fix proposed in the PR solves this problem.


 Since I created a user/group "games" in NetInfo, I can't really test
 the second problem, but would assume it still exists on unmodified
 MacOS systems.


 The third problem (/var/games/xjewel.scores) still exists.  It would be
 nice to have this package observe $VARBASE and create the subdirectory
 if it doesn't already exist.

 Looks like "HSCORE_FILE" can be modified in "Imakefile".  Suggest
 adding an "HSCORE_DIR" set to $(VARBASE)/games "HSCORE_FILE" be set to
 "$(HSCORE_DIR)/xjewel.scores".  Also, the install:: target should be
 prepended with "	$(MKDIRHIER) $(HSCORE_DIR)".

 (Just tried that.  Not sure how to get value of ${VARBASE} passed to
 imake automagically, or let it be evaluated later...)

 Made above changes, but hardcoded "HSCORE_DIR=/usr/pkg/var/games" to
 proceed.


 The fourth problem, manual page installation, seems to have been fixed.


 Looks like "patch-aa" does most things already.  Just need to add a bit
 more to handle the MacOS X and ${VARBASE} situations.

 A revised "patch-aa" would look like:

 --- Imakefile.orig	1994-02-16 04:35:06.000000000 -0600
 +++ Imakefile	2010-10-25 11:01:29.000000000 -0500
 @@ -4,12 +4,14 @@
   CDEBUGFLAGS = -O

   # CHANGE HSCORE_FILE TO SUIT
 -#HSCORE_FILE=/usr/local/lib/xjewel.scores
 -HSCORE_FILE=xjewel.scores
 +#HSCORE_DIR=$(VARBASE)/games
 +HSCORE_DIR=/usr/pkg/var/games
 +HSCORE_FILE=$(HSCORE_DIR)/xjewel.scores

   # ADD YOUR ARCHITECTURE IF YOU USE SELECT INSTEAD OF POLL
   #if defined(HPArchitecture) || defined(ApolloArchitecture) || \
 - 	defined(UltrixArchitecture)
 + 	defined(UltrixArchitecture) || defined(NetBSDArchitecture) || \
 +	defined(DragonFlyArchitecture)|| defined(DarwinArchitecture)
   #define sel -DUSE_SELECT
   #else
   #define sel 
 @@ -21,10 +23,10 @@
   # DEFINE 'GETPWENT' if you dont have the cuserid ftn (hscore.c)
   # DEFINE 'SLOW_FONTS=n' if your server is overly fast on fonts
   # DEFINE 'SLOW_DRAW=n' if your server is overly fast on drawing
 -USERDEFS = -DICON_WINDOW
 +USERDEFS = -DICON_WINDOW -DGETPWENT

   # CHANGE FFILE TO REFLECT THE EXTENSION USED FOR COMPILED FONTS
 -FFILE = snf
 +FFILE = pcf.gz

   ##############################################################################
   # X-STUFF...
 @@ -42,15 +44,20 @@


   # LETS GET TO IT...
 +INSTPGMFLAGS = -s -m 2555 -o root -g games
   ComplexProgramTarget(xjewel)

   # IF YOUR SERVER DOES NOT LIKE THE DEFAULT FONT COMPILER, EDIT HERE...
   FontTarget($(FONT))
   	$(MKFONTDIR) bitmaps/

 +MANSUFFIX=6
 +
   # FORCE FONT TO BE BUILT
   all:: $(CFONT)

   install::
 -	touch  $(HSCORE_FILE)
 -	chmod a+w $(HSCORE_FILE)
 +	$(MKDIRHIER) $(HSCORE_DIR)
 +	touch $(HSCORE_FILE)
 +	chown games:games $(HSCORE_FILE)
 +	chmod 664 $(HSCORE_FILE)



 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Wed, 03 Nov 2010 05:09:54 +0000
State-Changed-Why:
Feedback received; problem still exists.


Responsible-Changed-From-To: jdc->dholland
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Thu, 04 Nov 2010 05:06:02 +0000
Responsible-Changed-Why:
score file lossage; I've been fixing that


From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/30172 CVS commit: pkgsrc/games/xjewel
Date: Fri, 12 May 2023 09:02:12 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Fri May 12 09:02:12 UTC 2023

 Modified Files:
 	pkgsrc/games/xjewel: distinfo
 	pkgsrc/games/xjewel/patches: patch-aa

 Log Message:
 games/xjewel: add macos to list of OSes using select.

 From PR 30172 from John D. Baker. May only apply to ppc macos, but
 should be harmless otherwise if so.


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 pkgsrc/games/xjewel/distinfo
 cvs rdiff -u -r1.3 -r1.4 pkgsrc/games/xjewel/patches/patch-aa

 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: dholland@NetBSD.org
State-Changed-When: Fri, 12 May 2023 09:06:36 +0000
State-Changed-Why:
I just fixed the select/poll bit. The scorefile stuff seems to have been
fixed by obache in 2011.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.