diff options
author | Mike Sullivan <mksully22@gmail.com> | 2019-04-05 13:56:49 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2019-04-08 09:41:28 +0000 |
commit | 24047c7f5bc3ca5ee8c1f3d00bc516f48d580a65 (patch) | |
tree | cbebd9a7a8acc62a5f0a2b6bd6d630758ee1fb9a /non-free | |
parent | 7c60dff865044cdaefa1596d7e64872a3dc111fa (diff) | |
download | alpine_aports-24047c7f5bc3ca5ee8c1f3d00bc516f48d580a65.tar.bz2 alpine_aports-24047c7f5bc3ca5ee8c1f3d00bc516f48d580a65.tar.xz alpine_aports-24047c7f5bc3ca5ee8c1f3d00bc516f48d580a65.zip |
non-free/mongodb-tools: fix build error in pcap.go use C.struct, not _Ctype_struct
Diffstat (limited to 'non-free')
-rw-r--r-- | non-free/mongodb-tools/APKBUILD | 4 | ||||
-rw-r--r-- | non-free/mongodb-tools/fix-cstruct-decls.patch | 78 |
2 files changed, 81 insertions, 1 deletions
diff --git a/non-free/mongodb-tools/APKBUILD b/non-free/mongodb-tools/APKBUILD index a9b93677b7..fb5fd2d17a 100644 --- a/non-free/mongodb-tools/APKBUILD +++ b/non-free/mongodb-tools/APKBUILD | |||
@@ -2,7 +2,7 @@ | |||
2 | # Maintainer: Marc Vertes <mvertes@free.fr> | 2 | # Maintainer: Marc Vertes <mvertes@free.fr> |
3 | pkgname=mongodb-tools | 3 | pkgname=mongodb-tools |
4 | pkgver=4.0.6 | 4 | pkgver=4.0.6 |
5 | pkgrel=0 | 5 | pkgrel=1 |
6 | pkgdesc="The MongoDB tools provide import, export, and diagnostic capabilities." | 6 | pkgdesc="The MongoDB tools provide import, export, and diagnostic capabilities." |
7 | url="https://github.com/mongodb/mongo-tools" | 7 | url="https://github.com/mongodb/mongo-tools" |
8 | arch="all !s390x !aarch64" | 8 | arch="all !s390x !aarch64" |
@@ -10,6 +10,7 @@ license="Apache" | |||
10 | makedepends="$depends_dev go cyrus-sasl-dev openssl-dev libpcap-dev bash perl" | 10 | makedepends="$depends_dev go cyrus-sasl-dev openssl-dev libpcap-dev bash perl" |
11 | options="!check" | 11 | options="!check" |
12 | source="$pkgname-$pkgver.tar.gz::https://github.com/mongodb/mongo-tools/archive/r$pkgver.tar.gz | 12 | source="$pkgname-$pkgver.tar.gz::https://github.com/mongodb/mongo-tools/archive/r$pkgver.tar.gz |
13 | fix-cstruct-decls.patch | ||
13 | fix-build.patch | 14 | fix-build.patch |
14 | " | 15 | " |
15 | builddir="$srcdir/src/github.com/mongodb/mongo-tools" | 16 | builddir="$srcdir/src/github.com/mongodb/mongo-tools" |
@@ -35,4 +36,5 @@ package() { | |||
35 | } | 36 | } |
36 | 37 | ||
37 | sha512sums="d6185d7442a593d29db78889c55aba53e070bedd522d78d8c0bf52bb27f26c5fee6d010457f65774ea36a2e6d5280f38c95433ff76ed53ed9d74b1c811198cb7 mongodb-tools-4.0.6.tar.gz | 38 | sha512sums="d6185d7442a593d29db78889c55aba53e070bedd522d78d8c0bf52bb27f26c5fee6d010457f65774ea36a2e6d5280f38c95433ff76ed53ed9d74b1c811198cb7 mongodb-tools-4.0.6.tar.gz |
39 | e95ff1c3583ad8c3c4b8f14c6743fe8a5029c91e83b78bc33eae762d1d3aa48a6536c5b27183fca81b93034f4f3d91d23fef857a1f85f725d57f3a45a599fedf fix-cstruct-decls.patch | ||
38 | 74e432b354fd75209b87461e54f79a173ba0d647a2e45a48d520ee9342236b6a50ef1c634312f4804402578b8534d59ebf10973ce90cae2bbe76407102f2b404 fix-build.patch" | 40 | 74e432b354fd75209b87461e54f79a173ba0d647a2e45a48d520ee9342236b6a50ef1c634312f4804402578b8534d59ebf10973ce90cae2bbe76407102f2b404 fix-build.patch" |
diff --git a/non-free/mongodb-tools/fix-cstruct-decls.patch b/non-free/mongodb-tools/fix-cstruct-decls.patch new file mode 100644 index 0000000000..87d332c5b5 --- /dev/null +++ b/non-free/mongodb-tools/fix-cstruct-decls.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | --- a/vendor/github.com/google/gopacket/pcap/pcap.go | ||
2 | +++ b/vendor/github.com/google/gopacket/pcap/pcap.go | ||
3 | @@ -170,7 +170,7 @@ | ||
4 | // BPF is a compiled filter program, useful for offline packet matching. | ||
5 | type BPF struct { | ||
6 | orig string | ||
7 | - bpf _Ctype_struct_bpf_program // takes a finalizer, not overriden by outsiders | ||
8 | + bpf C.struct_bpf_program // takes a finalizer, not overriden by outsiders | ||
9 | } | ||
10 | |||
11 | // BPFInstruction is a byte encoded structure holding a BPF instruction | ||
12 | @@ -381,7 +381,7 @@ | ||
13 | |||
14 | // Stats returns statistics on the underlying pcap handle. | ||
15 | func (p *Handle) Stats() (stat *Stats, err error) { | ||
16 | - var cstats _Ctype_struct_pcap_stat | ||
17 | + var cstats C.struct_pcap_stat | ||
18 | if -1 == C.pcap_stats(p.cptr, &cstats) { | ||
19 | return nil, p.Error() | ||
20 | } | ||
21 | @@ -418,7 +418,7 @@ | ||
22 | return datalinks, nil | ||
23 | } | ||
24 | |||
25 | -func (p *Handle) compileBPFFilter(expr string) (_Ctype_struct_bpf_program, error) { | ||
26 | +func (p *Handle) compileBPFFilter(expr string) (C.struct_bpf_program, error) { | ||
27 | errorBuf := (*C.char)(C.calloc(errorBufferSize, 1)) | ||
28 | defer C.free(unsafe.Pointer(errorBuf)) | ||
29 | |||
30 | @@ -441,7 +441,7 @@ | ||
31 | } | ||
32 | } | ||
33 | |||
34 | - var bpf _Ctype_struct_bpf_program | ||
35 | + var bpf C.struct_bpf_program | ||
36 | cexpr := C.CString(expr) | ||
37 | defer C.free(unsafe.Pointer(cexpr)) | ||
38 | |||
39 | @@ -459,7 +459,7 @@ | ||
40 | return nil, err | ||
41 | } | ||
42 | |||
43 | - bpfInsn := (*[bpfInstructionBufferSize]_Ctype_struct_bpf_insn)(unsafe.Pointer(bpf.bf_insns))[0:bpf.bf_len:bpf.bf_len] | ||
44 | + bpfInsn := (*[bpfInstructionBufferSize]C.struct_bpf_insn)(unsafe.Pointer(bpf.bf_insns))[0:bpf.bf_len:bpf.bf_len] | ||
45 | bpfInstruction := make([]BPFInstruction, len(bpfInsn), len(bpfInsn)) | ||
46 | |||
47 | for i, v := range bpfInsn { | ||
48 | @@ -535,7 +535,7 @@ | ||
49 | |||
50 | return nil | ||
51 | } | ||
52 | -func bpfInstructionFilter(bpfInstructions []BPFInstruction) (bpf _Ctype_struct_bpf_program, err error) { | ||
53 | +func bpfInstructionFilter(bpfInstructions []BPFInstruction) (bpf C.struct_bpf_program, err error) { | ||
54 | if len(bpfInstructions) < 1 { | ||
55 | return bpf, errors.New("bpfInstructions must not be empty") | ||
56 | } | ||
57 | @@ -548,7 +548,7 @@ | ||
58 | cbpfInsns := C.calloc(C.size_t(len(bpfInstructions)), C.size_t(unsafe.Sizeof(bpfInstructions[0]))) | ||
59 | |||
60 | copy((*[bpfInstructionBufferSize]BPFInstruction)(cbpfInsns)[0:len(bpfInstructions)], bpfInstructions) | ||
61 | - bpf.bf_insns = (*_Ctype_struct_bpf_insn)(cbpfInsns) | ||
62 | + bpf.bf_insns = (*C.struct_bpf_insn)(cbpfInsns) | ||
63 | |||
64 | return | ||
65 | } | ||
66 | @@ -656,10 +656,10 @@ | ||
67 | return | ||
68 | } | ||
69 | |||
70 | -func findalladdresses(addresses *_Ctype_struct_pcap_addr) (retval []InterfaceAddress) { | ||
71 | +func findalladdresses(addresses *C.struct_pcap_addr) (retval []InterfaceAddress) { | ||
72 | // TODO - make it support more than IPv4 and IPv6? | ||
73 | retval = make([]InterfaceAddress, 0, 1) | ||
74 | - for curaddr := addresses; curaddr != nil; curaddr = (*_Ctype_struct_pcap_addr)(curaddr.next) { | ||
75 | + for curaddr := addresses; curaddr != nil; curaddr = (*C.struct_pcap_addr)(curaddr.next) { | ||
76 | // Strangely, it appears that in some cases, we get a pcap address back from | ||
77 | // pcap_findalldevs with a nil .addr. It appears that we can skip over | ||
78 | // these. | ||