diff options
Diffstat (limited to 'games-kids/scratch')
-rw-r--r-- | games-kids/scratch/Manifest | 2 | ||||
-rw-r--r-- | games-kids/scratch/scratch-1.4.0.6.ebuild | 104 |
2 files changed, 106 insertions, 0 deletions
diff --git a/games-kids/scratch/Manifest b/games-kids/scratch/Manifest new file mode 100644 index 0000000..596ea7b --- /dev/null +++ b/games-kids/scratch/Manifest @@ -0,0 +1,2 @@ +DIST scratch-1.4.0.6.src.tar.gz 40329193 RMD160 2134cc7ae551006f6c33e98da73707c926637b4f SHA1 3ebc0390c2a4a271a32a046c9ab12e9d4e16c214 SHA256 738669c4eade6fb8ae7daab326aefc9328fbb3720c9946fe8445dbf8a995af7a +EBUILD scratch-1.4.0.6.ebuild 2555 RMD160 c737efbd438588fe32d3846bd41efc47a30ce2da SHA1 b9f0454f4c55a56a2a3c07c0d024be3cf4316b2b SHA256 65951b11c5c1d2f80f98fde26e5abf1ea5cf586cfb6c21321cee9d0d984f82ef diff --git a/games-kids/scratch/scratch-1.4.0.6.ebuild b/games-kids/scratch/scratch-1.4.0.6.ebuild new file mode 100644 index 0000000..8a240bc --- /dev/null +++ b/games-kids/scratch/scratch-1.4.0.6.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 + +inherit games confutils + +DESCRIPTION="A programming environment for creating and sharing interactive stories, animations, games, music, and art." +HOMEPAGE="http://scratch.mit.edu/" +SRC_URI="http://download.scratch.mit.edu/${P}.src.tar.gz" + +LICENSE="MIT GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="alsa oss pulseaudio v4l" + +DEPEND=" + dev-lang/squeak + >=x11-libs/cairo-1.8.6 + >=x11-libs/pango-1.20.5 + >=dev-libs/glib-2.20.1:2 + v4l? ( >=media-libs/libv4l-0.5.8 ) +" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${P}.src" +ABI="x86" + +if use alsa; then squeak_sound_plugin="ALSA" +elif use oss; then squeak_sound_plugin="OSS" +elif use pulseaudio; then squeak_sound_plugin="pulse" +else squeak_sound_plugin="null" +fi + +pkg_pretend() { + # Is the a convenience function for "zero or one"? + confutils_require_one alsa oss pulseaudio +} + +src_prepare() { + if ! use v4l; then + sed -i '/\/camera/d' "${S}/Makefile" + fi + rm Plugins/so.MIDIPlugin Plugins/so.Mpeg3Plugin +# use alsa || rm -f Plugins/vm-sound-ALSA +# use oss || rm -f Plugins/vm-sound-OSS +# use pulseaudio || rm -f Plugins/vm-sound-pulse +} + +src_compile() { + cd ${S} + emake +} + +src_install() { + local libdir="$(games_get_libdir)/${PN}" + local datadir="/usr/share/${PN}" + local icondir="/usr/share/icons/hicolor" + dodir "${libdir}" "${datadir}" + + insinto "${libdir}" + doins -r Scratch.* Plugins + + insinto "${datadir}" + doins -r Help locale Media Projects + + doman src/man/scratch.1.gz + dodoc ACKNOWLEDGEMENTS KNOWN-BUGS README LICENSE NOTICE TRADEMARK_POLICY + + insinto /usr/share/mime/packages + echo "3" + doins src/scratch.xml + ( + cd src/icons + for res in *; do + insinto "${icondir}/${res}/apps" + doins "${res}"/scratch*.png + + if [ -e "${res}/gnome-mime-application-x-scratch-project.png" ]; + then + insinto "${icondir}/${res}/mimetypes" + newins "${res}/gnome-mime-application-x-scratch-project.png" mime-application-x-scratch-project.png + fi + done + ) + install_runner + make_desktop_entry scratch Scratch scratch "Education;Development" "MimeType=application/x-scratch-project" +} + +install_runner() { + local tmpexe=$(emktemp) + cat << EOF > "${tmpexe}" +#!/bin/sh +cd +exec /usr/bin/squeak \\ + -plugins "$(games_get_libdir)/${PN}/Plugins" \\ + -vm-sound-${squeak_sound_plugin} \\ + "$(games_get_libdir)/${PN}/Scratch.image" \\ + "${@}" +EOF + chmod go+rx "${tmpexe}" + newbin "${tmpexe}" "${PN}" || die +} |