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