[Gentoo] Packaging science apps

I was just looking at my recent commits via CIA and noticed that I’ve packaged 15 new apps since Thursday, in addition to doing fonts for Xorg 7RC4. If you haven’t read this before, you may have missed my constant rants about how much science apps suck to package. The number greatly belittles the work that went into it.

A quick summary of the new apps:

Caver: Finds paths from protein cores to the surface to figure out how stuff gets in there
Maxit, Validation, PDB-Extract: Fixing PDBs (Protein Data Bank), converting to and from mmCIF
Sparky: NMR (Nuclear Magnetic Resonance) assignment and integration
Eden: Crystallographic electron-density refinement tool
Ortep3: Plots anisotropic B-factors (In human words, atoms vibrate differently in different directions)
Platon: A multipurpose crystallographic tool — calculates data from SHELX output, also graphics, etc
MAID: Automatically fits alpha-carbon chains to electron-density maps, with up to 85% accuracy

For those of you counting, the rest of the 15 come from dependencies of the above apps.

[Gentoo] XKB working!

After bugging people for an hour or so, I finally tracked down svu in #freedesktop to ask about my XKB issues. He got them figured out in probably 30 seconds.

Here’s the final setup to emulate the old en_US with my itouch keyboard and a compose with my menu key:

Option "XkbModel" "itouch"
Option "XkbLayout" "latin" #this changed
Option "XkbOptions" "compose:menu,lv3:ralt_switch" #this also changed

The changes were layout from en_US to latin, and adding the lv3 section to options. I never would’ve thought of trying latin; I figured it was some permutation of ‘us’ I was messing up. And the option is also quite obscure to me.

Thanks, svu! I don’t have $4.99, but hopefully this is good enough. =)

[Gentoo] XKB changes in xorg 7

I finally figured out why my XKB stopped working. It’s because of the xkeyboard-config files that were merged in around RC1/RC2 — some of the symbols files were deleted, including mine.

