Re: [Gimp-developer] how to build json-glib in a prefix when building gimp from git in a prefix?



On 09/29/2018 05:18 PM, Ken Moffat via gimp-developer-list wrote:
On Sat, Sep 29, 2018 at 03:23:24PM -0400, Elle Stone wrote:
Anyone know the precise terminal commands for building json-glib in a prefix
using meson? I'm trying to update this article:

https://ninedegreesbelow.com/photography/build-gimp-in-prefix-for-artists.html

I already established the prefix using these commands:


PREFIX=$HOME/code/gimpdefault/install
export PATH=$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
export XDG_DATA_DIRS=$PREFIX/share:$XDG_DATA_DIRS
export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal"
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH
export GIO_EXTRA_MODULES=/usr/lib64/gio/modules
export SRC_DIR=$HOME/code/gimpdefault/build

I'm building on OpenSUSE Tumbleweed. Probably I need to install meson
something or other, so does anyone know what package(s) to install? And then
of course what commands to type.

Best,

and thanks in advance for any help!

Elle

Hi Elle,

I don't know how OpenSUSE splits packages into sub-packages (-dev or
something for headers), but the upstream packages you will need are
meson, ninja, and python3.

Well, on my main computer I run Gentoo. Failing to build json-glib on the upstairs computer (which runs OpenSUSE), I thought I'd try on my main computer, but I'm having the same problems.

For building meson in /usr, see
http://www.linuxfromscratch.org/blfs/view/svn/general/json-glib.html

Note that is still on 1.4.2 which is probably older than what you
are going to build.

I don't know what version json-glib from git is on. I cloned it as follows: git clone https://gitlab.gnome.org/GNOME/json-glib But I'd be happy to download a specific tarball, if anyone knows what version of json-glib is currently required by GIMP.

I don't think the _process_ of using meson has changed recently:
create a build directory, change to it, invoke meson with whatever
switches you need (a minimum of --prefix=) followed by .. to point
to where the meson files are.

I've never built anything using meson before. So I don't know how it was done before or how it should be done now. I made a directory called "build" within the clonse json-glib folder and cd'ed to is, and then used this command to set the prefix:

meson configure --prefix=$PREFIX

Which resulted in this error:

Meson configurator encountered an error:

ERROR: Directory /hdd/data1/code-build/gimp299/build/json-glib/build does not seem to be a Meson build directory.

For some options you may need cmake-style -Dfoo=bar.

I have found it necessary to export LC_ALL with a UTF-8 value, e.g.
en_GB.UTF-8, if invoking meson from a script running under the C or
POSIX locales.


I don't know what you are talking about. I have my locale information set to UTF-8. I don't know what "script running under the C or POSIX locales" actually means - can you explain?

And ninja will use all your cores, although for json-glib that is
probably immaterial.

So, use meson to create the Makefile(s), ninja to build, ninja
install.  For a DESTDIR-style install to check what is going to be
installed:
  DESTDIR=/tmp/JG ninja install
(i.e. put the DESTDIR first)

Please, having cd'ed to the "build" folder inside the json-glib folder, what's the next thing to type?

Personally I don't care if I never build json-glib from source as the Gentoo version is plenty recent enough for building GIMP from git. But I'm trying to update my website article for people who *do* need to build json-glib from source.

In BLFS we target linuxfromscratch which includes meson and ninja,
so those are not listed as dependencies, and the build time uses
LFS's "standard build units" (SBU) - for json-glib the time should
only be a few seconds on any modern machine.  Other deps are
whatever any 'Required' or 'Recommended' packages specify - but
since you probably already have glib and gobject-introspection I
guess you have everything necessary.

Also, in BLFS we only use lib, not lib64, I'm not sure if that will
affect meson.  Old docs from fedora suggest --libdir, but I don't

Gentoo uses "lib". OpenSUSE uses "lib64" or at least used to. Probably I should check to see what's currently being used on OpenSUSE. But right now I'm sitting at my Gentoo machine trying to do a test install of json-glib.

immediately see that in their latest build, so I suggest you try
without, and if it builds do a DESTDIR install to see if the files
are where you expect them to be.

For building with meson the important files are meson.build and
meson_options.txt.

 From the first, for json-glib-1.4.2 meson needs to be >= 0.40.1,
glib >= 2.44.0, and from the second, introspection defaults to true
but can be set to false if you don't have gobject-introspection, and

On Gentoo I have dev-util/meson-0.46.1 and dev-util/ninja-1.8.2 installed from portage. And I have at least glib > 2.44 installed in the prefix. I also have gobject-introspection installed from portage.

I don't think the problem is missing dependencies. I think the problem is that I just don't know what to type at the command line.

Why is json-glib even a requirement for running GIMP? glib-json is described on LFS as "The JSON GLib package is a library providing serialization and deserialization support for the JavaScript Object Notation (JSON) format described by RFC 4627. " -

Why does GIMP need anything even remotely related to javascript to run? GIMP is an image editor.

Best,
Elle

the docs are not built by default (needs gtk-doc and xsltproc).  But
check the required version of meson in the version of json-glib you
are going to build.

HTH

ĸen



--
https://ninedegreesbelow.com
Color management and free/libre photography


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