-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (43 loc) · 2.04 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
werift_version = v0.14.2
clean:
rm -r types/lib-jitsi-meet modules/ bundles/
modules:
mkdir modules
modules/werift: modules
git clone https://github.com/shinyoshiaki/werift-webrtc/ \
--branch $(werift_version) \
--single-branch \
modules/werift
modules/lib-jitsi-meet: modules
git clone https://github.com/jitsi/lib-jitsi-meet/ \
--branch master \
--single-branch \
modules/lib-jitsi-meet
bundles:
mkdir bundles
define WERIFT_BUNDLE_HEADER
// werift-webrct $(werift_version) bundled for deno
import { createRequire } from 'https://deno.land/std/node/module.ts';
const require = createRequire(import.meta.url);
var module = {};
endef
bundles/werift.min.js: bundles modules/werift
cd modules/werift && npm i --no-scripts esbuild && npx esbuild packages/webrtc/src/index.ts \
--bundle --minify --outfile=bundle.js --platform=node --target=es2020
$(file > bundles/werift.min.js,$(WERIFT_BUNDLE_HEADER))
cat modules/werift/bundle.js >> bundles/werift.min.js
rm modules/werift/bundle.js
types/lib-jitsi-meet: modules/lib-jitsi-meet
cp -r modules/lib-jitsi-meet/types/hand-crafted/ types/lib-jitsi-meet/
find types/lib-jitsi-meet/ -name "*.d.ts" -exec sed -i \
-e "s/JQuery\|HTMLElement\|MediaStream\|MediaStreamTrack\|MediaDeviceInfo\|Element\|RTCPeerConnection\|RTCRtpSender\|RTCRtpReceiver\|RTCRtpEncodingParameters\|RTCSessionDescription\|\(typeof \)\{0,1\}Strophe\.[A-Za-z]\+/unknown/g" \
-e "s|\(import .* from ['\"]\.\{1,2\}/[a-zA-Z0-9/\.]\+\)|\1.d.ts|g" \
{} \;
sed -i \
-e "s|jitsi-meet-logger|../jitsi-meet-logger/Logger.d.ts|" \
-e "s/\(setNetworkInfo: (\)/\1info:/g" \
types/lib-jitsi-meet/JitsiMeetJS.d.ts
sed -i -e "s/\({ timeout: number }\)/data: \1/" types/lib-jitsi-meet/modules/xmpp/XmppConnection.d.ts
sed -i "s|from 'events'|from 'https://deno.land/std/node/_events.d.ts'|" types/lib-jitsi-meet/modules/RTC/JitsiTrack.d.ts
sed -i "s|../.\(./JitsiConnectionErrors.d.ts\)|\1|" types/lib-jitsi-meet/authenticateAndUpgradeRole.d.ts
sed -i "s|../.\(./JitsiConferenceEvents.d.ts\)|\1|" types/lib-jitsi-meet/JitsiConference.d.ts