Tuesday, April 20, 2010

easy_squeakvm on github

I've created my first repository on github. So easy!

easy_squeakvm is used to build the squeak vm from scratch on Linux in one command.
To build the VM, just get the the script and execute

./easy_squeakvm.sh


This will

  • checkout squeakvm sources from svn repository
  • download PharoCore image
  • load VMMaker into PharoCore
  • generate the interpreter
  • build the VM
  • put binaries in out/squeakvm, ready to use


I was tired of typing the same commands over and over :)

http://github.com/lolgzs/easy_squeakvm

Wednesday, March 10, 2010

How I build squeak vm on (Arch)Linux

I write this post as a memento for me. I will appreciate some feedback on building the VM on other Linux distro.

1. Prepare a working directory

All the work will take place in ~/squeakvm (/home/lol/squeakvm on my machine):


mkdir ~/squeakvm
cd ~/squeakvm


2. Get squeak-vm source

The easiest part. The VM source code tarball can be found on http://www.squeakvm.org/unix/. At the time of writing, the last stable version is 3.11-3.2135. Go and get it:


wget http://www.squeakvm.org/unix/release/Squeak-3.11.3.2135-src.tar.gz
tar -xvzf Squeak-3.11.3.2135-src.tar.gz


3. Load VMMaker tool

For more explanations on why VMMaker is needed and how it works, here is a good overview.

To generate the source code for your own VM, you need a running Pharo image. Here I use a fresh Pharo 1.0-10508 rc2 image from Pharo website.

Open your image, then load VMMaker by evaluating this in a Workspace:

Gofer new
 squeaksource: 'MetacelloRepository';
 package: 'ConfigurationOfVMMaker';
 load.
 
(Smalltalk at:#ConfigurationOfVMMaker) project lastVersion load.




4. Load FT2Plugin

UPDATE: Should not be necessary now. See Javier's comment.

To display anti-aliased font of Pharo images, you need the FT2Plugin. To load it:

MCHttpRepository
 location:'http://www.squeaksource.com/FreeTypePlus'
 user: ''
 password: ''.

MCHttpRepository
 location: 'http://source.impara.de/freetype'
 user: ''
 password: ''.


5. Configure VMMaker and generate the VM source

Now you can open VMMakerTool:

VMMakerTool openInWorld


In the Path to platforms field put the path to the extracted Squeak VM tarball: ~/squeakvm/Squeak-3.11.3.2135-src.

Then right-click on one of the plugins pane and select make all external for a simple configuration.



Note you can have a description of each plugin by reading the class comment.Classes are part of VMMaker-Plugins category.

In path to generated source select a directory where the VM source will be written. Here ~/squeakvm/src32.

The VMMakerTool window should look like this:



Then click on the Entire button (top-left of window). Wait a moment, pray, and the code should be generated.

Finally, I replace the original VM source with the generated one.

rm -rf ~/squeakvm/Squeak-3.11.3.2135-src/unix/src
cp -a ~/squeakvm/src32 ~/squeakvm/Squeak-3.11.3.2135-src/unix/src


Note: theorically this should not be necessary as the configure script accepts an option to specify the source directory path, but it doesn't seem to work.

6. Build the VM

First create a directory for the build and go in:

mkdir ~/squeakvm/Squeak-3.11.3.2135-src/build
cd ~/squeakvm/Squeak-3.11.3.2135-src/build


Then run the configure script

../unix/cmake/configure 


First problem. I have this error:

CMake Warning (dev) in 
/home/lol/squeakvm/Squeak-3.11.3.2135-src/build/=/CMakeLists.txt:
  Syntax error in cmake code when parsing string

    ${=_link_directories}

  syntax error, unexpected cal_SYMBOL, expecting } (21)


Thanks to this mail there's a patch to correct it.


cd ~/squeakvm/Squeak-3.11.3.2135-src/unix/cmake/
wget http://lolgzs.free.fr/pharo/Plugins.cmake.patch
patch -p0 < Plugins.cmake.patch
Then clean and run the configure script again
cd ~/squeakvm/Squeak-3.11.3.2135-src/build
rm -rf *
../unix/cmake/configure 
You should have the Makefile now. Run make:
make
Then another problem as libfreetype (needed by FT2Plugin) is not found. To correct it, create config.cmake for FT2Plugin this way:
mkdir ~/squeakvm/Squeak-3.11.3.2135-src/unix/plugins/FT2Plugin/
echo "PLUGIN_FIND_LIBRARY(FT2 freetype)" > 
    ~/squeakvm/Squeak-3.11.3.2135-src/unix/plugins/FT2Plugin/config.cmake
More informations on this error here.

UPDATE: See Javier's comment.


Clean and run make again:
make clean
make
Then install:
sudo make install
7. Conclusion
The process is not so easy. To help I put all the squeakvm directory (with sources, pharo image with vmmaker) on http://lolgzs.free.fr/pharo/squeakvm.tar.gz

UPDATE: Good post for MacOSX

Thursday, February 25, 2010

Pharo & Smalltalk party

J'organise avec quelques confrères une "Pharo & Smalltalk party", dans l'objectif de faire découvrir et partager les expériences du développement Pharo et Smalltalk.

Que vous soyez développeur curieux ou Smalltalker expérimenté, rendez-vous le Samedi 20 Mars de 14h à 18h dans les locaux de Félix Création à Cran-Gévrier (bassin Annécien).

Voici le plan du lieu de rendez-vous.

Saturday, January 30, 2010

Seaside-Hosting compatible Pharo

L'hébergeur gratuit (pour des applications non-commerciales) Seaside-Hosting accepte maintenant les images Pharo ! J'en ai donc profité pour déployer ma première image Seaside... et c'est d'une simplicité étonnante.

Il suffit juste de créer un compte, uploader son image, clicker sur Start et c'est fini. Cool.

J'ai donc mis en ligne une image avec SimpleWebDoc: http://magaloma.seasidehosting.st/

Friday, January 29, 2010

Screencast sous Linux

Après avoir essayé pas mal d'outils disponibles sous Linux pour réaliser des screencasts et alimenter Pharocasts, voici le contenu de ma boîte à outils du moment.

Pour enregistrer j'utilise Xvidcap. On définit une zone de capture et le mode multi-frame permet de générer la vidéo à la volée. Ma zone de capture est en 800x600, éviter les résolutions exotiques (garder du 4:3 ou 16:9). Dans le cas contraire on risque une perte importante de la qualité par les encodeurs et les sites de publication en ligne.
J'enregistre en avi/mpeg4.

Pour couper les scènes, j'aime bien Avidemux. Interfaces texte, GTK et Qt disponibles. Il s'appuie sur son propre fork de FFmpeg pour l'encodage et c'est très rapide si vous gardez le même format que la vidéo originale.

Pour encapsuler au format mov, car les possesseurs d'anciennes versions de MacOSX ont des soucis avec l'avi, j'utilise la commande suivante (qui ne doit pas être la meilleure, vu que le fichier généré double de taille pour une qualité moindre):
ffmpeg -i mavideo.mpeg -b 500k mavideo.mov

Je suis toujours à la recherche d'un outil sympa pour le montage, type Kdenlive, mais je n'ai encore rien trouvé qui me plaise vraiment.

Pour publier, entre Vimeo, YouTube et DailyMotion, c'est Vimeo que je préfère pour la qualité de la vidéo.