Package: libdata-messagepack-stream-perl / 1.04+ds-1

use-packaged-msgpack.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Description: Use packaged msgpack
 Remove from builder/MyBuilder.pm the code to build the msgpack source code
 included in the upstream source. Link to the binary from the libmsgpack
 package instead.
Forwarded: not-needed
Author: Christopher Hoskin <christopher.hoskin@gmail.com>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2018-08-06

--- a/builder/MyBuilder.pm
+++ b/builder/MyBuilder.pm
@@ -10,52 +10,10 @@
     my ($class, %argv) = @_;
     $class->SUPER::new(
         %argv,
-        include_dirs => [catdir('msgpack-1.4.2', 'include')],
+        extra_linker_flags => ['-lmsgpackc'],
         generate_ppport_h => catfile('lib', 'Data', 'MessagePack', 'ppport.h'),
         cc_warnings => 1,
     );
 }
 
-sub _set_mtime {
-    my $self = shift;
-    open my $fh, "<", "builder/mtime.txt" or die;
-    while (my $line = <$fh>) {
-        next if $line =~ /^#/ || $line !~ /\S/;
-        chomp $line;
-        my ($file, $mtime) = split /\t/, $line, 2;
-        $file = catfile(split /\//, $file);
-        die "miss $file" if !-e $file;
-        utime $mtime, $mtime, $file or die "utime $mtime, $mtime, $file: $!";
-    }
-}
-
-sub _build_msgpack {
-    my $self = shift;
-
-    # We should restore original mtime in msgpack-1.4.2.tar.gz; otherwise end-users might be asked for having automake tools.
-    $self->_set_mtime;
-
-    my @opt = ('--disable-shared');
-    push @opt, '--with-pic' if Config->myconfig =~ /(amd64|x86_64)/i;
-
-    chdir "msgpack-1.4.2";
-    my $ok = $self->do_system("./configure", @opt);
-    $ok &&= $self->do_system($Config{make});
-    chdir "..";
-    $ok;
-}
-
-sub ACTION_code {
-    my ($self, @argv) = @_;
-
-    my $spec = $self->_infer_xs_spec(catfile("lib", "Data", "MessagePack", "Stream.xs"));
-    my $archive = catfile("msgpack-1.4.2", "src", ".libs", "libmsgpackc.a");
-    if (!$self->up_to_date($archive, $spec->{lib_file})) {
-        $self->_build_msgpack or die;
-        push @{$self->{properties}{objects}}, $archive; # XXX
-    }
-
-    $self->SUPER::ACTION_code(@argv);
-}
-
 1;