Can't find Cairo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't find Cairo

Steven R. Baker
Heya,

I need some help telling Pharo where to find things. I've installed Bloc
into my image, and it can't find cairo. Cairo is installed, but as far
as I can tell Bloc is not looking for it in /usr/lib/x86_64-linux-gnu/
which is where it can be found.

I don't care to go making symlinks around my system: is there a sensible
way to tell Pharo where to find libcairo?

Thanks!

-Steven



Reply | Threaded
Open this post in threaded view
|

Re: Can't find Cairo

Peter Uhnak
Make sure you have the same image and lib version (64bit vs 32bit).

The paths where Pharo looks are described in CairoLibrary class.

CairoLibrary>>unix32ModuleName
"On different flavors of linux the path to library may differ
depending on OS distro or whether system is 32 or 64 bit.
Packages such as snapcraft can also change the path.
Look in a number of known locations, or LD_LIBRARY_PATH."

(#('/usr/lib/i386-linux-gnu' '/usr/lib32' '/usr/lib'),
(((OSEnvironment current getEnv: 'LD_LIBRARY_PATH') ifNil: [ '' ]) substrings: ':'))
do: [ :path | 
| libraryPath |
libraryPath := path asFileReference / 'libcairo.so.2'.
libraryPath exists
ifTrue: [ ^ libraryPath fullName ] ].
self error: 'Cannot locate cairo library. Please check if it installed on your system'

CairoLibrary>>unix64ModuleName
"On different flavors of linux the path to library may differ
depending on OS distro or whether system is 32 or 64 bit.
Packages such as snapcraft can also change the path.
Look in a number of known locations, or LD_LIBRARY_PATH."

(#('/lib/x86_64-linux-gnu' '/usr/lib'),
(((OSEnvironment current getEnv: 'LD_LIBRARY_PATH') ifNil: [ '' ]) substrings: ':'))
do: [ :path | 
| libraryPath |
libraryPath := path asFileReference / 'libcairo.so.2'.
libraryPath exists
ifTrue: [ ^ libraryPath fullName ] ].
self error: 'Cannot locate cairo library. Please check if it installed on your system'

Cheers,
Peter

On Sun, Oct 8, 2017 at 6:34 PM, Steven R. Baker <[hidden email]> wrote:
Heya,

I need some help telling Pharo where to find things. I've installed Bloc
into my image, and it can't find cairo. Cairo is installed, but as far
as I can tell Bloc is not looking for it in /usr/lib/x86_64-linux-gnu/
which is where it can be found.

I don't care to go making symlinks around my system: is there a sensible
way to tell Pharo where to find libcairo?

Thanks!

-Steven