From a3b4c1f8b15e5eea91286069bb1c7ccdf7d5ef30 Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 30 Dec 2024 22:12:53 +0800 Subject: [PATCH 1/2] x265: improve numa deps --- packages/x/x265/xmake.lua | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/packages/x/x265/xmake.lua b/packages/x/x265/xmake.lua index 4d7dc75f8f9..0f58cfdd12b 100644 --- a/packages/x/x265/xmake.lua +++ b/packages/x/x265/xmake.lua @@ -3,9 +3,9 @@ package("x265") set_description("A free software library and application for encoding video streams into the H.265/MPEG-H HEVC compression format.") set_license("GPL-2.0") - add_urls("https://github.com/videolan/x265.git", - "https://bitbucket.org/multicoreware/x265_git") - + add_urls("https://bitbucket.org/multicoreware/x265_git.git", + "https://github.com/videolan/x265.git") +` add_urls("https://github.com/videolan/x265/archive/refs/tags/$(version).tar.gz", {alias = "github"}) add_urls("https://bitbucket.org/multicoreware/x265_git/downloads/x265_$(version).tar.gz", {alias = "bitbucket"}) @@ -20,6 +20,7 @@ package("x265") add_configs("svt_hevc", {description = "Enable SVT HEVC Encoder", default = false, type = "boolean"}) add_configs("high_bit_depth", {description = "Store pixel samples as 16bit values (Main10/Main12)", default = false, type = "boolean"}) add_configs("main12", {description = "Support Main12 instead of Main10", default = false, type = "boolean"}) + add_configs("vmaf", {description = "Enable vmaf", default = false, type = "boolean"}) if is_plat("linux") then add_configs("numa", {description = "Enable libnuma", default = false, type = "boolean"}) elseif is_plat("wasm") then @@ -45,7 +46,16 @@ package("x265") end) end - on_install("!cross", function (package) + on_load(function (package) + if package:config("numa") then + package:add("deps", "numactl") + end + if package:config("vmaf") then + package:add("deps", "vmaf") + end + end) + + on_install(function (package) os.cd("source") -- Let xmake cp pdb io.replace("CMakeLists.txt", "if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED))", "if(0)", {plain = true}) @@ -68,13 +78,9 @@ package("x265") table.insert(configs, "-DMAIN12=" .. (package:config("main12") and "ON" or "OFF")) table.insert(configs, "-DENABLE_CLI=" .. (package:config("tools") and "ON" or "OFF")) table.insert(configs, "-DNATIVE_BUILD=" .. (package:is_cross() and "OFF" or "ON")) + table.insert(configs, "-DENABLE_LIBNUMA=" .. (package:config("numa") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_VMAF=" .. (package:config("vmaf") and "ON" or "OFF")) - if package:config("numa") then - table.insert(configs, "-DENABLE_LIBNUMA=ON") - package:add("syslinks", "numa") - else - table.insert(configs, "-DENABLE_LIBNUMA=OFF") - end if package:version() then table.insert(configs, "-DX265_LATEST_TAG=" .. package:version():rawstr()) end @@ -92,10 +98,6 @@ package("x265") end end - if package:is_plat("windows") then - table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") - end - local opt = {} if package:gitref() or package:version():ge("4.0") then if package:is_plat("wasm") then @@ -111,14 +113,6 @@ package("x265") end -- Error links, switch to xmake pc file os.rm(package:installdir("lib/pkgconfig/x265.pc")) - - if package:is_debug() then - local dir = package:installdir(package:config("shared") and "bin" or "lib") - os.trycp(path.join(package:buildir(), "libx265.pdb"), dir) - if package:config("tools") then - os.trycp(path.join(package:buildir(), "x265.pdb"), package:installdir("bin")) - end - end else if package:config("shared") then os.tryrm(package:installdir("lib/libx265.a")) From 70485d8977d618701af597d2f7fa42d79a7cbd3f Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 30 Dec 2024 22:21:07 +0800 Subject: [PATCH 2/2] Update xmake.lua --- packages/x/x265/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/x/x265/xmake.lua b/packages/x/x265/xmake.lua index 0f58cfdd12b..092f136b0c6 100644 --- a/packages/x/x265/xmake.lua +++ b/packages/x/x265/xmake.lua @@ -5,7 +5,7 @@ package("x265") add_urls("https://bitbucket.org/multicoreware/x265_git.git", "https://github.com/videolan/x265.git") -` + add_urls("https://github.com/videolan/x265/archive/refs/tags/$(version).tar.gz", {alias = "github"}) add_urls("https://bitbucket.org/multicoreware/x265_git/downloads/x265_$(version).tar.gz", {alias = "bitbucket"})