Browse Source

add VERILATOR_ROOT env in verilator (#1744)

* add VERILATOR_ROOT

* fix package
ruki 2 years ago
parent
commit
a7bee93ef1
1 changed files with 7 additions and 1 deletions
  1. 7 1
      packages/v/verilator/xmake.lua

+ 7 - 1
packages/v/verilator/xmake.lua

@@ -22,6 +22,8 @@ package("verilator")
             end
             package:add("deps", "python 3.x", {kind = "binary"})
         end
+        package:mark_as_pathenv("VERILATOR_ROOT")
+        package:addenv("VERILATOR_ROOT", ".")
     end)
 
     on_install("windows", function (package)
@@ -37,6 +39,7 @@ package("verilator")
             end
         end
         local envs = cmake.buildenvs(package)
+        envs.VERILATOR_ROOT = nil
         envs.WIN_FLEX_BISON = winflexbison:installdir()
         io.replace("src/CMakeLists.txt", '${ASTGEN} -I"${srcdir}"', '${ASTGEN} -I "${srcdir}"', {plain = true})
         cmake.install(package, configs, {envs = envs, cxflags = cxflags})
@@ -44,6 +47,7 @@ package("verilator")
     end)
 
     on_install("linux", "macosx", function (package)
+        import("package.tools.autoconf")
         local configs = {}
         local cxflags = {}
         local flex = package:dep("flex"):fetch()
@@ -54,7 +58,9 @@ package("verilator")
             end
         end
         os.vrun("autoconf")
-        import("package.tools.autoconf").install(package, configs, {cxflags = cxflags})
+        local envs = autoconf.buildenvs(package, {cxflags = cxflags})
+        envs.VERILATOR_ROOT = nil
+        autoconf.install(package, configs, {envs = envs})
     end)
 
     on_test(function (package)