pd4web 2.2.3__tar.gz → 2.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pd4web-2.2.3 → pd4web-2.2.4}/PKG-INFO +1 -1
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web/Compilers.py +16 -3
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web/Libraries.py +4 -4
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web/Pd4Web.py +18 -31
- {pd4web-2.2.3 → pd4web-2.2.4}/pyproject.toml +1 -1
- {pd4web-2.2.3 → pd4web-2.2.4}/LICENSE +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/README.md +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/.clang-format +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/.prettierrc +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/.yamlftm +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/Libraries.yaml +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/ambi~.cmake +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/cyclone.cmake +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/earplug.cmake +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/else.cmake +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/libpd.cmake +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/o.scofo~.cmake +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/.git +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/.github/workflows/c-cpp.yml +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/.gitignore +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/CMakeLists.txt +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Examples/.clang-format +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Examples/CMakeLists.txt +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Examples/fft~/fft~-help.pd +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Examples/fft~/fft~.cpp +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Examples/simple/simple-help.pd +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Examples/simple/simple-patch.pd +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Examples/simple/simple.cpp +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Examples/simple~/simple~-help.pd +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Examples/simple~/simple~.cpp +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/LICENSE +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/README.md +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Tests/01.Deprecated-Functions/CMakeLists.txt +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/Tests/CMakeLists.txt +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pd.cmake/pd.cmake +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/pmpd.cmake +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Libraries/timbreIDLib.cmake +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Templates/1/bula.md +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Templates/1/index.html +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Templates/2/index.html +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Templates/2/sketch.js +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Templates/3/index.html +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Templates/4/index.html +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Templates/4/sketch.js +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Templates/5/index.html +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/Templates/5/tutorial.md +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/__init__.py +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/cmake-format.yaml +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/config.h +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/externals.cpp +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/favicon.ico +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/index.html +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/nogui.html +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web/Builder.py +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web/Objects.py +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web/Patch.py +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web/__init__.py +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web.cpp +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web.gitignore +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web.gui.js +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web.hpp +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web.midi.js +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web.style.css +0 -0
- {pd4web-2.2.3 → pd4web-2.2.4}/Sources/pd4web.threads.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pd4web
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.4
|
|
4
4
|
Summary: pd4web compiles PureData patches with external objects for Wasm, allowing to run entire patches in web browsers.
|
|
5
5
|
Home-page: https://charlesneimog.github.io/pd4web
|
|
6
6
|
Author: Charles K. Neimog
|
|
@@ -37,14 +37,17 @@ class ExternalsCompiler:
|
|
|
37
37
|
libRepo.set_head(commit.id)
|
|
38
38
|
libRepo.checkout_tree(commit)
|
|
39
39
|
libRepo.reset(commit.id, pygit2.GIT_RESET_HARD)
|
|
40
|
-
self.
|
|
40
|
+
self.Pd4Web.print(
|
|
41
|
+
f"Checking out emsdk to {tag_name}",
|
|
42
|
+
color="yellow",
|
|
43
|
+
silence=self.Pd4Web.SILENCE,
|
|
44
|
+
pd4web=self.Pd4Web.PD_EXTERNAL,
|
|
45
|
+
)
|
|
41
46
|
|
|
42
47
|
# check if Cmake
|
|
43
48
|
if not os.path.exists(self.EMCMAKE):
|
|
44
49
|
self.InstallEMCC()
|
|
45
50
|
|
|
46
|
-
# self.InstallEMCC()
|
|
47
|
-
|
|
48
51
|
def InitVariables(self):
|
|
49
52
|
self.EMSDK = self.Pd4Web.APPDATA + "/emsdk/emsdk"
|
|
50
53
|
self.EMSDK_PY = self.Pd4Web.APPDATA + "/emsdk/emsdk.py"
|
|
@@ -107,9 +110,15 @@ class ExternalsCompiler:
|
|
|
107
110
|
result = subprocess.run(
|
|
108
111
|
["chmod", "+x", self.EMSDK], env=self.Pd4Web.env, capture_output=not self.Pd4Web.verbose, text=True
|
|
109
112
|
)
|
|
113
|
+
|
|
110
114
|
if result.returncode != 0:
|
|
111
115
|
self.Pd4Web.exception("Failed to make emsdk executable")
|
|
116
|
+
else:
|
|
117
|
+
self.Pd4Web.print(
|
|
118
|
+
"emsdk is now executable", color="green", silence=self.Pd4Web.SILENCE, pd4web=self.Pd4Web.PD_EXTERNAL
|
|
119
|
+
)
|
|
112
120
|
|
|
121
|
+
self.Pd4Web.print("Installing emsdk, this will take a about 5 minutes, wait!!!", color="yellow", silence=self.Pd4Web.SILENCE, pd4web=self.Pd4Web.PD_EXTERNAL)
|
|
113
122
|
# ──────────────────────────────────────
|
|
114
123
|
result = subprocess.run(
|
|
115
124
|
[self.EMSDK, "install", "latest"],
|
|
@@ -121,6 +130,10 @@ class ExternalsCompiler:
|
|
|
121
130
|
self.Pd4Web.exception(
|
|
122
131
|
f"Failed to install emsdk, result {result.returncode}, cmd: " + " ".join(result.args)
|
|
123
132
|
)
|
|
133
|
+
else:
|
|
134
|
+
self.Pd4Web.print(
|
|
135
|
+
"emsdk installed", color="green", silence=self.Pd4Web.SILENCE, pd4web=self.Pd4Web.PD_EXTERNAL
|
|
136
|
+
)
|
|
124
137
|
|
|
125
138
|
# ──────────────────────────────────────
|
|
126
139
|
result = subprocess.run(
|
|
@@ -168,7 +168,7 @@ class ExternalLibraries:
|
|
|
168
168
|
|
|
169
169
|
libLink = f"https://github.com/{libData.dev}/{libData.repo}"
|
|
170
170
|
try:
|
|
171
|
-
self.Pd4Web.print(f"Cloning library {libData.repo}... This will take some time!", color="green")
|
|
171
|
+
self.Pd4Web.print(f"Cloning library {libData.repo}... This will take some time!", color="green", silence=self.Pd4Web.SILENCE, pd4web=self.Pd4Web.PD_EXTERNAL)
|
|
172
172
|
pygit2.clone_repository(libLink, libPath)
|
|
173
173
|
except Exception as e:
|
|
174
174
|
self.Pd4Web.exception(f"Failed to clone repository: {str(e)}")
|
|
@@ -179,10 +179,10 @@ class ExternalLibraries:
|
|
|
179
179
|
libRepo.set_head(commit.id)
|
|
180
180
|
libRepo.checkout_tree(commit)
|
|
181
181
|
libRepo.reset(commit.id, pygit2.GIT_RESET_HARD)
|
|
182
|
-
self.Pd4Web.print(f"Library {libData.repo} cloned successfully!", color="green")
|
|
183
|
-
self.Pd4Web.print(f"Using commit {commit.id}", color="green")
|
|
182
|
+
self.Pd4Web.print(f"Library {libData.repo} cloned successfully!", color="green", silence=self.Pd4Web.SILENCE, pd4web=self.Pd4Web.PD_EXTERNAL)
|
|
183
|
+
self.Pd4Web.print(f"Using commit {commit.id}", color="green", silence=self.Pd4Web.SILENCE, pd4web=self.Pd4Web.PD_EXTERNAL)
|
|
184
184
|
try:
|
|
185
|
-
self.Pd4Web.print(f"Initializing submodules of {libData.repo}...", color="green")
|
|
185
|
+
self.Pd4Web.print(f"Initializing submodules of {libData.repo}...", color="green", silence=self.Pd4Web.SILENCE, pd4web=self.Pd4Web.PD_EXTERNAL)
|
|
186
186
|
submodule_collection = pygit2.submodules.SubmoduleCollection(pygit2.Repository(libPath))
|
|
187
187
|
submodule_collection.init()
|
|
188
188
|
submodule_collection.update()
|
|
@@ -67,6 +67,7 @@ class Pd4Web:
|
|
|
67
67
|
|
|
68
68
|
self.Parser = parser
|
|
69
69
|
self.Patch = os.path.abspath(self.Parser.patch_file)
|
|
70
|
+
|
|
70
71
|
if not os.path.isfile(self.Patch):
|
|
71
72
|
self.exception("\n\nError: Patch file not found")
|
|
72
73
|
|
|
@@ -114,9 +115,16 @@ class Pd4Web:
|
|
|
114
115
|
|
|
115
116
|
self.env = os.environ.copy()
|
|
116
117
|
python_dir = os.path.dirname(sys.executable)
|
|
117
|
-
|
|
118
|
+
if "PATH" in self.env:
|
|
119
|
+
self.env["PATH"] = f"{python_dir};{self.env['PATH']}"
|
|
120
|
+
else:
|
|
121
|
+
self.env["PATH"] = python_dir
|
|
118
122
|
self.env["PYTHON"] = sys.executable
|
|
119
123
|
self.env["EMSDK_QUIET"] = "1"
|
|
124
|
+
# add /bin and /usr/bin to PATH on macOS
|
|
125
|
+
if sys.platform == "darwin":
|
|
126
|
+
self.env["PATH"] += ":/bin:/usr/bin"
|
|
127
|
+
|
|
120
128
|
|
|
121
129
|
def Execute(self):
|
|
122
130
|
from .Builder import GetAndBuildExternals
|
|
@@ -191,38 +199,9 @@ class Pd4Web:
|
|
|
191
199
|
if not os.path.exists(self.APPDATA):
|
|
192
200
|
os.makedirs(self.APPDATA)
|
|
193
201
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
def DownloadZip(self, url, filename, what=""):
|
|
197
|
-
self.print(f"Downloading {what}...", color="green", silence=self.SILENCE)
|
|
198
|
-
response = requests.get(url, stream=True)
|
|
199
|
-
if response.status_code != 200:
|
|
200
|
-
self.exception(f"Error: {response.status_code}")
|
|
201
|
-
total_size = response.headers.get("content-length")
|
|
202
|
-
total_size = int(total_size) if total_size is not None else None
|
|
203
|
-
chunk_size = 1024
|
|
204
|
-
num_bars = 40
|
|
205
|
-
with open(filename, "wb") as file:
|
|
206
|
-
downloaded_size = 0
|
|
207
|
-
for data in response.iter_content(chunk_size):
|
|
208
|
-
file.write(data)
|
|
209
|
-
downloaded_size += len(data)
|
|
210
|
-
if total_size:
|
|
211
|
-
progress = downloaded_size / total_size
|
|
212
|
-
num_hashes = int(progress * num_bars)
|
|
213
|
-
progress_bar = "#" * num_hashes + "-" * (num_bars - num_hashes)
|
|
214
|
-
sys.stdout.write(f"\r 🟢 |{progress_bar}| {progress:.2%}")
|
|
215
|
-
else:
|
|
216
|
-
num_hashes = int(downloaded_size / chunk_size) % num_bars
|
|
217
|
-
progress_bar = "#" * num_hashes + "-" * (num_bars - num_hashes)
|
|
218
|
-
sys.stdout.write(f"\r 🟢 |{progress_bar}| {downloaded_size} bytes")
|
|
219
|
-
sys.stdout.flush()
|
|
220
|
-
print()
|
|
221
|
-
return True
|
|
222
|
-
|
|
223
202
|
def GetPdSourceCode(self):
|
|
224
203
|
if not os.path.exists(self.APPDATA + "/Pd"):
|
|
225
|
-
self.print("Cloning Pd", color="yellow")
|
|
204
|
+
self.print("Cloning Pd", color="yellow", silence=self.SILENCE, pd4web=self.PD_EXTERNAL)
|
|
226
205
|
pd_path = self.APPDATA + "/Pd"
|
|
227
206
|
pd_git = "https://github.com/pure-data/pure-data"
|
|
228
207
|
ok = pygit2.clone_repository(pd_git, pd_path)
|
|
@@ -326,6 +305,14 @@ class Pd4Web:
|
|
|
326
305
|
type=int,
|
|
327
306
|
help="Initial memory size in MB",
|
|
328
307
|
)
|
|
308
|
+
|
|
309
|
+
parser.add_argument(
|
|
310
|
+
"--patch-file",
|
|
311
|
+
required=False,
|
|
312
|
+
default="",
|
|
313
|
+
type=str,
|
|
314
|
+
help="Patch file to compile",
|
|
315
|
+
)
|
|
329
316
|
|
|
330
317
|
# GUI
|
|
331
318
|
parser.add_argument(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pd4web"
|
|
3
|
-
version = "2.2.
|
|
3
|
+
version = "2.2.4"
|
|
4
4
|
description = "pd4web compiles PureData patches with external objects for Wasm, allowing to run entire patches in web browsers."
|
|
5
5
|
authors = ["Charles K. Neimog <charlesneimog@outlook.com>"]
|
|
6
6
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|