Skip to content

Commit

Permalink
pycdc: add 2024.08.12 version (#5414)
Browse files Browse the repository at this point in the history
* pycdc: add 2024.08.12 version

* drop 2022.10.04 version

* limit shared config
  • Loading branch information
star-hengxing authored Oct 4, 2024
1 parent 4190da7 commit 5f4b081
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
28 changes: 28 additions & 0 deletions packages/p/pycdc/port/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
add_rules("mode.debug", "mode.release")

set_languages("c++11")

target("pycxx")
set_kind("$(kind)")
add_files(
"bytecode.cpp",
"data.cpp",
"pyc_*.cpp",
"bytes/python_*.cpp"
)
add_includedirs(os.projectdir())
add_headerfiles("*.h")

if is_plat("windows") and is_kind("shared") then
add_rules("utils.symbols.export_all", {export_classes = true})
end

target("pycdas")
set_kind("binary")
add_files("pycdas.cpp")
add_deps("pycxx")

target("pycdc")
set_kind("binary")
add_files("pycdc.cpp", "ASTree.cpp", "ASTNode.cpp")
add_deps("pycxx")
19 changes: 8 additions & 11 deletions packages/p/pycdc/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
package("pycdc")
set_homepage("https://github.com/zrax/pycdc")
set_description("C++ python bytecode disassembler and decompiler")
set_license("GPL-3.0")

add_urls("https://github.com/zrax/pycdc.git")
add_versions("2022.10.04", "44a730f3a889503014fec94ae6e62d8401cb75e5")

add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
add_versions("2024.08.12", "dc6ca4ae36128f2674b5b4c9b0ce6fdda97d4df0")

add_deps("cmake")
add_deps("python", {kind = "binary"})
if is_plat("windows") and is_arch("arm.*") then
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
end

on_install("macosx", "linux", "windows", function (package)
local configs = {}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
import("package.tools.cmake").install(package, configs, {buildir = "build"})
os.cp("*.h", package:installdir("include"))
os.trycp("build/*.a", package:installdir("lib"))
os.trycp("build/*.lib", package:installdir("lib"))
on_install(function (package)
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
import("package.tools.xmake").install(package)
package:addenv("PATH", "bin")
end)

Expand Down

0 comments on commit 5f4b081

Please sign in to comment.