make usb_modeswitch work with udev
cover make usb_modeswitch work with udev
This patchset corrects the usb_modeswitch installation:
First patch installs tclsh8.4 when usb_modeswitch_data is selected. (it is needed by usb_modeswitch_dispatcher tcl script which is called by udev rules)
Second patch adds a symlink tclsh->tclsh8.4
(to handle usb_modeswitch_dispatcher shebang)
The lasts two pathches are just versions bumps
Richard Genoud (4):
TCL: change BR2_PACKAGE_TCL_SHLIB_ONLY option
tcl: add a tclsh symlink
usb_modeswitch: bump to 1.2.6
usb_modeswitch_data: bump to 20130610
package/tcl/Config.in | 11 ++++--- package/tcl/tcl.mk | 4 ++- .../usb_modeswitch/usb_modeswitch-makefile.patch | 31 -------------------- package/usb_modeswitch/usb_modeswitch.mk | 2 +- .../usb_modeswitch_data-fix-parallel-install.patch | 6 ++-- .../usb_modeswitch_data-makefile.patch | 12 ++++---- package/usb_modeswitch_data/usb_modeswitch_data.mk | 2 +- 7 files changed, 19 insertions(+), 49 deletions(-) delete mode 100644 package/usb_modeswitch/usb_modeswitch-makefile.patch
Signature · 1 line
1.7.10.4
PATCH 1/4 TCL: change BR2_PACKAGE_TCL_SHLIB_ONLY option
It's not convenient to have an option (defaulted to yes) that removes a software.
For instance, usb_modeswitching_data needs the tclsh interpreter, so it would have to un-select this option, but select TCL.
Having an option that adds the tclsh binary (defaulted to no to keep the same behaviour) is way more convenient.
Moreover, it seems that it was intended liked that at the begining because usb_modeswitching_data already selects BR2_PACKAGE_TCL_TCLSH which wasn't declared anywhere
--- package/tcl/Config.in | 11 +++++------ package/tcl/tcl.mk | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-)
package/tcl/Config.in +5 -6
@@ -16,12 +16,11 @@ config BR2_PACKAGE_TCL_DEL_ENCODINGS It saves approx. 1.4 Mb of space. -config BR2_PACKAGE_TCL_SHLIB_ONLY - bool "install only shared library" - default y +config BR2_PACKAGE_TCL_TCLSH + bool "Install also tclsh binary, not only the shared library" + default n depends on BR2_PACKAGE_TCL help - Install only TCL shared library and not binary tcl - interpreter(tclsh8.4). + Install the TCL interpreter binary file(tclsh8.4). - Saves ~14kb. + Adds ~14kb.
package/tcl/tcl.mk +1 -1
@@ -26,7 +26,7 @@ define TCL_POST_INSTALL_CLEANUP -if [ "$(BR2_PACKAGE_TCL_DEL_ENCODINGS)" = "y" ]; then \ rm -Rf $(TARGET_DIR)/usr/lib/tcl$(TCL_VERSION_MAJOR)/encoding/*; \ fi - -if [ "$(BR2_PACKAGE_TCL_SHLIB_ONLY)" = "y" ]; then \ + -if [ "$(BR2_PACKAGE_TCL_TCLSH)" != "y" ]; then \ rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR); \ fi endef
Signature · 1 line
1.7.10.4
PATCH 1/4 TCL: change BR2_PACKAGE_TCL_SHLIB_ONLY option
Dear Richard Genoud,
package/tcl/tcl.mk define TCL_POST_INSTALL_CLEANUP · line 32
Quoted 9 lines · Richard Genoud
package/tcl/tcl.mk +1
-1@@ -26,7 +26,7 @@ define TCL_POST_INSTALL_CLEANUP -if [ "$(BR2_PACKAGE_TCL_DEL_ENCODINGS)" = "y" ]; then \ rm -Rf $(TARGET_DIR)/usr/lib/tcl$(TCL_VERSION_MAJOR)/encoding/*; \ fi - -if [ "$(BR2_PACKAGE_TCL_SHLIB_ONLY)" = "y" ]; then \ + -if [ "$(BR2_PACKAGE_TCL_TCLSH)" != "y" ]; then \ rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR); \ fi endef
Whenever possible, I think we prefer to use make conditional rather than shell conditions. So something like:
ifeq ($(BR2_PACKAGE_TCL_DEL_ENCODINGS),y)
define TCL_REMOVE_ENCODINGS
rm -rf $(TARGET_DIR)/usr/lib/tcl$(TCL_VERSION_MAJOR)/encoding/*
endef
TCL_POST_INSTALL_TARGET_HOOKS += TCL_REMOVE_ENCODINGS endif
ifeq ($(BR2_PACKAGE_TCL_TCLSH),y)
define TCL_SYMLINK_TCLSH
ln -s tclsh$(TCL_VERSION_MAJOR) $(TARGET_DIR)/usr/bin/tclsh
endef
TCL_POST_INSTALL_TARGET_HOOKS += TCL_SYMLINK_TCLSH else
define TCL_REMOVE_TCLSH
rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR)
endef
TCL_POST_INSTALL_TARGET_HOOKS += TCL_REMOVE_TCLSH
endif
And while you're at it, you could also remove the useless (and incorrect) :
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libtcl8.4.so
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 2/4 tcl: add a tclsh symlink
In reply to Richard Genoudtclsh is installed with its version number (tclshx.y) but scripts (like usb_modeswitch_dispatcher) are calling tclsh, not tclshx.y.
--- package/tcl/tcl.mk | 2 ++ 1 file changed, 2 insertions(+)
package/tcl/tcl.mk +2 -0
@@ -28,6 +28,8 @@ define TCL_POST_INSTALL_CLEANUP fi -if [ "$(BR2_PACKAGE_TCL_TCLSH)" != "y" ]; then \ rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR); \ + else \ + ln -s tclsh$(TCL_VERSION_MAJOR) $(TARGET_DIR)/usr/bin/tclsh ; \ fi endef
Signature · 1 line
1.7.10.4
PATCH 3/4 usb_modeswitch: bump to 1.2.6
In reply to Richard Genoud--- .../usb_modeswitch/usb_modeswitch-makefile.patch | 31 -------------------- package/usb_modeswitch/usb_modeswitch.mk | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 package/usb_modeswitch/usb_modeswitch-makefile.patch
package/usb_modeswitch/usb_modeswitch-makefile.patch deleted +0 -31
@@ -1,31 +0,0 @@ -Removed the -s from the install command. Without this, usb_modeswitch would -fail to install. - -Signed-off-by: J.C. Woltz <[email protected]> - -Index: b/Makefile -=================================================================== ---- a/Makefile -+++ b/Makefile -@@ -46,7 +46,7 @@ - cd jim && $(MAKE) distclean - - install-common: all -- install -D -s --mode=755 usb_modeswitch $(SBINDIR)/usb_modeswitch -+ install -D --mode=755 usb_modeswitch $(SBINDIR)/usb_modeswitch - install -D --mode=755 usb_modeswitch.sh $(UDEVDIR)/usb_modeswitch - install -D --mode=644 usb_modeswitch.conf $(ETCDIR)/usb_modeswitch.conf - install -D --mode=644 usb_modeswitch.1 $(MANDIR)/usb_modeswitch.1 -@@ -67,10 +67,10 @@ - install: install-common install-script - - install-shared: dispatcher-dynamic install-common -- install -D -s --mode=755 usb_modeswitch_dispatcher $(SBINDIR)/usb_modeswitch_dispatcher -+ install -D --mode=755 usb_modeswitch_dispatcher $(SBINDIR)/usb_modeswitch_dispatcher - - install-static: dispatcher-static install-common -- install -D -s --mode=755 usb_modeswitch_dispatcher $(SBINDIR)/usb_modeswitch_dispatcher -+ install -D --mode=755 usb_modeswitch_dispatcher $(SBINDIR)/usb_modeswitch_dispatcher - - uninstall: - $(RM) $(SBINDIR)/usb_modeswitch
package/usb_modeswitch/usb_modeswitch.mk +1 -1
@@ -4,7 +4,7 @@ # ############################################################# -USB_MODESWITCH_VERSION = 1.2.5 +USB_MODESWITCH_VERSION = 1.2.6 USB_MODESWITCH_SOURCE = usb-modeswitch-$(USB_MODESWITCH_VERSION).tar.bz2 USB_MODESWITCH_SITE = http://www.draisberghof.de/usb_modeswitch USB_MODESWITCH_DEPENDENCIES = libusb-compat
Signature · 1 line
1.7.10.4
PATCH 3/4 usb_modeswitch: bump to 1.2.6
Dear Richard Genoud,
Quoted 6 lines · Richard Genoud
Signed-off-by Richard Genoud <[email protected]>--- .../usb_modeswitch/usb_modeswitch-makefile.patch | 31 -------------------- package/usb_modeswitch/usb_modeswitch.mk | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 package/usb_modeswitch/usb_modeswitch-makefile.patch
When bumping to a new version leads to the removal of some patches, it is always good to mention /why/ they are removed (they got upstreamed, they are no longer needed because..).
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 3/4 usb_modeswitch: bump to 1.2.6
2013/6/20 Thomas Petazzoni <[email protected]>:
Quoted 10 lines
Dear Richard Genoud,
Quoted 6 lines · Richard Genoud
Signed-off-by Richard Genoud <[email protected]>--- .../usb_modeswitch/usb_modeswitch-makefile.patch | 31 -------------------- package/usb_modeswitch/usb_modeswitch.mk | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 package/usb_modeswitch/usb_modeswitch-makefile.patch
Quoted 3 lines
When bumping to a new version leads to the removal of some patches, it is always good to mention /why/ they are removed (they got upstreamed, they are no longer needed because..).
You're right, I've been a little lazy on this !
I'll resend the whole set tomorrow.
Thanks,
Richard.
PATCH 3/4 usb_modeswitch: bump to 1.2.6
Quoted 11 lines · Richard Genoud
2013/6/20 Thomas Petazzoni <[email protected]>:
Quoted 10 lines
Dear Richard Genoud,
Quoted 6 lines · Richard Genoud
Signed-off-by Richard Genoud <[email protected]>--- .../usb_modeswitch/usb_modeswitch-makefile.patch | 31 -------------------- package/usb_modeswitch/usb_modeswitch.mk | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 package/usb_modeswitch/usb_modeswitch-makefile.patch
Quoted 6 lines
Quoted 3 lines
When bumping to a new version leads to the removal of some patches, it is always good to mention /why/ they are removed (they got upstreamed, they are no longer needed because..).
You're right, I've been a little lazy on this !
I'll resend the whole set tomorrow.
Never mind about 3-4/4 since it's been already done by Patrick Ziegler and committed already :)
Regards.
PATCH 4/4 usb_modeswitch_data: bump to 20130610
In reply to Richard Genoud--- .../usb_modeswitch_data-fix-parallel-install.patch | 6 +++--- .../usb_modeswitch_data/usb_modeswitch_data-makefile.patch | 12 ++++++------ package/usb_modeswitch_data/usb_modeswitch_data.mk | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-)
package/usb_modeswitch_data/usb_modeswitch_data-fix-parallel-install.patch +3 -3
@@ -7,10 +7,10 @@ Index: b/Makefile =================================================================== --- a/Makefile +++ b/Makefile -@@ -22,6 +22,7 @@ - install -D --mode=644 40-usb_modeswitch.rules $(RULESDIR)/40-usb_modeswitch.rules +@@ -26,6 +26,7 @@ + ./gen-rules.tcl - db-install: + db-install: files-install + install -d $(PREFIX)/share/usb_modeswitch install --mode=644 -t $(PREFIX)/share/usb_modeswitch ./usb_modeswitch.d/*
package/usb_modeswitch_data/usb_modeswitch_data-makefile.patch +6 -6
@@ -4,19 +4,19 @@ cross-compiler environment, it is not wanted to reload the host udev rules. Signed-off-by: J.C. Woltz <[email protected]> --- usb_modeswitch_data-20120120.orig/Makefile 2012-01-20 17:25:32.000000000 -0500 +++ usb_modeswitch_data-20120120/Makefile 2012-02-06 14:20:47.000000000 -0500 -@@ -12,9 +12,9 @@ - +@@ -13,9 +13,9 @@ clean: + $(RM) 40-usb_modeswitch.rules --install: files-install db-install rules-reload -+install: files-install db-install +-install: all files-install db-install rules-reload ++install: all files-install db-install -install-packed: files-install db-install-packed rules-reload +install-packed: files-install db-install-packed - files-install: + files-install: install -d $(PREFIX)/share/usb_modeswitch -@@ -50,7 +50,7 @@ +@@ -54,7 +54,7 @@ fi \ fi
package/usb_modeswitch_data/usb_modeswitch_data.mk +1 -1
@@ -4,7 +4,7 @@ # ############################################################# -USB_MODESWITCH_DATA_VERSION = 20121109 +USB_MODESWITCH_DATA_VERSION = 20130610 USB_MODESWITCH_DATA_SOURCE = usb-modeswitch-data-$(USB_MODESWITCH_DATA_VERSION).tar.bz2 USB_MODESWITCH_DATA_SITE = http://www.draisberghof.de/usb_modeswitch USB_MODESWITCH_DATA_DEPENDENCIES = usb_modeswitch
Signature · 1 line
1.7.10.4
cover tcl rework (was: make usb_modeswitch work with udev)
In reply to Richard GenoudFrom: Richard Genoud <[email protected]>
At first, the goal of this patch set was to add a symlink tclsh->tclsh8.4 to make usb_modeswitch_dispatcher happy (it has a shebang #!/usr/bin/tclsh).
While doing that, I saw some other problems (libtcl not stripped and not into staging). Also, Thomas suggested (and coded it actually !) that make condition should be used.
Hence, a bigger patchset.
Changes since v1:
- drop usb_modeswitch{,_data} version bumps patches as they are already mainlined (thanks Gustavo for the heads up !)
- use make conditions rather than shell conditions
- drop the explicit strip
- install the library into stating
- make the library writable
Richard Genoud (6):
tcl: change BR2_PACKAGE_TCL_SHLIB_ONLY option
tcl: use make conditions
tcl: remove strip command
tcl: install the libtcl into staging
tcl: add a tclsh symlink
tcl: make the libtcl writable in order to be stripped
package/tcl/Config.in | 11 +++++------ package/tcl/tcl.mk | 33 ++++++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 15 deletions(-)
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): 1371815822-29453-1-git-send-email-y
PATCH 1/6 tcl: change BR2_PACKAGE_TCL_SHLIB_ONLY option
From: Richard Genoud <[email protected]>
It's not convenient to have an option (defaulted to yes) that removes a software.
For instance, usb_modeswitching_data needs the tclsh interpreter, so it would have to un-select this option, but select TCL.
Having an option that adds the tclsh binary (defaulted to no to keep the same behaviour) is way more convenient.
Moreover, it seems that it was intended liked that at the begining because usb_modeswitching_data already selects BR2_PACKAGE_TCL_TCLSH which wasn't declared anywhere.
--- package/tcl/Config.in | 11 +++++------ package/tcl/tcl.mk | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-)
package/tcl/Config.in +5 -6
@@ -16,12 +16,11 @@ config BR2_PACKAGE_TCL_DEL_ENCODINGS It saves approx. 1.4 Mb of space. -config BR2_PACKAGE_TCL_SHLIB_ONLY - bool "install only shared library" - default y +config BR2_PACKAGE_TCL_TCLSH + bool "Install also tclsh binary, not only the shared library" + default n depends on BR2_PACKAGE_TCL help - Install only TCL shared library and not binary tcl - interpreter(tclsh8.4). + Install the TCL interpreter binary file(tclsh8.4). - Saves ~14kb. + Adds ~14kb.
package/tcl/tcl.mk +1 -1
@@ -27,7 +27,7 @@ define TCL_POST_INSTALL_CLEANUP -if [ "$(BR2_PACKAGE_TCL_DEL_ENCODINGS)" = "y" ]; then \ rm -Rf $(TARGET_DIR)/usr/lib/tcl$(TCL_VERSION_MAJOR)/encoding/*; \ fi - -if [ "$(BR2_PACKAGE_TCL_SHLIB_ONLY)" = "y" ]; then \ + -if [ "$(BR2_PACKAGE_TCL_TCLSH)" != "y" ]; then \ rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR); \ fi endef
Signature · 1 line
1.7.10.4
PATCH 1/6 tcl: change BR2_PACKAGE_TCL_SHLIB_ONLY option
Dear Richard Genoud,
Am 21.06.2013 13:56, schrieb richard.genoud at gmail.com:
Quoted 7 lines
From: Richard Genoud <[email protected]>
It's not convenient to have an option (defaulted to yes) that removes a software.
For instance,usb_modeswitching_dataneeds the tclsh interpreter, so it would have to un-select this option, but select TCL.
Quoted 7 lines
Having an option that adds the tclsh binary (defaulted to no to keep the same behaviour) is way more convenient.
Moreover, it seems that it was intended liked that at the begining becauseusb_modeswitching_dataalready selectsBR2_PACKAGE_TCL_TCLSHwhich wasn't declared anywhere.Signed-off-by Richard Genoud <[email protected]>
If you change an existing option, please have a look on the Config.in.legacy file. You should add the old option to that file, so the user gets informed about the change.
Finally you should check if another package uses this option for its own configuration and change this to the new option. BR2_PACKAGE_TCL_SHLIB_ONLY is used by usb_modeswitch (not usb_modeswitch_data anymore) to switch between the binary wrapper and the tcl wrapper script.
Best regards
Patrick
Signature · 14 lines
Dipl.-Inf. (FH) Patrick Ziegler University Of Applied Sciences Kaiserslautern Amerikastrasse 1 D-66482 Zweibruecken Germany Phone: +49 631 3724 5526 Mail: patrick.ziegler at fh-kl.de http://www.fh-kl.de http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html
PATCH 1/6 tcl: change BR2_PACKAGE_TCL_SHLIB_ONLY option
2013/6/22 Patrick Ziegler <[email protected]>:
Quoted 22 lines
Dear Richard Genoud,
Am 21.06.2013 13:56, schrieb richard.genoud at gmail.com:
Quoted 7 lines
From: Richard Genoud <[email protected]>
It's not convenient to have an option (defaulted to yes) that removes a software.
For instance,usb_modeswitching_dataneeds the tclsh interpreter, so it would have to un-select this option, but select TCL.Quoted 7 lines
Having an option that adds the tclsh binary (defaulted to no to keep the same behaviour) is way more convenient.
Moreover, it seems that it was intended liked that at the begining becauseusb_modeswitching_dataalready selectsBR2_PACKAGE_TCL_TCLSHwhich wasn't declared anywhere.Signed-off-by Richard Genoud <[email protected]>If you change an existing option, please have a look on the Config.in.legacy file. You should add the old option to that file, so the user gets informed about the change.
Quoted 6 lines
Finally you should check if another package uses this option for its own configuration and change this to the new option.
BR2_PACKAGE_TCL_SHLIB_ONLYis used byusb_modeswitch(notusb_modeswitch_dataanymore) to switch between the binary wrapper and the tcl wrapper script.
I didn't saw your patch on that !
It seems that you already correct the problem with the tclsh interpreter. So I can drop this patch.
Thanks !
Best regards,
Richard.
PATCH 2/6 tcl: use make conditions
In reply to a message not in the archiveFrom: Richard Genoud <[email protected]>
As suggested by Thomas Petazzoni, make conditions should be used rather than shell condition in Makefiles.
--- package/tcl/tcl.mk | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
package/tcl/tcl.mk +14 -7
@@ -24,15 +24,22 @@ HOST_TCL_CONF_OPT = \ define TCL_POST_INSTALL_CLEANUP -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libtcl8.4.so - -if [ "$(BR2_PACKAGE_TCL_DEL_ENCODINGS)" = "y" ]; then \ - rm -Rf $(TARGET_DIR)/usr/lib/tcl$(TCL_VERSION_MAJOR)/encoding/*; \ - fi - -if [ "$(BR2_PACKAGE_TCL_TCLSH)" != "y" ]; then \ - rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR); \ - fi endef - TCL_POST_INSTALL_TARGET_HOOKS += TCL_POST_INSTALL_CLEANUP +ifeq ($(BR2_PACKAGE_TCL_DEL_ENCODINGS),y) +define TCL_REMOVE_ENCODINGS + rm -rf $(TARGET_DIR)/usr/lib/tcl$(TCL_VERSION_MAJOR)/encoding/* +endef +TCL_POST_INSTALL_TARGET_HOOKS += TCL_REMOVE_ENCODINGS +endif + +ifneq ($(BR2_PACKAGE_TCL_TCLSH),y) +define TCL_REMOVE_TCLSH + rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR) +endef +TCL_POST_INSTALL_TARGET_HOOKS += TCL_REMOVE_TCLSH +endif + $(eval $(autotools-package)) $(eval $(host-autotools-package))
Signature · 1 line
1.7.10.4
PATCH 3/6 tcl: remove strip command
In reply to a message not in the archiveFrom: Richard Genoud <[email protected]>
Stripping is done at the end of the buildroot process, for all files at once.
There's no need to do it here.
(Suggested by Thomas Petazzoni)
--- package/tcl/tcl.mk | 5 ----- 1 file changed, 5 deletions(-)
package/tcl/tcl.mk +0 -5
@@ -22,11 +22,6 @@ HOST_TCL_CONF_OPT = \ --disable-langinfo \ --disable-framework -define TCL_POST_INSTALL_CLEANUP - -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libtcl8.4.so -endef -TCL_POST_INSTALL_TARGET_HOOKS += TCL_POST_INSTALL_CLEANUP - ifeq ($(BR2_PACKAGE_TCL_DEL_ENCODINGS),y) define TCL_REMOVE_ENCODINGS rm -rf $(TARGET_DIR)/usr/lib/tcl$(TCL_VERSION_MAJOR)/encoding/*
Signature · 1 line
1.7.10.4
PATCH 4/6 tcl: install the libtcl into staging
In reply to a message not in the archiveFrom: Richard Genoud <[email protected]>
The tcl package contains a lib, so it should go into staging.
--- package/tcl/tcl.mk | 1 + 1 file changed, 1 insertion(+)
package/tcl/tcl.mk +1 -0
@@ -12,6 +12,7 @@ TCL_SITE = http://downloads.sourceforge.net/project/tcl/Tcl/$(TCL_VERSION_MAJOR) TCL_LICENSE = tcl license TCL_LICENSE_FILES = license.terms TCL_SUBDIR = unix +TCL_INSTALL_STAGING = YES TCL_CONF_OPT = \ --disable-symbols \ --disable-langinfo \
Signature · 1 line
1.7.10.4
PATCH 5/6 tcl: add a tclsh symlink
In reply to a message not in the archiveFrom: Richard Genoud <[email protected]>
tclsh is installed with its version number (tclshx.y) but scripts (like usb_modeswitch_dispatcher) are calling tclsh, not tclshx.y.
--- package/tcl/tcl.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
package/tcl/tcl.mk +6 -1
@@ -30,7 +30,12 @@ endef TCL_POST_INSTALL_TARGET_HOOKS += TCL_REMOVE_ENCODINGS endif -ifneq ($(BR2_PACKAGE_TCL_TCLSH),y) +ifeq ($(BR2_PACKAGE_TCL_TCLSH),y) +define TCL_SYMLINK_TCLSH + ln -s tclsh$(TCL_VERSION_MAJOR) $(TARGET_DIR)/usr/bin/tclsh +endef +TCL_POST_INSTALL_TARGET_HOOKS += TCL_SYMLINK_TCLSH +else define TCL_REMOVE_TCLSH rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR) endef
Signature · 1 line
1.7.10.4
PATCH 6/6 tcl: make the libtcl writable in order to be stripped
In reply to a message not in the archiveFrom: Richard Genoud <[email protected]>
The libtcl is installed with 0555 and that prevents it from being stripped.
--- package/tcl/tcl.mk | 7 +++++++ 1 file changed, 7 insertions(+)
package/tcl/tcl.mk +7 -0
@@ -42,5 +42,12 @@ endef TCL_POST_INSTALL_TARGET_HOOKS += TCL_REMOVE_TCLSH endif +# library get installed read only, so strip fails +define TCL_FIXUP_RO_LIB + chmod +w $(TARGET_DIR)/usr/lib/libtcl* +endef + +TCL_POST_INSTALL_TARGET_HOOKS += TCL_FIXUP_RO_LIB + $(eval $(autotools-package)) $(eval $(host-autotools-package))
Signature · 1 line
1.7.10.4
v3 cover tcl rework (was: make usb_modeswitch work with udev)
In reply to Richard GenoudAt first, the goal of this patch set was to add a symlink tclsh->tclsh8.4 to make usb_modeswitch_dispatcher happy (it has a shebang #!/usr/bin/tclsh).
While doing that, I saw some other problems (libtcl not stripped and not into staging). Also, Thomas suggested (and coded it actually !) that make condition should be used.
Hence, a bigger patchset.
Changes since v2:
- drop the change of BR2_PACKAGE_TCL_SHLIB_ONLY option as commit d3e4db4 (usb_modeswitch: bump to version 1.2.6) already fixes the problem.
Changes since v1:
- drop usb_modeswitch{,_data} version bumps patches as they are already mainlined (thanks Gustavo for the heads up !)
- use make conditions rather than shell conditions
- drop the explicit strip
- install the library into stating
- make the library writable
Richard Genoud (5):
tcl: use make conditions
tcl: remove strip command
tcl: install the libtcl into staging
tcl: add a tclsh symlink
tcl: make the libtcl writable in order to be stripped
package/tcl/tcl.mk | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-)
Signature · 1 line
1.7.10.4
PATCH v3 1/5 tcl: use make conditions
As suggested by Thomas Petazzoni, make conditions should be used rather than shell condition in Makefiles.
--- package/tcl/tcl.mk | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
package/tcl/tcl.mk +14 -7
@@ -24,15 +24,22 @@ HOST_TCL_CONF_OPT = \ define TCL_POST_INSTALL_CLEANUP -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libtcl8.4.so - -if [ "$(BR2_PACKAGE_TCL_DEL_ENCODINGS)" = "y" ]; then \ - rm -Rf $(TARGET_DIR)/usr/lib/tcl$(TCL_VERSION_MAJOR)/encoding/*; \ - fi - -if [ "$(BR2_PACKAGE_TCL_SHLIB_ONLY)" = "y" ]; then \ - rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR); \ - fi endef - TCL_POST_INSTALL_TARGET_HOOKS += TCL_POST_INSTALL_CLEANUP +ifeq ($(BR2_PACKAGE_TCL_DEL_ENCODINGS),y) +define TCL_REMOVE_ENCODINGS + rm -rf $(TARGET_DIR)/usr/lib/tcl$(TCL_VERSION_MAJOR)/encoding/* +endef +TCL_POST_INSTALL_TARGET_HOOKS += TCL_REMOVE_ENCODINGS +endif + +ifeq ($(BR2_PACKAGE_TCL_SHLIB_ONLY),y) +define TCL_REMOVE_TCLSH + rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR) +endef +TCL_POST_INSTALL_TARGET_HOOKS += TCL_REMOVE_TCLSH +endif + $(eval $(autotools-package)) $(eval $(host-autotools-package))
Signature · 1 line
1.7.10.4
PATCH v3 2/5 tcl: remove strip command
In reply to Richard GenoudStripping is done at the end of the buildroot process, for all files at once.
There's no need to do it here.
(Suggested by Thomas Petazzoni)
--- package/tcl/tcl.mk | 5 ----- 1 file changed, 5 deletions(-)
package/tcl/tcl.mk +0 -5
@@ -22,11 +22,6 @@ HOST_TCL_CONF_OPT = \ --disable-langinfo \ --disable-framework -define TCL_POST_INSTALL_CLEANUP - -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libtcl8.4.so -endef -TCL_POST_INSTALL_TARGET_HOOKS += TCL_POST_INSTALL_CLEANUP - ifeq ($(BR2_PACKAGE_TCL_DEL_ENCODINGS),y) define TCL_REMOVE_ENCODINGS rm -rf $(TARGET_DIR)/usr/lib/tcl$(TCL_VERSION_MAJOR)/encoding/*
Signature · 1 line
1.7.10.4
PATCH v3 3/5 tcl: install the libtcl into staging
In reply to Richard GenoudThe tcl package contains a lib, so it should go into staging.
--- package/tcl/tcl.mk | 1 + 1 file changed, 1 insertion(+)
package/tcl/tcl.mk +1 -0
@@ -12,6 +12,7 @@ TCL_SITE = http://downloads.sourceforge.net/project/tcl/Tcl/$(TCL_VERSION_MAJOR) TCL_LICENSE = tcl license TCL_LICENSE_FILES = license.terms TCL_SUBDIR = unix +TCL_INSTALL_STAGING = YES TCL_CONF_OPT = \ --disable-symbols \ --disable-langinfo \
Signature · 1 line
1.7.10.4
PATCH v3 4/5 tcl: add a tclsh symlink
In reply to Richard Genoudtclsh is installed with its version number (tclshx.y) but scripts (like usb_modeswitch_dispatcher) are calling tclsh, not tclshx.y.
--- package/tcl/tcl.mk | 5 +++++ 1 file changed, 5 insertions(+)
package/tcl/tcl.mk +5 -0
@@ -35,6 +35,11 @@ define TCL_REMOVE_TCLSH rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR) endef TCL_POST_INSTALL_TARGET_HOOKS += TCL_REMOVE_TCLSH +else +define TCL_SYMLINK_TCLSH + ln -s tclsh$(TCL_VERSION_MAJOR) $(TARGET_DIR)/usr/bin/tclsh +endef +TCL_POST_INSTALL_TARGET_HOOKS += TCL_SYMLINK_TCLSH endif $(eval $(autotools-package))
Signature · 1 line
1.7.10.4
PATCH v3 5/5 tcl: make the libtcl writable in order to be stripped
In reply to Richard GenoudThe libtcl is installed with 0555 and that prevents it from being stripped.
--- package/tcl/tcl.mk | 7 +++++++ 1 file changed, 7 insertions(+)
package/tcl/tcl.mk +7 -0
@@ -42,5 +42,12 @@ endef TCL_POST_INSTALL_TARGET_HOOKS += TCL_SYMLINK_TCLSH endif +# library get installed read only, so strip fails +define TCL_FIXUP_RO_LIB + chmod +w $(TARGET_DIR)/usr/lib/libtcl* +endef + +TCL_POST_INSTALL_TARGET_HOOKS += TCL_FIXUP_RO_LIB + $(eval $(autotools-package)) $(eval $(host-autotools-package))
Signature · 1 line
1.7.10.4
v3 cover tcl rework (was: make usb_modeswitch work with udev)
In reply to Richard GenoudDear Richard Genoud,
Quoted 9 lines · Richard Genoud
Richard Genoud (5):
tcl: use make conditions
tcl: remove strip command
tcl: install the libtcl into staging
tcl: add a tclsh symlink
tcl: make the libtcl writable in order to be strippedpackage/tcl/tcl.mk | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-)
Committed, thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com