Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in
@ 2017-12-29 21:52 Adam Duskett
  2017-12-29 21:52 ` [Buildroot] [PATCH 2/2] systemd: bump to 236, convert to meson Adam Duskett
  2017-12-29 22:22 ` [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Adam Duskett @ 2017-12-29 21:52 UTC (permalink / raw)
  To: buildroot

Currently, meson will set the c_link_args and the cpp_link_args to the value
of TARGET_LDFLAGS, even when it's not defined.

This creates a malformed array ["",] which will break any package building
using meson/ninja.

Add a small regular expression at the end of the sed command to check for
["", ] and replace it with [] instead.

Credit goes to Yann for the regular expression.

Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
---
 package/meson/meson.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/meson/meson.mk b/package/meson/meson.mk
index 55ce84da07..75b9a1666a 100644
--- a/package/meson/meson.mk
+++ b/package/meson/meson.mk
@@ -26,6 +26,7 @@ define HOST_MESON_INSTALL_CROSS_CONF
 	    -e "s%@TARGET_LDFLAGS@%`printf '"%s", ' $(TARGET_LDFLAGS)`%g" \
 	    -e "s%@TARGET_CXXFLAGS@%`printf '"%s", ' $(TARGET_CXXFLAGS)`%g" \
 	    -e "s%@HOST_DIR@%$(HOST_DIR)%g" \
+	    -e 's/\["", \]/[]/' \
 	    $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
 	    > $(HOST_DIR)/etc/meson/cross-compilation.conf
 endef
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] systemd: bump to 236, convert to meson
  2017-12-29 21:52 [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in Adam Duskett
@ 2017-12-29 21:52 ` Adam Duskett
  2017-12-29 22:57   ` Yann E. MORIN
  2017-12-29 22:22 ` [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Adam Duskett @ 2017-12-29 21:52 UTC (permalink / raw)
  To: buildroot

systemd is no longer a autotools package, as such, it has now been converted
over to meson.

Changes include:
  - Changing all the options from --enable/disable to -Doption=true/false
  - Remove --without-python (no longer an option)
  - Add -Dsplit-user=true, without this option, rootprefix is set to /usr
    explicitly.
  - Change rootprefix from blank to /
  - Remove all of the ac_cv_path_ variables, these are now set properly in
    meson.build by default.
  - Change systemd from a autotools package to a generic package
  - Add sha256sum's for the license files.

Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
---
 .../systemd/0002-build-check-for-ln-relative.patch |  98 ---------
 ...h => 0002-fix-am-path-libgcrypt-no-found.patch} |   0
 package/systemd/systemd.hash                       |   5 +-
 package/systemd/systemd.mk                         | 242 ++++++++++-----------
 4 files changed, 123 insertions(+), 222 deletions(-)
 delete mode 100644 package/systemd/0002-build-check-for-ln-relative.patch
 rename package/systemd/{0003-fix-am-path-libgcrypt-no-found.patch => 0002-fix-am-path-libgcrypt-no-found.patch} (100%)

diff --git a/package/systemd/0002-build-check-for-ln-relative.patch b/package/systemd/0002-build-check-for-ln-relative.patch
deleted file mode 100644
index 817ce5010a..0000000000
--- a/package/systemd/0002-build-check-for-ln-relative.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From b60e16cc2ef8c9b4c05c4348a980d3312f2e1cb4 Mon Sep 17 00:00:00 2001
-From: "Yann E. MORIN" <yann.morin.1998@free.fr>
-Date: Fri, 28 Jul 2017 07:04:07 -0400
-Subject: [PATCH] build: check for ln --relative
-
-ln --relative is recent enough that not all distributions support it.
-This is especially the case for enterprise-grade distributions than can
-have a life-span of more than a decade.
-
-Detect if ln supports --relative and use it if so.
-
-If not supported, use a bit of sed magic to construct the ../ sequence,
-that leads back to / when appended to the destination directory.
-
-We introduce this as a macro that expands to a single command. To avoid
-complexity in the macro, we expect paths to be passed whitout the
-leading DESTDIR.
-
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-[Adam: Refresh for 234]
-Signed-off-by: Adam Duskett  <aduskett@gmail.com>
----
-Upstream-Status: Denied [No desire to support building on old distributions]
-    https://github.com/systemd/systemd/pull/5682
-
- Makefile.am  | 25 ++++++++++++++++++++++---
- configure.ac |  5 ++++-
- 2 files changed, 26 insertions(+), 4 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index c16e622..bed097f 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -305,6 +305,24 @@ install-busnames-target-wants-hook:
- 	what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(systemunitdir) && $(add-wants)
- 	what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
- 
-+# Macro to emulate ln --relative when needed
-+# $(1): options for ln, except --relative
-+# $(2): source file, absolute path without leading DESTDIR
-+# $(3): destination file, absolute path without leading DESTDIR
-+if HAVE_LN_RELATIVE
-+define ln-s-relative
-+	$(LN_S) --relative $(1) \
-+		$(DESTDIR)$(strip $(2)) \
-+		$(DESTDIR)$(strip $(3))
-+endef
-+else
-+define ln-s-relative
-+	$(LN_S) $(1) \
-+		`dirname $(strip $(3)) |sed -r -e 's:/+[^/]+:../:g; s:/$$::'`$(strip $(2)) \
-+		$(DESTDIR)$(strip $(3))
-+endef
-+endif
-+
- define add-wants
- 	[ -z "$$what" ] || ( \
- 	  dir=$(DESTDIR)$$dir/$$wants.wants && \
-@@ -318,8 +336,9 @@ install-directories-hook:
- 	$(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
- 
- install-environment-conf-hook: install-directories-hook
--	$(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(sysconfdir)/environment \
--		$(DESTDIR)$(environmentdir)/99-environment.conf
-+	$(AM_V_LN)$(call ln-s-relative,-f,\
-+			$(sysconfdir)/environment,\
-+			$(environmentdir)/99-environment.conf)
- 
- install-aliases-hook:
- 	set -- $(SYSTEM_UNIT_ALIASES) && \
-@@ -342,7 +361,7 @@ define install-relative-aliases
- 	while [ -n "$$1" ]; do \
- 		$(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
- 		rm -f $(DESTDIR)$$dir/$$2 && \
--		$(LN_S) --relative $(DESTDIR)$$1 $(DESTDIR)$$dir/$$2 && \
-+		$(call ln-s-relative,,$$1,$$dir/$$2) && \
- 		shift 2 || exit $$?; \
- 	done
- endef
-diff --git a/configure.ac b/configure.ac
-index c7537aa..9354441 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -109,7 +109,10 @@ AC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin])
- AC_PATH_PROG([MOUNT_PATH], [mount], [/usr/bin/mount], [$PATH:/usr/sbin:/sbin])
- AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin])
- 
--AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
-+AC_MSG_CHECKING([if ln supports --relative])
-+AS_IF([! ${LN_S} --relative --help > /dev/null 2>&1], [ln_relative=no], [ln_relative=yes])
-+AC_MSG_RESULT([$ln_relative])
-+AM_CONDITIONAL([HAVE_LN_RELATIVE], [test "x$ln_relative" = "xyes"])
- 
- M4_DEFINES=
- 
--- 
-2.13.3
-
diff --git a/package/systemd/0003-fix-am-path-libgcrypt-no-found.patch b/package/systemd/0002-fix-am-path-libgcrypt-no-found.patch
similarity index 100%
rename from package/systemd/0003-fix-am-path-libgcrypt-no-found.patch
rename to package/systemd/0002-fix-am-path-libgcrypt-no-found.patch
diff --git a/package/systemd/systemd.hash b/package/systemd/systemd.hash
index 9a1f926e4d..d8f6365c9c 100644
--- a/package/systemd/systemd.hash
+++ b/package/systemd/systemd.hash
@@ -1,2 +1,5 @@
 # sha256 locally computed
-sha256 da3e69d10aa1c983d33833372ad4929037b411ac421fb085c8cee79ae1d80b6a  systemd-234.tar.gz
+sha256	0cadccfa7109232ec2a469d41ca595d5595b83b648b534ea669c15dbca904c43	systemd-236.tar.gz
+sha256	ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6	LICENSE.GPL2
+sha256	dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551	LICENSE.LGPL2.1
+sha256	f6a739f5ee7f10df6467021066038297c0150ff680db9a4b9f60da53b11aa560	README
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 9f286fd54b..91e65e690d 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -4,20 +4,20 @@
 #
 ################################################################################
 
-SYSTEMD_VERSION = 234
+SYSTEMD_VERSION = 236
 SYSTEMD_SITE = $(call github,systemd,systemd,v$(SYSTEMD_VERSION))
 SYSTEMD_LICENSE = LGPL-2.1+, GPL-2.0+ (udev), Public Domain (few source files, see README)
 SYSTEMD_LICENSE_FILES = LICENSE.GPL2 LICENSE.LGPL2.1 README
 SYSTEMD_INSTALL_STAGING = YES
 SYSTEMD_DEPENDENCIES = \
+	host-gperf \
 	host-intltool \
-	libcap \
-	util-linux \
+	host-meson \
 	kmod \
-	host-gperf
+	libcap \
+	util-linux
 
 SYSTEMD_PROVIDES = udev
-SYSTEMD_AUTORECONF = YES
 
 # Make sure that systemd will always be built after busybox so that we have
 # a consistent init setup between two builds
@@ -26,268 +26,243 @@ SYSTEMD_DEPENDENCIES += busybox
 endif
 
 SYSTEMD_CONF_OPTS += \
-	--with-rootprefix= \
-	--enable-blkid \
-	--enable-static=no \
-	--disable-manpages \
-	--disable-ima \
-	--disable-libcryptsetup \
-	--disable-efi \
-	--disable-gnuefi \
-	--disable-ldconfig \
-	--disable-tests \
-	--disable-coverage \
-	--with-default-dnssec=no \
-	--without-python
+	--prefix=/usr \
+	--buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
+	--cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf \
+	-Dsplit-user=true \
+	-Drootprefix='/' \
+	-Dblkid=true \
+	-Dman=false \
+	-Dima=false \
+	-Dlibcryptsetup=false \
+	-Defi=false \
+	-Dgnu-efi=false \
+	-Dldconfig=false \
+	-Ddefault-dnssec=no
 
 SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-lto
 
-# Override paths to a few utilities needed at runtime, to
-# avoid finding those we would install in $(HOST_DIR).
-SYSTEMD_CONF_ENV = \
-	CFLAGS="$(SYSTEMD_CFLAGS)" \
-	ac_cv_path_KILL=/usr/bin/kill \
-	ac_cv_path_KMOD=/usr/bin/kmod \
-	ac_cv_path_KEXEC=/usr/sbin/kexec \
-	ac_cv_path_SULOGIN=/usr/sbin/sulogin \
-	ac_cv_path_MOUNT_PATH=/usr/bin/mount \
-	ac_cv_path_UMOUNT_PATH=/usr/bin/umount
-
-define SYSTEMD_RUN_INTLTOOLIZE
-	cd $(@D) && $(HOST_DIR)/bin/intltoolize --force --automake
-endef
-SYSTEMD_PRE_CONFIGURE_HOOKS += SYSTEMD_RUN_INTLTOOLIZE
-
 ifeq ($(BR2_PACKAGE_ACL),y)
-SYSTEMD_CONF_OPTS += --enable-acl
 SYSTEMD_DEPENDENCIES += acl
+SYSTEMD_CONF_OPTS += -Dacl=true
 else
-SYSTEMD_CONF_OPTS += --disable-acl
+SYSTEMD_CONF_OPTS += -Dacl=false
 endif
 
 ifeq ($(BR2_PACKAGE_AUDIT),y)
-SYSTEMD_CONF_OPTS += --enable-audit
 SYSTEMD_DEPENDENCIES += audit
+SYSTEMD_CONF_OPTS += -Daudit=true
 else
-SYSTEMD_CONF_OPTS += --disable-audit
+SYSTEMD_CONF_OPTS += -Daudit=false
 endif
 
 ifeq ($(BR2_PACKAGE_LIBIDN),y)
-SYSTEMD_CONF_OPTS += --enable-libidn
 SYSTEMD_DEPENDENCIES += libidn
+SYSTEMD_CONF_OPTS += -Dlibidn=true
 else
-SYSTEMD_CONF_OPTS += --disable-libidn
+SYSTEMD_CONF_OPTS += -Dlibidn=false
 endif
 
 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
-SYSTEMD_CONF_OPTS += --enable-seccomp
 SYSTEMD_DEPENDENCIES += libseccomp
+SYSTEMD_CONF_OPTS += -Dseccomp=true
 else
-SYSTEMD_CONF_OPTS += --disable-seccomp
+SYSTEMD_CONF_OPTS += -Dseccomp=false
 endif
 
 ifeq ($(BR2_PACKAGE_LIBXKBCOMMON),y)
-SYSTEMD_CONF_OPTS += --enable-xkbcommon
 SYSTEMD_DEPENDENCIES += libxkbcommon
+SYSTEMD_CONF_OPTS += -Dxkbcommon=true
 else
-SYSTEMD_CONF_OPTS += --disable-xkbcommon
+SYSTEMD_CONF_OPTS += -Dxkbcommon=false
 endif
 
 ifeq ($(BR2_PACKAGE_BZIP2),y)
 SYSTEMD_DEPENDENCIES += bzip2
-SYSTEMD_CONF_OPTS += --enable-bzip2
+SYSTEMD_CONF_OPTS += -Dbzip2=true
 else
-SYSTEMD_CONF_OPTS += --disable-bzip2
+SYSTEMD_CONF_OPTS += -Dbzip2=false
 endif
 
 ifeq ($(BR2_PACKAGE_LZ4),y)
 SYSTEMD_DEPENDENCIES += lz4
-SYSTEMD_CONF_OPTS += --enable-lz4
+SYSTEMD_CONF_OPTS += -Dlz4=true
 else
-SYSTEMD_CONF_OPTS += --disable-lz4
+SYSTEMD_CONF_OPTS += -Dlz4=false
 endif
 
 ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
 SYSTEMD_DEPENDENCIES += linux-pam
-SYSTEMD_CONF_OPTS += --enable-pam
+SYSTEMD_CONF_OPTS += -Dpam=true
 else
-SYSTEMD_CONF_OPTS += --disable-pam
+SYSTEMD_CONF_OPTS += -Dpam=false
 endif
 
 ifeq ($(BR2_PACKAGE_XZ),y)
 SYSTEMD_DEPENDENCIES += xz
-SYSTEMD_CONF_OPTS += --enable-xz
+SYSTEMD_CONF_OPTS += -Dxz=true
 else
-SYSTEMD_CONF_OPTS += --disable-xz
+SYSTEMD_CONF_OPTS += -Dxz=false
 endif
 
 ifeq ($(BR2_PACKAGE_ZLIB),y)
 SYSTEMD_DEPENDENCIES += zlib
-SYSTEMD_CONF_OPTS += --enable-zlib
+SYSTEMD_CONF_OPTS += -Dzlib=true
 else
-SYSTEMD_CONF_OPTS += --disable-zlib
+SYSTEMD_CONF_OPTS += -Dzlib=false
 endif
 
 ifeq ($(BR2_PACKAGE_LIBCURL),y)
 SYSTEMD_DEPENDENCIES += libcurl
-SYSTEMD_CONF_OPTS += --enable-libcurl
+SYSTEMD_CONF_OPTS += -Dlibcurl=true
 else
-SYSTEMD_CONF_OPTS += --disable-libcurl
+SYSTEMD_CONF_OPTS += -Dlibcurl=false
 endif
 
 ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
 SYSTEMD_DEPENDENCIES += libgcrypt
-SYSTEMD_CONF_OPTS += \
-	--enable-gcrypt \
-	--with-libgcrypt-prefix=$(STAGING_DIR)/usr \
-	--with-libgpg-error-prefix=$(STAGING_DIR)/usr
+SYSTEMD_CONF_OPTS += -Dgcrypt=true
 else
-SYSTEMD_CONF_OPTS += --disable-gcrypt
+SYSTEMD_CONF_OPTS += -Dgcrypt=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY),y)
 SYSTEMD_DEPENDENCIES += libmicrohttpd
-SYSTEMD_CONF_OPTS += --enable-microhttpd
+SYSTEMD_CONF_OPTS += -Dmicrohttpd=true
 ifeq ($(BR2_PACKAGE_LIBQRENCODE),y)
-SYSTEMD_CONF_OPTS += --enable-qrencode
+SYSTEMD_CONF_OPTS += -Dqrencode=true
 SYSTEMD_DEPENDENCIES += libqrencode
 else
-SYSTEMD_CONF_OPTS += --disable-qrencode
+SYSTEMD_CONF_OPTS += -Dqrencode=false
 endif
 else
-SYSTEMD_CONF_OPTS += --disable-microhttpd --disable-qrencode
+SYSTEMD_CONF_OPTS += -Dmicrohttpd=false -Dqrencode=false
 endif
 
 ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
 SYSTEMD_DEPENDENCIES += libselinux
-SYSTEMD_CONF_OPTS += --enable-selinux
+SYSTEMD_CONF_OPTS += -Dselinux=true
 else
-SYSTEMD_CONF_OPTS += --disable-selinux
+SYSTEMD_CONF_OPTS += -Dselinux=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_HWDB),y)
-SYSTEMD_CONF_OPTS += --enable-hwdb
+SYSTEMD_CONF_OPTS += -Dhwdb=true
 else
-SYSTEMD_CONF_OPTS += --disable-hwdb
+SYSTEMD_CONF_OPTS += -Dhwdb=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_BINFMT),y)
-SYSTEMD_CONF_OPTS += --enable-binfmt
+SYSTEMD_CONF_OPTS += -Dbinfmt=true
 else
-SYSTEMD_CONF_OPTS += --disable-binfmt
+SYSTEMD_CONF_OPTS += -Dbinfmt=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_VCONSOLE),y)
-SYSTEMD_CONF_OPTS += --enable-vconsole
+SYSTEMD_CONF_OPTS += -Dvconsole=true
 else
-SYSTEMD_CONF_OPTS += --disable-vconsole
+SYSTEMD_CONF_OPTS += -Dvconsole=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_QUOTACHECK),y)
-SYSTEMD_CONF_OPTS += --enable-quotacheck
-SYSTEMD_CONF_ENV += \
-	ac_cv_path_QUOTAON=/usr/sbin/quotaon \
-	ac_cv_path_QUOTACHECK=/usr/sbin/quotacheck
+SYSTEMD_CONF_OPTS += -Dquotacheck=true
 else
-SYSTEMD_CONF_OPTS += --disable-quotacheck
-SYSTEMD_CONF_ENV += \
-	ac_cv_path_QUOTAON=/.missing \
-	ac_cv_path_QUOTACHECK=/.missing
+SYSTEMD_CONF_OPTS += -Dquotacheck=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_TMPFILES),y)
-SYSTEMD_CONF_OPTS += --enable-tmpfiles
+SYSTEMD_CONF_OPTS += -Dtmpfiles=true
 else
-SYSTEMD_CONF_OPTS += --disable-tmpfiles
+SYSTEMD_CONF_OPTS += -Dtmpfiles=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_SYSUSERS),y)
-SYSTEMD_CONF_OPTS += --enable-sysusers
+SYSTEMD_CONF_OPTS += -Dsysusers=true
 else
-SYSTEMD_CONF_OPTS += --disable-sysusers
+SYSTEMD_CONF_OPTS += -Dsysusers=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_FIRSTBOOT),y)
-SYSTEMD_CONF_OPTS += --enable-firstboot
+SYSTEMD_CONF_OPTS += -Dfirstboot=true
 else
-SYSTEMD_CONF_OPTS += --disable-firstboot
+SYSTEMD_CONF_OPTS += -Dfirstboot=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_RANDOMSEED),y)
-SYSTEMD_CONF_OPTS += --enable-randomseed
+SYSTEMD_CONF_OPTS += -Drandomseed=true
 else
-SYSTEMD_CONF_OPTS += --disable-randomseed
+SYSTEMD_CONF_OPTS += -Drandomseed=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_BACKLIGHT),y)
-SYSTEMD_CONF_OPTS += --enable-backlight
+SYSTEMD_CONF_OPTS += -Dbacklight=true
 else
-SYSTEMD_CONF_OPTS += --disable-backlight
+SYSTEMD_CONF_OPTS += -Dbacklight=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_RFKILL),y)
-SYSTEMD_CONF_OPTS += --enable-rfkill
+SYSTEMD_CONF_OPTS += -Drfkill=true
 else
-SYSTEMD_CONF_OPTS += --disable-rfkill
+SYSTEMD_CONF_OPTS += -Drfkill=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y)
-SYSTEMD_CONF_OPTS += --enable-logind
+SYSTEMD_CONF_OPTS += -Dlogind=true
 else
-SYSTEMD_CONF_OPTS += --disable-logind
+SYSTEMD_CONF_OPTS += -Dlogind=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_MACHINED),y)
-SYSTEMD_CONF_OPTS += --enable-machined
+SYSTEMD_CONF_OPTS += -Dmachined=true
 else
-SYSTEMD_CONF_OPTS += --disable-machined
+SYSTEMD_CONF_OPTS += -Dmachined=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_IMPORTD),y)
-SYSTEMD_CONF_OPTS += --enable-importd
+SYSTEMD_CONF_OPTS += -Dimportd=true
 else
-SYSTEMD_CONF_OPTS += --disable-importd
+SYSTEMD_CONF_OPTS += -Dimportd=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_HOSTNAMED),y)
-SYSTEMD_CONF_OPTS += --enable-hostnamed
+SYSTEMD_CONF_OPTS += -Dhostnamed=true
 else
-SYSTEMD_CONF_OPTS += --disable-hostnamed
+SYSTEMD_CONF_OPTS += -Dhostnamed=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_MYHOSTNAME),y)
-SYSTEMD_CONF_OPTS += --enable-myhostname
+SYSTEMD_CONF_OPTS += -Dmyhostname=true
 else
-SYSTEMD_CONF_OPTS += --disable-myhostname
+SYSTEMD_CONF_OPTS += -Dmyhostname=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMEDATED),y)
-SYSTEMD_CONF_OPTS += --enable-timedated
+SYSTEMD_CONF_OPTS += -Dtimedated=true
 else
-SYSTEMD_CONF_OPTS += --disable-timedated
+SYSTEMD_CONF_OPTS += -Dtimedated=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_LOCALED),y)
-SYSTEMD_CONF_OPTS += --enable-localed
+SYSTEMD_CONF_OPTS += -Dlocaled=true
 else
-SYSTEMD_CONF_OPTS += --disable-localed
+SYSTEMD_CONF_OPTS += -Dlocaled=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_COREDUMP),y)
-SYSTEMD_CONF_OPTS += --enable-coredump
+SYSTEMD_CONF_OPTS += -Dcoredump=true
 SYSTEMD_COREDUMP_USER = systemd-coredump -1 systemd-coredump -1 * /var/lib/systemd/coredump - - Core Dumper
 else
-SYSTEMD_CONF_OPTS += --disable-coredump
+SYSTEMD_CONF_OPTS += -Dcoredump=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_POLKIT),y)
-SYSTEMD_CONF_OPTS += --enable-polkit
+SYSTEMD_CONF_OPTS += -Dpolkit=true
 else
-SYSTEMD_CONF_OPTS += --disable-polkit
+SYSTEMD_CONF_OPTS += -Dpolkit=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
-SYSTEMD_CONF_OPTS += --enable-networkd
+SYSTEMD_CONF_OPTS += -Dnetworkd=true
 SYSTEMD_NETWORKD_USER = systemd-network -1 systemd-network -1 * - - - Network Manager
 define SYSTEMD_INSTALL_RESOLVCONF_HOOK
 	ln -sf ../run/systemd/resolve/resolv.conf \
@@ -302,18 +277,18 @@ define SYSTEMD_INSTALL_NETWORK_CONFS
 endef
 endif
 else
-SYSTEMD_CONF_OPTS += --disable-networkd
+SYSTEMD_CONF_OPTS += -Dnetworkd=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_RESOLVED),y)
-SYSTEMD_CONF_OPTS += --enable-resolved
+SYSTEMD_CONF_OPTS += -Dresolved=true
 SYSTEMD_RESOLVED_USER = systemd-resolve -1 systemd-resolve -1 * - - - Network Name Resolution Manager
 else
-SYSTEMD_CONF_OPTS += --disable-resolved
+SYSTEMD_CONF_OPTS += -Dresolved=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
-SYSTEMD_CONF_OPTS += --enable-timesyncd
+SYSTEMD_CONF_OPTS += -Dtimesyncd=true
 SYSTEMD_TIMESYNCD_USER = systemd-timesync -1 systemd-timesync -1 * - - - Network Time Synchronization
 define SYSTEMD_INSTALL_SERVICE_TIMESYNC
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
@@ -321,19 +296,19 @@ define SYSTEMD_INSTALL_SERVICE_TIMESYNC
 		$(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
 endef
 else
-SYSTEMD_CONF_OPTS += --disable-timesyncd
+SYSTEMD_CONF_OPTS += -Dtimesyncd=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT),y)
-SYSTEMD_CONF_OPTS += --enable-smack
+SYSTEMD_CONF_OPTS += -Dsmack=true
 else
-SYSTEMD_CONF_OPTS += --disable-smack
+SYSTEMD_CONF_OPTS += -Dsmack=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_HIBERNATE),y)
-SYSTEMD_CONF_OPTS += --enable-hibernate
+SYSTEMD_CONF_OPTS += -Dhibernate=true
 else
-SYSTEMD_CONF_OPTS += --disable-hibernate
+SYSTEMD_CONF_OPTS += -Dhibernate=false
 endif
 
 define SYSTEMD_INSTALL_INIT_HOOK
@@ -341,7 +316,6 @@ define SYSTEMD_INSTALL_INIT_HOOK
 	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
 	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
 	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
-
 	ln -fs ../../../lib/systemd/system/multi-user.target \
 		$(TARGET_DIR)/etc/systemd/system/default.target
 endef
@@ -398,4 +372,26 @@ define SYSTEMD_INSTALL_INIT_SYSTEMD
 	$(SYSTEMD_INSTALL_NETWORK_CONFS)
 endef
 
-$(eval $(autotools-package))
+SYSTEMD_NINJA_OPTS = $(if $(VERBOSE),-v)
+
+define SYSTEMD_CONFIGURE_CMDS
+	rm -rf $(@D)/build
+	mkdir -p $(@D)/build
+	$(TARGET_MAKE_ENV) meson $(SYSTEMD_CONF_OPTS) $(@D) $(@D)/build
+endef
+
+define SYSTEMD_BUILD_CMDS
+	$(TARGET_MAKE_ENV) ninja $(SYSTEMD_NINJA_OPTS) -C $(@D)/build
+endef
+
+define SYSTEMD_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja $(SYSTEMD_NINJA_OPTS) \
+		-C $(@D)/build install
+endef
+
+define SYSTEMD_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) DESTDIR=$(STAGING_DIR) ninja $(SYSTEMD_NINJA_OPTS) \
+		-C $(@D)/build install
+endef
+
+$(eval $(generic-package))
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in
  2017-12-29 21:52 [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in Adam Duskett
  2017-12-29 21:52 ` [Buildroot] [PATCH 2/2] systemd: bump to 236, convert to meson Adam Duskett
@ 2017-12-29 22:22 ` Thomas Petazzoni
  2017-12-30  4:32   ` Adam Duskett
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2017-12-29 22:22 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 29 Dec 2017 16:52:42 -0500, Adam Duskett wrote:
> Currently, meson will set the c_link_args and the cpp_link_args to the value
> of TARGET_LDFLAGS, even when it's not defined.
> 
> This creates a malformed array ["",] which will break any package building
> using meson/ninja.
> 
> Add a small regular expression at the end of the sed command to check for
> ["", ] and replace it with [] instead.
> 
> Credit goes to Yann for the regular expression.
> 
> Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
> ---
>  package/meson/meson.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/meson/meson.mk b/package/meson/meson.mk
> index 55ce84da07..75b9a1666a 100644
> --- a/package/meson/meson.mk
> +++ b/package/meson/meson.mk
> @@ -26,6 +26,7 @@ define HOST_MESON_INSTALL_CROSS_CONF
>  	    -e "s%@TARGET_LDFLAGS@%`printf '"%s", ' $(TARGET_LDFLAGS)`%g" \
>  	    -e "s%@TARGET_CXXFLAGS@%`printf '"%s", ' $(TARGET_CXXFLAGS)`%g" \
>  	    -e "s%@HOST_DIR@%$(HOST_DIR)%g" \
> +	    -e 's/\["", \]/[]/' \
>  	    $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
>  	    > $(HOST_DIR)/etc/meson/cross-compilation.conf  
>  endef

While this works, it feels a bit like a hack to me: we are just fixing
the mess we have created a few lines before. Can we instead do the
replacement only if it's needed ? Or calculate some intermediate
variable that is empty is TARGET_CFLAGS is empty, and equal to
'"$(TARGET_CFLAGS)", ' if not ?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] systemd: bump to 236, convert to meson
  2017-12-29 21:52 ` [Buildroot] [PATCH 2/2] systemd: bump to 236, convert to meson Adam Duskett
@ 2017-12-29 22:57   ` Yann E. MORIN
  0 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2017-12-29 22:57 UTC (permalink / raw)
  To: buildroot

