| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-office/scribus/scribus-1.4.0-r2.ebuild,v 1.3 2012/05/20 14:53:21 ago Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
PYTHON_DEPEND="2"
|
| 8 |
|
| 9 |
inherit cmake-utils fdo-mime multilib python
|
| 10 |
|
| 11 |
DESCRIPTION="Desktop publishing (DTP) and layout program"
|
| 12 |
HOMEPAGE="http://www.scribus.net/"
|
| 13 |
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
|
| 14 |
|
| 15 |
LICENSE="GPL-2"
|
| 16 |
SLOT="0"
|
| 17 |
KEYWORDS="amd64 hppa ~ppc ~ppc64 ~sparc x86"
|
| 18 |
IUSE="cairo debug examples +minimal +pdf spell templates"
|
| 19 |
|
| 20 |
# a=$(ls resources/translations/po/scribus.*ts | sed -e 's:\.: :g' | awk '{print $2}'); echo ${a}
|
| 21 |
IUSE_LINGUAS=" af ar bg br ca cs_CZ cy da_DK de_1901 de_CH de el en_AU en_GB en_US es_ES et eu fi fr gl hu id it ja ko lt_LT nb_NO nl pl_PL pt_BR pt ru sa sk_SK sl sq sr sv th_TH tr uk zh_CN zh_TW"
|
| 22 |
IUSE+=" ${IUSE_LINGUAS// / linguas_}"
|
| 23 |
|
| 24 |
COMMON_DEPEND="
|
| 25 |
dev-libs/hyphen
|
| 26 |
dev-libs/libxml2
|
| 27 |
media-libs/fontconfig
|
| 28 |
media-libs/freetype:2
|
| 29 |
media-libs/lcms:2
|
| 30 |
media-libs/libpng:0
|
| 31 |
media-libs/tiff:0
|
| 32 |
net-print/cups
|
| 33 |
sys-libs/zlib[minizip]
|
| 34 |
x11-libs/qt-core:4
|
| 35 |
x11-libs/qt-gui:4
|
| 36 |
virtual/jpeg
|
| 37 |
spell? ( app-text/aspell )
|
| 38 |
pdf? ( app-text/podofo )
|
| 39 |
cairo? ( x11-libs/cairo[X,svg] )"
|
| 40 |
RDEPEND="${COMMON_DEPEND}
|
| 41 |
app-text/ghostscript-gpl"
|
| 42 |
DEPEND="${COMMON_DEPEND}
|
| 43 |
dev-libs/boost"
|
| 44 |
|
| 45 |
PATCHES=(
|
| 46 |
"${FILESDIR}"/${PN}-1.4.0_rc5-docs.patch
|
| 47 |
"${FILESDIR}"/${P}-export.patch
|
| 48 |
"${FILESDIR}"/${P}-minizip.patch
|
| 49 |
)
|
| 50 |
|
| 51 |
pkg_setup() {
|
| 52 |
python_set_active_version 2
|
| 53 |
python_pkg_setup
|
| 54 |
}
|
| 55 |
|
| 56 |
src_prepare() {
|
| 57 |
cat > cmake/modules/FindZLIB.cmake <<- EOF
|
| 58 |
find_package(PkgConfig)
|
| 59 |
pkg_check_modules(ZLIB minizip zlib)
|
| 60 |
SET( ZLIB_LIBRARY \${ZLIB_LIBRARIES} )
|
| 61 |
SET( ZLIB_INCLUDE_DIR \${ZLIB_INCLUDE_DIRS} )
|
| 62 |
MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )
|
| 63 |
EOF
|
| 64 |
|
| 65 |
rm scribus/{ioapi,unzip}.[ch] || die
|
| 66 |
|
| 67 |
if use templates; then
|
| 68 |
sed '/ADD_SUBDIRECTORY(resources\/templates)/d' -i CMakeLists.txt || die
|
| 69 |
fi
|
| 70 |
if use examples; then
|
| 71 |
sed '/ADD_SUBDIRECTORY(samples)/d' -i scribus/plugins/scriptplugin/CMakeLists.txt || die
|
| 72 |
fi
|
| 73 |
|
| 74 |
base_src_prepare
|
| 75 |
}
|
| 76 |
|
| 77 |
src_configure() {
|
| 78 |
local lang langs
|
| 79 |
for lang in ${IUSE_LINGUAS}; do
|
| 80 |
use linguas_${lang} && langs+=",${lang}"
|
| 81 |
done
|
| 82 |
|
| 83 |
local mycmakeargs=(
|
| 84 |
-DHAVE_PYTHON=ON
|
| 85 |
-DPYTHON_INCLUDE_PATH=$(python_get_includedir)
|
| 86 |
-DPYTHON_LIBRARY=$(python_get_library)
|
| 87 |
-DWANT_NORPATH=ON
|
| 88 |
-DWANT_QTARTHUR=ON
|
| 89 |
-DWANT_QT3SUPPORT=OFF
|
| 90 |
-DGENTOOVERSION=${PVR}
|
| 91 |
-DWANT_GUI_LANG=${langs#,}
|
| 92 |
$(cmake-utils_use_has spell ASPELL)
|
| 93 |
$(cmake-utils_use_has pdf PODOFO)
|
| 94 |
$(cmake-utils_use_want cairo)
|
| 95 |
$(cmake-utils_use_want minimal NOHEADERINSTALL)
|
| 96 |
$(cmake-utils_use_want debug DEBUG)
|
| 97 |
)
|
| 98 |
cmake-utils_src_configure
|
| 99 |
}
|
| 100 |
|
| 101 |
src_install() {
|
| 102 |
cmake-utils_src_install
|
| 103 |
|
| 104 |
mv "${ED}"/usr/share/doc/${PF}/{en,html} || die
|
| 105 |
ln -sf html "${ED}"/usr/share/doc/${PF}/en || die
|
| 106 |
docompress -x /usr/share/doc/${PF}/en
|
| 107 |
doicon resources/icons/scribus.png
|
| 108 |
domenu scribus.desktop
|
| 109 |
}
|
| 110 |
|
| 111 |
pkg_preinst() {
|
| 112 |
# 399595
|
| 113 |
rm -vf "${ED}"/usr/share/doc/${PF}/en* || die
|
| 114 |
ln -sf html "${ED}"/usr/share/doc/${PF}/en
|
| 115 |
}
|
| 116 |
|
| 117 |
pkg_postinst() {
|
| 118 |
fdo-mime_mime_database_update
|
| 119 |
}
|
| 120 |
|
| 121 |
pkg_postrm() {
|
| 122 |
fdo-mime_mime_database_update
|
| 123 |
}
|