fix build-debug-info so that it works with MULTI_PACKAGES with distinct
PREFIX. Specifically: - stop tweaking PREFIX for build-debug-info - have build-debug-info use -B instead - generate Makefile with full paths - tweak the sequence in bsd.port.mk to NOT pass FAKE_SETUP around This fixes got
This commit is contained in:
parent
4f6822b7ff
commit
a6cd76d399
@ -1,5 +1,5 @@
|
||||
#! /usr/bin/perl
|
||||
# $OpenBSD: build-debug-info,v 1.36 2020/04/07 10:45:20 espie Exp $
|
||||
# $OpenBSD: build-debug-info,v 1.37 2020/04/08 09:15:39 espie Exp $
|
||||
# Copyright (c) 2019 Marc Espie <espie@openbsd.org>
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
@ -61,6 +61,12 @@ sub substclass
|
||||
return 'OpenBSD::Subst';
|
||||
}
|
||||
|
||||
sub handle_options
|
||||
{
|
||||
my $s = shift;
|
||||
$s->SUPER::handle_options;
|
||||
$s->{prefix} = "$s->{base}$s->{prefix}";
|
||||
}
|
||||
# Most of the heavy lifting is done by visitor methods, as always
|
||||
|
||||
package OpenBSD::PackingElement;
|
||||
@ -151,8 +157,8 @@ sub write_rule
|
||||
}
|
||||
print $fh $dbg, "\n";
|
||||
my $mk = $o->{mk};
|
||||
print $mk "all: $dbg\n";
|
||||
print $mk "$dbg: $s\n";
|
||||
print $mk "all: $o->{prefix}/$dbg\n";
|
||||
print $mk "$o->{prefix}/$dbg: $o->{prefix}/$s\n";
|
||||
print $mk "\t\@\$\{$what\}\n\n";
|
||||
$o->{ostash}{$dbg} = 1;
|
||||
delete $o->{empty};
|
||||
@ -230,7 +236,7 @@ PlistReader->parse_args($self);
|
||||
use File::Basename;
|
||||
$self->{mk} = $state->openfile($state->{pkgdir}."/Makefile.new");
|
||||
print {$self->{mk}} << 'EOPREAMBLE';
|
||||
# Makefile generated by build-debug-info $OpenBSD: build-debug-info,v 1.36 2020/04/07 10:45:20 espie Exp $
|
||||
# Makefile generated by build-debug-info $OpenBSD: build-debug-info,v 1.37 2020/04/08 09:15:39 espie Exp $
|
||||
# No serviceable parts
|
||||
# Intended to run under the stage area after cd ${WRKINST}
|
||||
|
||||
@ -264,7 +270,7 @@ $self->{ostash} = {};
|
||||
for my $l (@{$self->{lists}}) {
|
||||
$self->{empty} = 1;
|
||||
$self->{dirstash} = {};
|
||||
$self->{destdir} = $l->{state}{base};
|
||||
$self->{prefix} = $l->{state}{prefix};
|
||||
my $name = pop @{$l->{base_plists}};
|
||||
$name = $state->{pkgdir}."/".(basename $name);
|
||||
my $fh = $state->openfile($name);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#-*- mode: Makefile; tab-width: 4; -*-
|
||||
# ex:ts=4 sw=4 filetype=make:
|
||||
# $OpenBSD: bsd.port.mk,v 1.1532 2020/04/08 09:10:00 espie Exp $
|
||||
# $OpenBSD: bsd.port.mk,v 1.1533 2020/04/08 09:15:39 espie Exp $
|
||||
#
|
||||
# bsd.port.mk - 940820 Jordan K. Hubbard.
|
||||
# This file is in the public domain.
|
||||
@ -1186,7 +1186,7 @@ DESCR${_S} ?= ${PKGDIR}/DESCR${_S}
|
||||
.endif
|
||||
|
||||
|
||||
_EXCLUDE_DEBUG_PLISTS = ${_WRKDEBUG} ${_WRKDEBUG}/Makefile
|
||||
_EXCLUDE_DEBUG_PLISTS = ${_WRKDEBUG} ${_WRKDEBUG}/Makefile ${_WRKDEBUG}/Makefile.new
|
||||
|
||||
.for _S in ${MULTI_PACKAGES}
|
||||
PKG_ARGS${_S} += -A'${PKG_ARCH${_S}}'
|
||||
@ -2124,7 +2124,7 @@ ${_pkg_cookie${_S}}:
|
||||
@${_MAKE} ${_PACKAGE_COOKIE_DEPS}
|
||||
# What PACKAGE normally does:
|
||||
. if !empty(DEBUG_PACKAGES)
|
||||
@${_SUDOMAKESYS} _copy-debug-info ${FAKE_SETUP}
|
||||
@${_SUDOMAKESYS} _copy-debug-info
|
||||
. endif
|
||||
@${_MAKE} _internal-generate-readmes
|
||||
@${ECHO_MSG} "===> Building package for ${FULLPKGNAME${_S}}"
|
||||
@ -3003,9 +3003,9 @@ ${_WRKDEBUG}/Makefile: ${_FAKE_COOKIE}
|
||||
@${_build_debug_info}
|
||||
|
||||
_copy-debug-info: ${_FAKE_COOKIE} ${_WRKDEBUG}/Makefile
|
||||
@cd ${PREFIX} && \
|
||||
@cd ${WRKINST} && \
|
||||
exec ${SETENV} ${MAKE} -r -f ${_WRKDEBUG}/Makefile \
|
||||
PATH='${PATH}' DWZ='${DWZ}' \
|
||||
PATH='${PORTPATH}' DWZ='${DWZ}' \
|
||||
INSTALL_DATA_DIR='${INSTALL_DATA_DIR}' all
|
||||
|
||||
show-debug-info:
|
||||
|
Loading…
Reference in New Issue
Block a user