Skip to content

Commit 398715d

Browse files
Fix build script (#17)
1 parent 7be1027 commit 398715d

File tree

2 files changed

+10
-28
lines changed

2 files changed

+10
-28
lines changed

build-scripts/build.py

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
CLI_PACKAGE_NAME,
3636
DESKTOP_BINARY_NAME,
3737
DESKTOP_PACKAGE_NAME,
38+
DESKTOP_PACKAGE_PATH,
3839
DMG_NAME,
3940
LINUX_ARCHIVE_NAME,
4041
LINUX_LEGACY_GNOME_EXTENSION_UUID,
@@ -259,7 +260,7 @@ def build_macos_desktop_app(
259260

260261
run_cmd(
261262
cargo_tauri_args,
262-
cwd=DESKTOP_PACKAGE_NAME,
263+
cwd=DESKTOP_PACKAGE_PATH,
263264
env={**os.environ, **rust_env(release=release, variant=Variant.FULL), "BUILD_DIR": BUILD_DIR},
264265
)
265266

@@ -387,30 +388,6 @@ def sign_and_rebundle_macos(app_path: pathlib.Path, dmg_path: pathlib.Path, sign
387388
info("Done signing!!")
388389

389390

390-
def linux_bundle(
391-
pty_path: pathlib.Path,
392-
cli_path: pathlib.Path,
393-
desktop_app_path: pathlib.Path,
394-
is_minimal: bool,
395-
):
396-
if not is_minimal:
397-
for res in [16, 22, 24, 32, 48, 64, 128, 256, 512]:
398-
shutil.copy2(
399-
f"{DESKTOP_PACKAGE_NAME}/icons/{res}x{res}.png",
400-
f"build/usr/share/icons/hicolor/{res}x{res}/apps/fig.png",
401-
)
402-
403-
info("Copying bundle files")
404-
bin_path = pathlib.Path("build/usr/bin")
405-
bin_path.mkdir(parents=True, exist_ok=True)
406-
shutil.copy2(cli_path, bin_path)
407-
shutil.copy2(pty_path, bin_path)
408-
shutil.copytree("bundle/linux/minimal", BUILD_DIR, dirs_exist_ok=True)
409-
if not is_minimal:
410-
shutil.copytree("bundle/linux/desktop", BUILD_DIR, dirs_exist_ok=True)
411-
shutil.copy2(desktop_app_path, bin_path)
412-
413-
414391
def build_linux_minimal(cli_path: pathlib.Path, pty_path: pathlib.Path):
415392
"""
416393
Creates tar.gz, tar.xz, tar.zst, and zip archives under `BUILD_DIR`.
@@ -576,7 +553,7 @@ def build_linux_deb(
576553
desktop_icon_path.parent.mkdir(parents=True)
577554
share_path = bundle_dir / f"usr/share/{LINUX_PACKAGE_NAME}"
578555
share_path.mkdir(parents=True)
579-
shutil.copy(pathlib.Path(f"{DESKTOP_PACKAGE_NAME}/icons/128x128.png"), desktop_icon_path)
556+
shutil.copy(DESKTOP_PACKAGE_PATH / "icons" / "128x128.png", desktop_icon_path)
580557
shutil.copytree(resources.legacy_extension_dir_path, share_path / LINUX_LEGACY_GNOME_EXTENSION_UUID)
581558
shutil.copytree(resources.modern_extension_dir_path, share_path / LINUX_MODERN_GNOME_EXTENSION_UUID)
582559
shutil.copytree(resources.npm_packages.autocomplete_path, share_path / "autocomplete")
@@ -655,7 +632,7 @@ def copy_extension(extension_uuid, extension_dir_name):
655632
modern_extension_dir_path = copy_extension(LINUX_MODERN_GNOME_EXTENSION_UUID, "gnome-extension")
656633

657634
info("Building tauri config")
658-
tauri_config_path = pathlib.Path(DESKTOP_PACKAGE_NAME) / "build-config.json"
635+
tauri_config_path = DESKTOP_PACKAGE_PATH / "build-config.json"
659636
tauri_config_path.write_text(
660637
linux_tauri_config(
661638
cli_path=cli_path,
@@ -686,7 +663,7 @@ def copy_extension(extension_uuid, extension_dir_name):
686663
info("Building", DESKTOP_PACKAGE_NAME)
687664
run_cmd(
688665
cargo_tauri_args,
689-
cwd=DESKTOP_PACKAGE_NAME,
666+
cwd=DESKTOP_PACKAGE_PATH,
690667
env={**os.environ, **rust_env(release=release, variant=Variant.FULL), "BUILD_DIR": BUILD_DIR},
691668
)
692669
desktop_path = pathlib.Path(f'target/{target}/{"release" if release else "debug"}/{DESKTOP_BINARY_NAME}')

build-scripts/const.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import pathlib
2+
3+
14
APP_NAME = "Amazon Q"
25
CLI_BINARY_NAME = "q"
36
PTY_BINARY_NAME = "qterm"
@@ -20,5 +23,7 @@
2023
PTY_PACKAGE_NAME = "figterm"
2124
DESKTOP_PACKAGE_NAME = "fig_desktop"
2225

26+
DESKTOP_PACKAGE_PATH = pathlib.Path("crates", "fig_desktop")
27+
2328
# AMZN Mobile LLC
2429
APPLE_TEAM_ID = "94KV3E626L"

0 commit comments

Comments
 (0)