Skip to content

Commit 9ac578d

Browse files
committed
Use arch-specified pkgroot
1 parent ef709a1 commit 9ac578d

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

bin/spc-alpine-docker

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,13 @@ COPY ./composer.* /app/
123123
ADD ./bin /app/bin
124124
RUN composer install --no-dev
125125
ADD ./config /app/config
126-
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc doctor --auto-fix
127-
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc install-pkg upx
126+
RUN bin/spc doctor --auto-fix
127+
RUN bin/spc install-pkg upx
128+
129+
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
130+
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
131+
RUN chmod +x /bin/docker-entrypoint.sh
132+
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
128133
EOF
129134
fi
130135

bin/spc-gnu-docker

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ ENV SPC_LIBC=glibc
112112
ENV PATH="/app/bin:/cmake/bin:/opt/rh/devtoolset-10/root/usr/bin:\$PATH"
113113
114114
ADD ./config /app/config
115-
RUN CC=gcc PKG_ROOT_PATH=/app/pkgroot-private bin/spc doctor --auto-fix --debug
116-
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc install-pkg upx
115+
RUN CC=gcc bin/spc doctor --auto-fix --debug
116+
RUN bin/spc install-pkg upx
117117
RUN if [ -f /app/buildroot/bin/re2c ]; then \
118118
cp /app/buildroot/bin/re2c /usr/local/bin/re2c ;\
119119
fi
@@ -133,6 +133,11 @@ RUN curl -o automake.tgz -fsSL https://ftp.gnu.org/gnu/automake/automake-1.17.ta
133133
make && \
134134
make install && \
135135
ln -sf /usr/local/bin/automake /usr/bin/automake
136+
137+
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
138+
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
139+
RUN chmod +x /bin/docker-entrypoint.sh
140+
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
136141
EOF
137142
fi
138143

src/globals/internal-env.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
// output path for shared extensions
2323
define('BUILD_MODULES_PATH', FileSystem::convertPath(is_string($a = getenv('BUILD_MODULES_PATH')) ? $a : (BUILD_ROOT_PATH . '/modules')));
2424

25-
define('PKG_ROOT_PATH', FileSystem::convertPath(is_string($a = getenv('PKG_ROOT_PATH')) ? $a : (WORKING_DIR . '/pkgroot')));
25+
// pkg arch name
26+
$_pkg_arch_name = arch2gnu(php_uname('m')) . '-' . strtolower(PHP_OS_FAMILY);
27+
define('PKG_ROOT_PATH', FileSystem::convertPath(is_string($a = getenv('PKG_ROOT_PATH')) ? $a : (WORKING_DIR . "/pkgroot/{$_pkg_arch_name}")));
28+
2629
define('SOURCE_PATH', FileSystem::convertPath(is_string($a = getenv('SOURCE_PATH')) ? $a : (WORKING_DIR . '/source')));
2730
define('DOWNLOAD_PATH', FileSystem::convertPath(is_string($a = getenv('DOWNLOAD_PATH')) ? $a : (WORKING_DIR . '/downloads')));
2831
define('CPU_COUNT', match (PHP_OS_FAMILY) {

0 commit comments

Comments
 (0)