CentOS編譯安裝GIMP

gimp是擴平臺的圖像處理軟件

因爲最近要在linux上做幾張圖片決定安裝它試試

直接yum install gimp貌似有問題

一啓動就說什麼有錯誤

還是決定走源碼安裝的不歸路

因爲源碼編譯的需要的包可能系統中會存在

但若直接替換可能會引起其它軟件崩掉

configure時最好用--prefix=指定下安裝路徑


gimp的源碼包可以在官網上下載

./configure --prefix=/app/gimp2.8.8出現錯誤

configure: error: Package requirements (babl >= 0.1.10) were not met:

No package 'babl' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

本來以爲yum install babl就可以的,沒想到出現

Setting up Install Process
Package babl-0.1.2-4.el6.i686 already installed and latest version
Nothing to do

yum的babl太舊了,看來得自己下載

http://www.linuxfromscratch.org/blfs/view/svn/general/babl.html下載到babl-0.1.10.tar.bz2安裝很簡單,./configure --prefix=/app/babl-0.1.10 && make && make install就可以了

因爲我把babl放在了/app/babl-0.1.10目錄下

所以現在需要改下PKG_CONFIG_PATH這個環境變量

vim ~/.bash_profile

加上 PKG_CONFIG_PATH=$PKG_CONFIG_PATH:babl安裝目錄/lib/pkgconfig

      export PKG_CONFIG_PATH

然後打開新的終端執行下 . ~/.bash_profile  

再在這個終端重新configure剛纔的gimp


又出錯了

No package 'gegl-0.2' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefi

還是yum中的包太老了,還得重新下載

gegl可以在ftp://ftp.gimp.org/pub/gegl/0.2/中下載

gegl在configure的時候也需要剛纔的babl,如果不是在剛纔打開的終端中執行的話,需要再 執行一次 . ~/.bash_profile

安裝gegl還會遇到需要GLib >=2.28的情況,

http://ftp.gnome.org/pub/GNOME/sources/glib/

下載(最好下載最新的,),

