[packages/stfl] don't use fixed python executable

atler atler at pld-linux.org
Mon Jul 1 21:00:11 CEST 2024


commit 2198bad97f88d11b809e0a0610d5ecf192264f8d
Author: Jan Palus <atler at pld-linux.org>
Date:   Mon Jul 1 20:46:48 2024 +0200

    don't use fixed python executable

 python-bin.patch | 43 +++++++++++++++++++++++++++++++++++++++++++
 stfl.spec        |  8 ++++++--
 2 files changed, 49 insertions(+), 2 deletions(-)
---
diff --git a/stfl.spec b/stfl.spec
index b3f921c..6cd7836 100644
--- a/stfl.spec
+++ b/stfl.spec
@@ -11,6 +11,7 @@ Source0:	http://www.clifford.at/stfl/%{name}-%{version}.tar.gz
 Patch0:		%{name}-example-dir.patch
 Patch1:		%{name}-link.patch
 Patch2:		python-install.patch
+Patch3:		python-bin.patch
 URL:		http://www.clifford.at/stfl/
 BuildRequires:	ncurses-devel >= 5
 BuildRequires:	perl-devel
@@ -124,6 +125,7 @@ Wiązania Ruby'ego dla STFL-a.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 echo 'LDLIBS=-ltinfow' >> Makefile.cfg
 
 %build
@@ -132,7 +134,8 @@ echo 'LDLIBS=-ltinfow' >> Makefile.cfg
 	libdir=%{_libdir} \
 	CFLAGS="-Wall %{rpmcppflags} %{rpmcflags} -I. -D_GNU_SOURCE -fPIC" \
 	LDFLAGS="%{rpmldflags}" \
-	CC="%{__cc} -pthread"
+	CC="%{__cc} -pthread" \
+	PYTHON="%{__python}"
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -142,7 +145,8 @@ install -d $RPM_BUILD_ROOT%{py_libdir}/lib-dynload
 	prefix=%{_prefix} \
 	libdir=%{_lib} \
 	RUBYARCHDIR=$RPM_BUILD_ROOT%{ruby_vendorarchdir} \
-	DESTDIR=$RPM_BUILD_ROOT
+	DESTDIR=$RPM_BUILD_ROOT \
+	PYTHON="%{__python}"
 
 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
 
diff --git a/python-bin.patch b/python-bin.patch
new file mode 100644
index 0000000..37e77a8
--- /dev/null
+++ b/python-bin.patch
@@ -0,0 +1,43 @@
+diff -ur stfl-0.24.orig/Makefile.cfg stfl-0.24/Makefile.cfg
+--- stfl-0.24.orig/Makefile.cfg	2024-07-01 20:29:07.196345570 +0200
++++ stfl-0.24/Makefile.cfg	2024-07-01 20:30:51.739972927 +0200
+@@ -21,6 +21,7 @@
+ export libdir ?= lib
+ export prefix ?= /usr/local
+ export DESTDIR ?= /
++PYTHON = python
+ 
+ ifneq ($(shell spl-config --cflags 2>/dev/null),)
+ FOUND_SPL = 1
+@@ -40,7 +41,7 @@
+ FOUND_PERL5 = 0
+ endif
+ 
+-ifneq ($(shell python -c 'print 1' 2>/dev/null),)
++ifneq ($(shell $(PYTHON) -c 'print 1' 2>/dev/null),)
+ FOUND_PYTHON = 1
+ else
+ FOUND_PYTHON = 0
+diff -ur stfl-0.24.orig/python/Makefile.snippet stfl-0.24/python/Makefile.snippet
+--- stfl-0.24.orig/python/Makefile.snippet	2024-07-01 20:29:07.193012334 +0200
++++ stfl-0.24/python/Makefile.snippet	2024-07-01 20:31:38.551946874 +0200
+@@ -18,8 +18,8 @@
+ #  MA 02110-1301 USA
+ #
+ 
+-PYTHON_VERSION = $(shell python -V 2>&1 | cut -f2 -d' ' | cut -f1-2 -d'.')
+-PYTHON_SITEARCH = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=True, prefix='/usr')")
++PYTHON_VERSION = $(shell $(PYTHON) -V 2>&1 | cut -f2 -d' ' | cut -f1-2 -d'.')
++PYTHON_SITEARCH = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=True, prefix='/usr')")
+ 
+ all: python/_stfl.so python/stfl.py python/stfl.pyc
+ 
+@@ -29,7 +29,7 @@
+ 	cd python && swig -python -threads stfl.i
+ 	gcc -shared -pthread -fPIC python/stfl_wrap.c -I/usr/include/python$(PYTHON_VERSION) \
+ 		-I. libstfl.a -lncursesw -o python/_stfl.so
+-	cd python && python -c 'import stfl'
++	cd python && $(PYTHON) -c 'import stfl'
+ 
+ install_python: python/_stfl.so python/stfl.py python/stfl.pyc
+ 	mkdir -p $(DESTDIR)$(PYTHON_SITEARCH)/
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/stfl.git/commitdiff/2198bad97f88d11b809e0a0610d5ecf192264f8d



More information about the pld-cvs-commit mailing list