plchat/Makefile

87 lines
2.5 KiB
Makefile
Raw Normal View History

2021-04-15 15:16:38 -05:00
ifeq ($(PREFIX),)
2021-04-17 12:38:40 -05:00
PREFIX := /usr/local/
endif
ifeq ($(LIBDIR),)
LIBDIR := lib/
2021-04-15 15:16:38 -05:00
endif
2021-04-24 15:38:35 -05:00
VER = $(shell cat installer.cfg | grep version= | head -n 1 | sed s/version=//)
2021-04-15 15:16:38 -05:00
2021-04-16 20:59:52 -05:00
all: default pack
systemlibs: systemlibtarget pack
2021-04-25 14:37:04 -05:00
dpkg: debtarget dpkg-build
2021-04-24 15:38:35 -05:00
windows: wtarget wpack
2021-04-16 20:59:52 -05:00
default:
python3 -m nuitka --follow-imports --file-reference-choice=runtime --include-module=certifi --include-module=keyring.backends.kwallet --include-module=keyring.backends.chainer --enable-plugin=qt-plugins --include-qt-plugins=all --python-flag=-O -o plchat plchat.py
2021-04-17 15:31:25 -05:00
debtarget:
2021-04-25 14:37:04 -05:00
mkdir -p deb/usr/lib/plchat
echo "#!/usr/lib/plchat/venv/bin/python" > deb/usr/lib/plchat/plchatdeb.py
echo "" >> deb/usr/lib/plchat/plchatdeb.py
cat plchat.py >> deb/usr/lib/plchat/plchatdeb.py
chmod +x deb/usr/lib/plchat/plchatdeb.py
cp fedi.svg deb/usr/lib/plchat
2021-04-25 15:53:05 -05:00
cp fedi_color.svg deb/usr/lib/plchat
2021-04-25 14:37:04 -05:00
cp fedi.ico deb/usr/lib/plchat
2021-04-25 15:53:05 -05:00
cp notif.wav deb/usr/lib/plchat
2021-04-25 14:37:04 -05:00
cp send.svg deb/usr/lib/plchat
cp unread.svg deb/usr/lib/plchat
cp README.md deb/usr/lib/plchat
cp LICENSE deb/usr/lib/plchat
cp COPYING deb/usr/lib/plchat
cp audiowidget.py deb/usr/lib/plchat
cp misc.py deb/usr/lib/plchat
cp pleroma.py deb/usr/lib/plchat
cp monkeypatch.py deb/usr/lib/plchat
cp timeconvert.py deb/usr/lib/plchat
cp videowidget.py deb/usr/lib/plchat
2021-04-16 20:59:52 -05:00
systemlibtarget:
python3 -m nuitka --file-reference-choice=runtime --nofollow-imports --follow-import-to=misc --follow-import-to=monkeypatch --follow-import-to=pleroma --follow-import-to=timeconvert --follow-import-to=videowidget --follow-import-to=audiowidget --python-flag=-O -o plchat plchat.py
2021-04-16 20:59:52 -05:00
2021-04-24 15:38:35 -05:00
windowstarget:
2021-04-24 15:08:45 -05:00
cat windows.patch > plchatwindows.py
cat plchat.py >> plchatwindows.py
makensis -VERSION || die "No makensis in path"
python3 -m nsist installer.cfg
2021-04-24 15:38:35 -05:00
wpack:
mv build/nsis/PlChat_$(VER).exe .
zip plchat_windows.zip PlChat_$(VER).exe
2021-04-24 15:08:45 -05:00
2021-04-16 20:59:52 -05:00
pack:
mkdir dist
mv plchat dist
cp fedi.svg dist
2021-04-25 15:53:05 -05:00
cp notif.wav dist
cp fedi_color.svg dist
2021-04-16 20:59:52 -05:00
cp fedi.ico dist
cp send.svg dist
cp unread.svg dist
2021-04-17 15:31:25 -05:00
cp README.md dist
cp LICENSE dist
cp COPYING dist
2021-04-16 20:59:52 -05:00
dpkg-build:
2021-04-18 19:57:22 -05:00
dpkg --build deb
mv deb.deb plchat.deb
2021-04-16 20:59:52 -05:00
clean:
2021-04-16 22:22:31 -05:00
rm -r dist || true
2021-04-24 15:38:35 -05:00
rm -r build || true
rm -r deb/usr || true
2021-04-16 22:22:31 -05:00
install:
2021-04-17 12:38:40 -05:00
mkdir $(PREFIX)$(LIBDIR)
install dist/plchat $(PREFIX)$(LIBDIR)
install dist/fedi.ico $(PREFIX)$(LIBDIR)
install dist/fedi.svg $(PREFIX)$(LIBDIR)
2021-04-25 15:53:05 -05:00
install dist/fedi_color.svg $(PREFIX)$(LIBDIR)
install dist/notif.wav $(PREFIX)$(LIBDIR)
2021-04-17 12:38:40 -05:00
install dist/send.svg $(PREFIX)$(LIBDIR)
install dist/unread.svg $(PREFIX)$(LIBDIR)
2021-04-18 12:41:45 -05:00
ln -sf $(PREFIX)$(LIBDIR)plchat $(PREFIX)bin/plchat