Skip to contentSkip to conversation

dos2unix: add target support

PATCH New Baruch Siach 3 participants 14 messages Sep 3, 2015 – Sep 6, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/5 dos2unix: add target support

From: James Knight <[email protected]>

Allow the dos2unix utility to be built and installed on the target system.

[baruch: properly handle target gettext]

---
v3:
* Show only if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is enabled (Peter)
* Add busybox to _DEPENDENCIES

v2:
* Fix static build with gettext
* Support build without locale support

---
 package/Config.in            |  1 +
 package/dos2unix/Config.in   | 11 +++++++++++
 package/dos2unix/dos2unix.mk | 25 ++++++++++++++++++++++---
 3 files changed, 34 insertions(+), 3 deletions(-)
 create mode 100644 package/dos2unix/Config.in
package/Config.in +1 -0
index 6ba21a1aace8..2c1325af31c5 100644
@@ -115,6 +115,7 @@ menu "Development tools"
 	source "package/cvs/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/diffutils/Config.in"
+	source "package/dos2unix/Config.in"
 	source "package/findutils/Config.in"
 endif
 	source "package/flex/Config.in"
package/dos2unix/Config.in new file +11 -0
new file mode 100644
index 000000000000..fdcd0700509b
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_DOS2UNIX
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
+	depends on BR2_USE_WCHAR # gettext
+	bool "dos2unix"
+	help
+	  dos2unix converts text file line endings between CRLF and LF
+
+	  http://freshmeat.net/projects/dos2unix
+
+comment "dos2unix needs a toolchain w/ wchar"
+	depends on !BR2_USE_WCHAR
package/dos2unix/dos2unix.mk +22 -3
index 2d7fcbbc6958..b1d21f27364d 100644
@@ -6,17 +6,36 @@
 
 DOS2UNIX_VERSION = 7.0
 DOS2UNIX_SITE = http://waterlan.home.xs4all.nl/dos2unix
-DOS2UNIX_DEPENDENCIES = host-gettext
 DOS2UNIX_LICENSE = BSD-2c
 DOS2UNIX_LICENSE_FILES = COPYING.txt
+DOS2UNIX_DEPENDENCIES = $(if $(BR2_PACKAGE_BUSYBOX),busybox)
+HOST_DOS2UNIX_DEPENDENCIES = host-gettext
+
+ifeq ($(BR2_ENABLE_LOCALE),)
+DOS2UNIX_MAKE_OPTS += ENABLE_NLS=
+endif
+
+ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
+DOS2UNIX_DEPENDENCIES += gettext
+DOS2UNIX_MAKE_OPTS += LIBS_EXTRA=-lintl
+endif
+
+define DOS2UNIX_BUILD_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(DOS2UNIX_MAKE_OPTS)
+endef
+
+define DOS2UNIX_INSTALL_TARGET_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) \
+		$(DOS2UNIX_MAKE_OPTS) install
+endef
 
 define HOST_DOS2UNIX_BUILD_CMDS
 	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)
 endef
 
 define HOST_DOS2UNIX_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
-		install DESTDIR=$(HOST_DIR)
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) install
 endef
 
+$(eval $(generic-package))
 $(eval $(host-generic-package))
Signature · 1 line
2.5.0
#1 lore raw

PATCH v3 2/5 dos2unix: bump to version 7.3

---
v2:
* New patch in this series

---
 package/dos2unix/dos2unix.hash | 2 +-
 package/dos2unix/dos2unix.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/dos2unix/dos2unix.hash +1 -1
index 7880f1d85567..b22b6fc1682e 100644
@@ -1,2 +1,2 @@
 # Locally calculated after checking pgp signature
-sha256	551afe005a86e58664b4f41327408e73afafe92400488dd0aab1dad6deb4e72b	dos2unix-7.0.tar.gz
+sha256	8175f7552a72edaaa8918fdee68ce2cbc982dc25452f33d4dc611d769f4944d1	dos2unix-7.3.tar.gz
package/dos2unix/dos2unix.mk +1 -1
index b1d21f27364d..0d5a67456e6b 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-DOS2UNIX_VERSION = 7.0
+DOS2UNIX_VERSION = 7.3
 DOS2UNIX_SITE = http://waterlan.home.xs4all.nl/dos2unix
 DOS2UNIX_LICENSE = BSD-2c
 DOS2UNIX_LICENSE_FILES = COPYING.txt
