2019-10-03 08:31:46 +08:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# ripgrep
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2021-08-15 03:51:43 +08:00
|
|
|
RIPGREP_VERSION = 13.0.0
|
2019-10-03 08:31:46 +08:00
|
|
|
RIPGREP_SITE = $(call github,burntsushi,ripgrep,$(RIPGREP_VERSION))
|
|
|
|
RIPGREP_LICENSE = MIT
|
|
|
|
RIPGREP_LICENSE_FILES = LICENSE-MIT
|
2021-07-19 06:07:00 +08:00
|
|
|
RIPGREP_CPE_ID_VENDOR = ripgrep_project
|
2019-10-03 08:31:46 +08:00
|
|
|
|
2020-02-08 02:08:25 +08:00
|
|
|
RIPGREP_DEPENDENCIES = host-rustc
|
2021-08-02 06:59:28 +08:00
|
|
|
RIPGREP_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo \
|
|
|
|
__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" \
|
|
|
|
CARGO_TARGET_APPLIES_TO_HOST="false"
|
2019-10-03 08:31:46 +08:00
|
|
|
|
2020-08-27 08:44:24 +08:00
|
|
|
RIPGREP_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(RIPGREP_CARGO_BIN_SUBDIR)
|
2019-10-03 08:31:46 +08:00
|
|
|
|
|
|
|
RIPGREP_CARGO_OPTS = \
|
2021-08-02 06:59:28 +08:00
|
|
|
-Z target-applies-to-host \
|
2019-10-03 08:31:46 +08:00
|
|
|
--target=$(RUSTC_TARGET_NAME) \
|
|
|
|
--manifest-path=$(@D)/Cargo.toml
|
|
|
|
|
2021-06-01 22:34:15 +08:00
|
|
|
ifeq ($(BR2_ENABLE_RUNTIME_DEBUG),y)
|
2020-08-27 08:44:24 +08:00
|
|
|
RIPGREP_CARGO_BIN_SUBDIR = debug
|
|
|
|
else
|
|
|
|
RIPGREP_CARGO_OPTS += --release
|
|
|
|
RIPGREP_CARGO_BIN_SUBDIR = release
|
|
|
|
endif
|
|
|
|
|
2019-10-03 08:31:46 +08:00
|
|
|
define RIPGREP_BUILD_CMDS
|
|
|
|
$(TARGET_MAKE_ENV) $(RIPGREP_CARGO_ENV) \
|
|
|
|
cargo build $(RIPGREP_CARGO_OPTS)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define RIPGREP_INSTALL_TARGET_CMDS
|
|
|
|
$(INSTALL) -D -m 0755 $(@D)/$(RIPGREP_BIN_DIR)/rg \
|
|
|
|
$(TARGET_DIR)/usr/bin/rg
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|