Adam, All,

On 2017-12-29 16:52 -0500, Adam Duskett spake thusly:
> systemd is no longer a autotools package, as such, it has now been converted
> over to meson.

I would have preferred that we do the switch in two steps:

  - first, the switch over to meson without bumping the version, so that
    we really get the grasps if what htis implies relative to the
    buildsystem itself,

  - second, a version bump.

> Changes include:
>   - Changing all the options from --enable/disable to -Doption=true/false
>   - Remove --without-python (no longer an option)
>   - Add -Dsplit-user=true, without this option, rootprefix is set to /usr
>     explicitly.
>   - Change rootprefix from blank to /
>   - Remove all of the ac_cv_path_ variables, these are now set properly in
>     meson.build by default.
>   - Change systemd from a autotools package to a generic package
>   - Add sha256sum's for the license files.
> 
> Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
> ---
>  .../systemd/0002-build-check-for-ln-relative.patch |  98 ---------
>  ...h => 0002-fix-am-path-libgcrypt-no-found.patch} |   0
>  package/systemd/systemd.hash                       |   5 +-
>  package/systemd/systemd.mk                         | 242 ++++++++++-----------
>  4 files changed, 123 insertions(+), 222 deletions(-)
>  delete mode 100644 package/systemd/0002-build-check-for-ln-relative.patch
>  rename package/systemd/{0003-fix-am-path-libgcrypt-no-found.patch => 0002-fix-am-path-libgcrypt-no-found.patch} (100%)
> 
> diff --git a/package/systemd/0002-build-check-for-ln-relative.patch b/package/systemd/0002-build-check-for-ln-relative.patch
> deleted file mode 100644
> index 817ce5010a..0000000000
> --- a/package/systemd/0002-build-check-for-ln-relative.patch

