[PATCH] openssl: don't rename a file with quilt

Felix Fietkau nbd at nbd.name
Fri Mar 26 21:57:47 GMT 2021


On 2021-03-26 22:39, Eneas U de Queiroz wrote:
> On Fri, Mar 26, 2021 at 4:28 PM Rosen Penev <rosenp at gmail.com> wrote:
>>
>> On Fri, Mar 26, 2021 at 5:55 AM Eneas U de Queiroz
>> <cotequeiroz at gmail.com> wrote:
>> >
>> > On Fri, Mar 26, 2021 at 6:26 AM Rosen Penev <rosenp at gmail.com> wrote:
>> > > +ifeq ($(QUILT),)
>> > > +       mv $(PKG_BUILD_DIR)/crypto/engine/eng_devcrypto.c $(PKG_BUILD_DIR)/engines/e_devcrypto.c
>> > > +endif
>> >
>> > This will break compilation with QUILT, as the rename will never
>> > happen then.  You're using this strategy with other packages, so I
>> > won't mention them individually, but this applies to all.
>> > I would handle it at the patch level by removing the old file and
>> > creating the new one.
>> It doesn't break quilt as the rename happens separately. Note that the
>> patches were modified to refer to the old name.
> It breaks 'make package/openssl/compile QUILT=1', because the 'mv'
> command will never run when QUILT is not empty.  You can't run the
> 'mv' line with quilt because the patches are not applied in
> Build/Prepare.  However, you must ensure it is run later, or the
> package will not compile with QUILT=1.  I can point you to
> openwrt/packages#14894 to see why you can't just skip running stuff
> when QUILT is defined.
I fully agree with Eneas here (though I don't like his patch for this
issue either). Here's a way to fix this:

include/package-defaults.mk has this:

  define Build/Prepare/Default
	$(PKG_UNPACK)
	[ ! -d ./src/ ] || $(CP) ./src/. $(PKG_BUILD_DIR)
	$(Build/Patch)
  endef

You can adjust it to define this in the package Makefile:

define Build/Prepare
	$(PKG_UNPACK)
	[ ! -d ./src/ ] || $(CP) ./src/. $(PKG_BUILD_DIR)
	mv $(PKG_BUILD_DIR)/crypto/engine/eng_devcrypto.c $(PKG_BUILD_DIR)/engines/e_devcrypto.c
	$(Build/Patch)
endef

- Felix



More information about the openwrt-devel mailing list