Merge ~ondrak/snappy-hwe-snaps/+git/pulseaudio:stable-xenial into ~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio:stable
- Git
- lp:~ondrak/snappy-hwe-snaps/+git/pulseaudio
- stable-xenial
- Merge into stable
Status: | Needs review |
---|---|
Proposed branch: | ~ondrak/snappy-hwe-snaps/+git/pulseaudio:stable-xenial |
Merge into: | ~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio:stable |
Diff against target: |
893 lines (+667/-71) 10 files modified
.gitignore (+6/-0) alsa-lib-snap.patch (+181/-0) glue/bin/client-wrapper (+0/-5) glue/bin/pulseaudio (+10/-10) pulseaudio-snap.patch (+89/-0) quiltrc (+6/-0) snap/hooks/configure (+201/-0) snap/hooks/install (+29/-0) snap/hooks/post-refresh (+33/-0) snap/snapcraft.yaml (+112/-56) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
System Enablement Bot | continuous-integration | Needs Fixing | |
Oliver Grawert | Pending | ||
Review via email: mp+373533@code.launchpad.net |
Commit message
Update of snapcraft to use modern way of snap building
adding options to alter configurations if required by hw
Description of the change
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:4a74ba660a7
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
@ondra, please rebase and propose again against master.
Unmerged commits
- 4a74ba6... by Ondrej Kubik
-
snap: add network, network-bind plug to pulse server
Signed-off-by: Ondrej Kubik <email address hidden>
- 4bd2143... by Ondrej Kubik
-
add pulseaudio snap patch
Signed-off-by: Ondrej Kubik <email address hidden>
- a9a20f4... by Ondrej Kubik
-
add alsa-lib snap patch
Signed-off-by: Ondrej Kubik <email address hidden>
- 0b6c7b9... by Ondrej Kubik
-
snapcraft: dummy part to triger autobuild for pulse and libsound2
Signed-off-by: Ondrej Kubik <email address hidden>
- 87dfa3f... by Ondrej Kubik
-
snapcraft: build snap from upstream source
Signed-off-by: Ondrej Kubik <email address hidden>
- 531a7fe... by Ondrej Kubik
-
glue: pulseaudion: add optional service start delay
Signed-off-by: Ondrej Kubik <email address hidden>
- 4259e17... by Ondrej Kubik
-
hooks: add support for config file modification using snap set
Signed-off-by: Ondrej Kubik <email address hidden>
- a7923d3... by Ondrej Kubik
-
snapcraft: making configuration writable
Signed-off-by: Ondrej Kubik <email address hidden>
- 7f548c4... by Ondrej Kubik
-
snapcraft: refactor to new syntax and plugings
Signed-off-by: Ondrej Kubik <email address hidden>
- b8c0cdf... by Ondrej Kubik
-
add gitignore
Signed-off-by: Ondrej Kubik <email address hidden>
Preview Diff
1 | diff --git a/.gitignore b/.gitignore | |||
2 | 0 | new file mode 100644 | 0 | new file mode 100644 |
3 | index 0000000..3ed44be | |||
4 | --- /dev/null | |||
5 | +++ b/.gitignore | |||
6 | @@ -0,0 +1,6 @@ | |||
7 | 1 | parts/ | ||
8 | 2 | prime/ | ||
9 | 3 | stage/ | ||
10 | 4 | *.snap | ||
11 | 5 | snap/plugins/__pycache__ | ||
12 | 6 | snap/.snapcraft/ | ||
13 | diff --git a/alsa-lib-snap.patch b/alsa-lib-snap.patch | |||
14 | 0 | new file mode 100644 | 7 | new file mode 100644 |
15 | index 0000000..d57a937 | |||
16 | --- /dev/null | |||
17 | +++ b/alsa-lib-snap.patch | |||
18 | @@ -0,0 +1,181 @@ | |||
19 | 1 | From a763fcf93e6957f9edd8cd49948507d5a0728412 Mon Sep 17 00:00:00 2001 | ||
20 | 2 | From: Ondrej Kubik <ondrej.kubik@canonical.com> | ||
21 | 3 | Date: Fri, 14 Jun 2019 21:32:14 +0100 | ||
22 | 4 | Subject: [PATCH] xenial: snap: snap changes | ||
23 | 5 | |||
24 | 6 | Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com> | ||
25 | 7 | --- | ||
26 | 8 | src/alisp/alisp.c | 3 ++- | ||
27 | 9 | src/conf.c | 7 +++++-- | ||
28 | 10 | src/confmisc.c | 4 ++-- | ||
29 | 11 | src/control/control.c | 7 +++++-- | ||
30 | 12 | src/dlmisc.c | 7 +++++-- | ||
31 | 13 | src/pcm/pcm.c | 8 ++++++-- | ||
32 | 14 | src/pcm/pcm_rate.c | 5 ++++- | ||
33 | 15 | 7 files changed, 29 insertions(+), 12 deletions(-) | ||
34 | 16 | |||
35 | 17 | diff --git a/src/alisp/alisp.c b/src/alisp/alisp.c | ||
36 | 18 | index 3c61bb1..1474b97 100644 | ||
37 | 19 | --- a/src/alisp/alisp.c | ||
38 | 20 | +++ b/src/alisp/alisp.c | ||
39 | 21 | @@ -2399,7 +2399,8 @@ struct alisp_object * F_path(struct alisp_instance *instance, struct alisp_objec | ||
40 | 22 | } | ||
41 | 23 | if (!strcmp(p1->value.s, "data")) { | ||
42 | 24 | delete_tree(instance, p1); | ||
43 | 25 | - return new_string(instance, ALSA_CONFIG_DIR); | ||
44 | 26 | + const char *config_dir = getenv("ALSA_CONFIG_DIR"); | ||
45 | 27 | + return new_string(instance, config_dir ? config_dir : ALSA_CONFIG_DIR ); | ||
46 | 28 | } | ||
47 | 29 | delete_tree(instance, p1); | ||
48 | 30 | return &alsa_lisp_nil; | ||
49 | 31 | diff --git a/src/conf.c b/src/conf.c | ||
50 | 32 | index a4f2a4f..29e48a9 100644 | ||
51 | 33 | --- a/src/conf.c | ||
52 | 34 | +++ b/src/conf.c | ||
53 | 35 | @@ -622,6 +622,9 @@ static int get_delimstring(char **string, int delim, input_t *input); | ||
54 | 36 | static int get_char_skip_comments(input_t *input) | ||
55 | 37 | { | ||
56 | 38 | int c; | ||
57 | 39 | + char *config_dir = getenv("ALSA_CONFIG_DIR"); | ||
58 | 40 | + if (!config_dir) | ||
59 | 41 | + config_dir = ALSA_CONFIG_DIR; | ||
60 | 42 | while (1) { | ||
61 | 43 | c = get_char(input); | ||
62 | 44 | if (c == '<') { | ||
63 | 45 | @@ -632,12 +635,12 @@ static int get_char_skip_comments(input_t *input) | ||
64 | 46 | if (err < 0) | ||
65 | 47 | return err; | ||
66 | 48 | if (!strncmp(str, "confdir:", 8)) { | ||
67 | 49 | - char *tmp = malloc(strlen(ALSA_CONFIG_DIR) + 1 + strlen(str + 8) + 1); | ||
68 | 50 | + char *tmp = malloc(strlen(config_dir) + 1 + strlen(str + 8) + 1); | ||
69 | 51 | if (tmp == NULL) { | ||
70 | 52 | free(str); | ||
71 | 53 | return -ENOMEM; | ||
72 | 54 | } | ||
73 | 55 | - sprintf(tmp, ALSA_CONFIG_DIR "/%s", str + 8); | ||
74 | 56 | + sprintf(tmp, "%s/%s", config_dir, str + 8); | ||
75 | 57 | free(str); | ||
76 | 58 | str = tmp; | ||
77 | 59 | } | ||
78 | 60 | diff --git a/src/confmisc.c b/src/confmisc.c | ||
79 | 61 | index ae0275f..8ca70de 100644 | ||
80 | 62 | --- a/src/confmisc.c | ||
81 | 63 | +++ b/src/confmisc.c | ||
82 | 64 | @@ -584,11 +584,11 @@ int snd_func_datadir(snd_config_t **dst, snd_config_t *root ATTRIBUTE_UNUSED, | ||
83 | 65 | { | ||
84 | 66 | int err; | ||
85 | 67 | const char *id; | ||
86 | 68 | - | ||
87 | 69 | + const char *config_dir = getenv("ALSA_CONFIG_DIR"); | ||
88 | 70 | err = snd_config_get_id(src, &id); | ||
89 | 71 | if (err < 0) | ||
90 | 72 | return err; | ||
91 | 73 | - return snd_config_imake_string(dst, id, ALSA_CONFIG_DIR); | ||
92 | 74 | + return snd_config_imake_string(dst, id, config_dir ? config_dir : ALSA_CONFIG_DIR); | ||
93 | 75 | } | ||
94 | 76 | #ifndef DOC_HIDDEN | ||
95 | 77 | SND_DLSYM_BUILD_VERSION(snd_func_datadir, SND_CONFIG_DLSYM_VERSION_EVALUATE); | ||
96 | 78 | diff --git a/src/control/control.c b/src/control/control.c | ||
97 | 79 | index 4a28cf6..7c92db9 100644 | ||
98 | 80 | --- a/src/control/control.c | ||
99 | 81 | +++ b/src/control/control.c | ||
100 | 82 | @@ -835,6 +835,9 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name, | ||
101 | 83 | const char *lib = NULL, *open_name = NULL; | ||
102 | 84 | const char *id; | ||
103 | 85 | int (*open_func)(snd_ctl_t **, const char *, snd_config_t *, snd_config_t *, int) = NULL; | ||
104 | 86 | + char *plugin_dir = getenv("ALSA_PLUGIN_DIR"); | ||
105 | 87 | + if (!plugin_dir) | ||
106 | 88 | + plugin_dir = ALSA_PLUGIN_DIR; | ||
107 | 89 | #ifndef PIC | ||
108 | 90 | extern void *snd_control_open_symbols(void); | ||
109 | 91 | #endif | ||
110 | 92 | @@ -912,13 +915,13 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name, | ||
111 | 93 | build_in++; | ||
112 | 94 | } | ||
113 | 95 | if (*build_in == NULL) { | ||
114 | 96 | - buf1 = malloc(strlen(str) + sizeof(ALSA_PLUGIN_DIR) + 32); | ||
115 | 97 | + buf1 = malloc(strlen(str) + sizeof(plugin_dir) + 32); | ||
116 | 98 | if (buf1 == NULL) { | ||
117 | 99 | err = -ENOMEM; | ||
118 | 100 | goto _err; | ||
119 | 101 | } | ||
120 | 102 | lib = buf1; | ||
121 | 103 | - sprintf(buf1, "%s/libasound_module_ctl_%s.so", ALSA_PLUGIN_DIR, str); | ||
122 | 104 | + sprintf(buf1, "%s/libasound_module_ctl_%s.so", plugin_dir, str); | ||
123 | 105 | } | ||
124 | 106 | } | ||
125 | 107 | #ifndef PIC | ||
126 | 108 | diff --git a/src/dlmisc.c b/src/dlmisc.c | ||
127 | 109 | index b36c48f..b8c4db3 100644 | ||
128 | 110 | --- a/src/dlmisc.c | ||
129 | 111 | +++ b/src/dlmisc.c | ||
130 | 112 | @@ -74,10 +74,13 @@ void *snd_dlopen(const char *name, int mode) | ||
131 | 113 | */ | ||
132 | 114 | void *handle = NULL; | ||
133 | 115 | char *filename; | ||
134 | 116 | + char *plugin_dir = getenv("ALSA_PLUGIN_DIR"); | ||
135 | 117 | + if (!plugin_dir) | ||
136 | 118 | + plugin_dir = ALSA_PLUGIN_DIR; | ||
137 | 119 | |||
138 | 120 | if (name && name[0] != '/') { | ||
139 | 121 | - filename = malloc(sizeof(ALSA_PLUGIN_DIR) + 1 + strlen(name) + 1); | ||
140 | 122 | - strcpy(filename, ALSA_PLUGIN_DIR); | ||
141 | 123 | + filename = malloc(sizeof(plugin_dir) + 1 + strlen(name) + 1); | ||
142 | 124 | + strcpy(filename, plugin_dir); | ||
143 | 125 | strcat(filename, "/"); | ||
144 | 126 | strcat(filename, name); | ||
145 | 127 | handle = dlopen(filename, mode); | ||
146 | 128 | diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c | ||
147 | 129 | index cbbc55a..60c410f 100644 | ||
148 | 130 | --- a/src/pcm/pcm.c | ||
149 | 131 | +++ b/src/pcm/pcm.c | ||
150 | 132 | @@ -2117,6 +2117,10 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name, | ||
151 | 133 | int (*open_func)(snd_pcm_t **, const char *, | ||
152 | 134 | snd_config_t *, snd_config_t *, | ||
153 | 135 | snd_pcm_stream_t, int) = NULL; | ||
154 | 136 | + char *plugin_dir = getenv("ALSA_PLUGIN_DIR"); | ||
155 | 137 | + if (!plugin_dir) | ||
156 | 138 | + plugin_dir = ALSA_PLUGIN_DIR; | ||
157 | 139 | + | ||
158 | 140 | #ifndef PIC | ||
159 | 141 | extern void *snd_pcm_open_symbols(void); | ||
160 | 142 | #endif | ||
161 | 143 | @@ -2197,13 +2201,13 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name, | ||
162 | 144 | build_in++; | ||
163 | 145 | } | ||
164 | 146 | if (*build_in == NULL) { | ||
165 | 147 | - buf1 = malloc(strlen(str) + sizeof(ALSA_PLUGIN_DIR) + 32); | ||
166 | 148 | + buf1 = malloc(strlen(str) + sizeof(plugin_dir) + 32); | ||
167 | 149 | if (buf1 == NULL) { | ||
168 | 150 | err = -ENOMEM; | ||
169 | 151 | goto _err; | ||
170 | 152 | } | ||
171 | 153 | lib = buf1; | ||
172 | 154 | - sprintf(buf1, "%s/libasound_module_pcm_%s.so", ALSA_PLUGIN_DIR, str); | ||
173 | 155 | + sprintf(buf1, "%s/libasound_module_pcm_%s.so", plugin_dir, str); | ||
174 | 156 | } | ||
175 | 157 | } | ||
176 | 158 | #ifndef PIC | ||
177 | 159 | diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c | ||
178 | 160 | index c76db25..ae920bc 100644 | ||
179 | 161 | --- a/src/pcm/pcm_rate.c | ||
180 | 162 | +++ b/src/pcm/pcm_rate.c | ||
181 | 163 | @@ -1226,11 +1226,14 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type, int verbose) | ||
182 | 164 | char open_name[64], lib_name[128], *lib = NULL; | ||
183 | 165 | snd_pcm_rate_open_func_t open_func; | ||
184 | 166 | int err; | ||
185 | 167 | + char *plugin_dir = getenv("ALSA_PLUGIN_DIR"); | ||
186 | 168 | + if (!plugin_dir) | ||
187 | 169 | + plugin_dir = ALSA_PLUGIN_DIR; | ||
188 | 170 | |||
189 | 171 | snprintf(open_name, sizeof(open_name), "_snd_pcm_rate_%s_open", type); | ||
190 | 172 | if (!is_builtin_plugin(type)) { | ||
191 | 173 | snprintf(lib_name, sizeof(lib_name), | ||
192 | 174 | - "%s/libasound_module_rate_%s.so", ALSA_PLUGIN_DIR, type); | ||
193 | 175 | + "%s/libasound_module_rate_%s.so", plugin_dir, type); | ||
194 | 176 | lib = lib_name; | ||
195 | 177 | } | ||
196 | 178 | open_func = snd_dlobj_cache_get(lib, open_name, NULL, verbose); | ||
197 | 179 | -- | ||
198 | 180 | 2.20.1 | ||
199 | 181 | |||
200 | diff --git a/bin/client-wrapper b/glue/bin/client-wrapper | |||
201 | 0 | similarity index 90% | 182 | similarity index 90% |
202 | 1 | rename from bin/client-wrapper | 183 | rename from bin/client-wrapper |
203 | 2 | rename to glue/bin/client-wrapper | 184 | rename to glue/bin/client-wrapper |
204 | index 255187c..fc66e93 100755 | |||
205 | --- a/bin/client-wrapper | |||
206 | +++ b/glue/bin/client-wrapper | |||
207 | @@ -19,11 +19,6 @@ if [ "$(id -u)" -ne 0 ]; then | |||
208 | 19 | exit 1 | 19 | exit 1 |
209 | 20 | fi | 20 | fi |
210 | 21 | 21 | ||
211 | 22 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/usr/lib/pulseaudio:$SNAP/usr/lib/pulse-8.0/modules/ | ||
212 | 23 | export PULSE_CLIENTCONFIG=$SNAP/etc/pulse/client.conf | ||
213 | 24 | export PULSE_RUNTIME_PATH=/var/run/pulse | ||
214 | 25 | export PULSE_SYSTEM=1 | ||
215 | 26 | |||
216 | 27 | unset XDG_RUNTIME_DIR | 22 | unset XDG_RUNTIME_DIR |
217 | 28 | 23 | ||
218 | 29 | export HOME=$SNAP_DATA/home | 24 | export HOME=$SNAP_DATA/home |
219 | diff --git a/bin/config b/glue/bin/config | |||
220 | 30 | similarity index 100% | 25 | similarity index 100% |
221 | 31 | rename from bin/config | 26 | rename from bin/config |
222 | 32 | rename to glue/bin/config | 27 | rename to glue/bin/config |
223 | diff --git a/bin/pulseaudio b/glue/bin/pulseaudio | |||
224 | 33 | similarity index 62% | 28 | similarity index 62% |
225 | 34 | rename from bin/pulseaudio | 29 | rename from bin/pulseaudio |
226 | 35 | rename to glue/bin/pulseaudio | 30 | rename to glue/bin/pulseaudio |
227 | index 40c9a85..e966e92 100755 | |||
228 | --- a/bin/pulseaudio | |||
229 | +++ b/glue/bin/pulseaudio | |||
230 | @@ -2,14 +2,6 @@ | |||
231 | 2 | set -e | 2 | set -e |
232 | 3 | set -x | 3 | set -x |
233 | 4 | 4 | ||
234 | 5 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/usr/lib/pulseaudio:$SNAP/usr/lib/pulse-8.0/modules/ | ||
235 | 6 | export PULSE_RUNTIME_PATH=/var/run/pulse | ||
236 | 7 | export PULSE_STATE_PATH=$SNAP_DATA/state | ||
237 | 8 | export ALSA_CONFIG_UCM=$SNAP/usr/share/alsa/ucm | ||
238 | 9 | export ALSA_CONFIG_TPLG=$SNAP/usr/share/alsa/topology | ||
239 | 10 | export ALSA_CONFIG_PATH=$SNAP/usr/share/alsa/alsa.conf | ||
240 | 11 | export ALSA_MIXER_SIMPLE=$SNAP/usr/share/alsa/smixer.conf | ||
241 | 12 | |||
242 | 13 | mkdir -p $PULSE_STATE_PATH | 5 | mkdir -p $PULSE_STATE_PATH |
243 | 14 | 6 | ||
244 | 15 | EXTRA_ARGS= | 7 | EXTRA_ARGS= |
245 | @@ -19,12 +11,20 @@ if [ -e $SNAP_DATA/config/debug ] ; then | |||
246 | 19 | export LIBASOUND_DEBUG=1 | 11 | export LIBASOUND_DEBUG=1 |
247 | 20 | fi | 12 | fi |
248 | 21 | 13 | ||
249 | 14 | # on some hw, hw requires init steps before pulseaudio can be started | ||
250 | 15 | # as we do not have socket activated service yet, add optional delayed start | ||
251 | 16 | DELAY=$(snapctl get pulseaudio.delay-service) | ||
252 | 17 | if [ -n "${DELAY}" ]; then | ||
253 | 18 | # ignore any error is delay is boggus number | ||
254 | 19 | sleep ${DELAY} || true | ||
255 | 20 | fi | ||
256 | 21 | |||
257 | 22 | $SNAP/usr/bin/pulseaudio \ | 22 | $SNAP/usr/bin/pulseaudio \ |
258 | 23 | --exit-idle-time=-1 \ | 23 | --exit-idle-time=-1 \ |
259 | 24 | --disallow-exit=yes \ | 24 | --disallow-exit=yes \ |
260 | 25 | --disallow-module-loading \ | 25 | --disallow-module-loading \ |
261 | 26 | --system \ | 26 | --system \ |
264 | 27 | -F $SNAP/etc/pulse/default.pa \ | 27 | -F ${SNAP_DATA}/etc/pulse/default.pa \ |
265 | 28 | -p $SNAP/usr/lib/pulse-8.0/modules \ | 28 | -p ${SNAP}/usr/lib/pulse-8.0/modules \ |
266 | 29 | -n \ | 29 | -n \ |
267 | 30 | $EXTRA_ARGS | 30 | $EXTRA_ARGS |
268 | diff --git a/data/copyright b/glue/usr/share/doc/pulseaudio/copyright | |||
269 | 31 | similarity index 100% | 31 | similarity index 100% |
270 | 32 | rename from data/copyright | 32 | rename from data/copyright |
271 | 33 | rename to glue/usr/share/doc/pulseaudio/copyright | 33 | rename to glue/usr/share/doc/pulseaudio/copyright |
272 | diff --git a/pulseaudio-snap.patch b/pulseaudio-snap.patch | |||
273 | 34 | new file mode 100644 | 34 | new file mode 100644 |
274 | index 0000000..4ffbcdb | |||
275 | --- /dev/null | |||
276 | +++ b/pulseaudio-snap.patch | |||
277 | @@ -0,0 +1,89 @@ | |||
278 | 1 | From e0eaeecf7b028a238c9ba4c8fd15e794eaefc2af Mon Sep 17 00:00:00 2001 | ||
279 | 2 | From: Ondrej Kubik <ondrej.kubik@canonical.com> | ||
280 | 3 | Date: Fri, 14 Jun 2019 22:01:35 +0100 | ||
281 | 4 | Subject: [PATCH] xenial: snap: snap changes | ||
282 | 5 | |||
283 | 6 | Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com> | ||
284 | 7 | --- | ||
285 | 8 | configure.ac | 2 +- | ||
286 | 9 | src/daemon/main.c | 12 ++++++------ | ||
287 | 10 | src/modules/alsa/alsa-mixer.c | 6 ++++-- | ||
288 | 11 | 3 files changed, 11 insertions(+), 9 deletions(-) | ||
289 | 12 | |||
290 | 13 | diff --git a/configure.ac b/configure.ac | ||
291 | 14 | index 9250c05d..f8e7673c 100644 | ||
292 | 15 | --- a/configure.ac | ||
293 | 16 | +++ b/configure.ac | ||
294 | 17 | @@ -177,7 +177,7 @@ esac | ||
295 | 18 | #### Compiler flags #### | ||
296 | 19 | |||
297 | 20 | AX_APPEND_COMPILE_FLAGS( | ||
298 | 21 | - [-Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -fno-common -fdiagnostics-show-option -fdiagnostics-color=auto], | ||
299 | 22 | + [-Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -fno-common -fdiagnostics-show-option -fdiagnostics-color=auto -fomit-frame-pointer], | ||
300 | 23 | [], [-pedantic -Werror]) | ||
301 | 24 | |||
302 | 25 | AS_CASE([" $CFLAGS "], [*" -O0 "*], [], [ | ||
303 | 26 | diff --git a/src/daemon/main.c b/src/daemon/main.c | ||
304 | 27 | index c2f47b69..f4887554 100644 | ||
305 | 28 | --- a/src/daemon/main.c | ||
306 | 29 | +++ b/src/daemon/main.c | ||
307 | 30 | @@ -175,16 +175,16 @@ static int change_user(void) { | ||
308 | 31 | return -1; | ||
309 | 32 | } | ||
310 | 33 | |||
311 | 34 | - if (!pa_streq(pw->pw_dir, PA_SYSTEM_RUNTIME_PATH)) | ||
312 | 35 | - pa_log_warn(_("Home directory of user '%s' is not '%s', ignoring."), PA_SYSTEM_USER, PA_SYSTEM_RUNTIME_PATH); | ||
313 | 36 | + if (!pa_streq(pw->pw_dir, getenv("PULSE_RUNTIME_PATH"))) | ||
314 | 37 | + pa_log_warn(_("Home directory of user '%s' is not '%s', ignoring."), PA_SYSTEM_USER, getenv("PULSE_RUNTIME_PATH")); | ||
315 | 38 | |||
316 | 39 | - if (pa_make_secure_dir(PA_SYSTEM_RUNTIME_PATH, 0755, pw->pw_uid, gr->gr_gid, true) < 0) { | ||
317 | 40 | - pa_log(_("Failed to create '%s': %s"), PA_SYSTEM_RUNTIME_PATH, pa_cstrerror(errno)); | ||
318 | 41 | + if (pa_make_secure_dir(getenv("PULSE_RUNTIME_PATH"), 0755, pw->pw_uid, gr->gr_gid, true) < 0) { | ||
319 | 42 | + pa_log(_("Failed to create '%s': %s"), getenv("PULSE_RUNTIME_PATH"), pa_cstrerror(errno)); | ||
320 | 43 | return -1; | ||
321 | 44 | } | ||
322 | 45 | |||
323 | 46 | - if (pa_make_secure_dir(PA_SYSTEM_STATE_PATH, 0700, pw->pw_uid, gr->gr_gid, true) < 0) { | ||
324 | 47 | - pa_log(_("Failed to create '%s': %s"), PA_SYSTEM_STATE_PATH, pa_cstrerror(errno)); | ||
325 | 48 | + if (pa_make_secure_dir(getenv("PULSE_STATE_PATH"), 0700, pw->pw_uid, gr->gr_gid, true) < 0) { | ||
326 | 49 | + pa_log(_("Failed to create '%s': %s"), getenv("PULSE_STATE_PATH"), pa_cstrerror(errno)); | ||
327 | 50 | return -1; | ||
328 | 51 | } | ||
329 | 52 | |||
330 | 53 | diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c | ||
331 | 54 | index 1fe2a024..4cbc8277 100644 | ||
332 | 55 | --- a/src/modules/alsa/alsa-mixer.c | ||
333 | 56 | +++ b/src/modules/alsa/alsa-mixer.c | ||
334 | 57 | @@ -2529,10 +2529,11 @@ static int path_verify(pa_alsa_path *p) { | ||
335 | 58 | } | ||
336 | 59 | |||
337 | 60 | static const char *get_default_paths_dir(void) { | ||
338 | 61 | + const char *alsa_paths_dir = getenv("PULSE_ALSA_PATHS_DIR"); | ||
339 | 62 | if (pa_run_from_build_tree()) | ||
340 | 63 | return PA_SRCDIR "/modules/alsa/mixer/paths/"; | ||
341 | 64 | else | ||
342 | 65 | - return PA_ALSA_PATHS_DIR; | ||
343 | 66 | + return alsa_paths_dir ? alsa_paths_dir : PA_ALSA_PATHS_DIR; | ||
344 | 67 | } | ||
345 | 68 | |||
346 | 69 | pa_alsa_path* pa_alsa_path_new(const char *paths_dir, const char *fname, pa_alsa_direction_t direction) { | ||
347 | 70 | @@ -4365,6 +4366,7 @@ pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel | ||
348 | 71 | char *fn; | ||
349 | 72 | int r; | ||
350 | 73 | void *state; | ||
351 | 74 | + const char *alsa_profile_sets_dir = getenv("PULSE_ALSA_PROFILE_SETS_DIR"); | ||
352 | 75 | |||
353 | 76 | static pa_config_item items[] = { | ||
354 | 77 | /* [General] */ | ||
355 | 78 | @@ -4409,7 +4411,7 @@ pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel | ||
356 | 79 | |||
357 | 80 | fn = pa_maybe_prefix_path(fname, | ||
358 | 81 | pa_run_from_build_tree() ? PA_SRCDIR "/modules/alsa/mixer/profile-sets/" : | ||
359 | 82 | - PA_ALSA_PROFILE_SETS_DIR); | ||
360 | 83 | + alsa_profile_sets_dir ? alsa_profile_sets_dir : PA_ALSA_PROFILE_SETS_DIR); | ||
361 | 84 | |||
362 | 85 | r = pa_config_parse(fn, NULL, items, NULL, false, ps); | ||
363 | 86 | pa_xfree(fn); | ||
364 | 87 | -- | ||
365 | 88 | 2.20.1 | ||
366 | 89 | |||
367 | diff --git a/quiltrc b/quiltrc | |||
368 | 0 | new file mode 100644 | 90 | new file mode 100644 |
369 | index 0000000..f2568ce | |||
370 | --- /dev/null | |||
371 | +++ b/quiltrc | |||
372 | @@ -0,0 +1,6 @@ | |||
373 | 1 | for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do | ||
374 | 2 | if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then | ||
375 | 3 | export QUILT_PATCHES=debian/patches | ||
376 | 4 | break | ||
377 | 5 | fi | ||
378 | 6 | done | ||
379 | diff --git a/snap/hooks/configure b/snap/hooks/configure | |||
380 | 0 | new file mode 100755 | 7 | new file mode 100755 |
381 | index 0000000..844be89 | |||
382 | --- /dev/null | |||
383 | +++ b/snap/hooks/configure | |||
384 | @@ -0,0 +1,201 @@ | |||
385 | 1 | #!/bin/bash | ||
386 | 2 | # | ||
387 | 3 | # Copyright (C) 2016 Canonical Ltd | ||
388 | 4 | # | ||
389 | 5 | # This program is free software: you can redistribute it and/or modify | ||
390 | 6 | # it under the terms of the GNU General Public License version 3 as | ||
391 | 7 | # published by the Free Software Foundation. | ||
392 | 8 | # | ||
393 | 9 | # This program is distributed in the hope that it will be useful, | ||
394 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
395 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
396 | 12 | # GNU General Public License for more details. | ||
397 | 13 | # | ||
398 | 14 | # You should have received a copy of the GNU General Public License | ||
399 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
400 | 16 | |||
401 | 17 | if [ -e $SNAP_DATA/config/debug ] ; then | ||
402 | 18 | DEBUG=1 | ||
403 | 19 | set -x | ||
404 | 20 | fi | ||
405 | 21 | |||
406 | 22 | exec >> $SNAP_COMMON/hook.log 2>&1 | ||
407 | 23 | echo "$(date '+%Y-%m-%d %H:%M:%S') $(basename $0): Entering hook" | ||
408 | 24 | |||
409 | 25 | # traverse in three directories | ||
410 | 26 | # -etc/pulse | ||
411 | 27 | # -usr/share/alsa | ||
412 | 28 | # -usr/share/pulseaudio | ||
413 | 29 | # when file config is reached, it has three values, filaname, remove and add | ||
414 | 30 | # - filename: is relative file path, without $SNAP_DATA part | ||
415 | 31 | # - remove: list of strings to be removed from given file | ||
416 | 32 | # this can be multi line value, each line is process separatelly | ||
417 | 33 | # - add: list of strings to be appended to given file | ||
418 | 34 | # this could be multi line value, all lines are appended to config file | ||
419 | 35 | # - replace: list of pairs match replace values, values on separate lines | ||
420 | 36 | # at least two lines needed match <> replace | ||
421 | 37 | # | ||
422 | 38 | # example: | ||
423 | 39 | # snap set pulseaudio etc.pulse.default-pa='{"filename": "etc/pulse/default.pa", "remove": "", "add": "load-module module-alsa-sink device=hw:0,0\nload-module module-alsa-source device=hw:0,1"}' | ||
424 | 40 | # snap set pulseaudio etc.pulse='{"daemon-conf": { "filename": "etc/pulse/daemon.conf", "remove": "", "add": "" }, "default-pa": { "filename": "etc/pulse/default.pa", "remove": "", "add": "load-module module-alsa-sink device=hw:0,0\nload-module module-alsa-source device=hw:0,1"}' | ||
425 | 41 | # snap set pulseaudio etc.pulse='{"daemon-conf": { "filename": "etc/pulse/daemon.conf", "remove": "", "add": "" }, "default-pa": { "filename": "etc/pulse/default.pa", "remove": "load-module module-alsa-sink device=.*\nload-module module-alsa-source device=.*", "add": "load-module module-alsa-sink device=hw:0,0\nload-module module-alsa-source device=hw:0,1"}}' | ||
426 | 42 | # snap set pulseaudio etc.pulse.default-pa='{"filename": "etc/pulse/default.pa", "replace": ".*load-module module-alsa-sink.*\nload-module module-alsa-sink device=hw:0,0\n.*load-module module-alsa-source.*\nload-module module-alsa-source device=hw:0,1"}' | ||
427 | 43 | # providing way to alter configuration files through snap set command | ||
428 | 44 | # not full example of supported config options | ||
429 | 45 | # { | ||
430 | 46 | # "etc": { | ||
431 | 47 | # "pulse": { | ||
432 | 48 | # "client-conf": { | ||
433 | 49 | # "filename": "etc/pulse/client.conf", | ||
434 | 50 | # "replace": "" | ||
435 | 51 | # "remove": "", | ||
436 | 52 | # "add": "" | ||
437 | 53 | # }, | ||
438 | 54 | # "daemon-conf": { | ||
439 | 55 | # "filename": "etc/pulse/daemon.conf", | ||
440 | 56 | # "remove": "", | ||
441 | 57 | # "add": "" | ||
442 | 58 | # }, | ||
443 | 59 | # "default-pa": { | ||
444 | 60 | # "filename": "etc/pulse/default.pa", | ||
445 | 61 | # "replace": ".*load-module module-alsa-sink.*\nload-module module-alsa-sink device=hw:0,0\n.*load-module module-alsa-source.*\nload-module module-alsa-source device=hw:0,1", | ||
446 | 62 | # "remove": "load-module module-alsa-sink device=.*\nload-module module-alsa-source device=.*", | ||
447 | 63 | # "add": "load-module module-alsa-sink device=hw:0,0\nload-module module-alsa-source device=hw:0,1" | ||
448 | 64 | # }, | ||
449 | 65 | # "system-pa": { | ||
450 | 66 | # "filename": "etc/pulse/system.pa", | ||
451 | 67 | # "remove": "", | ||
452 | 68 | # "add": "" | ||
453 | 69 | # } | ||
454 | 70 | # } | ||
455 | 71 | # }, | ||
456 | 72 | # "usr": { | ||
457 | 73 | # "share": { | ||
458 | 74 | # "alsa": { | ||
459 | 75 | # "alsa-conf": { | ||
460 | 76 | # "filename": "usr/share/alsa/alsa.conf", | ||
461 | 77 | # "remove": "", | ||
462 | 78 | # "add": "" | ||
463 | 79 | # }, | ||
464 | 80 | # "topology": { | ||
465 | 81 | # "broadwell": { | ||
466 | 82 | # "filename": "usr/share/alsa/topology/broadwell/broadwell.conf", | ||
467 | 83 | # "remove": "", | ||
468 | 84 | # "add": "" | ||
469 | 85 | # } | ||
470 | 86 | # } | ||
471 | 87 | # }, | ||
472 | 88 | # "pulseaudio": { | ||
473 | 89 | # "alsa-mixer": { | ||
474 | 90 | # "paths": { | ||
475 | 91 | # "analog-output-conf": { | ||
476 | 92 | # "filename": "usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf", | ||
477 | 93 | # "remove": "", | ||
478 | 94 | # "add": "" | ||
479 | 95 | # } | ||
480 | 96 | # }, | ||
481 | 97 | # "profile-sets": { | ||
482 | 98 | # "default-conf": { | ||
483 | 99 | # "filename": "usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf", | ||
484 | 100 | # "remove": "", | ||
485 | 101 | # "add": "" | ||
486 | 102 | # } | ||
487 | 103 | # } | ||
488 | 104 | # } | ||
489 | 105 | # } | ||
490 | 106 | # } | ||
491 | 107 | # } | ||
492 | 108 | # } | ||
493 | 109 | |||
494 | 110 | process_file_remove() { | ||
495 | 111 | filename="${1}" | ||
496 | 112 | shift | ||
497 | 113 | remove="${@}" | ||
498 | 114 | if [ -n "${remove}" ]; then | ||
499 | 115 | # remove all matching lines from config, there could be more patterns, process by lines | ||
500 | 116 | while read -r line | ||
501 | 117 | do | ||
502 | 118 | if [ -n "${line}" ]; then | ||
503 | 119 | echo "removing from [${filename}] strings [$line]" | ||
504 | 120 | sed -i "s/$(echo ${line} | sed -e 's/\\/\\\\/g; s/\//\\\//g; s/&/\\\&/g')//g" ${SNAP_DATA}/${filename} | ||
505 | 121 | fi | ||
506 | 122 | done < <(echo "${remove}") | ||
507 | 123 | fi | ||
508 | 124 | } | ||
509 | 125 | |||
510 | 126 | process_file_add() { | ||
511 | 127 | filename="${1}" | ||
512 | 128 | shift | ||
513 | 129 | add="${@}" | ||
514 | 130 | if [ -n "${add}" ]; then | ||
515 | 131 | echo "adding from [${filename}] strings [$add]" | ||
516 | 132 | [ "${DEBUG}" = "1" ] && echo -e "\n# start: added by snap configure" >> ${SNAP_DATA}/${filename} | ||
517 | 133 | echo "${add}" >> ${SNAP_DATA}/${filename} | ||
518 | 134 | [ "${DEBUG}" = "1" ] && echo -e "# end: added by snap configure" >> ${SNAP_DATA}/${filename} | ||
519 | 135 | fi | ||
520 | 136 | } | ||
521 | 137 | |||
522 | 138 | process_file_replace() { | ||
523 | 139 | filename="${1}" | ||
524 | 140 | shift | ||
525 | 141 | if [ -n "${@}" ]; then | ||
526 | 142 | # we need to process two lines at the time, first line is match, following line is replacing value | ||
527 | 143 | while read -r match | ||
528 | 144 | do | ||
529 | 145 | read -r replace | ||
530 | 146 | if [ -n "${match}" ] && [ -n "${replace}" ]; then | ||
531 | 147 | echo "replace from [${filename}] string [${match}] with [${replace}]" | ||
532 | 148 | sed -i "s/$(echo ${match} | sed -e 's/\\/\\\\/g; s/\//\\\//g; s/&/\\\&/g')/$(echo ${replace} | sed -e 's/\\/\\\\/g; s/\//\\\//g; s/&/\\\&/g')/g" ${SNAP_DATA}/${filename} | ||
533 | 149 | fi | ||
534 | 150 | done < <(echo "${@}") | ||
535 | 151 | fi | ||
536 | 152 | } | ||
537 | 153 | |||
538 | 154 | process_line() { | ||
539 | 155 | [ "${DEBUG}" = "1" ] && echo "process_line << $@" | ||
540 | 156 | # each line starts with key name and end with variable | ||
541 | 157 | local key=$1 | ||
542 | 158 | shift | ||
543 | 159 | # check if we have valid json in first place | ||
544 | 160 | if ! jq -e . >/dev/null 2>&1 <<<"$@"; then | ||
545 | 161 | type -p handle_key_value && handle_key_value ${key} $@ | ||
546 | 162 | return | ||
547 | 163 | fi | ||
548 | 164 | filename=$(echo $@ | jq -r '.filename') | ||
549 | 165 | # if we have filename, no need to traverse further | ||
550 | 166 | if [ "${filename}" == "null" ]; then | ||
551 | 167 | type -p processing_top_key_start && processing_top_key_start ${key} | ||
552 | 168 | while read -r line | ||
553 | 169 | do | ||
554 | 170 | process_line ${key}.${line} | ||
555 | 171 | done < <(echo "$@" | jq -r 'keys[] as $k | "\($k) \(.[$k] )"') | ||
556 | 172 | type -p processing_top_key_end && processing_top_key_end ${key} | ||
557 | 173 | else | ||
558 | 174 | ADD=$(echo $@ | jq -r '.add') | ||
559 | 175 | [ "${ADD}" == "null" ] && ADD="" | ||
560 | 176 | REMOVE=$(echo $@ | jq -r '.remove') | ||
561 | 177 | [ "${REMOVE}" == "null" ] && REMOVE="" | ||
562 | 178 | REPLACE=$(echo $@ | jq -r '.replace') | ||
563 | 179 | [ "${REPLACE}" == "null" ] && REPLACE="" | ||
564 | 180 | type -p process_file_replace && process_file_replace "${filename}" "${REPLACE}" | ||
565 | 181 | type -p process_file_remove && process_file_remove "${filename}" "${REMOVE}" | ||
566 | 182 | type -p process_file_add && process_file_add "${filename}" "${ADD}" | ||
567 | 183 | fi | ||
568 | 184 | } | ||
569 | 185 | |||
570 | 186 | CONFIGURATION="etc usr" | ||
571 | 187 | |||
572 | 188 | echo "Process config changes" | ||
573 | 189 | |||
574 | 190 | for conf in $CONFIGURATION | ||
575 | 191 | do | ||
576 | 192 | [ "${DEBUG}" = "1" ] && echo "processing: ${conf}" | ||
577 | 193 | # only process if we get valid json | ||
578 | 194 | key_val=$(snapctl get -d "${conf}") | ||
579 | 195 | if jq -e . >/dev/null 2>&1 <<<"${key_val}"; then | ||
580 | 196 | process_line $(jq -r 'keys[] as $k | "\($k) \(.[$k] )"' <<< $(snapctl get -d ${conf})) | ||
581 | 197 | fi | ||
582 | 198 | done | ||
583 | 199 | |||
584 | 200 | # restart pulse service | ||
585 | 201 | snapctl restart ${SNAP_INSTANCE_NAME}.pulseaudio | ||
586 | diff --git a/snap/hooks/install b/snap/hooks/install | |||
587 | 0 | new file mode 100755 | 202 | new file mode 100755 |
588 | index 0000000..db735a4 | |||
589 | --- /dev/null | |||
590 | +++ b/snap/hooks/install | |||
591 | @@ -0,0 +1,29 @@ | |||
592 | 1 | #!/bin/bash | ||
593 | 2 | |||
594 | 3 | # | ||
595 | 4 | # Copyright (C) 2016 Canonical Ltd | ||
596 | 5 | # | ||
597 | 6 | # This program is free software: you can redistribute it and/or modify | ||
598 | 7 | # it under the terms of the GNU General Public License version 3 as | ||
599 | 8 | # published by the Free Software Foundation. | ||
600 | 9 | # | ||
601 | 10 | # This program is distributed in the hope that it will be useful, | ||
602 | 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
603 | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
604 | 13 | # GNU General Public License for more details. | ||
605 | 14 | # | ||
606 | 15 | # You should have received a copy of the GNU General Public License | ||
607 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
608 | 17 | |||
609 | 18 | set -x | ||
610 | 19 | exec >> $SNAP_COMMON/hook.log 2>&1 | ||
611 | 20 | echo "$(date '+%Y-%m-%d %H:%M:%S') $(basename $0): Entering hook" | ||
612 | 21 | |||
613 | 22 | # copy initial client configuration | ||
614 | 23 | mkdir -p ${SNAP_DATA}/var/lib/pulse | ||
615 | 24 | mkdir -p ${SNAP_DATA}/etc | ||
616 | 25 | mkdir -p ${SNAP_DATA}/usr/share | ||
617 | 26 | |||
618 | 27 | cp -r ${SNAP}/etc/pulse ${SNAP_DATA}/etc | ||
619 | 28 | cp -r ${SNAP}/usr/share/alsa ${SNAP_DATA}/usr/share | ||
620 | 29 | cp -r ${SNAP}/usr/share/pulseaudio ${SNAP_DATA}/usr/share | ||
621 | diff --git a/snap/hooks/post-refresh b/snap/hooks/post-refresh | |||
622 | 0 | new file mode 100755 | 30 | new file mode 100755 |
623 | index 0000000..83eecc4 | |||
624 | --- /dev/null | |||
625 | +++ b/snap/hooks/post-refresh | |||
626 | @@ -0,0 +1,33 @@ | |||
627 | 1 | #!/bin/bash | ||
628 | 2 | # | ||
629 | 3 | # Copyright (C) 2016 Canonical Ltd | ||
630 | 4 | # | ||
631 | 5 | # This program is free software: you can redistribute it and/or modify | ||
632 | 6 | # it under the terms of the GNU General Public License version 3 as | ||
633 | 7 | # published by the Free Software Foundation. | ||
634 | 8 | # | ||
635 | 9 | # This program is distributed in the hope that it will be useful, | ||
636 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
637 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
638 | 12 | # GNU General Public License for more details. | ||
639 | 13 | # | ||
640 | 14 | # You should have received a copy of the GNU General Public License | ||
641 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
642 | 16 | |||
643 | 17 | set -x | ||
644 | 18 | exec >> ${SNAP_COMMON}/hook.log 2>&1 | ||
645 | 19 | echo "$(date '+%Y-%m-%d %H:%M:%S') $(basename $0): Entering hook" | ||
646 | 20 | |||
647 | 21 | # make sure we have initial configuration handy | ||
648 | 22 | mkdir -p ${SNAP_DATA}/var/lib/pulse | ||
649 | 23 | mkdir -p ${SNAP_DATA}/etc | ||
650 | 24 | mkdir -p ${SNAP_DATA}/usr/share | ||
651 | 25 | |||
652 | 26 | cp -r -n ${SNAP}/etc/pulse ${SNAP_DATA}/etc | ||
653 | 27 | cp -r -n ${SNAP}/usr/share/alsa ${SNAP_DATA}/usr/share | ||
654 | 28 | cp -r -n ${SNAP}/usr/share/pulseaudio ${SNAP_DATA}/usr/share | ||
655 | 29 | |||
656 | 30 | # clean snapctl as we cannot do it from configure hooks | ||
657 | 31 | # so we not repeaase same steps again | ||
658 | 32 | snapctl set env="" | ||
659 | 33 | snapctl set usr="" | ||
660 | diff --git a/snapcraft.yaml b/snap/snapcraft.yaml | |||
661 | 0 | similarity index 50% | 34 | similarity index 50% |
662 | 1 | rename from snapcraft.yaml | 35 | rename from snapcraft.yaml |
663 | 2 | rename to snap/snapcraft.yaml | 36 | rename to snap/snapcraft.yaml |
664 | index 605243c..172eaa1 100644 | |||
665 | --- a/snapcraft.yaml | |||
666 | +++ b/snap/snapcraft.yaml | |||
667 | @@ -1,5 +1,4 @@ | |||
668 | 1 | name: pulseaudio | 1 | name: pulseaudio |
669 | 2 | version: 8.0-4 | ||
670 | 3 | summary: PulseAudio sound server | 2 | summary: PulseAudio sound server |
671 | 4 | description: | | 3 | description: | |
672 | 5 | PulseAudio, previously known as Polypaudio, is a sound server for POSIX and | 4 | PulseAudio, previously known as Polypaudio, is a sound server for POSIX and |
673 | @@ -10,27 +9,62 @@ description: | | |||
674 | 10 | https://code.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio | 9 | https://code.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio |
675 | 11 | grade: stable | 10 | grade: stable |
676 | 12 | confinement: strict | 11 | confinement: strict |
677 | 12 | adopt-info: pulseaudio | ||
678 | 13 | base: core | ||
679 | 14 | |||
680 | 15 | environment: | ||
681 | 16 | PATH: ${SNAP}/usr/sbin:${SNAP}/usr/bin:${SNAP}/sbin:${SNAP}/bin:${PATH} | ||
682 | 17 | LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}:${SNAP}/usr/lib/pulseaudio:${SNAP}/usr/lib/pulse-8.0/modules/:${SNAP}/lib:${SNAP}/usr/lib:${SNAP}/lib/${SNAPCRAFT_ARCH_TRIPLET}:${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET} | ||
683 | 18 | PULSE_DLPATH: ${SNAP}/usr/lib/pulse-8.0/modules | ||
684 | 19 | PULSE_CLIENTCONFIG: ${SNAP_DATA}/etc/pulse/client.conf | ||
685 | 20 | PULSE_RUNTIME_PATH: /var/run/pulse | ||
686 | 21 | PULSE_SYSTEM: 1 | ||
687 | 22 | PULSE_STATE_PATH: ${SNAP_DATA}/state | ||
688 | 23 | PULSE_SCRIPT: ${SNAP_DATA}/etc/pulse/default.pa | ||
689 | 24 | PULSE_CONFIG: ${SNAP_DATA}/etc/pulse/daemon.conf | ||
690 | 25 | PULSE_CONFIG_PATH: ${SNAP_DATA}/var/lib/pulse | ||
691 | 26 | PULSE_ALSA_PATHS_DIR: ${SNAP_DATA}/usr/share/pulseaudio/alsa-mixer | ||
692 | 27 | ALSA_CONFIG_UCM: ${SNAP_DATA}/usr/share/alsa/ucm | ||
693 | 28 | ALSA_CONFIG_TPLG: ${SNAP_DATA}/usr/share/alsa/topology | ||
694 | 29 | ALSA_CONFIG_PATH: ${SNAP_DATA}/usr/share/alsa/alsa.conf | ||
695 | 30 | ALSA_MIXER_SIMPLE: ${SNAP_DATA}/usr/share/alsa/smixer.conf | ||
696 | 31 | ALSA_CONFIG_DIR: ${SNAP_DATA}/usr/share/alsa/ | ||
697 | 32 | ALSA_CONFIG_UCM_VAR: ${SNAP_DATA}/usr/share/alsa/ucm | ||
698 | 33 | ALSA_CONFIG_TPLG_VAR: ${SNAP_DATA}/usr/share/alsa/topology | ||
699 | 34 | ALSA_PLUGIN_DIR: ${SNAP}/usr/lib/alsa-lib | ||
700 | 35 | ALSA_MIXER_SIMPLE_MODULES: ${SNAP}/usr/lib/alsa-lib/smixer | ||
701 | 36 | ALSA_MIXER_SIMPLE_MPYTHON: ${SNAP}/usr/lib/alsa-lib/smixer/python/main.py | ||
702 | 13 | 37 | ||
703 | 14 | apps: | 38 | apps: |
704 | 15 | pulseaudio: | 39 | pulseaudio: |
705 | 16 | command: bin/pulseaudio | 40 | command: bin/pulseaudio |
706 | 17 | daemon: simple | 41 | daemon: simple |
708 | 18 | slots: [service] | 42 | slots: |
709 | 43 | - service | ||
710 | 44 | plugs: | ||
711 | 45 | - network | ||
712 | 46 | - network-bind | ||
713 | 47 | |||
714 | 19 | pactl: | 48 | pactl: |
715 | 20 | command: bin/client-wrapper usr/bin/pactl | 49 | command: bin/client-wrapper usr/bin/pactl |
719 | 21 | plugs: [client, network] | 50 | plugs: |
720 | 22 | aliases: | 51 | - client |
721 | 23 | - pactl | 52 | - network |
722 | 53 | |||
723 | 24 | paplay: | 54 | paplay: |
724 | 25 | command: bin/client-wrapper usr/bin/paplay | 55 | command: bin/client-wrapper usr/bin/paplay |
728 | 26 | plugs: [client, home, network] | 56 | plugs: |
729 | 27 | aliases: | 57 | - client |
730 | 28 | - paplay | 58 | - home |
731 | 59 | - network | ||
732 | 60 | |||
733 | 29 | parec: | 61 | parec: |
734 | 30 | command: bin/client-wrapper usr/bin/parec | 62 | command: bin/client-wrapper usr/bin/parec |
738 | 31 | plugs: [client, home, network] | 63 | plugs: |
739 | 32 | aliases: | 64 | - client |
740 | 33 | - parec | 65 | - home |
741 | 66 | - network | ||
742 | 67 | |||
743 | 34 | config: | 68 | config: |
744 | 35 | command: bin/config | 69 | command: bin/config |
745 | 36 | 70 | ||
746 | @@ -43,21 +77,21 @@ plugs: | |||
747 | 43 | interface: pulseaudio | 77 | interface: pulseaudio |
748 | 44 | 78 | ||
749 | 45 | parts: | 79 | parts: |
757 | 46 | pulseaudio-common: | 80 | glue: |
758 | 47 | plugin: copy | 81 | plugin: dump |
759 | 48 | files: | 82 | source: glue |
753 | 49 | bin/pulseaudio: bin/pulseaudio | ||
754 | 50 | bin/client-wrapper: bin/client-wrapper | ||
755 | 51 | bin/config: bin/config | ||
756 | 52 | data/copyright: usr/share/doc/pulseaudio/copyright | ||
760 | 53 | 83 | ||
761 | 54 | alsa-lib: | 84 | alsa-lib: |
762 | 55 | plugin: autotools | 85 | plugin: autotools |
765 | 56 | 86 | source: https://git.launchpad.net/ubuntu/+source/alsa-lib | |
764 | 57 | source: https://git.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio | ||
766 | 58 | source-type: git | 87 | source-type: git |
769 | 59 | source-branch: alsa-lib/xenial/1.1.0 | 88 | source-branch: ubuntu/xenial |
770 | 60 | 89 | override-pull: | | |
771 | 90 | snapcraftctl pull | ||
772 | 91 | rm -rf manual | ||
773 | 92 | [ -z "${SNAPCRAFT_PROJECT_DIR}" ] && SNAPCRAFT_PROJECT_DIR="../../.." | ||
774 | 93 | quilt push -afq --leave-rejects --quiltrc=${SNAPCRAFT_PROJECT_DIR}/quiltrc | ||
775 | 94 | git apply ${SNAPCRAFT_PROJECT_DIR}/alsa-lib-snap.patch | ||
776 | 61 | configflags: | 95 | configflags: |
777 | 62 | - --prefix=/usr | 96 | - --prefix=/usr |
778 | 63 | - --sysconfdir=/etc | 97 | - --sysconfdir=/etc |
779 | @@ -68,27 +102,26 @@ parts: | |||
780 | 68 | - --disable-silent-rules | 102 | - --disable-silent-rules |
781 | 69 | - --disable-static | 103 | - --disable-static |
782 | 70 | - --disable-python | 104 | - --disable-python |
792 | 71 | 105 | stage: | |
793 | 72 | filesets: | 106 | - usr/lib/libasound.so* |
794 | 73 | libasound2: | 107 | - usr/lib/alsa-lib |
795 | 74 | - usr/lib/libasound.so* | 108 | - usr/share/alsa |
787 | 75 | - usr/lib/alsa-lib/* | ||
788 | 76 | - usr/share/alsa/* | ||
789 | 77 | |||
790 | 78 | snap: | ||
791 | 79 | - $libasound2 | ||
796 | 80 | 109 | ||
797 | 81 | 110 | ||
798 | 82 | pulseaudio: | 111 | pulseaudio: |
799 | 83 | after: | 112 | after: |
800 | 84 | - alsa-lib | 113 | - alsa-lib |
801 | 85 | |||
802 | 86 | plugin: autotools | 114 | plugin: autotools |
805 | 87 | 115 | source: https://git.launchpad.net/ubuntu/+source/pulseaudio | |
804 | 88 | source: https://git.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio | ||
806 | 89 | source-type: git | 116 | source-type: git |
809 | 90 | source-branch: pulseaudio/8.0 | 117 | source-branch: ubuntu/xenial |
810 | 91 | 118 | override-pull: | | |
811 | 119 | snapcraftctl pull | ||
812 | 120 | snapcraftctl set-version $(git describe --tags | cut -c 19-) | ||
813 | 121 | rm -rf manual | ||
814 | 122 | [ -z "${SNAPCRAFT_PROJECT_DIR}" ] && SNAPCRAFT_PROJECT_DIR="../../.." | ||
815 | 123 | quilt push -afq --leave-rejects --quiltrc=../../../quiltrc | ||
816 | 124 | git apply ${SNAPCRAFT_PROJECT_DIR}/pulseaudio-snap.patch | ||
817 | 92 | build-packages: | 125 | build-packages: |
818 | 93 | - intltool | 126 | - intltool |
819 | 94 | - libasound2-dev | 127 | - libasound2-dev |
820 | @@ -106,7 +139,8 @@ parts: | |||
821 | 106 | - libudev-dev | 139 | - libudev-dev |
822 | 107 | - libasyncns-dev | 140 | - libasyncns-dev |
823 | 108 | - libxcb1-dev | 141 | - libxcb1-dev |
825 | 109 | 142 | - libsbc-dev | |
826 | 143 | - quilt | ||
827 | 110 | configflags: | 144 | configflags: |
828 | 111 | - --prefix=/usr | 145 | - --prefix=/usr |
829 | 112 | - --sysconfdir=/etc | 146 | - --sysconfdir=/etc |
830 | @@ -133,22 +167,44 @@ parts: | |||
831 | 133 | - --disable-x11 | 167 | - --disable-x11 |
832 | 134 | - --with-system-user=root | 168 | - --with-system-user=root |
833 | 135 | - --with-system-group=root | 169 | - --with-system-group=root |
853 | 136 | 170 | stage-packages: | |
854 | 137 | filesets: | 171 | - libavahi-client3 |
855 | 138 | wanted: | 172 | - libavahi-common3 |
856 | 139 | - etc/* | 173 | - libasyncns0 |
857 | 140 | - lib/* | 174 | - libflac8 |
858 | 141 | - usr/bin/pacat | 175 | - libltdl7 |
859 | 142 | - usr/bin/pactl | 176 | - libtdb1 |
860 | 143 | - usr/bin/paplay | 177 | - libogg0 |
861 | 144 | - usr/bin/parec | 178 | - libsndfile1 |
862 | 145 | - usr/bin/pulseaudio | 179 | - libspeexdsp1 |
863 | 146 | - usr/lib/libpulse-mainloop-glib.so* | 180 | - libvorbis0a |
864 | 147 | - usr/lib/libpulse-simple.so* | 181 | - libvorbisenc2 |
865 | 148 | - usr/lib/libpulse.so* | 182 | - libxcb1 |
866 | 149 | - usr/lib/pulse-8.0/* | 183 | - liborc-0.4-0 |
867 | 150 | - usr/lib/pulseaudio/*.so | 184 | - libxdmcp6 |
868 | 151 | - usr/share/pulseaudio/* | 185 | - libxau6 |
869 | 152 | 186 | - libsbc1 | |
870 | 153 | snap: | 187 | - jq |
871 | 154 | - $wanted | 188 | stage: |
872 | 189 | - etc | ||
873 | 190 | - lib | ||
874 | 191 | - usr/bin/pacat | ||
875 | 192 | - usr/bin/pactl | ||
876 | 193 | - usr/bin/paplay | ||
877 | 194 | - usr/bin/parec | ||
878 | 195 | - usr/bin/pulseaudio | ||
879 | 196 | - usr/bin/jq | ||
880 | 197 | - usr/lib | ||
881 | 198 | - usr/share/pulseaudio | ||
882 | 199 | |||
883 | 200 | # part to simulate pulseaudio and alsa dependencies, to trigger auto builds | ||
884 | 201 | # as we build from source,we don't actually consume binaries | ||
885 | 202 | dummy-pulse: | ||
886 | 203 | plugin: nil | ||
887 | 204 | stage-packages: | ||
888 | 205 | - pulseaudio | ||
889 | 206 | - libasound2 | ||
890 | 207 | stage: | ||
891 | 208 | - -* | ||
892 | 209 | prime: | ||
893 | 210 | - -* |
PASSED: Successfully build documentation, rev: 4a74ba660a7c2d7 d7923f471607cc3 4fef7fb288
Generated documentation is available at https:/ /jenkins. canonical. com/system- enablement/ job/snappy- hwe-snaps- snap-docs/ 1268/