Saturday, March 5, 2011

Setting up my development environment in Fedora

The last couple of days I started having problems after updating and rebuilding cheese master branch and the other packages it uses (running jhbuild -acf build cheese). This was in my Ubuntu partition.

Every time the mouse entered the clutter stage I got a segmentation fault. I debugged it a little but I didn't find the cause, just a null pointer in the handling of CLUTTER_ENTER event inside clutter. But the gtk-clutter-events example in clutter-gtk worked fine, so it was a problem related to cheese I guess, or something I forgot to update, or some mixture caused by my attempts to build cheese gtk3 branch, I don't really know.

A little tired, I decided I'd set up the development enviroment in my fedora partition (which I barely used before, so it was in a "fresh install" state), something I wanted to try anyway to see how it worked.

It's a long and tedious process:


download from git, build and install jhbuild
create .jhbuildrc 
(already had it)

install some packages needed by jhbuild sanitycheck
(jhbuild bootstrap)

jhbuild sanitycheck keeps complaining about automake 1.8/1.9 after bootstrap, 
(install automake 1.8.5 and 1.8 from sources, still complains, ignore it and continue)(this was a mistake I had to deal with later)

cannot connect to gnome git, public key issue after copying existing keys from ubuntu partition to .ssh in fedora partition
(change keys owner from root to laura)

g++ is missing 
(install "c++ support for gcc")

$ jhbuild build cheese

*** Error during phase configure of gnome-doc-utils:
No package 'libxml-2.0' found
No package 'libxslt' found
(instal libxml-devel, libxslt-devel)

*** Error during phase configure of fontconfigerror: 
You must have freetype installed; 
(install freetype-devel)

*** Error during phase force_checkout of cairo: 
/bin/sh: patch: command not found
(install patch)

*** Error during phase configure of cairo: 
libpng not found 
(install libpng-devel)

*** Error during phase configure of gdk-pixbuf:
libtiff not found
(install libtiff-devel)

*** Error during phase configure of gdk-pixbuf:
libjpeg not found
(install libjpeg-devel)

*** Error during phase configure of gtk+
configure:22402: checking for XOpenDisplay
configure:22406: error: *** libX11 not found. Check 'config.log' for more details.
(install libXrender-devel)

*** Error during phase configure of libIDL:
configure: error: flex is required to create the libIDL scanner 
(install flex "a tool for creating scanners")

*** Error during phase configure of libIDL: 
yacc is not usable as yacc - consider using bison
(install bison "GNU general purpose parser generator")

*** Error during phase configure of libIDL: 
makeinfo: command not found
(install texinfo)

*** Error during phase build of gtk+-3:
gdkdeviceprivate-xi.h:28:35: fatal error: X11/extensions/XInput.h: No such file or directory
(install libxi-devel)

*** Error during phase configure of dbus-glib:configure: 
error: DBus development libraries not found
(install dbus-devel)

*** Error during phase configure of gconf:
introspection.m4 not found
(install gobject-introspection-devel)

*** Error during phase configure of gudev:
configure: error: gperf is needed
(install gperf)

*** Error during phase configure of gudev:
configure: error: libacl not found
(install libacl-devel)

*** Error during phase configure of gudev:
No package 'libusb' found
(install libusb-devel)

*** Error during phase build of gudev:
No package 'libudev' found
(install libudev-devel)

