Skip to content

Commit

Permalink
Add AppImage to make release
Browse files Browse the repository at this point in the history
  • Loading branch information
ncravino committed Nov 5, 2023
1 parent 2c32933 commit bb3a2a0
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
build/
.qmake.stash
packaging/*
dist/*
32 changes: 27 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
VERSION := $(shell cat VERSION)
DATE := $(shell date +"%Y-%m-%d")

default: build

.PHONY: icon
icon:
convert ./resources/icons/giduba.svg -define icon:auto-resize="256,128,96,64,48,32,16" ./resources/icons/giduba.ico
convert ./resources/icons/giduba.svg -resize 32 ./resources/icons/giduba.png
convert ./resources/icons/giduba.svg -resize 256 ./resources/icons/giduba.png

./build/:
mkdir -p build && cd build && qmake ../Giduba.pro
Expand All @@ -31,11 +32,13 @@ run:
prepare-deb: build
rm -rf ./packaging/deb/ && \
mkdir -p ./packaging/deb/giduba/usr/bin && \
mkdir -p ./packaging/deb/giduba//usr/share/applications && \
mkdir -p ./packaging/deb/giduba/usr/share/applications && \
mkdir -p ./packaging/deb/giduba/usr/share/metainfo && \
mkdir -p ./packaging/deb/giduba/usr/share/icons/hicolor/scalable/apps/ && \
mkdir -p ./packaging/deb/giduba/DEBIAN && \
VERSION=${VERSION} envsubst < ./scripts/packaging//control > ./packaging/deb/giduba/DEBIAN/control && \
cp ./scripts/packaging//giduba.desktop ./packaging/deb/giduba/usr/share/applications/ && \
VERSION=${VERSION} DATE=${DATE} envsubst < ./scripts/packaging/com.ncravino.giduba.appdata.xml > ./packaging/deb/giduba/usr/share/metainfo/com.ncravino.giduba.appdata.xml && \
cp ./scripts/packaging/com.ncravino.giduba.desktop ./packaging/deb/giduba/usr/share/applications/ && \
cp ./resources/icons/giduba.svg ./packaging/deb/giduba/usr/share/icons/hicolor/scalable/apps/ && \
cp ./build/Giduba ./packaging/deb/giduba/usr/bin/

Expand All @@ -54,12 +57,31 @@ deb: prepare-deb
tgz: prepare-tgz
cd ./packaging/tgz/ && tar -czf giduba-${VERSION}.tar.gz ./giduba/*

.PHONY: prepare-appimage
prepare-appimage: build
rm -rf ./packaging/appimage && \
mkdir -p ./packaging/appimage/AppDir/usr/bin/ && \
mkdir -p ./packaging/appimage/AppDir/usr/share/metainfo/ && \
VERSION=${VERSION} DATE=${DATE} envsubst < ./scripts/packaging/com.ncravino.giduba.appdata.xml > ./packaging/appimage/AppDir/usr/share/metainfo/com.ncravino.giduba.appdata.xml && \
cp ./scripts/packaging/com.ncravino.giduba.desktop ./packaging/appimage/ && \
cp ./resources/icons/giduba.svg ./packaging/appimage && \
cp ./build/Giduba ./packaging/appimage/AppDir/usr/bin/

.PHONY: appimage
appimage: prepare-appimage
cd ./packaging/appimage/ && \
linuxdeploy-x86_64.AppImage --appdir AppDir -d ./com.ncravino.giduba.desktop -i ./giduba.svg --output appimage



.PHONY: release
release: clean deb tgz
release: clean deb tgz appimage
mkdir -p ./dist/ && \
cp ./packaging/tgz/giduba-${VERSION}.tar.gz ./dist/ && \
cp ./packaging/deb/giduba-${VERSION}.deb ./dist/
cp ./packaging/deb/giduba-${VERSION}.deb ./dist/ && \
cp ./packaging/appimage/Giduba-x86_64.AppImage ./dist/

.PHONY: deb-install-build-depends
deb-install-build-depends:
sudo apt update && sudo apt install make qt5-qmake qtbase5-dev build-essential

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Giduba is the sumerian word for writing utensils, literally a reed that was cut

## Installing

You can find both .deb and .tar.gz releases in [https://github.com/ncravino/giduba/releases](https://github.com/ncravino/giduba/releases).
You can find both .deb, AppImage, and .tar.gz releases in [https://github.com/ncravino/giduba/releases](https://github.com/ncravino/giduba/releases).

To install a .deb, simply download it and run:
- `sudo dpkg -i filename.deb`

Expand Down
Binary file modified resources/icons/giduba.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions scripts/packaging/com.ncravino.giduba.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>com.ncravino.giduba</id>
<name>Giduba</name>
<summary>A small and fast text editor</summary>
<description>
<p>Giduba is a small and simple QT based text editor for quick text editing and manipulation tasks.</p>
<p>It provides:</p>
<ul>
<li>Unicode Support</li>
<li>Configurable via configuration file</li>
<li>Character, word, and line counter</li>
<li>Search and Replace</li>
<li>Word Wrapping</li>
<li>Remember last window geometry state</li>
</ul>
</description>
<content_rating type="oars-1.0"/>
<url type="homepage">https://github.com/ncravino/giduba</url>
<launchable type="desktop-id">com.ncravino.giduba.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<screenshots>
<screenshot type="default">
<caption>Giduba under KDE Plasma</caption>
<image>https://github.com/ncravino/giduba/blob/main/images/screenshot.png</image>
</screenshot>
</screenshots>

<provides>
<binary>Giduba</binary>
</provides>
<releases>
<release version="$VERSION" date="$DATE" />
</releases>
<developer_name>Nuno Cravino</developer_name>
</component>



Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[Desktop Entry]
MimeType=text/plain;inode/directory;
StartupWMClass=com.ncravino.giduba
Name=Giduba
Comment=A lean, small, and simple text editor in QT
Exec=Giduba %F
Expand Down
4 changes: 2 additions & 2 deletions src/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,11 @@ Editor::Editor(int argc, char ** argv){
this->main = new Ui::MainWindow();

QApplication::setWindowIcon(this->icon);
QApplication::setDesktopFileName("giduba"); //needed for wayland et al to show icon in window
QApplication::setDesktopFileName("com.ncravino.giduba"); //needed for wayland et al to show icon in window

this->app->setApplicationVersion(QString(VERSION));
this->app->setApplicationDisplayName("Giduba");
this->app->setApplicationName("Giduba");
this->app->setApplicationName("com.ncravino.giduba");
this->app->setQuitOnLastWindowClosed(true);

this->main->setupUi(this->window);
Expand Down

0 comments on commit bb3a2a0

Please sign in to comment.