0102-quilt-add-further-relocatability-fixes.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. From: Jo-Philipp Wich <jow@openwrt.org>
  2. Date: Tue, 29 Sep 2015 11:37:27 +0000
  3. Subject: quilt: add further relocatability fixes
  4. Prevent quilt's build system from generating useless compat wrappers and
  5. hardcoded absolute utility paths to binaries in staging_dir/host/.
  6. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
  7. Backport of OpenWrt r47070
  8. diff --git a/tools/quilt/Makefile b/tools/quilt/Makefile
  9. index 01b0bd298fa58c6586b54044366fd85574e77e11..c2dbc07c7929b464d404feea1883070f4ec783e7 100644
  10. --- a/tools/quilt/Makefile
  11. +++ b/tools/quilt/Makefile
  12. @@ -15,9 +15,6 @@ PKG_MD5SUM:=c0ef4beb58a6fa72563b955e70624b6e
  13. include $(INCLUDE_DIR)/host-build.mk
  14. -HOST_CONFIGURE_ARGS += \
  15. - --with-find=$(FIND)
  16. -
  17. define Host/Configure
  18. cd $(HOST_BUILD_DIR) && autoconf
  19. $(call Host/Configure/Default)
  20. diff --git a/tools/quilt/patches/000-relocatable.patch b/tools/quilt/patches/000-relocatable.patch
  21. index 99d7af5771dc6250f5e22f27fe0e02b14443d180..9309fc426a67bd42172a3628fb67efb6569a1b47 100644
  22. --- a/tools/quilt/patches/000-relocatable.patch
  23. +++ b/tools/quilt/patches/000-relocatable.patch
  24. @@ -1,6 +1,6 @@
  25. --- a/bin/quilt.in
  26. +++ b/bin/quilt.in
  27. -@@ -15,9 +15,15 @@
  28. +@@ -15,14 +15,22 @@ unset POSIXLY_CORRECT
  29. unset GREP_OPTIONS
  30. export TEXTDOMAIN=quilt
  31. @@ -10,14 +10,22 @@
  32. +if test -n "$STAGING_DIR"; then
  33. + export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
  34. + : ${QUILT_DIR=$STAGING_DIR/../host/share/quilt} ${QUILT_LIB=$STAGING_DIR/../host/lib/quilt}
  35. ++ : ${QUILT_ETC=$STAGING_DIR/../host/etc}
  36. +else
  37. + export TEXTDOMAINDIR=@LOCALEDIR@
  38. + : ${QUILT_DIR=@QUILT_DIR@}
  39. ++ : ${QUILT_ETC=@ETCDIR@}
  40. +fi
  41. +
  42. export QUILT_DIR
  43. if [ -z "$QUILTRC" ]
  44. + then
  45. +- for QUILTRC in $HOME/.quiltrc @ETCDIR@/quilt.quiltrc; do
  46. ++ for QUILTRC in $HOME/.quiltrc $QUILT_ETC/quilt.quiltrc; do
  47. + [ -e $QUILTRC ] && break
  48. + done
  49. + export QUILTRC
  50. --- a/quilt/scripts/edmail.in
  51. +++ b/quilt/scripts/edmail.in
  52. @@ -29,7 +29,7 @@ BEGIN {
  53. @@ -70,3 +78,52 @@
  54. textdomain("quilt");
  55. sub _($) {
  56. +--- a/Makefile.in
  57. ++++ b/Makefile.in
  58. +@@ -21,8 +21,8 @@ COLUMN := @COLUMN@
  59. + GETOPT := @GETOPT@
  60. + CP := @CP@
  61. + DATE := @DATE@
  62. +-PERL := @PERL@
  63. +-BASH := @BASH@
  64. ++PERL := /usr/bin/env perl
  65. ++BASH := /usr/bin/env bash
  66. + SHELL:= @BASH@ # It does not work if dash is used as a shell, for example
  67. + GREP := @GREP@
  68. + TAIL := @TAIL@
  69. +@@ -32,7 +32,7 @@ AWK := @AWK@
  70. + FIND := @FIND@
  71. + XARGS := @XARGS@
  72. + DIFF := @DIFF@
  73. +-PATCH := @PATCH@
  74. ++PATCH := /usr/bin/env patch
  75. + MKTEMP := @MKTEMP@
  76. + MSGMERGE := @MSGMERGE@
  77. + MSGFMT := @MSGFMT@
  78. +@@ -49,8 +49,8 @@ USE_NLS := @USE_NLS@
  79. + STAT_HARDLINK := @STAT_HARDLINK@
  80. + PATCH_WRAPPER := @PATCH_WRAPPER@
  81. +
  82. +-COMPAT_SYMLINKS := @COMPAT_SYMLINKS@
  83. +-COMPAT_PROGRAMS := @COMPAT_PROGRAMS@
  84. ++COMPAT_SYMLINKS :=
  85. ++COMPAT_PROGRAMS :=
  86. +
  87. + default: all
  88. +
  89. +--- a/quilt/scripts/backup-files.in
  90. ++++ b/quilt/scripts/backup-files.in
  91. +@@ -53,7 +53,12 @@ usage ()
  92. + "
  93. + }
  94. +
  95. +-: ${QUILT_DIR=@QUILT_DIR@}
  96. ++if test -n "$STAGING_DIR"; then
  97. ++ : ${QUILT_DIR="$STAGING_DIR/../host/share/quilt"}
  98. ++else
  99. ++ : ${QUILT_DIR=@QUILT_DIR@}
  100. ++fi
  101. ++
  102. + . $QUILT_DIR/scripts/utilfns
  103. +
  104. + ensure_nolinks()