unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob c42e13cf2a4e45d64fc57828fbc8d094803ca0a2 8915 bytes (raw)
name: gnu/packages/meson.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Corentin Bocquillon <corentin@nybble.fr>
;;; Copyright © 2017, 2018, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
;;; Copyright © 2018-2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2021 Sou Bunnbu (宋文武) <iyzsong@gmail.com>
;;; Copyright © 2021 Kaelyn Takata <kaelyn.alexi@protonmail.com>
;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
;;; Copyright © 2021 Vivien Kraus <vivien@planete-kraus.eu>
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages meson)
  #:use-module (ice-9 optargs)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system python)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module (guix modules)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages check)
  #:use-module (gnu packages elf)
  #:use-module (gnu packages ninja)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-build)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages version-control))

(define-public meson-0.63
  (package
    (name "meson")
    (version "0.63.2")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/mesonbuild/meson/"
                                  "releases/download/" version  "/meson-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "1gwba75z47m2hv3w08gw8sgqgbknjr7rj1qwr510bgknxwbjy8hn"))))
    (build-system python-build-system)
    (arguments
     `(;; FIXME: Tests require many additional inputs and patching many
       ;; hard-coded file system locations in "run_unittests.py".
       #:tests? #f
       #:phases (modify-phases %standard-phases
                  ;; Meson calls the various executables in out/bin through the
                  ;; Python interpreter, so we cannot use the shell wrapper.
                  (replace 'wrap
                    (lambda* (#:key outputs inputs #:allow-other-keys)
                      (let ((python-version
                             (python-version (assoc-ref inputs "python")))
                            (output (assoc-ref outputs "out")))
                        (substitute* (string-append output "/bin/meson")
                          (("# EASY-INSTALL-ENTRY-SCRIPT")
                           (format #f "\
import sys
sys.path.insert(0, '~a/lib/python~a/site-packages')
# EASY-INSTALL-ENTRY-SCRIPT"
                                   output python-version)))))))))
    (inputs (list python-wrapper ninja))
    (home-page "https://mesonbuild.com/")
    (synopsis "Build system designed to be fast and user-friendly")
    (description
     "The Meson build system is focused on user-friendliness and speed.
It can compile code written in C, C++, Fortran, Java, Rust, and other
languages.  Meson provides features comparable to those of the
Autoconf/Automake/make combo.  Build specifications, also known as @dfn{Meson
files}, are written in a custom domain-specific language (@dfn{DSL}) that
resembles Python.")
    (license license:asl2.0)))

(define-public meson-0.60
  (package
    (inherit meson-0.63)
    (version "0.60.3")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/mesonbuild/meson/"
                                  "releases/download/" version  "/meson-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "13mrrizg4vl6n5k7fz6amyafnn3i097dcarr552qc0ca6nlmzjl7"))
              (patches (search-patches
                        "meson-allow-dirs-outside-of-prefix.patch"))))))

;;; This older Meson variant is kept for now for gtkmm and others that may
;;; have problems with 0.60.
(define-public meson-0.59
  (package
    (inherit meson-0.60)
    (version "0.59.4")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/mesonbuild/meson/"
                                  "releases/download/" version  "/meson-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "117cm8794h291lca1wljz1pwnzidgbvrpg3mw3np6ksma368hyd7"))
              (patches (search-patches
                        "meson-allow-dirs-outside-of-prefix.patch"))))))

;; TODO: Bump this in the next rebuild cycle.
(define-public meson meson-0.60)

(define-public meson-python
  (package
    (name "meson-python")
    (version "0.8.1")
    (source (origin
              (method url-fetch)
              (uri (pypi-uri "meson_python" version))
              (sha256
               (base32
                "0k2yn0iws1n184sdznzmfw4xgbqgq5cn02hpc7m0xdaxryj1ybs4"))))
    (build-system python-build-system)
    (arguments
     (list #:phases
           #~(modify-phases %standard-phases
               (add-after 'unpack 'avoid-ninja-dependency
                 (lambda _
                   ;; Avoid dependency on the "ninja" PyPI distribution,
                   ;; which is a meta-package that simply downloads and
                   ;; installs ninja from the web ...
                   (substitute* "pyproject.toml"
                     (("'ninja',")
                      ""))))
               (replace 'build
                 (lambda _
                   ;; ZIP does not support timestamps before 1980.
                   (setenv "SOURCE_DATE_EPOCH" "315532800")
                   (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
               (replace 'install
                 (lambda _
                   (let ((whl (car (find-files "dist" "\\.whl$"))))
                     (invoke "pip" "--no-cache-dir" "--no-input"
                             "install" "--no-deps" "--prefix" #$output whl))))
               (replace 'check
                 (lambda* (#:key tests? #:allow-other-keys)
                   (when tests?
                     (invoke "pytest" "-vv" "tests" "-k"
                             (string-append
                              "not "
                              ;; These tests require a git checkout.
                              (string-join '("test_contents_unstaged"
                                             "test_no_pep621"
                                             "test_pep621"
                                             "test_dynamic_version"
                                             "test_contents"
                                             "test_contents_subdirs")
                                           " and not ")))))))))
    (propagated-inputs
     (list meson-0.63                   ;>=0.62 required
           ninja
           ;; XXX: python-meson forcefully sets the RUNPATH of binaries
           ;; for vendoring purposes, and uses PatchELF for that(!).  This
           ;; functionality is not useful in Guix, but removing this
           ;; dependency is tricky.  There is discussion upstream about making
           ;; it optional, but for now we'll just carry it:
           ;; https://github.com/FFY00/meson-python/issues/125
           patchelf
           python-colorama
           python-pyproject-metadata
           python-tomli
           python-wheel))
    (native-inputs
     (list python-pypa-build
           python-wheel

           ;; For tests.
           pkg-config
           python-gitpython
           python-pytest
           python-pytest-mock))
    (home-page "https://github.com/FFY00/mesonpy")
    (synopsis "Meson-based build backend for Python")
    (description
     "meson-python is a PEP 517 build backend for Meson projects.")
    (license license:expat)))

debug log:

solving c42e13cf2a ...
found c42e13cf2a in https://yhetil.org/guix-patches/28f09f45f5ded05a459aafac932207a28e4d27d3.1673045732.git.vivien@planete-kraus.eu/

applying [1/1] https://yhetil.org/guix-patches/28f09f45f5ded05a459aafac932207a28e4d27d3.1673045732.git.vivien@planete-kraus.eu/
diff --git a/gnu/packages/meson.scm b/gnu/packages/meson.scm
new file mode 100644
index 0000000000..c42e13cf2a

Checking patch gnu/packages/meson.scm...
Applied patch gnu/packages/meson.scm cleanly.

index at:
100644 c42e13cf2a4e45d64fc57828fbc8d094803ca0a2	gnu/packages/meson.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).