Use https by default
[gentoo.git] / app-office / dia / dia-0.97.3_pre20140417-r1.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 GCONF_DEBUG=yes
7 GNOME2_LA_PUNT=yes
8 PYTHON_COMPAT=( python2_7 )
9
10 inherit autotools eutils gnome2 python-single-r1 multilib
11
12 DESCRIPTION="Diagram/flowchart creation program"
13 HOMEPAGE="https://wiki.gnome.org/Apps/Dia"
14
15 SRC_URI="https://dev.gentoo.org/~pacho/gnome/${PN}-0.97.3_pre20140417.tar.xz"
16 S="${WORKDIR}/${PN}-0.97.2"
17
18 LICENSE="GPL-2"
19 SLOT="0"
20 KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ~ppc ~ppc64 ~sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos"
21 # the doc USE flag doesn't seem to do anything without docbook2html
22 # cairo support is preferred as explained by upstream at:
23 # https://bugzilla.gnome.org/show_bug.cgi?id=729668#c6
24 IUSE="+cairo doc python"
25
26 RDEPEND="
27         >=dev-libs/glib-2:2
28         dev-libs/libxml2
29         dev-libs/libxslt
30         dev-libs/popt
31         >=media-libs/freetype-2
32         >=media-libs/libart_lgpl-2
33         media-libs/libpng:0
34         sys-libs/zlib
35         x11-libs/gtk+:2
36         x11-libs/pango
37         cairo? ( x11-libs/cairo )
38         doc? (
39                 app-text/docbook-xml-dtd:4.5
40                 app-text/docbook-xsl-stylesheets )
41         python? (
42                 >=dev-python/pygtk-2
43                 ${PYTHON_DEPS} )
44 "
45 DEPEND="${RDEPEND}
46         dev-util/intltool
47         sys-apps/sed
48         virtual/pkgconfig
49         doc? ( dev-libs/libxslt )"
50
51 pkg_setup() {
52         use python && python-single-r1_pkg_setup
53 }
54
55 src_prepare() {
56         DOCS="AUTHORS ChangeLog KNOWN_BUGS MAINTAINERS NEWS README RELEASE-PROCESS THANKS TODO"
57
58         epatch "${FILESDIR}"/${PN}-0.97.0-gnome-doc.patch #159381 , upstream #470812 #558690
59         epatch "${FILESDIR}"/${PN}-0.97.2-underlinking.patch #420685
60         epatch "${FILESDIR}"/${PN}-0.97.2-disable-cairo.patch #509636
61         epatch "${FILESDIR}"/${PN}-0.97.2-png-crash.patch #508566
62
63         if use python; then
64                 python_fix_shebang .
65                 sed -i -e "s/\.so/$(get_libname)/" acinclude.m4 || die #298232
66         fi
67
68         if ! use doc; then
69                 # Skip man generation
70                 sed -i -e '/if HAVE_DB2MAN/,/endif/d' doc/*/Makefile.am || die
71         fi
72
73         # Fix naming conflict on Darwin/OSX, upstream bug #????
74         sed -i -e 's/isspecial/char_isspecial/' objects/GRAFCET/boolequation.c || die
75
76         sed -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.in || die
77
78         sed -i -e "/localedir/d" configure.in || die
79
80         eautoreconf
81         gnome2_src_prepare
82 }
83
84 src_configure() {
85         # --exec-prefix makes Python look for modules in the Prefix
86         # --enable-gnome only adds support for deprecated stuff, bug #442294
87         # https://bugzilla.redhat.com/show_bug.cgi?id=996759
88         gnome2_src_configure \
89                 --exec-prefix="${EPREFIX}/usr" \
90                 --disable-gnome \
91                 --disable-libemf \
92                 $(use_enable doc db2html) \
93                 $(use_with cairo) \
94                 $(use_with python) \
95                 --without-swig \
96                 --without-hardbooks
97 }
98
99 src_install() {
100         gnome2_src_install
101
102         # Install second desktop file for integrated mode (bug #415495)
103         sed -e 's|^Exec=dia|Exec=dia --integrated|' \
104                         -e '/^Name/ s|$| (integrated mode)|' \
105                         "${ED}"/usr/share/applications/dia.desktop \
106                         > "${ED}"/usr/share/applications/dia-integrated.desktop || die
107 }