Deal with missing *.la files on CRUX

Many programs started removing *.la files in the recent years. I will not discuss about them, but from what I have understood it is an obsolete system. This leads to problems, when a program would no longer build since it expects to find *.la files that are no longer there.

For example, after a recent CRUX update, freetype no longer ships its freetype.la. Unfortunately, revdep cannot identify which ports need to be rebuilt. The issue was discussed on #crux and I found the solution here.

That’s a wonderful script that will search for and recompile everything that is still looking for a missing *.la file. I modified it a bit like this, so it accepts variable from input:

#!/bin/bash
rebuild-lib() {
    prt-cache update -fr -if -im -is \
        `for f in $(grep -lr "$*" /usr/lib/ 2> /dev/null | sed 's|.*/||'); \
        do prt-get fsearch $f | grep '^Found in' | sed -e 's|.*/||' -e 's|:$||'; \
        done | sort -u | xargs prt-cache isinst | grep -e 'is installed' | awk '{ print $2 }'`; 
}

rebuild-lib "${1}"

So, for example to rebuild ports that miss freetype.la I did:

prt-get cache
laRebuild.sh freetype.la

Great!



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s