-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Add support for contrib ports #21191
Closed
Closed
Changes from 5 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
351bac9
first pass at contrib port
ypujante 7ff2807
Generate documentation for contrib ports
ypujante 1986351
added -s
ypujante 259ce42
generate documentation for contrib ports
ypujante 440a2e4
Merge remote-tracking branch 'origin/main' into contrib-ports
ypujante 6c4bf89
fixed python syntax
ypujante 5095bfc
ports are loaded on demand only
ypujante 0fb7f9c
added the concept of port options
ypujante 05da2b1
add options in the documentation
ypujante fddc7b0
use better name
ypujante 7d16050
better syntax
ypujante e5986cd
Merge remote-tracking branch 'origin/main' into contrib-ports
ypujante 357e4df
updated documentation
ypujante 83e5507
Merge remote-tracking branch 'origin/main' into contrib-ports
ypujante File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2024 The Emscripten Authors. All rights reserved. | ||
* Emscripten is available under two separate licenses, the MIT license and the | ||
* University of Illinois/NCSA Open Source License. Both these licenses can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
#include <GLFW/glfw3.h> | ||
#include <GLFW/emscripten_glfw3.h> | ||
#include <contrib_example.h> | ||
#include <assert.h> | ||
|
||
int main() { | ||
// from one contrib port | ||
assert(contrib_example() == 12); | ||
|
||
// from another contrib port | ||
assert(glfwInit() == GLFW_TRUE); | ||
|
||
GLFWwindow* window = glfwCreateWindow(320, 200, "test_glfw3_port", 0, 0); | ||
assert(window != 0); | ||
// this call ensures that it uses the right port | ||
assert(emscripten_glfw_is_window_fullscreen(window) == EM_FALSE); | ||
glfwTerminate(); | ||
|
||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Emscripten "Contrib" Ports | ||
========================== | ||
|
||
Ports in this directory are contributed by the wider community and are | ||
supported on a "best effort" basis. Since they are not run as part of | ||
emscripten CI they are not always guaranteed to build or function. | ||
|
||
If you want to add a contrib port, please use another contrib port as | ||
an example. In particular, each contrib port must provide 3 extra piece | ||
of information (provided as functions in the port file): | ||
|
||
* `project_url`: the url where the user can find more information about | ||
the project/port | ||
* `project_description`: a (short) description of what the project/port | ||
is about | ||
* `project_license`: the license used by the project/port | ||
|
||
After adding (resp. modifying) a contrib port, you must run the | ||
`./tools/maint/update_settings_docs.py` command to add (resp. update) | ||
the new port to the documentation. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Copyright 2024 The Emscripten Authors. All rights reserved. | ||
# Emscripten is available under two separate licenses, the MIT license and the | ||
# University of Illinois/NCSA Open Source License. Both these licenses can be | ||
# found in the LICENSE file. | ||
|
||
|
||
# The purpose of this contrib port is to have 2 contrib ports in order to have a test with | ||
# 2 ports since the syntax is different. Once there are 2 contrib ports available, this | ||
# example can be removed and the test changed to use the 2 available ports... | ||
|
||
|
||
import os | ||
|
||
|
||
def get_lib_name(settings): | ||
return 'libcontrib_example.a' | ||
|
||
|
||
def get(ports, settings, shared): | ||
|
||
def create(final): | ||
source_path = ports.get_dir() | ||
ports.write_file(os.path.join(source_path, 'contrib_example.h'), example_h) | ||
ports.write_file(os.path.join(source_path, 'contrib_example.c'), example_c) | ||
ports.install_headers(source_path) | ||
ports.build_port(source_path, final, 'contrib_example') | ||
|
||
return [shared.cache.get_lib(get_lib_name(settings), create, what='port')] | ||
|
||
|
||
def clear(ports, settings, shared): | ||
shared.cache.erase_lib(get_lib_name(settings)) | ||
|
||
|
||
def process_args(ports): | ||
return ['-isystem', ports.get_include_dir('contrib_example')] | ||
|
||
|
||
def project_url(): | ||
return 'https://github.com/emscripten-core/emscripten' | ||
|
||
|
||
def project_description(): | ||
return 'Port Contrib Example' | ||
|
||
|
||
def project_license(): | ||
return 'MIT license' | ||
|
||
|
||
example_h = 'int contrib_example();' | ||
|
||
|
||
example_c = r''' | ||
int contrib_example() { | ||
return 12; | ||
} | ||
''' |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using the libarchive example I provided in my PR?