Signature · 1 line
2.5.0
#2 lore raw

PATCH v3 2/5 dos2unix: bump to version 7.3

Dear Baruch Siach,

Quoted 24 lines · Baruch Siach

---
v2:
* New patch in this series

---
 package/dos2unix/dos2unix.hash | 2 +-
 package/dos2unix/dos2unix.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/dos2unix/dos2unix.hash +1 -1
index 7880f1d85567..b22b6fc1682e 100644
@@ -1,2 +1,2 @@
 # Locally calculated after checking pgp signature
-sha256	551afe005a86e58664b4f41327408e73afafe92400488dd0aab1dad6deb4e72b	dos2unix-7.0.tar.gz
+sha256	8175f7552a72edaaa8918fdee68ce2cbc982dc25452f33d4dc611d769f4944d1	dos2unix-7.3.tar.gz
package/dos2unix/dos2unix.mk +0 -0
index b1d21f27364d..0d5a67456e6b 100644

package/dos2unix/dos2unix.mk line 10

Quoted 8 lines
package/dos2unix/dos2unix.mk +1 -1
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-DOS2UNIX_VERSION = 7.0
+DOS2UNIX_VERSION = 7.3
 DOS2UNIX_SITE = http://waterlan.home.xs4all.nl/dos2unix
 DOS2UNIX_LICENSE = BSD-2c
 DOS2UNIX_LICENSE_FILES = COPYING.txt

Compile test for MIPS architecture:

$ grep ^DOS2UNIX_VERSION package/dos2unix/dos2unix.mk
DOS2UNIX_VERSION = 7.3
$ file output/target/usr/bin/dos2unix
output/target/usr/bin/dos2unix: ELF 32-bit MSB executable, MIPS, MIPS32
rel2 version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.6.32, with unknown capability 0x41000000 = 0xf676e75, with
unknown capability 0x10000 = 0x70401, stripped

Regards,

Vincent.

#3 lore raw

PATCH v3 3/5 dos2unix: remove WCHAR dependency

In reply to Baruch Siach

Add a patch fixing wchar build failure.

---
I added this as a separate patch after version bump to avoid package patch rebase churn.

v3:
* New patch in this series (Peter)

---
 .../dos2unix/0001-fix-build-without-wchar.patch    | 59 ++++++++++++++++++++++
 package/dos2unix/Config.in                         |  4 --
 package/dos2unix/dos2unix.mk                       |  4 ++
 3 files changed, 63 insertions(+), 4 deletions(-)
 create mode 100644 package/dos2unix/0001-fix-build-without-wchar.patch
package/dos2unix/0001-fix-build-without-wchar.patch new file +59 -0
new file mode 100644
index 000000000000..c3188363ec7e
@@ -0,0 +1,59 @@
+Don't reference wchar_t when D2U_UNICODE is not defined.
+
+Patch status: upstream (http://sourceforge.net/p/dos2unix/code/736)
+
+Signed-off-by: Baruch Siach <[email protected]>
+
+diff -Nuar dos2unix-7.3.orig/common.c dos2unix-7.3/common.c
+--- dos2unix-7.3.orig/common.c	2015-08-21 02:02:31.000000000 +0300
++++ dos2unix-7.3/common.c	2015-09-02 22:13:33.648486366 +0300
+@@ -1615,9 +1615,11 @@
+     } else if (pFlag->status & WRONG_CODEPAGE) {
+       d2u_fprintf(stderr,"%s: ",progname);
+       d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
++#ifdef D2U_UNICODE
+     } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
+       d2u_fprintf(stderr,"%s: ",progname);
+       d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), "stdin", (int)sizeof(wchar_t));
++#endif
+     } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
+       d2u_fprintf(stderr,"%s: ",progname);
+       d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), "stdin", pFlag->line_nr);
+@@ -1701,9 +1703,11 @@
+   } else if (pFlag->status & WRONG_CODEPAGE) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
++#ifdef D2U_UNICODE
+   } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
++#endif
+   } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), infile, pFlag->line_nr);
+@@ -1781,9 +1785,11 @@
+   } else if (pFlag->status & WRONG_CODEPAGE) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
++#ifdef D2U_UNICODE
+   } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
++#endif
+   } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), infile, pFlag->line_nr);
+@@ -1834,11 +1840,13 @@
+       d2u_fprintf(stderr,"%s: ",progname);
+       d2u_fprintf(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), infile);
+     }
++#ifdef D2U_UNICODE
+   } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
+     if (pFlag->verbose) {
+       d2u_fprintf(stderr,"%s: ",progname);
+       d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
+     }
++#endif
+   }
+ }
+ 
package/dos2unix/Config.in +0 -4
index fdcd0700509b..782c25cf0e13 100644
@@ -1,11 +1,7 @@
 config BR2_PACKAGE_DOS2UNIX
 	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
-	depends on BR2_USE_WCHAR # gettext
 	bool "dos2unix"
 	help
 	  dos2unix converts text file line endings between CRLF and LF
 
 	  http://freshmeat.net/projects/dos2unix
-
-comment "dos2unix needs a toolchain w/ wchar"
-	depends on !BR2_USE_WCHAR
package/dos2unix/dos2unix.mk +4 -0
index 0d5a67456e6b..4c5f4fcff384 100644
@@ -20,6 +20,10 @@ DOS2UNIX_DEPENDENCIES += gettext
 DOS2UNIX_MAKE_OPTS += LIBS_EXTRA=-lintl
 endif
 
+ifeq ($(BR2_USE_WCHAR),)
+DOS2UNIX_MAKE_OPTS += UCS=
+endif
+
 define DOS2UNIX_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(DOS2UNIX_MAKE_OPTS)
 endef
Signature · 1 line
2.5.0
#4 lore raw

PATCH v3 3/5 dos2unix: remove WCHAR dependency

Dear Baruch Siach,

Quoted 103 lines · Baruch Siach

Add a patch fixing wchar build failure.

---
I added this as a separate patch after version bump to avoid package patch rebase churn.

v3:
* New patch in this series (Peter)

---
 .../dos2unix/0001-fix-build-without-wchar.patch    | 59 ++++++++++++++++++++++
 package/dos2unix/Config.in                         |  4 --
 package/dos2unix/dos2unix.mk                       |  4 ++
 3 files changed, 63 insertions(+), 4 deletions(-)
 create mode 100644 package/dos2unix/0001-fix-build-without-wchar.patch
package/dos2unix/0001-fix-build-without-wchar.patch new file +59 -0
new file mode 100644
index 000000000000..c3188363ec7e
@@ -0,0 +1,59 @@
+Don't reference wchar_t when D2U_UNICODE is not defined.
+
+Patch status: upstream (http://sourceforge.net/p/dos2unix/code/736)
+
+Signed-off-by: Baruch Siach <[email protected]>
+
+diff -Nuar dos2unix-7.3.orig/common.c dos2unix-7.3/common.c
+--- dos2unix-7.3.orig/common.c	2015-08-21 02:02:31.000000000 +0300
++++ dos2unix-7.3/common.c	2015-09-02 22:13:33.648486366 +0300
+@@ -1615,9 +1615,11 @@
+     } else if (pFlag->status & WRONG_CODEPAGE) {
+       d2u_fprintf(stderr,"%s: ",progname);
+       d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
++#ifdef D2U_UNICODE
+     } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
+       d2u_fprintf(stderr,"%s: ",progname);
+       d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), "stdin", (int)sizeof(wchar_t));
++#endif
+     } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
+       d2u_fprintf(stderr,"%s: ",progname);
+       d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), "stdin", pFlag->line_nr);
+@@ -1701,9 +1703,11 @@
+   } else if (pFlag->status & WRONG_CODEPAGE) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
++#ifdef D2U_UNICODE
+   } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
++#endif
+   } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), infile, pFlag->line_nr);
+@@ -1781,9 +1785,11 @@
+   } else if (pFlag->status & WRONG_CODEPAGE) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
++#ifdef D2U_UNICODE
+   } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
++#endif
+   } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
+     d2u_fprintf(stderr,"%s: ",progname);
+     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), infile, pFlag->line_nr);
+@@ -1834,11 +1840,13 @@
+       d2u_fprintf(stderr,"%s: ",progname);
+       d2u_fprintf(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), infile);
+     }
++#ifdef D2U_UNICODE
+   } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
+     if (pFlag->verbose) {
+       d2u_fprintf(stderr,"%s: ",progname);
+       d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
+     }
++#endif
+   }
+ }
+ 
package/dos2unix/Config.in +0 -4
index fdcd0700509b..782c25cf0e13 100644
@@ -1,11 +1,7 @@
 config BR2_PACKAGE_DOS2UNIX
 	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
