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 wgpu-native #2439

Merged
merged 3 commits into from
Aug 14, 2023
Merged

Add wgpu-native #2439

merged 3 commits into from
Aug 14, 2023

Conversation

SirLynix
Copy link
Member

I tried to support debug builds as well but I couldn't because artifacts are processed before the "load" script is.

    on_load("windows|x64", "windows|x86", "linux|x86_64", "macosx|x86_64", "macosx|arm64", function (package)
        local suffix = package:debug() and "debug" or "release"
        if package:is_plat("windows") and package:is_arch("x64") then
            package:add("url", "https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-windows-x86_64-" .. suffix .. ".zip", {version = function(version) return version:gsub("%+", ".") end})
            if package:debug() then
                package:add("version", "v0.17.0+2", "ddcaa0542149be17e47e3f85f8df637814318668d03c341cfddcd3ccd9269f28")
            else
                package:add("version", "v0.17.0+2", "1b8ae05bb7626e037ab7088f9f11fc8bb8341a32800d33857c09ff2fb1b3893f")
            end
        elseif package:is_plat("windows") and package:is_arch("x86") then
            package:add("url", "https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-windows-i686-" .. suffix .. ".zip", {version = function(version) return version:gsub("%+", ".") end})
            if package:debug() then
                package:add("version", "v0.17.0+2", "c9efb8e0ea1ba776e3dec968691d0f53ff50f199705f1c0fdb98d93182b7289a")
            else
                package:add("version", "v0.17.0+2", "098037ca18c1a3fbf25f061f822762d5eab1cd4ecf8e7d039f9ccbd357322a54")
            end
        elseif package:is_plat("linux") and package:is_arch("x86_64") then
            package:add("url", "https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-linux-x86_64-" .. suffix .. ".zip", {version = function(version) return version:gsub("%+", ".") end})
            if package:debug() then
                package:add("version", "v0.17.0+2", "7a05f7367b75ac2619e7da3a6a523a88207d7bc7c21ea00552f504ed0480610f")
            else
                package:add("version", "v0.17.0+2", "2bfebb48072cafee316fcec452d49d02aa46d7096325097e637c3c2e784eca5b")
            end
        elseif package:is_plat("macosx") and package:is_arch("x86_64") then
            package:add("url", "https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-macos-x86_64-" .. suffix .. ".zip", {version = function(version) return version:gsub("%+", ".") end})
            if package:debug() then
                package:add("version", "v0.17.0+2", "adbaa903a23984016a5dfc7ec3b7754cc355b6f604671986bd46a1d4c67d554b")
            else
                package:add("version", "v0.17.0+2", "749683e616659b5fa9a42151b7b71c2308e114c0322df78975d486aaf43650e9")
            end
        elseif package:is_plat("macosx") and package:is_arch("arm64") then
            package:add("url", "https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-macos-arm64-" .. suffix .. ".zip", {version = function(version) return version:gsub("%+", ".") end})
            if package:debug() then
                package:add("version", "v0.17.0+2", "77f27c870a44aaad1de413c0bca3d2a6227d2d4d6c3e80246241384f50bd3642")
            else
                package:add("version", "v0.17.0+2", "9af5dadcd05fa8d47d37cf171abae65c7d813123d0a60f0b50392da381279d04")
            end
        else
            os.raise("unsupported plat/arch")
        end
    end)

@waruqi
Copy link
Member

waruqi commented Aug 14, 2023

I tried to support debug builds as well but I couldn't because artifacts are processed before the "load" script is.

    on_load("windows|x64", "windows|x86", "linux|x86_64", "macosx|x86_64", "macosx|arm64", function (package)
        local suffix = package:debug() and "debug" or "release"
        if package:is_plat("windows") and package:is_arch("x64") then
            package:add("url", "https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-windows-x86_64-" .. suffix .. ".zip", {version = function(version) return version:gsub("%+", ".") end})
            if package:debug() then
                package:add("version", "v0.17.0+2", "ddcaa0542149be17e47e3f85f8df637814318668d03c341cfddcd3ccd9269f28")
            else
                package:add("version", "v0.17.0+2", "1b8ae05bb7626e037ab7088f9f11fc8bb8341a32800d33857c09ff2fb1b3893f")
            end
        elseif package:is_plat("windows") and package:is_arch("x86") then
            package:add("url", "https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-windows-i686-" .. suffix .. ".zip", {version = function(version) return version:gsub("%+", ".") end})
            if package:debug() then
                package:add("version", "v0.17.0+2", "c9efb8e0ea1ba776e3dec968691d0f53ff50f199705f1c0fdb98d93182b7289a")
            else
                package:add("version", "v0.17.0+2", "098037ca18c1a3fbf25f061f822762d5eab1cd4ecf8e7d039f9ccbd357322a54")
            end
        elseif package:is_plat("linux") and package:is_arch("x86_64") then
            package:add("url", "https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-linux-x86_64-" .. suffix .. ".zip", {version = function(version) return version:gsub("%+", ".") end})
            if package:debug() then
                package:add("version", "v0.17.0+2", "7a05f7367b75ac2619e7da3a6a523a88207d7bc7c21ea00552f504ed0480610f")
            else
                package:add("version", "v0.17.0+2", "2bfebb48072cafee316fcec452d49d02aa46d7096325097e637c3c2e784eca5b")
            end
        elseif package:is_plat("macosx") and package:is_arch("x86_64") then
            package:add("url", "https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-macos-x86_64-" .. suffix .. ".zip", {version = function(version) return version:gsub("%+", ".") end})
            if package:debug() then
                package:add("version", "v0.17.0+2", "adbaa903a23984016a5dfc7ec3b7754cc355b6f604671986bd46a1d4c67d554b")
            else
                package:add("version", "v0.17.0+2", "749683e616659b5fa9a42151b7b71c2308e114c0322df78975d486aaf43650e9")
            end
        elseif package:is_plat("macosx") and package:is_arch("arm64") then
            package:add("url", "https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-macos-arm64-" .. suffix .. ".zip", {version = function(version) return version:gsub("%+", ".") end})
            if package:debug() then
                package:add("version", "v0.17.0+2", "77f27c870a44aaad1de413c0bca3d2a6227d2d4d6c3e80246241384f50bd3642")
            else
                package:add("version", "v0.17.0+2", "9af5dadcd05fa8d47d37cf171abae65c7d813123d0a60f0b50392da381279d04")
            end
        else
            os.raise("unsupported plat/arch")
        end
    end)

you can disable debug

@SirLynix
Copy link
Member Author

Yeah but I'd like to support it, but I don't think there is a way for now, except perhaps with a on_download callback?

@waruqi
Copy link
Member

waruqi commented Aug 14, 2023

Yeah but I'd like to support it, but I don't think there is a way for now, except perhaps with a on_download callback?

Maybe, you can try.

@waruqi waruqi merged commit e678ebb into dev Aug 14, 2023
53 checks passed
@waruqi waruqi deleted the SirLynix-wgpu-native branch August 14, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants