mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
commit
241af38456
7 changed files with 199 additions and 298 deletions
|
@ -27,7 +27,10 @@ define GoCompiler/Default/Make
|
|||
cd "$(1)/src" ; \
|
||||
$(if $(2),GOROOT_FINAL="$(2)/lib/go-$(3)") \
|
||||
$(4) \
|
||||
$(BASH) make.bash --no-banner ; \
|
||||
$(BASH) make.bash \
|
||||
$(if $(findstring s,$(OPENWRT_VERBOSE)),-v) \
|
||||
--no-banner \
|
||||
; \
|
||||
)
|
||||
endef
|
||||
|
||||
|
@ -73,8 +76,10 @@ define GoCompiler/Default/Install/Bin
|
|||
$(INSTALL_BIN) -p "$(1)/bin/$(4)"/* "$(2)/lib/go-$(3)/bin/"
|
||||
endif
|
||||
|
||||
$(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg"
|
||||
$(CP) "$(1)/pkg/$(4)$(if $(5),_$(5))" "$(2)/lib/go-$(3)/pkg/"
|
||||
if [ -d "$(1)/pkg/$(4)$(if $(5),_$(5))" ]; then \
|
||||
$(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg" ; \
|
||||
$(CP) "$(1)/pkg/$(4)$(if $(5),_$(5))" "$(2)/lib/go-$(3)/pkg/" ; \
|
||||
fi
|
||||
|
||||
$(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg/tool/$(4)"
|
||||
$(INSTALL_BIN) -p "$(1)/pkg/tool/$(4)"/* "$(2)/lib/go-$(3)/pkg/tool/$(4)/"
|
||||
|
@ -95,8 +100,6 @@ define GoCompiler/Default/Install/Doc
|
|||
$(call GoCompiler/Default/Install/make-dirs,$(2),$(3))
|
||||
|
||||
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),doc)
|
||||
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),favicon.ico)
|
||||
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),robots.txt)
|
||||
endef
|
||||
|
||||
# $(1) source go root
|
||||
|
|
|
@ -29,7 +29,8 @@ unexport \
|
|||
GOOS \
|
||||
GOPATH \
|
||||
GOROOT \
|
||||
GOTMPDIR
|
||||
GOTMPDIR \
|
||||
GOWORK
|
||||
# Unmodified:
|
||||
# GOINSECURE
|
||||
# GOPRIVATE
|
||||
|
@ -58,10 +59,16 @@ unexport \
|
|||
unexport \
|
||||
GOARM \
|
||||
GO386 \
|
||||
GOAMD64 \
|
||||
GOMIPS \
|
||||
GOMIPS64 \
|
||||
GOPPC64 \
|
||||
GOWASM
|
||||
|
||||
# Environment variables for use with code coverage:
|
||||
unexport \
|
||||
GOCOVERDIR
|
||||
|
||||
# Special-purpose environment variables:
|
||||
unexport \
|
||||
GCCGOTOOLDIR \
|
||||
|
@ -74,6 +81,7 @@ unexport \
|
|||
# From https://pkg.go.dev/runtime#hdr-Environment_Variables
|
||||
unexport \
|
||||
GOGC \
|
||||
GOMEMLIMIT \
|
||||
GOMAXPROCS \
|
||||
GORACE \
|
||||
GOTRACEBACK
|
||||
|
@ -86,13 +94,12 @@ unexport \
|
|||
# CC_FOR_${GOOS}_${GOARCH}
|
||||
# CXX_FOR_${GOOS}_${GOARCH}
|
||||
|
||||
# From https://golang.org/doc/install/source#environment
|
||||
# From https://go.dev/doc/install/source#environment
|
||||
unexport \
|
||||
GOHOSTOS \
|
||||
GOHOSTARCH \
|
||||
GOPPC64
|
||||
GOHOSTARCH
|
||||
|
||||
# From https://golang.org/src/make.bash
|
||||
# From https://go.dev/src/make.bash
|
||||
unexport \
|
||||
GO_GCFLAGS \
|
||||
GO_LDFLAGS \
|
||||
|
@ -101,16 +108,16 @@ unexport \
|
|||
GOBUILDTIMELOGFILE \
|
||||
GOROOT_BOOTSTRAP
|
||||
|
||||
# From https://golang.org/doc/go1.9#parallel-compile
|
||||
# From https://go.dev/doc/go1.9#parallel-compile
|
||||
unexport \
|
||||
GO19CONCURRENTCOMPILATION
|
||||
|
||||
# From https://golang.org/src/cmd/dist/build.go
|
||||
# From https://go.dev/src/cmd/dist/build.go
|
||||
unexport \
|
||||
BOOT_GO_GCFLAGS \
|
||||
BOOT_GO_LDFLAGS
|
||||
|
||||
# From https://golang.org/src/cmd/dist/buildtool.go
|
||||
# From https://go.dev/src/cmd/dist/buildtool.go
|
||||
unexport \
|
||||
GOBOOTSTRAP_TOOLEXEC
|
||||
|
||||
|
@ -152,6 +159,9 @@ ifeq ($(GO_ARCH),386)
|
|||
# -fno-plt: causes "unexpected GOT reloc for non-dynamic symbol" errors
|
||||
GO_CFLAGS_TO_REMOVE:=-fno-plt
|
||||
|
||||
else ifeq ($(GO_ARCH),amd64)
|
||||
GO_AMD64:=v1
|
||||
|
||||
else ifeq ($(GO_ARCH),arm)
|
||||
GO_TARGET_FPU:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
|
||||
|
||||
|
@ -183,6 +193,9 @@ else ifneq ($(filter $(GO_ARCH),mips64 mips64le),)
|
|||
GO_MIPS64:=softfloat
|
||||
endif
|
||||
|
||||
else ifeq ($(GO_ARCH),ppc64)
|
||||
GO_PPC64:=power8
|
||||
|
||||
endif
|
||||
|
||||
|
||||
|
@ -193,12 +206,11 @@ GO_ARCH_DEPENDS:=@(aarch64||arm||i386||i686||mips||mips64||mips64el||mipsel||pow
|
|||
|
||||
# ASLR/PIE
|
||||
|
||||
# From https://golang.org/src/cmd/internal/sys/supported.go
|
||||
# From https://go.dev/src/internal/platform/supported.go
|
||||
GO_PIE_SUPPORTED_OS_ARCH:= \
|
||||
android_386 android_amd64 android_arm android_arm64 \
|
||||
linux_386 linux_amd64 linux_arm linux_arm64 \
|
||||
\
|
||||
windows_386 windows_amd64 windows_arm \
|
||||
windows_386 windows_amd64 windows_arm windows_arm64 \
|
||||
\
|
||||
darwin_amd64 darwin_arm64 \
|
||||
ios_amd64 ios_arm64 \
|
||||
|
@ -209,8 +221,8 @@ GO_PIE_SUPPORTED_OS_ARCH:= \
|
|||
\
|
||||
linux_ppc64le linux_riscv64 linux_s390x
|
||||
|
||||
# From https://golang.org/src/cmd/go/internal/work/init.go
|
||||
go_pie_install_suffix=$(if $(filter $(1),aix_ppc64 windows_386 windows_amd64 windows_arm),,shared)
|
||||
# From https://go.dev/src/cmd/go/internal/work/init.go
|
||||
go_pie_install_suffix=$(if $(filter $(1),aix_ppc64 windows_386 windows_amd64 windows_arm windows_arm64),,shared)
|
||||
|
||||
ifneq ($(filter $(GO_HOST_OS_ARCH),$(GO_PIE_SUPPORTED_OS_ARCH)),)
|
||||
GO_HOST_PIE_SUPPORTED:=1
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
GO_VERSION_MAJOR_MINOR:=1.17
|
||||
GO_VERSION_MAJOR_MINOR:=1.20
|
||||
GO_VERSION_PATCH:=3
|
||||
|
||||
PKG_NAME:=golang
|
||||
|
@ -20,7 +20,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \
|
|||
|
||||
PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
|
||||
PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
|
||||
PKG_HASH:=705c64251e5b25d5d55ede1039c6aa22bea40a7a931d14c370339853643c3df0
|
||||
PKG_HASH:=e447b498cde50215c4f7619e5124b0fc4e25fb5d16ea47271c47f278e7aa763a
|
||||
|
||||
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
@ -63,9 +63,11 @@ HOST_GO_VALID_OS_ARCH:= \
|
|||
aix_ppc64 \
|
||||
js_wasm \
|
||||
\
|
||||
freebsd_riscv64 \
|
||||
\
|
||||
linux_ppc64 linux_ppc64le \
|
||||
linux_mips linux_mipsle linux_mips64 linux_mips64le \
|
||||
linux_riscv64 linux_s390x \
|
||||
linux_loong64 linux_riscv64 linux_s390x \
|
||||
\
|
||||
openbsd_mips64
|
||||
|
||||
|
@ -86,6 +88,12 @@ BOOTSTRAP_GO_VALID_OS_ARCH:= \
|
|||
solaris_amd64 \
|
||||
windows_386 windows_amd64
|
||||
|
||||
BOOTSTRAP_1_17_SOURCE:=go1.17.13.src.tar.gz
|
||||
BOOTSTRAP_1_17_SOURCE_URL:=$(GO_SOURCE_URLS)
|
||||
BOOTSTRAP_1_17_HASH:=a1a48b23afb206f95e7bbaa9b898d965f90826f6f1d1fc0c1d784ada0cd300fd
|
||||
|
||||
BOOTSTRAP_1_17_BUILD_DIR:=$(HOST_BUILD_DIR)/.go_bootstrap_1.17
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../golang-compiler.mk
|
||||
|
@ -94,6 +102,7 @@ include ../golang-package.mk
|
|||
PKG_UNPACK:=$(HOST_TAR) -C "$(PKG_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(PKG_SOURCE)"
|
||||
HOST_UNPACK:=$(HOST_TAR) -C "$(HOST_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(PKG_SOURCE)"
|
||||
BOOTSTRAP_UNPACK:=$(HOST_TAR) -C "$(BOOTSTRAP_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(BOOTSTRAP_SOURCE)"
|
||||
BOOTSTRAP_1_17_UNPACK:=$(HOST_TAR) -C "$(BOOTSTRAP_1_17_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(BOOTSTRAP_1_17_SOURCE)"
|
||||
|
||||
# don't strip ELF executables in test data
|
||||
RSTRIP:=:
|
||||
|
@ -106,7 +115,7 @@ endif
|
|||
define Package/golang/Default
|
||||
$(call GoPackage/GoSubMenu)
|
||||
TITLE:=Go programming language
|
||||
URL:=https://golang.org/
|
||||
URL:=https://go.dev/
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
|
@ -181,8 +190,7 @@ ifeq ($(BOOTSTRAP_ROOT_DIR),)
|
|||
$(eval $(call Download,golang-bootstrap))
|
||||
|
||||
define Bootstrap/Prepare
|
||||
mkdir -p "$(BOOTSTRAP_BUILD_DIR)"
|
||||
$(BOOTSTRAP_UNPACK)
|
||||
mkdir -p "$(BOOTSTRAP_BUILD_DIR)" && $(BOOTSTRAP_UNPACK) ;
|
||||
endef
|
||||
Hooks/HostPrepare/Post+=Bootstrap/Prepare
|
||||
|
||||
|
@ -190,6 +198,23 @@ ifeq ($(BOOTSTRAP_ROOT_DIR),)
|
|||
endif
|
||||
|
||||
|
||||
# Bootstrap 1.17
|
||||
|
||||
define Download/golang-bootstrap-1.17
|
||||
FILE:=$(BOOTSTRAP_1_17_SOURCE)
|
||||
URL:=$(BOOTSTRAP_1_17_SOURCE_URL)
|
||||
HASH:=$(BOOTSTRAP_1_17_HASH)
|
||||
endef
|
||||
$(eval $(call Download,golang-bootstrap-1.17))
|
||||
|
||||
define Bootstrap-1.17/Prepare
|
||||
mkdir -p "$(BOOTSTRAP_1_17_BUILD_DIR)" && $(BOOTSTRAP_1_17_UNPACK) ;
|
||||
endef
|
||||
Hooks/HostPrepare/Post+=Bootstrap-1.17/Prepare
|
||||
|
||||
$(eval $(call GoCompiler/AddProfile,Bootstrap-1.17,$(BOOTSTRAP_1_17_BUILD_DIR),,bootstrap-1.17,$(GO_HOST_OS_ARCH)))
|
||||
|
||||
|
||||
# Host
|
||||
|
||||
ifeq ($(GO_HOST_PIE_SUPPORTED),1)
|
||||
|
@ -202,23 +227,31 @@ endif
|
|||
$(eval $(call GoCompiler/AddProfile,Host,$(HOST_BUILD_DIR),$(HOST_GO_PREFIX),$(HOST_GO_VERSION_ID),$(GO_HOST_OS_ARCH),$(HOST_GO_INSTALL_SUFFIX)))
|
||||
|
||||
HOST_GO_VARS= \
|
||||
GOHOSTARCH="$(GO_HOST_ARCH)" \
|
||||
GOCACHE="$(GO_BUILD_CACHE_DIR)" \
|
||||
GOENV=off \
|
||||
CC="$(HOSTCC_NOCACHE)" \
|
||||
CXX="$(HOSTCXX_NOCACHE)"
|
||||
|
||||
define Host/Compile
|
||||
define Host/Configure
|
||||
$(call GoCompiler/Bootstrap/CheckHost,$(BOOTSTRAP_GO_VALID_OS_ARCH))
|
||||
$(call GoCompiler/Host/CheckHost,$(HOST_GO_VALID_OS_ARCH))
|
||||
|
||||
mkdir -p "$(GO_BUILD_CACHE_DIR)"
|
||||
endef
|
||||
|
||||
define Host/Compile
|
||||
$(call GoCompiler/Bootstrap/Make, \
|
||||
$(HOST_GO_VARS) \
|
||||
)
|
||||
|
||||
$(call GoCompiler/Host/Make, \
|
||||
$(call GoCompiler/Bootstrap-1.17/Make, \
|
||||
GOROOT_BOOTSTRAP="$(BOOTSTRAP_ROOT_DIR)" \
|
||||
$(HOST_GO_VARS) \
|
||||
)
|
||||
|
||||
$(call GoCompiler/Host/Make, \
|
||||
GOROOT_BOOTSTRAP="$(BOOTSTRAP_1_17_BUILD_DIR)" \
|
||||
$(if $(HOST_GO_ENABLE_PIE),GO_LDFLAGS="-buildmode pie") \
|
||||
$(HOST_GO_VARS) \
|
||||
)
|
||||
|
@ -262,14 +295,16 @@ $(eval $(call GoCompiler/AddProfile,Package,$(PKG_BUILD_DIR),$(PKG_GO_PREFIX),$(
|
|||
|
||||
PKG_GO_ZBOOTSTRAP_MODS:= \
|
||||
s/defaultGO386 = `[^`]*`/defaultGO386 = `$(or $(GO_386),sse2)`/; \
|
||||
s/defaultGOAMD64 = `[^`]*`/defaultGOAMD64 = `$(or $(GO_AMD64),v1)`/; \
|
||||
s/defaultGOARM = `[^`]*`/defaultGOARM = `$(or $(GO_ARM),5)`/; \
|
||||
s/defaultGOMIPS = `[^`]*`/defaultGOMIPS = `$(or $(GO_MIPS),hardfloat)`/; \
|
||||
s/defaultGOMIPS64 = `[^`]*`/defaultGOMIPS64 = `$(or $(GO_MIPS64),hardfloat)`/; \
|
||||
s/defaultGOPPC64 = `[^`]*`/defaultGOPPC64 = `power8`/;
|
||||
s/defaultGOPPC64 = `[^`]*`/defaultGOPPC64 = `$(or $(GO_PPC64),power8)`/;
|
||||
|
||||
PKG_GO_ZBOOTSTRAP_PATH:=$(PKG_BUILD_DIR)/src/internal/buildcfg/zbootstrap.go
|
||||
|
||||
PKG_GO_VARS= \
|
||||
GOHOSTARCH="$(GO_HOST_ARCH)" \
|
||||
GOCACHE="$(GO_BUILD_CACHE_DIR)" \
|
||||
GOENV=off \
|
||||
GO_GCC_HELPER_PATH="$$$$PATH" \
|
||||
|
@ -290,18 +325,19 @@ PKG_GO_LDFLAGS= \
|
|||
-extldflags '$(patsubst -z%,-Wl$(comma)-z$(comma)%,$(TARGET_LDFLAGS))' \
|
||||
$(if $(CONFIG_NO_STRIP)$(CONFIG_DEBUG),,-s -w)
|
||||
|
||||
# setting -trimpath is not necessary here because the paths inside the
|
||||
# compiler binary are relative to GOROOT_FINAL (PKG_GO_ROOT), which is
|
||||
# static / not dependent on the build environment
|
||||
PKG_GO_INSTALL_ARGS= \
|
||||
-buildvcs=false \
|
||||
-trimpath \
|
||||
-ldflags "all=$(PKG_GO_LDFLAGS)" \
|
||||
$(if $(PKG_GO_GCFLAGS),-gcflags "all=$(PKG_GO_GCFLAGS)") \
|
||||
$(if $(PKG_GO_ASMFLAGS),-asmflags "all=$(PKG_GO_ASMFLAGS)") \
|
||||
$(if $(filter $(GO_PKG_ENABLE_PIE),1),-buildmode pie)
|
||||
|
||||
define Build/Compile
|
||||
define Build/Configure
|
||||
mkdir -p "$(GO_BUILD_CACHE_DIR)"
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@echo "Building target Go first stage"
|
||||
|
||||
$(call GoCompiler/Package/Make, \
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
From 5ccf9f47bf4f5ba53e0ab7338a7fd4626714cfb2 Mon Sep 17 00:00:00 2001
|
||||
From: Jeffery To <jeffery.to@gmail.com>
|
||||
Date: Tue, 23 Nov 2021 15:05:37 +0800
|
||||
Subject: [PATCH] cmd/link: use gold on ARM/ARM64 only if gold is available
|
||||
|
||||
COPY relocation handling on ARM/ARM64 has been fixed in recent versions
|
||||
of the GNU linker. This switches to gold only if gold is available.
|
||||
|
||||
Fixes #22040.
|
||||
---
|
||||
src/cmd/link/internal/ld/lib.go | 19 +++++++------------
|
||||
1 file changed, 7 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/src/cmd/link/internal/ld/lib.go
|
||||
+++ b/src/cmd/link/internal/ld/lib.go
|
||||
@@ -1535,25 +1535,20 @@ func (ctxt *Link) hostlink() {
|
||||
}
|
||||
|
||||
if ctxt.Arch.InFamily(sys.ARM, sys.ARM64) && buildcfg.GOOS == "linux" {
|
||||
- // On ARM, the GNU linker will generate COPY relocations
|
||||
- // even with -znocopyreloc set.
|
||||
+ // On ARM, older versions of the GNU linker will generate
|
||||
+ // COPY relocations even with -znocopyreloc set.
|
||||
// https://sourceware.org/bugzilla/show_bug.cgi?id=19962
|
||||
//
|
||||
- // On ARM64, the GNU linker will fail instead of
|
||||
- // generating COPY relocations.
|
||||
+ // On ARM64, older versions of the GNU linker will fail
|
||||
+ // instead of generating COPY relocations.
|
||||
//
|
||||
- // In both cases, switch to gold.
|
||||
- altLinker = "gold"
|
||||
-
|
||||
- // If gold is not installed, gcc will silently switch
|
||||
- // back to ld.bfd. So we parse the version information
|
||||
- // and provide a useful error if gold is missing.
|
||||
+ // In both cases, switch to gold if gold is available.
|
||||
name, args := flagExtld[0], flagExtld[1:]
|
||||
args = append(args, "-fuse-ld=gold", "-Wl,--version")
|
||||
cmd := exec.Command(name, args...)
|
||||
if out, err := cmd.CombinedOutput(); err == nil {
|
||||
- if !bytes.Contains(out, []byte("GNU gold")) {
|
||||
- log.Fatalf("ARM external linker must be gold (issue #15696), but is not: %s", out)
|
||||
+ if bytes.Contains(out, []byte("GNU gold")) {
|
||||
+ altLinker = "gold"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -69,7 +69,7 @@ MY_DEPENDS := \
|
|||
ca-bundle openssl-util \
|
||||
dejavu-fonts-ttf-DejaVuSerif dejavu-fonts-ttf-DejaVuSerif-Bold dejavu-fonts-ttf-DejaVuSerif-Italic dejavu-fonts-ttf-DejaVuSerif-BoldItalic \
|
||||
luci-app-snmpd \
|
||||
iputils-tracepath !TARGET_mvebu:v2ray-plugin netcat simple-obfs \
|
||||
iputils-tracepath netcat simple-obfs \
|
||||
(TARGET_x86||TARGET_x86_64):kmod-iwlwifi (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl1000 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl100 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl105 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl135 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl2000 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl2030 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl3160 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl3168 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl5000 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl5150 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6000g2 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6000g2a (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6000g2b (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl6050 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl7260 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl7265 (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl7265d (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl8260c (TARGET_x86||TARGET_x86_64):iwlwifi-firmware-iwl8265 \
|
||||
(TARGET_x86||TARGET_x86_64):kmod-e1000 (TARGET_x86||TARGET_x86_64):kmod-e1000e (TARGET_x86||TARGET_x86_64):kmod-igb (TARGET_x86||TARGET_x86_64):kmod-ne2k-pci (TARGET_x86||TARGET_x86_64):kmod-r8169 (TARGET_x86||TARGET_x86_64):kmod-8139too (TARGET_x86||TARGET_x86_64):kmod-bnx2 \
|
||||
TARGET_mvebu:kmod-mwlwifi TARGET_mvebu:mwlwifi-firmware-88w8864 TARGET_mvebu:mwlwifi-firmware-88w8897 TARGET_mvebu:mwlwifi-firmware-88w8964 TARGET_mvebu:mwlwifi-firmware-88w8997 \
|
||||
|
|
|
@ -15,7 +15,7 @@ PKG_SOURCE_PROTO:=git
|
|||
#PKG_SOURCE_URL:=https://github.com/shadowsocks/v2ray-plugin.git
|
||||
PKG_SOURCE_URL:=https://github.com/teddysun/v2ray-plugin.git
|
||||
#PKG_SOURCE_VERSION:=63a74bef9e9f639bc199255db9d452d96f01d11a
|
||||
PKG_SOURCE_VERSION:=5cafcf9a0ae316cb268120eb1994adf5255eb7f0
|
||||
PKG_SOURCE_VERSION:=87488f188689234956407631e728faae143f3e65
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
|
|
@ -1,309 +1,111 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2019 Xingwang Liao
|
||||
# Copyright (C) 2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# Copyright (C) 2021-2022 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=v2ray-core
|
||||
PKG_VERSION:=4.45.2
|
||||
PKG_VERSION:=5.4.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE:=v$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/v2fly/v2ray-core/archive/refs/tags/
|
||||
PKG_HASH:=7a126bac7df32f627f34331778cb39ac99db18d7edcd45628db06e123fa0694b
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=e208bca255c4689a30104e965039d73fa138a7a6e902f820cff94b5b772b042b
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Yannick Chabanois <ycarus@zugaina.org>
|
||||
|
||||
PKG_CONFIG_DEPENDS := \
|
||||
CONFIG_V2RAY_JSON_V2CTL \
|
||||
CONFIG_V2RAY_JSON_INTERNAL \
|
||||
CONFIG_V2RAY_JSON_NONE \
|
||||
CONFIG_V2RAY_EXCLUDE_V2CTL \
|
||||
CONFIG_V2RAY_EXCLUDE_ASSETS \
|
||||
CONFIG_V2RAY_COMPRESS_UPX \
|
||||
CONFIG_V2RAY_DISABLE_NONE \
|
||||
CONFIG_V2RAY_DISABLE_CUSTOM \
|
||||
CONFIG_V2RAY_DISABLE_DNS \
|
||||
CONFIG_V2RAY_DISABLE_LOG \
|
||||
CONFIG_V2RAY_DISABLE_POLICY \
|
||||
CONFIG_V2RAY_DISABLE_REVERSE \
|
||||
CONFIG_V2RAY_DISABLE_ROUTING \
|
||||
CONFIG_V2RAY_DISABLE_STATISTICS \
|
||||
CONFIG_V2RAY_DISABLE_BLACKHOLE_PROTO \
|
||||
CONFIG_V2RAY_DISABLE_DNS_PROXY \
|
||||
CONFIG_V2RAY_DISABLE_DOKODEMO_PROTO \
|
||||
CONFIG_V2RAY_DISABLE_FREEDOM_PROTO \
|
||||
CONFIG_V2RAY_DISABLE_MTPROTO_PROXY \
|
||||
CONFIG_V2RAY_DISABLE_HTTP_PROTO \
|
||||
CONFIG_V2RAY_DISABLE_SHADOWSOCKS_PROTO \
|
||||
CONFIG_V2RAY_DISABLE_SOCKS_PROTO \
|
||||
CONFIG_V2RAY_DISABLE_VMESS_PROTO \
|
||||
CONFIG_V2RAY_DISABLE_TCP_TRANS \
|
||||
CONFIG_V2RAY_DISABLE_MKCP_TRANS \
|
||||
CONFIG_V2RAY_DISABLE_WEBSOCKET_TRANS \
|
||||
CONFIG_V2RAY_DISABLE_HTTP2_TRANS \
|
||||
CONFIG_V2RAY_DISABLE_DOMAIN_SOCKET_TRANS \
|
||||
CONFIG_V2RAY_DISABLE_QUIC_TRANS
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/v2fly/v2ray-core/v4
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
GO_PKG:=github.com/v2fly/v2ray-core/v5
|
||||
GO_PKG_BUILD_PKG:=$(GO_PKG)/main
|
||||
GO_PKG_LDFLAGS_X:= \
|
||||
$(GO_PKG).build=OpenWrt \
|
||||
$(GO_PKG).version=$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
#include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
include $(TOPDIR)/feeds/openmptcprouter/golang/golang-package.mk
|
||||
|
||||
define Package/v2ray-core
|
||||
TITLE:=A platform for building proxies
|
||||
URL:=https://www.v2fly.org
|
||||
define Package/v2ray/template
|
||||
TITLE:=A platform for building proxies to bypass network restrictions
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Project V
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +protobuf
|
||||
URL:=https://www.v2fly.org
|
||||
endef
|
||||
|
||||
define Package/v2ray-core/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
define Package/v2ray-core
|
||||
$(call Package/v2ray/template)
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
|
||||
endef
|
||||
|
||||
define Package/v2ray-example
|
||||
$(call Package/v2ray/template)
|
||||
TITLE+= (example configs)
|
||||
DEPENDS:=v2ray-core
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/v2ray-extra
|
||||
$(call Package/v2ray/template)
|
||||
TITLE+= (extra resources)
|
||||
DEPENDS:=v2ray-core
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/v2ray/description
|
||||
Project V is a set of network tools that help you to build your own computer network.
|
||||
It secures your network connections and thus protects your privacy.
|
||||
endef
|
||||
|
||||
define Package/v2ray-core/description
|
||||
Project V is a set of network tools that help you to build your own computer network.
|
||||
It secures your network connections and thus protects your privacy.
|
||||
|
||||
This package contains v2ray, v2ctl and v2ray-assets.
|
||||
$(call Package/v2ray/description)
|
||||
endef
|
||||
|
||||
V2RAY_SED_ARGS:=
|
||||
define Package/v2ray-example/description
|
||||
$(call Package/v2ray/description)
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_JSON_INTERNAL),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/main\/json"/\/\/ &/; \
|
||||
/\/\/ _ "github.com\/v2fly\/v2ray-core\/v4\/main\/jsonem"/s/\/\/ //;
|
||||
else ifeq ($(CONFIG_V2RAY_JSON_NONE),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/main\/json"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_CUSTOM),y)
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_DNS),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/app\/dns"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_LOG),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/app\/log"/\/\/ &/; \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/app\/log\/command"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_POLICY),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/app\/policy"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_REVERSE),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/app\/reverse"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_ROUTING),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/app\/router"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_STATISTICS),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/app\/stats"/\/\/ &/; \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/app\/stats\/command"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_BLACKHOLE_PROTO),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/proxy\/blackhole"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_DNS_PROXY),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/proxy\/dns"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_DOKODEMO_PROTO),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/proxy\/dokodemo"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_FREEDOM_PROTO),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/proxy\/freedom"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_MTPROTO_PROXY),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/proxy\/mtproto"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_HTTP_PROTO),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/proxy\/http"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_SHADOWSOCKS_PROTO),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/proxy\/shadowsocks"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_SOCKS_PROTO),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/proxy\/socks"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_VMESS_PROTO),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/proxy\/vmess\/inbound"/\/\/ &/; \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/proxy\/vmess\/outbound"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_TCP_TRANS),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/tcp"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_MKCP_TRANS),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/kcp"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_WEBSOCKET_TRANS),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/websocket"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_HTTP2_TRANS),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/http"/\/\/ &/; \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/headers\/http"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_DOMAIN_SOCKET_TRANS),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/domainsocket"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_QUIC_TRANS),y)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/quic"/\/\/ &/;
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_DISABLE_MKCP_TRANS)$(CONFIG_V2RAY_DISABLE_QUIC_TRANS),yy)
|
||||
V2RAY_SED_ARGS += \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/headers\/noop"/\/\/ &/; \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/headers\/srtp"/\/\/ &/; \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/headers\/tls"/\/\/ &/; \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/headers\/utp"/\/\/ &/; \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/headers\/wechat"/\/\/ &/; \
|
||||
s/_ "github.com\/v2fly\/v2ray-core\/v4\/transport\/internet\/headers\/wireguard"/\/\/ &/;
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
GEOIP_VER:=latest
|
||||
GEOIP_FILE:=geoip-$(GEOIP_VER).dat
|
||||
|
||||
define Download/geoip.dat
|
||||
URL:=https://github.com/v2ray/geoip/releases/$(GEOIP_VER)/download
|
||||
URL_FILE:=geoip.dat
|
||||
FILE:=$(GEOIP_FILE)
|
||||
HASH:=skip
|
||||
This includes example configuration files for v2ray-core.
|
||||
endef
|
||||
|
||||
GEOSITE_VER:=latest
|
||||
GEOSITE_FILE:=geosite-$(GEOSITE_VER).dat
|
||||
define Package/v2ray-extra/description
|
||||
$(call Package/v2ray/description)
|
||||
|
||||
define Download/geosite.dat
|
||||
URL:=https://github.com/v2ray/domain-list-community/releases/$(GEOSITE_VER)/download
|
||||
URL_FILE:=dlc.dat
|
||||
FILE:=$(GEOSITE_FILE)
|
||||
HASH:=skip
|
||||
This includes extra resources for v2ray-core.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(Build/Prepare/Default)
|
||||
|
||||
ifneq ($(CONFIG_V2RAY_EXCLUDE_ASSETS),y)
|
||||
# move file to make sure download new file every build
|
||||
mv -f $(DL_DIR)/$(GEOIP_FILE) $(PKG_BUILD_DIR)/release/config/geoip.dat
|
||||
mv -f $(DL_DIR)/$(GEOSITE_FILE) $(PKG_BUILD_DIR)/release/config/geosite.dat
|
||||
endif
|
||||
|
||||
( \
|
||||
sed -i \
|
||||
's/\(version[[:space:]]*=[[:space:]]*"\).*\("\)/\1$(PKG_VERSION)\2/; \
|
||||
s/\(build[[:space:]]*=[[:space:]]*"\).*\("\)/\1OpenWrt R$(PKG_RELEASE)\2/' \
|
||||
$(PKG_BUILD_DIR)/core.go ; \
|
||||
)
|
||||
ifneq ($(V2RAY_SED_ARGS),)
|
||||
( \
|
||||
sed -i \
|
||||
'$(V2RAY_SED_ARGS)' \
|
||||
$(PKG_BUILD_DIR)/main/distro/all/all.go ; \
|
||||
)
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(eval GO_PKG_BUILD_PKG:=$(GO_PKG)/main)
|
||||
$(call GoPackage/Build/Compile)
|
||||
mv -f $(GO_PKG_BUILD_BIN_DIR)/main $(GO_PKG_BUILD_BIN_DIR)/v2ray
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_COMPRESS_UPX),y)
|
||||
upx --ultra-brute $(GO_PKG_BUILD_BIN_DIR)/v2ray
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_V2RAY_EXCLUDE_V2CTL),y)
|
||||
$(eval GO_PKG_BUILD_PKG:=$(GO_PKG)/infra/control/main)
|
||||
$(call GoPackage/Build/Compile)
|
||||
mv -f $(GO_PKG_BUILD_BIN_DIR)/main $(GO_PKG_BUILD_BIN_DIR)/v2ctl
|
||||
|
||||
ifeq ($(CONFIG_V2RAY_COMPRESS_UPX),y)
|
||||
upx --ultra-brute $(GO_PKG_BUILD_BIN_DIR)/v2ctl
|
||||
endif
|
||||
endif
|
||||
define Package/v2ray-core/conffiles
|
||||
/etc/config/v2ray
|
||||
/etc/v2ray/
|
||||
endef
|
||||
|
||||
define Package/v2ray-core/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
$(INSTALL_DIR) $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/v2ray
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/etc/v2ray/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/config.json $(1)/etc/v2ray/
|
||||
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v2ray $(1)/usr/bin
|
||||
$(CP) ./files/* $(1)/
|
||||
|
||||
ifneq ($(CONFIG_V2RAY_EXCLUDE_V2CTL),y)
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v2ctl $(1)/usr/bin
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_V2RAY_EXCLUDE_ASSETS),y)
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/release/config/{geoip,geosite}.dat \
|
||||
$(1)/usr/bin
|
||||
endif
|
||||
# $(INSTALL_DIR) $(1)/etc/config/
|
||||
# $(INSTALL_CONF) $(CURDIR)/files/v2ray.conf $(1)/etc/config/v2ray
|
||||
# $(INSTALL_DIR) $(1)/etc/init.d/
|
||||
# $(INSTALL_BIN) $(CURDIR)/files/v2ray.init $(1)/etc/init.d/v2ray
|
||||
endef
|
||||
|
||||
ifneq ($(CONFIG_V2RAY_EXCLUDE_ASSETS),y)
|
||||
$(eval $(call Download,geoip.dat))
|
||||
$(eval $(call Download,geosite.dat))
|
||||
endif
|
||||
define Package/v2ray-example/install
|
||||
$(INSTALL_DIR) $(1)/etc/v2ray/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/vpoint_socks_vmess.json $(1)/etc/v2ray/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/vpoint_vmess_freedom.json $(1)/etc/v2ray/
|
||||
endef
|
||||
|
||||
define Package/v2ray-extra/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/v2ray/
|
||||
$(CP) $(PKG_BUILD_DIR)/release/extra/* $(1)/usr/share/v2ray/
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,v2ray-core))
|
||||
$(eval $(call BuildPackage,v2ray-core))
|
||||
$(eval $(call BuildPackage,v2ray-example))
|
||||
$(eval $(call BuildPackage,v2ray-extra))
|
||||
|
|
Loading…
Reference in a new issue