-
Notifications
You must be signed in to change notification settings - Fork 24
/
export-zips.sh
executable file
·53 lines (38 loc) · 1.46 KB
/
export-zips.sh
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
#!/bin/bash
# SPDX-FileCopyrightText: 2017 Florian Müllner <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-or-later
srcdir=`dirname $0`
srcdir=`(cd $srcdir && pwd)`
builddir=`mktemp -p $srcdir -d _build.XXXXXX` || exit 1
destdir=`mktemp -p $srcdir -d _dest.XXXXXX` || exit 1
meson setup --prefix=/usr -Dextension_set=all $srcdir $builddir
meson install --destdir $destdir -C $builddir
rm -rf $srcdir/zip-files
mkdir $srcdir/zip-files
extensiondir=$destdir/usr/share/gnome-shell/extensions
schemadir=$destdir/usr/share/glib-2.0/schemas
for f in $extensiondir/*; do
name=`basename ${f%%@*}`
schema=$schemadir/org.gnome.shell.extensions.$name.gschema.xml
olddomain=gnome-shell-extensions
newdomain=gnome-shell-extension-$name
sed -i "/gettext-domain/ s:$olddomain:$newdomain:" $f/metadata.json
xgettext --from-code=UTF-8 --output-dir=$builddir --output=$name.pot $f/*.js
if [ -f $builddir/$name.pot ]; then
mkdir $f/po
for l in $(<$srcdir/po/LINGUAS); do
msgmerge --quiet --output-file=$f/po/$l.po \
$srcdir/po/$l.po $builddir/$name.pot
done
fi
cp $srcdir/NEWS $srcdir/COPYING $f
sources=(NEWS COPYING $(cd $f; ls *.js *.css 2>/dev/null))
[ -d $f/icons ] && sources+=(icons)
[ -f $schema ] || unset schema
gnome-extensions pack ${sources[@]/#/--extra-source=} \
${schema:+--schema=$schema} --out-dir=$srcdir/zip-files $f
done
rm -rf $builddir
rm -rf $destdir