Skip to content

Instantly share code, notes, and snippets.

@hschne
Forked from renexu/build_libvips.md
Last active September 3, 2019 13:44
Show Gist options
  • Save hschne/adcccd120362e71fb3304c821fb01575 to your computer and use it in GitHub Desktop.
Save hschne/adcccd120362e71fb3304c821fb01575 to your computer and use it in GitHub Desktop.
Packaging Vips on Ubuntu 18.04

These are the steps to build latest libvips (8.7.4) deb package on Ubuntu 18.04.

Getting set up

Install the build dependencies.

sudo apt install build-essential devscripts

Next, get the latest vips sources.

wget https://github.com/libvips/libvips/releases/download/v8.7.4/vips-8.7.4.tar.gz
tar zxf vips-8.7.4.tar.gz
cd vips-8.7.4

Download the deb build package from launchpad

wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/vips/8.7.4-1/vips_8.7.4-1.debian.tar.xz
tar xvf vips_8.7.4-1.debian.tar.xz

Install build dependencies

Add the deb-src to your sources.

sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
sudo apt update

To run mk-build-debs you will need equiv installed as well.

sudo apt install equiv
mk-build-deps vips --install --root-cmd sudo --remove

Now all required dependencies are installed.

Disable python-vipscc

you should use pyvips for python binding

Open debian/control in your favorite text editor and comment out (by adding #) the block beginning with Package: python-vipscc

Build

To build the package run

debuild -i -us -uc -b

and wait for a while. Confirm that the build was successful by listing the created packages.

$ ls ../*.deb
../gir1.2-vips-8.0_8.7.4-1_amd64.deb  ../libvips-doc_8.7.4-1_all.deb
../libvips42_8.7.4-1_amd64.deb        ../libvips-tools_8.7.4-1_amd64.deb
../libvips-dev_8.7.4-1_amd64.deb

You can now install libvips and libvips-tools by running

sudo dpkg -i libvips42_8.7.4-1_amd64.deb libvips-tools_8.7.4-1_amd64.deb

If you want to install libvips-dev you will need gir1.2-vips installed as well:

sudo dpkg -i gir1.2-vips-8.0_8.7.4-1_amd64.deb  libvips-dev_8.7.4-1_amd64.deb

Clean up

Clean up the the things you used for building the package.

sudo apt remove vips-build-deps
sudo apt autoremove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment