Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emsdk: add new version 3.1.72 #24218

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions recipes/emsdk/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"3.1.68":
url: "https://github.com/emscripten-core/emsdk/archive/3.1.68.tar.gz"
sha256: "97f21c32c0c1eecb963d19d1cacf58538086ce28eb28274993ab21d3673b5c29"
"3.1.50":
url: "https://github.com/emscripten-core/emsdk/archive/3.1.50.tar.gz"
sha256: "7491a881eb5ee15fe81bbabcfff1fd571e45ccdb24a81890af429f9970cbd1f3"
Expand Down
26 changes: 20 additions & 6 deletions recipes/emsdk/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
from conan import ConanFile, conan_version
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import cross_building
from conan.tools.env import Environment
from conan.tools.files import chdir, copy, get, replace_in_file
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
import json
import os
import platform

required_conan_version = ">=1.52.0"


class EmSDKConan(ConanFile):
name = "emsdk"
description = "Emscripten SDK. Emscripten is an Open Source LLVM to JavaScript compiler"
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/kripken/emscripten"
topics = ("emsdk", "emscripten", "sdk")
license = "MIT"
topics = ("emscripten", "sdk")
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved
package_type = "application"
settings = "os", "arch", "compiler", "build_type"

short_paths = True

@property
Expand All @@ -29,17 +31,29 @@ def layout(self):
basic_layout(self, src_folder="src")

def requirements(self):
self.requires("nodejs/16.3.0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There has been some talk about this recipe requiring nodejs directly, instead of it being a tool_requires, we should clarify if it's really needed or if we could get away with tool_requireing it.

The issue is that users of emsdk are not able to override nodejs, and they get conflicts using it as a tool_requires

if Version(self.version) < "3.1.64":
self.requires("nodejs/16.3.0")
else:
self.requires("nodejs/20.16.0")
# self.requires("python") # FIXME: Not available as Conan package
# self.requires("wasm") # FIXME: Not available as Conan package

@property
def _is_glibc_older_than_2_28(self):
libver = platform.libc_ver()
return self.settings.os == 'Linux' and libver[0] == 'glibc' and Version(libver[1]) < "2.28"

def validate_build(self):
if Version(self.version) >= "3.1.64" and self._is_glibc_older_than_2_28:
raise ConanInvalidConfiguration(
f"{self.ref} requires glibc 2.28 for nodejs/20.16.0")

def package_id(self):
del self.info.settings.compiler
del self.info.settings.build_type

def source(self):
get(self, **self.conan_data["sources"][self.version],
destination=self.source_folder, strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)

@property
def _relative_paths(self):
Expand Down
2 changes: 2 additions & 0 deletions recipes/emsdk/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.1.68":
folder: all
"3.1.50":
folder: all
"3.1.49":
Expand Down
Loading