Saturday, July 25, 2009

When Opera hangs on some pages

To the urlfilter.ini file (for me under .opera in my home directory) exclude the url 'http://pagead2.googlesyndication.com/*".

These instructions come from
http://groups.google.com/group/opera.os.solaris/browse_thread/thread/31e222e9f82bc04e.

Saturday, June 20, 2009

Changing the RPATH of a binary

Suppose that you have two different versions of a library installed on /usr/lib and /usr/local/lib. Further suppose that for most software you run you will want to use the standard one in /usr/lib, but for a specific program you're compiling you need to make it use /usr/local/lib. The problem is that GCC builds in a search path used at runtime where /usr/lib is always before /usr/local/lib. This means that the binary will always find the wrong library in /usr/lib before it finds the library in /usr/local/lib. You can use ldd and "ldd -s" to check which libraries the binary uses.

Because I don't have a good solution I do this: Use elfedit to edit the binary to change the search path.

Step 1.
Get the current search path. (-r means read-only so you will only display the current one)
# elfedit -r -e 'dyn:runpath' file
index tag value
[31] RUNPATH 0x494b /usr/ccs/lib:/lib:/usr/lib:/usr/sfw/lib:/usr/local/lib
[32] RPATH 0x494b /usr/ccs/lib:/lib:/usr/lib:/usr/sfw/lib:/usr/local/lib

See how /usr/lib is before /usr/local/lib? That is my problem here.

Step 2.
Change the path so that /usr/local/lib is before /usr/lib.
# elfedit -e 'dyn:runpath /usr/ccs/lib:/lib:/usr/local/lib:/usr/lib:/usr/sfw/lib' file

Step 3.
Verify that it has changed.
# elfedit -r -e 'dyn:runpath' file
index tag value
[31] RUNPATH 0x4982 /usr/ccs/lib:/lib:/usr/local/lib:/usr/lib:/usr/sfw/lib
[32] RPATH 0x4982 /usr/ccs/lib:/lib:/usr/local/lib:/usr/lib:/usr/sfw/lib

This is the problem I

Wednesday, June 10, 2009

Build awesome 3.2.1 on OpenSolaris 2009.06

There are a number of prerequisites that need to be built before building awesome and a number of them that can be easily installed via IPS.

Getting awesome
Download awesome 3.2.1 from awesome's main site.

Needed IPS packages
You need to install these packages (by "pfexec pkg install SUNWxxx"):
  • SUNWcmake
  • SUNWgnu-gperf (needed by ?)
  • SUNWgmake
  • SUNWgnome-common-devel (for pkg-config)
  • SUNWxwinc (for pthread-stubs and xau, required by libxcb)
  • SUNWgm4 (for xcb-util)
  • SUNWlua (for awesome itself)

Prerequisites
The XCB library and utilities must be installed. I used the following versions:
and they are to be built in that order. Before building "libxcb", set the PKG_CONFIG_PATH environment variable to include "/usr/local/lib/pkgconfig". In bash:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

These are compiled by running "./configure", "gmake", "pfexec gmake install". This will by default build them to be placed under "/usr/local".
If, when you do "./configure" on libxcb get something like the following:
checking for XCBPROTO... configure: error: Package requirements (xcb-proto >= 1.1) were not met:

No package 'xcb-proto' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
then that means you haven't set the PKG_CONFIG_PATH to "/usr/local/lib/pkgconfig".

Building cairo, pango and imlib2
Get cairo 1.8.6 here.
Get pango 1.24.2 here.
Get imlib2 here.
For cairo, use these configure flags to enable xcb and disable xlib.
./configure --enable-xcb --disable-xlib
Also here, run "gmake" and "pfexec gmake install".

For pango, use these configure flags to disable xlib.
./configure --without-x
And then "gmake", "pfexec gmake install".
For some versions of pango there is a bug in which pango tries to include "cairo-xlib.h" even when using the "--without-x" configure flag. In that case, go here
and get the patch (the .diff file) and apply it to pango using (assuming you save the patch file as pango_cairo_xlib.diff):

patch -p0 < pango_cairo_xlib.diff
and recompile.

Build imlib2 using "./configure", "gmake", "pfexec gmake install".

Building readline and libev
The readline main site is here.
Get libev from here.
Compile both using "./configure", "gmake", "pfexec gmake install".

Compiling awesome
There are a few things that need to be adjusted in awesome's build scripts to make it link cleanly. No changes should have to be made to the actual code.

The following patch adds libsocket to required libraries.
--- awesomeConfig.cmake.orig 2009-06-11 20:27:17.136714602 +0200
+++ awesomeConfig.cmake 2009-06-11 20:26:31.525618560 +0200
@@ -163,6 +163,7 @@
# Check for readline, ncurse and libev
a_find_library(LIB_READLINE readline)
a_find_library(LIB_EV ev)
+a_find_library(LIB_SOCKET socket)

# Error check
if(NOT LUA51_FOUND AND NOT LUA50_FOUND) # This is a workaround to a cmake bug
@@ -173,6 +174,7 @@
${AWESOME_COMMON_REQUIRED_LIBRARIES}
${AWESOME_REQUIRED_LIBRARIES}
${LIB_EV}
+ ${LIB_SOCKET}
${LUA_LIBRARIES})