-	depends on BR2_USE_WCHAR # gettext
 	bool "dos2unix"
 	help
 	  dos2unix converts text file line endings between CRLF and LF
 
 	  http://freshmeat.net/projects/dos2unix
-
-comment "dos2unix needs a toolchain w/ wchar"
-	depends on !BR2_USE_WCHAR
package/dos2unix/dos2unix.mk +0 -0
index 0d5a67456e6b..4c5f4fcff384 100644

package/dos2unix/dos2unix.mk DOS2UNIX_DEPENDENCIES += gettext · line 29

Quoted 10 lines
package/dos2unix/dos2unix.mk +4 -0
@@ -20,6 +20,10 @@ DOS2UNIX_DEPENDENCIES += gettext
 DOS2UNIX_MAKE_OPTS += LIBS_EXTRA=-lintl
 endif
 
+ifeq ($(BR2_USE_WCHAR),)
+DOS2UNIX_MAKE_OPTS += UCS=
+endif
+
 define DOS2UNIX_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(DOS2UNIX_MAKE_OPTS)
 endef

Any instructions on how to reproduce the build failure so I can test it? Also, does that patch fixes an autobuild failure? If so, please add the "Fixes" line and the URL.

Regards,

Vincent.

#5 lore raw

PATCH v3 3/5 dos2unix: remove WCHAR dependency

Hi Vincent,

Quoted 4 lines · Vicente Olivert Riera
Quoted 3 lines · Baruch Siach

Add a patch fixing wchar build failure.

[...]

Quoted 5 lines

Any instructions on how to reproduce the build failure so I can test it? Also, does that patch fixes an autobuild failure? If so, please add the "Fixes" line and the URL.

This patch doesn't fix any build failure because current Buildroot master doesn't support target dos2unix. Event with the previous patches applied, the WCHAR dependency would prevent the build failure that the patch describes.

Thanks for reviewing,
baruch

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

PATCH v3 4/5 dos2unix: remove host-gettext dependency from host package

In reply to Baruch Siach

This shortens build time.

---
v3:
* New patch in this series (Peter)

---
 package/dos2unix/dos2unix.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/dos2unix/dos2unix.mk +4 -3
index 4c5f4fcff384..55608c653f9c 100644
@@ -9,7 +9,7 @@ DOS2UNIX_SITE = http://waterlan.home.xs4all.nl/dos2unix
 DOS2UNIX_LICENSE = BSD-2c
 DOS2UNIX_LICENSE_FILES = COPYING.txt
 DOS2UNIX_DEPENDENCIES = $(if $(BR2_PACKAGE_BUSYBOX),busybox)
-HOST_DOS2UNIX_DEPENDENCIES = host-gettext
+HOST_DOS2UNIX_DEPENDENCIES =
 
 ifeq ($(BR2_ENABLE_LOCALE),)
 DOS2UNIX_MAKE_OPTS += ENABLE_NLS=
@@ -34,11 +34,12 @@ define DOS2UNIX_INSTALL_TARGET_CMDS
 endef
 
 define HOST_DOS2UNIX_BUILD_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) ENABLE_NLS=
 endef
 
 define HOST_DOS2UNIX_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) install
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) ENABLE_NLS= \
+		install
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.5.0
#7 lore raw

PATCH v3 4/5 dos2unix: remove host-gettext dependency from host package

Dear Baruch Siach,

Quoted 29 lines · Baruch Siach

This shortens build time.

---
v3:
* New patch in this series (Peter)

---
 package/dos2unix/dos2unix.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/dos2unix/dos2unix.mk +1 -2
index 4c5f4fcff384..55608c653f9c 100644
@@ -9,7 +9,7 @@ DOS2UNIX_SITE = http://waterlan.home.xs4all.nl/dos2unix
 DOS2UNIX_LICENSE = BSD-2c
 DOS2UNIX_LICENSE_FILES = COPYING.txt
 DOS2UNIX_DEPENDENCIES = $(if $(BR2_PACKAGE_BUSYBOX),busybox)
-HOST_DOS2UNIX_DEPENDENCIES = host-gettext
+HOST_DOS2UNIX_DEPENDENCIES =
 
 ifeq ($(BR2_ENABLE_LOCALE),)
 DOS2UNIX_MAKE_OPTS += ENABLE_NLS=
