commit:     e9c21faf4101883e9de250041359ffa6eff4911b
Author:     Jonas Frei <freijon <AT> pm <DOT> me>
AuthorDate: Tue Apr  5 19:38:46 2022 +0000
Commit:     Ronny Gutbrod <gentoo <AT> tastytea <DOT> de>
CommitDate: Tue Apr  5 19:44:43 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e9c21faf

gui-apps/swaync: Added '+man' USE flag

Closes: https://bugs.gentoo.org/show_bug.cgi?id=836832

Signed-off-by: Jonas Frei <freijon <AT> pm.me>

 .../swaync-0.5-dont-force-build-manpages.patch     | 63 ++++++++++++++++++++++
 gui-apps/swaync/metadata.xml                       |  1 +
 .../{swaync-0.5.ebuild => swaync-0.5-r1.ebuild}    | 11 +++-
 3 files changed, 73 insertions(+), 2 deletions(-)

diff --git a/gui-apps/swaync/files/swaync-0.5-dont-force-build-manpages.patch 
b/gui-apps/swaync/files/swaync-0.5-dont-force-build-manpages.patch
new file mode 100644
index 000000000..80f659fdc
--- /dev/null
+++ b/gui-apps/swaync/files/swaync-0.5-dont-force-build-manpages.patch
@@ -0,0 +1,63 @@
+--- swaync/meson.build 2022-04-03 18:03:10.000000000 +0200
++++ swaync/meson.build 2022-04-05 21:21:03.543535988 +0200
+@@ -89,33 +89,34 @@
+ endif
+ 
+ # Man pages
+-man_pages = get_option('man-pages')
+-scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: 
man_pages)
+-if scdoc.found()
+-  scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: 
true)
++if get_option('man-pages')
++  scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: 
true)
++  if scdoc.found()
++    scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: 
true)
+ 
+-  mandir = get_option('mandir')
+-  man_files = [
+-    'swaync.1.scd',
+-    'swaync.5.scd',
+-    'swaync-client.1.scd',
+-  ]
++    mandir = get_option('mandir')
++    man_files = [
++      'swaync.1.scd',
++      'swaync.5.scd',
++      'swaync-client.1.scd',
++    ]
+ 
+-  foreach filename : man_files
+-    topic = filename.split('.')[-3].split('/')[-1]
+-    section = filename.split('.')[-2]
+-    output = '@0@.@1@'.format(topic, section)
+-    message(mandir, section, '@0@/man@1@'.format(mandir, section))
++    foreach filename : man_files
++      topic = filename.split('.')[-3].split('/')[-1]
++      section = filename.split('.')[-2]
++      output = '@0@.@1@'.format(topic, section)
++      message(mandir, section, '@0@/man@1@'.format(mandir, section))
+ 
+-    custom_target(
+-      output,
+-      input: join_paths('man', filename),
+-      output: output,
+-      command: scdoc_prog,
+-      install: true,
+-      feed: true,
+-      capture: true,
+-      install_dir: '@0@/man@1@'.format(mandir, section)
+-    )
+-  endforeach
++      custom_target(
++        output,
++        input: join_paths('man', filename),
++        output: output,
++        command: scdoc_prog,
++        install: true,
++        feed: true,
++        capture: true,
++        install_dir: '@0@/man@1@'.format(mandir, section)
++      )
++    endforeach
++  endif
+ endif

diff --git a/gui-apps/swaync/metadata.xml b/gui-apps/swaync/metadata.xml
index e529667b6..71f15d7df 100644
--- a/gui-apps/swaync/metadata.xml
+++ b/gui-apps/swaync/metadata.xml
@@ -10,6 +10,7 @@
                
<bugs-to>https://github.com/ErikReider/SwayNotificationCenter/issues</bugs-to>
        </upstream>
        <use>
+               <flag name="man">Build and install man pages</flag>
                <flag name="scripting">Enable notification scripting</flag>
        </use>
 </pkgmetadata>

diff --git a/gui-apps/swaync/swaync-0.5.ebuild 
b/gui-apps/swaync/swaync-0.5-r1.ebuild
similarity index 83%
rename from gui-apps/swaync/swaync-0.5.ebuild
rename to gui-apps/swaync/swaync-0.5-r1.ebuild
index 4878af1c0..5f84d19ed 100644
--- a/gui-apps/swaync/swaync-0.5.ebuild
+++ b/gui-apps/swaync/swaync-0.5-r1.ebuild
@@ -14,7 +14,10 @@ S="${WORKDIR}/${MY_PN}-${PV}"
 LICENSE="GPL-3"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE="scripting"
+IUSE="+man scripting"
+PATCHES=(
+       "${FILESDIR}/${P}-dont-force-build-manpages.patch"
+)
 
 DEPEND="
        dev-libs/glib:2
@@ -29,7 +32,10 @@ DEPEND="
        x11-libs/gtk+:3
 "
 RDEPEND="${DEPEND}"
-BDEPEND="$(vala_depend)"
+BDEPEND="
+       $(vala_depend)
+       man? ( app-text/scdoc )
+"
 
 src_prepare() {
        default
@@ -38,6 +44,7 @@ src_prepare() {
 
 src_configure() {
        local emesonargs=(
+               $(meson_use man man-pages)
                $(meson_use scripting)
        )
        meson_src_configure

Reply via email to