You are not logged in.

#1 2013-11-07 02:15:47

Carl Karl
Member
Registered: 2013-06-12
Posts: 220

[solved] Clean way to include a "ln -s /usr/ /usr/..." in a PKGBUILD?

Hello,
in order to run a third party closed source software, I needed to

ln -s /usr/lib32/libjpeg.so /usr/lib32/libjpeg.so.62

In order not to do this by hand in the future, I'd like to make this by the PKGBUILD. But as far as I can see, the PKGBUILD script is only about files inside the package, not outside of them.

So is there a clean way to include

ln -s /usr/lib32/libjpeg.so /usr/lib32/libjpeg.so.62

in a PKGBUILD?
Thanks!

Last edited by Carl Karl (2013-11-08 00:42:54)

Offline

#2 2013-11-07 02:27:17

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: [solved] Clean way to include a "ln -s /usr/ /usr/..." in a PKGBUILD?

You ought not do this. Certainly, you mustn't do this if you plan to share the pkgbuild with others. Even if you only plan to use it yourself, it is a really bad idea.

This can be done. At least, not that exact command. But the equivalent. But I personally think that if you don't know how to do it, there is all the more reason you shouldn't do it since you probably have no idea of the sorts of trouble this is likely to cause. This just isn't the right way to solve the problem.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#3 2013-11-07 06:03:42

Carl Karl
Member
Registered: 2013-06-12
Posts: 220

Re: [solved] Clean way to include a "ln -s /usr/ /usr/..." in a PKGBUILD?

cfr wrote:

This can be done. At least, not that exact command. But the equivalent.

Thinking a bit more about it I found the way, thanks for that hint.


cfr wrote:

You ought not do this. Certainly, you mustn't do this if you plan to share the pkgbuild with others. Even if you only plan to use it yourself, it is a really bad idea.
But I personally think that if you don't know how to do it, there is all the more reason you shouldn't do it since you probably have no idea of the sorts of trouble this is likely to cause. This just isn't the right way to solve the problem.

I really understood what's your opinion on that (and you're right, this is not for the AUR), but you're right:

cfr wrote:

you probably have no idea of the sorts of trouble this is likely to cause.

Yes, I don't know, so I can't fully understand your opinion.

And I don't know what the alternative is. Leaving out the symlink leads to:

error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory

And as I said, it is unfortunately closed source (and I need it for my job), so what's the alternative?

I heard here, that unmanaged files are more or less the worst thing you can do, so including that symlink in the package makes it at least managed by pacman....

Last edited by Carl Karl (2013-11-07 06:04:06)

Offline

#4 2013-11-07 06:06:33

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,900

Re: [solved] Clean way to include a "ln -s /usr/ /usr/..." in a PKGBUILD?

The correct alternative is to build and install the correct version of libjpeg alongside of the current one.

Edit, I'm guessing it's here: https://aur.archlinux.org/packages/libjpeg6/ or even better: https://aur.archlinux.org/packages/libjpeg6-turbo/

Last edited by Scimmia (2013-11-07 06:21:29)

Offline

#5 2013-11-07 15:53:03

Carl Karl
Member
Registered: 2013-06-12
Posts: 220

Re: [solved] Clean way to include a "ln -s /usr/ /usr/..." in a PKGBUILD?

@Scimmia:
Been there, done that. No use, still

error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory

with both packages you mentioned.

(Perhaps I should at that the closed source 3rd party application is a 32bit program without having a 64bit equivalent, so therefore the /usr/lib32 path is needed.)

Offline

#6 2013-11-07 16:31:28

mcmillan
Member
Registered: 2006-04-06
Posts: 688

Re: [solved] Clean way to include a "ln -s /usr/ /usr/..." in a PKGBUILD?

Actually this seems to be the AUR package that should be built (though I'm at work and can't test it just yet to be sure) https://aur.archlinux.org/packages/lib32-libjpeg6/

Offline

#7 2013-11-07 17:13:36

Carl Karl
Member
Registered: 2013-06-12
Posts: 220

Re: [solved] Clean way to include a "ln -s /usr/ /usr/..." in a PKGBUILD?

@mcmillan:
Great, that works, thanks!

How can one find the matching package?

Last edited by Carl Karl (2013-11-07 17:25:20)

Offline

#8 2013-11-07 22:56:09

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: [solved] Clean way to include a "ln -s /usr/ /usr/..." in a PKGBUILD?

Sorry. I didn't mean to be so mysterious. Basically it hides a problem and it can cause further problems. So the application you do it for believes that it has a certain version of the library but it doesn't which could well cause weird failures, even if it does compile. Once that symbolic link is in your system, moreover, anything else you compile can potentially find it and try to compile against it. Suppose you were building something which did something conditionally e.g. "if we find version X of lib Y, assume A; if we find version Z of lib Y, assume B" or which just depended on a particular version of the library. Now you will have silent errors building up in the stuff you are compiling, even though it has nothing to do with the original application you installed the work around for.

There may be other reasons it is bad, too, which I don't know about. That's the stuff I know about.

Anyway, I'm certainly glad you found a better solution. As for finding packages, you could just search AUR using the web interface or you could use something like cower. In this case, you could try, for example:

$ cower -s lib32-libjpeg
aur/lib32-libjpeg6 6b1-1 (392)
    Legacy version of Library of JPEG support functions (32 bit)
aur/lib32-libjpeg6-turbo 1.2.1-1 (12)
    libjpeg derivative with accelerated baseline JPEG compression and decompression
aur/lib32-libjpeg7 7-3 (19)
    Library of JPEG support functions, version 7 (32 bit)

32 bit libraries for 64 bit systems all start lib32- so that's why I searched on lib32-libjpeg rather than just libjpeg. cower is an extremely useful, minimal and lightweight AUR helper. Obviously, you could use another AUR helper if you liked - cower is just my favourite.

Last edited by cfr (2013-11-07 22:57:34)


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#9 2013-11-08 00:41:01

Carl Karl
Member
Registered: 2013-06-12
Posts: 220

Re: [solved] Clean way to include a "ln -s /usr/ /usr/..." in a PKGBUILD?

@cfr
many thanks for your really useful answer! I  didn't know of cower before and so.

Offline

Board footer

Powered by FluxBB