Merge branch 'xfim-master'
[gentoo.git] / x11-wm / windowmaker / windowmaker-9999.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit eutils git-r3
7
8 DESCRIPTION="The fast and light GNUstep window manager"
9 HOMEPAGE="http://www.windowmaker.org/"
10 SRC_URI="http://www.windowmaker.org/pub/source/release/WindowMaker-extra-0.1.tar.gz"
11 EGIT_REPO_URI="git://repo.or.cz/wmaker-crm.git"
12 EGIT_BRANCH="next"
13
14 SLOT="0"
15 LICENSE="GPL-2"
16 IUSE="gif imagemagick jpeg modelock nls png tiff webp xinerama +xpm xrandr"
17 KEYWORDS=""
18
19 DEPEND="media-libs/fontconfig
20         >=x11-libs/libXft-2.1.0
21         x11-libs/libXmu
22         x11-libs/libXpm
23         x11-libs/libXt
24         x11-libs/libXv
25         gif? ( >=media-libs/giflib-4.1.0-r3 )
26         imagemagick? ( media-gfx/imagemagick )
27         jpeg? ( virtual/jpeg:0= )
28         png? ( media-libs/libpng:0= )
29         tiff? ( media-libs/tiff:0 )
30         webp? ( media-libs/libwebp )
31         xinerama? ( x11-libs/libXinerama )
32         xrandr? ( x11-libs/libXrandr )"
33 RDEPEND="${DEPEND}
34         nls? ( >=sys-devel/gettext-0.10.39 )
35         !app-i18n/scim-anthy[gtk3]"
36
37 src_unpack() {
38         # wm-extras
39         unpack ${A}
40
41         git-r3_src_unpack
42 }
43
44 src_prepare() {
45         # Fix some paths
46         for file in WindowMaker/*menu* util/wmgenmenu.c; do
47                 if [[ -r $file ]] ; then
48                         sed -i -e "s:/usr/local/GNUstep/Applications/WPrefs.app:${EPREFIX}/usr/bin/:g;" "$file" || die
49                         sed -i -e "s:/usr/local/share/WindowMaker:${EPREFIX}/usr/share/WindowMaker:g;" "$file" || die
50                         sed -i -e "s:/opt/share/WindowMaker:${EPREFIX}/usr/share/WindowMaker:g;" "$file" || die
51                 fi;
52         done;
53 }
54
55 src_configure() {
56         local myconf
57
58         # image format types
59         myconf="$(use_enable imagemagick magick) $(use_enable jpeg) $(use_enable gif) $(use_enable png) $(use_enable tiff) $(use_enable webp) $(use_enable xpm)"
60
61         # non required X capabilities
62         myconf="${myconf} $(use_enable modelock) $(use_enable xrandr randr) $(use_enable xinerama)"
63
64         if use nls; then
65                 [[ -z $LINGUAS ]] && export LINGUAS="$(ls po/*.po | sed 's:po/\(.*\)\.po$:\1:' | xargs)"
66         else
67                 myconf="${myconf} --disable-locale"
68         fi
69
70         # default settings with $myconf appended
71         econf \
72                 --sysconfdir="${EPREFIX}"/etc/X11 \
73                 --with-x \
74                 --enable-usermenu \
75                 --with-pixmapdir="${EPREFIX}"/usr/share/pixmaps \
76                 --localedir="${EPREFIX}"/usr/share/locale \
77                 ${myconf}
78
79         cd ../WindowMaker-extra-0.1
80         econf
81 }
82
83 src_compile() {
84         emake
85
86         # WindowMaker Extra Package (themes and icons)
87         cd ../WindowMaker-extra-0.1
88         emake
89 }
90
91 src_install() {
92         emake DESTDIR="${D}" install
93
94         dodoc AUTHORS BUGFORM BUGS ChangeLog INSTALL* FAQ* \
95                   README* NEWS TODO
96
97         # WindowMaker Extra
98         cd ../WindowMaker-extra-0.1
99         emake DESTDIR="${D}" install
100
101         newdoc README README.extra
102
103         # create wmaker session shell script
104         echo "#!/usr/bin/env bash" > wmaker
105         echo "${EPREFIX}/usr/bin/wmaker" >> wmaker
106         exeinto /etc/X11/Sessions/
107         doexe wmaker
108
109         insinto /usr/share/xsessions
110         doins "${FILESDIR}"/wmaker.desktop
111         make_desktop_entry /usr/bin/wmaker
112 }