Skip to contentSkip to conversation

alsa-utils: add udev optional dependency

PATCH New Fabrice Fontaine 3 participants 5 messages Dec 13, 2018 – Dec 14, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 alsa-utils: add udev optional dependency

Add udev optional dependency and fix build with pkgconf 1.5.3

Since the bump to 1.5.3, pkgconf prepends the sysroot to all absolute paths found in the .pc file. This is correct when the paths refer to something in STAGING_DIR (e.g. libdir, includedir), but not when it refers to something used for the target.

alsa-utils uses the udevdir variable from udev.pc to decide where to install things. Since DESTDIR is prepended to the install destination, this will end up in the wrong location.

Until a better solution is found in pkgconf, pass the udevrulesdir to use explicitly instead of relying on udev.pc.

Fixes:
- http://autobuild.buildroot.org/results/d8ad140ae52b4fe8e153de3835f3f17e92b58e53

---
 package/alsa-utils/alsa-utils.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/alsa-utils/alsa-utils.mk +5 -0
index 0bf2b432bd..422318796f 100644
@@ -28,6 +28,11 @@ ALSA_UTILS_CONF_OPTS = \
 	--disable-rst2man \
 	--with-curses=$(if $(BR2_PACKAGE_NCURSES_WCHAR),ncursesw,ncurses)
 
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+ALSA_UTILS_CONF_OPTS += --with-udev-rules-dir=/usr/lib/udev/rules.d
+ALSA_UTILS_DEPENDENCIES += udev
+endif
+
 ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSALOOP),y)
 ALSA_UTILS_CONF_OPTS += --enable-alsaloop
 else
Signature · 1 line
2.14.1
#1 lore raw

PATCH 2/2 alsa-utils: fix systemd build with pkgconf 1.5.3

Since the bump to 1.5.3, pkgconf prepends the sysroot to all absolute paths found in the .pc file. This is correct when the paths refer to something in STAGING_DIR (e.g. libdir, includedir), but not when it refers to something used for the target.

alsa-utils uses the systemdsystemunitdir variable from systemd.pc to decide where to install things. Since DESTDIR is prepended to the install destination, this will end up in the wrong location.

Until a better solution is found in pkgconf, pass the systemdsystemunitdir to use explicitly instead of relying on systemd.pc.

Fixes:
- http://autobuild.buildroot.org/results/d8ad140ae52b4fe8e153de3835f3f17e92b58e53

---
 package/alsa-utils/alsa-utils.mk | 1 +
 1 file changed, 1 insertion(+)
package/alsa-utils/alsa-utils.mk +1 -0
index 422318796f..d4b21837e1 100644
@@ -89,6 +89,7 @@ endef
 
 ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSACTL)$(BR2_INIT_SYSTEMD),yy)
 ALSA_UTILS_DEPENDENCIES += systemd
+ALSA_UTILS_CONF_OPTS += --with-systemdsystemunitdir=/usr/lib/systemd/system
 define ALSA_UTILS_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(@D)/alsactl/alsa-restore.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service
Signature · 1 line
2.14.1
#2 lore raw

PATCH 1/2 alsa-utils: add udev optional dependency

In reply to Fabrice Fontaine

Hi Fabrice,

Quoted 27 lines · Fabrice Fontaine

Add udev optional dependency and fix build with pkgconf 1.5.3

Since the bump to 1.5.3, pkgconf prepends the sysroot to all absolute paths found in the .pc file. This is correct when the paths refer to something in STAGING_DIR (e.g. libdir, includedir), but not when it refers to something used for the target.

alsa-utils uses the udevdir variable from udev.pc to decide where to install things. Since DESTDIR is prepended to the install destination, this will end up in the wrong location.

Until a better solution is found in pkgconf, pass the udevrulesdir to use explicitly instead of relying on udev.pc.

Fixes:
- http://autobuild.buildroot.org/results/d8ad140ae52b4fe8e153de3835f3f17e92b58e53

---
 package/alsa-utils/alsa-utils.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/alsa-utils/alsa-utils.mk +0 -0
index 0bf2b432bd..422318796f 100644

package/alsa-utils/alsa-utils.mk ALSA_UTILS_CONF_OPTS = \ · line 33

