File: rsync-optional.patch

package info (click to toggle)
mpc 0.34-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 504 kB
  • sloc: ansic: 4,020; sh: 172; python: 107; makefile: 9
file content (56 lines) | stat: -rw-r--r-- 1,738 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
commit b656ca4b6c2a0d5b6cebd7f7daa679352f664e0e
Author: Sören Tempel <soeren+git@soeren-tempel.net>
Date:   Tue Nov 30 02:53:23 2021 +0100

    doc: make upload target dependency on rsync optional
    
    Currently, rsync is an unconditional dependency and checked during
    `meson configure`. As such, the build will fail if rsync is not
    installed which is probably not what was intended here.
    
    From the meson documentation:
    
            Meson will automatically insert the appropriate dependencies on
            targets and files listed in this keyword [the command] argument.
    
    This commit fixes the unconditional dependency on rsync with an explicit
    find_program invocation with `required: false`. Also wrap the
    custom_target in an if statement since it is not allowed to use
    non-found external programs in `command`.

diff --git a/doc/meson.build b/doc/meson.build
index f9475da..62529f8 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -8,17 +8,20 @@ sphinx_output = custom_target(
   install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()),
 )
 
-custom_target(
-  'upload',
-  input: sphinx_output,
-  output: 'upload',
-  build_always_stale: true,
-  command: [
-    'rsync', '-vpruz', '--delete', '@INPUT@',
-    'www.musicpd.org:/var/www/mpd/doc/mpc/',
-    '--chmod=a+rX',
-  ],
-)
+rsync = find_program('rsync', required: false)
+if rsync.found()
+  custom_target(
+    'upload',
+    input: sphinx_output,
+    output: 'upload',
+    build_always_stale: true,
+    command: [
+      rsync, '-vpruz', '--delete', '@INPUT@',
+      'www.musicpd.org:/var/www/mpd/doc/mpc/',
+      '--chmod=a+rX',
+    ],
+  )
+endif
 
 custom_target(
   'Manpage documentation',