Monday, May 06, 2013

Building GTK+ 3 Library

I have spent my days building GTK+ 3 and components for my project inside my Thinkpad E125 running on Ubuntu 10.04 LTS (Lucid Lynx).

Below are GTK+ 3 components that need to be downloaded from their respective project site:
Installation directory is under /opt/gtk, pkg-config ($PKG_CONFIG_PATH), dynamic library ($LD_LIBRARY_PATH) and system path ($PATH) environment variable should be determined (depends on package) in order to configure and compile each package. Notice that I passed extraction process for each package and cover only build and installation.

Also it is important to have a correct version for package dependency, for example GTK+ 3.6.4 requires at least version 2.34.x of Glib, as well as other package. gtk-doc is optional (enabled with --enable-gtk-doc configure argument) to generate GTK+ HTML style documentation which very important to me.

So here are the building steps:
  • gtk-doc-1.18
    $ ./configure && make && sudo make install
  • glib-2.34.3
    $ ./configure --prefix=/opt/gtk --enable-gtk-doc
    $ make && sudo make install
  • atk-2.6.0
    $ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig LD_LIBRARY_PATH=/opt/gtk/lib ./configure --prefix=/opt/gtk --enable-gtk-doc
    $ make && sudo make install
  • at-spi2-core-2.6.3
    $ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig LD_LIBRARY_PATH=/opt/gtk/lib ./configure --prefix=/opt/gtk
    $ make && sudo make install
  • at-spi2-atk-2.6.2
    $ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig LD_LIBRARY_PATH=/opt/gtk/lib ./configure --prefix=/opt/gtk
    $ PATH=/opt/gtk/bin:$PATH make
    $ sudo PATH=$PATH:/opt/gtk/bin make install
  • pixman-0.28.2
    $ ./configure --prefix=/opt/gtk
    $ make && sudo make install
  • cairo-1.2.14
    $ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig ./configure --prefix=/opt/gtk --enable-gtk-doc
    $ make && sudo make install
  • gdk-pixbuf-2.29.0
    $ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig LD_LIBRARY_PATH=/opt/gtk/lib ./configure --prefix=/opt/gtk --enable-gtk-doc --without-libtiff
    $ make && sudo make install
  • freetype-2.4.11
    $ ./configure --prefix=/opt/gtk
    $ make && sudo make install
  • fontconfig-2.10.91
    $ ./configure --prefix=/opt/gtk
    $ make && sudo make install
  • harfbuzz-0.9.16
    $ ./configure --prefix=/opt/gtk
    $ make && sudo make install
  • pango-1.32.5
    $ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig ./configure --prefix=/opt/gtk --enable-gtk-doc
    $ make && sudo make install
  • gtk+-3.6.4
    $ PATH=/opt/gtk/bin:$PATH PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig LD_LIBRARY_PATH=/opt/gtk/lib ./configure --prefix=/opt/gtk --enable-gtk-doc --enable-packagekit=no
    $ PATH=/opt/gtk/bin:$PATH make
    $ PATH=/opt/gtk/bin:$PATH sudo make install
To test if the build was successful, the easy way is to run gtk3-demo program inside /opt/gtk/bin, previously have provided dynamic module path either in ld.so.conf or by set LD_LIBRARY_PATH environment variable at the runtime, for example:

$ LD_LIBRARY_PATH=/opt/gtk/lib /opt/gtk/bin/gtk3-demo

To compile and link against GTK+ 3 (or any component), use pkg-config environment variable PKG_CONFIG_PATH to set GTK+ 3 pkg-config file location for both --cflags and --libs argument.

Monday, October 01, 2012

Leaving DB

Back to October 2008, when I was in Bandung, I got a call from a HR manager in Jakarta asked me for a job interview. Then 1 week after it, I go to Jakarta to meet the HR manager, after a long negotiation and spending some weeks in the city I'm officially hired by the company.

I started my days to build their network infrastructure and next advance to system programmer. I design Linux device and application for one of their most important device. From this experience I proofed how good Linux for the industry, tons of features, highly customizable and undoubtedly reliable. I proofed how good the collaboration of the Debian project, proofed the GTK+ interface and usability, proofed how good POSIX thread was implemented and more. I have learned many things from serial port devices to card and reader interfaces.

For some personal decisions (human natures such as dislike and disagree) I decided to leave the company and advance to the next level of complexity. I have worked with peoples who has great determination and spirit, got so many friends there. This is my 4th years relation with the company, thanks for giving me such a great experience, wish the best success for you. And I hate to say Goodbye!.

Thursday, April 26, 2012

Dream Theater World Tour

Time is running quickly but what I was missing? nothing, especially it is one of my favorite metal band tour, yeah Dream Theater (DT) is about to come to Jakarta at 21th April 2012. The tour is named after their 11th album's title: A Dramatic Turn of Events world tour and luckily they also pick Jakarta as tour destination, so I would like to say thanks to Variant Entertainment as promoter for bringing the progressive metal band here (and also for the high-price ticket). This is their first (might be the ONLY one) visit to Indonesia, so I will not take any compromises and must go to the show.

