Created
January 18, 2018 16:36
-
-
Save drozdziak1/8deda6315f9ac5d341ef4822c3b0b35b to your computer and use it in GitHub Desktop.
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
# | |
# Copyright (C) 2017-2018 Justin Kilpatrick, Stanislaw Drozd, Openwrt.org | |
# | |
# This is free software, licensed under the GNU General Public License v2. | |
# See /LICENSE for more information. | |
# | |
include $(TOPDIR)/rules.mk | |
PKG_NAME:=althea-rust-binaries | |
PKG_VERSION:=0.1 | |
PKG_RELEASE:=0 | |
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz | |
PKG_SOURCE_PROTO:=git | |
#PKG_SOURCE_URL:=/home/drozdziak1/mesh-junk/althea_rs | |
PKG_SOURCE_VERSION:=println-not-found-fix | |
PKG_SOURCE_URL:=/home/drozdziak1/mesh-junk/althea_rs | |
#PKG_SOURCE_VERSION:=master | |
PKG_LICENSE:=Apache-2.0 | |
include $(INCLUDE_DIR)/package.mk | |
define Package/althea-rust-binaries | |
SECTION:=net | |
CATEGORY:=utils | |
SUBMENU:=Utilities | |
TITLE:=Althea Rust executables | |
URL:=https://github.com/althea-mesh/althea_rs | |
MAINTAINER:= Justin Kilpatrick <justin@altheamesh.com> | |
DEPENDS:=@IPV6 +libopenssl @OPENSSL_WITH_COMPRESSION | |
endef | |
define Package/althea-rust-binaries/description | |
Althea Rust executables | |
endef | |
ifeq ($(ARCH),arm) | |
RUST_TRIPLE:=arm-unknown-linux-musleabihf | |
else ifeq ($(ARCH),mips) | |
RUST_TRIPLE:=mips-unknown-linux-musl | |
else ifeq ($(ARCH),i386) | |
RUST_TRIPLE:=i686-unknown-linux-musl | |
CARGO_ENV_NAME:=CARGO_TARGET_I686_UNKNOWN_LINUX_MUSL_LINKER | |
endif | |
#ifeq ($(ARCH),arm) | |
#RUST_TRIPLE:=arm-unknown-linux-gnueabihf | |
#else ifeq ($(ARCH),mips) | |
#RUST_TRIPLE:=mips-unknown-linux-gnu | |
#else ifeq ($(ARCH),i386) | |
#RUST_TRIPLE:=i686-unknown-linux-gnu | |
#endif | |
RUST_BIN_FILENAMES:=guac-light-client rita | |
RUST_BIN_PATHS:=$(foreach filename, $(RUST_BIN_FILENAMES), $(PKG_BUILD_DIR)/target/$(RUST_TRIPLE)/release/$(filename)) | |
#$(CARGO_ENV_NAME)=$(TARGET_CC) \ | |
#TARGET="$(RUST_TRIPLE)" \ | |
#CC="$(TARGET_CC)" \ | |
#CFLAGS="$(TARGET_CFLAGS)" \ | |
#TARGET_CFLAGS="$(TARGET_CFLAGS)" \ | |
#CXX="$(TARGET_CXX)" \ | |
#CXXFLAGS="$(TARGET_CXXFLAGS)" \ | |
#TARGET_CXXFLAGS="$(TARGET_CXXFLAGS)" \ | |
#CPPFLAGS="$(TARGET_CPPFLAGS)" \ | |
#TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \ | |
#LDFLAGS="$(TARGET_LDFLAGS)" \ | |
#TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \ | |
#OPENSSL_DIR="$(STAGING_DIR)/usr" | |
define Build/Compile | |
#echo Your variable is $(CARGO_ENV_NAME) | |
#exit 1 | |
(\ | |
cd $(PKG_BUILD_DIR) && \ | |
\ | |
\ | |
cargo build --verbose --all --release --target $(RUST_TRIPLE) \ | |
) | |
$(STRIP) $(RUST_BIN_PATHS) | |
endef | |
define Package/althea-rust-binaries/install | |
$(INSTALL_DIR) $(1)/usr/sbin | |
$(INSTALL_BIN) $(RUST_BIN_PATHS) $(1)/usr/sbin/ | |
endef | |
$(eval $(call BuildPackage,althea-rust-binaries)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment