<commit_before>################################################################################
#
# skiff-core-gentoo
#
################################################################################

SKIFF_CORE_GENTOO_DEPENDENCIES = skiff-core skiff-core-defconfig

# Select the distro based on the architecture.

# amd64 (default)
SKIFF_CORE_GENTOO_COREENV_ARCH = amd64

# arm
ifeq ($(BR2_arm),y)
SKIFF_CORE_GENTOO_COREENV_ARCH = arm

# armv6 (default)
SKIFF_CORE_GENTOO_COREENV_MICROARCH = armv6j
SKIFF_CORE_GENTOO_COREENV_SUFFIX = _hardfp

# armv5
ifeq ($(BR2_ARM_CPU_ARMV5),y)
SKIFF_CORE_GENTOO_COREENV_MICROARCH = armv5tel
SKIFF_CORE_GENTOO_COREENV_SUFFIX = none
endif

# armv7a (default)
ifeq ($(BR2_ARM_CPU_ARMV7A),y)
SKIFF_CORE_GENTOO_COREENV_MICROARCH = armv7a
SKIFF_CORE_GENTOO_COREENV_SUFFIX = _hardfp
endif

endif

# aarch64 / arm64
ifeq ($(BR2_aarch64),y)
SKIFF_CORE_GENTOO_COREENV_ARCH = arm64
SKIFF_CORE_GENTOO_COREENV_MICROARCH = arm64
endif

SKIFF_CORE_GENTOO_COREENV_DIST = \
	http://distfiles.gentoo.org/releases/$(SKIFF_CORE_GENTOO_COREENV_ARCH)/autobuilds

# default microarch to equal arch
ifeq ($(SKIFF_CORE_GENTOO_COREENV_MICROARCH),)
SKIFF_CORE_GENTOO_COREENV_MICROARCH = $(SKIFF_CORE_GENTOO_COREENV_ARCH)
endif

# configure the CFLAGS in Gentoo according to the Skiff CFLAGS
SKIFF_CORE_GENTOO_CFLAGS = $(TARGET_CFLAGS)

