Skip to contentSkip to conversation

libmpdclient: fix install

PATCH Superseded Fabrice Fontaine 2 participants 4 messages Mar 10, 2018

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 libmpdclient: fix install

meson adds the build machine architecture for installation, see:
https://github.com/mesonbuild/meson/issues/2535
Until this is fixed, fix libmpdclient.pc and copy the libraries and libmpclient.pc to the correct place.

Fixes:
- http://autobuild.buildroot.net/results/aec/aec9f3de545a832b66cd00c217fbaa99246e1715
- http://autobuild.buildroot.net/results/07a/07adcba71106a2dca963e4071f4673791b41a603
- http://autobuild.buildroot.net/results/a27/a272a8e521863374901a5e3c0fb9da0b8daa4076

---
Changes v2 -> v3:
- Add autobuilder links
Changes v1 -> v2:
- Fix install of libmpdclient.pc

 package/libmpdclient/libmpdclient.mk | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
package/libmpdclient/libmpdclient.mk +25 -0
index 3148fd2873..2b27eff397 100644
@@ -35,9 +35,34 @@ define LIBMPDCLIENT_INSTALL_TARGET_CMDS
 		ninja $(LIBMPDCLIENT_NINJA_OPTS) -C $(@D)/build install
 endef
 
+# meson adds the build machine architecture for installation, see:
+# https://github.com/mesonbuild/meson/issues/2535
+# Until this is fixed, copy the libraries to the correct place
+define LIBMPDCLIENT_FIX_LIBRARY_INSTALL_TARGET
+	cp -a $(@D)/build/libmpdclient.* $(TARGET_DIR)/usr/lib
+endef
+
+LIBMPDCLIENT_POST_INSTALL_TARGET_HOOKS += \
+	LIBMPDCLIENT_FIX_LIBRARY_INSTALL_TARGET
+
 define LIBMPDCLIENT_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) DESTDIR=$(STAGING_DIR) \
 		ninja $(LIBMPDCLIENT_NINJA_OPTS) -C $(@D)/build install
 endef
 
+# meson adds the build machine architecture for installation, see:
+# https://github.com/mesonbuild/meson/issues/2535
+# Until this is fixed, fix libmpdclient.pc and copy the libraries and
+# libmpclient.pc to the correct place
+define LIBMPDCLIENT_FIX_LIBRARY_INSTALL_STAGING
+	$(INSTALL) -D -m 644 $(@D)/build/meson-private/libmpdclient.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/libmpdclient.pc
+	$(SED) 's,^libdir=.*,libdir=$${prefix}/lib,' \
+		$(STAGING_DIR)/usr/lib/pkgconfig/libmpdclient.pc
+	cp -a $(@D)/build/libmpdclient.* $(STAGING_DIR)/usr/lib
+endef
+
+LIBMPDCLIENT_POST_INSTALL_STAGING_HOOKS += \
+	LIBMPDCLIENT_FIX_LIBRARY_INSTALL_STAGING
+
 $(eval $(generic-package))
Signature · 1 line
2.14.1
#1 lore raw

PATCH v3 1/1 libmpdclient: fix install

Quoted 27 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fabrice" == Fabrice Fontaine <[email protected]> writes:

meson adds the build machine architecture for installation, see:
https://github.com/mesonbuild/meson/issues/2535
Until this is fixed, fix libmpdclient.pc and copy the libraries and libmpclient.pc to the correct place.

Fixes:
- http://autobuild.buildroot.net/results/aec/aec9f3de545a832b66cd00c217fbaa99246e1715
- http://autobuild.buildroot.net/results/07a/07adcba71106a2dca963e4071f4673791b41a603
- http://autobuild.buildroot.net/results/a27/a272a8e521863374901a5e3c0fb9da0b8daa4076

---
Changes v2 -> v3:
- Add autobuilder links
Changes v1 -> v2:
- Fix install of libmpdclient.pc

 package/libmpdclient/libmpdclient.mk | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
