Skip to content

Commit c1c4868

Browse files
csmartdaltoncsmartdalton
andcommitted
Download python-ply inside of premake
This way clients don't have to configure a virtual environment and install it. Diffs= 31bf5a44f Download python-ply inside of premake (#8285) Co-authored-by: Chris Dalton <[email protected]>
1 parent 8e6bb1e commit c1c4868

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

.rive_head

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5d5d418b7316aa555edb7f8ada7f20714430bdfe
1+
31bf5a44f282bd4c233a6fb9e44e73b0378bf449

renderer/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ pushd ../skia/dependencies
1919
popd
2020
```
2121

22-
## Install Python PLY
23-
24-
```
25-
python3 -m pip install ply
26-
```
27-
2822
## Add build_rive.sh to $PATH
2923

3024
```

renderer/premake5_pls_renderer.lua

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
dofile('rive_build_config.lua')
22

33
RIVE_RUNTIME_DIR = path.getabsolute('..')
4+
local dependency = require('dependency')
45

56
newoption({
67
trigger = 'with_vulkan',
@@ -9,7 +10,6 @@ newoption({
910
-- Guard this in an "if" (instead of filter()) so we don't download these repos when not building
1011
-- for Vulkan.
1112
if _OPTIONS['with_vulkan'] then
12-
local dependency = require('dependency')
1313
-- Standardize on the same set of Vulkan headers on all platforms.
1414
vulkan_headers = dependency.github('KhronosGroup/Vulkan-Headers', 'vulkan-sdk-1.3.283')
1515
vulkan_memory_allocator = dependency.github(
@@ -90,12 +90,21 @@ else
9090
nproc = handle:read('*a')
9191
handle:close()
9292
end
93-
nproc = nproc:gsub("%s+", "") -- remove whitespace
93+
nproc = nproc:gsub('%s+', '') -- remove whitespace
94+
local python_ply = dependency.github('dabeaz/ply', '5c4dc94d4c6d059ec127ee1493c735963a5d2645')
9495
local pls_generated_headers = RIVE_BUILD_OUT .. '/include'
9596
local pls_shaders_absolute_dir = path.getabsolute(pls_generated_headers .. '/generated/shaders')
96-
local makecommand = 'make -C '
97+
local makecommand
98+
if os.host() == 'windows' then
99+
makecommand = '"set PYTHONPATH=' .. python_ply .. '/src" && '
100+
else
101+
makecommand = 'PYTHONPATH="' .. python_ply .. '/src" '
102+
end
103+
makecommand = makecommand
104+
.. 'make -C '
97105
.. path.getabsolute('src/shaders')
98-
.. ' -j' .. nproc
106+
.. ' -j'
107+
.. nproc
99108
.. ' OUT='
100109
.. pls_shaders_absolute_dir
101110

renderer/src/shaders/minify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ def t_DEFINE(tok):
8484
return tok
8585

8686
def t_IFDEF(tok):
87-
r"\#[ \t]*(?P<tag>ifn?def)[ \t]+(?P<id>[\@\$]?[A-Za-z_][A-Za-z0-9_]*)"
87+
r"\#[ \t]*(?P<tag>ifn?def)[ \t]+(?P<ifdef_id>[\@\$]?[A-Za-z_][A-Za-z0-9_]*)"
8888
tok.ifdef_tag = re.match(t_IFDEF.__doc__, tok.value)['tag']
89-
tok.ifdef_id = re.match(t_IFDEF.__doc__, tok.value)['id']
89+
tok.ifdef_id = re.match(t_IFDEF.__doc__, tok.value)['ifdef_id']
9090
if tok.ifdef_id[0] == '@':
9191
exported_switches.add(tok.ifdef_id)
9292
parse_id(tok.ifdef_id, tok.lexer.exports, is_reference=True)

0 commit comments

Comments
 (0)