app-arch/xdms: respect DESTDIR, fix man dest, Darwin build

* EAPI 6->7
* Respect DESTDIR (similar patch to app-arch/cksfv, naturally)
* Fix VariableScope issue (${ED} in src_configure, see point 1)
* Fix man page destination
* Fix build on Darwin (append standard undefined lookup flag)

Bug: https://bugs.gentoo.org/721896
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2021-04-17 02:51:13 +01:00
parent 5ff3c2e4e0
commit c5a1059bbb
5 changed files with 76 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7

View File

@@ -0,0 +1,13 @@
From: Sam James <sam@gentoo.org>
Subject: [PATCH 2/2] Don't compress man pages
--- a/Makefile.in
+++ b/Makefile.in
@@ -11,5 +11,4 @@ install: xdms
install xdms.txt COPYING ChangeLog.txt ${DESTDIR}{PREFIX}/share/doc/xdms-{VERSION}/
chmod og+rx ${DESTDIR}{PREFIX}/bin ${DESTDIR}{PREFIX}/bin/xdms
chmod -R og+rX ${DESTDIR}{PREFIX}/share/doc/xdms-{VERSION}
- gzip < xdms.1 > xdms.1.gz
- install xdms.1.gz ${DESTDIR}{PREFIX}/share/man/man1/
+ install xdms.1 ${DESTDIR}{PREFIX}/share/man/man1/
--

View File

@@ -0,0 +1,22 @@
From: Sam James <sam@gentoo.org>
Subject: [PATCH 1/2] Respect DESTDIR
--- a/Makefile.in
+++ b/Makefile.in
@@ -6,10 +6,10 @@ clean:
$(MAKE) -C src clean
install: xdms
- mkdir -p {PREFIX}/bin {PREFIX}/share/doc/xdms-{VERSION} {PREFIX}/share/man/man1
- install src/xdms {PREFIX}/bin/
- install xdms.txt COPYING ChangeLog.txt {PREFIX}/share/doc/xdms-{VERSION}/
- chmod og+rx {PREFIX}/bin {PREFIX}/bin/xdms
- chmod -R og+rX {PREFIX}/share/doc/xdms-{VERSION}
+ mkdir -p ${DESTDIR}{PREFIX}/bin ${DESTDIR}{PREFIX}/share/doc/xdms-{VERSION} ${DESTDIR}{PREFIX}/share/man/man1
+ install src/xdms ${DESTDIR}{PREFIX}/bin/
+ install xdms.txt COPYING ChangeLog.txt ${DESTDIR}{PREFIX}/share/doc/xdms-{VERSION}/
+ chmod og+rx ${DESTDIR}{PREFIX}/bin ${DESTDIR}{PREFIX}/bin/xdms
+ chmod -R og+rX ${DESTDIR}{PREFIX}/share/doc/xdms-{VERSION}
gzip < xdms.1 > xdms.1.gz
- install xdms.1.gz {PREFIX}/share/man/man1/
+ install xdms.1.gz ${DESTDIR}{PREFIX}/share/man/man1/
--

View File

@@ -1,31 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit toolchain-funcs
DESCRIPTION="xDMS - Amiga DMS disk image decompressor"
HOMEPAGE="https://zakalwe.fi/~shd/foss/xdms"
SRC_URI="https://zakalwe.fi/~shd/foss/xdms/${P}.tar.bz2"
LICENSE="public-domain"
SLOT="0"
KEYWORDS="amd64 ~hppa ppc x86"
IUSE=""
pkg_setup() {
tc-export CC
}
src_prepare() {
default
sed -i Makefile.in \
-e "s:COPYING::" \
-e "s:share/doc/xdms-{VERSION}:share/doc/xdms-${PF}:" || die
sed -i -e "s:-O2::" src/Makefile.in || die
}
src_configure() {
./configure --prefix=/usr --package-prefix="${D}" || die
}

View File

@@ -0,0 +1,40 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit flag-o-matic toolchain-funcs
DESCRIPTION="xDMS - Amiga DMS disk image decompressor"
HOMEPAGE="https://zakalwe.fi/~shd/foss/xdms"
SRC_URI="https://zakalwe.fi/~shd/foss/xdms/${P}.tar.bz2"
LICENSE="public-domain"
SLOT="0"
KEYWORDS="amd64 ~hppa ppc x86"
PATCHES=(
"${FILESDIR}"/${PN}-1.3.2-respect-DESTDIR.patch
"${FILESDIR}"/${PN}-1.3.2-dont-compress-man-pages.patch
)
src_prepare() {
default
sed -i Makefile.in \
-e "s:COPYING::" \
-e "s:share/doc/xdms-{VERSION}:share/doc/${PF}:" || die
sed -i -e "s:-O2::" src/Makefile.in || die
}
src_configure() {
tc-export CC
if [[ ${CHOST} == *-darwin* ]] ; then
# Needed to avoid typical "Undefined symbols for architecture x86_64"
append-ldflags -undefined dynamic_lookup
fi
./configure --prefix="${EPREFIX}"/usr || die
}