Live video on the AT Protocol

rust: working `make dev` for mac

+20 -6
+2
.golangci.yaml
··· 7 7 - -QF1003 # "could use tagged switch" 8 8 - -ST1003 # "should not use underscores in Go names" - indigo's code gen makes some 9 9 - -SA5008 # "unknown JSON option" doesn't care for the const stuff 10 + - -ST1006 # receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (uniffi-bindgen-go uses this) 11 + - -ST1005 # error strings should not be capitalized (uniffi-bindgen-go uses this) 10 12 disable: 11 13 - unused 12 14 exclusions:
+7 -3
Makefile
··· 66 66 67 67 .PHONY: dev-setup-meson-configure 68 68 dev-setup-meson-configure: 69 + if ! which uniffi-bindgen-go; then cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.3.0+v0.28.3; fi 69 70 meson setup --default-library=shared $(BUILDDIR) $(SHARED_OPTS) 70 71 meson configure --default-library=shared $(BUILDDIR) $(SHARED_OPTS) 71 72 ··· 78 79 dev: 79 80 cp ./util/streamplace-dev.sh $(BUILDDIR)/streamplace 80 81 cargo build 82 + $(MAKE) iroh-streamplace-codegen 81 83 PKG_CONFIG_PATH=$(SHARED_PKG_CONFIG_PATH) \ 82 84 LD_LIBRARY_PATH=$(SHARED_LD_LIBRARY_PATH) \ 83 85 DYLD_LIBRARY_PATH=$(SHARED_DYLD_LIBRARY_PATH) \ ··· 839 841 && git commit -m "Update streamplace $(VERSION)" \ 840 842 && git push 841 843 842 - .PHONY: iroh-streamplace 843 - iroh-streamplace: 844 - uniffi-bindgen-go --out-dir pkg/iroh/generated --library ./target/debug/libiroh_streamplace.so 844 + .PHONY: iroh-streamplace-codegen 845 + iroh-streamplace-codegen: 846 + EXT=so; \ 847 + if [ "$(BUILDOS)" = "darwin" ]; then EXT=dylib; fi; \ 848 + uniffi-bindgen-go --out-dir pkg/iroh/generated --library ./target/debug/libiroh_streamplace.$$EXT
+10 -2
rust/iroh-streamplace/meson.build
··· 3 3 if get_option('default_library') == 'shared' 4 4 cargo_cmd = '@0@ build'.format(prog_cargo.full_path()) 5 5 6 + if host_machine.system() == 'darwin' 7 + ext = 'dylib' 8 + elif host_machine.system() == 'linux' 9 + ext = 'so' 10 + else 11 + error('Unsupported dev system: @0@'.format(host_machine.system())) 12 + endif 13 + 6 14 iroh_streamplace_dep = custom_target( 7 15 'libiroh_streamplace', 8 16 input: [], 9 - output: ['libiroh_streamplace.so'], 17 + output: ['libiroh_streamplace.' + ext], 10 18 command: [ 11 19 'sh', 12 20 '-c', 13 - 'cd "@2@/../.." && @0@ && cp "@2@/../../target/debug/libiroh_streamplace.so" "@1@/libiroh_streamplace.so"'.format(cargo_cmd, meson.current_build_dir(), meson.current_source_dir()), 21 + 'cd "@2@/../.." && @0@ && cp "@2@/../../target/debug/libiroh_streamplace.@3@" "@1@/libiroh_streamplace.@3@"'.format(cargo_cmd, meson.current_build_dir(), meson.current_source_dir(), ext), 14 22 ], 15 23 build_by_default: true, 16 24 )
+1 -1
util/streamplace-dev.sh
··· 8 8 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) 9 9 STREAMPLACE_DEV_VERSION=$(go run ./pkg/config/git/git.go -v) \ 10 10 LD_LIBRARY_PATH="$SCRIPT_DIR/lib/usr/local/lib/x86_64-linux-gnu:$SCRIPT_DIR/../target/debug" \ 11 - DYLD_LIBRARY_PATH="$SCRIPT_DIR/lib/usr/local/lib" \ 11 + DYLD_LIBRARY_PATH="$SCRIPT_DIR/lib/usr/local/lib:$SCRIPT_DIR/../target/debug" \ 12 12 SP_DEV_FRONTEND_PROXY="http://127.0.0.1:38081" \ 13 13 exec "$SCRIPT_DIR/libstreamplace" "$@"