forked from Stremio/stremio-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppImage.makefile
56 lines (36 loc) · 1.51 KB
/
AppImage.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
52
53
54
55
VERSION := $(shell grep -oPm1 'VERSION=\K.+' stremio.pro)
NSS_DIR := /usr/lib/x86_64-linux-gnu/nss
DEST_DIR := dist-linux
BUILD_DIR := build
RELEASE_DIR := release
QT_BIN_PATH ?= /usr/share/qt5
ICON_BIN := images/stremio.png
SERVER_JS := ${DEST_DIR}/server.js
STREMIO_DESKTOP := stremio.desktop
STREMIO_BIN := ${BUILD_DIR}/stremio
NODE_BIN := $(shell which node)
FFMPEG_BIN := $(shell which ffmpeg)
FFPROBE_BIN := $(shell which ffprobe)
QT_RESOURCES = ${QT_BIN_PATH}/resources
QT_TRANSLATIONS = ${QT_BIN_PATH}/translations
APPIMAGE_FILE := Stremio-v${VERSION}-x86_64.AppImage
ALL: ${APPIMAGE_FILE}
${DEST_DIR}: ${STREMIO_BIN} ${NODE_BIN} ${FFMPEG_BIN} ${FFPROBE_BIN} ${ICON_BIN} ${STREMIO_DESKTOP} ${QT_RESOURCES} ${QT_TRANSLATIONS}
mkdir -p ${DEST_DIR}/lib
cp -r $^ ${DEST_DIR}/
cp -r ${NSS_DIR} ${DEST_DIR}/lib/
${APPIMAGE_FILE}: ${SERVER_JS} linuxdeployqt
./linuxdeployqt --appimage-extract
#This will create Stremio-x86_64.AppImage
./squashfs-root/AppRun ${DEST_DIR}/stremio -qmldir=. -bundle-non-qt-libs -appimage
${SERVER_JS}: ${DEST_DIR}
wget "https://s3-eu-west-1.amazonaws.com/stremio-artifacts/four/v${VERSION}/server.js" -qO ${SERVER_JS} || rm ${SERVER_JS}
linuxdeployqt:
wget "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -qO $@ || rm $@
chmod 700 $@
clean:
rm -rf linuxdeployqt ${BUILD_DIR} ${DEST_DIR} ${RELEASE_DIR} ${APPIMAGE_FILE}
${STREMIO_BIN}: ${BUILD_DIR}
cd ${BUILD_DIR} && qmake .. && make -j
${BUILD_DIR}:
mkdir ${BUILD_DIR}