Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for testing/adding other exts #12

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ python_build/*
!python_build/Makefile
build/
PyNX.*
.DS_Store
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ dist: $(BUILD)
unzip $(PY_BUILD)/nxpy3.5.3/python.zip -d $(LIBDIR)
cp -r $(PY_BUILD)/nx-*/nx $(LIBDIR)
cp -r $(PY_BUILD)/imgui-switch-*/dist/python/* $(LIBDIR)
cp -r python_exts/py_libs/* $(LIBDIR)
cp $(OUTPUT).nro $(DIST_DIR)/
cp $(OUTPUT).nacp $(DIST_DIR)/
cp main.py $(DIST_DIR)/
Expand Down
3 changes: 3 additions & 0 deletions python_build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ else
endif

PYCONFIG_DIR := ../python_config
PY_EXT_DIR := ../python_exts

LIBDIRS := $(PORTLIBS) $(LIBNX)
export INCLUDE := $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
Expand Down Expand Up @@ -135,6 +136,8 @@ patchPY: cloneNX extractedPY
cp $(PYDIR)/Modules/Setup.dist $(PYDIR)/Modules/Setup.dist_old
cat $(PYDIR)/Modules/Setup.dist_old | $(SED) -e '$$a_nx -I$$(srcdir)/Modules/_nx _nx/_nxmodule.c hashtable.c' | $(SED) 's/^\([^#].* pwdmodule\.c.*\)/#\1/' | $(SED) 's/^#\(array\|cmath\|math\|_struct\|operator\|_random\|_collections\|itertools\|signal\|strop\|unicodedata\|_io\|_csv\|_md5\|_sha\|_sha256\|_sha512\|binascii\|select\|cStringIO\|time\|_functools\|_socket\|datetime\|_bisect\|zlib\)\(.*\)/\1\2/' | $(SED) "s#\\(zlib[^\$$]*\\)\$$(prefix)\\([^\$$]*\\)\$$(exec_prefix)\\(.*\\)#\1$(DEVKITPRO)/portlibs/switch\2$(DEVKITPRO)/portlibs/switch\3#" | $(SED) "s/_tracemalloc/# _tracemalloc/" >$(PYDIR)/Modules/Setup.dist
cat imgui-switch-*/setup.txt >> $(PYDIR)/Modules/Setup.dist
cp -r $(TOPDIR)/python_exts/c_files/. $(TOPDIR)/python_build/$(PYDIR)/Modules/
cat $(TOPDIR)/python_exts/setup/* >>$(TOPDIR)/python_build/$(PYDIR)/Modules/Setup.dist
cp -r _nx-*/_nx $(PYDIR)/Modules/
cp -r imgui-switch-*/dist/modules/* $(PYDIR)/Modules/

Expand Down
Empty file added python_exts/c_files/.gitkeep
Empty file.
Empty file added python_exts/py_libs/.gitkeep
Empty file.
Empty file added python_exts/setup/.gitkeep
Empty file.