← Back to team overview

scratch team mailing list archive

A few patches for scratch

 

Dear Scratch on Linux team,

thanks for all your work to make Scratch on Linux work great! This is
very much appreciated :)

I recently tried to compile the latest Ubuntu package on Debian Lenny,
and came across a few small issues. Patches for these issues are
attached, with descriptions inside.

Two other things I noted:
The Build-Depends of the scratch package contains versioned
dependencies, but some seem unnecessary high. Specifically, I could
build Scratch using libpango1.0-dev version 1.20.5-5+lenny1, and the
package still works perfectly :) Maybe the version could be adjusted.
(Though I could understand perfectly well if you said: "We'll leave these
at their current version, because that's what we use to test the
packages. If you use older packages, you're on your own.")

I tried to post the issues in this mail to your bugtracker (on
http://www.assembla.com/spaces/scratchonlinux/tickets), but it seems to
be read-only? Even after registering, I couldn't find any "new ticket"
button. If this is by design, please count this mail as a vote to create
a public bugtracker where anyone can report issues and comment on them.
I think this would be very helpful in building a community, as others
could see the state of various issues, submit and comment on patches,
and so on.

Regards
Thomas Bleher

>From 18032c8b6d050ac743d3a9cf213f6b59968c78d4 Mon Sep 17 00:00:00 2001
From: Thomas Bleher <tbleher@xxxxxx>
Date: Sun, 9 May 2010 16:14:16 +0200
Subject: [PATCH] Build plugins with -O2 by default

This uses the standard debian/rules mechanism to decide when to build
using -O2.
---
 scratch/debian/rules                 |    5 +++++
 scratch/src/plugins/camera/Makefile  |    2 +-
 scratch/src/plugins/scratch/Makefile |    2 +-
 scratch/src/plugins/unicode/Makefile |    2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/scratch/debian/rules b/scratch/debian/rules
index 0226cec..51a978a 100755
--- a/scratch/debian/rules
+++ b/scratch/debian/rules
@@ -6,6 +6,11 @@ package = scratch
 
 CC = gcc
 CFLAGS = -g -Wall
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
 
 all: build
 
diff --git a/scratch/src/plugins/camera/Makefile b/scratch/src/plugins/camera/Makefile
index 85d47fd..2681b76 100644
--- a/scratch/src/plugins/camera/Makefile
+++ b/scratch/src/plugins/camera/Makefile
@@ -1,7 +1,7 @@
 all: clean build
 
 build:	
-	gcc -fPIC -Wall -c *.c
+	gcc $(CFLAGS) -fPIC -c *.c
 	gcc -shared -lv4l2 *.o -o ../../../Plugins/CameraPlugin
 
 clean:
diff --git a/scratch/src/plugins/scratch/Makefile b/scratch/src/plugins/scratch/Makefile
index 326cd66..50d2201 100644
--- a/scratch/src/plugins/scratch/Makefile
+++ b/scratch/src/plugins/scratch/Makefile
@@ -1,7 +1,7 @@
 all: clean build
 
 build:	
-	gcc -fPIC -Wall -c *.c
+	gcc $(CFLAGS) -fPIC -c *.c
 	gcc -shared *.o -o ../../../Plugins/ScratchPlugin
 
 clean:
diff --git a/scratch/src/plugins/unicode/Makefile b/scratch/src/plugins/unicode/Makefile
index c46c57f..6004cfe 100644
--- a/scratch/src/plugins/unicode/Makefile
+++ b/scratch/src/plugins/unicode/Makefile
@@ -1,7 +1,7 @@
 all: clean build
 
 build:	
-	gcc -fPIC -Wall -c `pkg-config --cflags pangocairo` *.c 
+	gcc $(CFLAGS) -fPIC -c `pkg-config --cflags pangocairo` *.c 
 	gcc -shared `pkg-config --libs pangocairo` -lc *.o -o ../../../Plugins/UnicodePlugin
 
 clean:
-- 
1.5.6.5

>From 6fe2b5095cd64b9a4e3fdc014dd5bf33e4c0b4a0 Mon Sep 17 00:00:00 2001
From: Thomas Bleher <tbleher@xxxxxx>
Date: Sun, 9 May 2010 16:14:52 +0200
Subject: [PATCH] Fix spelling in README.txt, remove two unneeded \r line endings

---
 scratch/README.txt |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scratch/README.txt b/scratch/README.txt
index e69dd24..b860674 100644
--- a/scratch/README.txt
+++ b/scratch/README.txt
@@ -15,7 +15,7 @@ The following directories must be found in these locations, because references t
 /usr/share/scratch/Media - image and sound files bundled with Scratch
 /usr/share/scratch/Projects - sample projects bundled with Scratch
 
-The "scratch" startup script shows how to execute the virtual machine, as well as the necessary command line switches to indicate where the plugins can be found and which sound plugin should be used. The included script uses the pulseaudio sound plugin by defauilt (vm-sound-pulse), but plugins are also available for alsa (vm-sound-ALSA) and oss (vm-sound-OSS). Simply change the vm's command line switches to try different ones. Here's the script:
+The "scratch" startup script shows how to execute the virtual machine, as well as the necessary command line switches to indicate where the plugins can be found and which sound plugin should be used. The included script uses the pulseaudio sound plugin by default (vm-sound-pulse), but plugins are also available for alsa (vm-sound-ALSA) and oss (vm-sound-OSS). Simply change the vm's command line switches to try different ones. Here's the script:
 
 /usr/bin/scratch_squeak_vm \
 -plugins /usr/lib/scratch/Plugins \
@@ -25,8 +25,8 @@ The "scratch" startup script shows how to execute the virtual machine, as well a
 Scratch project files end in .sb, so you may want to register that filetype on your system. See the source code for the package at: https://www.assembla.com/spaces/scratchonlinux/trac_subversion_tool for more info.
 
 For more information about how to customize Scratch for your network / language / setting, view this page:
-http://info.scratch.mit.edu/Network_Installation
-
+http://info.scratch.mit.edu/Network_Installation
+
 The Scratch Source code / License is available in modifiable form here:
 http://info.scratch.mit.edu/Source_Code
 
-- 
1.5.6.5

>From 7e0e52530281a66d9d42be02485fe13f469b4f7d Mon Sep 17 00:00:00 2001
From: Thomas Bleher <tbleher@xxxxxx>
Date: Sun, 9 May 2010 16:16:11 +0200
Subject: [PATCH] Add missing return

This return was removed in the Debian diff (why?)
---
 scratch/src/plugins/camera/sqCamera-linux.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/scratch/src/plugins/camera/sqCamera-linux.c b/scratch/src/plugins/camera/sqCamera-linux.c
index d88cadc..bc24f13 100755
--- a/scratch/src/plugins/camera/sqCamera-linux.c
+++ b/scratch/src/plugins/camera/sqCamera-linux.c
@@ -167,6 +167,7 @@ static int getFrame() {
 
 		/* EAGAIN - retry */
 	}
+	return -1;
 }
 
 
-- 
1.5.6.5

>From e5c36fa609efc7e0fa148557a8e1841ca1edef36 Mon Sep 17 00:00:00 2001
From: Thomas Bleher <tbleher@xxxxxx>
Date: Sun, 9 May 2010 16:22:18 +0200
Subject: [PATCH] Fix versioned depends on pulseaudio

Ubuntu's pulseaudio version has an epoch in it (the '1:' at the front).
This causes all versions without an epoch to be smaller than the version
with the epoch (so e.g. 2.3 < 1:0.9).

See http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
for details how versions are compared.
---
 scratch/debian/control |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scratch/debian/control b/scratch/debian/control
index b8b03c6..32ad373 100644
--- a/scratch/debian/control
+++ b/scratch/debian/control
@@ -10,7 +10,7 @@ Build-Depends: debhelper (>= 6),libcairo2-dev (>= 1.8.6), libpango1.0-dev (>= 1.
 Homepage: http://scratch.mit.edu
 Package: scratch
 Architecture: i386
-Depends: ${shlibs:Depends}, ${misc:Depends}, pulseaudio (>= 1.0.9)
+Depends: ${shlibs:Depends}, ${misc:Depends}, pulseaudio (>= 1:0.9)
 Description: easy to use programming environment for ages 8 and up
  Scratch is an easy, interactive, collaborative programming
  environment designed for creation of interactive stories, animations,
-- 
1.5.6.5


Follow ups