Files
TagStudio/tagstudio.spec
Xarvex 55bc7aac88 refactor!: change layout; import and build change
Fixes: #200
Fixes: #365
Fixes: #512
Fixes: #800

fix(pyproject): resolve mix-up of mypy and pytest

chore(ci): remove legacy scripts

chore: format with new mypy rules; fix translation test

wip(ci/mypy): remove config flag

fix(pyinstaller): use correct dict access

fix(resources): usage in ts_qt.py

feat(nix/package): validate tests with pytest hook

fix(nix/package): remove old dependency patch

feat(nix): support Darwin

fix(nix/package): move check deps to checkInputs

fix(nix/shell): typo

fix(nix/shell): correctly wrap Python with Qt args

fix(pyproject): specify mypy-extensions

feat(nix/package): provide pillow-jxl-plugin

nix(nix/package): split into multiple files, allow overriding of JXL and vtf2img

fix(nix/shell): provide FFmpeg on runtime

feat(flake): output pillow-jxl-plugin and vtf2img

fix(nix/package): load pipewire

feat(nix/package): run tests on pillow-jxl-plugin

fix: remove extra noqa comment

docs: update installation docs

docs: shrink table size on docs site

nit(nix/package): pipewire not needed in buildInputs

docs: update commands, environment, setup

fix: use consistent possessives

chore: format with prettier, add ignore flags

fix(pyinstaller): consume from pyproject

Revert "fix(pyinstaller): consume from pyproject"

This reverts commit 398cd4e5630a3e83d22d15286d7ac59b4c07c5d6.

refactor: use icon from resource manager

Also fixes incorrect path currently used in ts_qt.py.

nix(pyinstaller): replace use of sys.platform with platform.system

docs: add build section

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
2025-03-09 18:55:32 -05:00

95 lines
2.0 KiB
Python

import platform
from argparse import ArgumentParser
from PyInstaller.building.api import COLLECT, EXE, PYZ
from PyInstaller.building.build_main import Analysis
from PyInstaller.building.osx import BUNDLE
from tomllib import load
parser = ArgumentParser()
parser.add_argument("--portable", action="store_true")
options = parser.parse_args()
with open("pyproject.toml", "rb") as file:
pyproject = load(file)["project"]
system = platform.system()
name = pyproject["name"] if system == "Windows" else "tagstudio"
icon = None
if system == "Windows":
icon = "src/tagstudio/resources/icon.ico"
elif system == "Darwin":
icon = "src/tagstudio/resources/icon.icns"
a = Analysis(
["src/tagstudio/main.py"],
pathex=[],
binaries=[],
datas=[("src/tagstudio", "tagstudio")],
hiddenimports=[],
hookspath=[],
hooksconfig={},
excludes=[],
runtime_hooks=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
include = [a.scripts]
if options.portable:
include += (a.binaries, a.datas)
exe = EXE(
pyz,
*include,
[],
bootloader_ignore_signals=False,
console=False,
hide_console="hide-early",
disable_windowed_traceback=False,
debug=False,
name=name,
exclude_binaries=not options.portable,
icon=icon,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
)
coll = (
None
if options.portable
else COLLECT(
exe,
a.binaries,
a.datas,
name=name,
strip=False,
upx=True,
upx_exclude=[],
)
)
if system == "Darwin":
app = BUNDLE(
exe if coll is None else coll,
name=f"{pyproject['name']}.app",
icon=icon,
bundle_identifier="com.cyanvoxel.tagstudio",
version=pyproject["version"],
info_plist={
"NSAppleScriptEnabled": False,
"NSPrincipalClass": "NSApplication",
},
)
# vi: ft=python