aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Elsing <david.elsing@posteo.net>2024-03-23 22:04:48 +0000
committerLudovic Courtès <ludo@gnu.org>2024-06-18 11:35:51 +0200
commit67b412f2b01516aaa859e3af601446c34da51d06 (patch)
treee690add496be4ec5e5a75a3d26b750f8671f8c53
parent9dc696884ef041440132a92a8eb340e6efa492b1 (diff)
downloadguix-67b412f2b01516aaa859e3af601446c34da51d06.tar
guix-67b412f2b01516aaa859e3af601446c34da51d06.tar.gz
gnu: Add miniz-for-pytorch.
* gnu/packages/compression.scm (miniz-for-pytorch): New variable. * gnu/packages/patches/miniz-for-pytorch.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/compression.scm21
-rw-r--r--gnu/packages/patches/miniz-for-pytorch.patch47
3 files changed, 69 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 98f22710f1..5a4149cf23 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1734,6 +1734,7 @@ dist_patch_DATA = \
%D%/packages/patches/mingw-w64-reproducible-gendef.patch \
%D%/packages/patches/minisat-friend-declaration.patch \
%D%/packages/patches/minisat-install.patch \
+ %D%/packages/patches/miniz-for-pytorch.patch \
%D%/packages/patches/mit-krb5-hurd.patch \
%D%/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch \
%D%/packages/patches/mixxx-system-googletest-benchmark.patch \
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index fa47006f83..ac025e0e3d 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -2968,3 +2968,24 @@ the zlib (RFC 1950) and Deflate (RFC 1951) compressed data format
specification standards. It supports the most commonly used functions
exported by the zlib library.")
(license license:expat)))
+
+(define-public miniz-for-pytorch
+ (package
+ (inherit miniz)
+ (version "pytorch-2.2.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/richgel999/miniz")
+ (commit "2.2.0")))
+ (file-name (git-file-name (package-name miniz) version))
+ (sha256
+ (base32
+ "09j9ihigfsavgcmk8l36zmbjvdf1x1w7h2v4rkww1qk1sb43y5zf"))
+ (patches (search-patches "miniz-for-pytorch.patch"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments miniz)
+ ((#:configure-flags flags '())
+ ;; The changes break the examples.
+ `(cons "-DBUILD_EXAMPLES=OFF" ,flags))))
+ (properties '((hidden? . #t)))))
diff --git a/gnu/packages/patches/miniz-for-pytorch.patch b/gnu/packages/patches/miniz-for-pytorch.patch
new file mode 100644
index 0000000000..19fa705a31
--- /dev/null
+++ b/gnu/packages/patches/miniz-for-pytorch.patch
@@ -0,0 +1,47 @@
+Modifications from the internal fork of the python-pytorch package.
+
+diff --git a/miniz.h b/miniz.h
+index 42e1ea2..5869ab9 100644
+--- a/miniz.h
++++ b/miniz.h
+@@ -123,7 +123,7 @@
+ /* If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able to get the current time, or */
+ /* get/set file times, and the C run-time funcs that get/set times won't be called. */
+ /* The current downside is the times written to your archives will be from 1979. */
+-/*#define MINIZ_NO_TIME */
++#define MINIZ_NO_TIME
+
+ /* Define MINIZ_NO_ARCHIVE_APIS to disable all ZIP archive API's. */
+ /*#define MINIZ_NO_ARCHIVE_APIS */
+@@ -135,7 +135,7 @@
+ /*#define MINIZ_NO_ZLIB_APIS */
+
+ /* Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. */
+-/*#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES */
++#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES
+
+ /* Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc.
+ Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc
+@@ -172,8 +172,7 @@
+ #if !defined(MINIZ_USE_UNALIGNED_LOADS_AND_STORES)
+ #if MINIZ_X86_OR_X64_CPU
+ /* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses. */
+-#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
+-#define MINIZ_UNALIGNED_USE_MEMCPY
++#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0
+ #else
+ #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0
+ #endif
+diff --git a/miniz_zip.h b/miniz_zip.h
+index 82502bd..3d92255 100644
+--- a/miniz_zip.h
++++ b/miniz_zip.h
+@@ -150,7 +150,7 @@ typedef enum {
+ MZ_ZIP_TOTAL_ERRORS
+ } mz_zip_error;
+
+-typedef struct
++typedef struct mz_zip_archive
+ {
+ mz_uint64 m_archive_size;
+ mz_uint64 m_central_directory_file_ofs;