[gimp-web-devel/pat/bootstrap] content: add a new "Problem/Solution" and update one.



commit 3006c18bb310a138bf2c47fd92df57a37451e2e4
Author: Jehan <jehan girinstud io>
Date:   Wed Sep 7 20:18:49 2022 +0200

    content: add a new "Problem/Solution" and update one.
    
    - Adding infos on how to find the right package to install for relevant
      platforms.
    - Add some info about the 'Failed to load module "canberra-gtk-module"'
      which may still happen even though `libcanberra-gtk3-module` package
      has been installed, when you are using a self-built GTK (hence
      GTK modules from system packages are not installed in the prefix which
      your non-system GTK reads).

 content/core/setup/Problems_and_solutions.md | 72 ++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)
---
diff --git a/content/core/setup/Problems_and_solutions.md b/content/core/setup/Problems_and_solutions.md
index a9c9dd5..2406b93 100644
--- a/content/core/setup/Problems_and_solutions.md
+++ b/content/core/setup/Problems_and_solutions.md
@@ -23,6 +23,60 @@ package manager, or compile them from source! Compiling these is done
 exactly like we compiled `babl` – download the source (either the latest
 from `git`, or a package from the official site), compile and install.
 
+#### Searching the package name for a dependency
+
+Problem
+: The configuration step complains about a missing dependency but I
+don't know how to find the right package name.
+
+Solution
+: There are 2 main cases, but they are similarly handled. Basically you
+need to find the name of a file which will be available in the package.
+
+The 2 common cases are:
+
+1. The dependency is a library.
+    * In the `meson.build` file, it will be searched by a call similar
+      to `dependency('gdk-pixbuf-2.0', version: '>='+gdk_pixbuf_minver)`.
+      The important part is the first argument here. Since library
+      dependency are usually searched by `pkg-config` (it's not
+      mandatory, but it's definitely what we favor), the file you want
+      to search is the first argument followed by `.pc`. E.g. in the
+      given example, you will want to search for a package containing a
+      file `gdk-pixbuf-2.0.pc`.  On
+    * In the `configure.ac`, it will look like the below code instead.
+      Here the important part is the second argument. The rest is the
+      same.
+```sh
+PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= gdk_pixbuf_required_version,,
+                  [add_deps_error([gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])])
+
+```
+2. The dependency is an executable.
+    * In `meson.build`, you will see `find_program('perl5', 'perl', 'perl5.005', 'perl5.004', 'perl')`.
+      The binary you want to search is any from the list.
+    * In `configure.ac`, you will see `AC_PATH_PROGS(PERL,perl5 perl,perl)`.
+      The binay will be one from the second argument list.
+
+Now that you have determined what file to search, here are how to find
+which package contains it:
+
+Debian and Debian-based distributions
+: Install the `apt-file` package. Before the first run, you will need to
+run `apt-file update`, then search with `apt-file search perl5` or
+`apt-file search gdk-pixbuf-2.0.pc`.
+
+Fedora and dnf using distributions
+: Search the package with `dnf repoquery whatprovides */perl5` or `dnf repoquery whatprovides 
*/gdk-pixbuf-2.0.pc`.
+Unlike `apt-file`, this command requires exact path. So when you only
+know a partial name, use glob patterns.
+
+Windows compilation from Linux using Crossroad
+: Inside your crossroad environment, search with `crossroad search --search-files perl5`
+or `crossroad search --search-files gdk-pixbuf-2.0.pc`.
+
+We welcome more helper commands for other platforms.
+
 #### Error while loading shared libraries: No such file or directory
 
 Problem
@@ -989,6 +1043,24 @@ Cause
 Solution
 : Install missing package, for example: `sudo apt-get install libcanberra-gtk3-module`
 
+Note that you may still see the error if you are using a self-built
+GTK+3. In this case, the `libcanberra` module installed by the package
+manager is not visible by the GTK installed in a prefix.
+
+You may redirect the self-built GTK to look into the system prefix for
+modules through the
+[`GTK_PATH`](https://docs.gtk.org/gtk3/running.html#environment-variables)
+environment variable. For instance:
+
+```sh
+export GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-3.0/
+```
+
+If ever you experience incompatibilities (since the system GTK and the
+self-built one may have been built differently), you may also decide to
+ignore the message, as it's harmless (unlike you needed to use this
+module, but chances are low this would ever be needed for GIMP).
+
 #### (gimp-2.99:xx): dbind-WARNING **: 09:35:43.023: Couldn't register with accessibility bus:
 
 Problem


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]