Live video on the AT Protocol
at eli/actor-status 577 lines 22 kB view raw
1OUT_DIR?="bin" 2$(shell mkdir -p $(OUT_DIR)) 3 4.PHONY: default 5default: app node 6 7VERSION?=$(shell go run ./pkg/config/git/git.go -v) 8VERSION_ELECTRON=$(subst -,-z,$(subst v,,$(VERSION))) 9UUID?=$(shell go run ./pkg/config/uuid/uuid.go) 10BRANCH?=$(shell go run ./pkg/config/git/git.go --branch) 11 12BUILDOS ?= $(shell uname -s | tr '[:upper:]' '[:lower:]') 13BUILDARCH ?= $(shell uname -m | tr '[:upper:]' '[:lower:]') 14ifeq ($(BUILDARCH),aarch64) 15 BUILDARCH=arm64 16endif 17ifeq ($(BUILDARCH),x86_64) 18 BUILDARCH=amd64 19endif 20BUILDDIR?=build-$(BUILDOS)-$(BUILDARCH) 21SHARED_LD_LIBRARY_PATH=$(shell pwd)/$(BUILDDIR)/lib/usr/local/lib/x86_64-linux-gnu 22SHARED_DYLD_LIBRARY_PATH=$(shell pwd)/$(BUILDDIR)/lib/usr/local/lib 23SHARED_PKG_CONFIG_PATH=$(shell pwd)/$(BUILDDIR)/meson-uninstalled 24 25.PHONY: version 26version: 27 @go run ./pkg/config/git/git.go -v \ 28 && go run ./pkg/config/git/git.go --env -o .ci/build.env 29 30.PHONY: install 31install: 32 yarn install --inline-builds 33 34.PHONY: app-and-node 35app-and-node: 36 $(MAKE) app 37 $(MAKE) node 38 39.PHONY: app-and-node-and-test 40app-and-node-and-test: 41 $(MAKE) app 42 $(MAKE) node 43 $(MAKE) test 44.PHONY: app 45app: schema install 46 yarn run build 47 48.PHONY: node 49node: schema 50 $(MAKE) meson-setup 51 meson compile -C $(BUILDDIR) streamplace 52 53js/app/dist/index.html: install 54 yarn run build 55 56.PHONY: dev-setup 57dev-setup: schema install js/app/dist/index.html 58 meson setup --default-library=shared $(BUILDDIR) $(SHARED_OPTS) 59 meson configure --default-library=shared $(BUILDDIR) $(SHARED_OPTS) 60 meson compile -C $(BUILDDIR) streamplace 61 meson install --destdir lib -C $(BUILDDIR) 62 $(MAKE) dev 63 64.PHONY: dev 65dev: 66 cp ./util/streamplace-dev.sh $(BUILDDIR)/streamplace 67 PKG_CONFIG_PATH=$(SHARED_PKG_CONFIG_PATH) \ 68 LD_LIBRARY_PATH=$(SHARED_LD_LIBRARY_PATH) \ 69 DYLD_LIBRARY_PATH=$(SHARED_DYLD_LIBRARY_PATH) \ 70 go build -o $(BUILDDIR)/libstreamplace ./cmd/libstreamplace/... 71 72.PHONY: dev-test 73dev-test: 74 PKG_CONFIG_PATH=$(SHARED_PKG_CONFIG_PATH) \ 75 LD_LIBRARY_PATH=$(SHARED_LD_LIBRARY_PATH) \ 76 DYLD_LIBRARY_PATH=$(SHARED_DYLD_LIBRARY_PATH) \ 77 go test -p 1 -timeout 120s ./... 78 79.PHONY: schema 80schema: 81 mkdir -p js/app/generated \ 82 && go run pkg/crypto/signers/eip712/export-schema/export-schema.go > js/app/generated/eip712-schema.json 83 84.PHONY: lexicons 85lexicons: 86 $(MAKE) go-lexicons \ 87 && $(MAKE) js-lexicons \ 88 && $(MAKE) md-lexicons \ 89 && make fix 90 91.PHONY: go-lexicons 92go-lexicons: 93 rm -rf ./pkg/streamplace \ 94 && mkdir -p ./pkg/streamplace \ 95 && rm -rf ./pkg/streamplace/cbor_gen.go \ 96 && $(MAKE) lexgen \ 97 && sed -i.bak 's/\tutil/\/\/\tutil/' $$(find ./pkg/streamplace -type f) \ 98 && go run golang.org/x/tools/cmd/goimports@latest -w $$(find ./pkg/streamplace -type f) \ 99 && go run ./pkg/gen/gen.go \ 100 && $(MAKE) lexgen \ 101 && find . | grep bak$$ | xargs rm \ 102 && rm -rf api 103 104.PHONY: js-lexicons 105js-lexicons: 106 node_modules/.bin/lex gen-api ./js/app/lexicons $$(find ./lexicons -type f -name '*.json') --yes \ 107 && echo 'import { ComAtprotoRepoCreateRecord, ComAtprotoRepoDeleteRecord, ComAtprotoRepoGetRecord, ComAtprotoRepoListRecords } from "@atproto/api"' >> ./js/app/lexicons/index.ts \ 108 && sed -i.bak "s/'\.\.\/\.\.\/app/'@atproto\/api\/src\/client\/types\/app/" $$(find ./js/app/lexicons/types/place/stream -type f) \ 109 && sed -i.bak "s/'\.\.\/\.\.\/\.\.\/app/'@atproto\/api\/src\/client\/types\/app/" $$(find ./js/app/lexicons/types/place/stream -type f) \ 110 && sed -i.bak "s/'\.\.\/\.\.\/com/'@atproto\/api\/src\/client\/types\/com/" $$(find ./js/app/lexicons/types/place/stream -type f) \ 111 && sed -i.bak "s/'\.\.\/\.\.\/\.\.\/com/'@atproto\/api\/src\/client\/types\/com/" $$(find ./js/app/lexicons/types/place/stream -type f) \ 112 && sed -i.bak 's/AppBskyGraphBlock\.Main/AppBskyGraphBlock\.Record/' $$(find ./js/app/lexicons/types/place/stream -type f) \ 113 && sed -i.bak 's/PlaceStreamChatProfile\.Main/PlaceStreamChatProfile\.Record/' $$(find ./js/app/lexicons/types/place/stream -type f) \ 114 && sed -i.bak "s/import\ \*\ as\ AppBskyFeedDefs\ from\ '.\/defs'/import \{ AppBskyFeedDefs } from '@atproto\/api'/" $$(find ./js/app/lexicons/types -type f) \ 115 && sed -i.bak "s/import\ \*\ as\ AppBskyActorDefs\ from\ '.\/defs'/import \{ AppBskyActorDefs } from '@atproto\/api'/" $$(find ./js/app/lexicons -type f) \ 116 && find . | grep bak$$ | xargs rm 117 118.PHONY: md-lexicons 119md-lexicons: 120 yarn exec lexmd \ 121 lexicons/place/stream \ 122 js/docs/src/content/docs/lex-reference \ 123 && $(MAKE) fix 124 125.PHONY: lexgen 126lexgen: 127 $(MAKE) lexgen-types 128 $(MAKE) lexgen-server 129 130.PHONY: lexgen-types 131lexgen-types: 132 go run github.com/bluesky-social/indigo/cmd/lexgen \ 133 -outdir ./pkg/spxrpc \ 134 --build-file util/lexgen-types.json \ 135 --external-lexicons subprojects/atproto/lexicons \ 136 lexicons/place/stream \ 137 ./subprojects/atproto/lexicons 138 139.PHONY: lexgen-server 140lexgen-server: 141 mkdir -p ./pkg/spxrpc \ 142 && go run github.com/bluesky-social/indigo/cmd/lexgen \ 143 --gen-server \ 144 --types-import place.stream:stream.place/streamplace/pkg/streamplace \ 145 --types-import app.bsky:github.com/bluesky-social/indigo/api/bsky \ 146 --types-import com.atproto:github.com/bluesky-social/indigo/api/atproto \ 147 --types-import chat.bsky:github.com/bluesky-social/indigo/api/chat \ 148 --types-import tools.ozone:github.com/bluesky-social/indigo/api/ozone \ 149 -outdir ./pkg/spxrpc \ 150 --build-file util/lexgen-types.json \ 151 --external-lexicons subprojects/atproto/lexicons \ 152 --package spxrpc \ 153 lexicons/place/stream \ 154 lexicons/app/bsky \ 155 lexicons/com/atproto 156 157.PHONY: ci-lexicons 158ci-lexicons: 159 $(MAKE) lexicons \ 160 && if ! git diff --exit-code >/dev/null; then echo "lexicons are out of date, run 'make lexicons' to fix"; exit 1; fi 161 162.PHONY: test 163test: 164 meson test -C $(BUILDDIR) go-tests 165 166# test to make sure we haven't added any more dynamic dependencies 167LINUX_LINK_COUNT=5 168.PHONY: link-test-linux 169link-test-linux: 170 count=$(shell ldd ./build-linux-amd64/streamplace | wc -l) \ 171 && echo $$count \ 172 && if [ "$$count" != "$(LINUX_LINK_COUNT)" ]; then echo "ldd reports new libaries linked! want $(LINUX_LINK_COUNT) got $$count" \ 173 && ldd ./build-linux-amd64/streamplace \ 174 && exit 1; \ 175 fi 176 177MACOS_LINK_COUNT=10 178.PHONY: link-test-macos 179link-test-macos: 180 count=$(shell otool -L ./build-darwin-arm64/streamplace | wc -l | xargs) \ 181 && echo $$count \ 182 && if [ "$$count" != "$(MACOS_LINK_COUNT)" ]; then echo "otool -L reports new libaries linked! want $(MACOS_LINK_COUNT) got $$count" \ 183 && otool -L ./build-darwin-arm64/streamplace \ 184 && exit 1; \ 185 fi 186 187WINDOWS_LINK_COUNT=16 188.PHONY: link-test-windows 189link-test-windows: 190 count=$(shell x86_64-w64-mingw32-objdump -p ./build-windows-amd64/streamplace.exe | grep "DLL Name" | tr '[:upper:]' '[:lower:]' | sort | uniq | wc -l | xargs) \ 191 && echo $$count \ 192 && if [ "$$count" != "$(WINDOWS_LINK_COUNT)" ]; then echo "x86_64-w64-mingw32-objdump -p reports new libaries linked! want $(WINDOWS_LINK_COUNT) got $$count" \ 193 && x86_64-w64-mingw32-objdump -p ./build-windows-amd64/streamplace.exe | grep "DLL Name" \ 194 && exit 1; \ 195 fi 196 197.PHONY: all 198all: version install check app test node-all-platforms android 199 200.PHONY: ci 201ci: version install check app node-all-platforms ci-upload-node 202 203.PHONY: ci-macos 204ci-macos: version install check app node-all-platforms-macos ci-upload-node-macos ios ci-upload-ios 205 206.PHONY: ci-macos 207ci-android: version install check android ci-upload-android 208 209.PHONY: ci-test 210ci-test: app 211 meson setup $(BUILDDIR) $(OPTS) 212 meson test -C $(BUILDDIR) go-tests 213 214.PHONY: android 215android: app .build/bundletool.jar 216 $(MAKE) android-release 217 $(MAKE) android-debug 218 219.PHONY: android-release 220android-release: .build/bundletool.jar 221 export NODE_ENV=production \ 222 && cd ./js/app/android \ 223 && ./gradlew :app:bundleRelease \ 224 && cd - \ 225 && mv ./js/app/android/app/build/outputs/bundle/release/app-release.aab ./bin/streamplace-$(VERSION)-android-release.aab \ 226 && cd bin \ 227 && java -jar ../.build/bundletool.jar build-apks --ks ../my-release-key.keystore --ks-key-alias alias_name --ks-pass pass:aquareum --bundle=streamplace-$(VERSION)-android-release.aab --output=streamplace-$(VERSION)-android-release.apks --mode=universal \ 228 && unzip streamplace-$(VERSION)-android-release.apks && mv universal.apk streamplace-$(VERSION)-android-release.apk && rm toc.pb 229 230.PHONY: android-debug 231android-debug: .build/bundletool.jar 232 export NODE_ENV=production \ 233 && cd ./js/app/android \ 234 && ./gradlew :app:bundleDebug \ 235 && cd - \ 236 && mv ./js/app/android/app/build/outputs/bundle/debug/app-debug.aab ./bin/streamplace-$(VERSION)-android-debug.aab \ 237 && cd bin \ 238 && java -jar ../.build/bundletool.jar build-apks --ks ../my-release-key.keystore --ks-key-alias alias_name --ks-pass pass:aquareum --bundle=streamplace-$(VERSION)-android-debug.aab --output=streamplace-$(VERSION)-android-debug.apks --mode=universal \ 239 && unzip streamplace-$(VERSION)-android-debug.apks && mv universal.apk streamplace-$(VERSION)-android-debug.apk && rm toc.pb 240 241.PHONY: ios 242ios: app 243 xcodebuild \ 244 -workspace ./js/app/ios/Streamplace.xcworkspace \ 245 -sdk iphoneos \ 246 -configuration Release \ 247 -scheme Streamplace \ 248 -archivePath ./bin/streamplace-$(VERSION)-ios-release.xcarchive \ 249 CODE_SIGN_IDENTITY=- \ 250 AD_HOC_CODE_SIGNING_ALLOWED=YES \ 251 CODE_SIGN_STYLE=Automatic \ 252 DEVELOPMENT_TEAM=ZZZZZZZZZZ \ 253 clean archive | xcpretty \ 254 && cd bin \ 255 && tar -czvf streamplace-$(VERSION)-ios-release.xcarchive.tar.gz streamplace-$(VERSION)-ios-release.xcarchive 256 257# xcodebuild -exportArchive -archivePath ./bin/streamplace-$(VERSION)-ios-release.xcarchive -exportOptionsPlist ./js/app/exportOptions.plist -exportPath ./bin/streamplace-$(VERSION)-ios-release.ipa 258 259.build/bundletool.jar: 260 mkdir -p .build \ 261 && curl -L -o ./.build/bundletool.jar https://github.com/google/bundletool/releases/download/1.17.0/bundletool-all-1.17.0.jar 262 263BASE_OPTS = \ 264 --buildtype=debugoptimized \ 265 -D "gst-plugins-base:audioresample=enabled" \ 266 -D "gst-plugins-base:playback=enabled" \ 267 -D "gst-plugins-base:opus=enabled" \ 268 -D "gst-plugins-base:gio-typefinder=enabled" \ 269 -D "gst-plugins-base:videotestsrc=enabled" \ 270 -D "gst-plugins-base:videoconvertscale=enabled" \ 271 -D "gst-plugins-base:typefind=enabled" \ 272 -D "gst-plugins-base:compositor=enabled" \ 273 -D "gst-plugins-base:videorate=enabled" \ 274 -D "gst-plugins-base:app=enabled" \ 275 -D "gst-plugins-base:audiorate=enabled" \ 276 -D "gst-plugins-base:audiotestsrc=enabled" \ 277 -D "gst-plugins-base:audioconvert=enabled" \ 278 -D "gst-plugins-good:matroska=enabled" \ 279 -D "gst-plugins-good:multifile=enabled" \ 280 -D "gst-plugins-good:rtp=enabled" \ 281 -D "gst-plugins-bad:fdkaac=enabled" \ 282 -D "gst-plugins-good:audioparsers=enabled" \ 283 -D "gst-plugins-good:isomp4=enabled" \ 284 -D "gst-plugins-good:png=enabled" \ 285 -D "gst-plugins-good:videobox=enabled" \ 286 -D "gst-plugins-good:jpeg=enabled" \ 287 -D "gst-plugins-good:audioparsers=enabled" \ 288 -D "gst-plugins-bad:videoparsers=enabled" \ 289 -D "gst-plugins-bad:mpegtsmux=enabled" \ 290 -D "gst-plugins-bad:mpegtsdemux=enabled" \ 291 -D "gst-plugins-bad:codectimestamper=enabled" \ 292 -D "gst-plugins-bad:opus=enabled" \ 293 -D "gst-plugins-ugly:x264=enabled" \ 294 -D "gst-plugins-ugly:gpl=enabled" \ 295 -D "x264:asm=enabled" \ 296 -D "gstreamer-full:gst-full=enabled" \ 297 -D "gstreamer-full:gst-full-plugins=libgstopusparse.a;libgstcodectimestamper.a;libgstrtp.a;libgstaudioresample.a;libgstlibav.a;libgstmatroska.a;libgstmultifile.a;libgstjpeg.a;libgstaudiotestsrc.a;libgstaudioconvert.a;libgstaudioparsers.a;libgstfdkaac.a;libgstisomp4.a;libgstapp.a;libgstvideoconvertscale.a;libgstvideobox.a;libgstvideorate.a;libgstpng.a;libgstcompositor.a;libgstaudiorate.a;libgstx264.a;libgstopus.a;libgstvideotestsrc.a;libgstvideoparsersbad.a;libgstaudioparsers.a;libgstmpegtsmux.a;libgstmpegtsdemux.a;libgstplayback.a;libgsttypefindfunctions.a;libgstcoretracers.a" \ 298 -D "gstreamer-full:gst-full-libraries=gstreamer-controller-1.0,gstreamer-plugins-base-1.0,gstreamer-pbutils-1.0" \ 299 -D "gstreamer-full:gst-full-elements=coreelements:concat,filesrc,filesink,queue,queue2,multiqueue,typefind,tee,capsfilter,fakesink,identity" \ 300 -D "gstreamer-full:bad=enabled" \ 301 -D "gstreamer-full:tls=disabled" \ 302 -D "gstreamer-full:libav=enabled" \ 303 -D "gstreamer-full:ugly=enabled" \ 304 -D "gstreamer-full:gpl=enabled" \ 305 -D "gstreamer-full:gst-full-typefind-functions=" \ 306 -D "gstreamer-full:glib_assert=false" \ 307 -D "gstreamer:glib_assert=false" \ 308 -D "gstreamer:coretracers=enabled" \ 309 -D "gst-plugins-good:glib_assert=false" \ 310 -D "gst-plugins-bad:glib_assert=false" \ 311 -D "gst-plugins-base:glib_assert=false" \ 312 -D "gst-plugins-ugly:glib_assert=false" \ 313 -D "glib:glib_assert=false" 314 315OPTS = \ 316 $(BASE_OPTS) \ 317 -D "gstreamer-full:gst-full-target-type=static_library" 318 319SHARED_OPTS = \ 320 $(BASE_OPTS) \ 321 -D "FFmpeg:default_library=shared" 322 323.PHONY: meson-setup 324meson-setup: 325 @meson setup $(BUILDDIR) $(OPTS) 326 @meson configure $(BUILDDIR) $(OPTS) 327 328.PHONY: node-all-platforms 329node-all-platforms: app 330 meson setup build-linux-amd64 $(OPTS) --buildtype debugoptimized 331 meson compile -C build-linux-amd64 archive 332 $(MAKE) link-test-linux 333 $(MAKE) linux-arm64 334 $(MAKE) windows-amd64 335 $(MAKE) windows-amd64-startup-test 336 $(MAKE) desktop-linux 337 $(MAKE) desktop-windows 338 339.PHONY: desktop-linux 340desktop-linux: 341 cd js/desktop \ 342 && yarn run make --platform linux --arch x64 \ 343 && yarn run make --platform linux --arch arm64 \ 344 && cd - \ 345 && mv "js/desktop/out/make/AppImage/x64/Streamplace-$(VERSION_ELECTRON)-x64.AppImage" ./bin/streamplace-desktop-$(VERSION)-linux-amd64.AppImage \ 346 && mv "js/desktop/out/make/AppImage/arm64/Streamplace-$(VERSION_ELECTRON)-arm64.AppImage" ./bin/streamplace-desktop-$(VERSION)-linux-arm64.AppImage 347 348.PHONY: desktop-windows 349desktop-windows: 350 cd js/desktop \ 351 && yarn run make --platform win32 --arch x64 \ 352 && cd - \ 353 && export SUM=$$(cat ./js/desktop/out/make/squirrel.windows/x64/streamplace_desktop-$(VERSION_ELECTRON)-full.nupkg | openssl sha1 | awk '{ print $$2 }') \ 354 && echo $$SUM > ./bin/streamplace-desktop-$(VERSION)-windows-amd64.nupkg.sha1 \ 355 && mv "js/desktop/out/make/squirrel.windows/x64/streamplace_desktop-$(VERSION_ELECTRON)-full.nupkg" ./bin/streamplace-desktop-$(VERSION)-windows-amd64.$$SUM.nupkg \ 356 && mv "js/desktop/out/make/squirrel.windows/x64/Streamplace-$(VERSION_ELECTRON) Setup.exe" ./bin/streamplace-desktop-$(VERSION)-windows-amd64.exe 357 358.PHONY: linux-arm64 359linux-arm64: 360 rustup target add aarch64-unknown-linux-gnu 361 meson setup --cross-file util/linux-arm64-gnu.ini --buildtype debugoptimized build-linux-arm64 $(OPTS) 362 meson compile -C build-linux-arm64 archive 363 364.PHONY: windows-amd64 365windows-amd64: 366 rustup target add x86_64-pc-windows-gnu 367 $(MAKE) windows-amd64-meson-setup 368 meson compile -C build-windows-amd64 archive 2>&1 | grep -v drectve 369 $(MAKE) link-test-windows 370 371.PHONY: windows-amd64-meson-setup 372windows-amd64-meson-setup: 373 meson setup --cross-file util/windows-amd64-gnu.ini --buildtype debugoptimized build-windows-amd64 $(OPTS) 374 375# unbuffer here is a workaround for wine trying to pop up a terminal window and failing 376.PHONY: windows-amd64-startup-test 377windows-amd64-startup-test: 378 bash -c 'set -euo pipefail && unbuffer wine64 ./build-windows-amd64/streamplace.exe self-test | cat' 379 380.PHONY: node-all-platforms-macos 381node-all-platforms-macos: app 382 meson setup --buildtype debugoptimized build-darwin-arm64 $(OPTS) 383 meson compile -C build-darwin-arm64 384 ./util/mac-codesign.sh ./build-darwin-arm64/streamplace 385 cd build-darwin-arm64 \ 386 && tar -czvf ../bin/streamplace-$(VERSION)-darwin-arm64.tar.gz ./streamplace \ 387 && cd - 388 ./build-darwin-arm64/streamplace --version 389 ./build-darwin-arm64/streamplace self-test 390 $(MAKE) link-test-macos 391 rustup target add x86_64-apple-darwin 392 meson setup --buildtype debugoptimized --cross-file util/darwin-amd64-apple.ini build-darwin-amd64 $(OPTS) 393 meson compile -C build-darwin-amd64 394 ./util/mac-codesign.sh ./build-darwin-amd64/streamplace 395 cd build-darwin-amd64 \ 396 && tar -czvf ../bin/streamplace-$(VERSION)-darwin-amd64.tar.gz ./streamplace \ 397 && cd - 398 ./build-darwin-amd64/streamplace --version 399 ./build-darwin-arm64/streamplace self-test 400 $(MAKE) desktop-macos 401 meson test -C build-darwin-arm64 go-tests 402 403.PHONY: desktop-macos 404desktop-macos: 405 export DEBUG="electron-osx-sign*" \ 406 && cd js/desktop \ 407 && yarn run make --platform darwin --arch arm64 \ 408 && yarn run make --platform darwin --arch x64 \ 409 && cd - \ 410 && mv js/desktop/out/make/Streamplace-$(VERSION_ELECTRON)-x64.dmg ./bin/streamplace-desktop-$(VERSION)-darwin-amd64.dmg \ 411 && mv js/desktop/out/make/Streamplace-$(VERSION_ELECTRON)-arm64.dmg ./bin/streamplace-desktop-$(VERSION)-darwin-arm64.dmg \ 412 && mv js/desktop/out/make/zip/darwin/x64/Streamplace-darwin-x64-$(VERSION_ELECTRON).zip ./bin/streamplace-desktop-$(VERSION)-darwin-amd64.zip \ 413 && mv js/desktop/out/make/zip/darwin/arm64/Streamplace-darwin-arm64-$(VERSION_ELECTRON).zip ./bin/streamplace-desktop-$(VERSION)-darwin-arm64.zip 414 415.PHONY: selftest-macos 416selftest-macos: 417 js/desktop/out/Streamplace-darwin-arm64/Streamplace.app/Contents/MacOS/Streamplace -- --self-test 418 419# link your local version of mist for dev 420.PHONY: link-mist 421link-mist: 422 rm -rf subprojects/mistserver 423 ln -s $$(realpath ../mistserver) ./subprojects/mistserver 424 425# link your local version of c2pa-go for dev 426.PHONY: link-c2pa-go 427link-c2pa-go: 428 rm -rf subprojects/c2pa_go 429 ln -s $$(realpath ../c2pa-go) ./subprojects/c2pa_go 430 431# link your local version of gstreamer 432.PHONY: link-gstreamer 433link-gstreamer: 434 rm -rf subprojects/gstreamer-full 435 ln -s $$(realpath ../gstreamer) ./subprojects/gstreamer-full 436 437# link your local version of ffmpeg for dev 438.PHONY: link-ffmpeg 439link-ffmpeg: 440 rm -rf subprojects/FFmpeg 441 ln -s $$(realpath ../ffmpeg) ./subprojects/FFmpeg 442 443.PHONY: docker 444docker: 445 docker build -f docker/local.Dockerfile -t dist.stream.place/streamplace/streamplace:local . 446 447.PHONY: docker-build 448docker-build: docker-build-builder docker-build-in-container 449 450.PHONY: docker-test 451docker-test: docker-build-builder docker-test-in-container 452 453.PHONY: docker-build-builder 454docker-build-builder: 455 cd docker \ 456 && podman build --target=builder --os=linux --arch=amd64 -f build.Dockerfile -t dist.stream.place/streamplace/streamplace:builder . 457 458.PHONY: docker-build-in-container 459docker-build-in-container: 460 podman run -v $$(pwd):$$(pwd) -w $$(pwd) --rm -it dist.stream.place/streamplace/streamplace:builder make app-and-node 461 462.PHONY: docker-test-in-container 463docker-test-in-container: 464 podman run -v $$(pwd):$$(pwd) -w $$(pwd) --rm -it dist.stream.place/streamplace/streamplace:builder make app-and-node-and-test 465 466IN_CONTAINER_CMD?=echo 'usage: make in-container IN_CONTAINER_CMD=\"<command>\"' 467DOCKER_BIN?=podman 468DOCKER_REF?=dist.stream.place/streamplace/streamplace:builder 469DOCKER_OPTS?= 470.PHONY: in-container 471in-container: docker-build-builder 472 $(DOCKER_BIN) run $(DOCKER_OPTS) -v $$(pwd):$$(pwd) -w $$(pwd) --rm $(DOCKER_REF) bash -c "$(IN_CONTAINER_CMD)" 473 474STREAMPLACE_URL?=https://git.stream.place/streamplace/streamplace/-/package_files/10122/download 475.PHONY: docker-release 476docker-release: 477 cd docker \ 478 && docker build -f release.Dockerfile \ 479 --build-arg TARGETARCH=$(BUILDARCH) \ 480 --build-arg STREAMPLACE_URL=$(STREAMPLACE_URL) \ 481 -t dist.stream.place/streamplace/streamplace \ 482 . 483 484.PHONY: docker-mistserver 485docker-mistserver: 486 cd docker \ 487 && docker build -f mistserver.Dockerfile \ 488 --build-arg TARGETARCH=$(BUILDARCH) \ 489 --build-arg STREAMPLACE_URL=$(STREAMPLACE_URL) \ 490 -t dist.stream.place/streamplace/streamplace:mistserver \ 491 . 492 493.PHONY: ci-upload 494ci-upload: ci-upload-node ci-upload-android 495 496.PHONY: ci-upload-node 497ci-upload-node: node-all-platforms 498 for GOOS in linux; do \ 499 for GOARCH in amd64 arm64; do \ 500 export file=streamplace-$(VERSION)-$$GOOS-$$GOARCH.tar.gz \ 501 && $(MAKE) ci-upload-file upload_file=$$file; \ 502 export file=streamplace-desktop-$(VERSION)-$$GOOS-$$GOARCH.AppImage \ 503 && $(MAKE) ci-upload-file upload_file=$$file; \ 504 done \ 505 done; 506 for GOOS in windows; do \ 507 for GOARCH in amd64; do \ 508 export file=streamplace-$(VERSION)-$$GOOS-$$GOARCH.zip \ 509 && $(MAKE) ci-upload-file upload_file=$$file; \ 510 export file=streamplace-desktop-$(VERSION)-$$GOOS-$$GOARCH.exe \ 511 && $(MAKE) ci-upload-file upload_file=$$file; \ 512 export SUM=$$(cat bin/streamplace-desktop-$(VERSION)-$$GOOS-$$GOARCH.nupkg.sha1) \ 513 && export file=streamplace-desktop-$(VERSION)-$$GOOS-$$GOARCH.$$SUM.nupkg \ 514 && $(MAKE) ci-upload-file upload_file=$$file; \ 515 done \ 516 done; 517 518.PHONY: ci-upload-node-macos 519ci-upload-node-macos: node-all-platforms-macos 520 for GOOS in darwin; do \ 521 for GOARCH in amd64 arm64; do \ 522 export file=streamplace-$(VERSION)-$$GOOS-$$GOARCH.tar.gz \ 523 && $(MAKE) ci-upload-file upload_file=$$file; \ 524 export file=streamplace-desktop-$(VERSION)-$$GOOS-$$GOARCH.dmg \ 525 && $(MAKE) ci-upload-file upload_file=$$file; \ 526 export file=streamplace-desktop-$(VERSION)-$$GOOS-$$GOARCH.zip \ 527 && $(MAKE) ci-upload-file upload_file=$$file; \ 528 done \ 529 done; 530 531.PHONY: ci-upload-android 532ci-upload-android: android 533 $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-android-release.apk \ 534 && $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-android-debug.apk \ 535 && $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-android-release.aab \ 536 && $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-android-debug.aab 537 538.PHONY: ci-upload-ios 539ci-upload-ios: ios 540 $(MAKE) ci-upload-file upload_file=streamplace-$(VERSION)-ios-release.xcarchive.tar.gz 541 542upload_file?="" 543.PHONY: ci-upload-file 544ci-upload-file: 545 curl \ 546 --fail-with-body \ 547 --header "JOB-TOKEN: $$CI_JOB_TOKEN" \ 548 --upload-file bin/$(upload_file) \ 549 "$$CI_API_V4_URL/projects/$$CI_PROJECT_ID/packages/generic/$(BRANCH)/$(VERSION)/$(upload_file)"; 550 551.PHONY: release 552release: 553 yarn run release 554 555.PHONY: ci-release 556ci-release: 557 go install gitlab.com/gitlab-org/release-cli/cmd/release-cli 558 go run ./pkg/config/git/git.go -release -o release.yml 559 release-cli create-from-file --file release.yml 560 561.PHONY: check 562check: install 563 yarn run check 564 if [ "`gofmt -l . | wc -l`" -gt 0 ]; then echo 'gofmt failed, run make fix'; exit 1; fi 565 566.PHONY: fix 567fix: 568 yarn run fix 569 gofmt -w . 570 571.PHONY: precommit 572precommit: dockerfile-hash-precommit 573 574.PHONY: dockefile-hash-precommit 575dockerfile-hash-precommit: 576 @bash -c 'printf "variables:\n DOCKERFILE_HASH: `git hash-object docker/build.Dockerfile`" > .ci/dockerfile-hash.yaml' \ 577 && git add .ci/dockerfile-hash.yaml