mistydemeo / homebrew-formulae

Alternate formulae repos for Homebrew
12 stars 6 forks source link

Can't install GBDK (failure while executing patch) #7

Closed leolobato closed 6 years ago

leolobato commented 6 years ago

I've tried to use your GBDK formula, but it seems to fail while applying a patch:

$ brew install --HEAD mistydemeo/formulae/gbdk
==> Installing gbdk from mistydemeo/formulae
==> Cloning https://github.com/qatsindio/gbdk.git
Cloning into '/Users/leolobato/Library/Caches/Homebrew/gbdk--git'...
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
==> Downloading https://raw.githubusercontent.com/co-me/gbdk/c8dc0a57e94a5c68555
######################################################################## 100.0%
==> Patching
==> Applying macosx.patch
patching file sdcc/support/cpp2/configure
patching file sdcc/src/SDCCy.c
Hunk #1 FAILED at 2494.
1 out of 1 hunk FAILED -- saving rejects to file sdcc/src/SDCCy.c.rej
Error: Failure while executing; `patch -g 0 -f -p1` exited with 1. Here's the output:
347
leolobato commented 6 years ago

I'm not very familiar with setting up brew formulas, but apparently your formula was supposed to be using -p0 strip level and it's being ignored by brew (last line of the log above).

If I manually apply that patch using -p0 to https://github.com/qatsindio/gbdk.git as described by their README, it works:

$ patch -g 0 -f -p1 < macosx.patch 
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- sdcc/support/cpp2/configure.orig   2014-01-08 21:54:41.000000000 +0900
|+++ sdcc/support/cpp2/configure    2014-01-08 21:55:14.000000000 +0900
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored

$ patch -p0 < macosx.patch 
patching file sdcc/support/cpp2/configure
leolobato commented 6 years ago

Turns out the issue was on the second patch, which doesn't seem to be necessary anymore.

I've removed it and was able to install and run the SDK against a sample GB code which built ok.

mistydemeo commented 6 years ago

Fixed by #8. Thanks again!