diff --git a/packages/p/pycdc/port/xmake.lua b/packages/p/pycdc/port/xmake.lua new file mode 100644 index 00000000000..530916abcf3 --- /dev/null +++ b/packages/p/pycdc/port/xmake.lua @@ -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") diff --git a/packages/p/pycdc/xmake.lua b/packages/p/pycdc/xmake.lua index 9fb9d11b3a8..549f131c62b 100644 --- a/packages/p/pycdc/xmake.lua +++ b/packages/p/pycdc/xmake.lua @@ -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)