Difference between revisions of "Scribus and Homebrew"

From Scribus Wiki
Jump to: navigation, search
(ToDo)
(added 2nd codesigning tutorial)
Line 281: Line 281:
 
== Debugging Scribus with gdb (GNU Debugger) ==
 
== Debugging Scribus with gdb (GNU Debugger) ==
 
<big>In order for us to troubleshoot Scribus problems on MacOS X we need to install the GNU Debugger and invoke Scribus within it. This will generate a backtrace that we can [[How to file a bug report|Submit to the BugTracker]]</big><br />
 
<big>In order for us to troubleshoot Scribus problems on MacOS X we need to install the GNU Debugger and invoke Scribus within it. This will generate a backtrace that we can [[How to file a bug report|Submit to the BugTracker]]</big><br />
'''Note''': The file paths used below assume that you installed via Homebrew Package Manager<ref>http://blog.panks.me/posts/2013/11/install-gdb-on-os-x-mavericks-from-source/</ref>.  
+
'''Note''': The file paths used below assume that you installed via Homebrew Package Manager<ref>http://blog.panks.me/posts/2013/11/install-gdb-on-os-x-mavericks-from-source/</ref> and <ref>http://www-scf.usc.edu/~csci104/installation/gccmac.html</ref>.  
 
* Install gdb via: <code>brew install gdb</code>
 
* Install gdb via: <code>brew install gdb</code>
 
* gdb requires that a signed certificate be made  
 
* gdb requires that a signed certificate be made  

Revision as of 02:25, 9 August 2014

Announcement: Extremely Experimental OSX Build
Updated 2014/08/09
Any feedback contact: scribusdotuseratgmail
Please follow exact instructions for successful results

Background

Homebrew is a MacOSX Package Manager. Currently it is the younger of the Package Managers available.
Other package managers include:


Goal

Essentially by using Homebrew, one can automatically:

  1. download the source code directly from the SVN
  2. download the dependencies Scribus needs to compile
  3. run the compiler on the source with the appropriate flags
  4. generate the Scribus executable
  5. install Scribus executable by placing it in /usr/local/Cellar/ and symlinking it to ~/Applications
  6. rejoice


