<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<id>https://www.tortall.net/mu/blog</id>
<title>Recent Entries</title>
<updated>2008-02-09T09:00:07Z</updated>
<link rel="alternate" type="text/html" href="https://www.tortall.net/mu/blog"/>
<author><name>Michael Urman</name><uri>https://www.tortall.net/mu</uri></author>

<entry>
<title>Using quilt for inplace tooltips</title>
<link rel="alternate" type="text/html" href="https://www.tortall.net/mu/blog/2008/02/09/using_quilt_for_inplace_tooltips"/>
<id>https://www.tortall.net/mu/blog/2008/02/09/using_quilt_for_inplace_tooltips</id>
<updated>2008-02-09T09:00:07Z</updated>
<published>2008-02-09T16:39:06Z</published>
<category term="debian"/>
<category term="gtk+"/>
<category term="freesoftware"/>
<category term="quilt"/>
<content type="text/html" mode="escaped"><![CDATA[<div class="blog_entry" name="Using quilt for inplace tooltips">
<p>
As I talked about <a href="http://www.tortall.net/mu/blog/2008/02/06/inplace_tooltips_vs_aptitude" class="out">earlier</a>, I have a patch for showing <a href="http://bugzilla.gnome.org/show_bug.cgi?id=346992" class="out">inplace tooltips on a gtk+ treeview</a>. Furthermore as it's nearing time to update it, I wanted to record the steps necessary to do so and to apply it.
</p>
<p>
Most of what I know about quilt I learned from this <a href="http://pkg-perl.alioth.debian.org/howto/quilt.html" class="out">quilt howto</a> hosted on <a href="http://alioth.debian.org/" class="out">alioth</a>. So I'm by no means an expert; rather I know just enough to be dangerous. So here are the steps a Debian user can use to update and refresh my inplace tooltips patch.
</p>
<p>
First: set up quilt. Here's my modified <tt>/etc/quilt/quiltrc</tt> but feel free to put the equivalent in your own <tt>~/.quiltrc</tt> instead. The first line is critical; the others just simplify the patches.
</p>
<pre class="block">QUILT_PATCHES=debian/patches
QUILT_DIFF_ARGS="--no-timestamps --no-index"
QUILT_REFRESH_ARGS="--no-timestamps --no-index"</pre><p>
Second: get the build dependencies and source.
</p>
<pre class="block">% sudo apt-get build-dep libgtk2.0-0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

% apt-get source libgtk2.0-0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Need to get 23.6MB of source archives.
Get:1 http://http.us.debian.org unstable/main gtk+2.0 2.12.7-1 (dsc) [1565B]
Get:2 http://http.us.debian.org unstable/main gtk+2.0 2.12.7-1 (tar) [23.5MB]
Get:3 http://http.us.debian.org unstable/main gtk+2.0 2.12.7-1 (diff) [89.4kB] 
Fetched 23.6MB in 54s (430kB/s)                                                
dpkg-source: extracting gtk+2.0 in gtk+2.0-2.12.7
dpkg-source: unpacking gtk+2.0_2.12.7.orig.tar.gz
dpkg-source: applying ./gtk+2.0_2.12.7-1.diff.gz</pre><p>
Third: apply the patch.
</p>
<pre class="block">% cd gtk+2.0-2.12.7
% quilt import ../gtk+2.0-2.12.5/debian/patches/mu-inplace-tips.patch
Importing patch ../gtk+2.0-2.12.5/debian/patches/mu-inplace-tips.patch (stored as mu-inplace-tips.patch)</pre><p>
Fourth: update debian/changelog. You'll want to fix the conflict, revert the changes, or update the number.
</p>
<pre class="block">% quilt push mu-inplace-tips.patch
% quilt edit debian/changelog
[...]
% quilt refresh
Refreshed patch mu-inplace-tips.patch</pre><p>
Fifth: build the packages. This takes a while.
</p>
<pre class="block">% dpkg-buildpackage -us -uc
[...]</pre><p>
If anything breaks you'll probably have to run <tt>quilt pop mu-inplace-tips.patch</tt>, edit the patch to resolve the build failure, run <tt>quilt refresh</tt>, and try the build again.
</p>
<p>
Sixth: install the package, and optionally put it on hold. Note that you need only the libgtk2.0-0 package if you haven't bumped up the version in the changelog; you don't really need the others if you have, but they have tightly coupled version dependencies that complain if you don't use them.
</p>
<pre class="block">% cd ..
% sudo dpkg -i libgtk2.0-0_2.12.7-1+0mu_i386.deb libgtk2.0-dev_2.12.7-1+0mu_i386.deb gtk2-engines-pixbuf_2.12.7-1+0mu_i386.deb
[...]
% echo libgtk2.0-0_2.12.7-1+0mu_i386.deb hold | sudo dpkg --set-selections
% echo libgtk2.0-dev_2.12.7-1+0mu_i386.deb hold | sudo dpkg --set-selections
% echo gtk2-engines-pixbuf_2.12.7-1+0mu_i386.deb hold | sudo dpkg --set-selections</pre><p>
Finally restart any gtk+ programs you want to use your freshly updated gtk+ library.
</p>

</div>
]]></content>
</entry>
<entry>
<title>Inplace Tooltips vs. Aptitude</title>
<link rel="alternate" type="text/html" href="https://www.tortall.net/mu/blog/2008/02/06/inplace_tooltips_vs_aptitude"/>
<id>https://www.tortall.net/mu/blog/2008/02/06/inplace_tooltips_vs_aptitude</id>
<updated>2008-02-06T20:41:25Z</updated>
<published>2008-02-06T20:42:05Z</published>
<category term="gtk+"/>
<category term="debian"/>
<category term="freesoftware"/>
<content type="text/html" mode="escaped"><![CDATA[<div class="blog_entry" name="Inplace Tooltips vs. Aptitude">
<p>
A long time ago I started work to port my rudimentary treeview hack from its <a href="http://sacredchao.net/quodlibet/browser/releases/quodlibet-1.0/qltk/views.py" class="out">TreeViewHints python implementation in Quod Libet</a> to a much more <a href="http://bugzilla.gnome.org/show_bug.cgi?id=346992" class="out">solid inplace-tooltips implementation in gtk+ itself</a>. Inplace-tooltips are the little tips that appear as you move your cursor over items that aren't fully visible, and often appear immediately instead of after a hover delay.
</p>
<p>
For whatever reasons the patch has neither been nurtured and accepted nor denied, and has languished for most of the 19 months since I first filed the feature request. I personally suspect things varying from confusion over the term <q>tooltips</q> being in the name to malevolent negligence, but claiming either of those doesn't help the situation anyway.
</p>
<p>
Eight months ago I found a much better approach to it, which wrangled out some superficial bugs for free, and updated the patch. Finally over the past two weeks, I found that <a href="http://packages.debian.org/libgtk2.0-0" class="out">Debian's gtk+ package</a> had changed its build procedure, and this time was able to figure out how to integrate my patch. Wow, what a difference it makes to use it full time. In under two weeks I'd found and filled some important gaps in my initial implementations, including fixing the tip's position when a tree is scrolled horizontally.
</p>
<p>
But building my own Debian packages comes at a price. Not only does it take significant time to build the packages, there are three options each with disadvantages.
</p>
<ul>
<li>Apply just the code patch</li>
</ul>
<blockquote>By applying just the code patch I get all the behavior changes I want...so long as I don't run a package update. If I run a package update, the original libgtk2.0-0 package takes precedence over my package, and offers to reinstall.</blockquote><p>

</p>
<ul>
<li>Also apply a <a href="http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version" class="out">debian revision</a> suffix</li>
</ul>
<blockquote>When Ubuntu makes packages, they apply a suffix to ensure that Debian's packages of the same version do not override theirs, but a newer Debian package can (so long as all dependencies are satisfied). This prevents the official package from overwriting my patched packages. However doing this causes the policy of my package to move past the <i>testing</i> archive and into the limbo which pulls in packages from <i>unstable</i>. It also requires I install some auxiliary packages due to tight version dependencies in the core gtk+ related packages.</blockquote><p>

</p>
<ul>
<li>Apply an <a href="http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version" class="out">epoch</a></li>
</ul>
<blockquote>An epoch is a special version indication that would let me continue to call my package by the same version the rest of gtk+ does, but tell the package management system it's newer than the official package. Assuming Debian never needs to bump their epoch, this would insulate me from the <i>testing</i>–&gt;<i>unstable</i> bump, as my packages would always be even newer than the ones in <i>unstable</i>. However because of that it would be much harder to track when it was time to upgrade my own packages.</blockquote><p>
Currently I gave up on the first, and am still trying the second. I've run into one major hitch: <a href="http://wiki.debian.org/Aptitude" class="out">aptitude</a> doesn't work how I want it to. In particular I'm running with my suffixed package version 2.12.5-2+0mu, and <i>unstable</i> now has 2.12.7-1:
</p>
<pre class="block">% apt-cache policy libgtk2.0-0
libgtk2.0-0:
  Installed: 2.12.5-2+0mu
  Candidate: 2.12.7-1
  Version table:
     2.12.7-1 0
        601 http://http.us.debian.org unstable/main Packages
 *** 2.12.5-2+0mu 0
        100 /var/lib/dpkg/status
     2.12.5-2 0
        900 http://http.us.debian.org testing/main Packages</pre><p>
Because I'm beyond <i>testing</i> (which I have as my default), apt and aptitude want to attempt to keep me at <i>unstable</i> (my fallback) because it appears that's where I was before the update. I'm not ready to make this leap; I want to make it when 2.12.7 reaches <i>testing</i>. So I employ the next trick in the book: <a href="http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/rn01re01.html" class="out">hold</a>.
</p>
<p>
Hold is supposed to tell aptitude to ignore this package during normal upgrades until I explicitly tell it to install a newer version. But it just doesn't work. If you visit <a href="http://bugs.debian.org/aptitude" class="out">aptitude's bug page</a> and search for <q>hold</q> it becomes obvious that there have been lots of problems with hold, and most of them are still unresolved. Most of them have to do with synchronizing aptitude's list of holds with dselect (and apt's) list. But if that were all, I could work around it. Instead aptitude doesn't even follow its own holds:
</p>
<pre class="block">% dpkg --get-selections | egrep 'gtk2-engines-pixbuf|libgtk2.0-0|libgtk2.0-dev'
gtk2-engines-pixbuf				hold
libgtk2.0-0					hold
libgtk2.0-dev					hold
% sudo aptitude unhold gtk2-engines-pixbuf libgtk2.0-0 libgtk2.0-dev
[...]
% sudo aptitude hold gtk2-engines-pixbuf libgtk2.0-0 libgtk2.0-dev  
[...]
% sudo aptitude safe-upgrade
[...]
The following packages will be upgraded:
  gtk2-engines-pixbuf libgtk2.0-0 libgtk2.0-dev 
3 packages upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Need to get 6061kB of archives. After unpacking 12.3kB will be used.
Do you want to continue? [Y/n/?] n
Abort.</pre><p>
Now that I've seen this sloppy behavior among others, and seen just how many long standing bugs there are against aptitude, I think it's time to go back to dselect, apt-get, and deborphan. Too bad; aptitude seemed like a good idea at the time.
</p>

</div>
]]></content>
</entry>
<entry>
<title>Fixing im-ja</title>
<link rel="alternate" type="text/html" href="https://www.tortall.net/mu/blog/2007/07/06/fixing_im_ja"/>
<id>https://www.tortall.net/mu/blog/2007/07/06/fixing_im_ja</id>
<updated>2007-07-06T23:16:45Z</updated>
<published>2007-07-06T23:16:52Z</published>
<category term="debian"/>
<category term="gtk+"/>
<category term="japanese"/>
<content type="text/html" mode="escaped"><![CDATA[<div class="blog_entry" name="Fixing im-ja">
<p>
My favorite Japanese input method for gtk+, <a href="http://im-ja.sourceforge.net/" class="out">im-ja</a>, broke when I updated to Debian's gtk+ 2.10 packages. Since there's no upstream activity to speak of (much less new packages), and I can't seem to find this on the web anywhere else, here's the solution I eventually found. No doubt there's a better one out there that updates the package to use the new debhelper support for gtkimmodules to create this file, but I made mine by hand:
</p>
<pre class="block">% cat /usr/lib/gtk-2.0/2.10.0/immodule-files.d/imja.immodules 
# edited by hand
"/usr/lib/gtk-2.0/2.4.0/immodules/im-ja.so"
"im-ja" "Japanese" "gtk+" "/usr/share/locale" "ja"</pre><p>
I had tried compiling a new version of the existing package that would go into the 2.10.0 immodules folder, but that didn't help. When I wired that version up with the slight mode to the above file, it crashed applications that tried to use it. But the original im-ja package is still kicking!
</p>

</div>
]]></content>
</entry>
<entry>
<title>Article Mash-up (July, 2006)</title>
<link rel="alternate" type="text/html" href="https://www.tortall.net/mu/blog/2006/07/13/article_mash_up_1"/>
<id>https://www.tortall.net/mu/blog/2006/07/13/article_mash_up_1</id>
<updated>2006-07-13T06:32:33Z</updated>
<published>2006-07-13T06:33:14Z</published>
<category term="gtk+"/>
<category term="cairo"/>
<category term="licensing"/>
<content type="text/html" mode="escaped"><![CDATA[<div class="blog_entry" name="Article Mash-up (July, 2006)">
<p>
Just dropping a quick note here because Independence Week (I took a few extra vacation days after the 4th) gave me time to start more projects than I normally do. And now I'm really busy from them. So in that vein, three quick notes.
</p>
<p>
The first is a really cool <a href="http://bugzilla.gnome.org/show_bug.cgi?id=346992" class="out">patch to GTK+</a> which is the beginnings Inplace-Tooltips — the next generation version of my <a href="https://www.tortall.net/mu/blog/2006/01/31/free_softwares_underbelly_2" title="Free Software's underbelly (2)" class="wiki">TreeViewHints</a> hack. I have an Ogg Theora screencast of what it can already do in Ex Falso (with TreeViewHints disabled), and am hoping to make a MNG in case it's smaller. I think the hard parts of this battle are making sure the behavior is perfect, that it doesn't leak references, and getting the decision makers to recognize its importance.
</p>
<p>
The second is a request to those holding copyright interests in GPL-licensed GStreamer-using projects <a href="http://www.fluendo.com/" class="out">Fluendo</a> has <a href="http://lists.sacredchao.net/quodlibet/msg00914.html" class="out">asked</a> to consider relicensing under terms compatible with plugins with which they wouldn't otherwise be compatible. Don't. You chose to license your code under the GPL for a reason. You are being asked to weaken your support for Free Software for commercial reasons, and being offered only the opportunity to be distributed with a particular Linux distribution. You are being asked to trade your belief in Freedom for an imaginary increase in your user base. Freedom is worth much more than that. Stand up for your beliefs and don't worry about people using encumbered formats in distributions that can't handle this a better way.
</p>
<p>
The last is I've started learning Cairo and have put together the beginnings of a <a href="http://www.tortall.net/svn/mu/trunk/tenuki/" class="out">Go client</a> (so far it's just the board display). Cairo is a real treat to work with, but there's not any good introductory documentation. I received a great explanation of the basics just last night from <a href="http://cworth.org/~cworth/" class="out">Carl Worth</a> and I hope to put it and the rest of what I've learned into a series of blog posts, and later perhaps a three-in-one tutorial of PyGTK gobjects and cairo.
</p>

</div>
]]></content>
</entry>
</feed>
