From 2ba3412b90c3e75f624e8f96e3d4c0fb1abf5df5 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Sat, 13 Jul 2024 18:33:05 +0000 Subject: [PATCH] extra/libcdio: added extra/libcdio --- extra/libcdio/.SRCINFO | 16 ++++ extra/libcdio/PKGBUILD | 64 ++++++++++++++++ ...A63BC2582034A02B923D521A8DE5008275EC21.asc | 23 ++++++ .../libcdio/libcdio-2.1.0-no-lfs-shims.patch | 75 +++++++++++++++++++ 4 files changed, 178 insertions(+) create mode 100644 extra/libcdio/.SRCINFO create mode 100644 extra/libcdio/PKGBUILD create mode 100644 extra/libcdio/keys/pgp/DAA63BC2582034A02B923D521A8DE5008275EC21.asc create mode 100644 extra/libcdio/libcdio-2.1.0-no-lfs-shims.patch diff --git a/extra/libcdio/.SRCINFO b/extra/libcdio/.SRCINFO new file mode 100644 index 000000000..36b67785b --- /dev/null +++ b/extra/libcdio/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = libcdio + pkgdesc = GNU Compact Disc Input and Control Library + pkgver = 2.1.0 + pkgrel = 4 + url = https://www.gnu.org/software/libcdio/ + arch = x86_64 + license = GPL3 + makedepends = git + makedepends = help2man + depends = ncurses + depends = gcc-libs + source = git+https://git.savannah.gnu.org/git/libcdio.git#commit=9c7a2779846da161279bc1501e83c849cf89a594 + validpgpkeys = DAA63BC2582034A02B923D521A8DE5008275EC21 + sha256sums = SKIP + +pkgname = libcdio diff --git a/extra/libcdio/PKGBUILD b/extra/libcdio/PKGBUILD new file mode 100644 index 000000000..9c79f00fb --- /dev/null +++ b/extra/libcdio/PKGBUILD @@ -0,0 +1,64 @@ +# Maintainer: Jan Alexander Steffens (heftig) +# Contributor: damir + +# ALARM: Kevin Mihelich +# - patch from Gentoo and set -D_FILE_OFFSET_BITS=64 to fix 32bit FTBFS + +pkgname=libcdio +pkgver=2.1.0 +pkgrel=4 +pkgdesc="GNU Compact Disc Input and Control Library" +url="https://www.gnu.org/software/libcdio/" +arch=(x86_64) +license=(GPL3) +depends=(ncurses gcc-libs) +makedepends=(git help2man) +_commit=9c7a2779846da161279bc1501e83c849cf89a594 # tags/release-2.1.0 +source=("git+https://git.savannah.gnu.org/git/libcdio.git#commit=$_commit" + "libcdio-2.1.0-no-lfs-shims.patch") +sha256sums=('SKIP' + 'c52c1af97c6ba8f6b0bd70020479bffa966ea3d5569f8977354b8bd893d79f9f') +validpgpkeys=('DAA63BC2582034A02B923D521A8DE5008275EC21') # R. Bernstein + +pkgver() { + cd $pkgname + git describe --tags | sed 's/^release-//;s/[^-]*-g/r&/;s/-/+/g' +} + +prepare() { + cd $pkgname + + # Format security + git cherry-pick -n 2adb43c60afc6e98e94d86dad9f93d3df52862b1 + + # realpath test failure + git cherry-pick -n 56335fff0f21d294cd0e478d49542a43e9495ed0 + + # gentoo patch for 32bit + patch -p1 -i ../libcdio-2.1.0-no-lfs-shims.patch + + autoreconf -fvi +} + +build() { + cd $pkgname + CPPFLAGS+=' -D_FILE_OFFSET_BITS=64' + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ + --disable-vcd-info --disable-cddb --enable-cpp-progs --disable-static \ + --enable-maintainer-mode + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + make +} + +check() { + cd $pkgname + make -C test check +} + +package() { + cd $pkgname + make DESTDIR="$pkgdir" install + + sed -e "/define CDIO_LIBCDIO_SOURCE_PATH/s|.*|/* #undef CDIO_LIBCDIO_SOURCE_PATH */|" \ + -i "$pkgdir/usr/include/cdio/cdio_config.h" +} diff --git a/extra/libcdio/keys/pgp/DAA63BC2582034A02B923D521A8DE5008275EC21.asc b/extra/libcdio/keys/pgp/DAA63BC2582034A02B923D521A8DE5008275EC21.asc new file mode 100644 index 000000000..4a9550af6 --- /dev/null +++ b/extra/libcdio/keys/pgp/DAA63BC2582034A02B923D521A8DE5008275EC21.asc @@ -0,0 +1,23 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQGiBDs1Z2QRBAClcQILf2cKY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g4+tUmBrosBnnYg +Dv/8xJ9riE4EGBECAAYFAjs1Z2cAEgkQGo3lAIJ17CEHZUdQRwABAfEwAJsGJxJM +hqduAFvJLfI3kxC9ChdkXwCcDf1kl8pbyhvtB4Nh2q37IJcF2a4= +=XDjr +-----END PGP PUBLIC KEY BLOCK----- diff --git a/extra/libcdio/libcdio-2.1.0-no-lfs-shims.patch b/extra/libcdio/libcdio-2.1.0-no-lfs-shims.patch new file mode 100644 index 000000000..473c54d9b --- /dev/null +++ b/extra/libcdio/libcdio-2.1.0-no-lfs-shims.patch @@ -0,0 +1,75 @@ +From https://bugs.gentoo.org/918988 +From: Alfred Wingate +Date: Mon, 20 May 2024 22:02:08 +0300 +Subject: [PATCH] Do not use LFS shims, rely on _FILE_OFFSET_BITS=64 + +See https://savannah.gnu.org/bugs/?65751 and https://bugs.gentoo.org/918988 + +Setting _FILE_OFFSET_BITS=64 is enough to get the LFS interface, +using LFS shims is unnecessary on 64-bit systems and they may +not be available on 32-bit systems on glibc. + +Signed-off-by: Alfred Wingate +--- a/configure.ac ++++ b/configure.ac +@@ -547,10 +547,10 @@ AC_DEFINE_UNQUOTED(LIBCDIO_SOURCE_PATH, "$LIBCDIO_SOURCE_PATH", + [Full path to libcdio top_sourcedir.]) + AC_SUBST(LIBCDIO_SOURCE_PATH) + +-AC_CHECK_FUNCS( [chdir drand48 fseeko fseeko64 ftruncate geteuid getgid \ +- getuid getpwuid gettimeofday lseek64 lstat memcpy memset mkstemp rand \ +- seteuid setegid snprintf setenv strndup unsetenv tzset sleep \ +- _stati64 usleep vsnprintf readlink realpath gmtime_r localtime_r] ) ++AC_CHECK_FUNCS( [chdir drand48 fseeko ftruncate geteuid getgid getuid \ ++ getpwuid gettimeofday lstat memcpy memset mkstemp rand seteuid \ ++ setegid snprintf setenv strndup unsetenv tzset sleep _stati64 \ ++ usleep vsnprintf readlink realpath gmtime_r localtime_r] ) + + # check for timegm() support + AC_CHECK_FUNC(timegm, AC_DEFINE(HAVE_TIMEGM,1, +--- a/lib/driver/_cdio_generic.c ++++ b/lib/driver/_cdio_generic.c +@@ -55,16 +55,6 @@ + #define PATH_MAX 4096 + #endif + +-/* If available and LFS is enabled, try to use lseek64 */ +-#if defined(HAVE_LSEEK64) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) +-#if defined(_MSC_VER) +-#include +-#endif +-#define CDIO_LSEEK lseek64 +-#else +-#define CDIO_LSEEK lseek +-#endif +- + /*! + Eject media -- there's nothing to do here. We always return -2. + Should we also free resources? +@@ -170,7 +160,7 @@ off_t + cdio_generic_lseek (void *user_data, off_t offset, int whence) + { + generic_img_private_t *p_env = user_data; +- return CDIO_LSEEK(p_env->fd, offset, whence); ++ return lseek(p_env->fd, offset, whence); + } + + /*! +--- a/lib/driver/_cdio_stdio.c ++++ b/lib/driver/_cdio_stdio.c +@@ -47,11 +47,7 @@ + #include "_cdio_stdio.h" + #include "cdio_assert.h" + +-/* On 32 bit platforms, fseek can only access streams of 2 GB or less. +- Prefer fseeko/fseeko64, that take a 64 bit offset when LFS is enabled */ +-#if defined(HAVE_FSEEKO64) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) +-#define CDIO_FSEEK fseeko64 +-#elif defined(HAVE_FSEEKO) ++#if defined(HAVE_FSEEKO) + #define CDIO_FSEEK fseeko + #else + #define CDIO_FSEEK fseek +-- +2.45.1 +