Skip to content

Commit 77ab81f

Browse files
committed
apply windows patch separately
we apply it with `--binary` option to allow Windows line endings setting patch type *.diff_bin to binary via .gitattributes
1 parent 5ec24db commit 77ab81f

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

.gitattributes

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
* text=auto eol=lf
33
# except for Windows batch files
44
*.{cmd,[cC][mM][dD]} text eol=crlf
5-
*.{bat,[bB][aA][tT]} text eol=crlf
5+
*.{bat,[bB][aA][tT]} text eol=crlf
6+
*.diff_bin binary
+4-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
Patch needed for zlib to build on Cygwin. This is needed due to a misguided
2-
and broken attempt to add unnecessary wide character interfaces on Cygwin
3-
(which generally works more on the POSIX philosophy for filenames).
4-
See https://trac.sagemath.org/ticket/23083
5-
diff -ruN a/gzguts.h b/gzguts.h
6-
--- a/gzguts.h 2017-05-26 12:14:03.500413900 +0200
7-
+++ b/gzguts.h 2017-05-26 12:14:28.200295200 +0200
1+
diff --git a/gzguts.h b/gzguts.h
2+
index 990a4d2..6378d46 100644
3+
--- a/gzguts.h
4+
+++ b/gzguts.h
85
@@ -39,7 +39,7 @@
96
# include <io.h>
107
#endif
@@ -14,11 +11,3 @@ diff -ruN a/gzguts.h b/gzguts.h
1411
# define WIDECHAR
1512
#endif
1613

17-
diff -ruN a/win32/zlib.def b/win32/zlib.def
18-
--- a/win32/zlib.def 2017-05-26 12:14:03.744912800 +0200
19-
+++ b/win32/zlib.def 2017-05-26 12:15:02.512250800 +0200
20-
@@ -91,4 +91,3 @@
21-
inflateCodesUsed
22-
inflateResetKeep
23-
deflateResetKeep
24-
- gzopen_w
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
diff --git a/win32/zlib.def b/win32/zlib.def
2+
index 784b138..b69fa3e 100644
3+
--- a/win32/zlib.def
4+
+++ b/win32/zlib.def
5+
@@ -91,4 +91,3 @@ EXPORTS
6+
inflateCodesUsed
7+
inflateResetKeep
8+
deflateResetKeep
9+
- gzopen_w

build/pkgs/zlib/spkg-install.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
cd src/
2-
2+
echo "patching win32/zlib.def with a binary patch"
3+
patch -p1 --posix --binary <"$SAGE_ROOT/build/pkgs/zlib/patches/cygwin-windef.diff_bin"
34

45
if [ "$UNAME" = CYGWIN ]; then
56
export BINARY_PATH="$SAGE_LOCAL/bin"

0 commit comments

Comments
 (0)