pkgsrc-Bugs archive

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

Re: pkg/53920: devel/patch: pkgsrc patches fail to apply on macOS due to ${PATCH} not being defined



The following reply was made to PR pkg/53920; it has been noted by GNATS.

From: Leonardo Taccari <leot%NetBSD.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/53920: devel/patch: pkgsrc patches fail to apply on macOS due to ${PATCH} not being defined
Date: Tue, 29 Jan 2019 10:44:08 +0100

 Hello Dean,
 
 bapabooiee%gmail.com@localhost writes:
 > >Number:         53920
 > >Category:       pkg
 > >Synopsis:       devel/patch: pkgsrc patches fail to apply on macOS due to ${PATCH} not being defined
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       medium
 > >Responsible:    pkg-manager
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Tue Jan 29 00:15:00 +0000 2019
 > >Originator:     Dean Matzkov
 > >Release:        pkgsrc-2018Q4
 > >Organization:
 > >Environment:
 > >Description:
 > When using pkgsrc-2018Q4 on the latest version of macOS, the package ``devel/patch`` fails to build due to ${PATCH} being undefined, and thus causing $pkgsrc/mk/patch/patch.nk to fail.
 >
 > No other package I've tried to build has failed to have its pkgsrc patches apply, so I can only guess is that, for whatever reason, the package name being called ``patch`` might have have something to do with it.
 >
 > Here's the output from running ``bmake patch`` in ``devel/patch``:
 >
 > ---SNIP---
 > $ bmake patch
 >
 > => Bootstrap dependency digest>=20010302: found digest-20180917
 > ===> Patching for patch-2.7.6nb1
 > => Applying pkgsrc patches for patch-2.7.6nb1
 > /bin/sh: -d: command not found
 > Patch /Volumes/Stuff/pkgsrc-2018Q4/devel/patch/patches/patch-src_pch.c failed
 > /bin/sh: -d: command not found
 > Patch /Volumes/Stuff/pkgsrc-2018Q4/devel/patch/patches/patch-tests_Makefile.in failed
 > /bin/sh: -d: command not found
 > Patch /Volumes/Stuff/pkgsrc-2018Q4/devel/patch/patches/patch-tests_ed-style failed
 > ERROR: Patching failed due to modified or broken patch file(s):
 > ERROR:  /Volumes/Stuff/pkgsrc-2018Q4/devel/patch/patches/patch-src_pch.c
 > ERROR:  /Volumes/Stuff/pkgsrc-2018Q4/devel/patch/patches/patch-tests_Makefile.in
 > ERROR:  /Volumes/Stuff/pkgsrc-2018Q4/devel/patch/patches/patch-tests_ed-style
 > *** Error code 1
 >
 > Stop.
 > bmake[1]: stopped in /Volumes/Stuff/pkgsrc-2018Q4/devel/patch
 > *** Error code 1
 >
 > Stop.
 > bmake: stopped in /Volumes/Stuff/pkgsrc-2018Q4/devel/patch
 > ---/SNIP---
 >
 >
 > I managed to get it to patch and build after making a quick and dirty edit of this line in ``do-pkgsrc-patch`` in ``$pkgsrc/mk/patch/patch.mk``, which'd help confirm it might indeed be caused by ${PATCH} being undefined:
 >
 >         if ${PATCH} $$fuzz_flags ${PATCH_ARGS} < $$i; then  \
 >
 > to -->
 >
 >         if patch $$fuzz_flags ${PATCH_ARGS} < $$i; then  \
 >
 >
 >
 > My mk.conf is bog-standard, with nothing to report aside from having my prefix being setup with ``--unprivileged``.
 > [...]
 
 I think that this is due mk/tools/replace.mk:642 check that define
 TOOLS_IGNORE.patch when the PKGPATH is devel/patch (instead of
 devel/nbpatch).
 
 Can you please try the attached patch and let us know if it fixes
 the problem?
 
 
 Thank you!
 
 
 -------------------------8<-----------------8<-------------------------
 mk/tools/replace.mk: Update the check to devel/nbpatch
 
 The check to avoid possible dependency loop was not updated to
 check devel/nbpatch (instead of devel/patch).
 
 Should fix PR pkg/53920.
 
 Index: tools/replace.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/tools/replace.mk,v
 retrieving revision 1.285
 diff -u -p -r1.285 replace.mk
 --- tools/replace.mk	17 Oct 2018 08:22:19 -0000	1.285
 +++ tools/replace.mk	29 Jan 2019 09:38:43 -0000
 @@ -639,7 +639,7 @@ TOOLS_PATH.openssl=		${LOCALBASE}/bin/op
  .endif
  
  .if !defined(TOOLS_IGNORE.patch) && !empty(_USE_TOOLS:Mpatch)
 -.  if !empty(PKGPATH:Mdevel/patch)
 +.  if !empty(PKGPATH:Mdevel/nbpatch)
  MAKEFLAGS+=			TOOLS_IGNORE.patch=
  .  elif !empty(_TOOLS_USE_PKGSRC.patch:M[yY][eE][sS])
  TOOLS_DEPENDS.patch?=		nbpatch-[0-9]*:../../devel/nbpatch
 


Home | Main Index | Thread Index | Old Index