Skip to contentSkip to conversation

package/makedevs: define extract step to allow patching

PATCH New Peter Korsgaard 1 participant 9 messages Apr 26, 2021 – May 1, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/makedevs: define extract step to allow patching

As recently discussed on the list:
http://lists.busybox.net/pipermail/buildroot/2021-April/308373.html

Packages like makedevs where the source code is included in the Buildroot tree, currently doesn't use an extract step (which also skips the patch step), so they cannot be patched by a patch in BR2_GLOBAL_PATCH_DIR (or the pkgdir), which is a bit confusing.

As a fix, add a simple extract step that copies the source file to the build directory, so the patch step gets run as well.

---
 package/makedevs/makedevs.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
package/makedevs/makedevs.mk +5 -1
index 36837a191e..9b0f44610c 100644
@@ -15,8 +15,12 @@ HOST_MAKEDEVS_CFLAGS += -DEXTENDED_ATTRIBUTES
 HOST_MAKEDEVS_LDFLAGS += -lcap
 endif
 
+define HOST_MAKEDEVS_EXTRACT_CMDS
+	cp $(HOST_MAKEDEVS_PKGDIR)/makedevs.c $(@D)
+endef
+
 define HOST_MAKEDEVS_BUILD_CMDS
-	$(HOSTCC) $(HOST_MAKEDEVS_CFLAGS) package/makedevs/makedevs.c \
+	$(HOSTCC) $(HOST_MAKEDEVS_CFLAGS) $(@D)/makedevs.c \
 		-o $(@D)/makedevs $(HOST_MAKEDEVS_LDFLAGS)
 endef
 
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/3 package/makedevs: define extract step to allow patching

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

As recently discussed on the list:
http://lists.busybox.net/pipermail/buildroot/2021-April/308373.html

Packages like makedevs where the source code is included in the Buildroot tree, currently doesn't use an extract step (which also skips the patch step), so they cannot be patched by a patch in BR2_GLOBAL_PATCH_DIR (or the pkgdir), which is a bit confusing.

Quoted 4 lines

As a fix, add a simple extract step that copies the source file to the build directory, so the patch step gets run as well.

Committed, thanks.

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

PATCH 1/3 package/makedevs: define extract step to allow patching

In reply to Peter Korsgaard
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

As recently discussed on the list:
http://lists.busybox.net/pipermail/buildroot/2021-April/308373.html

Packages like makedevs where the source code is included in the Buildroot tree, currently doesn't use an extract step (which also skips the patch step), so they cannot be patched by a patch in BR2_GLOBAL_PATCH_DIR (or the pkgdir), which is a bit confusing.

Quoted 4 lines

As a fix, add a simple extract step that copies the source file to the build directory, so the patch step gets run as well.

Committed to 2021.02.x, thanks.

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

PATCH 2/3 package/mkpaswd: define extract step to allow patching

In reply to Peter Korsgaard

As recently discussed on the list:
http://lists.busybox.net/pipermail/buildroot/2021-April/308373.html

Packages like mkpasswd where the source code is included in the Buildroot tree, currently doesn't use an extract step (which also skips the patch step), so they cannot be patched by a patch in BR2_GLOBAL_PATCH_DIR (or the pkgdir), which is a bit confusing.

As a fix, add a simple extract step that copies the source files to the build directory, so the patch step gets run as well.

---
 package/mkpasswd/mkpasswd.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
package/mkpasswd/mkpasswd.mk +5 -1
index b013390572..c1117ef65c 100644
@@ -9,9 +9,13 @@
 # at revision 5a0f08500fa51608b6d3b73ee338be38c692eadb
 HOST_MKPASSWD_LICENSE = GPL-2.0+
 
