Skip to content

Draft: blake3: build libblake3-{0,dev} (Closes: #1107091)

наб requested to merge nabijaczleweli/debcargo-conf:master into master

Draft because:

  1. I'm injecting additional d/control lines in repackage.sh; I haven't found the debcargo hook that would let me do it

override_dh_auto_install:
	sed -i.bkp '/Package: libblake3-dev/,$$s/^/#/' debian/control
	dh_auto_install
	mv debian/control.bkp debian/control

this is required because

sub install {
    my $this=shift;
    my $destdir=shift;
    my $crate = $this->{crate} . '-' . ($this->{version} =~ tr/~/-/r);
    if ($this->{libpkg}) {
        my $target = tmpdir($this->{libpkg}) . "/usr/share/cargo/registry/$crate";
        my @sources = $this->get_sources();
        install_dir($target);
        doit("cp", "--parents", "-at", $target, @sources);
        doit("rm", "-rf", "$target/target");
        doit("cp", "debian/cargo-checksum.json", "$target/.cargo-checksum.json");
        # prevent an ftpmaster auto-reject regarding files with old dates.
        doit("touch", "-d@" . $ENV{SOURCE_DATE_EPOCH}, "$target/Cargo.toml");
    }
    foreach my $pkg (@{$this->{featurepkg}}) {
        my $target = tmpdir($pkg) . "/usr/share/doc";
        install_dir($target);
        make_symlink_raw_target($this->{libpkg}, "$target/$pkg");
    }
    if ($this->{binpkg}) {
        # Do the install
        my $destdir = $ENV{'DESTDIR'} || tmpdir($this->{binpkg});
        doit("env", "DESTDIR=$destdir",
             "/usr/share/cargo/bin/cargo", "install", @_);
        # generate Built-Using fields
        doit("env", "/usr/share/cargo/bin/dh-cargo-built-using", $this->{binpkg});
    }
}
/usr/share/perl5/Debian/Debhelper/Buildsystem/cargo.pm: unmodified: line 144 of 206 [69%]

and

    foreach my $package (@packages) {
        my $pkg = $package->{Package};
        if ($pkg =~ /^libru[sz]t-.*-dev$/) {
            # ...
        } elsif ($package->{Architecture} ne 'all') {
            $this->{binpkg} = $pkg;
        }
    }

so if we don't do this then dh_auto_install always runs cargo install which fails so this should get decided differently maybe.

As an alternative, I have started prepping an out-of-tree implementation, but there's a debcargo generates heaps upon heaps of code and the real value-change is the 10 lines we see in this diff.

Cc: @fg

Edited by наб

Merge request reports

Loading