Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
apply windows patch separately
Browse files Browse the repository at this point in the history
we apply it with `--binary` option to allow Windows line endings
setting patch type *.diff_bin to binary via .gitattributes
  • Loading branch information
dimpase committed Sep 9, 2020
1 parent 5ec24db commit 77ab81f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
* text=auto eol=lf
# except for Windows batch files
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
*.diff_bin binary
19 changes: 4 additions & 15 deletions build/pkgs/zlib/patches/cygwin-gzopen_w.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
Patch needed for zlib to build on Cygwin. This is needed due to a misguided
and broken attempt to add unnecessary wide character interfaces on Cygwin
(which generally works more on the POSIX philosophy for filenames).
See https://trac.sagemath.org/ticket/23083
diff -ruN a/gzguts.h b/gzguts.h
--- a/gzguts.h 2017-05-26 12:14:03.500413900 +0200
+++ b/gzguts.h 2017-05-26 12:14:28.200295200 +0200
diff --git a/gzguts.h b/gzguts.h
index 990a4d2..6378d46 100644
--- a/gzguts.h
+++ b/gzguts.h
@@ -39,7 +39,7 @@
# include <io.h>
#endif
Expand All @@ -14,11 +11,3 @@ diff -ruN a/gzguts.h b/gzguts.h
# define WIDECHAR
#endif

diff -ruN a/win32/zlib.def b/win32/zlib.def
--- a/win32/zlib.def 2017-05-26 12:14:03.744912800 +0200
+++ b/win32/zlib.def 2017-05-26 12:15:02.512250800 +0200
@@ -91,4 +91,3 @@
inflateCodesUsed
inflateResetKeep
deflateResetKeep
- gzopen_w
9 changes: 9 additions & 0 deletions build/pkgs/zlib/patches/cygwin-windef.diff_bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff --git a/win32/zlib.def b/win32/zlib.def
index 784b138..b69fa3e 100644
--- a/win32/zlib.def
+++ b/win32/zlib.def
@@ -91,4 +91,3 @@ EXPORTS
inflateCodesUsed
inflateResetKeep
deflateResetKeep
- gzopen_w
3 changes: 2 additions & 1 deletion build/pkgs/zlib/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cd src/

echo "patching win32/zlib.def with a binary patch"
patch -p1 --posix --binary <"$SAGE_ROOT/build/pkgs/zlib/patches/cygwin-windef.diff_bin"

if [ "$UNAME" = CYGWIN ]; then
export BINARY_PATH="$SAGE_LOCAL/bin"
Expand Down

0 comments on commit 77ab81f

Please sign in to comment.