|
1 |
| - |
2 |
| -######################################################################### |
3 |
| -# Makefile Usage: |
4 |
| -# |
5 |
| -# 1) Make sure that you have the curl command line executable in your path |
6 |
| -# 2) Set the variable ROKU_DEV_TARGET in your environment to the IP |
7 |
| -# address of your Roku box. (e.g. export ROKU_DEV_TARGET=192.168.1.1. |
8 |
| -# Set in your this variable in your shell startup (e.g. .bashrc) |
9 |
| -# 3) and set up the ROKU_DEV_PASSWORD environment variable, too |
10 | 1 | ##########################################################################
|
| 2 | +# Need curl and npm in your $PATH |
| 3 | +# If you want to get_images, you'll also need convert from ImageMagick |
| 4 | +########################################################################## |
| 5 | + |
| 6 | +VERSION := 1.6.6 |
| 7 | + |
| 8 | +## usage |
| 9 | + |
| 10 | +.PHONY: help |
| 11 | +help: |
| 12 | + @echo "targets" |
| 13 | + @echo " build-dev build development package" |
| 14 | + @echo " build-prod build production package" |
| 15 | + @echo " build-tests build tests package" |
| 16 | + @echo " format format brighscripts" |
| 17 | + @echo " lint lint code and documentation" |
| 18 | + @echo " get_images update official jellyfin images" |
| 19 | + @echo "targets needing ROKU_DEV_TARGET" |
| 20 | + @echo " home press the home button on device" |
| 21 | + @echo " launch launch installed" |
| 22 | + @echo "targets needing ROKU_DEV_TARGET and ROKU_DEV_PASSWORD" |
| 23 | + @echo " install install on device" |
| 24 | + @echo " remove remove installed from device" |
| 25 | + @echo " screenshot take a screenshot" |
| 26 | + @echo " deploy lint, remove, install" |
| 27 | + @echo "environment" |
| 28 | + @echo " ROKU_DEV_TARGET with device's IP" |
| 29 | + @echo " ROKU_DEV_PASSWORD with device's password" |
| 30 | + |
| 31 | +## development |
| 32 | + |
| 33 | +BUILT_PKG := out/$(notdir $(CURDIR)).zip |
| 34 | + |
| 35 | +node_modules/: package-lock.json; npm ci |
| 36 | + |
| 37 | +.PHONY: build-dev build-prod build-tests |
| 38 | +.NOTPARALLEL: build-dev build-prod build-tests # output to the same file |
| 39 | +build-dev: node_modules/; npm run build |
| 40 | +build-prod: node_modules/; npm run build-prod |
| 41 | +build-tests: node_modules/; npm run build-tests |
| 42 | + |
| 43 | +# default to build-dev if file doesn't exist |
| 44 | +$(BUILT_PKG):; $(MAKE) build-dev |
| 45 | + |
| 46 | +.PHONY: format |
| 47 | +format: node_modules/; npm run format |
| 48 | + |
| 49 | +.PHONY: lint |
| 50 | +lint: node_modules/; npm run lint |
| 51 | + |
| 52 | +## roku box |
| 53 | + |
| 54 | +CURL_CMD ?= curl --show-error |
| 55 | + |
| 56 | +ifdef ROKU_DEV_TARGET |
| 57 | + |
| 58 | +.PHONY: home launch |
| 59 | +home: |
| 60 | + $(CURL_CMD) -XPOST http://$(ROKU_DEV_TARGET):8060/keypress/home |
| 61 | + sleep 2 # wait for device reaction |
| 62 | +launch: |
| 63 | + $(CURL_CMD) -XPOST http://$(ROKU_DEV_TARGET):8060/launch/dev |
| 64 | + |
| 65 | +ifdef ROKU_DEV_PASSWORD |
| 66 | + |
| 67 | +CURL_LOGGED_CMD := $(CURL_CMD) --user rokudev:$(ROKU_DEV_PASSWORD) --digest |
| 68 | + |
| 69 | +EXTRACT_ERROR_CMD := grep "<font color" | sed "s/<font color=\"red\">//" | sed "s[</font>[[" |
| 70 | +.PHONY: install remove |
| 71 | +install: $(BUILT_PKG) home |
| 72 | + $(CURL_LOGGED_CMD) -F "mysubmit=Install" -F "archive=@$<" -F "passwd=" http://$(ROKU_DEV_TARGET)/plugin_install | $(EXTRACT_ERROR_CMD) |
| 73 | + $(MAKE) launch |
| 74 | +remove: |
| 75 | + $(CURL_LOGGED_CMD) -F "mysubmit=Delete" -F "archive=" -F "passwd=" http://$(ROKU_DEV_TARGET)/plugin_install | $(EXTRACT_ERROR_CMD) |
| 76 | + |
| 77 | +.PHONY: screenshot |
| 78 | +screenshot: |
| 79 | + $(CURL_LOGGED_CMD) -o screenshot.jpg "http://$(ROKU_DEV_TARGET)/pkgs/dev.jpg" |
| 80 | + |
| 81 | +.PHONY: deploy |
| 82 | +.NOTPARALLEL: deploy |
| 83 | +deploy: lint remove install |
| 84 | + |
| 85 | +endif # ROKU_DEV_PASSWORD |
11 | 86 |
|
12 |
| -APPNAME = Jellyfin_Roku |
13 |
| -VERSION = 1.6.6 |
| 87 | +endif # ROKU_DEV_TARGET |
14 | 88 |
|
15 |
| -ZIP_EXCLUDE= -x xml/* -x artwork/* -x \*.pkg -x storeassets\* -x keys\* -x \*/.\* -x *.git* -x *.DS* -x *.pkg* -x dist/**\* -x out/**\* |
| 89 | +## sync branding |
16 | 90 |
|
17 |
| -include app.mk |
| 91 | +CONVERT_CMD ?= convert -gravity center |
| 92 | +CONVERT_BLUEBG_CMD := $(CONVERT_CMD) -background "\#000b25" |
| 93 | +BANNER := images/banner-dark.svg |
| 94 | +ICON := images/icon-transparent.svg |
18 | 95 |
|
19 |
| -dev: |
20 |
| - $(MAKE) BUILD='dev' package |
| 96 | +images/:; mkdir $@ |
21 | 97 |
|
22 |
| -beta: |
23 |
| - $(MAKE) BUILD='beta' package |
| 98 | +.PHONY: redo # force rerun |
| 99 | +$(BANNER) $(ICON): images/ redo |
| 100 | + $(CURL_CMD) https://raw.githubusercontent.com/jellyfin/jellyfin-ux/master/branding/SVG/$(@F) > $@ |
24 | 101 |
|
25 |
| -release: |
26 |
| - $(MAKE) BUILD='release' package |
| 102 | +images/logo.png: $(BANNER); $(CONVERT_CMD) -background none -scale 1000x48 -extent 180x48 $< $@ |
| 103 | +images/channel-poster_fhd.png: $(BANNER); $(CONVERT_BLUEBG_CMD) -scale 535x400 -extent 540x405 $< $@ |
| 104 | +images/channel-poster_hd.png: $(BANNER); $(CONVERT_BLUEBG_CMD) -scale 275x205 -extent 336x210 $< $@ |
| 105 | +images/channel-poster_sd.png: $(BANNER); $(CONVERT_BLUEBG_CMD) -scale 182x135 -extent 246x140 $< $@ |
| 106 | +images/splash-screen_fhd.jpg: $(BANNER); $(CONVERT_BLUEBG_CMD) -scale 540x540 -extent 1920x1080 $< $@ |
| 107 | +images/splash-screen_hd.jpg: $(BANNER); $(CONVERT_BLUEBG_CMD) -scale 360x360 -extent 1280x720 $< $@ |
| 108 | +images/splash-screen_sd.jpg: $(BANNER); $(CONVERT_BLUEBG_CMD) -scale 240x240 -extent 720x480 $< $@ |
27 | 109 |
|
28 |
| -deploy: prep_staging remove install |
| 110 | +.PHONY: get_images |
| 111 | +get_images: $(ICON) |
| 112 | +get_images: images/logo.png |
| 113 | +get_images: images/channel-poster_fhd.png images/channel-poster_hd.png images/channel-poster_sd.png |
| 114 | +get_images: images/splash-screen_fhd.jpg images/splash-screen_hd.jpg images/splash-screen_sd.jpg |
0 commit comments