guix-patches
[Top][All Lists]
Advanced

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

bug#28444: [PATCH 3/3] build-system: Add 'meson-build-system'.


From: Ludovic Courtès
Subject: bug#28444: [PATCH 3/3] build-system: Add 'meson-build-system'.
Date: Sat, 16 Sep 2017 18:11:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Hi Peter,

Peter Mikkelsen <address@hidden> 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 <address@hidden>
> 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
address@hidden://mesonbuild.com, meson} as their build system.
address@hidden://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
address@hidden, which is special because it doesn't clear the
address@hidden 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))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]