unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 49f41e0c0315af9addbc915b6770df15e3e35133 1578 bytes (raw)
name: gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch 	 # 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
 
From 10707f437f2fc3632067c6a0efa4432f7ebaf362 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Fri, 13 Dec 2019 10:46:20 +0200
Subject: [PATCH] Fix build with Python 3.8 by also checking for
 python-3.X-embed.pc

Since Python 3.8 the normal checks don't include the Python libraries
anymore and linking of the gst-python module would fail.

See also https://github.com/mesonbuild/meson/issues/5629

Fixes https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
---
 meson.build | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 5f13b48..d7c7e66 100644
--- a/meson.build
+++ b/meson.build
@@ -23,7 +23,17 @@ pygobject_dep = dependency('pygobject-3.0', fallback: ['pygobject', 'pygobject_d
 
 pymod = import('python')
 python = pymod.find_installation(get_option('python'))
-python_dep = python.dependency(required : true)
+pythonver = python.language_version()
+if pythonver.version_compare('<3.0')
+   error('Python2 is not supported anymore, please port your code to python3 (@0@ specified)'.format(python.language_version()))
+endif
+
+# Workaround for https://github.com/mesonbuild/meson/issues/5629
+# https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
+python_dep = dependency('python-@0@-embed'.format(pythonver), version: '>=3', required: false)
+if not python_dep.found()
+  python_dep = python.dependency(required : true)
+endif
 
 python_abi_flags = python.get_variable('ABIFLAGS', '')
 pylib_loc = get_option('libpython-dir')
-- 
2.26.2

debug log:

solving 49f41e0c03 ...
found 49f41e0c03 in https://yhetil.org/guix-patches/20200502110314.30403-1-mail@cbaines.net/

applying [1/1] https://yhetil.org/guix-patches/20200502110314.30403-1-mail@cbaines.net/
diff --git a/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch b/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch
new file mode 100644
index 0000000000..49f41e0c03

1:28: trailing whitespace.
 
1:43: trailing whitespace.
 
1:46: trailing whitespace.
-- 
Checking patch gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch...
Applied patch gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch cleanly.
warning: 3 lines add whitespace errors.

index at:
100644 49f41e0c0315af9addbc915b6770df15e3e35133	gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch

(*) 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).