[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: coreutils: use dummy man when cross build



Source: coreutils
Version: 8.28-1
Severity: normal
Tags: patch
Usertags: rebootstrap

Hi

We also did cross build coreutils and got the same problem that help2man can't get `--help' info from cross-binaries. We tried adding an extra step in debian/rules that builds native man pages first, then force cross build process re-use those man pages. This way may make build process a bit longer but it can generate the complete man pages itself.

I attached the patch.

Regards,
Trung
diff -Nru coreutils-8.28/debian/patches/crossbuild-avoid_generating_man_pages.patch coreutils-8.28/debian/patches/crossbuild-avoid_generating_man_pages.patch
--- coreutils-8.28/debian/patches/crossbuild-avoid_generating_man_pages.patch	1970-01-01 08:00:00.000000000 +0800
+++ coreutils-8.28/debian/patches/crossbuild-avoid_generating_man_pages.patch	2018-07-04 10:09:56.000000000 +0700
@@ -0,0 +1,22 @@
+diff --git coreutils-8.28/Makefile.in coreutils-8.28/Makefile.in
+index 521f293..c22f10d 100644
+--- coreutils-8.28/Makefile.in
++++ coreutils-8.28/Makefile.in
+@@ -14755,6 +14755,9 @@ check-local: check-texinfo
+ distclean-local:
+ 	test x$(srcdir) = x$(builddir) || rm -f $(ALL_MANS)
+ 
++ifeq "$(ISCROSS)" "yes"
++$(ALL_MANS):
++else
+ $(ALL_MANS): $(mandeps)
+ # Most prog.1 man pages depend on src/prog.  List the exceptions:
+ @SINGLE_BINARY_FALSE@man/install.1:   src/ginstall$(EXEEXT)
+@@ -14865,6 +14868,7 @@ $(ALL_MANS): $(mandeps)
+ @SINGLE_BINARY_FALSE@man/who.1:       src/who$(EXEEXT)
+ @SINGLE_BINARY_FALSE@man/whoami.1:    src/whoami$(EXEEXT)
+ @SINGLE_BINARY_FALSE@man/yes.1:       src/yes$(EXEEXT)
++endif
+ 
+ .x.1:
+ 	$(AM_V_GEN)name=`echo $@ | sed 's|.*/||; s|\.1$$||'` || exit 1;	\
diff -Nru coreutils-8.28/debian/patches/series coreutils-8.28/debian/patches/series
--- coreutils-8.28/debian/patches/series	2017-10-03 00:31:47.000000000 +0700
+++ coreutils-8.28/debian/patches/series	2018-07-04 16:31:50.000000000 +0700
@@ -3,3 +3,4 @@
 72_id_checkngroups.patch
 85_timer_settime.patch
 99_kfbsd_fstat_patch.patch
+crossbuild-avoid_generating_man_pages.patch
diff -Nru coreutils-8.28/debian/rules coreutils-8.28/debian/rules
--- coreutils-8.28/debian/rules	2016-01-19 03:35:34.000000000 +0700
+++ coreutils-8.28/debian/rules	2018-07-04 17:23:12.000000000 +0700
@@ -18,7 +18,12 @@
 	mktemp
 d=debian/coreutils
 
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+export ISCROSS=yes
+override_dh_auto_configure: build-native-man
+else
 override_dh_auto_configure:
+endif
 	dh_auto_configure -- --enable-install-program=arch 
 
 %:
@@ -26,6 +31,17 @@
 
 override_dh_auto_clean:
 	make distclean || true
+	rm -rf $(native_build_dir)/*
+
+native_build_dir=debian/build-native
+build-native-man: clean
+	# prepare to build native binary files,
+	# they are required to generate manpage with help2man when cross-compiling
+	mkdir -p $(native_build_dir)
+	dh_auto_configure --builddirectory=$(native_build_dir) -- \
+	    --enable-install-program=arch --host=$(DEB_BUILD_GNU_TYPE)
+	dh_auto_build --builddirectory=$(native_build_dir)
+	cp $(native_build_dir)/man/*.1 man/
 
 override_dh_auto_test:
 	# tests fail a lot on the buildds
-- 
This mail was scanned by BitDefender
For more information please visit http://www.bitdefender.com

Reply to: