Patchwork [v3] systemd: added python-systemd package generation.

login
register
mail settings
Submitter Yevhen Kyriukha
Date April 22, 2013, 9:16 p.m.
Message ID <1366665407-32136-1-git-send-email-kirgene@gmail.com>
Download mbox | patch
Permalink /patch/48659/
State New
Headers show

Comments

Yevhen Kyriukha - April 22, 2013, 9:16 p.m.
---
 meta/recipes-core/systemd/systemd_199.bb |   19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
Anders Darander - April 23, 2013, 6:36 a.m.
Yevhen Kyriukha <kirgene@gmail.com> wrote:

>---
> meta/recipes-core/systemd/systemd_199.bb |   19 +++++++++++++++----
> 1 file changed, 15 insertions(+), 4 deletions(-)
>
>diff --git a/meta/recipes-core/systemd/systemd_199.bb
>b/meta/recipes-core/systemd/systemd_199.bb
>index 5240443..9a68960 100644
>--- a/meta/recipes-core/systemd/systemd_199.bb
>+++ b/meta/recipes-core/systemd/systemd_199.bb
>@@ -11,12 +11,18 @@ PROVIDES = "udev"
> PE = "1"
> PR = "r2"
> 
>-DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native
>gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0"
>+DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native
>gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0
>python"

Would out be possible to change this patch to use PACKAGECONFIG instead? Otherwise we're going to always drag in Python, which will increase build times for systems that are not already building / using Python in the image. 

I think that I've discussed this at some earlier point when a similar changed was proposed, though I don't remember there were some problems with that approach. 

Cheers, 
Anders
Ross Burton - April 23, 2013, 8:43 a.m.
On 23 April 2013 07:36, Anders Darander <anders@chargestorm.se> wrote:
> Would out be possible to change this patch to use PACKAGECONFIG instead? Otherwise we're going to always drag in Python, which will increase build times for systems that are not already building / using Python in the image.
>
> I think that I've discussed this at some earlier point when a similar changed was proposed, though I don't remember there were some problems with that approach.

The earlier patch did use PACKAGECONFIG, so I agree that this should
be an PACKAGECONFIG option, defaulting to off.

Ross

Patch

diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
index 5240443..9a68960 100644
--- a/meta/recipes-core/systemd/systemd_199.bb
+++ b/meta/recipes-core/systemd/systemd_199.bb
@@ -11,12 +11,18 @@  PROVIDES = "udev"
 PE = "1"
 PR = "r2"
 
-DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0"
+DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0 python"
 DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 
 SECTION = "base/shell"
 
-inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives
+inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives pythonnative python-dir
+
+# need to export these variables for python-config to work
+export BUILD_SYS
+export HOST_SYS
+export STAGING_INCDIR
+export STAGING_LIBDIR
 
 SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
            file://touchscreen.rules \
@@ -63,9 +69,9 @@  EXTRA_OECONF = " --with-rootprefix=${base_prefix} \
                  --disable-coredump \
                  --disable-introspection \
                  --disable-tcpwrap \
+                 --with-python \
                  --enable-split-usr \
                  --disable-microhttpd \
-                 --without-python \
                  --with-sysvrcnd-path=${sysconfdir} \
                  --with-firmware-path=/lib/firmware \
                  ac_cv_path_KILL=${base_bindir}/kill \
@@ -119,7 +125,7 @@  python populate_packages_prepend (){
 }
 PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*"
 
-PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install"
+PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install python-${PN} python-${PN}-dbg python-${PN}-dev"
 
 USERADD_PACKAGES = "${PN}"
 GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
@@ -129,6 +135,11 @@  FILES_${PN}-analyze = "${bindir}/systemd-analyze"
 FILES_${PN}-initramfs = "/init"
 RDEPENDS_${PN}-initramfs = "${PN}"
 
+FILES_python-${PN} = "${PYTHON_SITEPACKAGES_DIR}/systemd/*.py* ${PYTHON_SITEPACKAGES_DIR}/systemd/*.so"
+RDEPENDS_python-${PN} = "python-core python-datetime python-logging python-syslog"
+FILES_python-${PN}-dev = "${PYTHON_SITEPACKAGES_DIR}/systemd/*.la"
+FILES_python-${PN}-dbg = "${PYTHON_SITEPACKAGES_DIR}/systemd/.debug"
+
 FILES_${PN}-gui = "${bindir}/systemadm"
 
 FILES_${PN}-vconsole-setup = "${systemd_unitdir}/systemd-vconsole-setup \