-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkiss-hook
executable file
Β·171 lines (135 loc) Β· 4.63 KB
/
kiss-hook
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/bin/sh -e
cleanup()
{
rm -rf "$DEST/usr/share/bash-completion" \
"$DEST/usr/share/applications" \
"$DEST/etc/bash_completion.d" \
"$DEST/usr/lib/charset.alias" \
"$DEST/usr/share/polkit-1" \
"$DEST/usr/share/gettext" \
"$DEST/usr/share/gtk-doc" \
"$DEST/usr/share/locale" \
"$DEST/usr/share/sounds" \
"$DEST/usr/share/icons" \
"$DEST/usr/share/info" \
"$DEST/usr/share/doc" \
"$DEST/usr/share/man" \
"$DEST/usr/share/zsh"
}
# int main()
{
case $TYPE in
pre-extract)
case $PKG in
firefox|firefox-esr|rust|llvm|clang|gcc)
mak_dir=$KISS_TMPDIR/build-$pid
pkg_dir=$KISS_TMPDIR/pkg-$pid
;;
*)
log "$PKG" "Activating tmpfs"
mak_dir=/tmp/build-$pid
pkg_dir=/tmp/pkg-$pid
;;
esac
mkdir -p "$mak_dir" "$pkg_dir/$PKG/var/db/kiss/installed"
;;
pre-build)
IFS=. read -r _start _ < /proc/uptime
case $PKG in
baselayout)
sed -i 's/home //g' "$repo_dir/build"
sed -i 's/bin i/bin home i/g' "$repo_dir/build"
sed -i '30iln -s usr/home "$1/home"' "$repo_dir/build"
;;
busybox)
sed -i "s|\.profile|etc/profile|g" shell/ash.c
sed -i "s|/home|/usr/home|g" loginutils/adduser.c
;;
mesa)
_flags=-Dgallium-drivers=radeonsi
_flags=$_flags\ -Dvulkan-drivers=amd
_flags=$_flags\ -Dgallium-va=enabled
sed -i "s/\. output/$_flags \0/" "$repo_dir/build"
;;
scroll)
sed -i "s|//||g" config.def.h
;;
esac
;;
post-build)
IFS=. read -r _end _ < /proc/uptime
(
_s=$((_end - _start))
_h=$((_s / 60 / 60 % 24))
_m=$((_s / 60 % 60))
[ "$_h" = 0 ] || _u="${_u}${_h}h "
[ "$_m" = 0 ] || _u="${_u}${_m}m "
log "$PKG" "Build finished in ${_u:-${_s}s}"
)
: "${DEST:?DEST is unset}"
case $PKG in
abiword)
;;
adwaita-icon-theme)
;;
alsa-lib)
_files="~/etc/asound.conf"
sed -i "s@~/.asoundrc@$_files|||\0@" "$DEST/usr/share/alsa/alsa.conf"
cleanup
;;
baselayout)
sed -i 's/home i/i/g' "$repo_dir/build"
sed -i 's/etc m/etc home m/g' "$repo_dir/build"
sed -i '/usr\/home/d' "$repo_dir/build"
;;
busybox)
{
echo "kvm root:kvm 660"
echo "SUBSYSTEM=drm;.* root:video 660 *env > /tmp/.libudev-zero/uevent.\$$"
echo "SUBSYSTEM=input;.* root:input 660 *env > /tmp/.libudev-zero/uevent.\$$"
} >> "$DEST/etc/mdev.conf"
;;
gnumeric)
;;
goffice)
;;
kiss)
sed -i "s/grub/metapkg/g" "$DEST/usr/bin/kiss-orphans"
;;
libudev-zero)
cc contrib/helper.c -o helper
install -Dm755 helper "$DEST/usr/bin/helper"
cleanup
;;
mesa)
_flags=-Dgallium-drivers=radeonsi
_flags=$_flags\ -Dvulkan-drivers=amd
_flags=$_flags\ -Dgallium-va=enabled
sed -i "s/$_flags //" "$repo_dir/build"
cleanup
;;
*)
cleanup
;;
esac
;;
pre-install)
case $PKG in
linux)
mount /dev/sdb2 /boot
;;
esac
;;
post-install)
case $PKG in
linux)
umount /boot
;;
sls)
chown root:eudaldgr /usr/bin/sls
chmod gu+s /usr/bin/sls
;;
esac
;;
esac
}