diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Debian/Debhelper/Buildsystem/cmake.pm | 10 | ||||
-rw-r--r-- | lib/Debian/Debhelper/Buildsystem/perl_makemaker.pm | 7 | ||||
-rw-r--r-- | lib/Debian/Debhelper/Dh_Lib.pm | 68 | ||||
-rw-r--r-- | lib/Debian/Debhelper/Sequence/root_sequence.pm | 22 | ||||
-rw-r--r-- | lib/Debian/Debhelper/SequencerUtil.pm | 7 |
5 files changed, 96 insertions, 18 deletions
diff --git a/lib/Debian/Debhelper/Buildsystem/cmake.pm b/lib/Debian/Debhelper/Buildsystem/cmake.pm index cafc743..42e4cac 100644 --- a/lib/Debian/Debhelper/Buildsystem/cmake.pm +++ b/lib/Debian/Debhelper/Buildsystem/cmake.pm @@ -79,9 +79,15 @@ sub new { return $this; } +sub _get_pkgconf { + my $toolprefix = is_cross_compiling() ? dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-" : ""; + return "/usr/bin/" . $toolprefix . "pkg-config"; +} + sub _get_cmake_env { my $update_env = {}; $update_env->{DEB_PYTHON_INSTALL_LAYOUT} = 'deb' unless $ENV{DEB_PYTHON_INSTALL_LAYOUT}; + $update_env->{PKG_CONFIG} = _get_pkgconf() unless $ENV{PKG_CONFIG}; return $update_env; } @@ -129,8 +135,8 @@ sub configure { if (not $ENV{CXX}) { push @flags, "-DCMAKE_CXX_COMPILER=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-g++"; } - push(@flags, "-DPKG_CONFIG_EXECUTABLE=/usr/bin/" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-pkg-config"); - push(@flags, "-DPKGCONFIG_EXECUTABLE=/usr/bin/" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-pkg-config"); + push(@flags, "-DPKG_CONFIG_EXECUTABLE=" . _get_pkgconf()); + push(@flags, "-DPKGCONFIG_EXECUTABLE=" . _get_pkgconf()); push(@flags, "-DQMAKE_EXECUTABLE=/usr/bin/" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-qmake"); } push(@flags, "-DCMAKE_INSTALL_LIBDIR=lib/" . dpkg_architecture_value("DEB_HOST_MULTIARCH")); diff --git a/lib/Debian/Debhelper/Buildsystem/perl_makemaker.pm b/lib/Debian/Debhelper/Buildsystem/perl_makemaker.pm index 881f1ec..efb01d2 100644 --- a/lib/Debian/Debhelper/Buildsystem/perl_makemaker.pm +++ b/lib/Debian/Debhelper/Buildsystem/perl_makemaker.pm @@ -32,6 +32,12 @@ sub check_auto_buildable { return 0; } +sub _get_pkgconf { + my $toolprefix = is_cross_compiling() ? dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-" : ""; + return "/usr/bin/" . $toolprefix . "pkg-config"; +} + + sub new { my $class=shift; my $this=$class->SUPER::new(@_); @@ -66,6 +72,7 @@ sub configure { if is_cross_compiling() and defined $cross_flag; push @flags, "LD=$ld $ENV{CFLAGS} $ENV{LDFLAGS}"; } + $ENV{"PKG_CONFIG"} = _get_pkgconf() if not exists($ENV{"PKG_CONFIG"}); push(@perl_flags, '-I.') if compat(10); diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm index cdc1686..d4ef875 100644 --- a/lib/Debian/Debhelper/Dh_Lib.pm +++ b/lib/Debian/Debhelper/Dh_Lib.pm @@ -1068,7 +1068,46 @@ sub default_sourcedir { sub pkgfile { # NB: $nameless_variant_handling is an implementation-detail; third-party packages # should not rely on it. - my ($package, $filename, $nameless_variant_handling) = @_; + my ($opts, $package, $filename); + my ($nameless_variant_handling, $named, $support_architecture_restriction, $is_bulk_check); + + # !!NOT A PART OF THE PUBLIC API!! + # Bulk test used by dh to speed up the can_skip check. It + # is NOT useful for finding the most precise pkgfile. + + if (ref($_[0]) eq 'HASH') { + ($opts, $package, $filename) = @_; + $is_bulk_check = ref($package) eq 'ARRAY'; + if ($is_bulk_check) { + # If `dh` does not have declarative hints to go by, then it must assume all + # variants are possible + $named = 1; + $support_architecture_restriction = 1; + } + + $nameless_variant_handling = $opts->{'internal-nameless-variant-handling'} + if exists($opts->{'internal-nameless-variant-handling'}); + $named = $opts->{'named'} if exists($opts->{'named'}); + $support_architecture_restriction = $opts->{'support-architecture-restriction'} + if exists($opts->{'support-architecture-restriction'}); + } else { + ($package, $filename) = @_; + + $is_bulk_check = ref($package) eq 'ARRAY'; + if ($is_bulk_check) { + # If `dh` does not have declarative hints to go by, then it must assume all + # variants are possible + $named = 1; + $support_architecture_restriction = 1; + } + } + + if (compat(13)) { + # Before compat 14, these were unconditionally on. + $named = 1; + $support_architecture_restriction = 1; + } + my (@try, $check_expensive); if (not exists($_check_expensive{$filename})) { @@ -1093,11 +1132,11 @@ sub default_sourcedir { # globally or not. But if someone is being "clever" then the # cache is reusable and for the general/normal case, it has no # adverse effects. - if (defined $dh{NAME}) { + if (defined $dh{NAME} and $opts->{'named'}) { $filename="$dh{NAME}.$filename"; } - if (ref($package) eq 'ARRAY') { + if ($is_bulk_check) { # !!NOT A PART OF THE PUBLIC API!! # Bulk test used by dh to speed up the can_skip check. It # is NOT useful for finding the most precise pkgfile. @@ -1115,7 +1154,7 @@ sub default_sourcedir { } else { # Avoid checking for hostarch+hostos unless we have reason # to believe that they exist. - if ($check_expensive) { + if ($check_expensive and $opts->{'support-architecture-restriction'}) { my $cross_type = uc(package_cross_type($package)); push(@try, "debian/${package}.${filename}.".dpkg_architecture_value("DEB_${cross_type}_ARCH"), @@ -1189,7 +1228,17 @@ sub isnative { } # Make sure we look at the correct changelog. - my $isnative_changelog = pkgfile($package, 'changelog', 0); + local $dh{NAME}; + delete($dh{NAME}); + my $isnative_changelog = pkgfile( + { + 'internal-nameless-variant-handling' => 0, + 'named' => 0, + 'support-architecture-restriction' => 0, + }, + $package, + 'changelog', + ); if (! $isnative_changelog) { $isnative_changelog = "debian/changelog"; $cache_key = '_source'; @@ -2402,7 +2451,14 @@ sub debhelper_script_subst { my $tmp=tmpdir($package); my $ext=pkgext($package); - my $file=pkgfile($package,$script); + my $file = pkgfile( + { + 'named' => 0, + 'support-architecture-restriction' => 0, + }, + $package, + $script, + ); my %variables = defined($extra_vars) ? %{$extra_vars} : (); my $service_script = generated_file($package, "${script}.service", 0); my @generated_scripts = ("debian/$ext$script.debhelper", $service_script); diff --git a/lib/Debian/Debhelper/Sequence/root_sequence.pm b/lib/Debian/Debhelper/Sequence/root_sequence.pm index 45d908c..0f1f489 100644 --- a/lib/Debian/Debhelper/Sequence/root_sequence.pm +++ b/lib/Debian/Debhelper/Sequence/root_sequence.pm @@ -79,20 +79,28 @@ qw{ qw{ dh_installwm dh_installxfonts - dh_strip_nondeterminism - dh_compress - dh_fixperms - dh_missing -}); +}, (!compat(13) ? qw() : qw( + dh_strip_nondeterminism + dh_compress + dh_fixperms +)), + qw(dh_missing), +); # Looking for dh_dwz, dh_strip, dh_makeshlibs, dh_shlibdeps (et al)? They are # in the elf-tools addon. -my @b=qw{ +my @b = ( + (!compat(13) ? qw( + dh_fixperms + dh_strip_nondeterminism + dh_compress +) : qw()), +qw{ dh_installdeb dh_gencontrol dh_md5sums dh_builddeb -}; +}); _add_sequence('build', SEQUENCE_ARCH_INDEP_SUBSEQUENCES, @bd); _add_sequence('install', SEQUENCE_ARCH_INDEP_SUBSEQUENCES, to_rules_target("build"), @i); diff --git a/lib/Debian/Debhelper/SequencerUtil.pm b/lib/Debian/Debhelper/SequencerUtil.pm index b01e920..ae7483e 100644 --- a/lib/Debian/Debhelper/SequencerUtil.pm +++ b/lib/Debian/Debhelper/SequencerUtil.pm @@ -447,10 +447,11 @@ sub compute_selected_addons { if (compat(14, 1) && getpackages() == 1 && !exists($explicitly_managed{'single-binary'})) { if (not compat(13, 1)) { warning("Implicitly activating single-binary dh addon for backwards compatibility. In compat 14+,"); - warning("this fallback will *not* happen automatically and dh_auto_install will instead use a"); - warning("different default for --destdir, which can cause the source to produce an empty binary package"); + warning("this fallback will *not* happen automatically via dh_auto_install will instead use a"); + warning("different default for --destdir unless the single-binary add-on is active,"); + warning("which can cause the source to produce an empty binary package"); warning(); - warning('To keep the existing behaviour, please activate the single-binary addon explicitly.'); + warning('To keep the existing behaviour (compat 13), please activate the single-binary addon explicitly.'); warning('This can be done by adding "dh-sequence-single-binary" to Build-Depends or passing'); warning('--with=single-binary to dh.'); warning(); |