So they are not longer using ln --relative in their install steps?
Or does meson provide a sane fallback?

OK, so from our IRC discussion: they still use it from their meson.build
file, so you need to patch it out, similarly to what we were doing so
far.

[--SNIP--]
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index 9f286fd54b..91e65e690d 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -4,20 +4,20 @@
>  #
>  ################################################################################
>  
> -SYSTEMD_VERSION = 234
> +SYSTEMD_VERSION = 236
>  SYSTEMD_SITE = $(call github,systemd,systemd,v$(SYSTEMD_VERSION))
>  SYSTEMD_LICENSE = LGPL-2.1+, GPL-2.0+ (udev), Public Domain (few source files, see README)
>  SYSTEMD_LICENSE_FILES = LICENSE.GPL2 LICENSE.LGPL2.1 README
>  SYSTEMD_INSTALL_STAGING = YES
>  SYSTEMD_DEPENDENCIES = \
> +	host-gperf \

Speaking od gperf, upstream claims they require gperf 3.1, but we only
have gperf 3.0.4.

What's going on with that?

>  	host-intltool \
> -	libcap \
> -	util-linux \
> +	host-meson \
>  	kmod \
> -	host-gperf
> +	libcap \
> +	util-linux

Please, don't re-ordr depednencies needlessly... If you're really
bothered, please do it in a separate patch...

