[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#872325: qtdeclarative-opensource-src: packages shipping qmlc files should have a stricter dependency on libqt5qml5



Source: qtdeclarative-opensource-src
Version: 5.9.1-5
Severity: important

Some time ago I received a private message from Alexander Volkov mentioning
this problem, but it got lost in my mailbox and I remembered about it only
now (sorry for that).

Packages shipping the .qmlc files (such as qtgraphicaleffects, qtquickcontrols
and qtquickcontrols2 QML modules) work only when the same upstream version of
libqt5qml5 that they were built against.

I am attaching a script I received from Alexander which adds such dependency
to ${shlibs:Depends} if .qmlc files are present in the package.

--
Dmitry Shachnev
#!/usr/bin/perl

use strict;
use warnings;
use Cwd;
use Debian::Debhelper::Dh_Lib;
use Dpkg::Substvars;
use Dpkg::Version;

init(options => {});

foreach my $package (@{$dh{DOPACKAGES}}) {
	my $tmp=tmpdir($package);
	my $ext=pkgext($package);
	my (@filelist, $ff);

	foreach my $file (split(/\n/,`find $tmp -type f -name "*.qmlc" -print -quit`)) {
		push @filelist,$file;
	}

	if (@filelist) {
		my $substvars = Dpkg::Substvars->new();
		my $varnameprefix = 'shlibs';
		my $varlistfile = "debian/${ext}substvars";
		my $varlistfilenew = "$varlistfile.new";
		my $depfield = 'Depends';
		my $vs = Dpkg::Version->new(`dpkg-query -f='\${Version}' -W libqt5qml5 2>/dev/null`, check => 1);
		if (not defined $vs) {
			error(g_('libqt5qml5 is missing, can\'t calculate dependency for qmlc files'));
		}
		my $uvs = $vs->as_string(omit_revision => 1);
		my @uvsdigits = version_split_digits($uvs);
		my $uvsnext = join "", @uvsdigits[0 .. $#uvsdigits-1], $uvsdigits[-1] + 1;
		$substvars->load($varlistfile) if -e $varlistfile;
		my $oldshlibs = $substvars->get("$varnameprefix:$depfield");
		my $newshlibs = "libqt5qml5 (>= $uvs), libqt5qml5 (<< $uvsnext)" . ($oldshlibs eq "" ? "" : ", ") . $oldshlibs;
		$substvars->set_as_used("$varnameprefix:$depfield", $newshlibs);
		$substvars->save($varlistfilenew);
		rename $varlistfilenew, $varlistfile
			or syserr(g_("install new varlist file '%s'"), $varlistfile);
	}
}

Attachment: signature.asc
Description: PGP signature


Reply to: