From patchwork Sat Mar 23 22:04:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 62175 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E953927BBE9; Sat, 23 Mar 2024 22:24:52 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CC5D927BBE2 for ; Sat, 23 Mar 2024 22:24:49 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ro9my-0000h4-38; Sat, 23 Mar 2024 18:24:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ro9mq-0000fF-Kf for guix-patches@gnu.org; Sat, 23 Mar 2024 18:24:24 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ro9mm-0003LE-Ut for guix-patches@gnu.org; Sat, 23 Mar 2024 18:24:23 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ro9nS-0007Cu-AB for guix-patches@gnu.org; Sat, 23 Mar 2024 18:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69591] [PATCH v4 09/32] gnu: Add miniz-for-pytorch. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 23 Mar 2024 22:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69591 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69591@debbugs.gnu.org Cc: David Elsing Received: via spool by 69591-submit@debbugs.gnu.org id=B69591.171123266527589 (code B ref 69591); Sat, 23 Mar 2024 22:25:02 +0000 Received: (at 69591) by debbugs.gnu.org; 23 Mar 2024 22:24:25 +0000 Received: from localhost ([127.0.0.1]:57430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ro9mq-0007Al-Jg for submit@debbugs.gnu.org; Sat, 23 Mar 2024 18:24:25 -0400 Received: from mout02.posteo.de ([185.67.36.66]:47349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ro9mn-0007AJ-DM for 69591@debbugs.gnu.org; Sat, 23 Mar 2024 18:24:22 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 878E1240103 for <69591@debbugs.gnu.org>; Sat, 23 Mar 2024 23:05:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1711231525; bh=E4wIn7qn7CCbSI86fGLYbuVGf0twXWiPv3T8+ISg4Oc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=qc4/ctdTpZ2DH9xzz4AVSO1ivRPePKI0SKUhaMIE+jTCzIlSSinn6UYnuDr9JCZw8 VlDmdEBz3nan92jbeW2/dV69GJlV1wvgHWpqURXEsKTrkNP/0pibZBWuvFqX+KJlHC oJC7ecoKflTFp7lns5u4FORxQL/uTtOwT5Ok/MNtAXjc+UrliAfq+GZLnFuy5/fItL /tlA5uJKXSkOpFxPEZtSzzXJZTpmo/iQj9hm6P9Na5B96cpEzCmUvJR9BwCat7vHcs IX7KQKjPZicU0QmQF+7b+taYpzouPa0ub22FlICQioDJf1ymji6py9KaOXl/cipxBQ fggiJUfAnLNdg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V2CtY1ZlYz6tx0; Sat, 23 Mar 2024 23:05:25 +0100 (CET) From: David Elsing Date: Sat, 23 Mar 2024 22:04:48 +0000 Message-ID: <20240323220518.25063-9-david.elsing@posteo.net> In-Reply-To: <20240323214040.20221-1-david.elsing@posteo.net> References: <20240323214040.20221-1-david.elsing@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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. --- gnu/local.mk | 1 + gnu/packages/compression.scm | 21 +++++++++ gnu/packages/patches/miniz-for-pytorch.patch | 47 ++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 gnu/packages/patches/miniz-for-pytorch.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7f1006010b..ca83a84ea2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1691,6 +1691,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 fcfc2c30f3..589c9bb834 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -2867,3 +2867,24 @@ (define-public miniz 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;