Skip to content

Commit

Permalink
media-libs/alure: Fix building with newer media-libs/dumb versions
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: James Le Cuirot <[email protected]>
  • Loading branch information
chewi committed May 31, 2020
1 parent 8b9daec commit bf1b4d6
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 2 deletions.
4 changes: 2 additions & 2 deletions media-libs/alure/alure-1.2-r1.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
Expand All @@ -16,7 +16,7 @@ IUSE="dumb examples flac fluidsynth mp3 sndfile static-libs vorbis"

RDEPEND="
>=media-libs/openal-1.1
dumb? ( media-libs/dumb )
dumb? ( =media-libs/dumb-0.9*:= )
flac? ( media-libs/flac )
fluidsynth? ( >=media-sound/fluidsynth-1.1.1:= )
mp3? ( media-sound/mpg123 )
Expand Down
53 changes: 53 additions & 0 deletions media-libs/alure/alure-1.2-r2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit cmake

DESCRIPTION="The OpenAL Utility Toolkit"
HOMEPAGE="https://kcat.strangesoft.net/alure.html"
SRC_URI="https://kcat.strangesoft.net/alure-releases/${P}.tar.bz2"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE="dumb examples flac fluidsynth mp3 sndfile static-libs vorbis"

RDEPEND="
>=media-libs/openal-1.1
dumb? ( media-libs/dumb:= )
flac? ( media-libs/flac )
fluidsynth? ( >=media-sound/fluidsynth-1.1.1:= )
mp3? ( media-sound/mpg123 )
sndfile? ( media-libs/libsndfile )
vorbis? ( media-libs/libvorbis )"
DEPEND="${RDEPEND}"

PATCHES=(
"${FILESDIR}"/${P}-include-unistd.patch
"${FILESDIR}"/${P}-new-dumb.patch
)

src_prepare() {
cmake_src_prepare

sed -i -e "/DESTINATION/s:doc/alure:doc/${PF}:" CMakeLists.txt || die
}

src_configure() {
# FIXME: libmodplug/sndfile.h from libmodplug conflict with sndfile.h from libsndfile
local mycmakeargs=(
-DMODPLUG=OFF
-DDUMB=$(usex dumb)
-DBUILD_EXAMPLES=$(usex examples)
-DFLAC=$(usex flac)
-DFLUIDSYNTH=$(usex fluidsynth)
-DMPG123=$(usex mp3)
-DSNDFILE=$(usex sndfile)
-DBUILD_STATIC=$(usex static-libs)
-DVORBIS=$(usex vorbis)
)

cmake_src_configure
}
30 changes: 30 additions & 0 deletions media-libs/alure/files/alure-1.2-new-dumb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Already fixed upstream:
# https://repo.or.cz/alure.git/commitdiff/9939cdfbf9c6c7a2690db7fb8dd2892389adcd5f

diff -Naur a/src/codec_dumb.cpp b/src/codec_dumb.cpp
--- a/src/codec_dumb.cpp 2011-07-29 09:37:48.000000000 +0100
+++ b/src/codec_dumb.cpp 2020-05-10 15:59:48.502632496 +0100
@@ -272,7 +272,11 @@

private:
// DUMBFILE iostream callbacks
+#if DUMB_VERSION >= 2*10000
+ static int skip(void *user_data, dumb_off_t offset)
+#else
static int skip(void *user_data, long offset)
+#endif
{
std::istream *stream = static_cast<dumbStream*>(user_data)->fstream;
stream->clear();
@@ -282,7 +286,11 @@
return -1;
}

+#if DUMB_VERSION >= 2*10000
+ static dumb_ssize_t read(char *ptr, size_t size, void *user_data)
+#else
static long read(char *ptr, long size, void *user_data)
+#endif
{
std::istream *stream = static_cast<dumbStream*>(user_data)->fstream;
stream->clear();

0 comments on commit bf1b4d6

Please sign in to comment.