Skip to content

Commit

Permalink
app-text/scdoc: fix cross-compile, prefix install.
Browse files Browse the repository at this point in the history
Cross-compiling (tested with a crossdev musl toolchain via
`PORTAGE_CONFIGROOT=/usr/x86_64-pc-linux-musl ebuild scdoc-1.3.1.ebuild ...`
currently fails because VERSION is not defined.

Installing in prefix fails due to files being installed outside of the
prefix. Pass PREFIX="${EPREFIX}/usr" on emake call.

Tested via building with `ebuild scdoc-1.3.1.ebuild ...` while inside a
prefix.

Signed-off-by: Marty E. Plummer <[email protected]>
Package-Manager: Portage-2.3.51, Repoman-2.3.11
Signed-off-by: Michał Górny <[email protected]>
  • Loading branch information
hanetzer authored and mgorny committed Oct 22, 2018
1 parent 3f97504 commit 01a332b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app-text/scdoc/scdoc-1.3.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,21 @@ src_prepare() {

sed -e 's/-Werror//' \
-e 's/CFLAGS=/CFLAGS+=/' \
-e '/^PREFIX/s@=.*$@=/usr@' \
-i Makefile || die 'Failed to patch Makefile'
}

src_compile() {
MY_HS="./scdoc"
local MY_HS="./scdoc"
if tc-is-cross-compiler; then
tc-export_build_env
MY_HS="./hostscdoc"
MAKEOPTS+=" HOST_SCDOC=./hostscdoc"
emake scdoc OUTDIR="${S}/.build.host" CC=$(tc-getBUILD_CC) \
CFLAGS="${BUILD_CFLAGS}" LDFLAGS="${BUILD_LDFLAGS}"
emake scdoc HOST_SCDOC="./hostscdoc" OUTDIR="${S}/.build.host" CC="$(tc-getBUILD_CC)" \
CFLAGS="${BUILD_CFLAGS} -DVERSION='\"${PV}\"'" LDFLAGS="${BUILD_LDFLAGS}"
mv scdoc hostscdoc || die 'Failed to rename host scdoc'
fi
emake LDFLAGS="${LDFLAGS}" HOST_SCDOC="${MY_HS}"
emake LDFLAGS="${LDFLAGS}" PREFIX="${EPREFIX}/usr" HOST_SCDOC="${MY_HS}"
}

src_install() {
emake DESTDIR="${D}" HOST_SCDOC="${MY_HS}" install
emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" HOST_SCDOC="${MY_HS}" install
}

0 comments on commit 01a332b

Please sign in to comment.