Quoted 6 lines
package/alsa-utils/alsa-utils.mk +3 -0
@@ -28,6 +28,11 @@ ALSA_UTILS_CONF_OPTS = \
 	--disable-rst2man \
 	--with-curses=$(if $(BR2_PACKAGE_NCURSES_WCHAR),ncursesw,ncurses)
 
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+ALSA_UTILS_CONF_OPTS += --with-udev-rules-dir=/usr/lib/udev/rules.d
+ALSA_UTILS_DEPENDENCIES += udev

Is there a build time dependency of alsa-utils on udev? As far as I can see alsa-utils only installs the .rules file, so the order of build should not matter.

package/alsa-utils/alsa-utils.mk ALSA_UTILS_CONF_OPTS = \ · line 38

Quoted 5 lines
package/alsa-utils/alsa-utils.mk +2 -0
+endif
+
 ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSALOOP),y)
 ALSA_UTILS_CONF_OPTS += --enable-alsaloop
 else

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#3 lore raw

PATCH 1/2 alsa-utils: add udev optional dependency

Dear Baruch,

Le ven. 14 d?c. 2018 ? 05:40, Baruch Siach <[email protected]> a ?crit :

Quoted 34 lines

Hi Fabrice,

Quoted 30 lines · Fabrice Fontaine

Add udev optional dependency and fix build with pkgconf 1.5.3

Since the bump to 1.5.3, pkgconf prepends the sysroot to all absolute paths found in the .pc file. This is correct when the paths refer to something in STAGING_DIR (e.g. libdir, includedir), but not when it refers to something used for the target.

alsa-utils uses the udevdir variable from udev.pc to decide where to install things. Since DESTDIR is prepended to the install destination, this will end up in the wrong location.

Until a better solution is found in pkgconf, pass the udevrulesdir to use explicitly instead of relying on udev.pc.

Fixes:
- http://autobuild.buildroot.org/results/d8ad140ae52b4fe8e153de3835f3f17e92b58e53

---
 package/alsa-utils/alsa-utils.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/alsa-utils/alsa-utils.mk +0 -0
index 0bf2b432bd..422318796f 100644
@@ -28,6 +28,11 @@ ALSA_UTILS_CONF_OPTS = \
      --disable-rst2man \
      --with-curses=$(if $(BR2_PACKAGE_NCURSES_WCHAR),ncursesw,ncurses)
 
Quoted 7 lines

package/alsa-utils/alsa-utils.mk ALSA_UTILS_CONF_OPTS = \ · line 33

Quoted 3 lines
package/alsa-utils/alsa-utils.mk +3 -0
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+ALSA_UTILS_CONF_OPTS += --with-udev-rules-dir=/usr/lib/udev/rules.d
+ALSA_UTILS_DEPENDENCIES += udev

Is there a build time dependency of alsa-utils on udev? As far as I can see alsa-utils only installs the .rules file, so the order of build should not matter.

Indeed, there is no build time dependency however if we remove --with-udev-rules-dir workaround, udev dependency will be needed to have a reproducible build because if udev.pc is not found, rules will be installed in /lib/udev/rules.d and if udev.pc is found, rules will be installed in /usr/lib/udev/rules.d.

Quoted 9 lines

package/alsa-utils/alsa-utils.mk ALSA_UTILS_CONF_OPTS = \ · line 38

Quoted 6 lines
package/alsa-utils/alsa-utils.mk +2 -0
+endif
+
 ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSALOOP),y)
 ALSA_UTILS_CONF_OPTS += --enable-alsaloop
 else

baruch

Quoted 4 lines

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

Best Regards,

Fabrice

#4 lore raw

PATCH 1/2 alsa-utils: add udev optional dependency

Hello,

Quoted 8 lines · Fabrice Fontaine
Quoted 3 lines

Is there a build time dependency of alsa-utils on udev? As far as I can see alsa-utils only installs the .rules file, so the order of build should not matter.

Indeed, there is no build time dependency however if we remove --with-udev-rules-dir workaround, udev dependency will be needed to have a reproducible build because if udev.pc is not found, rules will be installed in /lib/udev/rules.d and if udev.pc is found, rules will be installed in /usr/lib/udev/rules.d.

I think what Baruch said is that you should keep:

+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+ALSA_UTILS_CONF_OPTS += --with-udev-rules-dir=/usr/lib/udev/rules.d +endif

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com