Saturday 21th April I wear my metal attributes: Black CONVERSE John Varvatos (limited edition), Black Led Zeppelin sweater and a old black jeans, unfortunately my DT t-shirt is out of date now, so no DT stuff. Approx. at 3 PM I start from Arion Plaza by a taxi heading to Mata Elang Indoor Stadium (MEIS) at Ancol for the metal show after withdrawing the ATM for IDR 2,000,000.

Arrived at MEIS stadium, there are already a lot of DT's fans and they are here also for one reason: A metal show from a world class band, just like me. Then I look for the official ticket sale, and I feel lucky because there are buy-1-get-1-free ticket that means if you buy 1 ticket you will get 1 free ticket, it cost IDR 1,500,000 but with one condition: the voucher will be available for exchange (for the real ticket) after 7.45 PM, yeah sounds like a marketing strategy or what the hell. I will have 2 tickets, so I call my friend Iwan and asked if is available to join me for the show, considering he was also a crazy DT fan, yeah, of course he was available.

It is on 4 PM, DT fans is keep coming from everywhere, still has a lot of time to wait before the show that begin at 9 PM. So I wasted my times by taking some pics, walking around in front of MEIS stadium, eating AW fast food and walking. At 7.30 PM, the stadium was fulled by fans who came for the live show. I was queued for ticket exchange and got it, 2 Last Entry Festival tickets, at the time peoples were entering the stadium, one I still missing is Iwan, he was still heading here. I wait this guy in front of stadium until he came at probably 9 PM.

Entering MEIS stadium and going to the festival area, it still a solo acoustic guitar player as opening, peoples are shouting while he played A Change of Session intro as his closing. The band's crew are coming, opening the black large fabric and the stage showing up. Fantastic view, so that is the Dramatic Turn of Events tour's theme, it has 3 big box as background display and fantastic lightnings, the crew also tune some well known rock song, some of them are Anything Goes (AC/DC), Welcome To The Jungle (Guns N' Roses) while preparing. And the shows begin, John Petrucci attack us with Bridges In The Sky, you know the situation should be, a metal band with almost 8000 fans are watching, the band continue with Build Me, Break Me Down also from Dramatic Turn of Events album. Then a nostalgic song: 6.00 (Awake), after that Jordan Ruddes take the intro of Sorrounded (Images And Words), I keep singing and banging my head. The spectator did the same, keep their hand higher with metal sign and follow James LaBrie singing while the lights keep it's magic. The band continue with these songs in a a row The Root of All Evil (Octavarium), A Fortune In Lies (When Dream And Day Unite). After that, John Petrucci pick a accoustic guitar and sit beside James LaBrie, it is going to be acoustic. We sing together when they playing Silent Man (Awake), a very good song, then followed by the last song of Dramatic Turn of Events album, Beneath The, what can I say, this song was so beautiful and meaningful, one of DT killer song. Continue with On The Back of Angels. Then the most liked song: The Spirit Carries On (Metropolis), yeah everybody is singing and enchanted by this one. After that is Mike Mangini drum solo, I think he is very skilled drummer who able to replace Mike Portnoy, and John Myung also rocks too. Continue to Breaking All Illusions, this song is very dynamic and complex, It has good pattern and reff lyrics to sing. We want more... We want more... we are shouting this after they left the stage, this is a ancient band ritual, the band want to hear if you are demanding more. So they back to the stage and playing Pull Me Under (Images And Words), and the fans was again enjoying the famous DT's hit. So this is will be their last song. What a very fantastic and monumental event.

So that's all, Dream Theater live. thanks DT, you are one of the best band in my soul. That's all I can say. Then me and Iwan take a rest at AW for some foods and drinks, then leaving Ancol.

Thursday, March 15, 2012

systemd rc.local

In Fedora 16 (Verne) the init program has been completely replaced by systemd. systemd still provide SysVinit script compability such as the famous rc.local script. I noticed that Fedora 16 doesn't enable this by default, here a solution to enable this.

Create a rc.local script file at /etc/rc.d, for convenience we can provide this as link to it's common location with

# ln -sf /etc/rc.d/rc.local /etc/rc.local

Then activate the service and start it with

# systemctl enable rc-local.service
# systemctl start rc-local.service

Now systemd should run the rc.local script through the rc-local.service

Friday, February 10, 2012

Set single bit integer

Sometime you may lose your mind on how to operate with single bit in an integer, moreover if you are not using bit operation for a long time. This is a quick refresh to deal with single bit operation.

Given variable a type of int

To set the nth bit
a |= (1 << n)

To clear the nth bit
a &= ~(1 << n)

To toggle the nth bit
a ^= (1 << n)

To get nth bit value
a >> n & 1