From 6a2d0b20b11a28326be09809807b91d83c8c947e Mon Sep 17 00:00:00 2001 From: cabiste Date: Sat, 14 Oct 2023 11:03:26 +0000 Subject: [PATCH 1/5] added vscode folder to the gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 9d15e6f1..87d43934 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # PyCharm .idea +# vscode +.vscode + # Example builds /recipes/*/AppDir /recipes/*/appimage-build From 1785566aff0d778f3f537f973c56c40693fc54b2 Mon Sep 17 00:00:00 2001 From: cabiste Date: Sun, 15 Oct 2023 10:59:16 +0000 Subject: [PATCH 2/5] use the defined 'AppDir' path in the recipe file --- appimagebuilder/modules/setup/apprun_2/apprun2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appimagebuilder/modules/setup/apprun_2/apprun2.py b/appimagebuilder/modules/setup/apprun_2/apprun2.py index ffcee5dc..be540892 100644 --- a/appimagebuilder/modules/setup/apprun_2/apprun2.py +++ b/appimagebuilder/modules/setup/apprun_2/apprun2.py @@ -61,7 +61,7 @@ def __init__(self, context: Context, finder: Finder): self.context = context recipe = context.recipe - self.appdir_path = self.context.app_dir + self.appdir_path = recipe.AppDir.path() or self.context.app_dir self.main_exec = recipe.AppDir.app_info.exec() self.main_exec_args = recipe.AppDir.app_info.exec_args() or "$@" self.apprun_version = recipe.AppDir.runtime.version() or "v2.0.0" From cbef071bb4e437619b2da09efc2ef3e8c958ab64 Mon Sep 17 00:00:00 2001 From: cabiste Date: Wed, 18 Oct 2023 10:11:48 +0000 Subject: [PATCH 3/5] fixed 'appdir_path' not being posix when using the path from the recipe --- appimagebuilder/modules/setup/apprun_2/apprun2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appimagebuilder/modules/setup/apprun_2/apprun2.py b/appimagebuilder/modules/setup/apprun_2/apprun2.py index be540892..4e929bf7 100644 --- a/appimagebuilder/modules/setup/apprun_2/apprun2.py +++ b/appimagebuilder/modules/setup/apprun_2/apprun2.py @@ -27,7 +27,7 @@ import random import shutil import string -from pathlib import Path +from pathlib import Path, PosixPath from typing import Final from packaging import version @@ -61,7 +61,7 @@ def __init__(self, context: Context, finder: Finder): self.context = context recipe = context.recipe - self.appdir_path = recipe.AppDir.path() or self.context.app_dir + self.appdir_path = PosixPath(recipe.AppDir.path()) or self.context.app_dir self.main_exec = recipe.AppDir.app_info.exec() self.main_exec_args = recipe.AppDir.app_info.exec_args() or "$@" self.apprun_version = recipe.AppDir.runtime.version() or "v2.0.0" From 9e4aa41a3c971715602d7ddd92d49e48937c72ad Mon Sep 17 00:00:00 2001 From: cabiste Date: Wed, 18 Oct 2023 17:12:33 +0000 Subject: [PATCH 4/5] fixed the 'finder' using incorrect appdir path when path is taken from recipe --- appimagebuilder/orchestrator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appimagebuilder/orchestrator.py b/appimagebuilder/orchestrator.py index fdd5db46..c712ad12 100644 --- a/appimagebuilder/orchestrator.py +++ b/appimagebuilder/orchestrator.py @@ -108,7 +108,11 @@ def _create_setup_commands(self, context, recipe): ) commands.append(command) - finder = Finder(context.app_dir) + if os.path.exists(recipe.AppDir.path()): + finder = Finder(pathlib.PosixPath(recipe.AppDir.path())) + else: + finder = Finder(context.app_dir) + commands.append(SetupSymlinksCommand(context, recipe, finder)) commands.append(SetupRuntimeCommand(context, finder)) From e46c94a0633a6655fb1a4041a02e9c3289390625 Mon Sep 17 00:00:00 2001 From: cabiste Date: Wed, 18 Oct 2023 19:09:26 +0000 Subject: [PATCH 5/5] fixed incorrect path usage --- appimagebuilder/commands/deploy_record.py | 3 ++- appimagebuilder/commands/setup_app_info.py | 7 ++++--- appimagebuilder/modules/prime/appimage_primer.py | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/appimagebuilder/commands/deploy_record.py b/appimagebuilder/commands/deploy_record.py index d2636cf6..b5164aec 100644 --- a/appimagebuilder/commands/deploy_record.py +++ b/appimagebuilder/commands/deploy_record.py @@ -11,6 +11,7 @@ # all copies or substantial portions of the Software. import logging import os +from pathlib import PosixPath from ruamel.yaml import YAML @@ -25,7 +26,7 @@ def id(self): return "write-deploy-record" def __call__(self, *args, **kwargs): - path = self.context.app_dir / ".bundle.yml" + path = (PosixPath(self.context.recipe.AppDir.path()) or self.context.app_dir) / ".bundle.yml" with open(path, "w") as f: logging.info( "Writing deploy record to: %s" diff --git a/appimagebuilder/commands/setup_app_info.py b/appimagebuilder/commands/setup_app_info.py index 83920ae2..b5e2af28 100644 --- a/appimagebuilder/commands/setup_app_info.py +++ b/appimagebuilder/commands/setup_app_info.py @@ -15,7 +15,7 @@ from appimagebuilder.modules.setup.icon_bundler import IconBundler from appimagebuilder.context import AppInfo, Context from appimagebuilder.commands.command import Command - +from pathlib import PosixPath class SetupAppInfoCommand(Command): def __init__(self, context: Context): @@ -25,10 +25,11 @@ def id(self): return "app-info-setup" def __call__(self, *args, **kwargs): - icon_bundler = IconBundler(self.context.app_dir, self.context.app_info.icon) + appdir_path = PosixPath(self.context.recipe.AppDir.path()) or self.context.app_dir + icon_bundler = IconBundler(appdir_path, self.context.app_info.icon) icon_bundler.bundle_icon() - desktop_entry_generator = DesktopEntryGenerator(self.context.app_dir) + desktop_entry_generator = DesktopEntryGenerator(appdir_path) desktop_entry_generator.generate( self.context.app_info, self.context.bundle_info.runtime_arch ) diff --git a/appimagebuilder/modules/prime/appimage_primer.py b/appimagebuilder/modules/prime/appimage_primer.py index 4bd36142..f90bd612 100644 --- a/appimagebuilder/modules/prime/appimage_primer.py +++ b/appimagebuilder/modules/prime/appimage_primer.py @@ -42,8 +42,9 @@ def prime(self): if not self.carrier_path.exists(): self._get_appimage_kit_runtime() + appdir_path = pathlib.PosixPath(self.context.recipe.AppDir.path()) or self.context.app_dir # create payload - payload_path = self._make_squashfs(self.context.app_dir) + payload_path = self._make_squashfs(appdir_path) # prepare carrier (a.k.a. "runtime" using a different name to differentiate from the AppRun settings) shutil.copyfile(self.carrier_path, self.appimage_path)