From bba196f9f07e5b46f6697f8b2882b529b6f79d3f Mon Sep 17 00:00:00 2001 From: mgrojo Date: Thu, 14 Mar 2024 21:05:12 +0100 Subject: [PATCH] Project renamed to alr2appimage --- README.md | 34 ++++++++++-------- alire.toml | 14 +++++--- alr_appimage.gpr => alr2appimage.gpr | 12 +++---- config/alr_appimage_config.ads | 20 ----------- config/alr_appimage_config.gpr | 28 --------------- image/{alr_appimage.svg => alr2appimage.svg} | 4 +-- .../alr2appimage.png} | Bin src/{alr_appimage.adb => alr2appimage.adb} | 12 +++---- src/file_manager.ads | 4 +-- src/runner.adb | 2 +- 10 files changed, 45 insertions(+), 85 deletions(-) rename alr_appimage.gpr => alr2appimage.gpr (62%) delete mode 100644 config/alr_appimage_config.ads delete mode 100644 config/alr_appimage_config.gpr rename image/{alr_appimage.svg => alr2appimage.svg} (99%) rename share/{alr_appimage/alr_appimage.png => alr2appimage/alr2appimage.png} (100%) rename src/{alr_appimage.adb => alr2appimage.adb} (93%) diff --git a/README.md b/README.md index 43163b8..b9852bc 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,25 @@ [![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: @@ -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 ``` @@ -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 @@ -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. @@ -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 diff --git a/alire.toml b/alire.toml index d296354..d4302db 100644 --- a/alire.toml +++ b/alire.toml @@ -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 ``` @@ -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" @@ -26,7 +30,7 @@ authors = ["Manuel Gomez"] maintainers = ["Manuel Gomez "] maintainers-logins = ["mgrojo"] -executables = ["alr_appimage"] +executables = ["alr2appimage"] [[depends-on]] ada_toml = "^0.3.0" diff --git a/alr_appimage.gpr b/alr2appimage.gpr similarity index 62% rename from alr_appimage.gpr rename to alr2appimage.gpr index abf66e9..b06743c 100644 --- a/alr_appimage.gpr +++ b/alr2appimage.gpr @@ -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 @@ -19,4 +19,4 @@ project Alr_Appimage is for Artifacts (".") use ("share"); end Install; -end Alr_Appimage; +end Alr2AppImage; diff --git a/config/alr_appimage_config.ads b/config/alr_appimage_config.ads deleted file mode 100644 index 44431c6..0000000 --- a/config/alr_appimage_config.ads +++ /dev/null @@ -1,20 +0,0 @@ --- Configuration for alr_appimage generated by Alire -pragma Restrictions (No_Elaboration_Code); -pragma Style_Checks (Off); - -package Alr_Appimage_Config is - pragma Pure; - - Crate_Version : constant String := "0.9.0"; - Crate_Name : constant String := "alr_appimage"; - - Alire_Host_OS : constant String := "linux"; - - Alire_Host_Arch : constant String := "x86_64"; - - Alire_Host_Distro : constant String := "ubuntu"; - - type Build_Profile_Kind is (release, validation, development); - Build_Profile : constant Build_Profile_Kind := release; - -end Alr_Appimage_Config; diff --git a/config/alr_appimage_config.gpr b/config/alr_appimage_config.gpr deleted file mode 100644 index e36d402..0000000 --- a/config/alr_appimage_config.gpr +++ /dev/null @@ -1,28 +0,0 @@ --- Configuration for alr_appimage generated by Alire -with "ada_toml.gpr"; -with "parse_args.gpr"; -with "resources.gpr"; -with "spoon.gpr"; -abstract project Alr_Appimage_Config is - Crate_Version := "0.9.0"; - Crate_Name := "alr_appimage"; - - Alire_Host_OS := "linux"; - - Alire_Host_Arch := "x86_64"; - - Alire_Host_Distro := "ubuntu"; - Ada_Compiler_Switches := External_As_List ("ADAFLAGS", " "); - Ada_Compiler_Switches := Ada_Compiler_Switches & - ( - "-O3" -- Optimize for performance - ,"-gnatn" -- Enable inlining - ,"-ffunction-sections" -- Separate ELF section for each function - ,"-fdata-sections" -- Separate ELF section for each variable - ,"-gnatW8" -- UTF-8 encoding for wide characters - ); - - type Build_Profile_Kind is ("release", "validation", "development"); - Build_Profile : Build_Profile_Kind := "release"; - -end Alr_Appimage_Config; diff --git a/image/alr_appimage.svg b/image/alr2appimage.svg similarity index 99% rename from image/alr_appimage.svg rename to image/alr2appimage.svg index 44cd8ea..3a9cd7a 100644 --- a/image/alr_appimage.svg +++ b/image/alr2appimage.svg @@ -7,8 +7,8 @@ id="svg3832" version="1.1" inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" - sodipodi:docname="alr-appimage.svg" - inkscape:export-filename="/home/mgr/src/github/mgrojo/alr-appimage/alr_appimage.png" + sodipodi:docname="alr2appimage.svg" + inkscape:export-filename="/home/mgr/src/github/mgrojo/alr2appimage/alr_appimage.png" inkscape:export-xdpi="96" inkscape:export-ydpi="96" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" diff --git a/share/alr_appimage/alr_appimage.png b/share/alr2appimage/alr2appimage.png similarity index 100% rename from share/alr_appimage/alr_appimage.png rename to share/alr2appimage/alr2appimage.png diff --git a/src/alr_appimage.adb b/src/alr2appimage.adb similarity index 93% rename from src/alr_appimage.adb rename to src/alr2appimage.adb index 0ec73c2..b078ec1 100644 --- a/src/alr_appimage.adb +++ b/src/alr2appimage.adb @@ -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; @@ -13,7 +13,7 @@ with String_Vectors; with Parse_Args; with Resources; -procedure Alr_Appimage is +procedure Alr2AppImage is use Parse_Args; @@ -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; @@ -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"); @@ -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 @@ -120,4 +120,4 @@ begin end Deploy; end Make_AppImage; -end Alr_Appimage; +end Alr2AppImage; diff --git a/src/file_manager.ads b/src/file_manager.ads index 828828f..09b083d 100644 --- a/src/file_manager.ads +++ b/src/file_manager.ads @@ -1,4 +1,4 @@ -with Alr_Appimage_Config; +with Alr2appimage_Config; package File_Manager is @@ -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; diff --git a/src/runner.adb b/src/runner.adb index ecdfc97..e993997 100644 --- a/src/runner.adb +++ b/src/runner.adb @@ -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";