summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Sokolov <alexey+gentoo@asokolov.org>2024-02-10 22:17:33 +0000
committerJoonas Niilola <juippis@gentoo.org>2024-02-15 15:17:10 +0200
commit5e3b8266ccf91538b9b9a8d337d520c3c906984a (patch)
treee36244082796d7961665e384ba4d8be89be40fff /games-rpg
parentmedia-video/vdr: add 2.6.6 (diff)
downloadgentoo-5e3b8266ccf91538b9b9a8d337d520c3c906984a.tar.gz
gentoo-5e3b8266ccf91538b9b9a8d337d520c3c906984a.tar.bz2
gentoo-5e3b8266ccf91538b9b9a8d337d520c3c906984a.zip
games-rpg/rpg-cli: fix build with musl 1.2.4
Closes: https://bugs.gentoo.org/923901 Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'games-rpg')
-rw-r--r--games-rpg/rpg-cli/files/getrandom-0.2.3-open64.patch27
-rw-r--r--games-rpg/rpg-cli/rpg-cli-1.0.1.ebuild10
2 files changed, 36 insertions, 1 deletions
diff --git a/games-rpg/rpg-cli/files/getrandom-0.2.3-open64.patch b/games-rpg/rpg-cli/files/getrandom-0.2.3-open64.patch
new file mode 100644
index 000000000000..eb29e580c058
--- /dev/null
+++ b/games-rpg/rpg-cli/files/getrandom-0.2.3-open64.patch
@@ -0,0 +1,27 @@
+Fix build with musl 1.2.4
+
+https://bugs.gentoo.org/923901
+https://github.com/rust-random/getrandom/pull/326
+
+--- a/src/util_libc.rs
++++ b/src/util_libc.rs
+@@ -96,18 +96,10 @@ impl Weak {
+ }
+ }
+
+-cfg_if! {
+- if #[cfg(any(target_os = "linux", target_os = "emscripten"))] {
+- use libc::open64 as open;
+- } else {
+- use libc::open;
+- }
+-}
+-
+ // SAFETY: path must be null terminated, FD must be manually closed.
+ pub unsafe fn open_readonly(path: &str) -> Result<libc::c_int, Error> {
+ debug_assert_eq!(path.as_bytes().last(), Some(&0));
+- let fd = open(path.as_ptr() as *const _, libc::O_RDONLY | libc::O_CLOEXEC);
++ let fd = libc::open(path.as_ptr() as *const _, libc::O_RDONLY | libc::O_CLOEXEC);
+ if fd < 0 {
+ return Err(last_os_error());
+ }
diff --git a/games-rpg/rpg-cli/rpg-cli-1.0.1.ebuild b/games-rpg/rpg-cli/rpg-cli-1.0.1.ebuild
index b42762da9613..4ec52d582136 100644
--- a/games-rpg/rpg-cli/rpg-cli-1.0.1.ebuild
+++ b/games-rpg/rpg-cli/rpg-cli-1.0.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2021-2022 Gentoo Authors
+# Copyright 2021-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Auto-Generated by cargo-ebuild 0.3.2
@@ -85,6 +85,14 @@ KEYWORDS="~amd64 ~ppc64"
QA_FLAGS_IGNORED="usr/bin/rpg-cli"
+src_prepare() {
+ pushd "${WORKDIR}"/cargo_home/gentoo/getrandom-0.2.3 || die
+ eapply "${FILESDIR}"/getrandom-0.2.3-open64.patch
+ popd || die
+
+ default
+}
+
src_install() {
cargo_src_install
dodoc README.md