@@ -34,11 +34,12 @@ define DOS2UNIX_INSTALL_TARGET_CMDS
 endef
 
 define HOST_DOS2UNIX_BUILD_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)

package/dos2unix/dos2unix.mk define DOS2UNIX_INSTALL_TARGET_CMDS · line 45

Quoted 10 lines
package/dos2unix/dos2unix.mk +3 -1
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) ENABLE_NLS=
 endef
 
 define HOST_DOS2UNIX_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) install
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) ENABLE_NLS= \
+		install
 endef
 
 $(eval $(generic-package))

Compile test for MIPS architecture:

$ grep gettext output/build/build-time.log
$
$ grep host-dos2unix output/build/build-time.log | grep install
1441363609:start:install-host        : host-dos2unix
1441363609:end  :install-host        : host-dos2unix

However I think your commit message is not correct. What your patch does is disable the native language support therefore there is no need to depend on gettext. Perhaps you could improve your commit message. Anyway you can keep my reviewed-by and tested-by.

Regards,

Vincent.

#8 lore raw

PATCH v3 5/5 dos2unix: update homepage link

In reply to Baruch Siach

Use the maintainer page that is much more informative than freecode.com.

---
v3:
* New patch in this series

---
 package/dos2unix/Config.in      | 2 +-
 package/dos2unix/Config.in.host | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/dos2unix/Config.in +1 -1
index 782c25cf0e13..ead1a8ffac78 100644
@@ -4,4 +4,4 @@ config BR2_PACKAGE_DOS2UNIX
 	help
 	  dos2unix converts text file line endings between CRLF and LF
 
-	  http://freshmeat.net/projects/dos2unix
+	  http://waterlan.home.xs4all.nl/dos2unix.html
package/dos2unix/Config.in.host +1 -1
index 012d614c0df4..5ec6033a8e32 100644
@@ -3,4 +3,4 @@ config BR2_PACKAGE_HOST_DOS2UNIX
 	help
 	  dos2unix converts text file line endings between CRLF and LF
 
-	  http://freecode.com/projects/dos2unix
+	  http://waterlan.home.xs4all.nl/dos2unix.html
Signature · 1 line
2.5.0
#9 lore raw

PATCH v3 5/5 dos2unix: update homepage link

Dear Baruch Siach,

Quoted 27 lines · Baruch Siach

Use the maintainer page that is much more informative than freecode.com.

---
v3:
* New patch in this series

---
 package/dos2unix/Config.in      | 2 +-
 package/dos2unix/Config.in.host | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/dos2unix/Config.in +1 -1
index 782c25cf0e13..ead1a8ffac78 100644
@@ -4,4 +4,4 @@ config BR2_PACKAGE_DOS2UNIX
 	help
 	  dos2unix converts text file line endings between CRLF and LF
 
-	  http://freshmeat.net/projects/dos2unix
+	  http://waterlan.home.xs4all.nl/dos2unix.html
package/dos2unix/Config.in.host +0 -0
index 012d614c0df4..5ec6033a8e32 100644

package/dos2unix/Config.in.host config BR2_PACKAGE_HOST_DOS2UNIX · line 6

Quoted 5 lines
package/dos2unix/Config.in.host +1 -1
@@ -3,4 +3,4 @@ config BR2_PACKAGE_HOST_DOS2UNIX
 	help
 	  dos2unix converts text file line endings between CRLF and LF
 
-	  http://freecode.com/projects/dos2unix
+	  http://waterlan.home.xs4all.nl/dos2unix.html

Regards,

Vincent.

#10 lore raw

PATCH v3 1/5 dos2unix: add target support

In reply to Baruch Siach

Dear Baruch Siach,

Quoted 87 lines · Baruch Siach

From: James Knight <[email protected]>

Allow the dos2unix utility to be built and installed on the target system.

[baruch: properly handle target gettext]

---
v3:
* Show only if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is enabled (Peter)
* Add busybox to _DEPENDENCIES

v2:
* Fix static build with gettext
* Support build without locale support

---
 package/Config.in            |  1 +
 package/dos2unix/Config.in   | 11 +++++++++++
 package/dos2unix/dos2unix.mk | 25 ++++++++++++++++++++++---
 3 files changed, 34 insertions(+), 3 deletions(-)
 create mode 100644 package/dos2unix/Config.in