define SKIFF_CORE_GENTOO_INSTALL_COREENV
	mkdir -p $(TARGET_DIR)/opt/skiff/coreenv/skiff-core-gentoo
	cd $(TARGET_DIR)/opt/skiff/coreenv/skiff-core-gentoo ; \
		cp -r $(SKIFF_CORE_GENTOO_PKGDIR)/coreenv/* ./ ;\
		$(INSTALL) -m 0644 $(SKIFF_CORE_GENTOO_PKGDIR)/coreenv-defconfig.yaml \
			../defconfig.yaml ; \
		$(SED) "/COMMON_FLAGS=/c\COMMON_FLAGS=\"$(SKIFF_CORE_GENTOO_CFLAGS)\"" \
			make.conf; \
		bash ./mkoverride.sh ARCH $(SKIFF_CORE_GENTOO_COREENV_ARCH); \
		bash ./mkoverride.sh MICROARCH $(SKIFF_CORE_GENTOO_COREENV_MICROARCH); \
		bash ./mkoverride.sh SUFFIX $(SKIFF_CORE_GENTOO_COREENV_SUFFIX); \
		bash ./mkoverride.sh DIST "$(SKIFF_CORE_GENTOO_COREENV_DIST)"; \
		touch ../.overridden
endef

SKIFF_CORE_GENTOO_POST_INSTALL_TARGET_HOOKS += SKIFF_CORE_GENTOO_INSTALL_COREENV

$(eval $(generic-package))<commit_msg>core/gentoo: inherit target optimization flags if set<commit_after>################################################################################
#
# skiff-core-gentoo
#
################################################################################

SKIFF_CORE_GENTOO_DEPENDENCIES = skiff-core skiff-core-defconfig

# Select the distro based on the architecture.

# amd64 (default)
SKIFF_CORE_GENTOO_COREENV_ARCH = amd64

# arm
ifeq ($(BR2_arm),y)
SKIFF_CORE_GENTOO_COREENV_ARCH = arm

# armv6 (default)
SKIFF_CORE_GENTOO_COREENV_MICROARCH = armv6j
SKIFF_CORE_GENTOO_COREENV_SUFFIX = _hardfp

# armv5
ifeq ($(BR2_ARM_CPU_ARMV5),y)
SKIFF_CORE_GENTOO_COREENV_MICROARCH = armv5tel
SKIFF_CORE_GENTOO_COREENV_SUFFIX = none
endif

# armv7a (default)
ifeq ($(BR2_ARM_CPU_ARMV7A),y)
SKIFF_CORE_GENTOO_COREENV_MICROARCH = armv7a
SKIFF_CORE_GENTOO_COREENV_SUFFIX = _hardfp
endif

endif

# aarch64 / arm64
ifeq ($(BR2_aarch64),y)
SKIFF_CORE_GENTOO_COREENV_ARCH = arm64
SKIFF_CORE_GENTOO_COREENV_MICROARCH = arm64
endif

SKIFF_CORE_GENTOO_COREENV_DIST = \
	http://distfiles.gentoo.org/releases/$(SKIFF_CORE_GENTOO_COREENV_ARCH)/autobuilds

# default microarch to equal arch
ifeq ($(SKIFF_CORE_GENTOO_COREENV_MICROARCH),)
SKIFF_CORE_GENTOO_COREENV_MICROARCH = $(SKIFF_CORE_GENTOO_COREENV_ARCH)
endif

# configure the CFLAGS in Gentoo according to the Skiff CFLAGS
# ... but only if there is some reason to (target optimization flags set)
ifneq ($(BR2_TARGET_OPTIMIZATION),)
SKIFF_CORE_GENTOO_CFLAGS = -O2 -fomit-frame-pointer -pipe
SKIFF_CORE_GENTOO_CFLAGS += $(call qstrip,$(BR2_TARGET_OPTIMIZATION))
endif

define SKIFF_CORE_GENTOO_INSTALL_COREENV
	mkdir -p $(TARGET_DIR)/opt/skiff/coreenv/skiff-core-gentoo
	cd $(TARGET_DIR)/opt/skiff/coreenv/skiff-core-gentoo ; \
		cp -r $(SKIFF_CORE_GENTOO_PKGDIR)/coreenv/* ./ ;\
		$(INSTALL) -m 0644 $(SKIFF_CORE_GENTOO_PKGDIR)/coreenv-defconfig.yaml \
			../defconfig.yaml ; \
    if [ -n "$(SKIFF_CORE_GENTOO_CFLAGS)" ]; then \
		  $(SED) "/COMMON_FLAGS=/c\COMMON_FLAGS=\"$(SKIFF_CORE_GENTOO_CFLAGS)\"" \
			  make.conf; \
		fi; \
		bash ./mkoverride.sh ARCH $(SKIFF_CORE_GENTOO_COREENV_ARCH); \
		bash ./mkoverride.sh MICROARCH $(SKIFF_CORE_GENTOO_COREENV_MICROARCH); \
		bash ./mkoverride.sh SUFFIX $(SKIFF_CORE_GENTOO_COREENV_SUFFIX); \
		bash ./mkoverride.sh DIST "$(SKIFF_CORE_GENTOO_COREENV_DIST)"; \
		touch ../.overridden
endef

SKIFF_CORE_GENTOO_POST_INSTALL_TARGET_HOOKS += SKIFF_CORE_GENTOO_INSTALL_COREENV

$(eval $(generic-package))
{'fraction_non_alphanumeric': 0.16566394499355394, 'fraction_numerical': 0.013536742587021916, 'mean_word_length': 6.618657937806874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7663476', 'n_tokens_mistral': 2003, 'n_tokens_neox': 1826, 'n_words': 268}