3

Drwright is not included in the main Ubuntu distribution but is availble through a PPA. In this way installation steps:

   sudo add-apt-repository ppa:drwright/stable 
   sudo apt-get update
   sudo apt-get install drwright

Installation completed succesfully.

But I want correct the source code of this program. I use apt-get source drwright to download it. And first of all I try compile the source code without changes:

   ./configure

But configure doesn't execute:

configure: error: Package requirements (
  glib-2.0 >= 2.31.13
  gio-2.0 >= 2.31.13
  gdk-pixbuf-2.0 >= 2.25.3
  gtk+-3.0 >= 3.0.0
  libcanberra-gtk3 >= 0
  libnotify >= 0.7
  x11) were not met:

No package 'glib-2.0' found
No package 'gio-2.0' found
No package 'gdk-pixbuf-2.0' found
No package 'gtk+-3.0' found
No package 'libcanberra-gtk3' found
No package 'libnotify' found
No package 'x11' found

Why Drwring installed from PPA and work succesfully, but I can't compile it from source code?

Idel Pivnitskiy
  • 1,057
  • 7
  • 9

2 Answers2

7

Header Files

To build a program from source, you don't just need the compiled binaries for the libraries it uses. You also need their header files.

In Debian, Ubuntu, and other Debian-based operating systems, header files are provided by packages whose names end in -dev. Usually it's the binary package name with -dev appended, or the binary package name with some version numbers removed and -dev appended.

-dev packages (for compiling) should not be confused with -dbg packages (for debugging). Here's some information about how and why these packages are made.

pkg-config Packages vs. Your Package Manager's Packages

When you build from source code and ./configure tells you about missing packages, usually it is not checking with the package manager to see what is installed, and the names of missing packages typically are not the exact names of the packages you need to install with your package manager. (pkg-config is a common way for ./configure scripts to calculate dependencies--see this article, the manpage, and the project page for more information.)

Figuring Out What Packages to Install with the Package Manager

To find out what packages you do need to install, you can look at packages that start the same...or that start with lib followed by the name of the "packages" spit out by ./configure. Packages starting with lib are more common (on Debian and Debian-based systems) since most library packages are named that way.

You can search for packages online (other distributions typically also provide this, here's Debian's). Or you can use bash completion to find them. Since this uses the locally stored information on your system about what packages are available in what versions from where, you should update that information first:

sudo apt-get update

Then type in a command that would install a package, with just the beginning of the name--however much you think you know. For example, for glib-2.0:

ek@Del:~$ apt-get install libglib2
libglib2.0-0                libglib2.0-cil-dev
libglib2.0-0-dbg            libglib2.0-data
libglib2.0-0-dbgsym         libglib2.0-dev
libglib2.0-0-refdbg         libglib2.0-dev-dbgsym
libglib2.0-0-refdbg-dbgsym  libglib2.0-doc
libglib2.0-bin              libglib2-ruby
libglib2.0-bin-dbgsym       libglib2-ruby1.8
libglib2.0-cil              libglib2-ruby1.8-dbg
libglib2.0-cil-dbgsym

There, I did not run the command I entered. (It wouldn't have succeeded if I had, both because there is no package called libglib2 and because apt-get install will not succeed unless run as root.)

Instead, I pressed Tab a couple times at the end of the line, and I got a list of suggestions.

From these suggestions, the right one is libglib2.0-dev.

If You're Still Not Sure

Sometimes you won't necessarily know which one is right; then you can use apt-cache show ... to find out. For example, suppose I'm wondering if I also need libglib2.0-cil-dev:

ek@Del:~$ apt-cache show libglib2.0-cil-dev 
Package: libglib2.0-cil-dev
Priority: optional
Section: libs
Installed-Size: 174
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian CLI Libraries Team <pkg-cli-libs-team@lists.alioth.debian.org>
Architecture: i386
Source: gtk-sharp2
Version: 2.12.10-2ubuntu4
Replaces: libglib2.0-cil (<< 2.12.9-2)
Depends: libglib2.0-cil (= 2.12.10-2ubuntu4)
Filename: pool/main/g/gtk-sharp2/libglib2.0-cil-dev_2.12.10-2ubuntu4_i386.deb
Size: 2408
MD5sum: 50fa0825eb4d73593bdc8419c5fc9737
SHA1: f9659e85410505f7463a7117ebb92c70af6ad3aa
SHA256: 8f9d39465f2a1d5b4cc7832660ea53bacc681811ab2c80b57cad1655d4055b01
Description-en: CLI binding for the GLib utility library 2.12
 This package provides the glib-sharp assembly that allows CLI (.NET) programs
 to use the GLib utility library 2.12. This is mostly useful for the GTK+ and
 GNOME bindings.
 .
 GTK# 2.10 is a CLI (.NET) language binding for the GTK+ 2.10 toolkit
 .
 This package contains development files for the glib-sharp library, and should
 be used for compilation
Homepage: http://www.mono-project.com/GtkSharp
Description-md5: e7432bd7eb91c1c711c14150f81a3556
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 18m

If you want, you can use command-line completion on incomplete package names as arguments to apt-cache show instead of apt-get install. Any command that takes the name of a package (and takes it whether the package is installed or not) is suitable for this purpose.

The Specific Packages You Need

Given the messages that appeared, the -dev packages you need are probably:

You can install these in the Software Center but I recommend the command-line as it's easier for installing multiple packages:

sudo apt-get update && sudo apt-get install libglib2.0-dev libgdk-pixbuf2.0-dev libgtk-3-dev libcanberra-gtk3-dev libnotify-dev libx11-dev
Community
  • 1
  • 1
Eliah Kagan
  • 1,704
  • 3
  • 22
  • 38
-1

try command in shell as root

$apt-get install glib-2.0 gio-2.0 gdk-pixbuf-2.0 gtk+-3.0 libcanberra-gtk3 libnotify x11 -f -y

Felipe
  • 9
  • 1