diff --git a/README.md b/README.md index 7d2b4f2..12c618a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Use environment variables to select the container engine or override image names CONTAINER_ENGINE=podman IMAGE_NAME=my-build-env ./rocky9/build.sh ``` -The Debian 13 and Rocky Linux 9 images install every library under `/usr/local` by default. Set `PREFIX` to install them elsewhere; the build environment variables (`PATH`, `PKG_CONFIG_PATH`, `CMAKE_PREFIX_PATH`, `CMAKE_INSTALL_PREFIX`, and so on) follow it. Rust is a build tool rather than a library, so it always lives under `/usr/local` and is not affected by `PREFIX`. The Alpine image does not support `PREFIX`. +The Debian 13 and Rocky Linux 9 images install every library under `/opt/local` by default. Set `PREFIX` to install them elsewhere; the build environment variables (`PATH`, `PKG_CONFIG_PATH`, `CMAKE_PREFIX_PATH`, `CMAKE_INSTALL_PREFIX`, and so on) follow it. Rust is a build tool rather than a library, so it always lives under `/usr/local` and is not affected by `PREFIX`. The Alpine image does not support `PREFIX`. ```sh PREFIX=/opt/stack ./debian13/build.sh diff --git a/debian13/Dockerfile b/debian13/Dockerfile index 171cbc2..6a832e5 100644 --- a/debian13/Dockerfile +++ b/debian13/Dockerfile @@ -23,11 +23,11 @@ RUN sed -i 's|deb.debian.org|mirrors.ustc.edu.cn|g' /etc/apt/sources.list.d/debi # Install prefix of every dependency, and the Debian multiarch directory name (`gcc -dumpmachine`) # its libraries are installed under; build.sh derives the latter from `uname -m`. -ARG PREFIX=/usr/local +ARG PREFIX=/opt/local ARG MULTIARCH=x86_64-linux-gnu # Make the compiler, CMake, pkg-config and the shell find earlier dependencies under a prefix other -# than the default /usr/local. CMake (>= 3.29) takes its default install prefix from the environment. +# than the default /opt/local. CMake (>= 3.29) takes its default install prefix from the environment. ENV PATH=${PREFIX}/bin:${PATH} \ C_INCLUDE_PATH=${PREFIX}/include \ CPLUS_INCLUDE_PATH=${PREFIX}/include \ diff --git a/debian13/build.sh b/debian13/build.sh index b1cfe23..d9c50bf 100755 --- a/debian13/build.sh +++ b/debian13/build.sh @@ -3,7 +3,7 @@ set -eu IMAGE_NAME="${IMAGE_NAME:-debian13-source-stack}" -PREFIX="${PREFIX:-/usr/local}" +PREFIX="${PREFIX:-/opt/local}" SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) SOURCES_DIR="${SOURCES_DIR:-$SCRIPT_DIR/../sources}" FETCH_SCRIPT="$SCRIPT_DIR/../fetch-sources.sh" diff --git a/rocky9/Dockerfile b/rocky9/Dockerfile index ff35ab6..02fe9c2 100644 --- a/rocky9/Dockerfile +++ b/rocky9/Dockerfile @@ -38,10 +38,10 @@ RUN dnf install --assumeyes --enablerepo=crb \ RUN git config --global url."https://wangguofang.net/github.com/".insteadOf "https://github.com/" # Install prefix of every dependency. Libraries are installed under ${PREFIX}/lib64. -ARG PREFIX=/usr/local +ARG PREFIX=/opt/local # Make the compiler, CMake, pkg-config and the shell find earlier dependencies under a prefix other -# than the default /usr/local. CMake (>= 3.29) takes its default install prefix from the environment. +# than the default /opt/local. CMake (>= 3.29) takes its default install prefix from the environment. ENV PATH=${PREFIX}/bin:${PATH} \ C_INCLUDE_PATH=${PREFIX}/include \ CPLUS_INCLUDE_PATH=${PREFIX}/include \ diff --git a/rocky9/build.sh b/rocky9/build.sh index 4e707f8..33f47f0 100755 --- a/rocky9/build.sh +++ b/rocky9/build.sh @@ -3,7 +3,7 @@ set -eu IMAGE_NAME="${IMAGE_NAME:-rocky9-source-stack}" -PREFIX="${PREFIX:-/usr/local}" +PREFIX="${PREFIX:-/opt/local}" SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) SOURCES_DIR="${SOURCES_DIR:-$SCRIPT_DIR/../sources}" FETCH_SCRIPT="$SCRIPT_DIR/../fetch-sources.sh"