Skip to content

Commit

Permalink
Merge branch 'main' into bump-xz_5.2.10_to_5.2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
DerThorsten authored May 27, 2024
2 parents 0959ef8 + 74e94ec commit ecf279f
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 105 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build_recipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ jobs:
cache-environment: true
post-cleanup: 'all'

################################################################
# EMSDK
################################################################
- name: Setup emsdk
shell: bash -el {0}
run: |
./emsdk/setup_emsdk.sh ${{ matrix.emsdk_ver }} $(pwd)/emsdk_install
################################################################
# POST ENV INSTALL CONFIG
################################################################
Expand Down
7 changes: 7 additions & 0 deletions docs/blog/.authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ authors:
avatar: https://avatars.githubusercontent.com/u/904752?v=4 # Author avatar
slug: DerThorsten # Author profile slug
url: https://github.com/DerThorsten # Author website URL

wolfv:
name: Wolf Vollprecht
description: main author of emscripten-forge
avatar: https://avatars.githubusercontent.com/u/885054?v=4
slug: wolfv # Author profile slug
url: https://prefix.dev # Author website URL
15 changes: 15 additions & 0 deletions docs/blog/posts/repack_emscripten.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
date: 2024-05-24
category:
- rust

authors:
- derthorsten
- wolfv
---

# Emscripten is now a proper package

So far, the emscripten package was a bit of a hack. It relied on a text file `~.emsdkdir` in the home directory which contained the directory of the emscripten installation. This was not very nice, because it was hard to build packags for serveral emscripten versions.

Now, emscripten is a repacked package which installs emscripten into the conda environment. This allows in principle to to compile packages for multiple emscripten versions.
14 changes: 0 additions & 14 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ authors = ["DerThorsten <[email protected]>"]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64"]

############################################
# setup-emsdk feature / tasks
############################################
[feature.feature_setup_emsdk]
[feature.feature_setup_emsdk.dependencies]
cxx-compiler = "1.5.2.*"
[feature.feature_setup_emsdk.tasks.setup-emsdk]
cmd = ["./emsdk/setup_emsdk.sh", "3.1.45", "$(pwd)/emscripten_forge_emsdk_install"]
outputs = ["emscripten_forge_emsdk_install/emsdk_env.sh"]


############################################
# rattler-build feature / tasks
Expand All @@ -40,7 +30,6 @@ cmd = [
"--recipe",
"recipes/recipes/emscripten_emscripten-wasm32"
]
depends_on = ["setup-emsdk"]