I was using en_US, a very convenient setup that allowed me to have accented/umlauted characters by hitting ralt+:, then the letter, or ralt+[, then the letter. I’ve looked around but I can’t find any alternative that works the same. Both the intl and alt-intl variants in the us symbols file basically suck for being usable, imho, because of the weird symbols they stick on the right side by default.

Any ideas for getting my en_US functionality back?

[Gentoo] Cleaning up “empty” font directories

Lots of programs (mkfontscale, mkfontdir, fc-cache, etc) keep metadata information in the same directory as the fonts. That information is regenerated upon installation of any new font or removal of any existing font in that directory by the ebuild, which then changes the MD5 sums and modification times of all that metadata. This means portage won’t automatically unmerge it, so we need to create a function to do so.

This function, called cleanup_fonts(), checks for a font directory with only metadata files in it. If it discovers any, it deletes them. I’d appreciate a couple more eyes on the code to make sure it’s sane, because it’s already in x-modular.eclass.

You can assume FONT_DIR is already set and sane at this point. It contains the names of each subdirectory in /usr/share/fonts/ that this particular package installed into.

Sorry about the lack of indentation; it doesn’t work by default, and I couldn’t figure it out in less than 10 seconds.

cleanup_fonts() {
local ALLOWED_FILES="encodings.dir fonts.cache-1 fonts.dir fonts.scale"
for DIR in ${FONT_DIR}; do

ebegin "Checking ${REAL_DIR} for useless files"
pushd ${REAL_DIR} &> /dev/null
for FILE in *; do
unset MATCH
if [[ ${FILE} = ${ALLOWED_FILE} ]]; then
# If it's allowed, then move on to the next file
# If we found a match in allowed files, move on to the next file
if [[ -n ${MATCH} ]]; then
# If we get this far, there wasn't a match in the allowed files
# We don't need to check more files if we're already keeping it
popd &> /dev/null
# If there are no files worth keeping, then get rid of the dir
if [[ -z "${KEEP_FONTDIR}" ]]; then
rm -rf ${REAL_DIR}
eend 0

[Gentoo] typespeed — Can you type random commands faster than your friend?

Polvi pointed out this strangely addictive app. There are choices from Unix commands to Spanish words and more.

I played it twice, and here’s how I did:

Top10 (score) (name) (level) (cps) (tcps) (typoinfos)

1. 562 donnie VeryGood 5.600 5.945 5.79% IT Person
2. 532 donnie VeryGood 5.295 5.505 3.81% Human

cps would be commands per second, so I’m floating around 5-6. Funnily, IT people apparently have more typos than regular humans.

You can also go it solo, if you swing that way.

[Gentoo] Learning how to fish

Here’s a picture of me learning fish shell syntax by screwing up bash syntax (Click for a bigger version):

fish syntax highlighting

As you can see, the syntax highlighting as you type and the errors are quite helpful in figuring things out.

[Gentoo] fish – a shell with syntax highlighting

I just added app-shells/fish to the tree. It’s a shell with syntax highlighting, awesome tab completion, and more. The tab completion for man pages, for example, actually includes the description of the command from whatis.

Look at the screenshots.

Update: More cool stuff about fish: It has really good error reporting, so it’s easy to find problems. If you type ‘help’ in the shell, it opens a browser (an X-based browser if DISPLAY is set, otherwise something like links/lynx) — This is cool because you get hyperlinks. Reworked syntax for much of the shell scripting features is self-consistent and easy to understand.

[Gentoo] WebMO, cool chemistry webapp

Yesterday I added WebMO to the tree. Here’s a few screenshots so you can see how it looks (Click for a bigger version.).

I don’t think the webapp-config hook script works properly, so you may need to fix all the paths in globals.int that point to /usr/share. globals.int is at /var/www/localhost/cgi-bin/webmo/interfaces/globals.int on a standard installation. The correct paths:


Also, I don’t think reinstallations work properly yet. They may overwrite your configuration from old installations. That’s why it’s in package.mask.

To log in for the first time, visit ${HOST}/cgi-bin/webmo/login.cgi. Username admin, blank password.

job manager
Here’s the “home screen.” It shows info on all the jobs you’ve run, and you can selectively view certain jobs.

job viewer
You can actually rotate the molecule, see vibrational modes, and so forth in the viewer. Also if you’ve calculated a spectrum, you can pop up a picture of it.

job options
This is where you select the type of job you want to run. Some of the programs have much more complex sets of options than Tinker.

[Gentoo] More molecular graphics / computational chemistry apps

Today I added two new molecular graphics packages — viewmol and gOpenMol. I’m working on tinker, a molecular mechanics package. So far, it installs everything to locations that make sense — and you’d be amazed how much work that was. But I haven’t tested how it runs yet, and that will surely require more fixes. I’m probably going to install WebMO tomorrow, so I have a consistent way to test tinker that doesn’t involve the CLI. That also raises the question of getting a WebMO ebuild together, which I’ll also work on.

In case you haven’t guessed, finals are next week so my procrastination kicked into high gear in the past day or two.

Update (12/3): Tinker’s now added and works great, except for FFE, the X-java front-end. This gives Gentoo a strong, free platform for computational chemistry from molecular mechanics (tinker) through semi-empirical calculations (mopac7) to quantum mechanics (gamess). Soon, I hope to add WebMO, the user-friendly front-end to all three in addition to some proprietary programs such as Gaussian.

[Gentoo] Firefox upgrade annoyances

First, there was that broken file in the digest, because I had downloaded an older version but it got updated on the mirrors.

Next, my middle clicks to open URLs don’t work. That in itself is enough to convince me to downgrade, because it’s critical to not wasting tons of time erasing and re-pasting URLs in the address bar. I’ll try looking for answers this weekend, but if I don’t find any, back to 1.0 I go.