summaryrefslogtreecommitdiff
blob: eeed53d9c6fc8460787e19fc7bc6fd461cb81a07 (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/uae/uae-0.8.26.ebuild,v 1.1 2007/08/12 15:15:32 pva Exp $

inherit eutils

DESCRIPTION="The Umiquious Amiga Emulator"
HOMEPAGE="http://www.freiburg.linux.de/~uae/"
SRC_URI="ftp://ftp.coresystems.de/pub/uae/sources/develop/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~ppc ~amd64"
IUSE="sdl X dga svga aalib alsa sdl-sound scsi ui"

DEPEND="sdl? ( media-libs/libsdl
			   media-libs/sdl-gfx
			   ui? ( x11-libs/gtk+ )
			   alsa? ( media-libs/alsa-lib )
			 )
	!sdl? ( X? ( x11-libs/libXext
				 dga? ( x11-libs/libXxf86dga 
					    x11-libs/libXxf86vm )
				 ui? ( x11-libs/gtk+ )
			   )
			!X? ( svga? ( media-libs/svgalib
				 		  ui? ( sys-libs/ncurses ) )
				  !svga? ( aalib? ( media-libs/aalib 
				 		            ui? ( sys-libs/ncurses ) ) )
				  		   !aalib? ( media-libs/libsdl 
			   						 ui? ( x11-libs/gtk+ ) ) ) 
			alsa? ( media-libs/alsa-lib )
		  )
	scsi? ( app-cdr/cdrtools )"

src_unpack() {
	unpack ${A}
	cd "${S}"

	epatch "${FILESDIR}"/uae-0.8.25-allow_spaces_in_zip_filenames.diff
	epatch "${FILESDIR}"/uae-0.8.25-close_window_hack.diff
	epatch "${FILESDIR}"/uae-0.8.25-fix_save_config.diff
	epatch "${FILESDIR}"/${P}-gtk-ui-cleanup.patch
	epatch "${FILESDIR}"/uae-0.8.25-makefile_more_cleaning.diff
	epatch "${FILESDIR}"/uae-0.8.25-memory_leaks_in_gui.diff
	epatch "${FILESDIR}"/uae-0.8.25-preserve_home_in_writing_optionsfile.diff
	epatch "${FILESDIR}"/uae-0.8.25-struct_uae_wrong_fields_name.diff
	epatch "${FILESDIR}"/${P}-uae_reset_args.diff
}

pkg_setup() {
	# See configure.in for possible pathes of logic...
	if use sdl ; then
		elog "Enabling sdl for video output."
		my_config="$(use_with sdl) $(use_with sdl sdl-gfx)"
		# SELECT UI
		if use ui ; then
			elog "Using GTK+ for UI."
			my_config="${my_config} $(use_enable ui)"
		else
			elog "You do not have ui in USE. Disabling UI"
			my_config="${my_config} --disable-ui"
		fi
		if use sdl-sound ; then
			elog "Enabling sdl-sound for sound output."
			my_config="${my_config} $(use_with sdl-sound)"
		elif use alsa ; then
			elog "Enabling alsa for sound output."
			my_config="${my_config} --without-sdl-sound $(use_with alsa)"
		else
			elog "You have not enabled alsa or sdl-sound in USE."
			elog "Using sound output to file."
			my_config="${my_config} --enable-file-sound"
		fi
	else
		elog "Disabling sdl for all (video and sound)."
		my_config="--without-sdl"
		if use X ; then
			elog "Enabling X11 for video output."
			# Disabling all other GFX to be sure that we'll have what we want.
			my_config="${my_config} --without-svgalib --without-asciiart $(use_with X x)"
			use dga && my_config="${my_config} $(use_enable dga) $(use_enable X vidmode)"
			# SELECT UI
			if use ui ; then
				elog "Using GTK+ for UI."
				my_config="${my_config} $(use_enable ui)"
			else
				elog "You do not have ui in USE. Disabling UI"
				my_config="${my_config} --disable-ui"
			fi
		else
			my_config="${my_config} --without-x"
			if use svga ; then
				elog "Enabling svga for video output."
				my_config="${my_config} $(use_with svga svgalib)"
				if use ui ; then
					elog "Using ncurses for UI."
					my_config="${my_config} $(use_enable ui)"
				else
					elog "You do not have ui in USE. Disabling UI"
					my_config="${my_config} --disable-ui"
				fi
			elif use aalib ; then
				elog "Enabling ASCII art for video output."
				my_config="${my_config} $(use_with aalib svgalib)"
				if use ui ; then
					einfo "Using ncurses for UI."
					my_config="${my_config} $(use_enable ui)"
				else
					elog "You do not have ui in USE. Disabling UI"
					my_config="${my_config} --disable-ui"
				fi
			else
				elog "You have not enabled sdl or X or svga or ncruses in USE!"
				elog "Video output is not selected. Falling back on sdl..."
				my_config="$(use_with sdl) $(use_with sdl sdl-gfx) $(use with sdl-sound)"
				# SELECT UI
				if use ui ; then
					elog "Using GTK+ for UI."
					my_config="${my_config} $(use_enable ui)"
				else
					elog "You do not have ui in USE. Disabling UI"
					my_config="${my_config} --disable-ui"
				fi
			fi
		fi
		if use alsa ; then
			elog "Enabling alsa for sound output."
			my_config="${my_config} $(use_with alsa)"
		else
			use sdl-sound && ewarn "You can not have sdl-sound without sdl."
			elog "You have not enabled alsa in USE."
			elog "Using sound output to file."
			my_config="${my_config} --enable-file-sound"
		fi
	fi

	my_config="${my_config} $(use_enable scsi scsi-device)"
	my_config="${my_config} --enable-threads"
}

src_compile() {
	econf ${my_config} || die "configure failed"
	emake -j1 || die "emake failed"
}

src_install() {
	dobin uae readdisk || die
	cp docs/unix/README docs/README.unix
	dodoc docs/*

	insinto /usr/share/uae/amiga-tools
	doins amiga/{*hack,trans*,uae*}
}