But did you forget to add host-ninja, too? Ah, it's a dependency of
host-meson...

But as I understand, meson can have different backends, of which ninja,
right? If so I think the package should be responsible to also depend on
host-ninja.

But feel free to correct me! ;-)

>  SYSTEMD_PROVIDES = udev
> -SYSTEMD_AUTORECONF = YES
>  
>  # Make sure that systemd will always be built after busybox so that we have
>  # a consistent init setup between two builds
> @@ -26,268 +26,243 @@ SYSTEMD_DEPENDENCIES += busybox
>  endif
>  
>  SYSTEMD_CONF_OPTS += \
> -	--with-rootprefix= \
> -	--enable-blkid \
> -	--enable-static=no \
> -	--disable-manpages \
> -	--disable-ima \
> -	--disable-libcryptsetup \
> -	--disable-efi \
> -	--disable-gnuefi \
> -	--disable-ldconfig \
> -	--disable-tests \
> -	--disable-coverage \
> -	--with-default-dnssec=no \
> -	--without-python
> +	--prefix=/usr \
> +	--buildtype $(if $(BR2_ENABLE_DEBUG),debug,release) \
> +	--cross-file $(HOST_DIR)/etc/meson/cross-compilation.conf \
> +	-Dsplit-user=true \
> +	-Drootprefix='/' \
> +	-Dblkid=true \
> +	-Dman=false \
> +	-Dima=false \
> +	-Dlibcryptsetup=false \
> +	-Defi=false \
> +	-Dgnu-efi=false \
> +	-Dldconfig=false \
> +	-Ddefault-dnssec=no
>  
>  SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-lto
>  
> -# Override paths to a few utilities needed at runtime, to
> -# avoid finding those we would install in $(HOST_DIR).
> -SYSTEMD_CONF_ENV = \
> -	CFLAGS="$(SYSTEMD_CFLAGS)" \
> -	ac_cv_path_KILL=/usr/bin/kill \
> -	ac_cv_path_KMOD=/usr/bin/kmod \
> -	ac_cv_path_KEXEC=/usr/sbin/kexec \
> -	ac_cv_path_SULOGIN=/usr/sbin/sulogin \
> -	ac_cv_path_MOUNT_PATH=/usr/bin/mount \
> -	ac_cv_path_UMOUNT_PATH=/usr/bin/umount

