Skip to content

Commit

Permalink
Migrate settings from Randomizer in preperation for GTK4
Browse files Browse the repository at this point in the history
  • Loading branch information
theCapypara committed Apr 11, 2024
1 parent 1e8ffa7 commit cb5f30f
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,27 @@ jobs:
build:
runs-on: ubuntu-latest
name: Build the Python wheel
container:
image: ghcr.io/skytemple/gtk4-build-image:1
steps:
# For tags we assume the version in pyproject.toml is correct!
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Rewrite version for dev if not tag
if: "!startsWith(github.ref, 'refs/tags/')"
run: |
perl -i -pe "s/version\s*=\s*\"(.*?)(\.rc.*|\.a.*|\.post.*)?\"/version=\"\1.dev0+${GITHUB_SHA::8}\"/" pyproject.toml
- name: Note version
run: |
echo "PACKAGE_VERSION=$(tomlq '.project.version' pyproject.toml -r)" >> $GITHUB_ENV
- name: Run make
run: make
- name: Build Python wheels
uses: RalfG/[email protected]_x86_64
with:
python-versions: 'cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
run: |
python3 -m pip install --upgrade build
python3 -m build
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,5 @@ venv.bak/
.idea/
### skytemple
*.glade~

*.ui
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "blueprint-compiler"]
path = blueprint-compiler
url = https://gitlab.gnome.org/theCapypara/blueprint-compiler.git
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Makefile for generating files.
# Does NOT install the Python package or dependencies.
# Make sure to install those first and also checkout the submodules.

.PHONY: clean all
.DEFAULT_GOAL: all

rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
ALL_BLP=$(call rwildcard,skytemple,*.blp)
ALL_UI=$(ALL_BLP:.blp=.ui)

%.ui: %.blp
./blueprint-compiler/blueprint-compiler.py compile --output "$@" "$<"

all: $(ALL_UI)

clean:
find skytemple_ssb_debugger -name "*.ui" -type f -delete
1 change: 1 addition & 0 deletions blueprint-compiler
Submodule blueprint-compiler added at 80aaee
5 changes: 5 additions & 0 deletions build-blp-to-ui.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$ErrorActionPreference = "Stop"
# Convert the Blueprint UI files to XML.
# This requires the blueprint-compiler submodule to be checked out.
.\blueprint-compiler\blueprint-compiler.py batch-compile skytemple_ssb_debugger\data\widget skytemple_ssb_debugger\data\widget (Resolve-Path skytemple_ssb_debugger\data\widget\*.blp)
if ($LASTEXITCODE) { exit $LASTEXITCODE }
9 changes: 9 additions & 0 deletions build-blp-to-ui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
# Convert the Blueprint UI files to XML.
# This requires the blueprint-compiler submodule to be checked out.
set -xe
./blueprint-compiler/blueprint-compiler.py \
batch-compile \
skytemple_ssb_debugger/data/widget \
skytemple_ssb_debugger/data/widget \
skytemple_ssb_debugger/data/widget/*.blp
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "skytemple-ssb-debugger"
version = "1.6.4"
version = "2.0.0b1"
authors = [
{name = 'Marco "Capypara" Köpcke', email = "[email protected]"},
# see About dialog or GitHub contributors list for additional people.
Expand All @@ -29,7 +29,7 @@ dependencies = [
"pmdsky-debug-py", # Whatever version skytemple-files requires.
"skytemple-icons >= 0.1.0",
"range-typed-integers >= 1.0.0",
"pygobject >= 3.26.0",
"pygobject >= 3.48.0",
"pycairo >= 1.16.0",
"skytemple-ssb-emulator >= 1.6.4, < 1.7.0",
"explorerscript >= 0.1.5",
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ndspy==4.1.0
pygobject==3.48.1
pygobject>=3.48.0
pycairo==1.18.2
skytemple-ssb-emulator==1.6.4
explorerscript==0.1.5
Expand All @@ -11,4 +11,4 @@ pmdsky-debug-py
git+https://github.com/skytemple/skytemple-icons@main#egg=skytemple_icons
types-setuptools
importlib_metadata>=4.6; python_version < "3.10"
pygobject-stubs --config-settings=config=Gtk3,Gdk3,GtkSource4
pygobject-stubs>=2.11.0 --config-settings=config=Gtk4,Gdk4,GtkSource5

0 comments on commit cb5f30f

Please sign in to comment.