install go2rtc on bob
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
# Scripts
|
||||
|
||||
This folder contains a script for building binaries for all platforms.
|
||||
|
||||
The project has no `CGO` dependencies, so building is as simple as possible using the `go build` command.
|
||||
|
||||
The project has to use the latest versions of go due to dependencies on third-party go libraries. Such as `pion/webrtc` or `golang.org/x`. Unfortunately, this breaks compatibility with older versions of operating systems.
|
||||
|
||||
The project uses [UPX](https://github.com/upx/upx) to compress binaries for Linux. The project does not use compression for Windows due to false antivirus alarms. The project does not use compression for macOS due to broken result.
|
||||
|
||||
## Useful commands
|
||||
|
||||
```
|
||||
go get -u
|
||||
go mod tidy
|
||||
go mod why github.com/pion/rtcp
|
||||
go list -deps .\cmd\go2rtc_rtsp\
|
||||
./goweight
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
```
|
||||
- gopkg.in/yaml.v3
|
||||
- github.com/kr/pretty
|
||||
- github.com/AlexxIT/go2rtc/pkg/hap
|
||||
- github.com/tadglines/go-pkgs
|
||||
- golang.org/x/crypto
|
||||
- github.com/AlexxIT/go2rtc/pkg/mdns
|
||||
- github.com/miekg/dns
|
||||
- github.com/AlexxIT/go2rtc/pkg/pcm
|
||||
- github.com/sigurn/crc16
|
||||
- github.com/sigurn/crc8
|
||||
- github.com/pion/ice/v2
|
||||
- github.com/google/uuid
|
||||
- github.com/wlynxg/anet
|
||||
- github.com/rs/zerolog
|
||||
- github.com/mattn/go-colorable
|
||||
- github.com/mattn/go-isatty
|
||||
- github.com/stretchr/testify
|
||||
- github.com/davecgh/go-spew
|
||||
- github.com/pmezard/go-difflib
|
||||
- ???
|
||||
- golang.org/x/mod
|
||||
- golang.org/x/net
|
||||
- golang.org/x/sys
|
||||
- golang.org/x/tools
|
||||
```
|
||||
|
||||
## Licenses
|
||||
|
||||
- github.com/asticode/go-astits - MIT
|
||||
- github.com/eclipse/paho.mqtt.golang - EPL-2.0
|
||||
- github.com/expr-lang/expr - MIT
|
||||
- github.com/gorilla/websocket - BSD-2
|
||||
- github.com/mattn/go-isatty - MIT
|
||||
- github.com/miekg/dns - BSD-3
|
||||
- github.com/pion/dtls - MIT
|
||||
- github.com/pion/ice - MIT
|
||||
- github.com/pion/interceptor - MIT
|
||||
- github.com/pion/rtcp - MIT
|
||||
- github.com/pion/rtp - MIT
|
||||
- github.com/pion/sdp - MIT
|
||||
- github.com/pion/srtp - MIT
|
||||
- github.com/pion/stun - MIT
|
||||
- github.com/pion/webrtc - MIT
|
||||
- github.com/rs/zerolog - MIT
|
||||
- github.com/sigurn/crc16 - MIT
|
||||
- github.com/sigurn/crc8 - MIT
|
||||
- github.com/stretchr/testify - MIT
|
||||
- github.com/tadglines/go-pkgs - Apache
|
||||
- golang.org/x/crypto - BSD-3
|
||||
- gopkg.in/yaml.v3 - MIT and Apache
|
||||
- github.com/asticode/go-astikit - MIT
|
||||
- github.com/davecgh/go-spew - ISC (BSD/MIT like)
|
||||
- github.com/google/uuid - BSD-3
|
||||
- github.com/kr/pretty - MIT
|
||||
- github.com/mattn/go-colorable - MIT
|
||||
- github.com/pion/datachannel - MIT
|
||||
- github.com/pion/logging - MIT
|
||||
- github.com/pion/mdns - MIT
|
||||
- github.com/pion/randutil - MIT
|
||||
- github.com/pion/sctp - MIT
|
||||
- github.com/pmezard/go-difflib - ???
|
||||
- github.com/wlynxg/anet - BSD-3
|
||||
- golang.org/x/mod - BSD-3
|
||||
- golang.org/x/net - BSD-3
|
||||
- golang.org/x/sync - BSD-3
|
||||
- golang.org/x/sys - BSD-3
|
||||
- golang.org/x/tools - BSD-3
|
||||
|
||||
## Virus
|
||||
|
||||
- https://go.dev/doc/faq#virus
|
||||
- https://groups.google.com/g/golang-nuts/c/lPwiWYaApSU
|
||||
|
||||
## Useful links
|
||||
|
||||
- https://github.com/golang-standards/project-layout
|
||||
- https://github.com/micro/micro
|
||||
- https://github.com/golang/go/wiki/GoArm
|
||||
- https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63
|
||||
- https://en.wikipedia.org/wiki/AArch64
|
||||
- https://stackoverflow.com/questions/22267189/what-does-the-w-flag-mean-when-passed-in-via-the-ldflags-option-to-the-go-comman
|
||||
@@ -0,0 +1,68 @@
|
||||
@ECHO OFF
|
||||
|
||||
@SET GOOS=windows
|
||||
@SET GOARCH=amd64
|
||||
@SET FILENAME=go2rtc_win64.zip
|
||||
go build -ldflags "-s -w" -trimpath && 7z a -mx9 -sdel %FILENAME% go2rtc.exe
|
||||
|
||||
@SET GOOS=windows
|
||||
@SET GOARCH=386
|
||||
@SET FILENAME=go2rtc_win32.zip
|
||||
go build -ldflags "-s -w" -trimpath && 7z a -mx9 -sdel %FILENAME% go2rtc.exe
|
||||
|
||||
@SET GOOS=windows
|
||||
@SET GOARCH=arm64
|
||||
@SET FILENAME=go2rtc_win_arm64.zip
|
||||
go build -ldflags "-s -w" -trimpath && 7z a -mx9 -sdel %FILENAME% go2rtc.exe
|
||||
|
||||
@SET GOOS=linux
|
||||
@SET GOARCH=amd64
|
||||
@SET FILENAME=go2rtc_linux_amd64
|
||||
go build -ldflags "-s -w" -trimpath -o %FILENAME% && upx --best --lzma %FILENAME%
|
||||
|
||||
@SET GOOS=linux
|
||||
@SET GOARCH=386
|
||||
@SET FILENAME=go2rtc_linux_i386
|
||||
go build -ldflags "-s -w" -trimpath -o %FILENAME% && upx --best --lzma %FILENAME%
|
||||
|
||||
@SET GOOS=linux
|
||||
@SET GOARCH=arm64
|
||||
@SET FILENAME=go2rtc_linux_arm64
|
||||
go build -ldflags "-s -w" -trimpath -o %FILENAME% && upx --best --lzma %FILENAME%
|
||||
|
||||
@SET GOOS=linux
|
||||
@SET GOARCH=arm
|
||||
@SET GOARM=7
|
||||
@SET FILENAME=go2rtc_linux_arm
|
||||
go build -ldflags "-s -w" -trimpath -o %FILENAME% && upx --best --lzma %FILENAME%
|
||||
|
||||
@SET GOOS=linux
|
||||
@SET GOARCH=arm
|
||||
@SET GOARM=6
|
||||
@SET FILENAME=go2rtc_linux_armv6
|
||||
go build -ldflags "-s -w" -trimpath -o %FILENAME% && upx --best --lzma %FILENAME%
|
||||
|
||||
@SET GOOS=linux
|
||||
@SET GOARCH=mipsle
|
||||
@SET FILENAME=go2rtc_linux_mipsel
|
||||
go build -ldflags "-s -w" -trimpath -o %FILENAME% && upx --best --lzma %FILENAME%
|
||||
|
||||
@SET GOOS=darwin
|
||||
@SET GOARCH=amd64
|
||||
@SET FILENAME=go2rtc_mac_amd64.zip
|
||||
go build -ldflags "-s -w" -trimpath && 7z a -mx9 -sdel %FILENAME% go2rtc
|
||||
|
||||
@SET GOOS=darwin
|
||||
@SET GOARCH=arm64
|
||||
@SET FILENAME=go2rtc_mac_arm64.zip
|
||||
go build -ldflags "-s -w" -trimpath && 7z a -mx9 -sdel %FILENAME% go2rtc
|
||||
|
||||
@SET GOOS=freebsd
|
||||
@SET GOARCH=amd64
|
||||
@SET FILENAME=go2rtc_freebsd_amd64.zip
|
||||
go build -ldflags "-s -w" -trimpath && 7z a -mx9 -sdel %FILENAME% go2rtc
|
||||
|
||||
@SET GOOS=freebsd
|
||||
@SET GOARCH=arm64
|
||||
@SET FILENAME=go2rtc_freebsd_arm64.zip
|
||||
go build -ldflags "-s -w" -trimpath && 7z a -mx9 -sdel %FILENAME% go2rtc
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e # Exit immediately if a command exits with a non-zero status.
|
||||
set -u # Treat unset variables as an error when substituting.
|
||||
|
||||
check_command() {
|
||||
if ! command -v "$1" >/dev/null
|
||||
then
|
||||
echo "Error: $1 could not be found. Please install it." >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
build_zip() {
|
||||
go build -ldflags "-s -w" -trimpath -o $2
|
||||
7z a -mx9 -sdel $1 $2
|
||||
}
|
||||
|
||||
build_upx() {
|
||||
go build -ldflags "-s -w" -trimpath -o $1
|
||||
upx --best --lzma $1
|
||||
}
|
||||
|
||||
check_command go
|
||||
check_command 7z
|
||||
check_command upx
|
||||
|
||||
export CGO_ENABLED=0
|
||||
|
||||
set -x # Print commands and their arguments as they are executed.
|
||||
|
||||
GOOS=windows GOARCH=amd64 build_zip go2rtc_win64.zip go2rtc.exe
|
||||
GOOS=windows GOARCH=386 build_zip go2rtc_win32.zip go2rtc.exe
|
||||
GOOS=windows GOARCH=arm64 build_zip go2rtc_win_arm64.zip go2rtc.exe
|
||||
|
||||
GOOS=linux GOARCH=amd64 build_upx go2rtc_linux_amd64
|
||||
GOOS=linux GOARCH=386 build_upx go2rtc_linux_i386
|
||||
GOOS=linux GOARCH=arm64 build_upx go2rtc_linux_arm64
|
||||
GOOS=linux GOARCH=mipsle build_upx go2rtc_linux_mipsel
|
||||
GOOS=linux GOARCH=arm GOARM=7 build_upx go2rtc_linux_arm
|
||||
GOOS=linux GOARCH=arm GOARM=6 build_upx go2rtc_linux_armv6
|
||||
|
||||
GOOS=darwin GOARCH=amd64 build_zip go2rtc_mac_amd64.zip go2rtc
|
||||
GOOS=darwin GOARCH=arm64 build_zip go2rtc_mac_arm64.zip go2rtc
|
||||
|
||||
GOOS=freebsd GOARCH=amd64 build_zip go2rtc_freebsd_amd64.zip go2rtc
|
||||
GOOS=freebsd GOARCH=arm64 build_zip go2rtc_freebsd_arm64.zip go2rtc
|
||||
Reference in New Issue
Block a user