Prerequisites

  • Make note where you install this because you will need to specify it in the formula below unless it's placed in ~/Qt/5.x.x/
  • Python (>=v2.7) (could possibly work with 2.6 not sure)
  • The Cairo dependency may require installing xQuartz (from http://xquartz.macosforge.org/landing/) if you haven't already (Inkscape & Synfig require it)


Dependencies

v1.5.0svn

Note: OSX 10.6 is for sure not supported because Qt5 will not install on it
This formula will install the most basic dependencies (libraries) that Homebrew needs to compile (see Formula Options for adding optional dependencies that offer extended functionality). Then it will connect to the SVN and pull whatever the most current source of the Scribus trunk is hence it will build an unstable 1.5.0 release not to be used in a production environment.

List of 1.5svn depenedencies

List of dependencies generated from: ---->
brew deps https://gist.githubusercontent.com/luzpaz/9042115/raw/scribus-dev.rb

boost 
cairo 
cmake 
fontconfig 
freetype 
gdbm 
gettext 
ghostscript 
glib 
gobject-introspection 
graphicsmagick 
homebrew/dupes/zlib 
hunspell 
intltool 
jbig2dec 
jpeg 
libffi 
libgsf 
libpng 
librevenge 
libtiff 
libtool 
libwpd 
libwpg 
little-cms2 
makedepend 
openjpeg 
openssl 
pixman 
pkg-config 
poppler 
python 
python 
qt5 
readline 
sqlite 
xz 


Formula

Warning Warning: The following Homebrew formula is extremely experimental (and unstable).
Should only be used for testing bleeding edge builds.
Not recommended to be used for production purposes.
The formula is subject to change and may actually be out of date.
In fact it's just here for educational purposes.
To use the most up-to-date forumla refer to the instructions below
require 'formula'
 
# Important Note: (from the Scribus core devs)
# - Don't use 1.5 for production, don't rely on it to work day to day. Use 1.4.4 for that.
# - If you ignore the above, be prepared to stay on a version that works for you. There's normally no
# reason to change every day.
# - No bugs for homebrew solutions in the Scribus tracker.
# - More info http://wiki.scribus.net/canvas/Scribus_and_Homebrew
 
# TODO
#  Add a patch template to test Scribus patches (https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook#patches)
#  Add Messaging (https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook#messaging)
#  Add the possibility to download only certain languages
 
class ScribusDownloadStrategy < SubversionDownloadStrategy
  def stage
    FileUtils.cp_r @clone.children, '.'
  end
end
 
 
class ScribusDev < Formula
  homepage 'http://wiki.scribus.net/canvas/Scribus_and_Homebrew'
  version '0.9'
  head 'svn://scribus.net//trunk/Scribus',
    # download a specific revision
    # use :revision => '######',
    :using => ScribusDownloadStrategy
  depends_on 'cmake' => :build
  depends_on 'little-cms2'
  depends_on 'qt5'
  depends_on 'cairo'
  depends_on 'jpeg'
  depends_on 'libtiff'
  depends_on 'fontconfig'
  depends_on 'openssl'
  depends_on 'pkg-config' => :build
  depends_on 'python'
  depends_on 'hunspell'
  depends_on 'homebrew/dupes/zlib'
  depends_on 'ghostscript' => :recommended
  depends_on 'graphicsmagick' => :recommended
  depends_on 'boost' => :recommended
  depends_on 'poppler' => :recommended
  depends_on 'podofo' => :recommended
  depends_on 'freetype' => :recommended
  depends_on 'librevenge' => :recommended       # Build import filters
  depends_on 'libwpg' => :recommended           # Importer: WordPerfect Graphics
  depends_on 'libvisio' => :recommended         # Importer: MS-Visio
  depends_on 'libmspub' => :recommended         # Importer: MS-Publisher
  # depends_on 'libcdr' => :recommended         # Importer: Corel Draw
 
   def install
    args = %W[
    -DBUILD_OSX_BUNDLE=1
    -DCMAKE_INSTALL_PREFIX:PATH=#{prefix}/ScribusDev.app/Contents/
    -DQT_PREFIX=#{Formula["qt5"].opt_prefix}
    -DWANT_HUNSPELL=1
    -DWITH_PODOFO=1
    -DWANT_GRAPHICSMAGICK=1
    -DWANT_SVNVERSION=1
    -DWANT_DEBUG=1
    ]
    # Other Options:
    # Enable Scripter2 with -DWANT_SCRIPTER2=1
 
    # ENV.libcxx if MacOS.version > :mountain_lion
    system "cmake", ".", *args
    system "make"
    system "make install"
  end
end

Formula Options

These need to be added in to brew formula as options at compile time: ---->

  • PoDoFo (highly recommended) is a library to work with the PDF file format and includes also a few tools.
homebrew: depends_on 'podofo'
cmake: "-DWITH_PODOFO=1" Enable support for PDF embedded in AI import
  • Boost (recommended) is a set of C++ libraries
homebrew: depends_on 'boost'
cmake: "-D?????=1" (Incomplete here)
  • Ghostscript (highly recommended) an interpreter for the PostScript language and for PDF.
homebrew: depends_on 'ghostscript'
  • GraphicsMagick (recommended) to install for ...
homebrew: depends_on 'graphicsmagick'
cmake: "-DWANT_GRAPHICSMAGICK=1'"
  • Hunspell
cmake: "-DWANT_HUNSPELL=1"
  • Scripter2 (experimental and may crash) experimental next gen scribus python script interpreter
cmake: "-DWANT_SCRIPTER2=1"
  • Debugging. If you want to debug the compile process add this to cmake
cmake: "-DWANT_DEBUG=1" for Dev build
  • To show the revision in about.cpp
cmake: "-DWANT_SVNVERSION=1




Invoke from Command Line

Warning Warning: The following Homebrew formula for Scribus development snapshop testing is extremely experimental (and unstable). Use at your own risk for production purposes. The formula is subject to change.

Invoke with:

  1. brew install -v --HEAD https://gist.githubusercontent.com/luzpaz/9042115/raw/scribus-dev.rb
  2. brew linkapps symbolically linking to /Applications folder

Notes:

Function Command Line for Homebrew
To Reinstall (uninsall + install) brew reinstall -v --HEAD https://gist.githubusercontent.com/luzpaz/9042115/raw/scribus-dev.rb
To Uninstall brew uninstall scribus-dev
Build without boost support [1] --without-boost
Build without freetype support --without-freetype
Build without ghostscript support --without-ghostscript
Build without graphicsmagick support --without-graphicsmagick
Build without libmspub support --without-libmspub
Build without librevenge support --without-librevenge
Build without libvisio support --without-libvisio
Build without libwpg support --without-libwpg
Build without podofo support --without-podofo
Build without poppler support --without-poppler

Problems

Problem Solution
Quickly upload all log files to a GitHub gist brew gist-logs scribus-dev

Note: If your installation fails then collect log files to the email in the announcement at the top of the page or via:



Debugging Scribus with gdb (GNU Debugger)

In order for us to troubleshoot Scribus problems on MacOS X we need to install the GNU Debugger and invoke Scribus within it. This will generate a backtrace that we can Submit to the BugTracker
Note: The file paths used below assume that you installed via Homebrew Package Manager[2] and [3].

  • Install gdb via: brew install gdb
  • gdb requires that a signed certificate be made
codesign -s gdb-cert /usr/local/Cellar/gdb/7.7.1/bin/gdb
  • Invoke Scribus through gdb with: gdb /usr/local/Cellar/scribus-dev/HEAD/ScribusDev.app/Contents/MacOS/./Scribus
  • What are the commands that need to be used?
bt = backtrace
run = run the program


ToDo

Ordered by priority

  • Make sure that the SVN flags get appended when specified
For example: if we don't want to compile with graphicmagic we'd pass
brew reinstall -v --without-graphicsmagic --HEAD https://gist.githubusercontent.com/luzpaz/9042115/raw/scribus-dev.rb
which shoudl pass the SVN Flag to disable graphicsmagic
  • Clean up formula, does it really need some of the deps like depends_on 'pkg-config' => :build ?
  • Add Homebrew formula jargon to choose optional dependencies at compile time
  • Fix the formula to use home directory (~) instead of current /Users/YourUserName/
  • Mac OS X v10.8 (Mountain Lion) option to compile with Python v3 (in order to use Scripter2(?) FIX: Add "-DWANT_SCRIPTER2=1" to Cmake
  • Circumvent compiling for Mac OS X users by creating a homebrew-cask to distribute the binary directly. (Done)
  • Mac OS X v10.9 (Mavericks) needs someone to test it (Patrice tested on 10.9.2) + add python 3 functionality
  • Mac OS X v10.7 (Lion): need someone to test this + add python 3 functionality Not going to happen
  • Consider submitting bleeding edge nightly to Homebrew or just turn into a gist through Scribus's official Github account
    Also possible to use https://github.com/Homebrew/homebrew-headonly
Need to research what this means for useability of Homebrew once we link to that repo. Will people have issues with identifying dependencies ?
Ask about Scribus Github Account login to set the formula as a gist from a reputable official account
  • Create a stable formula and submit to Homebrew (1.4.x uses Qt4 framework) <-- only >=v1.5 will be supported

Acknowledgements

  • freenode #scribus MrB, s_uv, a-l-e, jghali
  • freenode #machomebrew mistym, durka42, Argon]

References

  1. Generated from brew info scribus-dev
  2. http://blog.panks.me/posts/2013/11/install-gdb-on-os-x-mavericks-from-source/
  3. http://www-scf.usc.edu/~csci104/installation/gccmac.html

Related