From a0b495a283c9476783158471a084c5a47226e617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 5 Sep 2023 19:33:26 +0200 Subject: [PATCH] Packager: Support for extra dependencies and extra file for AppImage. Application identifier is now configurable. [DEVELOPMENT ENVIRONMENT] * NEW: Packager: Support for extra dependencies and extra file for AppImage. * NEW: Packager: Application identifier is now configurable. * NEW: Update French translation. --- app/src/gambas3/.lang/fr.po | 46 +++++++++---------- app/src/gambas3/.project | 1 + .../gambas3/.src/Packager/FMakeInstall.class | 9 ++++ .../gambas3/.src/Packager/FMakeInstall.form | 27 ++++++++--- app/src/gambas3/.src/Packager/Package.module | 40 ++++++++++------ app/src/gambas3/.src/Project.module | 6 +++ 6 files changed, 82 insertions(+), 47 deletions(-) diff --git a/app/src/gambas3/.lang/fr.po b/app/src/gambas3/.lang/fr.po index dac8134ac..f4bb949f9 100644 --- a/app/src/gambas3/.lang/fr.po +++ b/app/src/gambas3/.lang/fr.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: gambas3 3.18.90\n" -"PO-Revision-Date: 2023-09-05 04:59 UTC\n" +"PO-Revision-Date: 2023-09-05 16:24 UTC\n" "Last-Translator: benoit \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -238,19 +238,19 @@ msgstr "'&1.&2' est en écriture seule" msgid "',' or ')'" msgstr "',' ou ')'" -#: Package.module:1224 +#: Package.module:1223 msgid "'dpkg-buildpackage' has failed." msgstr "'dpkg-buildpackage' a échoué." -#: Package.module:2496 +#: Package.module:2495 msgid "'makepkg' has failed." msgstr "'makepkg' a échoué." -#: Package.module:1795 +#: Package.module:1794 msgid "'rpmbuild' has returned the following error code:" msgstr "'rpmbuild' a retourné le code d'erreur suivant :" -#: Package.module:2208 +#: Package.module:2207 msgid "'tar' has returned the following error code:" msgstr "'tar' a retourné le code d'erreur suivant:" @@ -443,7 +443,7 @@ msgstr "Ajouter au référentiel" #: FMakeInstall.form:198 FOption.form:441 msgid "Add vendor prefix or name to package names" -msgstr "Ajouter le préfixe ou le nom du vendeur aux noms des paquets" +msgstr "Ajouter le préfixe ou le nom du fournisseur aux noms des paquets" #: FConflictEditor.form:134 FEditor.form:152 FTextEditor.form:170 msgid "Advanced" @@ -545,10 +545,6 @@ msgstr "Anonyme" msgid "Another extern debugging is active." msgstr "Un autre débogage externe est actif." -#: Package.module:117 -msgid "AppImage does not support OpenGL." -msgstr "AppImage ne gère pas OpenGL." - #: CDocumentation.class:71 msgid "Application debugger helper" msgstr "Debogueur intégré" @@ -1749,23 +1745,23 @@ msgstr "Créer des liens symboliques" msgid "Create table" msgstr "Nouvelle table" -#: Package.module:1556 +#: Package.module:1555 msgid "Creating .spec file." msgstr "Creation du fichier .spec." -#: Package.module:2927 +#: Package.module:2933 msgid "Creating AppImage..." msgstr "Création de l'AppImage..." -#: Package.module:1005 +#: Package.module:1004 msgid "Creating desktop file..." msgstr "Création du fichier *.desktop..." -#: Package.module:1218 +#: Package.module:1217 msgid "Creating package..." msgstr "Création du paquet..." -#: Package.module:834 +#: Package.module:833 msgid "Creating package for &1." msgstr "Création du paquet pour &1." @@ -1773,7 +1769,7 @@ msgstr "Création du paquet pour &1." msgid "Creating packages..." msgstr "Creation des paquets..." -#: Package.module:1532 +#: Package.module:1531 msgid "Creating source package." msgstr "Création du paquet des sources." @@ -3108,7 +3104,7 @@ msgstr "Gamma" msgid "Generate patch" msgstr "Générer un patch" -#: Package.module:2839 +#: Package.module:2845 msgid "Generating 'AppImageBuilder' configuration file..." msgstr "Génération du fichier de configuration de 'AppImageBuilder'." @@ -3497,7 +3493,7 @@ msgstr "Inclure les informations de" msgid "Incorrect characters" msgstr "Caractères incorrects" -#: Package.module:1438 +#: Package.module:1437 msgid "Incorrect date in ChangeLog: &1" msgstr "Date incorrecte dans le ChangeLog : « &1 »" @@ -3573,7 +3569,7 @@ msgstr "dans la définition du formulaire" msgid "Initialize remote debugging..." msgstr "Initialisation du débogage distant..." -#: Package.module:1512 +#: Package.module:1511 msgid "Initializing ~/RPM directory." msgstr "Initialisation du répertoire ~/RPM." @@ -4054,11 +4050,11 @@ msgstr "Générer une archive des sources" msgid "Make transparent" msgstr "Rendre transparent" -#: Package.module:768 +#: Package.module:767 msgid "Making &1 support package..." msgstr "Création du paquet de support &1..." -#: Package.module:946 +#: Package.module:945 msgid "Making build directory." msgstr "Fabrication du répertoire de construction." @@ -6447,7 +6443,7 @@ msgstr "Paquets sources" msgid "Sources" msgstr "Sources" -#: Package.module:1013 +#: Package.module:1012 msgid "Sources are being debianizated." msgstr "\"Debianisation\" des sources..." @@ -7004,7 +7000,7 @@ msgstr "Le nom ne peut pas commencer par un point." msgid "The name of the control." msgstr "Le nom du controle." -#: Package.module:875 +#: Package.module:874 msgid "The package build has failed." msgstr "La construction des paquets a échoué." @@ -7704,7 +7700,7 @@ msgstr "Impossible de copier la table." msgid "Unable to create a new branch." msgstr "Impossible de créer une nouvelle branche." -#: Package.module:2936 +#: Package.module:2942 msgid "Unable to create AppImage." msgstr "Impossible de créer l'AppImage." @@ -7736,7 +7732,7 @@ msgstr "Impossible de créer le répertoire temporaire" msgid "Unable to delete database." msgstr "Impossible de supprimer la base de données." -#: Package.module:2862 +#: Package.module:2868 msgid "Unable to detect distribution." msgstr "Impossible de détecter la distribution." diff --git a/app/src/gambas3/.project b/app/src/gambas3/.project index fceb46477..6b13b373a 100644 --- a/app/src/gambas3/.project +++ b/app/src/gambas3/.project @@ -57,6 +57,7 @@ Groups=slackware:"Development/Languages" Menus=ubuntu:"Applications/Amateur Radio" Categories=ubuntu:"Audio;AudioVideo" Groups=ubuntu:"devel" +ExtraFiles=*:"font/gambasb12.otb\t" Tags=Database,Development,GUIDesigner,IDE,MySQL,PostgreSQL,SQLite WebSite=http://gambas.sourceforge.net DoNotTranslate=".src/Debug/FTestSuiteOld.form" diff --git a/app/src/gambas3/.src/Packager/FMakeInstall.class b/app/src/gambas3/.src/Packager/FMakeInstall.class index 60a8d0e74..ceb626303 100644 --- a/app/src/gambas3/.src/Packager/FMakeInstall.class +++ b/app/src/gambas3/.src/Packager/FMakeInstall.class @@ -73,6 +73,8 @@ Public Sub Form_Open() Else txtVendorPrefix.Text = Settings["/Packager/VendorPrefix"] Endif + + txtIdentifier.Placeholder = "org.gambas-basic." & LCase(Project.Name) If Project.License Then txtLicense.Text = Project.License @@ -342,6 +344,7 @@ Public Sub wizInstall_BeforeChange() Project.VendorPrefix = Trim(txtVendorPrefix.Text) Project.License = Trim(txtLicense.Text) Project.Url = Trim(txtUrl.Text) + Project.AppId = Trim(txtIdentifier.Text) If Not Project.Maintainer Then Message.Warning(("Please enter your name.")) @@ -361,6 +364,12 @@ Public Sub wizInstall_BeforeChange() Return Endif Endif + + If Project.AppId And Split(Project.AppId, ".").Count < 3 Then + Message.Warning(("Please enter an application identifier following the 'reversed DNS' format.")) + txtIdentifier.SetFocus + Stop Event + Endif Project.Description = txtDescribe.Text Project.Prefix = chkPrefix.Value diff --git a/app/src/gambas3/.src/Packager/FMakeInstall.form b/app/src/gambas3/.src/Packager/FMakeInstall.form index 37afb5833..7da233fb2 100644 --- a/app/src/gambas3/.src/Packager/FMakeInstall.form +++ b/app/src/gambas3/.src/Packager/FMakeInstall.form @@ -42,7 +42,7 @@ } } { Panel3 HBox - MoveScaled(1,10,87,8) + MoveScaled(1,5,87,8) Spacing = True { Panel5 VBox MoveScaled(0,0,53,8) @@ -79,7 +79,7 @@ } } { HBox8 HBox - MoveScaled(1,19,70,4) + MoveScaled(1,14,70,4) Spacing = True { Label3 Label MoveScaled(0,0,23,4) @@ -92,7 +92,7 @@ } } { HBox20 HBox - MoveScaled(1,24,70,4) + MoveScaled(1,19,70,4) Spacing = True { Label9 Label MoveScaled(0,0,23,4) @@ -104,6 +104,19 @@ Filter = "[A-Za-z0-9]" } } + { HBox22 HBox + MoveScaled(1,24,70,4) + Spacing = True + { Label11 Label + MoveScaled(0,0,23,4) + Text = ("Application identifier") + } + { txtIdentifier MaskBox + MoveScaled(24,0,44,4) + Expand = True + Filter = "[A-Za-z0-9.]" + } + } { TextLabel2 TextLabel MoveScaled(1,28,64,4) Font = Font["Bold"] @@ -148,11 +161,11 @@ } } { Panel1 HBox - MoveScaled(1,48,72,12) + MoveScaled(1,48,72,11) Expand = True Spacing = True { Panel4 VBox - MoveScaled(0,0,23,10) + MoveScaled(0,0,23,7) { Label6 Label MoveScaled(0,0,23,4) Font = Font["Bold"] @@ -160,13 +173,13 @@ } } { txtDescribe TextArea - MoveScaled(25,0,46,12) + MoveScaled(24,0,46,11) Expand = True Wrap = True } } { Panel2 HBox - MoveScaled(1,61,73,4) + MoveScaled(1,60,73,4) Spacing = True { Label5 Label MoveScaled(0,0,23,4) diff --git a/app/src/gambas3/.src/Packager/Package.module b/app/src/gambas3/.src/Packager/Package.module index 62a795044..53058d70c 100644 --- a/app/src/gambas3/.src/Packager/Package.module +++ b/app/src/gambas3/.src/Packager/Package.module @@ -534,10 +534,9 @@ Private Function CopyExtraFiles(sSys As String, sBuildDir As String) Project.MakeDir(sDst) If IsDir(sSrc) Then - Shell "cp -R --preserve=timestamp " & Shell$(sSrc) & " " & Shell$(sDst) Wait + RunCommand("cp -R --preserve=timestamp " & Shell$(sSrc) & " " & Shell$(sDst)) Else - Shell "cp --preserve=timestamp " & Shell$(sSrc) & " " & Shell$(sDst) Wait - 'Copy sSrc To sBuildDir &/ aFile[1] &/ File.Name(aFile[0]) + RunCommand("cp --preserve=timestamp " & Shell$(sSrc) & " " & Shell$(sDst)) Endif Next @@ -2815,6 +2814,8 @@ Private Sub MakeAppImagePackage(sSys As String) Dim I As Integer Dim aDir As String[] Dim bHasDatabaseDriver As Boolean + Dim sDep As String + Dim sAppId As String AddLog(("Making build directory.")) @@ -2834,22 +2835,31 @@ Private Sub MakeAppImagePackage(sSys As String) Project.StretchIcon(Project.Dir &/ Project.Icon, 256).Save(sAppDir &/ "usr/share/icons/hicolor/256x256/apps" &/ $sName & ".png") - ' 3. Building the 'AppImageBuilder.yml' file + ' TODO: 3. Copy the used libraries + + ' 4. Extra files + + CopyExtraFiles(sSys, sAppDir) + + ' 5. Building the 'AppImageBuilder.yml' file AddLog(("Generating 'AppImageBuilder' configuration file...")) sAppImageBuilder = File.Load("install/AppImageBuilder.yml") - ' 4. Fill the application details + ' 6. Fill the application details + + sAppId = Project.AppId + If Not sAppId Then sAppId = "org.gambas-basic." & LCase($sName) sAppImageBuilder = Replace(sAppImageBuilder, "$(appdir)", sAppDir) - sAppImageBuilder = Replace(sAppImageBuilder, "$(id)", "org.gambas-basic." & LCase($sName)) ' TODO: Make that configurable + sAppImageBuilder = Replace(sAppImageBuilder, "$(id)", sAppId) sAppImageBuilder = Replace(sAppImageBuilder, "$(name)", If(Project.Title, Project.Title, Project.Name)) sAppImageBuilder = Replace(sAppImageBuilder, "$(icon)", $sName & ".png") sAppImageBuilder = Replace(sAppImageBuilder, "$(exec)", $sName) sAppImageBuilder = Replace(sAppImageBuilder, "$(version)", $sVersion) - ' 5. Package sources + ' 7. Package sources hFile = Open "/etc/lsb-release" For Each sLine In hFile.Lines @@ -2876,7 +2886,7 @@ Private Sub MakeAppImagePackage(sSys As String) sAppImageBuilder = Replace(sAppImageBuilder, "$(sources)", aSources.Join("\n")) - ' 6. Package dependencies + ' 8. Package dependencies aPackages = New String[] aGenericGuiComp = New String[] @@ -2914,13 +2924,13 @@ Private Sub MakeAppImagePackage(sSys As String) sAppImageBuilder = Replace(sAppImageBuilder, "$(packages)", aPackages.Join("\n")) - ' TODO: Extra dependencies - - ' TODO: Libraries - - ' TODO: Extra files - - ' 7. Build that sucker + ' 9. Extra dependencies + + For Each sDep In Split(Project.ExtraDependencies[If(Project.SameDependencies, ALL_TARGETS, sSys)], "\n") + aPackages.Add(" - " & sDep) + Next + + ' 10. Build that sucker File.Save(sRoot &/ "AppImageBuilder.yml", sAppImageBuilder) diff --git a/app/src/gambas3/.src/Project.module b/app/src/gambas3/.src/Project.module index cc061e54d..5a17744b8 100644 --- a/app/src/gambas3/.src/Project.module +++ b/app/src/gambas3/.src/Project.module @@ -86,6 +86,7 @@ Public Maintainer As String Public Address As String Public Vendor As String Public VendorPrefix As String +Public AppId As String Property Url As String Use $sUrl Public License As String Public CreateEachDirectory As Boolean @@ -3120,6 +3121,7 @@ Public Sub ReadProject(Optional bConvert As Boolean) Maintainer = "" Vendor = "" VendorPrefix = "" + AppId = "" Address = "" $sUrl = "" License = "" @@ -3382,6 +3384,9 @@ Public Sub ReadProject(Optional bConvert As Boolean) Case "vendorprefix" VendorPrefix = sVal + Case "appid" + AppId = sVal + Case "runtimeversion" RuntimeVersion = UnQuote(sVal) @@ -3610,6 +3615,7 @@ Public Sub WriteProject(Optional bComponentDoNotChange As Boolean, Optional bMak If Maintainer Then Print #hFile, "Maintainer="; Maintainer If Vendor Then Print #hFile, "Vendor="; Vendor If VendorPrefix Then Print #hFile, "VendorPrefix="; VendorPrefix + If AppId Then Print #hFile, "AppId="; AppId If Address Then Print #hFile, "Address="; Address If $sUrl And If $sUrl <> DEFAULT_URL Then Print #hFile, "Url="; $sUrl If License Then Print #hFile, "License="; License