commit:     f8ed0435911386a99176204c60cf36ca94e51ecb
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 24 08:53:54 2021 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Wed Nov 24 08:57:44 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8ed0435

dev-embedded/lpc21isp: use sed to patch the Makefile

DOS line endings, patch files and git do not always mix.

Closes: https://bugs.gentoo.org/827018
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../lpc21isp/files/lpc21isp-1.97-makefile-tc-vars.patch      | 11 -----------
 dev-embedded/lpc21isp/lpc21isp-1.97.ebuild                   | 12 ++++++++----
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/dev-embedded/lpc21isp/files/lpc21isp-1.97-makefile-tc-vars.patch 
b/dev-embedded/lpc21isp/files/lpc21isp-1.97-makefile-tc-vars.patch
deleted file mode 100644
index 18e6d21fe19c..000000000000
--- a/dev-embedded/lpc21isp/files/lpc21isp-1.97-makefile-tc-vars.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -1,7 +1,7 @@
- all:      lpc21isp
- 
- GLOBAL_DEP  = adprog.h lpc21isp.h lpcprog.h lpcterm.h
--CC = gcc
-+CC ?= gcc
- 
- ifneq ($(findstring(freebsd, $(OSTYPE))),)
- CFLAGS+=-D__FREEBSD__

diff --git a/dev-embedded/lpc21isp/lpc21isp-1.97.ebuild 
b/dev-embedded/lpc21isp/lpc21isp-1.97.ebuild
index 5c201608ac52..081ebfcad4fe 100644
--- a/dev-embedded/lpc21isp/lpc21isp-1.97.ebuild
+++ b/dev-embedded/lpc21isp/lpc21isp-1.97.ebuild
@@ -13,12 +13,16 @@ LICENSE="LGPL-3+"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 
-PATCHES=(
-       "${FILESDIR}"/${PN}-1.97-makefile-tc-vars.patch
-)
-
 S="${WORKDIR}"/${MY_P}
 
+src_prepare() {
+       default
+
+       # Upstream makefile has got DOS line endings so using patches there is 
fragile,
+       # see Bug #827018.
+       sed -i -e 's#^\(CC \?\)=#\1?=#' Makefile || die
+}
+
 src_install() {
        dobin lpc21isp
 }

Reply via email to