File tree Expand file tree Collapse file tree 12 files changed +47
-24
lines changed Expand file tree Collapse file tree 12 files changed +47
-24
lines changed Original file line number Diff line number Diff line change 1
1
# Paths to packages
2
2
GO =$(shell which go)
3
+ DOCKER =$(shell which docker)
3
4
4
5
# Paths to locations, etc
5
6
BUILD_DIR := "build"
6
7
CMD_DIR := $(filter-out cmd/README.md, $(wildcard cmd/* ) )
7
8
8
9
# Build flags
9
- BUILD_MODULE = "github.com/mutablelogic/go-media"
10
+ BUILD_MODULE := $( shell go list -m)
10
11
BUILD_LD_FLAGS += -X $(BUILD_MODULE ) /pkg/config.GitSource=${BUILD_MODULE}
11
12
BUILD_LD_FLAGS += -X $(BUILD_MODULE ) /pkg/config.GitTag=$(shell git describe --tags)
12
13
BUILD_LD_FLAGS += -X $(BUILD_MODULE ) /pkg/config.GitBranch=$(shell git name-rev HEAD --name-only --always)
@@ -28,6 +29,15 @@ $(PLUGIN_DIR): FORCE
28
29
29
30
FORCE :
30
31
32
+ docker :
33
+ @echo Build docker image
34
+ @${DOCKER} build \
35
+ --tag go-media:$(shell git describe --tags) \
36
+ --build-arg PLATFORM=$(shell ${GO} env GOOS) \
37
+ --build-arg ARCH=$(shell ${GO} env GOARCH) \
38
+ --build-arg VERSION=kinetic \
39
+ -f etc/docker/Dockerfile .
40
+
31
41
test : clean dependencies
32
42
@echo Test sys/
33
43
@${GO} test ./sys/...
Original file line number Diff line number Diff line change 1
1
# recommended way to build is using:
2
2
# docker build \
3
- # --build-arg PLATFORM=linux --build-arg ARCH=amd64 --build-arg VERSION=bullseye \
3
+ # --build-arg PLATFORM=linux --build-arg ARCH=amd64 --build-arg VERSION=focal \
4
4
# -f etc/docker/Dockerfile .
5
5
#
6
+ # ${VERSION} should be "focal"
6
7
ARG PLATFORM
7
8
ARG ARCH
8
9
ARG VERSION
9
- FROM --platform=${PLATFORM}/${ARCH} golang:1.19-${VERSION} AS builder
10
+ FROM --platform=${PLATFORM}/${ARCH} ubuntu:${VERSION} AS builder
11
+
12
+ # update the base packages
13
+ ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/Berlin"
14
+ RUN apt-get update -y && apt-get upgrade -y
15
+
16
+ # install packages
17
+ RUN apt-get install -y apt-utils golang make pkg-config ca-certificates lsb-release software-properties-common
18
+
19
+ # install other build dependencies
20
+ # note we need to install ffmpeg 4 from a different repo for bionic
21
+ RUN apt-get install -y \
22
+ libavcodec-dev libavdevice-dev libavfilter-dev \
23
+ libavformat-dev libswresample-dev libavutil-dev libchromaprint-dev
10
24
11
25
# Run makefile to build command-line tools
12
26
WORKDIR /usr/src/app
Original file line number Diff line number Diff line change 1
- // + build dvb
1
+ //go: build dvb
2
2
3
3
package dvb
4
4
Original file line number Diff line number Diff line change 1
- // + build dvb
1
+ //go: build dvb
2
2
3
3
package dvb_test
4
4
5
5
import (
6
+ "github.com/mutablelogic/go-media/sys/dvb"
6
7
"testing"
7
-
8
- "github.com/djthorpe/gopi/v3/pkg/sys/dvb"
9
8
)
10
9
11
10
func Test_Demux_000 (t * testing.T ) {
Original file line number Diff line number Diff line change 1
- // + build dvb
1
+ //go: build dvb
2
2
3
3
package dvb
4
4
@@ -10,8 +10,6 @@ import (
10
10
"strings"
11
11
"syscall"
12
12
"unsafe"
13
-
14
- "github.com/djthorpe/gopi/v3"
15
13
)
16
14
17
15
////////////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change 1
- // + build dvb
1
+ //go: build dvb
2
2
3
3
package dvb_test
4
4
5
5
import (
6
+ "github.com/mutablelogic/go-media/sys/dvb"
6
7
"os"
7
8
"testing"
8
-
9
- "github.com/djthorpe/gopi/v3/pkg/sys/dvb"
10
9
)
11
10
12
11
func Test_Device_000 (t * testing.T ) {
Original file line number Diff line number Diff line change 1
- // + build dvb
1
+ //go: build dvb
2
2
3
3
package dvb
4
4
Original file line number Diff line number Diff line change 1
- // + build dvb
1
+ //go: build dvb
2
2
3
3
package dvb_test
4
4
5
5
import (
6
+ "github.com/mutablelogic/go-media/sys/dvb"
6
7
"os"
7
8
"testing"
8
9
"time"
9
-
10
- "github.com/djthorpe/gopi/v3/pkg/sys/dvb"
11
10
)
12
11
13
12
func Test_Frontend_000 (t * testing.T ) {
Original file line number Diff line number Diff line change
1
+ //go:build dvb
2
+
1
3
package dvb
2
4
3
5
import (
Original file line number Diff line number Diff line change 1
- // + build dvb
1
+ //go: build dvb
2
2
3
3
package dvb_test
4
4
You can’t perform that action at this time.
0 commit comments