ports/emulators/wine-devel/files/extra-gitapply
Damjan Jovanovic e041ced513 emulators/wine-devel: Update to Wine 6.20
This includes the following changes:
 - MSXml, XAudio, DInput and a few other modules converted to PE.
 - A few system libraries are bundled with the source to support PE builds.
 - HID joystick is now the only supported joystick backend in DirectInput.
 - Better support for MSVCRT builds in Winelib.
 - Various bug fixes.

Also, using our patches within this Port (for now):
 - procfs no longer needs to be mounted on /proc, we use sysctl() instead.
 - The Staging patchset will apply even if $PORTSDIR is a Git repository.

The latter requires lang/gawk as an additional EXTRACT_DEPENDS.

(The now bundled system libraries will trigger some follow-up changes,
but for now we're okay.)

Approved by:	maintainer (= author)
2021-11-01 08:57:10 +00:00

66 lines
1.9 KiB
Text

--- patches/gitapply.sh 2021-10-23 11:20:53.385792000 +0200
+++ patches/gitapply.sh 2021-10-23 11:21:40.952836000 +0200
@@ -22,6 +22,13 @@
nogit=0
tmpfile=""
+patch="patch"
+sha1sum="sha1sum"
+if [ `uname -s` = "FreeBSD" ]; then
+ patch="gpatch"
+ sha1sum="sha1"
+fi
+
# Show usage information about gitapply script
usage()
{
@@ -57,7 +64,7 @@
gitsha1()
{
if [ -f "$1" ]; then
- echo -en "blob $(du -b "$1" | cut -f1)\x00" | cat - "$1" | sha1sum | cut -d' ' -f1
+ echo -en "blob $(wc -c < "$1" | xargs | cut -d' ' -f1)\x00" | cat - "$1" | $sha1sum | cut -d' ' -f1
else
echo "0000000000000000000000000000000000000000"
fi
@@ -66,7 +73,7 @@
# Determine size of a file (or zero, if it doesn't exist)
filesize()
{
- local size=$(du -b "$1" | cut -f1)
+ local size=$(wc -c < "$1" | xargs | cut -d' ' -f1)
if [ -z "$size" ]; then
size="0"
fi
@@ -114,13 +121,6 @@
exit 1
fi
-# Detect BSD - we check this first to error out as early as possible
-if gzip -V 2>&1 | grep -q "BSD"; then
- echo "This script is not compatible with *BSD utilities. Please install git," >&2
- echo "which provides the same functionality and will be used instead." >&2
- exit 1
-fi
-
# Check if GNU Awk is available
if ! command -v gawk >/dev/null 2>&1; then
if ! awk -V 2>/dev/null | grep -q "GNU Awk"; then
@@ -135,7 +135,7 @@
fi
# Check for missing depdencies
-for dependency in gawk cut dd du grep gzip hexdump patch sha1sum; do
+for dependency in gawk cut dd grep gzip hexdump $patch $sha1sum; do
if ! command -v "$dependency" >/dev/null 2>&1; then
echo "Missing dependency: $dependency - please install this program and try again." >&2
exit 1
@@ -358,7 +358,7 @@
# Apply textual patch
tmpoffset=$((lastoffset - 1))
- if ! sed -n "$offset,$tmpoffset p" "$tmpfile" | patch -p1 -s -f; then
+ if ! sed -n "$offset,$tmpoffset p" "$tmpfile" | $patch -p1 -s -f; then
abort "Textual patch did not apply, aborting."
fi