File: on_update.sh

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (103 lines) | stat: -rwxr-xr-x 3,453 bytes parent folder | download | duplicates (5)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env bash
# Copyright 2025 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

set -euox pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

pushd "$SCRIPT_DIR/src"

TMP_DIR=$(mktemp -d)

meson setup \
    --prefix=/usr\
    --datadir=/usr/share\
    -Dxwayland=false\
    -Dx11=false\
    -Dremote_desktop=false\
    -Dlibgnome_desktop=false\
    -Dlibwacom=false\
    -Dsound_player=false\
    -Dsm=false\
    -Dintrospection=false\
    -Dcogl_tests=false\
    -Dclutter_tests=false\
    -Dmutter_tests=false\
    -Dtests=disabled\
    -Dprofiler=false\
    -Dinstalled_tests=false\
    -Dfonts=false\
    "$TMP_DIR"

meson compile -C "$TMP_DIR" mutter

# copy generated the toplevel config.h file
cp "$TMP_DIR/config.h" ../include/

# override the hard-coded absolute plugin path and set it to "." with the
# assumption that mutter will be run from the output directory where the plugin
# libdefault.so should be found
sed -i 's/#define MUTTER_PLUGIN_DIR.*/#define MUTTER_PLUGIN_DIR "."/'\
  ../include/config.h

# copy generated cogl headers
find "$TMP_DIR/cogl" -name '*.h' -printf '%P\n' |
  rsync --no-relative --dirs  --files-from=- "$TMP_DIR/cogl/" ../include/cogl/

# generate clutter headers
find "$TMP_DIR/clutter" -name '*.h' -printf '%P\n' | while read -r file; do
  # ensure no absolute path
  sed -i 's|(.*/third_party/mutter/src/\(.*\)|(\1|' "$TMP_DIR/clutter/$file"
  # replace references to clutter/clutter/ with clutter
  sed -i 's|clutter/clutter/|clutter/|' "$TMP_DIR/clutter/$file"
  echo "$file"
done | rsync --no-relative --dirs --files-from=- "$TMP_DIR/clutter/" \
  ../include/clutter/

# copy other headers excluding dbus
find "$TMP_DIR/src" -name 'meta-dbus*' -prune -o -name '*-protocol.*' \
  -prune -o -name '*.h' -printf '%P\n' |
  rsync -R --files-from=- "$TMP_DIR/src/" ../include/

# copy cogl genereated .c files
find "$TMP_DIR/cogl" -name '*.c' -printf '%P\n' | while read -r file; do
  # ensure no absolute path
  sed -i 's|"[^"]*/third_party/mutter/src/\([^"]*\)"|"\1"|' \
    "$TMP_DIR/cogl/$file"
  # replace references to cogl/cogl/ with cogl
  sed -i 's|cogl/cogl/|cogl/|' "$TMP_DIR/cogl/$file"
  echo "$file"
done | rsync --no-relative --dirs --files-from=- $TMP_DIR/cogl/ ../cogl/

# copy clutter genereated .c files
find $TMP_DIR/clutter -name '*.c' -printf '%P\n' | while read -r file; do
  # ensure no absolute path
  sed -i 's|"[^"]*/third_party/mutter/src/\([^"]*\)"|"\1"|' \
    "$TMP_DIR/clutter/$file"
  sed -i 's|(.*/third_party/mutter/src/\(.*\)|(\1|' "$TMP_DIR/clutter/$file"
  # replace references to clutter/clutter/ with clutter
  sed -i 's|clutter/clutter/|clutter/|' "$TMP_DIR/clutter/$file"
  echo "$file"
done | rsync --no-relative --dirs --files-from=- "$TMP_DIR/clutter/" ../clutter/

# copy other genereated .c files excluding dbus
find "$TMP_DIR/src" -name 'meta-dbus*' -prune -o -name '*-protocol.*' \
  -prune -o -name '*.c' -printf '%P\n' | while read -r file; do
  # ensure no absolute path
  sed -i 's|"[^"]*/src/\([^"]*\)"|"\1"|' "$TMP_DIR/src/$file"
  echo "$file"
done | rsync -R --files-from=- "$TMP_DIR/src/" ../

# copy generated headers from "meta"
find "$TMP_DIR/src/meta" -name '*.h' -printf '%P\n' |
  rsync --files-from=- "$TMP_DIR/src/meta/" ../include/meta/


# copy generated dbus files
find "$TMP_DIR/src" -name 'meta-dbus*' -printf '%P\n'

rm -rf "$TMP_DIR"

popd