package/libmpdclient/libmpdclient.mk +0 -0
index 3148fd2873..2b27eff397 100644

package/libmpdclient/libmpdclient.mk define LIBMPDCLIENT_INSTALL_TARGET_CMDS · line 42

Quoted 8 lines
package/libmpdclient/libmpdclient.mk +5 -0
@@ -35,9 +35,34 @@ define LIBMPDCLIENT_INSTALL_TARGET_CMDS
 		ninja $(LIBMPDCLIENT_NINJA_OPTS) -C $(@D)/build install
 endef
 
+# meson adds the build machine architecture for installation, see:
+# https://github.com/mesonbuild/meson/issues/2535
+# Until this is fixed, copy the libraries to the correct place
+define LIBMPDCLIENT_FIX_LIBRARY_INSTALL_TARGET
+	cp -a $(@D)/build/libmpdclient.* $(TARGET_DIR)/usr/lib

What about the version installed in $(TARGET_DIR)/usr/lib/$(HOST_GNU_NAME)? That is still there taking up space, right?

Having to do this workaround here is pretty horrible :/ What about the other packages using meson, don't they have the same issues (E.G. enlightenment/systemd/mpd-mpc)?

It would be a lot nicer to fix the problem. I have no experience with mesonbuild, but grepping around the problem seems to come from

is_debianlike() in mesonbuild/mesonlib.py, which looks for /etc/debian_version on the host(!) so this behaviour depends on the host OS. changing this to just a 'return False' fixes it for me.

There's other problems though. If it isn't a debianlike system, then it looks if /usr/lib64 on the host(!) is a directory, and if so uses that instead of usr/lib :/

Similary, get_library_dirs() has login to look at uname -m and again look in /usr/lib64 on the host, which breaks horrible for cross compilation :/

I guess we need to patch out all of this crap until upstream gains real cross compilation support :/

Any takers?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH v3 1/1 libmpdclient: fix install

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

Hi,

Quoted 11 lines

It would be a lot nicer to fix the problem. I have no experience with mesonbuild, but grepping around the problem seems to come from

is_debianlike() in mesonbuild/mesonlib.py, which looks for /etc/debian_version on the host(!) so this behaviour depends on the host OS. changing this to just a 'return False' fixes it for me.

There's other problems though. If it isn't a debianlike system, then it looks if /usr/lib64 on the host(!) is a directory, and if so uses that instead of usr/lib :/

Quoted 8 lines

Similary, get_library_dirs() has login to look at uname -m and again look in /usr/lib64 on the host, which breaks horrible for cross compilation :/

I guess we need to patch out all of this crap until upstream gains real cross compilation support :/

Any takers?

Sorry, after looking closer it seems most of these are just about the default location, so we can override then with the right values by passing the needed arguments to meson (--libdir).

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH v3 1/1 libmpdclient: fix install

Dear Peter,

2018-03-10 22:20 GMT+01:00 Peter Korsgaard <[email protected]>:

Quoted 24 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

Hi,

Quoted 11 lines

It would be a lot nicer to fix the problem. I have no experience with mesonbuild, but grepping around the problem seems to come from

is_debianlike() in mesonbuild/mesonlib.py, which looks for /etc/debian_version on the host(!) so this behaviour depends on the host OS. changing this to just a 'return False' fixes it for me.

There's other problems though. If it isn't a debianlike system, then it looks if /usr/lib64 on the host(!) is a directory, and if so uses that instead of usr/lib :/

Quoted 8 lines

Similary, get_library_dirs() has login to look at uname -m and again look in /usr/lib64 on the host, which breaks horrible for cross compilation :/

I guess we need to patch out all of this crap until upstream gains real cross compilation support :/

Any takers?

Quoted 9 lines

Sorry, after looking closer it seems most of these are just about the default location, so we can override then with the right values by passing the needed arguments to meson (--libdir).

You're perfectly right, I will send you an update of the patch.

--
Bye, Peter Korsgaard

Best Regards,

Fabrice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180310/5cb381fc/attachment.html>