summaryrefslogtreecommitdiffstats
path: root/core/modules/nvidia-libs@/module.build
blob: 30e7cfea5387a7ff285674b22010318f0dd4a277 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

pre_exec() {
	[ -z "$TARGET_VERSION" ] && perror "Not run from an @ target"
	local SRC SZ
	SRC="${ROOT_DIR}/tmp/work/nvidia-common/build/$TARGET_VERSION"
	[ -d "$SRC" ] || perror "nvidia-common did not build $TARGET_VERSION"
	SZ=$( du -sk "$SRC" | awk '{print $1}' )
	(( SZ < 200000 )) && perror "nvidia-common for $TARGET_VERSION is less than 200MB, fishy"
	# XXX Now we override the MODULE_BUILD_DIR, where mltk will then grab alle the required files from
	MODULE_BUILD_DIR="$SRC"
}

post_copy() {
	# generate addon-required for this version
	sed "s/%TARGET_VERSION%/$TARGET_VERSION/g" \
		< "${MODULE_DIR}/templates/addon-required.template" \
		> "${TARGET_BUILD_DIR}/addon-required" \
		|| perror "Could not copy addon-required template to target"
	chmod +x "${TARGET_BUILD_DIR}/addon-required"
}