summaryrefslogtreecommitdiff
blob: 354b5e5800e4db01f67869b70e1ef9c0f06c9c04 (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
--- fwupd-0.9.2/data/meson.build
+++ fwupd-0.9.2/data/meson.build
@@ -38,20 +38,22 @@
                           'system-services'),
 )
 
-# replace @bindir@
-configure_file(
-  input : 'fwupd-offline-update.service.in',
-  output : 'fwupd-offline-update.service',
-  configuration : con2,
-  install: true,
-  install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'),
-)
+if get_option('with-systemd') and systemd.found()
+  # replace @bindir@
+  configure_file(
+    input : 'fwupd-offline-update.service.in',
+    output : 'fwupd-offline-update.service',
+    configuration : con2,
+    install: true,
+    install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'),
+  )
 
-# replace @localstatedir@ and @bootdir@
-configure_file(
-  input : 'fwupd.service.in',
-  output : 'fwupd.service',
-  configuration : con2,
-  install: true,
-  install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'),
-)
+  # replace @localstatedir@ and @bootdir@
+  configure_file(
+    input : 'fwupd.service.in',
+    output : 'fwupd.service',
+    configuration : con2,
+    install: true,
+    install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'),
+  )
+endif
--- fwupd-0.9.2/meson.build
+++ fwupd-0.9.2/meson.build
@@ -127,13 +127,17 @@
 gpgme = cc.find_library('gpgme')
 gpgerror = cc.find_library('libgpg-error')
 libm = cc.find_library('libm', required: false)
-systemd = dependency('systemd')
 udev = dependency('udev')
 
 if valgrind.found()
   conf.set('HAVE_VALGRIND', '1')
 endif
 
+if get_option('with-systemd')
+  systemd = dependency('systemd')
+  conf.set('HAVE_SYSTEMD', '1')
+endif
+
 if get_option('enable-colorhug')
   colorhug = dependency('colorhug', version : '>= 1.2.12')
   conf.set('HAVE_COLORHUG', '1')
@@ -220,4 +224,6 @@
   message('git not found, you will not be able to run `ninja dist`')
 endif
 
-meson.add_install_script('meson_post_install.sh', systemd.get_pkgconfig_variable('systemdsystemunitdir'), localstatedir)
+if get_option('with-systemd') and systemd.found()
+  meson.add_install_script('meson_post_install.sh', systemd.get_pkgconfig_variable('systemdsystemunitdir'), localstatedir)
+endif
--- fwupd-0.9.2/meson_options.txt
+++ fwupd-0.9.2/meson_options.txt
@@ -5,3 +5,4 @@
 option('enable-dell', type : 'boolean', value : true, description : 'enable Dell-specific support')
 option('enable-thunderbolt', type : 'boolean', value : true, description : 'enable Thunderbolt support')
 option('with-bootdir', type : 'string', value : '/boot/efi', description : 'Directory for EFI system partition')
+option('with-systemd', type : 'boolean', value : true, description : 'Install systemd unit files')