[feature.feature_rattler_build.tasks.build-cross-python-pkg]
cmd = [
Expand All @@ -56,7 +45,6 @@ cmd = [
"--recipe",
"recipes/recipes/cross-python_emscripten-wasm32"
]
depends_on = ["setup-emsdk"]

[feature.feature_rattler_build.tasks.build-pytester-pkg]
cmd = [
Expand All @@ -72,7 +60,6 @@ cmd = [
"--recipe",
"recipes/recipes/pytester"
]
depends_on = ["setup-emsdk"]


[feature.feature_rattler_build.tasks.setup]
Expand Down Expand Up @@ -118,6 +105,5 @@ cmd = ["mkdocs", "build"]
############################################

[environments]
setup-emsdk-env = ["feature_setup_emsdk"]
rattler-build-env = ["feature_rattler_build"]
documentation-env = ["feature_documentation"]
28 changes: 2 additions & 26 deletions recipes/recipes/emscripten_emscripten-wasm32/activate.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@

if [ -z ${CONDA_FORGE_EMSCRIPTEN_ACTIVATED+x} ]; then

export CONDA_FORGE_EMSCRIPTEN_ACTIVATED=1

export EMSDK_PYTHON=${BUILD_PREFIX}/bin/python3
export PYTHON=${BUILD_PREFIX}/bin/python3




CONDA_EMSDK_DIR_CONFIG_FILE=$HOME/.emsdkdir
if test -f "$CONDA_EMSDK_DIR_CONFIG_FILE"; then
echo "Found config file $CONDA_EMSDK_DIR_CONFIG_FILE"
else
# return an error
echo "Config file $CONDA_EMSDK_DIR_CONFIG_FILE not found"
return 1
fi


CONDA_EMSDK_DIR=$CONDA_PREFIX/opt/emsdk

export EMSCRIPTEN_VERSION=$PKG_VERSION

export CONDA_EMSDK_DIR=$(<$CONDA_EMSDK_DIR_CONFIG_FILE)
export EMSCRIPTEN_FORGE_EMSDK_DIR=$CONDA_EMSDK_DIR
echo "Using EMSCRIPTEN_FORGE_EMSDK_DIR $CONDA_EMSDK_DIR_CONFIG_FILE: " $EMSCRIPTEN_FORGE_EMSDK_DIR

$CONDA_EMSDK_DIR/emsdk activate --embedded --build=Release $EMSCRIPTEN_VERSION

source $CONDA_EMSDK_DIR/emsdk_env.sh

export PATH="$CONDA_EMSDK_DIR/upstream/emscripten/":$PATH

# clear all prexisting cmake args / CC / CXX / AR / RANLIB
export CC="emcc"
Expand All @@ -39,8 +18,6 @@ if [ -z ${CONDA_FORGE_EMSCRIPTEN_ACTIVATED+x} ]; then

export CMAKE_ARGS=""



# set the emscripten toolchain
export CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$CONDA_EMSDK_DIR/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"

Expand Down Expand Up @@ -82,5 +59,4 @@ if [ -z ${CONDA_FORGE_EMSCRIPTEN_ACTIVATED+x} ]; then
# wasm bigint
export LDFLAGS="$LDFLAGS -sWASM_BIGINT"


fi
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,31 @@ do
done

mkdir -p ${PREFIX}/bin
cp "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh" ${PREFIX}/bin/activate_emscripten.sh
cp "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh" ${PREFIX}/bin/activate_emscripten.sh

export EMSDK_PYTHON=${BUILD_PREFIX}/bin/python

./emsdk install $PKG_VERSION

# export EMSDK=/Users/wolfv/Programs/emscripten-forge/emscripten_forge_emsdk_install
export EMSDK=.

mkdir -p $PREFIX/opt/emsdk/
cp -r $EMSDK/upstream $PREFIX/opt/emsdk/upstream
rm -rf $PREFIX/opt/emsdk/upstream/emscripten/test/

mkdir -p $PREFIX/bin

for file in $PREFIX/opt/emsdk/upstream/bin/*; do
echo "Linking $file"
ln -sf $file $PREFIX/bin/
done

for file in $PREFIX/opt/emsdk/upstream/emscripten/*; do
# Check if the file is executable
if [ -x "$file" ] && [ ! -d "$file" ]; then
# Create a symbolic link in the $PREFIX/bin directory
echo "Linking $file"
ln -sf $file $PREFIX/bin/
fi
done
17 changes: 13 additions & 4 deletions recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,31 @@ context:
version: 3.1.45

build:
number: 25
number: 26

outputs:
- package:
name: ${{ name|lower }}
version: ${{ version }}

source:
git: https://github.com/emscripten-core/emsdk.git

build:
script: build_compiler_package.sh

dynamic_linking:
binary_relocation: false

requirements:
build:
- gettext
- curl
- python
run:
- python
- nodejs 16.*
run_exports:
- ${{ pin_subpackage('emscripten-abi', min_pin='x.x.x', max_pin='x.x.x') }}
- ${{ pin_subpackage('emscripten-abi', min_pin='x.x.x', max_pin='x.x.x') }}

- package:
name: emscripten-abi
Expand All @@ -33,11 +41,12 @@ outputs:
about:
homepage: https://emscripten.org
license: MIT
license_file: LICENSE
license_file: LICENSE.txt
summary: emscripten
description: Emscripten is a complete compiler toolchain to WebAssembly, using LLVM, with a special focus on speed, size, and the Web platform.
documentation: https://emscripten.org/

extra:
recipe-maintainers:
- DerThorsten
- wolfv
52 changes: 0 additions & 52 deletions recipes/recipes/emscripten_emscripten-wasm32/recipe_legacy.yaml

This file was deleted.

0 comments on commit ecf279f

Please sign in to comment.