From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6441C158008 for ; Thu, 15 Jun 2023 15:19:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A1C26E08C0; Thu, 15 Jun 2023 15:19:54 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8A3E0E08C0 for ; Thu, 15 Jun 2023 15:19:54 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 82844340EE6 for ; Thu, 15 Jun 2023 15:19:53 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id ADF61A8D for ; Thu, 15 Jun 2023 15:19:51 +0000 (UTC) From: "Ben Kohler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ben Kohler" Message-ID: <1686842266.1afb1f2f7dfb2e4c1588fcb084f9879f3494f111.bkohler@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/fatcat/, sys-fs/fatcat/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-fs/fatcat/fatcat-1.1.1.ebuild sys-fs/fatcat/files/fatcat-1.1.1-musl-1.2.4-fixes.patch sys-fs/fatcat/files/fatcat-include-getopt.patch X-VCS-Directories: sys-fs/fatcat/ sys-fs/fatcat/files/ X-VCS-Committer: bkohler X-VCS-Committer-Name: Ben Kohler X-VCS-Revision: 1afb1f2f7dfb2e4c1588fcb084f9879f3494f111 X-VCS-Branch: master Date: Thu, 15 Jun 2023 15:19:51 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: add6e5b5-c7b3-415b-95bc-e1fb84348d3d X-Archives-Hash: ab9986e495e1bf2f6da7feb34d4d060d commit: 1afb1f2f7dfb2e4c1588fcb084f9879f3494f111 Author: Ben Kohler gentoo org> AuthorDate: Thu Jun 15 15:17:46 2023 +0000 Commit: Ben Kohler gentoo org> CommitDate: Thu Jun 15 15:17:46 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1afb1f2f sys-fs/fatcat: new musl fix, replace old musl fix too We previously had 1 musl patch for getopt usage, I'm replacing that with one from an upstream PR [1], also adding a new patch from that upstream PR. [1] https://github.com/Gregwar/fatcat/pull/34 Closes: https://bugs.gentoo.org/908541 Signed-off-by: Ben Kohler gentoo.org> sys-fs/fatcat/fatcat-1.1.1.ebuild | 6 +- .../files/fatcat-1.1.1-musl-1.2.4-fixes.patch | 107 +++++++++++++++++++++ sys-fs/fatcat/files/fatcat-include-getopt.patch | 11 --- 3 files changed, 111 insertions(+), 13 deletions(-) diff --git a/sys-fs/fatcat/fatcat-1.1.1.ebuild b/sys-fs/fatcat/fatcat-1.1.1.ebuild index 1cbdeace786e..ac61be67b09a 100644 --- a/sys-fs/fatcat/fatcat-1.1.1.ebuild +++ b/sys-fs/fatcat/fatcat-1.1.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 2018-2022 Gentoo Authors +# Copyright 2018-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -17,7 +17,9 @@ IUSE="" DEPEND="!elibc_glibc? ( sys-libs/argp-standalone )" RDEPEND="${DEPEND}" -PATCHES=( "${FILESDIR}"/fatcat-include-getopt.patch ) +PATCHES=( + "${FILESDIR}/fatcat-1.1.1-musl-1.2.4-fixes.patch" +) src_install() { cmake_src_install diff --git a/sys-fs/fatcat/files/fatcat-1.1.1-musl-1.2.4-fixes.patch b/sys-fs/fatcat/files/fatcat-1.1.1-musl-1.2.4-fixes.patch new file mode 100644 index 000000000000..e01533fee306 --- /dev/null +++ b/sys-fs/fatcat/files/fatcat-1.1.1-musl-1.2.4-fixes.patch @@ -0,0 +1,107 @@ +From 12fdf46cb916b71ed8360250d50b9208684695c9 Mon Sep 17 00:00:00 2001 +From: Alex Kiernan +Date: Sun, 19 Jan 2020 16:03:21 +0000 +Subject: [PATCH 1/2] Use unistd.h not argp.h for all POSIX systems + +getopt(3) is found in unistd.h on all POSIX systems and we make no use +of any of the GNU specific argp extensions. Include unistd.h directly to +allow building with musl on linux, whilst retaining compatibility with +glibc and other unices. + +Signed-off-by: Alex Kiernan +--- + src/fatcat.cpp | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/src/fatcat.cpp b/src/fatcat.cpp +index ce23ca0..b4427e4 100644 +--- a/src/fatcat.cpp ++++ b/src/fatcat.cpp +@@ -1,14 +1,10 @@ + #include +-#include +-#ifdef __APPLE__ +-#include +-#else ++#include + #ifdef __WIN__ + #include + #include "xgetopt/xgetopt.h" + #else +-#include +-#endif ++#include + #endif + + #include + +From 29021747ac2e52a27013310a532439bfdf438c24 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 16 Dec 2022 18:54:55 -0800 +Subject: [PATCH 2/2] Enable 64bit off_t + +Ensure that off_t is always 64-bit by specifying -D_LARGEFILE_SOURCE +-D_FILE_OFFSET_BITS=64 this will ensure that normal lseek() function is +same as lseek64 + +This helps compiling on latest musl where lseek64 and friends are not +available + +Signed-off-by: Khem Raj +--- + CMakeLists.txt | 2 ++ + src/core/FatSystem.cpp | 4 ++-- + src/core/FatSystem.h | 2 -- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d6a2649..4cdd1fb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -34,6 +34,8 @@ IF(DEFINE_WIN) + add_definitions(-D__WIN__) + ENDIF(DEFINE_WIN) + ++add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64) ++ + include_directories("${CMAKE_SOURCE_DIR}/src") + + add_executable(fatcat "src/fatcat.cpp" ${ALL_SOURCES}) +diff --git a/src/core/FatSystem.cpp b/src/core/FatSystem.cpp +index 79cda8c..1f52e82 100644 +--- a/src/core/FatSystem.cpp ++++ b/src/core/FatSystem.cpp +@@ -90,7 +90,7 @@ int FatSystem::readData(unsigned long long address, char *buffer, int size) + cerr << "! Trying to read outside the disk" << endl; + } + +- lseek64(fd, globalOffset+address, SEEK_SET); ++ lseek(fd, globalOffset+address, SEEK_SET); + + int n; + int pos = 0; +@@ -112,7 +112,7 @@ int FatSystem::writeData(unsigned long long address, const char *buffer, int siz + throw string("Trying to write data while write mode is disabled"); + } + +- lseek64(fd, globalOffset+address, SEEK_SET); ++ lseek(fd, globalOffset+address, SEEK_SET); + + int n; + int pos = 0; +diff --git a/src/core/FatSystem.h b/src/core/FatSystem.h +index cd3c914..f9f2ca3 100644 +--- a/src/core/FatSystem.h ++++ b/src/core/FatSystem.h +@@ -11,11 +11,9 @@ + + #ifdef __APPLE__ + #define O_LARGEFILE 0 +-#define lseek64 lseek + #endif + #ifdef __WIN__ + #define O_LARGEFILE 0 +-#define lseek64 lseek + #endif + using namespace std; + diff --git a/sys-fs/fatcat/files/fatcat-include-getopt.patch b/sys-fs/fatcat/files/fatcat-include-getopt.patch deleted file mode 100644 index a9c9094eceb3..000000000000 --- a/sys-fs/fatcat/files/fatcat-include-getopt.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -ur a/src/fatcat.cpp b/src/fatcat.cpp ---- a/src/fatcat.cpp 2020-04-05 11:12:55.773602065 -0500 -+++ b/src/fatcat.cpp 2020-04-05 11:13:14.112132604 -0500 -@@ -8,6 +8,7 @@ - #include "xgetopt/xgetopt.h" - #else - #include -+#include - #endif - #endif -