Difference between revisions of "CompilingDebian"

From Inkscape Wiki
Jump to navigation Jump to search
Line 5: Line 5:
=== Downloading the sourcefile and building it on Debian Unstable/Sid ===
=== Downloading the sourcefile and building it on Debian Unstable/Sid ===

You can download the source for Inkscape from [http://sourceforge.net/project/showfiles.php?group_id=93438&package_id=99112 The Inkscape download page on Sourceforge.net].  Just look for the latest version, and choose the file for that version that ends with ".tar.bz2".  For the sake of this example, I'll pretend you've downloaded "inkscape-0.42.tar.bz2", and that you're keeping it in your home directory (~/).
You can download the source for Inkscape from [http://sourceforge.net/project/showfiles.php?group_id=93438
==== Extracting ====
Make a temporary directory, somewhere that has enough space to build software:
  mkdir -p ~/tmp/inkscape
  cd ~/tmp/inkscape
  tar xvjf ~/inkscape-0.42.tar.bz2
  cd inkscape-0.42
==== Preparing debian for the software ====
Since Debian is already aware of older inkscape versions, you can take advantage of this, and have Debian help you install the correct packages that you'll need to build the new version.
  apt-get build-dep inkscape
  (do this as the root user)
There may still be a few packages missing, but we'll handle those later.  You'll also need some other software:
  apt-get install build-essential dpkg-dev fakeroot
  (do this as the root user)
==== Building the package ====
To build the package, just do:
  dpkg-buildpackage -uc -us -rfakeroot
If this complains about any missing dependancies, it may be because the newer version of inkscape requires something that isn't in the older, official Debian package.  Just use the apt-get install command to add whatever it complains about.  For instance, if it said you needed libfoo, you would just do: apt-get install libfoo.  Then, try the above dpkg-buildpackage command again.
Building will take a while, so be prepared, and don't panic if it seems like nothing is happening for a while.
==== Installing ====
Assuming the build process was successful, a debian package will have been created in the parent directory.  To install it, just do:
  cd ..
followed by:
  dpkg -i inkscape*.deb
  (do this as the root user)
==== Cleaning up ====
All of these build files can waste space on your computer, if you're happy that the install was successful, and you want to clean up those temporary files, you can just do:
  cd ..
  rm -rf inkscape
  (again, do this as root)
=== Another method ===
The <tt>/debian/control</tt> file asserts the following build dependencies
:<pre>Build-Depends: automake1.7, debhelper (>= 4.0.0), intltool, libart-2.0-dev (>= 2.3.10), libgc-dev, libgtk2.0-dev (>= 2.0.6-1), libgtkmm-2.4-dev, libpango1.0-dev, libpng12-dev, libpopt-dev, libsigc++-2.0-dev, libtool, libxml-parser-perl, libxml2-dev (>= 2-2.4.24), pkg-config, zlib1g-dev</pre>
The makefile below also requires the <tt>dpkg-dev</tt> package.
TrentBuck used the following makefile to construct a Debian package:
#!/usr/bin/make -f
package  = inkscape
version  = 0.40pre2
directory = $(package)-$(version)
tarball  = $(package)-$(version).tar.gz
url      = http://dl.sf.net/sourceforge/$(package)/$(tarball)
default all: clean WORKING $(tarball)
tar -C WORKING -zxf $(tarball)
$(MAKE) -C WORKING/$(directory) -f $(PWD)/Makefile build
# Most users will want to replace this with simply `wget $(url)'.
if test -s /alt/wget/$(url); then cp /alt/wget/$(url) .; else wget $(url); fi
test -d $@ || mkdir $@
clean: WORKING
-cd WORKING && rm -rf $(package)
-cd WORKING && rm -f *.asc *.build *.changes *.dsc *.tar.gz
-rm -f $(tarball)
-rm -rf WORKING && mkdir WORKING
# Never call make this target directly!
dpkg-buildpackage -rfakeroot
.PHONY: default all clean distclean build
The following <strong>additional changes</strong> are required to build a correct package:
* prepend an entry to <tt>/debian/changelog</tt> so that the debian package has the correct version.
* copy from CVS any of the following files missing from <tt>/debian</tt>: <tt>changelog compat control copyright dirs docs inkscape.applications inkscape.menu inkscape.xpm mime rules</tt>
==== Updating the Changelog ====
The debian package should have the name <tt>inkscape_VERSION_ARCHITECTURE.deb</tt>.
The version number should be
; <strong><tt>STABLE-DEBVER</tt></strong> for official releases : For example, <tt>0.39-1</tt>.  <br>STABLE is the current stable version of Inkscape, DEBVER is the debian minor version (usually 1).
; <strong><tt>STABLE+VERSION-DEBVER</tt></strong> for prereleases, releases candidates, etc : For example, <tt>0.39+0.40pre2-1</tt>.  <br>VERSION is the prerelease version.
; <strong><tt>STABLE+cvsDATE-DEBVER</tt></strong> for CVS releases : For example, <tt>0.39+cvs20041111-1</tt>.  <br>DATE is the date when the repository was checked out, in YYYYMMDD format.
Thus your changelog entry should be something like
inkscape (0.39+0.40pre2-1) unstable; urgency=low
  * Non-maintainer build.
-- Trent Buck <twbuc1@student.monash.edu.au>  Thu, 11 Nov 2004 03:09:18 +1100
Note that spacing '''is''' significant in debian changelog entryies (e.g. must be two spaces after email address).
[[Category:Developer Documentation]]

Revision as of 15:06, 12 April 2007

Building a Package

NOTE: Debian already has inkscape packages; these instructions are just for installing the most up-to-date version, that may not have reached Debian's official archives yet.

Downloading the sourcefile and building it on Debian Unstable/Sid

You can download the source for Inkscape from [http://sourceforge.net/project/showfiles.php?group_id=93438