This happened a couple of times while trying to checkout different packages:
Submodule 'common' (git://anongit.freedesktop.org/gstreamer/common) registered for path 'common'
git submodule update
Cloning into common...
and it stays there indefinitely
(Ctrl-c rerun phase, repeat until it starts)

*** Error during phase configure of clutter:
checking for XCOMPOSITE extension >= 0.4... configure: error: not found
(install libXcomposite development package)

*** Error during phase build of clutter-gst:
Couldn't find include 'Clutter-1.0.gir' (search path: ['.', 'path=.', '/home/laura/00_code/opt/gnome/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0'])
(./configure clutter adding --enable-introspection option (jhbuild shell, config.log command)
  clutter asks for gobject-introspection with higher version than that of fedora repository
  jhbuild buildone gobject-introspection
    *** Error during phase configure of gobject-introspection:
    configure: error: Python headers not found
    (install python-devel) 
make && make install clutter
Couldn't find include 'Atk-1n.0.gir'
jhbuild build -acf cheese *facepalm* (it means start over from the beginning))

*** Error during phase configure of clutter-gtk:
configure.ac:33: require Automake 1.11, but have 1.10.3
automake --version
Useless use of /d modifier in transliteration operator at /usr/local/share/automake-1.8/Automake/Wrap.pm line 60.
automake (GNU automake) 1.8.5
(make uninstall automake 1.8.5 and 1.8 both from opt and /usr, uninstalled and reinstalled automake 1.11.1 and libtool while trying to fix this, I don't know if it's needed)

*** Error during phase configure of startup-notification:
configure: error: X11 development libraries/headers not found
(check config.log to see what failed, X11/Intrinsic.h was not there, install libXt-devel)

*** Error during phase configure of libproxy:
/bin/sh: cmake: command not found
(install cmake)

*** Error during phase configure of glib-networking:
configure: error: "No package 'gnutls' found"
(install gnutls-devel)

*** Error during phase configure of libsoup:
No package 'sqlite3' found
(install sqlite-devel)

*** Error during phase configure of gnome-disk-utility:
No package 'udisks' found
(install udisks-devel)

*** Error during phase configure of gnome-disk-utility:
No package 'avahi-ui-gtk3' found
(install avahi-ui-gtk3 ? no. install avahi-ui-devel)

*** Error during phase build of gnome-disk-utility:
/usr/lib/libgtk-x11-3.0.so.0: undefined reference to `g_application_add_action'
/usr/lib/libgtk-x11-3.0.so.0: undefined reference to `g_application_set_action_enabled'
/usr/lib/libgtk-x11-3.0.so.0: undefined reference to `g_application_quit_with_data'
(removed .la files, rerun phase configure, same error)
(give up, add gnome-disk-utility to skip.extend in .jhbuildrc)


*** Error during phase configure of evolution-data-server:
checking Berkeley DB... configure: error: Cannot find libdb
(install libdb-devel)

*** Error during phase configure of evolution-data-server:
configure: error: NSPR headers not found. Use --with-nspr-includes to specify the include dir of NSPR. (same for nss)
(install nspr-devel nss-devel
run ./configure --enable-maintainer-mode --prefix /home/laura/00_code/opt/gnome --libdir /home/laura/00_code/opt/gnome/lib --disable-static --with-nspr-includes=/usr/include/nspr4 --with-nss-includes=/usr/include/nss3 )

////////
$ jhbuild build libcanberra:

*** Error during phase configure of libcanberra:
configure: error: Unable to find libltdl.
(install libtool-ltdl-devel)

*** Error during phase configure of libcanberra: 
No package 'vorbisfile' found
(install libvorbis-devel)

*** Error during phase configure of cheese:
No package 'clutter-gtk-0.10' found 
(known bug https://bugzilla.gnome.org/show_bug.cgi?id=632834)
(switch to clutter-gtk-0.10 remote branch rebuild it and install it)

$ jhbuild run cheese
Gtk-Message: Failed to load module "pk-gtk-module"
(ignore it https://bugzilla.redhat.com/show_bug.cgi?id=476066)

GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
(jhbuild build dconf)

(cheese:17888): Gtk-WARNING **: Could not find the icon 'image-loading'. The 'hicolor' theme
(?)

Error: One or more needed GStreamer elements are missing: oggmux, theoraenc, vorbisenc.
(install libtheora-devel reconfigure/rebuild gst-plugins-base)

$ git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-bad
*** Plug-ins with dependencies that will NOT be built:
...
opencv
(install opencv and opencv-devel)

video preview looks garbled
(install libxv-devel, reconfigure rebuild reinstall gst-plugins-base, select xvimagesink in gstreamer-properties)




I tried to think ways to make this a little bit better. For starters,
1) Add the unneeded packages to skip.extend in .jhbuildrc

This is the complete list of 47 packages built by "jhbuild build cheese":
$ jhbuild list cheese
gnome-common
intltool
rarian
gnome-doc-utils
gtk-doc
glib
fontconfig
pixman
cairo
gobject-introspection
pango
atk
gdk-pixbuf
shared-mime-info
gtk+
libIDL
ORBit2
gtk+-3
dbus-glib
gconf
gstreamer
liboil
gudev
gst-plugins-base
gst-plugins-good
json-glib
clutter
clutter-gst
clutter-gtk
libgee
gnome-video-effects
libcroco
librsvg
startup-notification
libnotify
libnl
libgnome-keyring
libproxy
glib-networking
libsoup
gvfs
gnome-desktop
libgweather
libical
libgdata
evolution-data-server
cheese

But I don't know yet which can be skipped and which are really needed.

2) Add some needed packages to that list: vala, libcanberra, gst-plugins-bad
3) Everytime I got an error complaining about a package not found, I searched its name in the package manager gui and added the related devel package. It would be great if somehow, jhbuild didn't stop with a prompt every time this happened, and listed instead all the errors about missing packages together after trying to configure the complete list of packages. Then try to add all the devel packages together somehow. (script? different gui for package manager that allows to list all currently installed packages with their devel counterparts and then "select all"?)
4) thinking about potential new contributors that are just starting, the error messages don't imply the solution at all, this causes lots of google searches. I can't think of an automated solution for this, since the error messages are written by people, and trying to set standards or guidelines for them will not be really effective. They vary a lot and are sometimes misleading. (Check the X11 cases).
5) ?

And on top of all this, this is the result:


Some minor variations in the results when starting cheese with different effects already selected.
I know that for the frei0r effects to work I need to install frei0r-plugins from fedora repos. (those would be the brownish "Cartoon", "Che Guevara", "Chrome", etc.). About the other effects, I had the same exact subset of effects that behaved a little different in ubuntu too, but with different symptoms. I haven't investigated what is exactly the difference between them.

These are the three different sets:

Look fineGarbled (pink hue in ubuntu)frei0r

Bulge
Heat
Kaleidoscope
Mirror
Pinch
Sepia
Square
Stretch
Twirl
X-Ray

No Effect
Dice
Edge
Historical
Hulk
Kung-Fu
Mauve
Noir/Blanc
Optical Illusion
Quark
Radioactive
Ripple
Saturation
Shagadelic
Vertigo
Warp
Waveform

Cartoon
Che Guevara
Chrome
Distortion
Invertion
Sobel
Time Delay

The exact behavior of these bugs depends on which effect was already seleted when starting cheese.

But anyway, now the mouse entering the stage does not cause a segmentation fault. Now I can keep testing my faceoverlay plugin that still have some problems when selecting and deselecting the effect (changing from READY to NULL and from NULL to READY in the pipeline), and that was the goal of all this. ;)