package/Config.in +1 -0
index 6ba21a1aace8..2c1325af31c5 100644
@@ -115,6 +115,7 @@ menu "Development tools"
 	source "package/cvs/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/diffutils/Config.in"
+	source "package/dos2unix/Config.in"
 	source "package/findutils/Config.in"
 endif
 	source "package/flex/Config.in"
package/dos2unix/Config.in new file +11 -0
new file mode 100644
index 000000000000..fdcd0700509b
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_DOS2UNIX
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
+	depends on BR2_USE_WCHAR # gettext
+	bool "dos2unix"
+	help
+	  dos2unix converts text file line endings between CRLF and LF
+
+	  http://freshmeat.net/projects/dos2unix
+
+comment "dos2unix needs a toolchain w/ wchar"
+	depends on !BR2_USE_WCHAR
package/dos2unix/dos2unix.mk +20 -1
index 2d7fcbbc6958..b1d21f27364d 100644
@@ -6,17 +6,36 @@
 
 DOS2UNIX_VERSION = 7.0
 DOS2UNIX_SITE = http://waterlan.home.xs4all.nl/dos2unix
-DOS2UNIX_DEPENDENCIES = host-gettext
 DOS2UNIX_LICENSE = BSD-2c
 DOS2UNIX_LICENSE_FILES = COPYING.txt
+DOS2UNIX_DEPENDENCIES = $(if $(BR2_PACKAGE_BUSYBOX),busybox)
+HOST_DOS2UNIX_DEPENDENCIES = host-gettext
+
+ifeq ($(BR2_ENABLE_LOCALE),)
+DOS2UNIX_MAKE_OPTS += ENABLE_NLS=
+endif
+
+ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
+DOS2UNIX_DEPENDENCIES += gettext
+DOS2UNIX_MAKE_OPTS += LIBS_EXTRA=-lintl
+endif
+
+define DOS2UNIX_BUILD_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(DOS2UNIX_MAKE_OPTS)
+endef
+
+define DOS2UNIX_INSTALL_TARGET_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) \
+		$(DOS2UNIX_MAKE_OPTS) install
+endef
 
 define HOST_DOS2UNIX_BUILD_CMDS
 	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)

package/dos2unix/dos2unix.mk line 41

Quoted 10 lines
package/dos2unix/dos2unix.mk +2 -2
 endef
 
 define HOST_DOS2UNIX_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
-		install DESTDIR=$(HOST_DIR)
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) install
 endef
 
+$(eval $(generic-package))
 $(eval $(host-generic-package))

Compile test for MIPS architecture:

$ grep ^DOS2UNIX_VERSION package/dos2unix/dos2unix.mk
DOS2UNIX_VERSION = 7.0
$ file output/target/usr/bin/dos2unix
output/target/usr/bin/dos2unix: ELF 32-bit MSB executable, MIPS, MIPS32
rel2 version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.6.32, with unknown capability 0x41000000 = 0xf676e75, with
unknown capability 0x10000 = 0x70401, stripped

Regards,

Vincent.

#11 lore raw

PATCH v3 1/5 dos2unix: add target support

In reply to Baruch Siach
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

From: James Knight <[email protected]> Allow the dos2unix utility to be built and installed on the target system.

Quoted 7 lines
[baruch: properly handle target gettext]

---
v3:
* Show only if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is enabled (Peter)
* Add busybox to _DEPENDENCIES

Committed series, thanks!

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

PATCH v3 1/5 dos2unix: add target support

Hi Peter,

Quoted 14 lines · Peter Korsgaard
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

From: James Knight <[email protected]> Allow the dos2unix utility to be built and installed on the target system.

Quoted 7 lines
[baruch: properly handle target gettext]

---
v3:
* Show only if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is enabled (Peter)
* Add busybox to _DEPENDENCIES

Quoted 1 line

Committed series, thanks!

Thanks. All patches except the last one (5/5: dos2unix: update homepage link) are in the master branch. What happened to the last one?

baruch

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

PATCH v3 1/5 dos2unix: add target support

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

"Baruch" == Baruch Siach <[email protected]> writes:

Hi,

Quoted 4 lines
Quoted 1 line

Committed series, thanks!

Thanks. All patches except the last one (5/5: dos2unix: update homepage link) are in the master branch. What happened to the last one?

Hmm, I don't know. I've committed it now. Thanks!

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard