summaryrefslogtreecommitdiff
blob: 1ab234a9702c127655fbcf77a0963636dd08c886 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/winex/winex-20021011.ebuild,v 1.10 2003/02/28 23:30:39 vapier Exp $

DESCRIPTION="distribution of Wine with enhanced DirectX for gaming"
SRC_URI="mirror://gentoo/${P}.tar.bz2
	mirror://gentoo/${P}-fake_windows.tar.bz2"
HOMEPAGE="http://www.transgaming.com/"

SLOT="0"
KEYWORDS="~x86 -ppc -sparc"
LICENSE="Aladdin"
IUSE="cups opengl"

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
	!app-emulation/winex-transgaming"

S=${WORKDIR}/wine

src_compile() {
	# Azarah's patches
	#patch -p0 < ${FILESDIR}/${P}-opengl.patch || die "opengl-patch failed"
    
	local myconf

	use opengl && myconf="--enable-opengl" || myconf="--disable-opengl"
	[ -z $DEBUG ] && myconf="$myconf --disable-trace --disable-debug" || myconf="$myconf --enable-trace --enable-debug"

	# the folks at #winehq were really angry about custom optimization
	unset CFLAGS
	unset CXXFLAGS
	
	./configure --prefix=/usr/lib/winex \
		--sysconfdir=/etc/winex \
		--host=${CHOST} \
		--enable-curses \
		--with-x \
		${myconf} || die "configure failed"

	# Fixes a winetest issue
	cd ${S}/programs/winetest
	cp Makefile 1
	sed -e 's:wine.pm:include/wine.pm:' 1 > Makefile

	# This persuades wineshelllink that "winex" is a better loader :)
	cd ${S}/tools
	cp wineshelllink 1
	sed -e 's/\(WINE_LOADER=\)\(\${WINE_LOADER:-wine}\)/\1winex/' 1 > wineshelllink

	cd ${S}	
	make depend all || die "make depend all failed"
	
	##### borked really bad ###############################################
	#cd programs && make || die "make died"                               #
	#######################################################################
}

src_install() {
	local WINEXMAKEOPTS="prefix=${D}/usr/lib/${PN}"

	# Installs winex to ${D}/usr/lib/${PN}
	make ${WINEXMAKEOPTS} install || die "make install failed"
	
	##### borked really bad ###############################################
	# cd ${S}/programs                                                    #
	# make ${WINEXMAKEOPTS} install || die "make install failed"          #
	#######################################################################

	# Creates /usr/lib/${PN}/.data with fake_windows in it
	# This is needed for ~/.${PN} initialization by our 
	# winex wrapper script
	dodir /usr/lib/${PN}/.data
	cp -R ${WORKDIR}/fake_windows ${D}/usr/lib/${PN}/.data
	cp ${FILESDIR}/${P}-config ${D}/usr/lib/${PN}/.data/config

	# winedefault.reg -- standard registry setup
	cp ${WORKDIR}/wine/winedefault.reg ${D}/usr/lib/${PN}/.data/winedefault.reg

	# Install the wrapper script
	dodir /usr/bin
	cp ${FILESDIR}/${P}-winex ${D}/usr/bin/winex
	cp ${FILESDIR}/${P}-regedit ${D}/usr/bin/regedit-winex

	# Take care of the other stuff
	cd ${S}
	dodoc ANNOUNCE AUTHORS BUGS ChangeLog DEVELOPERS-HINTS LICENSE README

	insinto /usr/lib/winex/.data/fake_windows/Windows
	doins documentation/samples/system.ini
	doins documentation/samples/generic.ppd

	# Manpage setup
	cp ${D}/usr/lib/${PN}/man/man1/wine.1 ${D}/usr/lib/${PN}/man/man1/${PN}.1
	doman ${D}/usr/lib/${PN}/man/man1/${PN}.1
	rm ${D}/usr/lib/${PN}/man/man1/${PN}.1
	
	# Remove the executable flag from those libraries.
	cd ${D}/usr/lib/${PN}/bin
	chmod a-x *.so
		
}

pkg_postinst() {
	einfo "Use /usr/bin/winex to start winex."
	einfo "This is a wrapper-script which will take care of everything"
	einfo "else. If you have further questions, enhancements or patches"
	einfo "send an email to phoenix@gentoo.org"
	einfo ""
	einfo "Manpage has been installed to the system."
	einfo "\"man winex\" should show it."
}