So those are now always correctly set even when they are present in
host/bin/ (or host/sbin) ?

> @@ -398,4 +372,26 @@ define SYSTEMD_INSTALL_INIT_SYSTEMD
>  	$(SYSTEMD_INSTALL_NETWORK_CONFS)
>  endef
>  
> -$(eval $(autotools-package))
> +SYSTEMD_NINJA_OPTS = $(if $(VERBOSE),-v)
> +
> +define SYSTEMD_CONFIGURE_CMDS
> +	rm -rf $(@D)/build
> +	mkdir -p $(@D)/build
> +	$(TARGET_MAKE_ENV) meson $(SYSTEMD_CONF_OPTS) $(@D) $(@D)/build
> +endef
> +
> +define SYSTEMD_BUILD_CMDS
> +	$(TARGET_MAKE_ENV) ninja $(SYSTEMD_NINJA_OPTS) -C $(@D)/build

And this is where you should also pass the number of parallel jobs,
otherwise ninja will use all the CPUs available.

> +endef
> +
> +define SYSTEMD_INSTALL_TARGET_CMDS
> +	$(TARGET_MAKE_ENV) DESTDIR=$(TARGET_DIR) ninja $(SYSTEMD_NINJA_OPTS) \
> +		-C $(@D)/build install

I guess ditto the number of jobs...

