File: make_pango.sh

package info (click to toggle)
chirp 1%3A20221106%2Bpy3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,144 kB
  • sloc: python: 119,334; ansic: 296; sh: 184; makefile: 41
file content (51 lines) | stat: -rw-r--r-- 863 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env bash

make_pango_modules() {
	local src=$1
	local dst=$2
	local sf=${src}/etc/pango/pango.modules
	local df=${dst}/etc/pango/pango.modules

	cat $sf | sed 's/\/opt\/.*\/lib/..\/Resources/' > $df
}

make_pango_rc() {
	local src=$1
	local dst=$2
	local sf=${src}/etc/pango/pangorc
	local df=${dst}/etc/pango/pangorc

	cat $sf | sed 's/\/opt\/.*\/etc/.\/etc/' > $df
}

make_pangox_aliases() {
	local src=$1
	local dst=$2

	cp ${src}/etc/pango/pangox.aliases ${dst}/etc/pango
}

usage() {
	echo 'Usage: make_pango.sh [PATH_TO_MACPORTS] [PATH_TO_APP]'
	echo 'Example:'
	echo '  make_pango.sh /opt/local dist/d-rats.app'
}

if [ -z "$1" ]; then
	usage
	exit 1
fi

if [ -z "$2" ]; then
	usage
	exit 1
fi

base=$1
app="$2/Contents/Resources"

mkdir -p ${app}/etc/pango

make_pango_modules $base $app
make_pango_rc $base $app
make_pangox_aliases $base $app