void-packages/srcpkgs/libportal/patches/optional_docs.patch
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

35 lines
1 KiB
Diff

From b7157e5d0c80981c74acfc7258683e84969649b0 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 18 Mar 2020 16:11:41 +0100
Subject: [PATCH] build: Make docs building optional
---
meson.build | 4 +++-
meson_options.txt | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index 3ca0fb3..49fa112 100644
--- a/meson.build
+++ b/meson.build
@@ -25,7 +25,9 @@ top_inc = include_directories('.')
libportal_inc = include_directories('libportal')
subdir('libportal')
-subdir('doc')
+if get_option('gtk_doc')
+ subdir('doc')
+endif
if get_option('build-portal-test')
subdir('portal-test')
endif
diff --git a/meson_options.txt b/meson_options.txt
index f138e4f..8501dc9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
option('build-portal-test', type: 'boolean', value: false,
description : 'Build the portal-test application')
-
+option('gtk_doc', type: 'boolean', value: true,
+ description : 'Build API reference with gtk-doc')