From 95b7dc45fd324a6dbed3a4c24d66e9c5434c9169493ce5bbc3039c11dbf7fbf5 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 30 Oct 2019 15:22:15 +0000 Subject: [PATCH 1/6] Accepting request 744254 from home:Guillaume_G:branches:Base:System - Enable python3 binding in python3-libfdt - Fix python installation with patch: * dtc-fix_python_install.patch OBS-URL: https://build.opensuse.org/request/show/744254 OBS-URL: https://build.opensuse.org/package/show/Base:System/dtc?expand=0&rev=40 --- dtc-1.5.1.tar.sign | 16 ++++++++++++++++ dtc-fix_python_install.patch | 12 ++++++++++++ dtc.changes | 7 +++++++ dtc.spec | 23 ++++++++++++++++++++++- 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 dtc-1.5.1.tar.sign create mode 100644 dtc-fix_python_install.patch diff --git a/dtc-1.5.1.tar.sign b/dtc-1.5.1.tar.sign new file mode 100644 index 0000000..cf7b9ba --- /dev/null +++ b/dtc-1.5.1.tar.sign @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAl1vRsgACgkQbDjKyiDZ +s5J6yRAAsx7WyerewJvw1qd+PjX3pA5qwrctlCyCKduMoJTw4x/NPvXbkGmufOkt +USR67cF7Bt2Po2B24BgCMK0jJjx3tgOjZu9OcxIrxc1D+1Ojb7OuUUqKQusVfa/c +u1yh/Shi/VCzU8DN9hHBgM9tVe8hnrzVV6Rid9eJKE+a7KGDq52ckcV+dVrmTtrc +7vbNI0s4O9X+Veq44Rg0M4/AT8o+qcNtMHoBogw2CP9Jnzv1iXWkqjoG9PqREtOB +fVlB0S6n9nJQpFsxXWjdNwFmq6B9EYNHk026tNnsxXjJkaSfWMoPjK4gEqG9wBxG +Eca80ADaKGP1l9vHCxqo4xA1Eh6O92JbL7oxwShpty8R/pPEf2SBwYHl2z8hswU8 +IJyQdTCTfOLolsKroqBeCPqOq7LRvmfr9evdhpupXaB/MkZ+9whWWsWAOVKQrWNl +js0nLfrb1PWqhItXjS/INW3N4+fitfKcQiQ/JmwgAkwGJtzeTPFE8BDaRCzr3ehh ++K0sytNeIzoQfIgiWE6QUmMx/8QS1eiAdqZDSAX5DISApChXJIXwoxobshOt+9Yq +loUfB9Suw/fxSKEFGN/SarJ6JtfLKLI/tL+7aE2EqrykoK17nt5QKldqRbFj/+xz +AfgxYPd7b6JVXaxU69+wQmfNw4dLN5czkfKLikrcpU4a6hCENUM= +=ZeOU +-----END PGP SIGNATURE----- diff --git a/dtc-fix_python_install.patch b/dtc-fix_python_install.patch new file mode 100644 index 0000000..147ff70 --- /dev/null +++ b/dtc-fix_python_install.patch @@ -0,0 +1,12 @@ +diff -purN dtc-1.5.1.orig/pylibfdt/Makefile.pylibfdt dtc-1.5.1/pylibfdt/Makefile.pylibfdt +--- dtc-1.5.1.orig/pylibfdt/Makefile.pylibfdt 2019-10-30 14:47:48.135793334 +0100 ++++ dtc-1.5.1/pylibfdt/Makefile.pylibfdt 2019-10-30 14:48:17.019978313 +0100 +@@ -22,7 +22,7 @@ $(PYMODULE): $(PYLIBFDT_srcs) $(LIBFDT_a + + install_pylibfdt: $(PYMODULE) + @$(VECHO) INSTALL-PYLIB +- $(PYTHON) $(SETUP) $(SETUPFLAGS) install --prefix=$(PREFIX) ++ $(PYTHON) $(SETUP) $(SETUPFLAGS) install --prefix=$(DESTDIR)$(PREFIX) + + pylibfdt_clean: + @$(VECHO) CLEAN "(pylibfdt)" diff --git a/dtc.changes b/dtc.changes index 03b4665..fa869d6 100644 --- a/dtc.changes +++ b/dtc.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Oct 30 13:24:05 UTC 2019 - Guillaume GARDET + +- Enable python3 binding in python3-libfdt +- Fix python installation with patch: + * dtc-fix_python_install.patch + ------------------------------------------------------------------- Wed Oct 30 13:23:32 UTC 2019 - Dirk Mueller diff --git a/dtc.spec b/dtc.spec index 8232e88..2a471db 100644 --- a/dtc.spec +++ b/dtc.spec @@ -24,10 +24,14 @@ Summary: Device-tree compiler License: GPL-2.0-or-later URL: https://github.com/dgibson/dtc Source0: https://mirrors.edge.kernel.org/pub/software/utils/dtc/dtc-%{version}.tar.gz -Source1: baselibs.conf +Source1: https://mirrors.edge.kernel.org/pub/software/utils/dtc/dtc-%{version}.tar.sign +Source2: baselibs.conf +Patch1: dtc-fix_python_install.patch BuildRequires: bison BuildRequires: flex BuildRequires: libyaml-devel +BuildRequires: python3-devel +BuildRequires: swig %description PowerPC kernels are moving towards requiring a small Open @@ -55,8 +59,19 @@ Obsoletes: libfdt1-devel < %{version}-%{release} %description -n libfdt-devel This package provides development files for libfdt + +%package -n python3-libfdt +Summary: Python binding for Device Tree + +%description -n python3-libfdt +libfdt is a library to process Open Firmware style device trees on various +architectures. + +Python binding part. + %prep %setup -q +%patch1 -p1 %build make %{?_smp_mflags} V=1 @@ -91,4 +106,10 @@ make %{?_smp_mflags} check %{_libdir}/libfdt.so %{_includedir}/* +%files -n python3-libfdt +%{python3_sitearch}/*.so +%{python3_sitearch}/*.egg-info +%{python3_sitearch}/__pycache__/*.pyc +%{python3_sitearch}/libfdt.py + %changelog From e83e86382d75d1e29f67fd4f212b26d9ebe4e3879aa634496ec17080878b878c Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 30 Oct 2019 15:38:49 +0000 Subject: [PATCH 2/6] - switch to building python3 bindings using setuptools to avoid patching - update to 1.5.1: OBS-URL: https://build.opensuse.org/package/show/Base:System/dtc?expand=0&rev=41 --- dtc-fix_python_install.patch | 12 ------------ dtc.changes | 10 +++++++--- dtc.spec | 5 ++++- 3 files changed, 11 insertions(+), 16 deletions(-) delete mode 100644 dtc-fix_python_install.patch diff --git a/dtc-fix_python_install.patch b/dtc-fix_python_install.patch deleted file mode 100644 index 147ff70..0000000 --- a/dtc-fix_python_install.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -purN dtc-1.5.1.orig/pylibfdt/Makefile.pylibfdt dtc-1.5.1/pylibfdt/Makefile.pylibfdt ---- dtc-1.5.1.orig/pylibfdt/Makefile.pylibfdt 2019-10-30 14:47:48.135793334 +0100 -+++ dtc-1.5.1/pylibfdt/Makefile.pylibfdt 2019-10-30 14:48:17.019978313 +0100 -@@ -22,7 +22,7 @@ $(PYMODULE): $(PYLIBFDT_srcs) $(LIBFDT_a - - install_pylibfdt: $(PYMODULE) - @$(VECHO) INSTALL-PYLIB -- $(PYTHON) $(SETUP) $(SETUPFLAGS) install --prefix=$(PREFIX) -+ $(PYTHON) $(SETUP) $(SETUPFLAGS) install --prefix=$(DESTDIR)$(PREFIX) - - pylibfdt_clean: - @$(VECHO) CLEAN "(pylibfdt)" diff --git a/dtc.changes b/dtc.changes index fa869d6..1a08ba6 100644 --- a/dtc.changes +++ b/dtc.changes @@ -1,14 +1,18 @@ +------------------------------------------------------------------- +Wed Oct 30 15:38:12 UTC 2019 - Dirk Mueller + +- switch to building python3 bindings using setuptools to avoid + patching + ------------------------------------------------------------------- Wed Oct 30 13:24:05 UTC 2019 - Guillaume GARDET - Enable python3 binding in python3-libfdt -- Fix python installation with patch: - * dtc-fix_python_install.patch ------------------------------------------------------------------- Wed Oct 30 13:23:32 UTC 2019 - Dirk Mueller -- update to 1.5.1: +- update to 1.5.1: * Numerous assorted bugfixes * Add a new fdt_create_with_flags() function, and a FDT_CREATE_FLAG_NO_NAME_DEDUP flag which improves speed at the diff --git a/dtc.spec b/dtc.spec index 2a471db..02d15df 100644 --- a/dtc.spec +++ b/dtc.spec @@ -31,6 +31,7 @@ BuildRequires: bison BuildRequires: flex BuildRequires: libyaml-devel BuildRequires: python3-devel +BuildRequires: python3-setuptools BuildRequires: swig %description @@ -74,12 +75,14 @@ Python binding part. %patch1 -p1 %build -make %{?_smp_mflags} V=1 +make %{?_smp_mflags} V=1 NO_PYTHON=1 +python3 pylibfdt/setup.py build '--executable=/usr/bin/python3 -s' %install %make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} install -p -m 644 libfdt/libfdt_env.h %{buildroot}/%{_includedir} rm -f %{buildroot}/%{_libdir}/*.a +python3 pylibfdt/setup.py install -O1 --skip-build --force --root %{buildroot} --prefix %{_prefix} %check make %{?_smp_mflags} check From a1b69fd90ad6b25057acfc92b541ee969783332e97733c9958d47c2cf6fba85c Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 30 Oct 2019 15:44:28 +0000 Subject: [PATCH 3/6] OBS-URL: https://build.opensuse.org/package/show/Base:System/dtc?expand=0&rev=42 --- dtc.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/dtc.spec b/dtc.spec index 02d15df..8d37957 100644 --- a/dtc.spec +++ b/dtc.spec @@ -26,7 +26,6 @@ URL: https://github.com/dgibson/dtc Source0: https://mirrors.edge.kernel.org/pub/software/utils/dtc/dtc-%{version}.tar.gz Source1: https://mirrors.edge.kernel.org/pub/software/utils/dtc/dtc-%{version}.tar.sign Source2: baselibs.conf -Patch1: dtc-fix_python_install.patch BuildRequires: bison BuildRequires: flex BuildRequires: libyaml-devel From 907a080d05663061db29ef6f25a4e7bf5ab49e823125ab368299d23443338a0b Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 30 Oct 2019 16:47:29 +0000 Subject: [PATCH 4/6] OBS-URL: https://build.opensuse.org/package/show/Base:System/dtc?expand=0&rev=43 --- dtc.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dtc.spec b/dtc.spec index 8d37957..7651ffa 100644 --- a/dtc.spec +++ b/dtc.spec @@ -71,17 +71,17 @@ Python binding part. %prep %setup -q -%patch1 -p1 %build make %{?_smp_mflags} V=1 NO_PYTHON=1 python3 pylibfdt/setup.py build '--executable=/usr/bin/python3 -s' %install -%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} +%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} NO_PYTHON=1 install -p -m 644 libfdt/libfdt_env.h %{buildroot}/%{_includedir} rm -f %{buildroot}/%{_libdir}/*.a -python3 pylibfdt/setup.py install -O1 --skip-build --force --root %{buildroot} --prefix %{_prefix} +pushd pylibfdt +python3 setup.py install -O1 --force --root %{buildroot} --prefix %{_prefix} %check make %{?_smp_mflags} check From c715f4783b6221fdf583d0cd55d6ca4fb0568ce87689cfa5409bd7115eea7e1d Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 30 Oct 2019 16:48:23 +0000 Subject: [PATCH 5/6] OBS-URL: https://build.opensuse.org/package/show/Base:System/dtc?expand=0&rev=44 --- dtc.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dtc.spec b/dtc.spec index 7651ffa..52a83e4 100644 --- a/dtc.spec +++ b/dtc.spec @@ -74,13 +74,14 @@ Python binding part. %build make %{?_smp_mflags} V=1 NO_PYTHON=1 -python3 pylibfdt/setup.py build '--executable=/usr/bin/python3 -s' +cd pylibfdt +python3 setup.py build '--executable=/usr/bin/python3 -s' %install %make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} NO_PYTHON=1 install -p -m 644 libfdt/libfdt_env.h %{buildroot}/%{_includedir} rm -f %{buildroot}/%{_libdir}/*.a -pushd pylibfdt +cd pylibfdt python3 setup.py install -O1 --force --root %{buildroot} --prefix %{_prefix} %check From c1d6ec879ccd56baa6a373e4b10702f3a045df2df475b99878dea29ddb62bd8b Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 30 Oct 2019 16:59:43 +0000 Subject: [PATCH 6/6] OBS-URL: https://build.opensuse.org/package/show/Base:System/dtc?expand=0&rev=45 --- dtc.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dtc.spec b/dtc.spec index 52a83e4..74f1d51 100644 --- a/dtc.spec +++ b/dtc.spec @@ -75,14 +75,15 @@ Python binding part. %build make %{?_smp_mflags} V=1 NO_PYTHON=1 cd pylibfdt -python3 setup.py build '--executable=/usr/bin/python3 -s' +python3 setup.py build_ext +%py3_build %install %make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} NO_PYTHON=1 install -p -m 644 libfdt/libfdt_env.h %{buildroot}/%{_includedir} rm -f %{buildroot}/%{_libdir}/*.a cd pylibfdt -python3 setup.py install -O1 --force --root %{buildroot} --prefix %{_prefix} +%python3_install %check make %{?_smp_mflags} check