dev-python/zc-lockfile: keyworded 2.0 for ia64, bug #717946
[gentoo.git] / app-emulation / playonlinux / playonlinux-4.2.12.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="6"
5 PYTHON_COMPAT=( python2_7 )
6
7 inherit eutils gnome2-utils python-single-r1
8
9 MY_PN="PlayOnLinux"
10
11 DESCRIPTION="Set of scripts to easily install and use Windows games and software"
12 HOMEPAGE="https://playonlinux.com/"
13 SRC_URI="http://www.playonlinux.com/script_files/${MY_PN}/${PV}/${MY_PN}_${PV}.tar.gz"
14
15 LICENSE="GPL-3"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="winbind"
19 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
20
21 DEPEND=""
22 RDEPEND="${PYTHON_DEPS}
23         app-arch/cabextract
24         app-arch/p7zip
25         app-arch/unzip
26         app-crypt/gnupg
27         virtual/wine
28         $(python_gen_cond_dep '
29                 dev-python/wxpython:3.0[${PYTHON_MULTI_USEDEP}]
30         ')
31         net-misc/wget
32         x11-apps/mesa-progs
33         x11-terms/xterm
34         media-gfx/icoutils
35         net-analyzer/netcat
36         virtual/imagemagick-tools
37         winbind? ( net-fs/samba[winbind] )
38 "
39
40 S="${WORKDIR}/${PN}"
41
42 # TODO:
43 # Having a real install script
44 # It will let using LANGUAGES easily
45 # How to deal with Microsoft Fonts installation asked every time ?
46 # How to deal with wine version installed ? (have a better mgmt of system one)
47 # Look at debian pkg: https://packages.debian.org/sid/playonlinux
48
49 PATCHES=(
50         "${FILESDIR}/${PN}-4.2.4-pol-bash.patch"
51         "${FILESDIR}/${PN}-4.2.4-binary-plugin.patch"
52         "${FILESDIR}/${PN}-4.2.6-stop-update-warning.patch"
53 )
54
55 src_prepare() {
56         default
57
58         python_fix_shebang .
59
60         # remove playonmac
61         rm etc/{playonmac.icns,terminal.applescript} || die
62
63         # remove desktop integration
64         rm etc/{PlayOnLinux.desktop,PlayOnLinux.directory,playonlinux-Programs.menu} || die
65 }
66
67 src_install() {
68         # all things without exec permissions
69         insinto "/usr/share/${PN}"
70         doins -r resources lang lib etc plugins
71
72         # bash/ install
73         exeinto "/usr/share/${PN}/bash"
74         find "${S}/bash" -type f -exec doexe '{}' +
75         exeinto "/usr/share/${PN}/bash/expert"
76         find "${S}/bash/expert" -type f -exec doexe '{}' +
77
78         # python/ install
79         python_moduleinto "/usr/share/${PN}"
80         python_domodule python
81
82         # main executable files
83         exeinto "/usr/share/${PN}"
84         doexe ${PN}{,-pkg,-bash,-shell,-url_handler}
85
86         # icons
87         doicon -s 128 etc/${PN}.png
88         for size in 16 22 32; do
89                 newicon -s $size etc/${PN}$size.png ${PN}.png
90         done
91
92         doman "${FILESDIR}"/playonlinux{,-pkg}.1
93         dodoc CHANGELOG.md
94
95         make_wrapper ${PN} "./${PN}" "/usr/share/${PN}"
96         make_wrapper ${PN}-pkg "./${PN}-pkg" "/usr/share/${PN}"
97         make_desktop_entry ${PN} ${MY_PN} ${PN} Game
98 }
99
100 pkg_preinst() {
101         gnome2_icon_savelist
102 }
103
104 pkg_postinst() {
105         gnome2_icon_cache_update
106 }
107
108 pkg_prerm() {
109         if [[ -z ${REPLACING_VERSIONS} ]]; then
110                 elog "Installed software and games with playonlinux have not been removed."
111                 elog "To remove them, you can re-install playonlinux and remove them using it,"
112                 elog "or do it manually by removing .PlayOnLinux/ in your home directory."
113         fi
114 }
115
116 pkg_postrm() {
117         gnome2_icon_cache_update
118 }