hortont · blog · gnome

Seed on Mac OS X

2010.01.02 in code and gnome

New Year

First things first, happy new years! I'd say 2009 was one of the better years, personally (the world on a whole might have something to say about this), but I'm shooting for even more fun during this orbit.

My Gnome Stuff

I'm home from school until almost the end of January, and all of the holidays are over now, so I have a great deal of time opening up to work on various things that I've promised everyone. I apologize for disappearing, but school got particularly time-consuming last semester (and the time I spent on it resulted in my best semester yet!) — and that comes first.

Seed on OS X

Over the past few days, I've been getting Seed working on Mac OS X, in order to (try) to decrease the number of brain context switches required when I want to work on something quickly (I spend 99% of my time in OS X).

I've now got MacPorts packages for gobject-introspection, gir-repository, gnome-js-common, and seed, as well as modified packages for webkit-gtk (to fix a bug in the current packaging), clutter/clutter-gtk (to enable introspection support), and gnome-common (to pull in gnome-autogen.sh from 2.28, which works with the version of automake/autoconf that currently ships with MacPorts).

As far as I know, these packages only work against the very latest version of MacPorts (1.8.1), with the very latest packages on an install of Snow Leopard with 64-bit-userland (I suppose the number of people with 32-bit-Snow-Leopard is rather low). I've tested it from a totally fresh MacPorts install twice now, and it seems to work fine.

It's relatively easy to install, with one caveat: I don't have a machine which is both online most of the time and I have the ability to run rsyncd on, so you'll have to manually pull changes (I'll explain how in a moment).

To install:

  1. Check out my custom ports tree:
    cd /opt
    sudo mkdir hortont-ports
    sudo chown [your username] hortont-ports
    git clone http://www.hortont.com/hortont-ports.git
    
  2. Edit the file
    /opt/local/etc/macports/sources.conf
    with administrator privileges, and add the line:
    file:///opt/hortont-ports

    before the line (at the bottom of the file) that reads:
    rsync://rsync.macports.org/release/ports/ [default]
  3. Upgrade your currently installed ports (important!), then install seed:
    sudo port sync
    sudo port upgrade outdated
    sudo port install seed
    
To update:
  1. Update your checkout of my ports tree:
    cd /opt/hortont-ports
    git pull
    
  2. Update your installed ports:
    sudo port sync
    sudo port upgrade outdated
    
To use Seed, make sure that you set LD_LIBRARY_PATH correctly
(this all also assumes that /opt/local/bin is in your PATH):
  1. export LD_LIBRARY_PATH=/opt/local/lib
    
  2. seed
    
Gnome Games

One of the primary things I'm planning on working on over the next few weeks is getting the three games from the summer up to tip-top shape for 2.30. Lights Off and Same (now swell-foop) are shipping, but they need documentation, high-scores, and (especially in the case of Same) performance help.

Epiphany Extensions

I've just gotten word that Epiphany JavaScript extensions are working much better now, as of the most recent (today) release of Seed. The last time I promised to look at various extensions for people, stability was a problem to the extent that I gave up after about ten minutes. So, this is another target for the next few weeks. Port some extensions, write some documentation, post the one extension that we have that works well somewhere better than bugzilla, etc.

All in all... should be a fun few weeks vacation!

Clutterhs First Release

2009.11.28 in gnome and school

My good friend and roommate Matt Arsenault has just pushed the initial (0.1) release of his Clutter bindings for Haskell. This was his RCOS project for this semester.

Anyway, if you speak Haskell and enjoy Clutter, download them and see what you can do! He's looking for lots of input for the next steps, so please have at it...

On RCOS (or, Open Software at Rensselaer)

2009.11.11 in code, gnome, school, and summer of code

Excuses

This post has been stewing for a very long time, as is evidenced by it covering a span of three years. With such a long timeframe comes a terribly scattered and disconnected process of storytelling (for me, at least), so keep that in mind while you notice how long your scrollbar currently is... there is no structure here, only late-night babble.

Also, I apologize in advance for making anyone feel bad over the course of the next few paragraphs...

The Problem

A freshman's eye would peg Rensselaer as a paragon of proprietary software, and they certainly wouldn't be wrong. A majority of the academic portion of campus is heavily entrenched in software like Office, MATLAB, Mathematica, and various CAD packages (or Creative Suite, Max/MSP, and Final Cut Studio, on the other side of campus). I wouldn't blame this on the 'tute, though — many of these packages have no free/open source counterpart even remotely in the same tier. The problem centers more around how much the attitude that comes along with such software is also pervasive here.

