Преглед на файлове

pycdc: add 2024.08.12 version (#5414)

* pycdc: add 2024.08.12 version

* drop 2022.10.04 version

* limit shared config
star9029 преди 10 месеца
родител
ревизия
5f4b081353
променени са 2 файла, в които са добавени 36 реда и са изтрити 11 реда
  1. 28 0
      packages/p/pycdc/port/xmake.lua
  2. 8 11
      packages/p/pycdc/xmake.lua

+ 28 - 0
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")

+ 8 - 11
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)