README
author ali <ali@juiblex.co.uk>
Tue Sep 24 06:44:58 2013 +0100 (2013-09-24)
changeset 95 d13e2582c2b5
parent 19 05d082ebf685
permissions -rw-r--r--
Fix bug #5: Cannot install on a Mac
     1                                    bookloupe
     2                                    =========
     3 
     4 General installation instructions can be found in INSTALL. The following
     5 aim to give a quick overview and some help for specific systems. Documentation
     6 for bookloupe itself can be found in doc/bookloupe.txt and for the test
     7 framework in doc/loupe-test.txt.
     8 
     9 Linux
    10 -----
    11 
    12 You should be able to use the standard:
    13 
    14 % ./configure
    15 % make
    16 % sudo make install
    17 
    18 If you get an error about no package 'glib-2.0' found, then you need to
    19 install the development package for glib2. Under Fedora, RHEL and friends
    20 that would be:
    21 
    22 % sudo yum install gcc pkgconfig glib2-devel
    23 
    24 Under Debian, Ubuntu and friends that would be:
    25 
    26 % sudo apt-get install gcc pkgconfig glib2-devel
    27 
    28 Microsoft Windows
    29 -----------------
    30 
    31 It should be possible to use either MSYS (http://www.mingw.org/wiki/MSYS)
    32 or cygwin (http://www.cygwin.com/) to build on a Windows machine. You'll
    33 need a copy of the development package for glib and its dependencies
    34 from http://www.gtk.org/download/win32.php.
    35 
    36 It's much easier to build using a cross-compiler from Linux, if you have
    37 access to such a system. Under Fedora, RHEL and friends you can do this
    38 with:
    39 
    40 % sudo yum install mingw32-gcc pkgconfig mingw32-glib2-static \
    41   mingw32-gettext-static mingw32-iconv-static
    42 % ./configure --host=i686-w64-mingw32 --disable-shared \
    43   --bindir=/bookloupe --datadir=/
    44 % make
    45 % mkdir build
    46 % make install DESTDIR=`pwd`/build
    47 
    48 The contents of the build/bookloupe directory can then be copied to a
    49 Microsoft Windows machine.
    50 
    51 Depending on the version of mingw32-gcc you use, you may need to specify a
    52 different host type. If you're not sure look and see what the cross-compiler
    53 is called (eg., i686-pc-mingw32-gcc) and use the prefix as the host type.
    54 
    55 Mac
    56 ---
    57 
    58 You will need the command line tools for any of the procedures described
    59 below. If you don't already have them, install Xcode (it's a free download).
    60 
    61 The simplest and least intrusive means to build on a Mac is to use Frau Sma's
    62 Homebrew formula. However, Homebrew is not compatible with Fink so if you
    63 have previously used Fink then you need an alternative solution, such as
    64 MacPorts (see below).
    65 
    66 It may also be possible to use Fink itself.
    67 
    68 Mac using Frau Sma's Homebrew formula
    69 -------------------------------------
    70 
    71 https://github.com/frau-sma/homebrew-bookloupe
    72 
    73 The README will be displayed by default. Follow its instructions to
    74 install bookloupe on your Mac.
    75 
    76 Creating statically linked binaries on a Mac using Homebrew
    77 -----------------------------------------------------------
    78 
    79 If you want to be able to distribute binaries of bookloupe to other Mac
    80 users, then they need to be statically (rather than dynamically) linked.
    81 Fundamentally this means that glib and its dependencies are included in
    82 the binary rather than being linked into the program by the Operating
    83 System each time it is run.
    84 
    85 http://mxcl.github.com/homebrew/
    86 
    87 Install Homebrew according to its instructions. If you already had Homebrew
    88 before, make sure it's all up to date and “raring to brew.” For that, you
    89 want to run:
    90 
    91 $ brew update
    92 
    93 and
    94 
    95 $ brew doctor
    96 
    97 from your terminal. Then you need to edit the formula for glib and each of its
    98 dependencies (gettext and libffi at the time of writing) using something like:
    99 
   100 $ brew edit gettext
   101 
   102 Each time find the args statement which includes --prefix and insert
   103 --disable-shared,for example change:
   104 
   105 args = ["--disable-dependency-tracking", "--disable-rebuilds",
   106            "--prefix=#{prefix}",
   107            "--disable-dtrace"]
   108 
   109 to
   110 
   111 args = ["--disable-dependency-tracking", "--disable-rebuilds",
   112            "--disable-shared",
   113            "--prefix=#{prefix}",
   114            "--disable-dtrace"]
   115 
   116 and then
   117 
   118 $ brew install glib
   119 
   120 before installing bookloupe as normal, but with the extra flag to configure:
   121 
   122 $ ./configure --disable-shared
   123 $ make
   124 $ make install
   125 
   126 Note that if you have previously used dynamic linking this may not work.
   127 (Homebrew doesn't seem to create .la files in a form that libtool can use
   128 when it is asked to prefer static libraries to dynamic ones.) Removing the
   129 dynamic libraries first will solve this problem.
   130 
   131 Mac using MacPorts
   132 ------------------
   133 
   134 Install MacPorts from http://www.macports.org/.
   135 
   136 Install pkgconfig (required to build glib) and then glib itself:
   137 
   138 $ sudo port install pkgconfig
   139 $ sudo port install glib2
   140 
   141 Then install bookloupe as normal, telling configure where to find glib's
   142 package configuration file:
   143 
   144 $ ./configure PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
   145 $ make
   146 $ make install