Going to RPI — for most people (mainly the engineers and artists, who together comprise way more than half of the student body) — is about spending four years learning how to make lots and lots of money using the tools that you have to use in your particularly overspecialized field; nothing more, nothing less. There's been a recent push for multidisciplinary studies, but I feel like this isn't as serious as it could be, yet — destroying entire departments (foreign language, for example) doesn't lead to much faith in this program...

While this heavily money-and-proprietary-software-driven philosophy might be a little off-putting to someone coming from a background filled with free and open source software (or even a science-for-science's sake background), there is hope!; this is what I want to write about, since it's much more interesting than what's broken...

The Real Problem

I should first clarify that I don't have a problem with proprietary software; I use OS X as my primary operating system, I often resort to Mathematica or Final Cut to do things that can't be easily solved otherwise... I'm very much a right-tool-for-the-job person. My problem is with the attitude; the attitude that says that "everything I create should be mine because there's a chance I can make fame or fortune off of it, and why in the world would I want to share that with other people?"... that is the attitude driven by total immersion in a corporate-academic/closed-source world, and that is what I have a problem with, and it's deeply embedded within both the faculty and a significant portion of the student population.

During freshman year, I spent the whole year doing physics and hiding my disapproval for the overarching RPI philosophy by spending lots of time with my few dozen extremely social floormates. Robb and I often chatted about how we felt about the school, and supported each other as much as we could in terms of not following in everyone else's footsteps.

By the beginning of sophomore year, Robb and I had heard rumors from one of our CS professors (Robert Ingalls, who taught our operating systems course) that there was actually a forming contingent of like-minded folk — people who enjoyed writing software in order to share it with the world, people who believed in the world we believed in.

Finding RCOS

This group turned out to be the Rensselaer Center for Open Software (RCOS, as we semi-lovingly call it). Headed by Moorthy (who was also my data structures professor at the time, though I didn't make the connection until mere minutes before we met him to propose our project), RCOS is an interesting beast. It provides funding, support, and — more importantly, at least in my opinion — a home for people interested in working on or learning about free/open software.

In order to participate, you have to bring a project to the table. It could be something small, as you're just getting started with programming, or something grand, far beyond the scope of a single person project, something you just want to peck away at — as long as there's something to be done, and you're willing to share your code and ideas, you're welcome to stay as long as you'd like.

Three times a semester, the group (or individual) hacking away at each project has to get up in front of the rest of the group — which now numbers somewhere around 30 — and show off what they've done, where they've come from, and where they hope to go; these presentations take place at weekly meetings which form the primary social interaction of the group and provide a place for people to bounce ideas off everyone, show off what they've learned, and get support from the rest of the group when they're having an issue.

Seed

First semester sophomore year — shortly after we discovered RCOS — Robb, Matt, and I proposed the "Orange Window Manager", a next-generation window manager that we were planning to write, utilizing Robb's knowledge from his time working on Compiz, as well as various technologies not then being used in window managers (primarily, Clutter). We wrote Seed, the JavaScriptCore<->GObject-Introspection bridge which we were planning to use for extensibility within our window manager, instead, mostly after realizing that we didn't have the time nor patience to write a window manager. Hearing about Shell and Mutter and friends at GNOME Summit affected that decision a slight bit as well; we had already accidentally duplicated some of the effort in creating Seed alongside GJS, we weren't interested in continuing down that path.

RCOS ended up funding two semesters of Seed development and also provided a place for us to show off what we were working on to a bunch of people from outside of the GNOME developer community — which is really a great thing, and lets you put a little bit of perspective on what you're working on... both semesters we had other overarching projects in mind, but both semesters Seed was the primary target of our development time, because it was something feasible and something potentially useful to others.

Big Picture

Without something like RCOS, Seed almost certainly would not have been written; I would still be sitting here having never gotten my hands dirty in the GNOME world (some would say we'd be better off that way :-D); and, more importantly for the big picture, dozens of undergrads would never have gotten a taste of community in software, nor of writing code out in the open, nor of thinking of themselves second for once when coming up with ideas.

I believe that this is incredibly important, and — shockingly — something relatively unique to our campus (I realize it happens in other places, but not nearly as many as one would initially hope), and that more campuses should take heed and — if at all possible — try to pull off something similar!

The Man with The Plan

It turns out that this is all made possible by one person: Sean O'Sullivan, who graduated from RPI in '85 and went on to help found MapInfo — far from being a model citizen of the free/open-source world, but the timeframe excuses them, without question.

Mr. O'Sullivan apparently believes in our world too — so much that he donated a significant chunk of money in order to initiate and fund RCOS for a few years, as well as to create a annual semester-long course on developing open source software (which Robb is currently enrolled in, and is having a blast with, from what I hear...).

Reasonable social protocol would dictate that Seed contain some sort of "thank you" to both Mr. O'Sullivan and to Moorthy; unfortunately I never quite feel comfortable inserting any sort of message to that effect anywhere, nor bringing it up this late in the game, so this is my thank you: thank you for the last three semesters, and hopefully three more; thank you for believing in our cause and our world; and thank you for showing even just a few new people something they hadn't seen before, and possibly wouldn't have had their paths not crossed yours.

TL;DR

RPI has an awesome-but-underappreciated program for getting people involved in open software, run by Mukkai Krishnamoorthy and created by Sean O'Sullivan, and it gives me the little bit of hope I have for our community...

GNOME 2.28! And, Amy with OCD.

2009.09.24 in gnome and school

GNOME 2.28 - Made to Share.


GNOME 2.28 is out! Now with 100% more Seed!

Also, last Wednesday, my first Intermediate Video project was due. I've shoved it to Vimeo for your viewing pleasure. Or not. Amy's awesome in it, but the lighting needs serious help (and I only managed to acquire one of the crappy cameras that has really poor low-light response). There are also some stories surrounding the making of this video and having to call PubSafe because I locked my keys in a room that nobody else I know has access too. Whoops!

Anyway, the next video will be mostly filmed outside; what's not being filmed outside will be filmed with lights (I'm planning on getting 6 large video lights, this time). So it should look a lot better... Unfortunately, it's also going to consume a lot of time — I'm replicating, to the best of my ability — the final 3:30 or so of The Usual Suspects. Ha! Disaster waiting to happen...

Clutter Export

2009.08.19 in code, gnome, and summer of code

I had a painful experience trying to make the video of gnomines-clutter for my last post... it seems to be very hard to capture OpenGL apps under X with any reasonable framerate. Anyway... after finally getting one of the dozens of programs that I tried to work (I can't remember which one now...), I decided I'd try to fix the problem from a different angle.

I'm really only interested in exporting the output of Clutter views, mostly. So, I figured I'd hack up Clutter to output PNGs for each frame. I added a check for the CLUTTER_EXPORT_FRAMES environment variable (or the --clutter-export-frames argument); if it's set, I discard the system time and instead draw every frame (incrementing the master clock by 1/CLUTTER_DEFAULT_FPS, so that the "frame rate" of the output is adjustable). When clutter_stage_paint is called, I read the pixels of the stage and export them to incrementally-numbered PNGs in the current directory.

This should work in theory. In practice, for some reason, some animations randomly speed up or slow down. You can see it in the video (most specifically with the sliding bounces when you finish a level).

Video of Lights Off with this here.

Patch is here. It's not particularly attractive... but maybe once it works I'll make it make more sense...

I'll have to harass someone working on Clutter and see if we can make it work/what I'm doing that's so crazy, because I'd really love for it to work!

There's at least one other thing that needs to be taken into account: idle time. Since frames are only exported when the stage is painted, when you're just sitting there doing nothing, nothing is exported, so the video runs like you're very, very quick with the mouse :-) But I'll work on that later...

Anyway, this might all be crazy or pointless. If so, I apologize! In any case, it can't possibly be as crazy as Carol's first blog post in many months... which is quite entertaining and awesome all at the same time, and details from a layman's point of view what she worked on all summer (while making fun of most of our crew at the same time). It's nice to see her getting along with GCC, finally! :-)

GSoC '09 Endgame

2009.08.18 in code, gnome, and summer of code

Today marked the final day of this year's Google Summer of Code! It's been a good summer, though I certainly didn't get as much done as I'd hoped, a lot of cool stuff got finished this summer.

Future in GSoC

I've decided that this is my last year participating in GSoC as a student; I had a great deal of fun both years, but I guess it's time to give others a chance, and I really don't like working on open-source with a definite deadline... it's more of a hobby to me than a "job", and I'd like to keep it that way for now — at least as long as I'm sitting at home/school; I think things would work a lot better if I had to go into work instead of working from somewhere where I'm comfortable/easily distracted. I guess a lot of people run into that problem...

Anyway; though I'm not going to participate as a student next year, I'd absolutely love to help out or mentor/co-mentor someone working on a GNOME-related (especially games, or Clutter, or Seed) next year. I think that would be great fun! But that's a good ways away now...

Also: be sure not to take any of the above to suggest that I'm leaving; far from it! I'm definitely going to be at Boston Summit this fall, and I plan to continue working on Seed and GNOME Games for the foreseeable future (as long as nobody wants to get rid of me (I realize there are some who want to get rid of all of us who peddle Clutter/GL/JavaScript/etc., but whatever...)).

Summer Results

It seems the general consensus is that my three games (lightsoff, same-gnome-clutter, and gnomines-clutter) will be moved to the "normal" section of GNOME Games (versus the "staging" section in which they currently reside) in master as soon as 2.28 is branched, and will ship with 2.30.

  • seed — I was more or less the active Seed maintainer during the majority of the summer, so this involved a lot of releases, patches, and bugs. I wrote a lot of documentation over the course of GSoC.
  • lightsoff — I completely rewrote Lights Off during the GSoC period, and created the entirety of the surrounding UI. It's 99% of the way there; it needs documentation and one preference to be removed (or made functional). The new version has theming, and is much more attractive and less buggy than v.1 or v.2.
  • same-gnome-clutter — Lots of updates and reorganization, as well as a bunch of preferences. And theming! (though there are no other themes, at the moment)
  • gnomines-clutter — Started an initial implementation, using things I've learned over the course of writing and rewriting the other two games. It has a very preliminary Clutter UI, but the game is theoretically playable.
Overall, I'm very happy with the games as they stand... I'm a little iffy about the performance of same-gnome-clutter, but I think I might know how to fix that. There's still a lot of work to do (saving high-scores still doesn't work, but I put that aside to work on gnomines-clutter so I would have something to show by the end of the project).

gnomines-clutter

Since nobody's seen any of gnomines except my family and Thomas, I guess I might as well show it to you here! Keep in mind that this is a total of a day of Clutter work (after working on and off for a few weeks in between other things on the underlying structure of the game and getting a playable CLI version working), so it'll get a lot better shortly. Also, I stole the flags and bombs from the current version of gnomines... that could be a good thing, or a bad thing... we'll see!

Click on the image for a short video!



I'll be creating a gnomines-clutter branch on GNOME Games git tomorrow (if nobody has any complaints) in which to continue working on this (right now I'm just using a local Git repo, so the code isn't published anywhere yet).

Seed 2.27.90 - quite the jump!

2009.08.10 in gnome and summer of code

I just pushed the tarballs/tag of Seed 2.27.90; Robb and Matt and I decided to jump to match the GNOME release number, to reduce confusion now that we're a module. Not sure that was a good idea because people might expect that we've passed "1.0" now, which we most certainly haven't done!

This is the first release to come with the FFI module, so you can do stuff like this:

var app = new ffi.Library();
var strcmp = app.strcmp;


strcmp.signature = {arguments: [GObject.TYPE_STRING, GObject.TYPE_STRING], returns: GObject.TYPE_INT};

print(strcmp("Hi", "Hi")); print(strcmp("Boo", "Foo")); print(strcmp("Foo", "Boo"));


(but please, only do that if you're really crazy... there are more useful applications; Robb has an example that calls out to XLib, too... which is a little longer but a good bit less silly...)

It also comes with a much more attractive way to install properties on GTypes. I haven't yet written documentation for this, but will in the next cycle. For now, I'll just note that it lets you do things like this:

OscillatorWidget = new GType({
    parent: Gtk.VBox.type,
    name: "OscillatorWidget",
    properties: [
        {
          name: "frequency",
          type: GObject.TYPE_INT,
          default_value: 1000,
          minimum_value: 0,
          maximum_value: 3000
    	}
    ], 
...


The property's flags default to readable/writable, but you can mark them as construct properties and then set them with the JSON construction notation. As I said before, documentation and polish are forthcoming.

And, for your reading pleasure, the Seed 2.27.90 complete ChangeLog:
  • Expanded and updated documentation; also available at library.gnome.org
  • All JavaScript contexts now have a __script_path__ property, which exposes the absolute, canonical path to the evaluated script
  • Add __init__.js functionality; if an imported folder contains __init__.js, it will be evaluated with the imported context as the 'this' object
  • Fix bug which caused inheritance from a GType created in Seed to fail
  • Add "pretty" property installation, see gtype-property-nice.js
  • New FFI module, provides an interface for calling non-introspected native C functions from JavaScript

Seed, the module!

2009.07.27 in gnome and summer of code

Last Wednesday, I got a wonderful email saying that Seed (alongside numerous other awesome projects) was accepted as an official GNOME module for 2.28. Many thanks to the release team and everyone who spoke out in support of us during the discussion period!

I've got no idea what's next in terms of things to do to get Seed ready for 2.28; I've been away (in Boston, visiting colleges with my little sister), so I haven't had a chance to look around and see what sort of work is involved. If anyone has any pointers, let me know!

Unfortunately my travel-netbook (Eee901) decided that Clutter wasn't something it wanted to deal with (on Karmic with xorg-edgers PPA, so I'm not surprised...), so I didn't get much GNOME Games work done this week, in Boston. I wrote some Seed documentation on the bus ride down, though. Oh, well. More to do this week!

In other news, I want some Tango t-shirts...

Happy Moon Day!

2009.07.20 in gnome, personal, and summer of code

As I'm sure everyone knows already, it's the 40th anniversary of Armstrong & Aldrin's landing on the moon. I really wish I'd been alive to see that — indeed, nobody's set foot on the moon or elsewhere in my entire lifetime so far! Hopefully we'll remedy that soon... I'd really like to visit, even if just for a short while. Someday!

It's also my 20th birthday! The 20th anniversary of the landing is pretty much one of the best possible birthdays for a geek, in my opinion...

Other things of note... the four of us are going to Boston (to visit schools with Amy) from Wednesday through Saturday; Amy's show (Romance/Romance) was excellent (one of the CTC's best...); Kaitlyn's home!; I started playing around with getting Mines going; etc.

At jclinton's request, I merged gsoc-seed-games into gnome-games master this week, so if you were tracking that, it's gone. Which, of course, means I managed to confuse some translators with unfinished strings and stuff (oops!). Hopefully that's mostly sorted out now (though I did notice that "Same GNOME (Clutter)" and "Same GNOME (Clutter, C)" are still getting translated unnecessarily, and I'm not sure what to do about that/what to call it/etc. Or, if we should just build one or the other depending on if you have Clutter or not... probably.

Some random pictures for your amusement (mostly all what people have seen before):







P.S. I apologize for shoving JavaScript and Clutter down your throats :-) (I really don't want to get in the middle of this...)

Seed 0.8.5, now with organized docs!

2009.07.11 in code, gnome, and summer of code

Just this afternoon, I pushed Seed 0.8.5 and gnome-js-common 0.1.1 to GNOME FTP. Both of these are primarily maintenance releases; however, Seed sees two new bits of code: native modules to bind MPFR and gettext. The bindings for the former are still incomplete and experimental, but the latter has already found use in my gsoc-seed-games branch of GNOME Games. Many thanks to Matt Arsenault for the MPFR bindings.

The largest change in 0.8.5 is a massive reorganization of the documentation. I've recently been somewhat irritated at some other projects' poor documentation, and have always appreciated the care that Clutter and GLib/Gtk+ always seem to have taken with their reference manuals (all three of which I rely on daily). This reorg is the first step I'm trying to take towards having a good reference guide for Seed, too. I realize that there's still a lot of writing to do, but the framework is finally there in a way that I feel comfortable working within.

Between 0.8 (I realize it says 0.7, someone forgot to update the source) and 0.8.5, we went from this:



to this:



As you can see, that's a pretty significant jump in structure. I've also decided to jump on the one-manual bandwagon, unless anyone objects, so I'm going to be updating and moving the tutorial into the manual, as well as constructing a Seed+Clutter tutorial (probably a walk-through of constructing a draft of one of my games, unless someone has a better idea). In addition, the runtime documentation (which covers using the JavaScript side of Seed) will be merged in (and is in dire need of updating).

I realize that some of the right-hand side long descriptions are somewhat contrived, but it looks so empty if you leave one out!

After the jump, the 0.8.5 ChangeLog:

  • Significant reorganization and expansion of the reference documentation
  • New native modules:
    • gettext
    • MPFR (partially complete)
  • Same Seed has moved to the gsoc-seed-games branch of Gnome Games (and will eventually move to master)
  • Add seed-module.h, which includes a handful of macros to make writing modules slightly more attractive. Look at gettext or the reference docs for examples.
  • Prefix native modules with seed_ (libseed_readline.so, etc.); this fixes the need to incessantly 'make clean' seed and cuts down on ambiguity in naming.
  • Add 'seed_value_is_string', 'seed_value_is_number', and 'seed_value_is_object_of_class' to libseed
  • Update examples to latest (now frozen) Clutter API changes.
  • Fixes a bug with the importer search path which resulted in the search path being overwritten each time something was imported
  • The importer now also searches the directory in which the script being executed is located by default.

See Older Posts