瀏覽代碼

add llvm (#265)

* add llvm

* update llvm urls
ruki 4 年之前
父節點
當前提交
b380d9ab2d
共有 3 個文件被更改,包括 43 次插入10 次删除
  1. 2 5
      .github/workflows/freebsd.yml
  2. 36 0
      packages/l/llvm/xmake.lua
  3. 5 5
      packages/z/zig/xmake.lua

+ 2 - 5
.github/workflows/freebsd.yml

@@ -17,9 +17,7 @@ jobs:
     runs-on: ${{ matrix.os }}
 
     steps:
-      - uses: actions/checkout@v2
-        with:
-          submodules: true
+      - uses: actions/checkout@v1
 
       - name: Tests
         uses: vmactions/[email protected]
@@ -33,8 +31,7 @@ jobs:
             gmake -j4
             gmake install
             export XMAKE_ROOT=y
-            git clone https://github.com/xmake-io/xmake-repo.git /tmp/xmake-repo -b dev --depth 2
-            cd /tmp/xmake-repo
+            cd -
             xmake l ./scripts/test.lua -D -k ${{ matrix.kind }}
 
 

+ 36 - 0
packages/l/llvm/xmake.lua

@@ -0,0 +1,36 @@
+package("llvm")
+
+    set_kind("binary")
+    set_homepage("https://llvm.org/")
+    set_description("The LLVM Compiler Infrastructure")
+
+    if is_host("macosx") then
+        if os.arch() == "x86_64" then
+            set_urls("https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/clang+llvm-$(version)-x86_64-apple-darwin.tar.xz")
+            add_versions("11.0.0", "b93886ab0025cbbdbb08b46e5e403a462b0ce034811c929e96ed66c2b07fe63a")
+        end
+    elseif is_host("bsd") then
+        if os.arch() == "x86_64" then
+            set_urls("https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/clang+llvm-$(version)-amd64-unknown-freebsd11.tar.xz")
+            add_versions("11.0.0", "3a3bcac4da7d1ed431fef469fe52ccf9a525016d6900718a447986c7ab850d45")
+        elseif os.arch() == "i386" then
+            set_urls("https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/clang+llvm-$(version)-i386-unknown-freebsd11.tar.xz")
+            add_versions("11.0.0", "649ae62e8b85cd44b872678b118c8cbc75e2e29d94d995fddd9149fc6c3a4040")
+        end
+    elseif is_host("windows") then
+        if os.arch() == "x86" then
+            set_urls("https://github.com/xmake-mirror/llvm-project/releases/download/llvmorg-$(version)/clang+llvm-$(version)-win32.tar.xz")
+            add_versions("11.0.0", "fd7f3862e6d2a7ed1855e4692702f60d0f49c04514202c8b1d6659ce1872ecb9")
+        else
+            set_urls("https://github.com/xmake-mirror/llvm-project/releases/download/llvmorg-$(version)/clang+llvm-$(version)-win64.tar.xz")
+            add_versions("11.0.0", "de2dce781b70a66c28b389905ae825998b18b33b7b1e3e94f947a2ec57fb328d")
+        end
+    end
+
+    on_install("@macosx", "@windows", "@msys", "@bsd", function (package)
+        os.cp("*", package:installdir())
+    end)
+
+    on_test(function (package)
+        os.vrun("clang --version")
+    end)

+ 5 - 5
packages/z/zig/xmake.lua

@@ -8,7 +8,7 @@ package("zig")
         set_urls("https://ziglang.org/download/$(version)/zig-macos-x86_64-$(version).tar.xz")
         add_versions("0.7.1", "845cb17562978af0cf67e3993f4e33330525eaf01ead9386df9105111e3bc519")
     elseif is_host("windows") then
-        if is_arch("x86") then
+        if os.arch() == "x86" then
             set_urls("https://ziglang.org/download/$(version)/zig-windows-i386-$(version).zip")
             add_versions("0.7.1", "a1b9a7421e13153e07fd2e2c93ff29aad64d83105b8fcdafa633dbe689caf1c0")
         else
@@ -16,13 +16,13 @@ package("zig")
             add_versions("0.7.1", "4818a8a65b4672bc52c0ae7f14d014e0eb8caf10f12c0745176820384cea296a")
         end
     elseif is_host("linux") then
-        if is_arch("i386") then
+        if os.arch() == "i386" then
             set_urls("https://ziglang.org/download/$(version)/zig-linux-i386-$(version).tar.xz")
             add_versions("0.7.1", "4882e052e5f83690bd0334bb4fc1702b5403cb3a3d2aa63fd7d6043d8afecba3")
-        elseif is_arch("arm64") then
+        elseif os.arch() == "arm64" then
             set_urls("https://ziglang.org/download/$(version)/zig-linux-aarch64-$(version).tar.xz")
             add_versions("0.7.1", "48ec90eba407e4587ddef7eecef25fec7e13587eb98e3b83c5f2f5fff2a5cbe7")
-        elseif is_arch("arm", "armv7") then
+        elseif os.arch() == "arm" or os.arch() == "armv7" then
             set_urls("https://ziglang.org/download/$(version)/zig-linux-armv7a-$(version).tar.xz")
             add_versions("0.7.1", "5a0662e07b4c4968665e1f97558f8591f6facec45d2e0ff5715e661743107ceb")
         else
@@ -34,7 +34,7 @@ package("zig")
         add_versions("0.7.1", "e73c1dca35791a3183fdd5ecde0443ebbe180942efceafe651886034fb8def09")
     end
 
-    on_install("macosx", "linux", "windows", "bsd", function (package)
+    on_install("@macosx", "@linux", "@windows", "@msys", "@bsd", function (package)
         os.cp("*", package:installdir())
         package:addenv("PATH", package:installdir())
     end)