blob: 0be8c5f28065c8843f3cec1dd742beacfcb64626 (
plain)
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
|
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit gnome2-utils
DESCRIPTION="BYOB (Build Your Own Blocks) is an advanced offshoot of Scratch"
HOMEPAGE="http://snap.berkeley.edu/old-byob.html"
SRC_URI="http://snap.berkeley.edu/BYOB_3_1_1_110519_w_changes.zip
http://snap.berkeley.edu/byoblib.tgz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+alsa oss pulseaudio nas +v4l"
DEPEND="dev-lang/squeakvm[scratch] games-kids/scratch
alsa? ( dev-lang/squeakvm[alsa] )
oss? ( dev-lang/squeakvm[oss] )
pulseaudio? ( dev-lang/squeakvm[pulseaudio] )
nas? ( dev-lang/squeakvm[nas] )
v4l? ( dev-lang/squeakvm[v4l] )"
RDEPEND="${DEPEND}"
REQUIRED_USE="?? ( alsa oss pulseaudio nas )"
S="${WORKDIR}"
src_prepare() {
mv Help/en/allscreens.html Help/en/allscreens-BYOB.html
rm Help/en/index.html \
Help/en/ScratchGettingStartedv14.pdf \
Help/en/ScratchReferenceGuide14.pdf \
Help/en/images/getting-started-thumb.gif \
Help/en/images/help-menu.gif \
Help/en/images/helpscreens-thumb.gif \
Help/en/images/scratch-interface-1.gif \
Help/en/images/scratch-logo.gif \
Help/en/images/support-site.gif
}
src_configure(){
if use alsa; then squeak_sound_plugin="ALSA"
elif use oss; then squeak_sound_plugin="OSS"
elif use pulseaudio; then squeak_sound_plugin="pulse"
elif use nas; then squeak_sound_plugin="nas"
else squeak_sound_plugin="null"
fi
}
src_install() {
local datadir="/usr/share/scratch"
local icondir="/usr/share/icons/hicolor"
dodir "${datadir}"
cp -r Help locale Media Projects "${D}${datadir}"
dodoc "BYOB 2.0.pdf" Elements090224.pdf README-BYOB.txt license.txt release.txt BYOBManual.pdf
dolib BYOB.image
dolib BYOB.changes
dolib BYOB.ini
newicon "Media/Costumes/Fantasy/alonzo.gif" "${PN}.gif"
install_runner
make_desktop_entry byob BYOB byob "Education;Development" "MimeType=application/x-scratch-project"
}
install_runner() {
local tmpexe=$(emktemp)
cat << EOF > "${tmpexe}"
#!/bin/sh
cd
exec \
"/usr/bin/squeak" \\
-vm-sound-${squeak_sound_plugin} \\
"/usr/$(get_libdir)/BYOB.image" \\
"${@}"
EOF
chmod go+rx "${tmpexe}"
newbin "${tmpexe}" "${PN}" || die
}
pkg_preinst() {
gnome2_icon_savelist
}
pkg_postinst() {
gnome2_icon_cache_update
}
pkg_postrm() {
gnome2_icon_cache_update
}
|