Monday, July 17, 2017

最近跳過 Debian 8,直接將 Debian 7 升級到  Debian 9,算順利。也慢慢將原本在 Ubuntu 12.04 裡面的檔案,轉移到 Debian 9。

對我來說,Scribus 是重要的軟體,可我發現,Debian 9 的版本,啟動時,splash screen(這中文怎麼講?一下子想不起來)是黑白的。以前在 Ubunttu 12.04 編譯 Scribus,也發生過這樣的情況,記得原因跟 GCC 版本有關。使用上倒沒碰到什麼問題,只是,心裡還是有些疙瘩。沒想到 Debian 9 內附的 Scribus,也會這樣。

想想,還是自己編譯,並把過程紀錄下來,日後參考。

GCC, make, automake 跟 autoconf 都是使用 Debian 9 的。

編譯 Scribus 需要使用 cmake,所以

~# apt install cmake

我使用目前穩定版的 Scribus,版本是 1.4.6,需要 Qt 4.x 的 library。

~# apt install libqt4-dev

其他相關的軟體也一併安裝

~# apt install \
 libjpeg-dev libpng-dev libtiff5-dev \
 python-dev  libfreetype6-dev libcups2-dev \
 libxml2-dev liblcms2-dev \
 libpodofo-dev libhyphen-dev \
 libboost-dev libfontconfig1-dev \
 libcairo2 libcairo2-dev

將已經下載的 scribus-1.4.6.tar.xz 擺到 build 目錄底下。

~$ cd /home/${USER}/build
~$ xz -cd scribus-1.4.6.tar.xz | tar -xvf -
~$ cd scribus-1.4.6
~$ mkdir builddir && cd builddir

執行 cmake 以產生我們需要的編譯設定檔。

在這兒,我是預設將 Scribus 安裝到 /usr/local/scribus 底下。

~$ cmake .. \
 -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/scribus \
 -DWANT_LIB64=1 \
 -DCPACK_GENERATOR="TGZ" \
 -DCMAKE_BUILD_TYPE:STRING=Release

執行 make 編譯軟體。

~$ make

將編譯好的 Scribus 打包,方便日後如果需要在另一臺電腦安裝的話。

~$ make package

將打包好的檔案從

scribus-1.4.6-.tar.gz

更名為

scribus-1.4.6-amd64-debian9.tar.gz

方便識別。

實際安裝到系統

~# make install

之後,執行

~$ /usr/local/scribus/bin/scribus &

即可。

如果系統界面是 GNOME 3,可以建立一個 scribus.desktop,將 scribus 整合到 GNOME 3 的環境。

~# vi /usr/share/applications/scribus.desktop

我這兒的內容為

[Desktop Entry]
Name=Scribus
Type=Application
Icon=/usr/local/scribus/share/scribus/icons/scribus.png
Comment=Page Layout and Publication
Comment[zh_CN]=桌面出版
Comment[zh_TW]=桌面出版
GenericName=Page Layout (Development)
GenericName[zh_CN]=桌面出版
GenericName[zh_TW]=桌面出版
Exec=/usr/local/scribus/bin/scribus %f
Terminal=false
MimeType=application/vnd.scribus;
Categories=Qt;Graphics;Publishing;
StartupWMClass=scribus
StartupNotify=false

後語:

我使用 Debian 9 的 GCC 跟 Qt4,包括 cmake 跟一堆 libraries。奇怪的是,自行編譯後,啟動的 splash screen 是彩色的。不知道 Debian 9 官方提供的 Scribus,編譯參數是怎麼下的,竟然跟我有不一樣的結果。

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.