1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

more packages

This commit is contained in:
Darien Raymond 2018-10-03 23:27:42 +02:00
parent 6e26fb5835
commit 222de64515
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
3 changed files with 140 additions and 17 deletions

8
main/BUILD Normal file
View File

@ -0,0 +1,8 @@
load("@v2ray_ext//bazel:build.bzl", "foreign_go_binary")
load("@v2ray_ext//bazel:gpg.bzl", "gpg_sign")
load("@v2ray_ext//bazel:matrix.bzl", "SUPPORTED_MATRIX")
load("//main:targets.bzl", "gen_targets")
package(default_visibility=["//visibility:public"])
gen_targets(SUPPORTED_MATRIX)

69
main/targets.bzl Normal file
View File

@ -0,0 +1,69 @@
load("@v2ray_ext//bazel:build.bzl", "foreign_go_binary")
load("@v2ray_ext//bazel:gpg.bzl", "gpg_sign")
def gen_targets(matrix):
pkg = "v2ray.com/core/main"
output = "v2ray"
for (os, arch) in matrix:
bin_name = "v2ray_" + os + "_" + arch
foreign_go_binary(
name = bin_name,
pkg = pkg,
output = output,
os = os,
arch = arch,
)
gpg_sign(
name = bin_name + "_sig",
base = ":" + bin_name,
)
if os in ["windows"]:
bin_name = "v2ray_" + os + "_" + arch + "_nowindow"
foreign_go_binary(
name = bin_name,
pkg = pkg,
output = "w" + output,
os = os,
arch = arch,
ld = "-H windowsgui",
)
gpg_sign(
name = bin_name + "_sig",
base = ":" + bin_name,
)
if arch in ["mips", "mipsle"]:
bin_name = "v2ray_" + os + "_" + arch + "_softfloat"
foreign_go_binary(
name = bin_name,
pkg = pkg,
output = output+"_softfloat",
os = os,
arch = arch,
mips = "softfloat",
)
gpg_sign(
name = bin_name + "_sig",
base = ":" + bin_name,
)
if arch in ["arm"]:
bin_name = "v2ray_" + os + "_" + arch + "_armv7"
foreign_go_binary(
name = bin_name,
pkg = pkg,
output = output+"_armv7",
os = os,
arch = arch,
arm = "7",
)
gpg_sign(
name = bin_name + "_sig",
base = ":" + bin_name,
)

View File

@ -1,21 +1,6 @@
package(default_visibility=["//visibility:public"]) package(default_visibility=["//visibility:public"])
load("@v2ray_ext//bazel:build.bzl", "foreign_go_binary")
load("@v2ray_ext//bazel:zip.bzl", "pkg_zip") load("@v2ray_ext//bazel:zip.bzl", "pkg_zip")
load("@v2ray_ext//bazel:gpg.bzl", "gpg_sign")
foreign_go_binary(
name = "v2ray_linux_amd64",
pkg = "v2ray.com/core/main",
output = "v2ray",
os = "linux",
arch = "amd64",
)
gpg_sign(
name = "v2ray_linux_amd64_sig",
base = ":v2ray_linux_amd64",
)
filegroup( filegroup(
name = "config_json", name = "config_json",
@ -42,11 +27,57 @@ filegroup(
srcs = ["config/geoip.dat", "config/geosite.dat"], srcs = ["config/geoip.dat", "config/geosite.dat"],
) )
pkg_zip(
name = "v2ray_darwin_amd64_package",
srcs = [
"//main:v2ray_darwin_amd64",
"//main:v2ray_darwin_amd64_sig",
"@v2ray_ext//tools/control/main:v2ctl_darwin_amd64",
"@v2ray_ext//tools/control/main:v2ctl_darwin_amd64_sig",
":config_json",
":doc",
":geodata",
],
out = "v2ray-macos-64.zip",
)
pkg_zip(
name = "v2ray_windows_amd64_package",
srcs = [
"//main:v2ray_windows_amd64",
"//main:v2ray_lwindows_amd64_sig",
"//main:v2ray_windows_amd64_nowindow",
"//main:v2ray_lwindows_amd64_nowindow_sig",
"@v2ray_ext//tools/control/main:v2ctl_windows_amd64",
"@v2ray_ext//tools/control/main:v2ctl_windows_amd64_sig",
":config_json",
":doc",
":geodata",
],
out = "v2ray-windows-64.zip",
)
pkg_zip(
name = "v2ray_windows_x86_package",
srcs = [
"//main:v2ray_windows_x86",
"//main:v2ray_windows_x86_sig",
"//main:v2ray_windows_x86_nowindow",
"//main:v2ray_windows_x86_nowindow_sig",
"@v2ray_ext//tools/control/main:v2ctl_windows_x86",
"@v2ray_ext//tools/control/main:v2ctl_windows_x86_sig",
":config_json",
":doc",
":geodata",
],
out = "v2ray-windows-32.zip",
)
pkg_zip( pkg_zip(
name = "v2ray_linux_amd64_package", name = "v2ray_linux_amd64_package",
srcs = [ srcs = [
":v2ray_linux_amd64", "//main:v2ray_linux_amd64",
":v2ray_linux_amd64_sig", "//main:v2ray_linux_amd64_sig",
"@v2ray_ext//tools/control/main:v2ctl_linux_amd64", "@v2ray_ext//tools/control/main:v2ctl_linux_amd64",
"@v2ray_ext//tools/control/main:v2ctl_linux_amd64_sig", "@v2ray_ext//tools/control/main:v2ctl_linux_amd64_sig",
":config_all", ":config_all",
@ -56,3 +87,18 @@ pkg_zip(
], ],
out = "v2ray-linux-64.zip", out = "v2ray-linux-64.zip",
) )
pkg_zip(
name = "v2ray_linux_x86_package",
srcs = [
"//main:v2ray_linux_x86",
"//main:v2ray_linux_x86_sig",
"@v2ray_ext//tools/control/main:v2ctl_linux_x86",
"@v2ray_ext//tools/control/main:v2ctl_linux_x86_sig",
":config_all",
":systemd",
":doc",
":geodata",
],
out = "v2ray-linux-32.zip",
)