how to build json-glib in a prefix when building gimp from git in a prefix?
This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.
This is a read-only list on gimpusers.com so this discussion thread is read-only, too.
how to build json-glib in a prefix when building gimp from git in a prefix? | Elle Stone | 29 Sep 19:23 |
how to build json-glib in a prefix when building gimp from git in a prefix? | Ken Moffat via gimp-developer-list | 29 Sep 21:18 |
how to build json-glib in a prefix when building gimp from git in a prefix? | Elle Stone | 29 Sep 22:21 |
how to build json-glib in a prefix when building gimp from git in a prefix? | Ken Moffat via gimp-developer-list | 29 Sep 23:00 |
how to build json-glib in a prefix when building gimp from git in a prefix? | Ken Moffat via gimp-developer-list | 30 Sep 01:33 |
how to build json-glib in a prefix when building gimp from git in a prefix? | wwp | 30 Sep 08:44 |
how to build json-glib in a prefix when building gimp from git in a prefix? | Ken Moffat via gimp-developer-list | 30 Sep 10:36 |
how to build json-glib in a prefix when building gimp from git in a prefix? | Elle Stone | 30 Sep 12:16 |
how to build json-glib in a prefix when building gimp from git in a prefix?
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
how to build json-glib in a prefix when building gimp from git in a prefix?
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/buildI'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.
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 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.
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.
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)
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 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 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
Well grubbed , old mole!
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/buildI'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.htmlNote 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
how to build json-glib in a prefix when building gimp from git in a prefix?
On Sat, Sep 29, 2018 at 06:21:36PM -0400, Elle Stone wrote:
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:
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.htmlNote 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've no idea (I stick to releases) but looking at gimp's configure script you will probably find a pkg-config test (always a bit hit-and-miss, look for json-glib throughout the configure script, until you find a test for pkg-config, then look for any variable it uses such as json_glib_version or JSON_VERSION or whatever).
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
No, maybe I confused you.
meson --prefix=$PREFIX ..
Meson is what does the configuration, and from a build directory it needs '..' to point to its files.
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.
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?
If you are already using UTF-8, as expected, then that is fine.
C and POSIX locales are the old-style "everything is ASCII" variants. Sometimes (particularly for building some old packages which got confused by modern locales) I have used scripts which included "LC_ALL=C".
Please, having cd'ed to the "build" folder inside the json-glib folder, what's the next thing to type?
As above, just meson with --prefix=$PREFIX and .. to poitn to the meson files.
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.
[...]
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.
[...]
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.
Yes.
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 JSON format is popular in mnany places which have nothing to do with javascript. I assume they invented it so they got naming rights.
ĸen
Well grubbed , old mole!
how to build json-glib in a prefix when building gimp from git in a prefix?
On Sun, Sep 30, 2018 at 12:00:40AM +0100, Ken Moffat via gimp-developer-list wrote:
On Sat, Sep 29, 2018 at 06:21:36PM -0400, Elle Stone wrote:
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.
Are you sure you need json-glib ?
I just cloned https://gitlab.gnome.org/GNOME/gimp.git a few minutes ago. I cani't run ./autogen.sh (don't have gtk-doc, and no intention of installing that source of pain), but grepping for json-glib only finds:
ken@origin /scratch/ken/git/gimp $find -type f | xargs grep json-glib ./build/windows/jhbuild/gimp.moduleset: ./build/windows/jhbuild/misclibs.moduleset: ./build/windows/jhbuild/misclibs.moduleset: module="json-glib/1.2/json-glib-1.2.2.tar.xz" ./build/docker/gimpbuilder-base/Dockerfile:RUN apt-get install $APT_GET_OPTIONS intltool libglib2.0-dev libjson-c-dev libjson-glib-dev libgexiv2-dev libcairo2-dev libpango1.0-dev libjpeg62-turbo-dev libsuitesparse-dev libspiro-dev libopenexr-dev libwebp-dev
which suggests that only docker and windows need it. And grepping for JSON in capitals finds some perl modules in a git hook, and JSON_C_LIBS references in the Makefile.am files under app/ - json-c (0.12.1) is again referenced in windows and docker files.
ĸen
Well grubbed , old mole!
how to build json-glib in a prefix when building gimp from git in a prefix?
Hello Ken,
On Sun, 30 Sep 2018 02:33:34 +0100 Ken Moffat via gimp-developer-list wrote:
On Sun, Sep 30, 2018 at 12:00:40AM +0100, Ken Moffat via gimp-developer-list wrote:
On Sat, Sep 29, 2018 at 06:21:36PM -0400, Elle Stone wrote:
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.
Are you sure you need json-glib ?
I just cloned https://gitlab.gnome.org/GNOME/gimp.git a few minutes ago. I cani't run ./autogen.sh (don't have gtk-doc, and no intention of installing that source of pain), but grepping for json-glib only finds:
ken@origin /scratch/ken/git/gimp $find -type f | xargs grep json-glib ./build/windows/jhbuild/gimp.moduleset: ./build/windows/jhbuild/misclibs.moduleset: ./build/windows/jhbuild/misclibs.moduleset: module="json-glib/1.2/json-glib-1.2.2.tar.xz" ./build/docker/gimpbuilder-base/Dockerfile:RUN apt-get install $APT_GET_OPTIONS intltool libglib2.0-dev libjson-c-dev libjson-glib-dev libgexiv2-dev libcairo2-dev libpango1.0-dev libjpeg62-turbo-dev libsuitesparse-dev libspiro-dev libopenexr-dev libwebp-dev
which suggests that only docker and windows need it. And grepping for JSON in capitals finds some perl modules in a git hook, and JSON_C_LIBS references in the Makefile.am files under app/ - json-c (0.12.1) is again referenced in windows and docker files.
Json-glib *is* needed to build gimp 2.10. I build gimp 2.8/2.10 on CentOS 6 and 7 boxes, where no package is available (for the latest 2.8 and 2.10 at all), and I build quite all the necessary deps (it's a lot and the cross-deps are a nightmare), json-glib is required at some step. From what I see in my build script, gegl 0.3/0.4 need it.
Regards,
wwp
how to build json-glib in a prefix when building gimp from git in a prefix?
On Sun, Sep 30, 2018 at 10:44:38AM +0200, wwp wrote:
Hello Ken,
Hi wwp,
On Sun, 30 Sep 2018 02:33:34 +0100 Ken Moffat via gimp-developer-list wrote:
On Sun, Sep 30, 2018 at 12:00:40AM +0100, Ken Moffat via gimp-developer-list wrote:
On Sat, Sep 29, 2018 at 06:21:36PM -0400, Elle Stone wrote:
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.
Are you sure you need json-glib ?
Json-glib *is* needed to build gimp 2.10. I build gimp 2.8/2.10 on CentOS 6 and 7 boxes, where no package is available (for the latest 2.8 and 2.10 at all), and I build quite all the necessary deps (it's a lot and the cross-deps are a nightmare), json-glib is required at some step. From what I see in my build script, gegl 0.3/0.4 need it.
Yeah, you are right. I thought it must be a new dep for gimp itself. And I didn't remember using it. But now that I look at my scripts I can see that it is GEGL which needs it.
So for Elle, the version is whatever your GEGL needs. A quick look at https://gitlab.gnome.org/GNOME/gegl/blob/master/configure.ac suggests json-glib-1.0 which both json-glib-1.2 and -1.4 (and probably even -1.0) provided.
ĸen
Well grubbed , old mole!
how to build json-glib in a prefix when building gimp from git in a prefix?
Many thanks to everyone who helped sort out how to build json-glib. I did finally manage to build json-glib in a prefix on Gentoo, using these commands:
$PREFIX=PREFIX=$HOME/code-install/gimp299/install
cd json-glib
mkdir build
cd build
meson --prefix=$PREFIX ..
ninja install
Best,
Elle
On 09/30/2018 06:36 AM, Ken Moffat via gimp-developer-list wrote:
On Sun, Sep 30, 2018 at 10:44:38AM +0200, wwp wrote:
Hello Ken,
Hi wwp,
On Sun, 30 Sep 2018 02:33:34 +0100 Ken Moffat via gimp-developer-list wrote:
On Sun, Sep 30, 2018 at 12:00:40AM +0100, Ken Moffat via gimp-developer-list wrote:
On Sat, Sep 29, 2018 at 06:21:36PM -0400, Elle Stone wrote:
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.
Are you sure you need json-glib ?
Json-glib *is* needed to build gimp 2.10. I build gimp 2.8/2.10 on CentOS 6 and 7 boxes, where no package is available (for the latest 2.8 and 2.10 at all), and I build quite all the necessary deps (it's a lot and the cross-deps are a nightmare), json-glib is required at some step. From what I see in my build script, gegl 0.3/0.4 need it.
Yeah, you are right. I thought it must be a new dep for gimp itself. And I didn't remember using it. But now that I look at my scripts I can see that it is GEGL which needs it.
So for Elle, the version is whatever your GEGL needs. A quick look at https://gitlab.gnome.org/GNOME/gegl/blob/master/configure.ac suggests json-glib-1.0 which both json-glib-1.2 and -1.4 (and probably even -1.0) provided.
ĸen
https://ninedegreesbelow.com Color management and free/libre photography