forked from area-of-dev/Zotero.AppImage
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (42 loc) · 2.7 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
# Copyright 2020 Alex Woroschilow ([email protected])
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
PWD:=$(shell pwd)
all: clean
mkdir --parents $(PWD)/build/Boilerplate.AppDir/zotero
apprepo --destination=$(PWD)/build appdir boilerplate libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0 libffi7
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo 'LD_LIBRARY_PATH=$${LD_LIBRARY_PATH}:$${APPDIR}/zotero' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo 'export LD_LIBRARY_PATH=$${LD_LIBRARY_PATH}' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo 'UUC_VALUE=`cat /proc/sys/kernel/unprivileged_userns_clone 2> /dev/null`' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo 'if [ -z "$${UUC_VALUE}" ]' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo ' then' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo ' exec $${APPDIR}/zotero/zotero --no-sandbox "$${@}"' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo ' else' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo ' exec $${APPDIR}/zotero/zotero "$${@}"' >> $(PWD)/build/Boilerplate.AppDir/AppRun
echo ' fi' >> $(PWD)/build/Boilerplate.AppDir/AppRun
wget --output-document=$(PWD)/build/build.tar.bz2 https://download.zotero.org/client/release/5.0.93/Zotero-5.0.93_linux-x86_64.tar.bz2
tar -xf $(PWD)/build/build.tar.bz2 -C $(PWD)/build/
cp --force --recursive $(PWD)/build/Zotero_*/* $(PWD)/build/Boilerplate.AppDir/zotero
rm --force $(PWD)/build/Boilerplate.AppDir/*.desktop
cp --force $(PWD)/AppDir/*.desktop $(PWD)/build/Boilerplate.AppDir/
cp --force $(PWD)/AppDir/*.png $(PWD)/build/Boilerplate.AppDir/ || true
cp --force $(PWD)/AppDir/*.svg $(PWD)/build/Boilerplate.AppDir/ || true
export ARCH=x86_64 && $(PWD)/bin/appimagetool.AppImage $(PWD)/build/Boilerplate.AppDir $(PWD)/Zotero.AppImage
chmod +x $(PWD)/Zotero.AppImage
clean:
rm -rf $(PWD)/build