change ports dir relative to srcdir
This commit is contained in:
@@ -12,6 +12,7 @@ override MOUSE_ARCH := $(MOUSE_ARCH_RESOLVED)
|
||||
|
||||
MOUSE_BUILD_DIR ?= $(CURDIR)/build/$(MOUSE_ARCH)
|
||||
MOUSE_SOURCE_DIR ?= $(CURDIR)/build/sources
|
||||
MOUSE_PORTS_DIR ?= $(CURDIR)/../ports
|
||||
MOUSE_BUILDER_CPUS ?= 8
|
||||
MOUSE_BUILDER_MEMORY ?= 8G
|
||||
MOUSE_BUILD_JOBS ?= 8
|
||||
@@ -23,6 +24,7 @@ BUILD_ENV = \
|
||||
MOUSE_ARCH="$(MOUSE_ARCH)" \
|
||||
MOUSE_BUILD_DIR="$(MOUSE_BUILD_DIR)" \
|
||||
MOUSE_SOURCE_DIR="$(MOUSE_SOURCE_DIR)" \
|
||||
MOUSE_PORTS_DIR="$(MOUSE_PORTS_DIR)" \
|
||||
MOUSE_BUILDER_PLATFORM="$(MOUSE_BUILDER_PLATFORM)" \
|
||||
MOUSE_BUILDER_CPUS="$(MOUSE_BUILDER_CPUS)" \
|
||||
MOUSE_BUILDER_MEMORY="$(MOUSE_BUILDER_MEMORY)" \
|
||||
|
||||
@@ -6,6 +6,7 @@ repo_dir=$(dirname "$script_dir")
|
||||
. "$script_dir/mouse-arch.sh"
|
||||
output_dir=${MOUSE_BUILD_DIR:-"$repo_dir/build/$MOUSE_ARCH"}
|
||||
source_dir=${MOUSE_SOURCE_DIR:-"$repo_dir/build/sources"}
|
||||
ports_dir=${MOUSE_PORTS_DIR:-"$repo_dir/../ports"}
|
||||
test_fixtures=${MOUSE_INCLUDE_TEST_FIXTURES:-0}
|
||||
builder_cpus=${MOUSE_BUILDER_CPUS:-8}
|
||||
builder_memory=${MOUSE_BUILDER_MEMORY:-8G}
|
||||
@@ -50,6 +51,8 @@ esac
|
||||
require_positive "$builder_cpus" MOUSE_BUILDER_CPUS
|
||||
require_positive "$build_jobs" MOUSE_BUILD_JOBS
|
||||
[ -n "$builder_memory" ] || die "MOUSE_BUILDER_MEMORY must not be empty"
|
||||
[ -f "$ports_dir/ports/Mk/mouse.port.mk" ] || die "missing ports tree: $ports_dir"
|
||||
ports_dir=$(CDPATH= cd -- "$ports_dir" && pwd)
|
||||
|
||||
if [ -n "${MOUSE_BUILDER_PLATFORM:-}" ]; then
|
||||
builder_platform=$MOUSE_BUILDER_PLATFORM
|
||||
@@ -116,24 +119,30 @@ cleanup() {
|
||||
}
|
||||
trap cleanup EXIT HUP INT TERM
|
||||
|
||||
mkdir -p "$build_context/mouse-src" "$build_context/mouse-ports"
|
||||
(
|
||||
cd "$repo_dir/.."
|
||||
cd "$repo_dir"
|
||||
tar -cf - \
|
||||
--exclude='mouse-src/.git/*' \
|
||||
--exclude='mouse-src/build/*' \
|
||||
--exclude='mouse-src/Containerfile' \
|
||||
--exclude='mouse-src/.containerignore' \
|
||||
--exclude='mouse-src/scripts/build-in-container.sh' \
|
||||
--exclude='mouse-src/base/cheesed/target/*' \
|
||||
--exclude='mouse-ports/.git/*' \
|
||||
mouse-src mouse-ports
|
||||
) | tar -xf - -C "$build_context"
|
||||
--exclude='./.git/*' \
|
||||
--exclude='./build/*' \
|
||||
--exclude='./Containerfile' \
|
||||
--exclude='./.containerignore' \
|
||||
--exclude='./scripts/build-in-container.sh' \
|
||||
--exclude='./base/cheesed/target/*' \
|
||||
.
|
||||
) | tar -xf - -C "$build_context/mouse-src"
|
||||
(
|
||||
cd "$ports_dir"
|
||||
tar -cf - \
|
||||
--exclude='./.git/*' \
|
||||
.
|
||||
) | tar -xf - -C "$build_context/mouse-ports"
|
||||
|
||||
cp "$repo_dir/Containerfile" "$build_context/Dockerfile"
|
||||
cp "$repo_dir/.containerignore" "$build_context/.dockerignore"
|
||||
|
||||
ports_revision=$(git -C "$repo_dir/../mouse-ports" rev-parse --short=12 HEAD)
|
||||
if [ -n "$(git -C "$repo_dir/../mouse-ports" status --porcelain)" ]; then
|
||||
ports_revision=$(git -C "$ports_dir" rev-parse --short=12 HEAD)
|
||||
if [ -n "$(git -C "$ports_dir" status --porcelain)" ]; then
|
||||
ports_revision=$ports_revision-dirty
|
||||
fi
|
||||
printf '%s\n' "$ports_revision" >"$build_context/mouse-ports-revision"
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
ports_dir=${MOUSE_PORTS_DIR:-/usr/local/src/mouse-ports}
|
||||
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
repo_dir=$(dirname "$script_dir")
|
||||
if [ -n "${MOUSE_PORTS_DIR:-}" ]; then
|
||||
ports_dir=$MOUSE_PORTS_DIR
|
||||
elif [ -f "$repo_dir/../ports/ports/Mk/mouse.port.mk" ]; then
|
||||
ports_dir=$repo_dir/../ports
|
||||
else
|
||||
ports_dir=/usr/local/src/mouse-ports
|
||||
fi
|
||||
seed=${MOUSE_PORTS_SEED:-/opt/mouse-ports-seed}
|
||||
distdir=${MOUSE_PORTS_DISTDIR:-/var/cache/mouse/ports/distfiles}
|
||||
workbase=${MOUSE_PORTS_WORKDIR:-/var/tmp/mouse-ports}
|
||||
|
||||
Reference in New Issue
Block a user