Subject: Re: Updated Wine pkgsrc entry (finally) available
To: Bang Jun-Young <junyoung@mogua.com>
From: Johnny Lam <jlam@jgrind.org>
List: tech-pkg
Date: 01/31/2002 06:23:36
--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii

On Thu, Jan 31, 2002 at 05:36:47PM +0900, Bang Jun-Young wrote:
> [CC'ed to tech-pkg from now on.]
> 
> On Wed, Jan 30, 2002 at 03:14:06PM -0800, Johnny C. Lam wrote:
> > I'll take a look at this package and see if I can untangle the X11 problem.
> > I'm sort of the xpkgwedge expert.  I have some questions, though, on the
> > package in wine-new-20020131.tar.gz:
> > 
> >      1) What's the purpose of setting LD_RUN_PATH?
> 
> Win32 binaries and Wine dlls can't find other dlls without it. It's a
> dirty hack, yet it works.

I've modified the package to set the rpath for the dlls to
/usr/X11R6/lib:/usr/pkg/lib, so hopefully, setting LD_RUN_PATH will be
unnecessary.

> >      2) Is wine supposed to be installed under /usr/X11R6?  You currently
> > 	have USE_X11BASE set in the Makefile, but it wasn't that way before.
> 
> Yes, it requires X to run. I don't understand why USE_X11BASE is
> necessary, but it simply didn't install/work without it.

I've fixed this package to install properly in ${LOCALBASE} (/usr/pkg)
instead.

> > 
> >      3) In patch-aa, you explicitly add "-lc" to LIBS.  Why is this
> > 	necessary?  I'd like to insert a comment to simplify future
> > 	maintenance.
> 
> This is a kind of dirty hack, too. And the same reason as above
> ("not work without it").

ISTR that I needed this in PostgreSQL as well, though I forget the
technical reason why.

> >      4) Will this package really work with NetBSD-1.5?  Or only with NetBSD
> > 	releases starting with 1.5.3?
> 
> It will install. However, if it works is a different problem. I'm 
> not sure if it works on 1.5.x since I don't have a 1.5.x machine to
> test with. One certain thing is that Wine won't be able to run most of
> popular Win32 apps on 1.5.x due to lack of clone(2) support and its
> inherent instability. Surely it has a lot of design problems not
> easily addressable, unlike our most-cleanly-designed OS. ;-)
> 
> > wiz: If you're already working on this package, please let me know so that
> >      we don't duplicate efforts.
> 
> A new one will be made available shortly.

I've fixed the build and install problems with the wine-new-20020131
package.  My diffs are attached below.  I'm also in the process of writing
a wine.inst script, to be installed in ${PREFIX}/bin, that does the
per-user post-install setup in ${WRKSRC}/tools/wineinstall.  I'm trying to
figure out how to properly set up wine so I can test the package and see if
my changes are correct.

	Cheers,

	-- Johnny Lam <jlam@jgrind.org>

--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="wine.diff"

diff -ur wine-new.orig/Makefile wine-new/Makefile
--- wine-new.orig/Makefile	Wed Jan 30 10:21:31 2002
+++ wine-new/Makefile	Thu Jan 31 04:06:54 2002
@@ -12,21 +12,38 @@
 
 ONLY_FOR_PLATFORM=	NetBSD-1.[5-9]*-i386
 
-GNU_CONFIGURE=		YES
-CONFIGURE_ARGS=		--without-curses --x-libraries=${X11BASE}/lib \
-			--prefix=${X11BASE}
-CONFIGURE_ENV=		X_LIBS="-L${X11PREFIX}/lib -Wl,-R${X11PREFIX}/lib"
-MAKE_ENV=		LD_RUN_PATH=${X11BASE}/lib
-USE_X11BASE=		YES
 USE_BUILDLINK_ONLY=	YES
+USE_GMAKE=		YES
+GNU_CONFIGURE=		YES
+CONFIGURE_ARGS+=	--without-curses
 
-post-install:
-	${INSTALL_DATA} ${WRKSRC}/documentation/samples/config \
-		${PREFIX}/etc/wine.conf.example
+# The Wine configure script has problems locating the freetype-config
+# script and the libraries in the buildlink directory, so explicitly
+# set the location of freetype-config and prepend all of the LDFLAGS
+# necessary to link against the libraries.
+#
+CONFIGURE_ENV+=		ft_devel=${FREETYPE_CONFIG}
+CONFIGURE_ENV+=		X_LIBS="${LDFLAGS}"
+LIBS+=			${LDFLAGS}
 
 .include "../../mk/bsd.prefs.mk"
 
-.include "../../graphics/freetype2/buildlink.mk"
+.if defined(USE_CUPS) && (${USE_CUPS} == YES)
+.include "../../print/cups/buildlink.mk"
+BUILD_DEFS+=		USE_CUPS
+.endif
+
+EGDIR=			${PREFIX}/share/examples/wine
+
+post-install:
+	${INSTALL_DATA_DIR} ${EGDIR}
+	cd ${WRKSRC}/documentation/samples;				\
+	${INSTALL_DATA} config ${EGDIR}/wine.conf;			\
+	${INSTALL_DATA} generic.ppd ${EGDIR}/generic.ppd;		\
+	${INSTALL_DATA} system.ini ${EGDIR}/system.ini
+
 .include "../../graphics/Mesa/buildlink.mk"
+.include "../../graphics/freetype2/buildlink.mk"
+.include "../../graphics/jpeg/buildlink.mk"
 .include "../../mk/x11.buildlink.mk"
 .include "../../mk/bsd.pkg.mk"
diff -ur wine-new.orig/PLIST wine-new/PLIST
--- wine-new.orig/PLIST	Mon Jan 28 01:43:39 2002
+++ wine-new/PLIST	Thu Jan 31 04:04:14 2002
@@ -15,7 +15,6 @@
 bin/wineshelllink
 bin/wmc
 bin/wrc
-etc/wine.conf.example
 include/wine/amaudio.h
 include/wine/amvideo.h
 include/wine/audevcod.h
@@ -347,6 +346,10 @@
 man/man1/wmc.1
 man/man1/wrc.1
 man/man5/wine.conf.5
+share/examples/wine/generic.ppd
+share/examples/wine/system.ini
+share/examples/wine/wine.conf
+@dirrm share/examples/wine
 @dirrm include/wine/wine
 @dirrm include/wine/msvcrt/sys
 @dirrm include/wine/msvcrt
Only in wine-new: work

--6TrnltStXW4iwmi0--