Skip to content

Commit

Permalink
link libpcap statically
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwinger233 committed Jun 19, 2023
1 parent 2b5bf59 commit edfca60
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.20

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@

tags
skbdump

dist/
7 changes: 6 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
before:
hooks:
- go mod download
- sudo apt-get install libpcap-dev
- sudo apt-get install -y curl unzip gcc flex bison make
- curl https://github.com/the-tcpdump-group/libpcap/archive/refs/tags/libpcap-1.10.4.zip -OL
- unzip libpcap-1.10.4.zip
- sh -c 'cd libpcap-libpcap-1.10.4/ && ./configure --enable-dbus=no && make && make install'

builds:
- id: skbdump
binary: skbdump
flags:
- -tags=static
goos:
- linux
goarch:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/jschwinger233/skbdump

go 1.19
go 1.20

require (
github.com/cilium/ebpf v0.10.0
Expand Down
2 changes: 1 addition & 1 deletion internal/bpf/pcap_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

/*
#cgo linux LDFLAGS: -lpcap
#cgo LDFLAGS: -L/usr/local/lib -lpcap -static
#include <stdlib.h>
#include <pcap.h>
*/
Expand Down

0 comments on commit edfca60

Please sign in to comment.