-
Notifications
You must be signed in to change notification settings - Fork 573
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 ViZDoom #4933
Closed
Closed
add ViZDoom #4933
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Note that this script can accept some limited command-line arguments, run | ||
# `julia build_tarballs.jl --help` to see a usage message. | ||
using BinaryBuilder, Pkg | ||
|
||
# See https://github.com/JuliaLang/Pkg.jl/issues/2942 | ||
# Once this Pkg issue is resolved, this must be removed | ||
uuid = Base.UUID("a83860b7-747b-57cf-bf1f-3e79990d037f") | ||
delete!(Pkg.Types.get_last_stdlibs(v"1.6.3"), uuid) | ||
|
||
julia_versions = [v"1.6.3", v"1.7.0", v"1.8.0", v"1.9.0"] | ||
|
||
name = "ViZDoom" | ||
version = v"1.1.13" | ||
|
||
# Collection of sources required to complete build | ||
sources = [ | ||
ArchiveSource("https://github.com/mwydmuch/ViZDoom/archive/refs/tags/$version.tar.gz", "e379a242ada7e1028b7a635da672b0936d99da3702781b76a4400b83602d78c4"), | ||
DirectorySource("./bundled"), | ||
] | ||
|
||
# Bash recipe for building across all platforms | ||
script = raw""" | ||
cd $WORKSPACE/srcdir/ViZDoom-* | ||
mv ../CMakeLists.txt ../ViZDoomJuliaModule.cpp src/lib_julia/ | ||
mkdir build | ||
cd build | ||
cmake \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_FIND_ROOT_PATH=${prefix} \ | ||
-DCMAKE_INSTALL_PREFIX=${prefix} \ | ||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ | ||
-DCMAKE_CROSSCOMPILING=FALSE \ | ||
-DJulia_PREFIX=${prefix} \ | ||
-DBUILD_JULIA=ON \ | ||
.. | ||
cmake --build . --parallel ${nproc} | ||
cp -r bin/* ${libdir} | ||
mv ../src/freedoom2.wad ${libdir} | ||
mv ../scenarios $prefix/ | ||
install_license $WORKSPACE/srcdir/ViZDoom-*/README.md | ||
""" | ||
|
||
# These are the platforms we will build for by default, unless further | ||
# platforms are passed in on the command line | ||
include("../../L/libjulia/common.jl") | ||
platforms = vcat(libjulia_platforms.(julia_versions)...) | ||
platforms = expand_cxxstring_abis(platforms) | ||
# Qt6Declarative_jll is not available for these architectures: | ||
filter!(p -> arch(p) != "armv6l", platforms) | ||
|
||
# The products that we will ensure are always built | ||
products = [ | ||
LibraryProduct("libvizdoomjl", :libvizdoom), | ||
FileProduct("scenarios", :scenarios) | ||
] | ||
|
||
# Dependencies that must be installed before this package can be built | ||
dependencies = [ | ||
Dependency("boost_jll"), | ||
jbrea marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Dependency("SDL2_jll"), | ||
Dependency("libcxxwrap_julia_jll"), | ||
BuildDependency("libjulia_jll"), | ||
] | ||
|
||
# Build the tarballs, and possibly a `build.jl` as well. | ||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; | ||
preferred_gcc_version = v"9", | ||
julia_compat = "1.6") |
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,11 @@ | ||
find_package(JlCxx REQUIRED) | ||
|
||
add_library(vizdoomjl SHARED ViZDoomJuliaModule.cpp) | ||
target_link_libraries(vizdoomjl JlCxx::cxxwrap_julia ${VIZDOOM_LIBS} libvizdoom_static) | ||
set_target_properties(vizdoomjl | ||
PROPERTIES | ||
LIBRARY_OUTPUT_DIRECTORY "${VIZDOOM_OUTPUT_DIR}" | ||
LIBRARY_OUTPUT_DIRECTORY_RELEASE "${VIZDOOM_OUTPUT_DIR}" | ||
LIBRARY_OUTPUT_DIRECTORY_DEBUG "${VIZDOOM_OUTPUT_DIR}" | ||
LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL "${VIZDOOM_OUTPUT_DIR}" | ||
LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${VIZDOOM_OUTPUT_DIR}") |
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.
This sounds wrong. The content of the
lib/
directory isThere is a mix of shared libraries (only things which should be here), executable binaries (which should go to
${bindir}
), source files (which shouldn't be in the tarball at all), files I have no idea what they are (*.wad
and*.pk3
) and static library (it's ok to have the static library in${libdir}
, but that's just useless for the purpose of calling a library from Julia, so we usually avoid having static libraries around).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.
Thanks. I removed most files, but vizdoom.pk3 and freedoom2.wad seem to be needed. Otherwise games won't load.