PKG_CONFIG_PATH cairo.pc nie może znaleźć pixmana

1

postępując zgodnie z tą instrukcją: http://npmjs.org/package/canvas

Zainstalowałem cairo i pixmana, ale cairo nie może znaleźć pixmana.

Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pixman-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pixman-1' found
gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1. while trying to load binding.gyp

mój cairo.pc wygląda następująco:

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: cairo
Description: Multi-platform 2D graphics library
Version: 1.12.14

Requires.private:   gobject-2.0 glib-2.0      pixman-1 >= 0.30.0    fontconfig >= 2.2.95 freetype2 >= 9.7.3   libpng xrender >= 0.6 x11
xext
Libs: -L${libdir} -lcairo
Libs.private:           -lz -lz
Cflags: -I${includedir}/cairo

teraz zobacz, co się stanie, kiedy edytuję PKG_CONFIG_PATH ...

z:

PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig



[root@vps ~]# npm install canvas
npm http GET https://registry.npmjs.org/canvas
npm http 304 https://registry.npmjs.org/canvas

> [email protected] install /lib/node_modules/canvas
> node-gyp rebuild

Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pixman-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pixman-1' found
gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/root/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:415:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:786:12)
gyp ERR! System Linux 2.6.32-042stab065.3
gyp ERR! command "node" "/root/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /lib/node_modules/canvas
gyp ERR! node -v v0.10.3
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok 
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls canvas
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-042stab065.3
npm ERR! command "node" "/root/local/bin/npm" "install" "canvas"
npm ERR! cwd /lib
npm ERR! node -v v0.10.3
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /lib/npm-debug.log
npm ERR! not ok code 0

lub:

PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/usr/local/lib/pkgconfig



[root@vps ~]# npm install canvas
npm http GET https://registry.npmjs.org/canvas
npm http 304 https://registry.npmjs.org/canvas

> [email protected] install /node_modules/canvas
> node-gyp rebuild

make: Entering directory `/node_modules/canvas/build'
  CXX(target) Release/obj.target/canvas/src/Canvas.o
../src/Canvas.cc: In static member function ‘static v8::Handle<v8::Value>    Canvas::StreamJPEGSync(const v8::Arguments&)’:
../src/Canvas.cc:369: warning: passing ‘double’ for argument 2 to ‘void    write_to_jpeg_stream(cairo_surface_t*, int, int, closure_t*)’
../src/Canvas.cc:369: warning: passing ‘double’ for argument 3 to ‘void     write_to_jpeg_stream(cairo_surface_t*, int, int, closure_t*)’
  CXX(target) Release/obj.target/canvas/src/CanvasGradient.o
  CXX(target) Release/obj.target/canvas/src/CanvasPattern.o
  CXX(target) Release/obj.target/canvas/src/CanvasRenderingContext2d.o
../src/CanvasRenderingContext2d.cc: In static member function ‘static v8::Handle<v8::Value> Context2d::DrawImage(const v8::Arguments&)’:
../src/CanvasRenderingContext2d.cc:639: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:640: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:641: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:642: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:643: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:644: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:645: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:646: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:650: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:651: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:652: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:653: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:657: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:658: warning: converting to ‘int’ from ‘double’
../src/CanvasRenderingContext2d.cc:679: warning: converting to ‘int’ from ‘float’
../src/CanvasRenderingContext2d.cc:680: warning: converting to ‘int’ from ‘float’
../src/CanvasRenderingContext2d.cc: In static member function ‘static void Context2d::SetShadowBlur(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&)’:
../src/CanvasRenderingContext2d.cc:942: warning: converting to ‘int’ from ‘double’
  CXX(target) Release/obj.target/canvas/src/color.o
  CXX(target) Release/obj.target/canvas/src/Image.o
../src/Image.cc: In member function ‘cairo_status_t Image::loadGIFFromBuffer(uint8_t*, unsigned int)’:
../src/Image.cc:602: error: ‘cairo_format_stride_for_width’ was not declared in this scope
../src/Image.cc: In member function ‘cairo_status_t Image::decodeJPEGIntoSurface(jpeg_decompress_struct*)’:
../src/Image.cc:716: error: ‘cairo_format_stride_for_width’ was not declared in this scope
make: *** [Release/obj.target/canvas/src/Image.o] Error 1
make: Leaving directory `/node_modules/canvas/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/root/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:786:12)
gyp ERR! System Linux 2.6.32-042stab065.3
gyp ERR! command "node" "/root/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /node_modules/canvas
gyp ERR! node -v v0.10.3
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok 
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls canvas
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-042stab065.3
npm ERR! command "node" "/root/local/bin/npm" "install" "canvas"
npm ERR! cwd /
npm ERR! node -v v0.10.3
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /npm-debug.log
npm ERR! not ok code 0
Ben Muircroft
źródło
@tjholowaychuk w tym ( github.com/LearnBoost/node-canvas/issues/74 ) strona, którą mówisz: "brak cairo_format_stride_for_width () mówi mi, że potrzebujesz nowszego cairo". moje Cairo to wersja 1.12.14. to było 2 lata temu, jak mogę to naprawić?
Ben Muircroft
Mam dokładnie ten sam problem. Polecenie, które się nie powiedzie, jest następujące: pkg-config pixman-1 --libs mówiąc, że nie może znaleźć pixman-1.pc, który znajduje się w katalogu wymienionym w komunikacie $PKG_CONFIG_PATH
Daniel Beardsley
Przejdę przez to ponownie, teraz jest październik, gdzie jest pixman-1.pc?
Ben Muircroft

Odpowiedzi:

2

Dzięki twojemu pytaniu znalazłem moje rozwiązanie.

[server]$ ./configure --prefix=$HOME/test
[server]$ make
[server]$ make install
[server]$ ls -R ~/test/
~/test/:
include  lib

~/test/include:
pixman-1

~/test/include/pixman-1:
pixman-version.h  pixman.h

~/test/lib:
libpixman-1.a   libpixman-1.so    libpixman-1.so.0.32.4
libpixman-1.la  libpixman-1.so.0  pkgconfig

~/test/lib/pkgconfig:
pixman-1.pc

Wszystko czego wymagałem było

$ export PKG_CONFIG_PATH="$HOME/lib/pkgconfig/"

następnie pkg-config pixman-1 --libs zwróciło poprawną bibliotekę i mogłem skompilować cairo.


Być może jest jakiś problem z piksem znajdującym się w pkg-config: możesz spróbować ustawić zmienne środowiskowe, aby zastąpić pkg-config

pixman_CFLAGS - Flagi kompilatora C dla pixmana, przesłaniające pkg-config

pixman_LIBS - flagi linkera dla pixmana, przesłonięcie pkg-config

$ export pixman_CFLAGS="-I$HOME/include/pixman-1"
$ export pixman_LIBS="-L$HOME/lib/ -lpixman-1"

Inny problem / rozwiązanie

Pau Coma Ramirez
źródło
0

Po prostu kopiuj pixman.h i pixman-version.h z pixman-1 folder do wyższego folderu, który jest zawierać .

Teraz możesz biegać robić polecenie i działa jak urok.

S.Ahmad Abtahi
źródło
-1

Musisz zainstalować biblioteki deweloperów Pixmana - które te instrukcje zdają się pomijać.

# apt-get install libpixman-1-dev

Andrei
źródło