Skip to content

Commit

Permalink
Project renamed to alr2appimage
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrojo committed Mar 14, 2024
1 parent 2b0ecff commit bba196f
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 85 deletions.
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<!---
[![Build](https://github.com/mgrojo/alr-appimage/actions/workflows/main.yml/badge.svg)](https://github.com/mgrojo/alr-appimage/actions/workflows/main.yml)
[![Alire](https://img.shields.io/endpoint?url=https://alire.ada.dev/badges/alr_appimage.json)](https://alire.ada.dev/crates/alr_appimage.html)
[![Alire CI/CD](https://img.shields.io/endpoint?url=https://alire-crate-ci.ada.dev/badges/alr_appimage.json)](https://alire-crate-ci.ada.dev/crates/alr_appimage.html)
[![Build](https://github.com/mgrojo/alr2appimage/actions/workflows/main.yml/badge.svg)](https://github.com/mgrojo/alr2appimage/actions/workflows/main.yml)
[![Alire](https://img.shields.io/endpoint?url=https://alire.ada.dev/badges/alr2appimage.json)](https://alire.ada.dev/crates/alr2appimage.html)
[![Alire CI/CD](https://img.shields.io/endpoint?url=https://alire-crate-ci.ada.dev/badges/alr2appimage.json)](https://alire-crate-ci.ada.dev/crates/alr2appimage.html)
-->
[![Download][download-img]][download]
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/ada-lang/Lobby)
[![Mentioned in Awesome Ada](https://awesome.re/mentioned-badge.svg)](https://github.com/ohenley/awesome-ada)

[download-img]: https://img.shields.io/github/downloads/mgrojo/alr-appimage/total.svg
[download]: https://github.com/mgrojo/alr-appimage/releases
[download-img]: https://img.shields.io/github/downloads/mgrojo/alr2appimage/total.svg
[download]: https://github.com/mgrojo/alr2appimage/releases

![Alr_Appimage](https://raw.githubusercontent.com/mgrojo/alr-appimage/master/share/alr_appimage/alr_appimage.png "alr_appimage icon")
![Alr2AppImage](https://raw.githubusercontent.com/mgrojo/alr2appimage/master/share/alr2appimage/alr2appimage.png "alr2appimage icon")

# alr_appimage
# alr2appimage

`alr_appimage` is a tool to automatically create an
`alr2appimage` is a tool to automatically create an
[AppImage](https://appimage.org/) executable from an Alire crate.

> [!NOTE] `alr2appimage` is an independent project; it is not
> affiliated to, nor supported by, Alire or AppImage projects.
# How to use the tool

There are two prerequisites for your project to work with this tool:
Expand All @@ -25,7 +28,7 @@ There are two prerequisites for your project to work with this tool:
- It must be installable using Alire, including all the needed resources.


`alr_appimage` will use the following command for installing it (this requires Alire 2.0):
`alr2appimage` will use the following command for installing it (this requires Alire 2.0):
```shell
alr install
```
Expand All @@ -39,7 +42,7 @@ The utility [linuxdeploy](https://github.com/linuxdeploy/linuxdeploy)
is automatically downloaded using `curl` or `wget` tools. If you
cannot install one of these utilities or lack an Internet connection in the
host, just put a copy of the `linuxdeploy-your_arch.AppImage` in the
crate directory, and it will be used by `alr_appimage`.
crate directory, and it will be used by `alr2appimage`.

This tool will generate a valid [Destop Entry](https://specifications.freedesktop.org/desktop-entry-spec/latest/)
for the AppImage. The following metadata will be read from your
Expand All @@ -54,15 +57,15 @@ field of the `your_crate.desktop` file:
| `executables` | `Exec` | The first executable is used as entrypoint of the AppImage.
| | `Terminal` | This field of the desktop entry will be set to `false` by default. It can be set to `true` passing the `--terminal` argument.
| | `Type` | This field of the desktop entry will be set to `Application`.
| | `Icon` | By default, the included icon (`alr_appimage.png`) will be used. It can be orverriden using the `--icon your-icon-file` argument.
| | `Icon` | By default, the included icon (`alr2appimage.png`) will be used. It can be orverriden using the `--icon your-icon-file` argument.

If your crate have resources, it is recommended to use the `resources`
If your crate has resources, it is recommended to use the `resources`
crate, or a similar mechanism, to properly load the resource files from
the installation prefix.

# Usage
```
Usage: alr_appimage [OPTIONS]...
Usage: alr2appimage [OPTIONS]...
Makes an AppImage from your Alire crate.
-h, --help Display this help text.
Expand All @@ -72,8 +75,9 @@ Makes an AppImage from your Alire crate.
```

Run inside an Alire crate to create a default AppImage of your
application. You can provide your own icon and override the default
value (false) for the terminal field.
application. With the corresponding arguments, you can provide your
own icon and override the default value (false) for the terminal
field.


# Status
Expand Down
14 changes: 9 additions & 5 deletions alire.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name = "alr_appimage"
name = "alr2appimage"
description = "Tool to create an AppImage executable from an Alire crate"
version = "0.9.1"
website = "https://github.com/mgrojo/alr-appimage"
version = "0.9.2"
website = "https://github.com/mgrojo/alr2appimage"
long-description = """
There are two prerequisites for your project to work with this tool:
- It has to be a crate with an `executables` field. Its first value
has to be the main application program.
- It must be installable using Alire, including all the needed resources.
`alr_appimage` will use the following command for installing it (this requires Alire 2.0):
`alr2appimage` will use the following command for installing it (this requires Alire 2.0):
```shell
alr install
```
Expand All @@ -17,6 +17,10 @@ Or it will run `gprinstall` inside `alr exec`, if the former fails (Alire 1.x).
If you simply run the tool inside an Alire crate, it will read the
metadata from your `alire.toml` file and create a default AppImage
from it.
NOTE: `alr2appimage` is an independent project; it is not
affiliated to, nor supported by, the Alire or AppImage projects.
"""
licenses = "GPL-3.0-only"

Expand All @@ -26,7 +30,7 @@ authors = ["Manuel Gomez"]
maintainers = ["Manuel Gomez <mgrojo@gmail.com>"]
maintainers-logins = ["mgrojo"]

executables = ["alr_appimage"]
executables = ["alr2appimage"]
[[depends-on]]
ada_toml = "^0.3.0"

Expand Down
12 changes: 6 additions & 6 deletions alr_appimage.gpr → alr2appimage.gpr
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
with "config/alr_appimage_config.gpr";
project Alr_Appimage is
with "config/alr2appimage_config.gpr";
project Alr2AppImage is

for Source_Dirs use ("src/", "config/");
for Object_Dir use "obj/" & Alr_Appimage_Config.Build_Profile;
for Object_Dir use "obj/" & Alr2AppImage_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Exec_Dir use "bin";
for Main use ("alr_appimage.adb");
for Main use ("alr2appimage.adb");

package Compiler is
for Default_Switches ("Ada") use Alr_Appimage_Config.Ada_Compiler_Switches;
for Default_Switches ("Ada") use Alr2AppImage_Config.Ada_Compiler_Switches;
end Compiler;

package Binder is
Expand All @@ -19,4 +19,4 @@ project Alr_Appimage is
for Artifacts (".") use ("share");
end Install;

end Alr_Appimage;
end Alr2AppImage;
20 changes: 0 additions & 20 deletions config/alr_appimage_config.ads

This file was deleted.

28 changes: 0 additions & 28 deletions config/alr_appimage_config.gpr

This file was deleted.

4 changes: 2 additions & 2 deletions image/alr_appimage.svg → image/alr2appimage.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
12 changes: 6 additions & 6 deletions src/alr_appimage.adb → src/alr2appimage.adb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ with Ada.Directories;
with Ada.Text_IO; use Ada.Text_IO;

with Alire_TOML;
with Alr_Appimage_Config;
with Alr2appimage_Config;
with Desktop_File;
with File_Manager;
with Runner;
Expand All @@ -13,7 +13,7 @@ with String_Vectors;
with Parse_Args;
with Resources;

procedure Alr_Appimage is
procedure Alr2AppImage is

use Parse_Args;

Expand All @@ -23,7 +23,7 @@ procedure Alr_Appimage is
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
end Report_Failure;

package My_Resources is new Resources (Alr_Appimage_Config.Crate_Name);
package My_Resources is new Resources (Alr2appimage_Config.Crate_Name);

AP : Argument_Parser;
Success : Boolean;
Expand All @@ -40,7 +40,7 @@ begin
& "i.e. the application is for the terminal or requires "
& "to be run from a terminal.");

AP.Add_Option (Make_String_Option (My_Resources.Resource_Path & "alr_appimage.png"),
AP.Add_Option (Make_String_Option (My_Resources.Resource_Path & "alr2appimage.png"),
"icon", 'i',
Usage => "Specify the icon file for the AppImage");

Expand All @@ -53,7 +53,7 @@ begin
return;

elsif AP.Parse_Success and then AP.Boolean_Value ("version") then
Put_Line (Alr_Appimage_Config.Crate_Name & " version: " & Alr_Appimage_Config.Crate_Version);
Put_Line (Alr2appimage_Config.Crate_Name & " version: " & Alr2appimage_Config.Crate_Version);
return;

elsif not AP.Parse_Success then
Expand Down Expand Up @@ -120,4 +120,4 @@ begin
end Deploy;
end Make_AppImage;

end Alr_Appimage;
end Alr2AppImage;
4 changes: 2 additions & 2 deletions src/file_manager.ads
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
with Alr_Appimage_Config;
with Alr2appimage_Config;

package File_Manager is

Expand All @@ -10,6 +10,6 @@ package File_Manager is
function Create_Temporary_Directory (Template : String) return String;

function To_AppImage_File (Name : String) return String is
(Name & '-' & Alr_Appimage_Config.Alire_Host_Arch & ".AppImage");
(Name & '-' & Alr2appimage_Config.Alire_Host_Arch & ".AppImage");

end File_Manager;
2 changes: 1 addition & 1 deletion src/runner.adb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ with Spoon;

package body Runner is

App_Dir_Template : constant String := "alr-appimage-AppDir-XXXXXX";
App_Dir_Template : constant String := "alr2appimage-AppDir-XXXXXX";

Installation_Subdir : constant String := "/usr";

Expand Down

0 comments on commit bba196f

Please sign in to comment.