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 2 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
2 changes: 2 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,7 @@ 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
TOPDIR=$(TOPDIR) PYDIR=$(PYDIR) PY_EXT_DIR=$(PY_EXT_DIR) $(PY_EXT_DIR)/SetupExtensions.sh
cp -r _nx-*/_nx $(PYDIR)/Modules/
cp -r imgui-switch-*/dist/modules/* $(PYDIR)/Modules/

Expand Down
13 changes: 13 additions & 0 deletions python_exts/SetupExtensions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
echo $PWD
files=$(ls $TOPDIR/python_exts/setup/* 2>/dev/null | wc -l)
if [ $files != "0" ]; then
for i in $TOPDIR/python_exts/setup/*; do
echo $i
cat $i >>$TOPDIR/python_build/$PYDIR/Modules/Setup.dist
done
fi
files2=$(ls $TOPDIR/python_exts/c_files/* 2>/dev/null | wc -l)
if [ $files2 != "0" ]; then
cp -r $TOPDIR/python_exts/c_files/* $TOPDIR/python_build/$PYDIR/Modules/
fi
Empty file.
Empty file added python_exts/setup/.dont_delete
Empty file.