From e4c05f8cbcc60ac07c0f0bc234e26471a7ccc4cd Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 20 Feb 2022 17:40:19 -0500 Subject: [PATCH] games/naev: Fix 15.0 build. Signed-off-by: B. Watson --- games/naev/bfd.diff | 19 +++++++++++++++++++ games/naev/naev.SlackBuild | 34 +++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 games/naev/bfd.diff diff --git a/games/naev/bfd.diff b/games/naev/bfd.diff new file mode 100644 index 0000000000..7f7c1ac466 --- /dev/null +++ b/games/naev/bfd.diff @@ -0,0 +1,19 @@ +diff -Naur naev-0.7.0/src/naev.c naev-0.7.0.patched/src/naev.c +--- naev-0.7.0/src/naev.c 2017-07-15 18:51:22.000000000 -0400 ++++ naev-0.7.0.patched/src/naev.c 2022-02-20 17:32:49.060133407 -0500 +@@ -1375,12 +1375,11 @@ + asection *section; + + for (section = abfd->sections; section != NULL; section = section->next) { +- if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0) ++ if ((bfd_section_flags(section) & SEC_ALLOC) == 0) + continue; + +- bfd_vma vma = bfd_get_section_vma(abfd, section); +- bfd_size_type size = bfd_get_section_size(section); +- if (address < vma || address >= vma + size) ++ bfd_vma vma = bfd_section_vma(section); ++ if (address < vma || address >= vma + bfd_section_size(section)) + continue; + + if (!bfd_find_nearest_line(abfd, section, syms, address - vma, diff --git a/games/naev/naev.SlackBuild b/games/naev/naev.SlackBuild index eacd4496c3..a19a38bdbe 100644 --- a/games/naev/naev.SlackBuild +++ b/games/naev/naev.SlackBuild @@ -21,11 +21,16 @@ # see fit. Or as I see fit. Or as I fit. Although # that is unlikely, as I am rather tall. +# 20220220 bkw: Modified by SlackBuilds.org, BUILD=2: +# - fix build on 15.0. +# - binary in /usr/games. +# - absolute paths in .desktop. + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=naev VERSION=${VERSION:-0.7.0} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -37,9 +42,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -71,18 +73,25 @@ cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \ - -exec chmod 755 {} \; -o \ + -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; + -exec chmod 644 {} \+ mkdir -p $PKG/usr/share/$PRGNAM cat $CWD/$PRGNAM-$VERSION-ndata.zip > $PKG/usr/share/$PRGNAM/ndata +# 20220220 bkw: recent binutils API changes. patch based on: +# https://707852.bugs.gentoo.org/attachment.cgi?id=611192 +patch -p1 < $CWD/bfd.diff + +SLKCFLAGS+=" -fcommon" + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ LDFLAGS="-lm -lvorbis" \ ./configure \ --prefix=/usr \ + --bindir=/usr/games \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ @@ -92,15 +101,14 @@ LDFLAGS="-lm -lvorbis" \ --build=$ARCH-slackware-linux make -make install DESTDIR=$PKG - -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true - -find $PKG/usr/man -type f -exec gzip -9 {} \; +make install-strip DESTDIR=$PKG +gzip -9 $PKG/usr/man/man*/* mkdir -p $PKG/usr/share/applications -cat $TMP/$PRGNAM-$VERSION/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop +sed -e '/^Icon/s,=.*,=/usr/share/pixmaps/naev.png,' \ + -e '/^Exec/s,=,=/usr/games/,' \ + < $PRGNAM.desktop \ + > $PKG/usr/share/applications/$PRGNAM.desktop mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a AUTHORS LICENSE README TODO \