然後也是configure--make--make install(安裝最新的要求要有libffi

http://sourceware.org/libffi/下載)

安裝好GLib後,也要重新編輯下~/.bash_profile

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:babl安裝目錄/lib/pkgconfig:glib安裝目錄/lib/pkgconfig

      export PKG_CONFIG_PATH

重新configure gegl,又有新問題

*** 'pkg-config --modversion glib-2.0' returned 2.28.8, but GLIB (2.22.5)
*** was found! If pkg-config was correct, then it is best
*** to remove the old version of GLib. You may also be able to fix the error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
*** to point to the correct configuration files

這是因爲系統默認有glib庫,你又安裝了一個版本,configure在查找時會找到兩個版本,所以會產生錯誤

解決方法
直接設置個臨時變量LD_LIBRARY_PATH

export LD_LIBRARY_PATH=你安裝的glib目錄/lib

然後重新configure就行了

接着就是make 和make install


安裝好gegl後,記得修改下PKG_CONFIG_PATH變量,不要把剛纔的glib去掉,後面還要用

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:babl安裝目錄/lib/pkgconfig:glib安裝目錄/lib/pkgconfig:gegl安裝目錄/lib/pkgconfig


然後打開新的終端執行下 . ~/.bash_profile  

之後重新configure gimp


又來了。。。。

Requested 'atk >= 2.2.0' but version of Atk is 1.28.0

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

繼續搞atk

可以在http://ftp.gnome.org/pub/GNOME/sources/atk/上下載

最好下載新的,新的要求GLib要大於2.31

如果剛纔的GLib下載不高,最好重新下載,然後重裝下之前的gegl

configure-make-make install 後

再改下 PKG_CONFIG_PATH

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:babl安裝目錄/lib/pkgconfig:gegl安裝目錄/lib/pkgconfig:atk安裝目錄/lib/pkgconfig

然後打開新的終端執行下 . ~/.bash_profile  

繼續重新configure gimp

之後會出現又是glib重複的問題

設置下LD_LIBRARY_PATH


然後又出現需要GTK了。。

http://www.gtk.org/download/linux.php

爲了防止3.X和2.X會有衝突,就下了2.X中的最高版本

安裝GTK還需要gdk-pixbuf

http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/

安裝gdk-pixbuf又說需要libtiff

*** Checks for TIFF loader failed. You can build without it by passing
*** --without-libtiff to configure but some programs using GTK+ may
*** not work properly

雖然可以禁用,不過還是裝上好了,都搞這麼多了。。

解決方法很簡單了 yum install libtiff-devel

就可以了,

裝好gdk-pixbuf後別忘了加到PKG_CONFIG_PATH中

然後新開個終端

執行 .  ~/.bash_profile

         export LD_LIBRARY_PATH=glib安裝目錄/lib

重新configure 下gtk就可以 make 和 make install gtk了

然後是再把gtk加入到PKG_CONFIG_PATH中

然後重開終端

執行之前那兩個命令(不過這次後一個命令變成了export LD_LIBRARY_PATH=glib安裝目錄/lib/:gtk安裝目錄/lib)

然後重新configure gimp

如果認爲這次就要搞定了,那就錯了。。。

equested 'cairo >= 1.10.2' but version of cairo is 1.8.8

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

http://cairographics.org/releases/上下載cairo最新版本

這個簡單了configure-make-make install就可以了

之後也是添加到PKG_CONFIG_PATH中

然後開個新終端

執行上面兩個步驟


。。。還是有問題 不過預感應該是最後的問題了~~

*** We require Pango with the optional support for Cairo compiled in.
*** See the file 'INSTALL' for more help.

http://ftp.gnome.org/pub/GNOME/sources/pango/上下載pango

pango需要cairo,確保configure之前執行 . ~/.bash_profile


configure pango時會出現

checking which cairo font backends could be used... none
configure: Disabling cairo support
configure: error: *** Could not enable any backends.
*** Must have at least one backend to build Pango.

那是因爲還得裝上三個東西

harfbuzz、freetype、fontconfig

harfbuzz可以在http://www.freedesktop.org/wiki/Software/HarfBuzz/上下載

freetype可以在http://www.freetype.org/download.html上下載

fontconfig可以在http://www.freedesktop.org/software/fontconfig/release/上下載

前兩個很好裝,第三個有點蛋疼

configure fontconfig是會要求有expat

直接 yum install expat-devel就可以解決了

然後我出現了docbook2pdf: command not found的錯誤

就去http://www.linuxfromscratch.org/blfs/view/6.3/pst/docbook-utils.html上下載了docbook-utils

尼瑪 裝了才發現系統中竟然有了,可是有了剛纔怎麼會找不到。。。

把安裝docbook-utils的bin目錄下的docbook2pdf放到/usr/bin目錄下

這回docbook2pdf命令是找到了,可又出現 pdfjadetex: command not found的錯誤

一開始不知到怎麼解決,安裝了一堆的rpm包還有一些第三方包

可以先試試用 yum install jadetex

不行的話在 加上 yum install tetex

還不行的話

http://www.tldp.org/HOWTO/DocBook-Install/install.html照着搞搞吧

搞這個搞的我快放棄了,最後是執行yum install jadetex解決的

之前後面兩條都搞了,就一起記下來了


三個裝好後加到PKG_CONFIG_PATH上

然後重啓終端就可以裝好pango了

然後把pango加到PKG_CONFIG_PATH中,就可以了


重開終端後,記得

. ~/.bash_profile

export LD_LIBRARY_PATH=glib安裝目錄/lib:gtk+安裝目錄/lib

然後重新configure gimp就行了

這回configure總算成功了。。

之後的make -make install等一下就好了


搞了一天,總算搞定了,還是yum爽啊




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章