summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-03-01 00:50:16 +0800
committerruki <[email protected]>2024-03-01 00:50:16 +0800
commit9b8384ff002380fce4ba8ca4cd3f6e0e354fb9dc (patch)
tree440df557186868b57313538be1526bce47d87dfe /xmake/core/package/package.lua
parent95029452b5b1ebf71986a6bd2d2d45f459861c19 (diff)
apply reversed patches for package
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index eef05d80e..9ef2abfe6 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -1998,6 +1998,12 @@ function _instance:fetch_librarydeps()
end
-- get the patches of the current version
+--
+-- @code
+-- add_patches("6.7.6", "https://cdn.kernel.org/pub/linux/kernel/v6.x/patch-6.7.6.xz",
+-- "a394326aa325f8a930a4ce33c69ba7b8b454aef1107a4d3c2a8ae12908615fc4", {reverse = true})
+-- @endcode
+--
function _instance:patches()
local patches = self._PATCHES
if patches == nil then
@@ -2009,7 +2015,8 @@ function _instance:patches()
patches = {}
patchinfo = table.wrap(patchinfo)
for idx = 1, #patchinfo, 2 do
- table.insert(patches , {url = patchinfo[idx], sha256 = patchinfo[idx + 1]})
+ local extra = self:extraconf("patches." .. version_str, patchinfo[idx])
+ table.insert(patches , {url = patchinfo[idx], sha256 = patchinfo[idx + 1], extra = extra})
end
else
-- match semver, e.g add_patches(">=1.0.0", url, sha256)
@@ -2018,7 +2025,8 @@ function _instance:patches()
patches = patches or {}
patchinfo = table.wrap(patchinfo)
for idx = 1, #patchinfo, 2 do
- table.insert(patches , {url = patchinfo[idx], sha256 = patchinfo[idx + 1]})
+ local extra = self:extraconf("patches." .. range, patchinfo[idx])
+ table.insert(patches , {url = patchinfo[idx], sha256 = patchinfo[idx + 1], extra = extra})
end
end
end