I installed Arch. The setup is neat and I like it so very much , I am going to keep this for a while ( thats all I can say because my friends know me as a distro hopper ). Only one thing bugged me. I could’nt get Malayalam input methods working. Even though I tried copying Santhosh’s swanalekha m17 script, it didnt work properly. Yesterday I had a chat with Santhosh and he asked me to check the m17 version. On a whim , I checked scim-tables version too. It was 0.5.7 and scim-tables 0.5.8 contains Swanalekha. So I thought, why not try building it. I installed the Arch Build System ( pacman -Ss abs ). Running abs as root got all the build scripts that are used to build the distro into my system.
Now comes the actual package build part. I went digging into the tree that abs created in /var/abs. Thanks to the locate command, i found where scim-table package’s script resides. This build script, named PKGBUILD is an awesome piece. The makepkg program uses this script to create an Arch package. If you write this script properly, the package creation process is a breeze. It has all the information needed to get and build a package from source – its version,download URL, dependencies, build time dependencies, and md5 to verify if the downloaded package is corrupted and a lot more information. It also contains a function called build() which is called by makepkg to compile the package.
What i had to do was copy the PKGBUILD corresponding to scim-tables to an empty directory ( a work area ) of my choice, change the package version number from 0.5.7 to 0.5.8 and change the md5 sum to the one corresponding to v0.5.8 source tarball. Thats it .. or so it seemed, until I ran makepkg and I saw the build failing.
Now, what goes on during the build is simple. makepkg parses the PKGBUILD and uses the source found in it to get the source tarball. Then it extracts it to a sub directory called src and calls build(). The build(0 function usually contains the standard ./configure , make and make install ( to a sub directory called pkg in the work area directoy, not to the system directories ).
The build failed during make. This was shitty. I googled the error and found that a bug was filed against it in Debian tracker ( build fail ). Santhosh appeared online right then, and he asked me to go check Debian’s sources. And voila ! there was a patch !. But that patch contained a lot lot more other patches. So I checked what the patch did. It was just changing <string> to <cstring> in a source header. So I made the change and took a diff ( I used Kompare to do this. I like GUIs ).
Now i need to stick the diff file in the PKGBUILD script somehow so I can run patch inside the build() function just before ./configure. So I went to the Arch Package Making wiki. It said that I can just put the diff ( or any other file I want to use during build ) along with the PKGBUILD script and then refer to it from inside the script. I did so and added a line to patch the source file just before running the configure script.
Now I ran makepkg again, and Voila ! there it is. The shiny new scim-tables-0.5.8 package. I installed it ( pacman -U pkgname)
അതു കഴിഞ്ഞു സന്തോഷിന്റടുത്ത് മൊട കാണിച്ചു കഴിഞ്ഞപ്പൊഴേ സമാധാനമായുള്ളൂ. All this took around half an hour. I am loving it
The build script and patch I used are here.