remove make dependency in packaged Linux build

This commit is contained in:
Damien Elmes 2020-11-20 19:33:40 +10:00
parent e23d40e850
commit a4d70c88e3
4 changed files with 49 additions and 45 deletions

View File

@ -1,40 +0,0 @@
PREFIX=/usr/local
all:
@echo "You can run Anki with ./bin/Anki"
@echo "If you wish to install it system wide, type 'sudo make install',"
@echo "then run with 'anki'."
@echo "Uninstall with 'sudo make uninstall'"
install:
rm -rf ${PREFIX}/share/anki
mkdir -p ${PREFIX}/share/anki
cp -av * ${PREFIX}/share/anki/
mkdir -p ${PREFIX}/bin
ln -sf ${PREFIX}/share/anki/bin/Anki ${PREFIX}/bin/anki
# fix a previous packaging issue where we created this as a file
(test -f ${PREFIX}/share/applications && rm ${PREFIX}/share/applications)||true
mkdir -p ${PREFIX}/share/pixmaps
mkdir -p ${PREFIX}/share/applications
mkdir -p ${PREFIX}/share/man/man1
cd ${PREFIX}/share/anki && (\
mv anki.xpm anki.png ${PREFIX}/share/pixmaps/;\
mv anki.desktop ${PREFIX}/share/applications/;\
mv anki.1 ${PREFIX}/share/man/man1/)
xdg-mime install anki.xml --novendor
xdg-mime default anki.desktop application/x-colpkg
xdg-mime default anki.desktop application/x-apkg
xdg-mime default anki.desktop application/x-ankiaddon
@echo
@echo "Install complete. Type 'anki' to run."
uninstall:
-xdg-mime uninstall ${PREFIX}/share/anki/anki.xml
rm -rf ${PREFIX}/share/anki
rm -rf ${PREFIX}/bin/anki
rm -rf ${PREFIX}/share/pixmaps/anki.xpm
rm -rf ${PREFIX}/share/pixmaps/anki.png
rm -rf ${PREFIX}/share/applications/anki.desktop
rm -rf ${PREFIX}/share/man/man1/anki.1
@echo
@echo "Uninstall complete."

View File

@ -2,11 +2,8 @@ To run, change to this folder in a terminal and run the following command:
./bin/Anki
- To install system wide, ensure you have make installed
(eg in Ubuntu, run 'sudo apt install make' in a terminal)
- Run 'sudo make install'
- Start Anki with 'anki'
- To remove in the future, run 'sudo make uninstall' from the same folder.
- To install system wide, run 'sudo ./install.sh'
- To remove in the future, run 'sudo ./uninstall.sh' from the same folder.
To play and record audio, mpv and lame must be installed. If mpv is not
installed or too old, Anki will try to fall back on using mplayer.

29
qt/linux/install.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
set -e
if [ "$PREFIX" = "" ]; then
PREFIX=/usr/local
fi
rm -rf ${PREFIX}/share/anki
mkdir -p ${PREFIX}/share/anki
cp -av * ${PREFIX}/share/anki/
mkdir -p ${PREFIX}/bin
ln -sf ${PREFIX}/share/anki/bin/Anki ${PREFIX}/bin/anki
# fix a previous packaging issue where we created this as a file
(test -f ${PREFIX}/share/applications && rm ${PREFIX}/share/applications)||true
mkdir -p ${PREFIX}/share/pixmaps
mkdir -p ${PREFIX}/share/applications
mkdir -p ${PREFIX}/share/man/man1
cd ${PREFIX}/share/anki && (\
mv anki.xpm anki.png ${PREFIX}/share/pixmaps/;\
mv anki.desktop ${PREFIX}/share/applications/;\
mv anki.1 ${PREFIX}/share/man/man1/)
xdg-mime install anki.xml --novendor
xdg-mime default anki.desktop application/x-colpkg
xdg-mime default anki.desktop application/x-apkg
xdg-mime default anki.desktop application/x-ankiaddon
echo "Install complete. Type 'anki' to run."

18
qt/linux/uninstall.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -e
if [ "$PREFIX" = "" ]; then
PREFIX=/usr/local
fi
xdg-mime uninstall ${PREFIX}/share/anki/anki.xml || true
rm -rf ${PREFIX}/share/anki
rm -rf ${PREFIX}/bin/anki
rm -rf ${PREFIX}/share/pixmaps/anki.xpm
rm -rf ${PREFIX}/share/pixmaps/anki.png
rm -rf ${PREFIX}/share/applications/anki.desktop
rm -rf ${PREFIX}/share/man/man1/anki.1
echo "Uninstall complete."