> +endef
> +
> +define SYSTEMD_INSTALL_STAGING_CMDS
> +	$(TARGET_MAKE_ENV) DESTDIR=$(STAGING_DIR) ninja $(SYSTEMD_NINJA_OPTS) \
> +		-C $(@D)/build install

Ditto again...

Regards,
Yann E. MORIN.

> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.14.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in
  2017-12-29 22:22 ` [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in Thomas Petazzoni
@ 2017-12-30  4:32   ` Adam Duskett
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Duskett @ 2017-12-30  4:32 UTC (permalink / raw)
  To: buildroot

Hello;

On Fri, Dec 29, 2017 at 5:22 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Fri, 29 Dec 2017 16:52:42 -0500, Adam Duskett wrote:
>> Currently, meson will set the c_link_args and the cpp_link_args to the value
>> of TARGET_LDFLAGS, even when it's not defined.
>>
>> This creates a malformed array ["",] which will break any package building
>> using meson/ninja.
>>
>> Add a small regular expression at the end of the sed command to check for
>> ["", ] and replace it with [] instead.
>>
>> Credit goes to Yann for the regular expression.
>>
>> Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
>> ---
>>  package/meson/meson.mk | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/package/meson/meson.mk b/package/meson/meson.mk
>> index 55ce84da07..75b9a1666a 100644
>> --- a/package/meson/meson.mk
>> +++ b/package/meson/meson.mk
>> @@ -26,6 +26,7 @@ define HOST_MESON_INSTALL_CROSS_CONF
>>           -e "s%@TARGET_LDFLAGS@%`printf '"%s", ' $(TARGET_LDFLAGS)`%g" \
>>           -e "s%@TARGET_CXXFLAGS@%`printf '"%s", ' $(TARGET_CXXFLAGS)`%g" \
>>           -e "s%@HOST_DIR@%$(HOST_DIR)%g" \
>> +         -e 's/\["", \]/[]/' \
>>           $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
>>           > $(HOST_DIR)/etc/meson/cross-compilation.conf
>>  endef
>
> While this works, it feels a bit like a hack to me: we are just fixing
> the mess we have created a few lines before. Can we instead do the
> replacement only if it's needed ? Or calculate some intermediate
> variable that is empty is TARGET_CFLAGS is empty, and equal to
> '"$(TARGET_CFLAGS)", ' if not ?
>
We could, but this works and is the only issue I could find with the
build system.
The end result would be exactly the same for a bunch of extra effort yes?

> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

Thanks!

Adam

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-30  4:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-29 21:52 [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in Adam Duskett
2017-12-29 21:52 ` [Buildroot] [PATCH 2/2] systemd: bump to 236, convert to meson Adam Duskett
2017-12-29 22:57   ` Yann E. MORIN
2017-12-29 22:22 ` [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in Thomas Petazzoni
2017-12-30  4:32   ` Adam Duskett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox