Skip to content

Commit

Permalink
Merge branch 'main' into bump-freetype_2.13.0_to_2.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
IsabelParedes authored Jun 12, 2024
2 parents 496086a + 7b9c7b8 commit 3b566ae
Show file tree
Hide file tree
Showing 32 changed files with 242 additions and 231 deletions.
10 changes: 1 addition & 9 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 Expand Up @@ -106,6 +98,6 @@ jobs:
mkdir -p ${GITHUB_WORKSPACE}/output/${platform}
for package in $(ls ${GITHUB_WORKSPACE}/output/${platform}/*.tar.bz2); do
echo "Uploading ${package} for ${platform} (build with rattler)"
QUETZ_API_KEY=${{ secrets.QUETZ_API_KEY}} quetz-client -u https://beta.mamba.pm post_file_to_channel emscripten-forge ${package}
QUETZ_API_KEY=${{ secrets.QUETZ_API_KEY}} quetz-client -u https://beta.mamba.pm post_file_to_channel emscripten-forge ${package} || true
done
done
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 packages for several emscripten versions.

But now, emscripten is a repacked package that installs emscripten into the conda environment. This allows in principle to compile packages for multiple emscripten versions.
8 changes: 4 additions & 4 deletions docs/development/local_builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ I.e. if you open a new terminal, you have to activate the environment again with
This is only needed for MacOS. On Linux, the compiler packages are already built and available in the `emscripten-forge` channel.

```bash
rattler-build build --recipe recipes/recipes/emscripten_emscripten-wasm32/rattler_recipe.yaml -c https://repo.mamba.pm/emscripten-forge -c conda-forge -c microsoft -m conda_build_config.yaml
rattler-build build --recipe recipes/recipes/cross-python_emscripten-wasm32/rattler_recipe.yaml -c https://repo.mamba.pm/emscripten-forge -c conda-forge -c microsoft -m conda_build_config.yaml
rattler-build build --recipe recipes/recipes/pytester/rattler_recipe.yaml -c https://repo.mamba.pm/emscripten-forge -c conda-forge -c microsoft -m conda_build_config.yaml
rattler-build build --recipe recipes/recipes/emscripten_emscripten-wasm32/recipe.yaml -c https://repo.mamba.pm/emscripten-forge -c conda-forge -c microsoft -m conda_build_config.yaml
rattler-build build --recipe recipes/recipes/cross-python_emscripten-wasm32/recipe.yaml -c https://repo.mamba.pm/emscripten-forge -c conda-forge -c microsoft -m conda_build_config.yaml
rattler-build build --recipe recipes/recipes/pytester/recipe.yaml -c https://repo.mamba.pm/emscripten-forge -c conda-forge -c microsoft -m conda_build_config.yaml
```

### Build packages with `rattler-build`:

```bash
rattler-build build --recipe recipes/recipes_emscripten/regex/rattler_recipe.yaml --target-platform=emscripten-wasm32 -c https://repo.mamba.pm/emscripten-forge -c conda-forge -c microsoft -m conda_build_config.yaml
rattler-build build --recipe recipes/recipes_emscripten/regex/recipe.yaml --target-platform=emscripten-wasm32 -c https://repo.mamba.pm/emscripten-forge -c conda-forge -c microsoft -m conda_build_config.yaml
```
18 changes: 2 additions & 16 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@ version = "0.1.0"
description = "The emscripten-forge for emscripten-wasm32- builds."
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"]
platforms = ["osx-arm64", "osx-64", "linux-64"]


############################################
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"]
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: 27

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.

20 changes: 13 additions & 7 deletions recipes/recipes_emscripten/fribidi/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
context:
version: "1.0.14"
version: 1.0.15

package:
name: fribidi
version: ${{ version }}

source:
url: https://github.com/fribidi/fribidi/releases/download/v${{ version }}/fribidi-${{ version }}.tar.xz
sha256: 76ae204a7027652ac3981b9fa5817c083ba23114340284c58e756b259cd2259a
url: https://github.com/fribidi/fribidi/releases/download/v${{ version }}/fribidi-${{
version }}.tar.xz
sha256: 0bbc7ff633bfa208ae32d7e369cf5a7d20d5d2557a0b067c9aa98bcbf9967587

build:
number: 0

requirements:
build:
- ${{ compiler('c') }}
- pkg-config
- gettext
- ${{ compiler('c') }}
- pkg-config
- gettext

tests:
- script:
- test -f ${PREFIX}/lib/libfribidi.a
- test -f ${PREFIX}/include/fribidi/fribidi.h

about:
homepage: https://github.com/fribidi/fribidi
Expand All @@ -29,4 +35,4 @@ about:
have proper Arabic and Hebrew support, the bidi algorithm needs to be
implemented. It is our hope that this library will stimulate more free
software in the Middle Eastern countries.
repository: https://github.com/fribidi/fribidi
repository: https://github.com/fribidi/fribidi
5 changes: 4 additions & 1 deletion recipes/recipes_emscripten/highs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

mkdir build
cd build
emcmake cmake ${CMAKE_ARGS} -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX $SRC_DIR -DCMAKE_INSTALL_LIBDIR=lib ..
emcmake cmake ${CMAKE_ARGS} \
-DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=$PREFIX $SRC_DIR \
-DCMAKE_INSTALL_LIBDIR=lib ..
emmake make install
Loading

0 comments on commit 3b566ae

Please sign in to comment.