+define HOST_MKPASSWD_EXTRACT_CMDS
+	cp $(HOST_MKPASSWD_PKGDIR)/*.c $(HOST_MKPASSWD_PKGDIR)/*.h $(@D)
+endef
+
 define HOST_MKPASSWD_BUILD_CMDS
 	$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
-		package/mkpasswd/mkpasswd.c package/mkpasswd/utils.c \
+		$(@D)/mkpasswd.c $(@D)/utils.c \
 		-o $(@D)/mkpasswd -lcrypt
 endef
 
Signature · 1 line
2.20.1
#4 lore raw

PATCH 2/3 package/mkpaswd: define extract step to allow patching

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

As recently discussed on the list:
http://lists.busybox.net/pipermail/buildroot/2021-April/308373.html

Packages like mkpasswd where the source code is included in the Buildroot tree, currently doesn't use an extract step (which also skips the patch step), so they cannot be patched by a patch in BR2_GLOBAL_PATCH_DIR (or the pkgdir), which is a bit confusing.

Quoted 4 lines

As a fix, add a simple extract step that copies the source files to the build directory, so the patch step gets run as well.

Committed, thanks.

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

PATCH 2/3 package/mkpaswd: define extract step to allow patching

In reply to Peter Korsgaard
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

As recently discussed on the list:
http://lists.busybox.net/pipermail/buildroot/2021-April/308373.html

Packages like mkpasswd where the source code is included in the Buildroot tree, currently doesn't use an extract step (which also skips the patch step), so they cannot be patched by a patch in BR2_GLOBAL_PATCH_DIR (or the pkgdir), which is a bit confusing.

Quoted 4 lines

As a fix, add a simple extract step that copies the source files to the build directory, so the patch step gets run as well.

Committed to 2021.02.x, thanks.

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

PATCH 3/3 package/mkpimage: define extract step to allow patching

In reply to Peter Korsgaard

As recently discussed on the list:
http://lists.busybox.net/pipermail/buildroot/2021-April/308373.html

Packages like mkpimage where the source code is included in the Buildroot tree, currently doesn't use an extract step (which also skips the patch step), so they cannot be patched by a patch in BR2_GLOBAL_PATCH_DIR (or the pkgdir), which is a bit confusing.

As a fix, add a simple extract step that copies the source file to the build directory, so the patch step gets run as well.

---
 package/mkpimage/mkpimage.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
package/mkpimage/mkpimage.mk +5 -1
index 8e08013f91..71500f00f3 100644
@@ -9,9 +9,13 @@ HOST_MKPIMAGE_LICENSE = GPL-2.0
 # source included in the package
 # came from barebox's repository:
 # https://git.pengutronix.de/cgit/barebox/tree/scripts/socfpga_mkimage.c?id=55d29525146dcd280987dfd565bfd34f08858fb3
+define HOST_MKPIMAGE_EXTRACT_CMDS
+	cp $(HOST_MKPIMAGE_PKGDIR)/mkpimage.c $(@D)
+endef
+
 define HOST_MKPIMAGE_BUILD_CMDS
 	$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
-		package/mkpimage/mkpimage.c -o $(@D)/mkpimage
+		$(@D)/mkpimage.c -o $(@D)/mkpimage
 endef
 
 define HOST_MKPIMAGE_INSTALL_CMDS
Signature · 1 line
2.20.1
#7 lore raw

PATCH 3/3 package/mkpimage: define extract step to allow patching

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

As recently discussed on the list:
http://lists.busybox.net/pipermail/buildroot/2021-April/308373.html

Packages like mkpimage where the source code is included in the Buildroot tree, currently doesn't use an extract step (which also skips the patch step), so they cannot be patched by a patch in BR2_GLOBAL_PATCH_DIR (or the pkgdir), which is a bit confusing.

Quoted 4 lines

As a fix, add a simple extract step that copies the source file to the build directory, so the patch step gets run as well.

Committed, thanks.

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

PATCH 3/3 package/mkpimage: define extract step to allow patching

In reply to Peter Korsgaard
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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

As recently discussed on the list:
http://lists.busybox.net/pipermail/buildroot/2021-April/308373.html

Packages like mkpimage where the source code is included in the Buildroot tree, currently doesn't use an extract step (which also skips the patch step), so they cannot be patched by a patch in BR2_GLOBAL_PATCH_DIR (or the pkgdir), which is a bit confusing.

Quoted 4 lines

As a fix, add a simple extract step that copies the source file to the build directory, so the patch step gets run as well.

Committed to 2021.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard