commit:     6ffd5dae18526e489fc873b1b7a2ab0b380f3340
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 23 20:24:41 2016 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Sun Oct 23 20:25:08 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ffd5dae

app-office/scribus: Add adapted fPIC patch back

Bump to EAPI=6
Shorten helper functions
take back maintainership

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=593510

Package-Manager: portage-2.3.2
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 app-office/scribus/files/scribus-1.5.2-fpic.patch  | 16 ++++
 app-office/scribus/metadata.xml                    |  5 +-
 ...cribus-1.5.2.ebuild => scribus-1.5.2-r1.ebuild} | 91 ++++++++++++----------
 3 files changed, 72 insertions(+), 40 deletions(-)

diff --git a/app-office/scribus/files/scribus-1.5.2-fpic.patch 
b/app-office/scribus/files/scribus-1.5.2-fpic.patch
new file mode 100644
index 00000000..5828364
--- /dev/null
+++ b/app-office/scribus/files/scribus-1.5.2-fpic.patch
@@ -0,0 +1,16 @@
+ scribus/third_party/prc/CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/scribus/third_party/prc/CMakeLists.txt 
b/scribus/third_party/prc/CMakeLists.txt
+index 5f7c2c6..1da7177 100644
+--- a/scribus/third_party/prc/CMakeLists.txt
++++ b/scribus/third_party/prc/CMakeLists.txt
+@@ -5,6 +5,8 @@ ${OPENGL_INCLUDE_DIR}
+ ${FREETYPE_INCLUDE_DIRS}
+ )
+ 
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_FPIC}")
++
+ SET(SCRIBUS_PRC_LIB_SOURCES
+     oPRCFile.cc
+     PRCbitStream.cc

diff --git a/app-office/scribus/metadata.xml b/app-office/scribus/metadata.xml
index 745ba20..885d510 100644
--- a/app-office/scribus/metadata.xml
+++ b/app-office/scribus/metadata.xml
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
 <pkgmetadata>
-  <!-- maintainer-needed -->
+  <maintainer type="person">
+    <email>j...@gentoo.org</email>
+    <description>Primary maintainer</description>
+  </maintainer>
   <use>
     <flag name="boost">Enable support for Boost based enhancement</flag>
     <flag name="graphicsmagick">Add support for 
<pkg>media-gfx/graphicsmagick</pkg></flag>

diff --git a/app-office/scribus/scribus-1.5.2.ebuild 
b/app-office/scribus/scribus-1.5.2-r1.ebuild
similarity index 72%
rename from app-office/scribus/scribus-1.5.2.ebuild
rename to app-office/scribus/scribus-1.5.2-r1.ebuild
index ea8ec9e..939d847 100644
--- a/app-office/scribus/scribus-1.5.2.ebuild
+++ b/app-office/scribus/scribus-1.5.2-r1.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=5
+EAPI=6
 
 PYTHON_COMPAT=( python2_7 )
 PYTHON_REQ_USE="tk?"
@@ -19,7 +19,7 @@ KEYWORDS="~amd64 ~x86"
 IUSE="+boost debug examples graphicsmagick hunspell +minimal osg +pdf scripts 
templates tk"
 
 #a=$((ls resources/translations/scribus.*ts | sed -e 's:\.: :g' | awk '{print 
$2}'; ls resources/loremipsum/*xml | sed -e 's:\.: :g' -e 's:loremipsum\/: :g'| 
awk '{print $2}'; ls resources/dicts/hyph*dic | sed -e 's:\.: :g' -e 's:hyph_: 
:g' | awk '{print $2}'; ls resources/dicts/README_*txt | sed -e 's:_hyph::g' -e 
's:\.: :g' -e 's:README_: :g' | awk '{print $2}') | sort | uniq); echo $a
-IUSE_LINGUAS=" af ar bg br ca ca_ES cs cs_CZ cy cy_GB da da_DK de de_1901 
de_CH de_DE el en_AU en_EN en_GB en_US eo es es_ES et eu fi fi_FI fr gl he hr 
hu hu_HU ia id id_ID is is_IS it ja ko ku la lt lt_LT nb_NO nl nn_NO pl pl_PL 
pt pt_BR pt_PT ro ro_RO ru ru_RU_0 sa sk sk_SK sl sl_SI sq sr sv sv_SE th_TH tr 
uk uk_UA zh_CN zh_TW"
+IUSE_LINGUAS=" af ar bg br ca ca_ES cs cs_CZ cy cy_GB da da_DK de de_1901 
de_CH de_DE el en_AU en_GB en_US eo es es_ES et eu fi fi_FI fr gl he hr hu 
hu_HU ia id id_ID is is_IS it ja ko ku la lt lt_LT nb_NO nl nn_NO pl pl_PL pt 
pt_BR pt_PT ro ro_RO ru ru_RU_0 sa sk sk_SK sl sl_SI sq sr sv sv_SE th_TH tr uk 
uk_UA zh_CN zh_TW"
 IUSE+=" ${IUSE_LINGUAS// / linguas_}"
 
 REQUIRED_USE="
@@ -42,7 +42,6 @@ COMMON_DEPEND="
        dev-qt/qtopengl:5
        dev-qt/qtprintsupport:5
        dev-qt/qtquickcontrols:5
-       dev-qt/qtwebkit:5
        dev-qt/qtwidgets:5
        dev-qt/qtxml:5
        media-libs/fontconfig
@@ -73,6 +72,7 @@ DEPEND="${COMMON_DEPEND}
 
 PATCHES=(
        "${FILESDIR}"/${PN}-1.5.0-docdir.patch
+       "${FILESDIR}"/${P}-fpic.patch
        )
 
 src_prepare() {
@@ -103,20 +103,28 @@ src_prepare() {
 }
 
 src_configure() {
-       local lang langs
+       local _lang lang langs
        for lang in ${IUSE_LINGUAS}; do
+               _lang=$(translate_lang ${lang})
                if use linguas_${lang} || [[ ${lang} == "en" ]]; then
                        # From the CMakeLists.txt
                        # "#Bit of a hack, preprocess all the filenames to 
generate our language string, needed for -DWANT_GUI_LANG=en_GB;de_DE , etc"
-                       langs+=";${lang}"
+                       langs+=";${_lang}"
                else
                        # Don't install localized documentation
-                       sed -e "/${lang}/d" -i doc/CMakeLists.txt || die
-                       safe_delete file ./resources/dicts/README_${lang}.txt
-                       safe_delete file 
./resources/dicts/README_hyph_${lang}.txt
-                       safe_delete file ./resources/dicts/hyph_${lang}.dic
-                       safe_delete file ./resources/loremipsum/${lang}.xml
+                       sed -e "/${_lang}/d" -i doc/CMakeLists.txt || die
+                       safe_delete \
+                               ./resources/dicts/README_${_lang}.txt \
+                               ./resources/dicts/README_hyph_${_lang}.txt \
+                               ./resources/dicts/hyph_${_lang}.dic \
+                               ./resources/loremipsum/${_lang}.xml
                fi
+               sed -e "/en_EN/d" -i doc/CMakeLists.txt || die
+               safe_delete \
+                       ./resources/dicts/README_en_EN.txt \
+                       ./resources/dicts/README_hyph_en_EN.txt \
+                       ./resources/dicts/hyph_en_EN.dic \
+                       ./resources/loremipsum/en_EN.xml
        done
 
        local mycmakeargs=(
@@ -126,15 +134,15 @@ src_configure() {
                -DWANT_DISTROBUILD=ON
                -DDOCDIR="/usr/share/doc/${PF}/"
                -DWANT_GUI_LANG="${langs#;};en"
-               $(cmake-utils_use_with pdf PODOFO)
-               $(cmake-utils_use_with boost)
-               $(cmake-utils_use_want graphicsmagick)
-               $(cmake-utils_use !osg WANT_NOOSG)
-               $(cmake-utils_use_want debug DEBUG)
-               $(cmake-utils_use_want minimal NOHEADERINSTALL)
-               $(cmake-utils_use_want hunspell HUNSPELL)
-               $(cmake-utils_use_want !examples NOEXAMPLES)
-               $(cmake-utils_use_want !templates NOTEMPLATES)
+               -DWITH_PODOFO="$(usex pdf)"
+               -DWITH_BOOST="$(usex boost)"
+               -DWANT_GRAPHICSMAGICK="$(usex graphicsmagick)"
+               -DWANT_NOOSG="$(usex !osg)"
+               -DWANT_DEBUG="$(usex debug)"
+               -DWANT_NOHEADERINSTALL="$(usex minimal)"
+               -DWANT_HUNSPELL="$(usex hunspell)"
+               -DWANT_NOEXAMPLES="$(usex !examples)"
+               -DWANT_NOTEMPLATES="$(usex !templates)"
                )
        cmake-utils_src_configure
 }
@@ -142,11 +150,14 @@ src_configure() {
 src_install() {
        cmake-utils_src_install
 
-       local lang
+       local lang _lang
+       # en_EN can be deleted always
        for lang in ${IUSE_LINGUAS}; do
                if ! use linguas_${lang}; then
-                       safe_delete dir "${ED}"/usr/share/man/${lang}
+                       _lang=$(translate_lang)
+                       safe_delete "${ED}"/usr/share/man/${_lang}
                fi
+                       safe_delete "${ED}"/usr/share/man/${_lang}
        done
 
        if ! use scripts; then
@@ -182,22 +193,24 @@ pkg_postrm() {
 }
 
 safe_delete () {
-       case $1 in
-               dir)
-                       if [[ -d "${2}" ]]; then
-                               ebegin "Deleting ${2} recursively"
-                               rm -r "${2}" || die
-                               eend $?
-                       fi
-                       ;;
-               file)
-                       if [[ -f "${2}" ]]; then
-                               ebegin "Deleting ${2}"
-                               rm "${2}" || die
-                               eend $?
-                       fi
-                       ;;
-               *)
-                       die "Wrong usage"
-       esac
+       local x
+       for x in ${@}; do
+               if [[ -d "${x}" ]]; then
+                       ebegin "Deleting ${x} recursively"
+                       rm -r "${x}" || die
+                       eend $?
+               elif [[ -f "${x}" ]]; then
+                       ebegin "Deleting ${x}"
+                       rm "${x}" || die
+                       eend $?
+               else
+                       ewarn "${x} not found"
+               fi
+       done
+}
+
+translate_lang() {
+       _lang=${1}
+#      [[ ${1} == "ru_RU" ]] && _lang+=_0
+       echo ${_lang}
 }

Reply via email to