set(AWESOME_REQUIRED_INCLUDE_DIRS
@@ -184,6 +186,7 @@
${AWESOME_COMMON_REQUIRED_LIBRARIES}
${LIB_READLINE}
${LIB_XCB}
+ ${LIB_SOCKET}
${CURSES_LIBRARIES})

set(AWESOMECLIENT_REQUIRED_INCLUDE_DIRS

The following patch fixes an unexpected link flag.

--- CMakeLists.txt.orig 2009-06-11 20:28:37.049608031 +0200
+++ CMakeLists.txt 2009-06-11 20:28:21.726953876 +0200
@@ -100,7 +100,7 @@

set_target_properties(${PROJECT_AWE_NAME}
PROPERTIES
- LINK_FLAGS -export-dynamic)
+ LINK_FLAGS --export-dynamic)

target_link_libraries(${PROJECT_AWE_NAME}
${AWESOME_COMMON_REQUIRED_LIBRARIES}


To compile, run "gmake".

Awesome actually compiles at this point, but I had problems with it finding the incompatible versions of cairo already installed in /usr/lib by default in OpenSolaris. To fix that I had to edit the binary with elfedit and set a different runpath on the awesome binary itself, but I'll leave that for an edit of this post.

Wednesday, May 27, 2009

Keyboard repeat stops working

On my machine at home, that runs OpenSolaris 2008.11, keyboard repeat sometimes stops working. I
recently found out that running "xset r on" (or "xset r", I ran it a couple of times) makes it work again. Previously I've had to log out/log in again (or reboot the machine, I can't exactly remember).

Wednesday, May 14, 2008

Paket, mina älskade

Jag tycker om att öppna paket. Inte så mycket att jag vill bli paketets pojkvän, eller nåt, men ganska mycket i alla fall. Det är bara under dom senare av mina 26 år som jag inte är helt spattig under julafton, när man måste sitta ner och äta mat och vara social och andra helt värdelösa saker, innan man får göra det julafton handlar om, vilket är att öppna paket. Sekularitet is full of win!

Hursomhelst, det är inte presenterna som är det viktiga, utan paketen. Det där härliga känslan när man får smeka bort allt presentpapper och med djupa andet... Hoppsan, nu ska vi inte gå dit. Det är ett annat inlägg.

Häromdagen fyllde min vän Arno år. Han fick öppna paket. Det fick inte jag. Men, jag kom på idén att bygga in en liten, liten (stor!) laddning av konfetti i ett paket som exploderar när man öppnar det. Eftersom jag är dålig på att hålla käft om såna här saker så kommer alla mina vänner vara på vakt när dom får presenter av mig ("Erik, varför tickar presenten?!"). Men jag har andra idéer än konfettiexplosioner. Mmmm, goda smaskiga idéer...

Nu når jag Kista snart, så nu måste jag sluta.

[Edit]
Formattering is not teh win!

Sunday, April 20, 2008

Han kan inte vara tyst

Jag har svårt att hantera honom. Det är inte så mycket det att han pratar så mycket, det klarar jag av. Vi träffas bara under korta stunder. Det som stör mig är att han säger såna rasistiska saker.

Jag tror att jag måste konfrontera honom. Det börjar gå så långt att jag funderar på att byta ut honom. Jag menar, det är min lägenhet och han har inte direkt någon rätt att vara där. Han är ju bara en toalettstol.
Det är speciellt på morgonen innan jag går till jobbet som han är som jobbigast. Jag är vanligtvis lite morgontrött och orkar inte hantera honom varje morgon när jag rakar mig eller använder honom.
Jag håller verkligen inte med om dom hemskt rasistiska och kvinnofientliga saker han säger, men då på morgonen orkar jag inte alltid bråka med honom. Ibland slår jag till och med ner toalettlocket lite extra hårt, bara för att göra honom illa.

Jag får inte något stöd att tala om från min familj heller. Dom har inte samma förhållande till sina toalettstolar som jag har till min, så dom förstår inte att jag pratar med honom. Jag tror faktiskt inte riktigt dom har greppat att han pratar till mig. Jag förstår inte riktigt varför, men dom har svårt med det.
Nä, jag tror inte att jag orkar med det längre. Om han inte börjar uppföra sig som en vanlig toalettstol så byter jag ut honom, mot en som inte är rasistisk på det sättet han är. Jag bryr mig ärligt talat inte längre om vad som händer med honom.

Jag får väl vara glad för att det bara är han som pratar med mig så här. Förutom min sittpuff så klart, men henne tycker jag om. Hon har humor. Det kanske man måste ha för att klara av att folk sätter sig på en hela tiden.

Thursday, April 17, 2008

Erik, den store poeten

Jag binder fast dig i mig,
jag vill inte tappa greppet

Du darrar i mina händer,
jag vill så gärna att det är av lust

När jag ser på dig, så kan jag inte vända bort blicken,
jag fastnar i dig, i timmar och timmar

Du är mitt Nintendo, och jag är din, för evigt