summaryrefslogtreecommitdiff
blob: 075f69ba194a934f5106516af9cd42d29027368a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-20020605-r2.ebuild,v 1.8 2002/12/09 04:17:41 manson Exp $

IUSE="cups opengl"

S=${WORKDIR}/${P}
DESCRIPTION="Wine is a free implementation of Windows on Unix."
SRC_URI="ftp://metalab.unc.edu/pub/Linux/ALPHA/wine/development/Wine-${PV}.tar.gz"
HOMEPAGE="http://www.winehq.com/"

DEPEND="virtual/x11
	sys-devel/gcc
	sys-devel/flex
	dev-util/yacc
	opengl? ( virtual/opengl )
	>=sys-libs/ncurses-5.2
	cups? ( net-print/cups )
	>=media-libs/freetype-2.0.0
	dev-lang/tcl dev-lang/tk"

KEYWORDS="x86 -sparc  -ppc"
LICENSE="GPL-2"
SLOT="0"

src_compile() {
	
	cd ${S}
	local myconf

	use opengl && myconf="--enable-opengl" || myconf="--disable-opengl"
	[ -z $DEBUG ] && myconf="$myconf --disable-trace --disable-debug" || myconf="$myconf --enable-trace --enable-debug"
	# there's no configure flag for cups, it's supposed to be autodetected
	
	# the folks at #winehq were really angry about custom optimization
	export CFLAGS=""
	export CXXFLAGS=""
	
	./configure --prefix=/usr \
	--exec_prefix=/usr/wine \
	--sysconfdir=/etc/wine \
	--mandir=/usr/share/man \
	--host=${CHOST} \
	--enable-curses \
	${myconf} || die

	cd ${S}/programs/winetest
	cp Makefile 1
	sed -e 's:wine.pm:include/wine.pm:' 1 > Makefile
	
	cd ${S}	
	make depend all || die
	cd programs && emake || die
	
}

src_install () {

	local WINEMAKEOPTS="prefix=${D}/usr \
		mandir=${D}/usr/wine/man \
		includedir=${D}/usr/wine/include \
		exec_prefix=${D}/usr/wine"
	
	cd ${S}
	make ${WINEMAKEOPTS} install || die
	cd ${S}/programs
	make ${WINEMAKEOPTS} install || die
	
	# these .so's are strange. they are from the make in programs/ above,
	# and are for apps built with winelib (windows sources built directly
	# against wine). Apparently the sources go into a <program name>.so file
	# and you run it via a symlink <program name> -> wine. Unfortunately both
	# the symlink and the .so apparently must reside in /usr/bin.
	cd ${D}/usr/wine/bin
	chmod a-x *.so
		
	cd ${S}
	dodoc ANNOUNCE AUTHORS BUGS ChangeLog DEVELOPERS-HINTS LICENSE README
	
	insinto /etc/wine
	doins documentation/samples/*
	doins ${S}/winedefault.reg
	
	dodir /etc/skel/.wine
	dosym /etc/wine/config /etc/skel/.wine/config
	
	insinto /etc/env.d
	doins ${FILESDIR}/80wine
}

pkg_postinst() {

	einfo "If you are installing wine for the first time,
copy /etc/wine/config (global configuration) to ~/.wine/config
and edit that for per-user configuration. Otherwise, wine will
not run.
Also, run \"regapi setValue < /etc/wine/winedefault.reg\" to setup
per-user registry for using wine. More info in /usr/share/doc/wine-${PV}."

}