Subject: bug#28444: closed (Re: [bug#28444] [PATCH 3/3] build-system: Add 'meson-build-system'.)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 16 Sep 2017 16:13:02 +0000

Your bug report

#28444: [PATCH 0/3] Add meson-build-system

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
28444: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28444
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#28444] [PATCH 3/3] build-system: Add 'meson-build-system'.
From: [email-masked] (Ludovic Courtès)
To: Peter Mikkelsen <[email-masked]>
Cc: [email-masked]
Date: Sat, 16 Sep 2017 18:11:59 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Peter,

Peter Mikkelsen <[email-masked]> skribis:

[...]

>> According to this description, half of it corresponds to the
>> ‘validate-runpath’ phase, no?
>
> To my understanding 'validate-runpath' just checks and complains, but
> this phase checks if it can find any dependencies in directories that
> are local to the package, and if it can, it adds them to the runpath.
> I have tried to update the description :)

I see.  Out of curiosity, which libraries did you find to be present in
RUNPATH but not in NEEDED?

I’d consider it a Meson bug (or a bug in how the package uses Meson) if
test libraries are passed as -l when linking non-test binaries.

At any rate, we should implement ‘shrink-runpath’ in (guix build
gremlin) someday!

> From 8185c2a154c7473d3b50351246cc83b792ec6a57 Mon Sep 17 00:00:00 2001
> From: Peter Mikkelsen <[email-masked]>
> Date: Wed, 13 Sep 2017 14:37:39 +0200
> Subject: [PATCH] build-system: Add 'meson-build-system'.
>
> * Makefile.am (MODULES): Add 'guix/build-system/meson.scm' and
>   'guix/build/meson-build-system.scm'.
> * guix/build-system/meson.scm: New file.
> * guix/build/meson-build-system.scm: New file.
> * doc/guix.texi (Build Systems): Add 'meson-build-system'.

Pushed with the changes below.

Thank you!

Now to upgrade GNOME?  :-)

Ludo’.

diff --git a/doc/guix.texi b/doc/guix.texi
index 1fee21314..1356a357c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3814,16 +3814,16 @@ locations in the output directory.
 @defvr {Scheme Variable} meson-build-system
 This variable is exported by @code{(guix build-system meson)}.  It
 implements the build procedure for packages that use
-@url{http://mesonbuild.com, meson} as their build system.
+@url{http://mesonbuild.com, Meson} as their build system.
 
-It adds both @code{meson} and @code{ninja} to the set of inputs, and they
-can be changed with the parameters @code{#:meson} and @code{#:ninja} if needed.
-The default @code{meson} is @code{meson-for-build} which is special because
-it doesn't clear the @code{RUNPATH} of binaries and libraries when they are
-installed.
+It adds both Meson and @uref{https://ninja-build.org/, Ninja} to the set
+of inputs, and they can be changed with the parameters @code{#:meson}
+and @code{#:ninja} if needed.  The default Meson is
+@code{meson-for-build}, which is special because it doesn't clear the
+@code{RUNPATH} of binaries and libraries when they are installed.
 
-The build-system is an extension of @var{gnu-build-system}, but with the
-following phases changed to some specific for meson:
+This build system is an extension of @var{gnu-build-system}, but with the
+following phases changed to some specific for Meson:
 
 @table @code
 
@@ -3838,7 +3838,7 @@ this can be changed with @code{#:parallel-build?}.
 
 @item check
 The phase runs @code{ninja} with the target specified in @code{#:test-target},
-which is @var{``test''} by default.
+which is @code{"test"} by default.
 
 @item install
 The phase runs @code{ninja install} and can not be changed.
@@ -3857,11 +3857,11 @@ when they are build, but often that is not the @code{RUNPATH} we want.
 Therefor it is also shrinked to the minimum needed by the program.
 
 @item glib-or-gtk-wrap
-This phase is the phase provided by @var{glib-or-gtk-build-system}, and it
+This phase is the phase provided by @code{glib-or-gtk-build-system}, and it
 is not enabled by default.  It can be enabled with @code{#:glib-or-gtk?}.
 
 @item glib-or-gtk-compile-schemas
-This phase is the phase provided by @var{glib-or-gtk-build-system}, and it
+This phase is the phase provided by @code{glib-or-gtk-build-system}, and it
 is not enabled by default.  It can be enabled with @code{#:glib-or-gtk?}.
 @end table
 @end defvr
diff --git a/guix/build/meson-build-system.scm b/guix/build/meson-build-system.scm
index 51542974e..2b92240c5 100644
--- a/guix/build/meson-build-system.scm
+++ b/guix/build/meson-build-system.scm
@@ -27,7 +27,6 @@
   #:use-module (rnrs io ports)
   #:use-module (srfi srfi-1)
   #:export (%standard-phases
-            %glib-or-gtk-phases
             meson-build))
 
 ;; Commentary:
@@ -61,8 +60,10 @@
 
 (define* (check #:key test-target parallel-tests? tests?
                 #:allow-other-keys)
-  (unless parallel-tests?
-    (setenv "MESON_TESTTHREADS" "1"))
+  (setenv "MESON_TESTTHREADS"
+          (if parallel-tests?
+              (number->string (parallel-job-count))
+              "1"))
   (if tests?
       (zero? (system* "ninja" test-target))
       (begin
@@ -114,7 +115,7 @@ for example libraries only needed for the tests."
        (let* ((elf-dirnames (map (lambda (subdir)
                                    (string-append directory "/" subdir))
                                  elf-directories))
-              (excisting-elf-dirs (filter (lambda (dir)
+              (existing-elf-dirs (filter (lambda (dir)
                                             (and (file-exists? dir)
                                                  (file-is-directory? dir)))
                                           elf-dirnames))
@@ -122,7 +123,7 @@ for example libraries only needed for the tests."
                           (elf-file? name)))
               (elf-list (concatenate (map (lambda (dir)
                                             (find-files dir elf-pred))
-                                          excisting-elf-dirs))))
+                                          existing-elf-dirs))))
          (for-each (lambda (elf-file)
                      (system* "patchelf" "--shrink-rpath" elf-file)
                      (handle-file elf-file elf-list))

Subject: [PATCH 0/3] Add meson-build-system
From: Peter Mikkelsen <[email-masked]>
To: [email-masked]
Cc: Peter Mikkelsen <[email-masked]>
Date: Wed, 13 Sep 2017 14:48:22 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

The following patches updates meson, adds a special version of meson to
be used in the build system, and then adds the build system. It does not
support cross compilation yet, but I might add it in the future.

Happy hacking!

Peter Mikkelsen (3):
  gnu: meson: Update to 0.42.0.
  gnu: Add meson-for-build.
  build-system: Add 'meson-build-system'.

 Makefile.am                                      |   2 +
 doc/guix.texi                                    |  55 +++++++
 gnu/local.mk                                     |   1 +
 gnu/packages/build-tools.scm                     |  20 ++-
 gnu/packages/patches/meson-for-build-rpath.patch |  24 +++
 guix/build-system/meson.scm                      | 178 +++++++++++++++++++++++
 guix/build/meson-build-system.scm                | 144 ++++++++++++++++++
 7 files changed, 422 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/meson-for-build-rpath.patch
 create mode 100644 guix/build-system/meson.scm
 create mode 100644 guix/build/meson-build-system.scm

--
2.14.1