forked from kenzok8/small-package
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
228974e
commit 63d3397
Showing
3 changed files
with
30 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
# Copyright (C) 2021 xiaorouji | ||
# | ||
# This is free software, licensed under the GNU General Public License v3. | ||
# SPDX-License-Identifier: GPL-3.0-only | ||
# | ||
# Copyright (C) 2021 ImmortalWrt.org | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=hysteria | ||
PKG_VERSION:=0.9.1 | ||
PKG_VERSION:=0.9.2 | ||
PKG_RELEASE:=$(AUTORELEASE) | ||
|
||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz | ||
PKG_SOURCE_URL:=https://codeload.github.com/HyNetwork/hysteria/tar.gz/v$(PKG_VERSION)? | ||
PKG_HASH:=skip | ||
|
||
PKG_LICENSE:=MIT | ||
PKG_LICENSE_FILE:=LICENSE | ||
PKG_MAINTAINER:=Tianling Shen <[email protected]> | ||
|
||
PKG_CONFIG_DEPENDS:= \ | ||
CONFIG_HYSTERIA_COMPRESS_GOPROXY \ | ||
CONFIG_HYSTERIA_COMPRESS_UPX | ||
|
@@ -22,44 +25,42 @@ PKG_BUILD_PARALLEL:=1 | |
PKG_USE_MIPS16:=0 | ||
|
||
GO_PKG:=github.com/tobyxdd/hysteria | ||
GO_PKG_BUILD_PKG:=$(GO_PKG)/cmd | ||
GO_PKG_BUILD_PKG:=github.com/tobyxdd/hysteria/cmd | ||
GO_PKG_LDFLAGS:=-s -w | ||
GO_PKG_LDFLAGS_X:= \ | ||
main.appVersion=$(PKG_VERSION) | ||
GO_PKG_LDFLAGS_X:=main.appVersion=$(PKG_VERSION) | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk | ||
|
||
define Package/$(PKG_NAME) | ||
SECTION:=net | ||
CATEGORY:=Network | ||
SUBMENU:=Web Servers/Proxies | ||
DEPENDS:=$$(GO_ARCH_DEPENDS) | ||
TITLE:=Hysteria is a feature-packed network utility optimized for networks of poor quality (e.g. satellite connections, congested public Wi-Fi, connecting from China to servers abroad) | ||
URL:=https://github.com/HyNetwork/hysteria | ||
define Package/hysteria | ||
SECTION:=net | ||
CATEGORY:=Network | ||
TITLE:=A feature-packed network utility optimized for networks of poor quality | ||
URL:=https://github.com/tobyxdd/hysteria | ||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle | ||
endef | ||
|
||
define Package/$(PKG_NAME)/config | ||
|
||
menu "Configuration" | ||
depends on PACKAGE_$(PKG_NAME) | ||
define Package/hysteria/description | ||
Hysteria is a feature-packed network utility optimized for networks | ||
of poor quality (e.g. satellite connections, congested public Wi-Fi, | ||
connecting from China to servers abroad) powered by a custom version | ||
of QUIC protocol. | ||
endef | ||
|
||
define Package/hysteria/config | ||
config HYSTERIA_COMPRESS_GOPROXY | ||
bool "Compiling with GOPROXY proxy" | ||
default n | ||
|
||
config HYSTERIA_COMPRESS_UPX | ||
bool "Compress executable files with UPX" | ||
depends on !mips64 | ||
default y | ||
|
||
endmenu | ||
|
||
default y | ||
endef | ||
|
||
ifeq ($(CONFIG_HYSTERIA_COMPRESS_GOPROXY),y) | ||
export GO111MODULE=on | ||
export GOPROXY=https://goproxy.io | ||
export GO111MODULE=on | ||
export GOPROXY=https://goproxy.baidu.com | ||
endif | ||
|
||
define Build/Compile | ||
|
@@ -69,11 +70,11 @@ ifeq ($(CONFIG_HYSTERIA_COMPRESS_UPX),y) | |
endif | ||
endef | ||
|
||
define Package/$(PKG_NAME)/install | ||
define Package/hysteria/install | ||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) | ||
$(INSTALL_DIR) $(1)/usr/bin/ | ||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cmd $(1)/usr/bin/hysteria | ||
endef | ||
|
||
$(eval $(call GoBinPackage,$(PKG_NAME))) | ||
$(eval $(call BuildPackage,$(PKG_NAME))) | ||
$(eval $(call GoBinPackage,hysteria)) | ||
$(eval $(call BuildPackage,hysteria)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters