Searching for Tao

Compiling KDE with debugging support in Arch Linux

One of the reasons I switched to Arch Linux was that I didn't want to have to compile all of my packages anymore. However, in leaving Gentoo for the Arch world, I also gave up a certain amount of ease of customisability (is that even a word?). Gentoo does, after all, excel in letting you do whatever you want to your machine and there are some circumstances where that's pretty important... even for users like myself.

Such a situation presented itself when I realised that the KDE binaries shipped with Arch do not include debugging support. This is obviously in place to improve performance, but for a bleeding-edge product like KDE, this also makes it very difficult to offer a good bug report. Thankfully, Arch's build system (abs) allows you to compile any program you want and install it with the package manager with little trouble... so I did just that.

Below is a quick script I wrote to rebuild all of my KDE binaries with debugging enabled. It's commented so you know what's going on:

  #!/usr/bin/env bash

  # Create a workspace if it isn't already there
  mkdir -p $HOME/abs

  # Fetch a list of kde packages from pacman
  PACKAGES=$(pacman -Qs kde | grep -v '^ ' | sed -e 's/ .*//' | sed -e 's/local\///' | grep '^kde')

  # Loop through the package list
  for PACKAGE in $PACKAGES; do

    echo $PACKAGE

    # Copy the package to your workspace
    cp -r /var/abs/extra/$PACKAGE $HOME/abs/
    cd $HOME/abs/$PACKAGE

    # Edit the PKGBUILD file to use debugging
    sed -i -e 's/DCMAKE_BUILD_TYPE=Release/DCMAKE_BUILD_TYPE=RelWithDebInfo/' PKGBUILD;
    echo "PATCHED"

    # Make the package
    makepkg -s

  done

Once you've built all of those (it'll take a long time... KDE is huge), you can install each one with pacman:

  # pacman -U PACKAGENAME-VERSION-i686.pkg.tar.gz

It's also a good idea to recompile qt as well. For that, you just add -debug to the configure list in its PKGBUILD file.

For more information, please visit the Arch Linux wiki page on ABS.

Random Favourites

Most Commented

Tags

Activism Advertising Agriculture Amsterdam Anarchy Animals Anime Appnovation Art Atheism Blasphemy Bloc Québécois Blogger British Columbia Broadway Canada Capitalism Career CBC CCTV Charity Christians Chrystal Cities Civil Rights Climate Change Coalition Code Snippets Communism Conservatives Consumerism Copyright Corporations Costumes Creative Commons Culture Cycling Death Democracy Diplomacy Django Dreams Dream Vancouver Drupal Economy Emily-Jane Energy Environment Ethics Facebook Family Food Free Software Friends Fun Stuff Gentoo Linux George Bush Germany Graffiti Green Party Hacking Health Health Care Homelessness Ideas Imager Iraq Israel Italy Japan Javascript Job Hunting KDE Korea Language Learning Liberals Linux Maps Marketing Media Melanie Memes Moments In Time Money Movies Moving Multiculturalism Munich Municipal Collective My Future Nationalism NDP Netherlands Net Neutrality New Mind Space Noreen Nuclear Olympics Oxyor/Marketsims Passing Thoughts Patents Perl Photography PHP Police Politics Prejudice Primus Privacy Programming Protests Provincial Campaign 2009 Public Space Published Python Racism Recipes Reinvent Religion Riptown 'Round-the-World Rydium Scams Science and Nature Scrubby Seattle Self Development Self Reflection Sex Socialism Software Solitude Sovereignty SSH Star Trek Stephanie Stephen Harper Street Furniture Stress Stupid People STV Suburbia Susan Switzerland Technology TED Television Terrorism The Arts TheChange.com The Economy The Toronto Public Space Committee The United States Toronto Transit Translink Travel Twitter Unemployment Urban Design Utrecht Vancouver Vancouver Public Space Network Violence War Weather Web Development Who Am I Wikipedia Windows Women Wordpress Work [at] Play Writing

Twitter Feed

Support Wikipedia