Pārlūkot izejas kodu

brotli: add version for pkgconfig file. (#1084)

Chen Yufei 3 gadi atpakaļ
vecāks
revīzija
4b57a224b5
2 mainītis faili ar 10 papildinājumiem un 1 dzēšanām
  1. 9 0
      packages/b/brotli/port/xmake.lua
  2. 1 1
      packages/b/brotli/xmake.lua

+ 9 - 0
packages/b/brotli/port/xmake.lua

@@ -1,5 +1,14 @@
 add_rules("mode.debug", "mode.release")
 add_rules("mode.debug", "mode.release")
 
 
+option("vers")
+    set_default("")
+    set_showmenu(true)
+option_end()
+
+if has_config("vers") then
+    set_version(get_config("vers"))
+end
+
 target("brotlienc")
 target("brotlienc")
     set_kind("$(kind)")
     set_kind("$(kind)")
     add_deps("brotlicommon")
     add_deps("brotlicommon")

+ 1 - 1
packages/b/brotli/xmake.lua

@@ -50,7 +50,7 @@ package("brotli")
 
 
     on_install(function (package)
     on_install(function (package)
         os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
         os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
-        local configs = {buildir = "xbuild"}
+        local configs = {buildir = "xbuild", vers = package:version_str()}
         if package:config("shared") then
         if package:config("shared") then
             configs.kind = "shared"
             configs.kind = "shared"
         end
         end