1
0
Fork 0

Adds desktop file and updates makefile and readme to reflect changes

This commit is contained in:
sloum 2021-06-24 14:46:09 -07:00
parent 10bf83a21b
commit b97fbc468d
4 changed files with 29 additions and 4 deletions

View File

@ -23,11 +23,13 @@ else
@echo Skipping upx compression
endif
.PHONY: install
install: build compress
.PHONY: install-bin
install-bin: build compress
install -d ${DESTDIR}${BINDIR}
install -m 0755 ./${BINARY} ${DESTDIR}${BINDIR}
.PHONY: install
install: install-bin install-desktop clean
.PHONY: clean
${GOCMD} clean
@ -35,3 +37,16 @@ install: build compress
.PHONY: uninstall
uninstall: clean
rm -f ${DESTDIR}${BINDIR}/${BINARY}
rm -f ${DESTDIR}${DATAROOTDIR}/applications/${BINARY}
rm -f ${DESTDIR}${DATAROOTDIR}/pixmaps/${BINARY}-icon.png
-update-desktop-database 2> /dev/null
.PHONY: install-desktop
install-desktop: ${BINARY}-icon.png
ifeq ($(shell uname), Linux)
install -d ${DESTDIR}${DATAROOTDIR}/applications
install -m 0644 ./${BINARY}.desktop ${DESTDIR}${DATAROOTDIR}/applications
install -d ${DESTDIR}${DATAROOTDIR}/pixmaps
install -m 0644 ./${BINARY}-icon.png ${DESTDIR}${DATAROOTDIR}/pixmaps
-update-desktop-database 2> /dev/null
endif

View File

@ -25,7 +25,7 @@ Most of the keys can be figured out if you don't know what they are already. I w
## Building
Minor build variations can be found for each system. Using upx (`apt install upx` or `brew install upx`) will reduce binary size by a good bit for any of these systems. After running the build command, and optionally running upx, move the resulting binary onto your path and you are good to go. Makefile coming soon<sup>TM</sup>.
Minor build variations can be found for each system. Using upx (`apt install upx` or `brew install upx`) will reduce binary size by a good bit for any of these systems. After running the build command, and optionally running upx, move the resulting binary onto your path and you are good to go.
### OSX / Linux
@ -35,7 +35,7 @@ Alternatively, you can just run a few things yourself and avoid make altogether:
`go build -ldflags "-s -w" -o gnums && upx gnums`
You would then need to move the executable to where you want it.
You would then need to move the executable to where you want it, as well as install the desktop entry/icon (linux only).
### Windows

BIN
gnums-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

10
gnums.desktop Normal file
View File

@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=gnums
GenericName=RPN Calculator
Comment=Reverse Polish Notation Calculator
Terminal=false
Categories=Utility;Calculator;
Exec=gnums
Icon=gnums-icon