Skip to content

Commit 88bd526

Browse files
PataterWinterMute
authored andcommitted
Prefer using GNU Patch
The patches we use do not apply with BSD Patch. Attempt to find GNU Patch and use that instead of the default 'patch' program. The patches appear to apply fine as no errors are returned when we run patch. However, files like libsysbase/dummy.c aren't created and we see the following error: gmake[2]: Entering directory '.devkitARM/arm-none-eabi/newlib/arm-none-eabi/libgloss' /usr/local/bin/gmake all-recursive gmake[3]: Entering directory '.devkitARM/arm-none-eabi/newlib/arm-none-eabi/libgloss' Making all in . gmake[4]: Entering directory '.devkitARM/arm-none-eabi/newlib/arm-none-eabi/libgloss' MAKEINFO ../../../../newlib-4.4.0.20231231/libgloss/doc/porting.info gmake[4]: *** No rule to make target 'libsysbase/dummy.c', needed by 'libsysbase/dummy.o'. Stop. By switching to GNU Patch, our patches properly apply and the build succeeds.
1 parent d3d636c commit 88bd526

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

build-devkit.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ DKA64_RULES_VER=1.1.1
3636

3737
OSXMIN=${OSXMIN:-10.9}
3838

39+
#---------------------------------------------------------------------------------
40+
# find proper patch
41+
#---------------------------------------------------------------------------------
42+
if [ -z "$PATCH" -a -x "$(which gpatch)" ]; then PATCH=$(which gpatch); fi
43+
if [ -z "$PATCH" -a -x "$(which patch)" ]; then PATCH=$(which patch); fi
44+
if [ -z "$PATCH" ]; then
45+
echo no patch found
46+
exit 1
47+
fi
48+
echo use $PATCH as patch
49+
export PATCH
50+
3951
#---------------------------------------------------------------------------------
4052
function extract_and_patch {
4153
#---------------------------------------------------------------------------------
@@ -46,7 +58,7 @@ function extract_and_patch {
4658
fi
4759
if [[ ! -f patched-$1-$2 && -f $patchdir/$1-$2.patch ]]; then
4860
echo "patching $1-$2"
49-
patch -p1 -d $1-$2 -i $patchdir/$1-$2.patch || { echo "Error patching $1"; exit 1; }
61+
$PATCH -p1 -d $1-$2 -i $patchdir/$1-$2.patch || { echo "Error patching $1"; exit 1; }
5062
touch patched-$1-$2
5163
fi
5264
}

0 commit comments

Comments
 (0)