Skip to content

Commit

Permalink
fix docker ENV problem
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoVan committed Apr 23, 2023
1 parent 84629fa commit 900d368
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 29 deletions.
1 change: 1 addition & 0 deletions Dockerfile
@@ -1,6 +1,7 @@
FROM fedora
COPY . /magic
WORKDIR /magic
ENV magicdir=/magic
RUN bash build.sh
RUN ["chmod", "+x", "/magic/entrypoint.sh"]
ENTRYPOINT ["/magic/entrypoint.sh"]
30 changes: 29 additions & 1 deletion build.sh
Expand Up @@ -32,7 +32,35 @@ set -x

. env.sh

mkdir ${magicprefix}
mkdir -p ${magicprefix}


# copied from:
# https://gist.github.com/kleisauke/acfa1c09522705efa5eb0541d2d00887
cat > "${magicdir}/emscripten-crossfile.meson" <<END
[binaries]
c = 'emcc'
cpp = 'em++'
ld = 'wasm-ld'
ar = 'emar'
ranlib = 'emranlib'
pkgconfig = ['emconfigure', 'pkg-config']
# https://docs.gtk.org/glib/cross-compiling.html#cross-properties
[properties]
growing_stack = true
have_c99_vsnprintf = true
have_c99_snprintf = true
have_unix98_printf = true
# Ensure that '-s PTHREAD_POOL_SIZE=*' is not injected into .pc files
[built-in options]
c_thread_count = 0
cpp_thread_count = 0
[host_machine]
system = 'emscripten'
cpu_family = 'wasm32'
cpu = 'wasm32'
endian = 'little'
END

check_result() {
if [ $? -eq 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
@@ -1,3 +1,3 @@
#!/bin/sh
. env.sh
. /magic/env.sh
exec "$@"
27 changes: 0 additions & 27 deletions env.sh
Expand Up @@ -6,7 +6,6 @@
# http://www.wtfpl.net/ for more details.
################

export magicdir=$(pwd)/
export magicprefix=${magicdir}/build

export MAKEFLAGS="-j$(nproc)"
Expand All @@ -22,29 +21,3 @@ ${magicdir}/emsdk/emsdk activate latest
source ${magicdir}/emsdk/emsdk_env.sh

export MESON_CROSS="${magicdir}/emscripten-crossfile.meson"
# copied from:
# https://gist.github.com/kleisauke/acfa1c09522705efa5eb0541d2d00887
cat > "${magicdir}/emscripten-crossfile.meson" <<END
[binaries]
c = 'emcc'
cpp = 'em++'
ld = 'wasm-ld'
ar = 'emar'
ranlib = 'emranlib'
pkgconfig = ['emconfigure', 'pkg-config']
# https://docs.gtk.org/glib/cross-compiling.html#cross-properties
[properties]
growing_stack = true
have_c99_vsnprintf = true
have_c99_snprintf = true
have_unix98_printf = true
# Ensure that '-s PTHREAD_POOL_SIZE=*' is not injected into .pc files
[built-in options]
c_thread_count = 0
cpp_thread_count = 0
[host_machine]
system = 'emscripten'
cpu_family = 'wasm32'
cpu = 'wasm32'
endian = 'little'
END

0 comments on commit 900d368

Please sign in to comment.