Skip to content

Commit

Permalink
Download python-ply inside of premake
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
csmartdalton and csmartdalton committed Oct 7, 2024
1 parent 8e6bb1e commit c1c4868
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5d5d418b7316aa555edb7f8ada7f20714430bdfe
31bf5a44f282bd4c233a6fb9e44e73b0378bf449
6 changes: 0 additions & 6 deletions renderer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ pushd ../skia/dependencies
popd
```

## Install Python PLY

```
python3 -m pip install ply
```

## Add build_rive.sh to $PATH

```
Expand Down
17 changes: 13 additions & 4 deletions renderer/premake5_pls_renderer.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
dofile('rive_build_config.lua')

RIVE_RUNTIME_DIR = path.getabsolute('..')
local dependency = require('dependency')

newoption({
trigger = 'with_vulkan',
Expand All @@ -9,7 +10,6 @@ newoption({
-- Guard this in an "if" (instead of filter()) so we don't download these repos when not building
-- for Vulkan.
if _OPTIONS['with_vulkan'] then
local dependency = require('dependency')
-- Standardize on the same set of Vulkan headers on all platforms.
vulkan_headers = dependency.github('KhronosGroup/Vulkan-Headers', 'vulkan-sdk-1.3.283')
vulkan_memory_allocator = dependency.github(
Expand Down Expand Up @@ -90,12 +90,21 @@ else
nproc = handle:read('*a')
handle:close()
end
nproc = nproc:gsub("%s+", "") -- remove whitespace
nproc = nproc:gsub('%s+', '') -- remove whitespace
local python_ply = dependency.github('dabeaz/ply', '5c4dc94d4c6d059ec127ee1493c735963a5d2645')
local pls_generated_headers = RIVE_BUILD_OUT .. '/include'
local pls_shaders_absolute_dir = path.getabsolute(pls_generated_headers .. '/generated/shaders')
local makecommand = 'make -C '
local makecommand
if os.host() == 'windows' then
makecommand = '"set PYTHONPATH=' .. python_ply .. '/src" && '
else
makecommand = 'PYTHONPATH="' .. python_ply .. '/src" '
end
makecommand = makecommand
.. 'make -C '
.. path.getabsolute('src/shaders')
.. ' -j' .. nproc
.. ' -j'
.. nproc
.. ' OUT='
.. pls_shaders_absolute_dir

Expand Down
4 changes: 2 additions & 2 deletions renderer/src/shaders/minify.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ def t_DEFINE(tok):
return tok

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

0 comments on commit c1c4868

Please sign in to comment.