Giter VIP home page Giter VIP logo

oead's Introduction

oead

oead is a C++ library for common file formats that are used in modern first-party Nintendo EAD (now EPD) titles.

Python bindings for 3.6+ are also available.

Features

Currently, oead only handles very common formats that are extensively used in recent games such as Breath of the Wild and Super Mario Odyssey.

  • AAMP (binary parameter archive): Only version 2 is supported.
  • BYML (binary YAML): Versions 1, 2, 3, and 4 are supported.
  • SARC (archive)
  • Yaz0 (compression algorithm)

oead also supports a recent Grezzo format that is used in Link's Awakening (Switch):

Getting started

To install the Python module, simply run:

pip install oead

This will download and install a precompiled version of oead for the following platforms:

  • Windows (x86-64 / 64-bit)
  • Recent Linux distributions (x86-64, glibc and musl)
  • macOS 10.14 / 10.15 (x86-64)

The following versions of Python are supported:

  • CPython 3.6 to 3.11
  • PyPy3.7 to 3.9

If you are using any other platform, you must build oead from source (refer to the next section).

Warning

Windows users must ensure that they have the latest Visual C++ 2019 Redistributable installed.

For more information, refer to the documentation.

Building from source

Building oead from source requires:

  • CMake 3.12+
  • A compiler that supports C++17
  • Everything needed to build libyaml

First, clone the repository then enter the oead directory and run git submodule update --init --recursive.

Building the Python module

  • To install the module, run pip install -e .. This requires the following Python modules to be installed: setuptools, wheel
  • If you just want to build the Python module from source without installing it, run python setup.py bdist_wheel.

C++ usage

Linking to the oead target is sufficient to use the library.

Contributing

This project is licensed under the GPLv2+ license.

oead's People

Contributors

antoyo avatar fruityloops1 avatar gingeravalanche avatar leoetlino avatar neebya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

oead's Issues

Fails to build

/home/snogard/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/debugging/failure_signal_handler.cc: In function ‘bool absl::SetupAlternateStackOnce()’:
/home/snogard/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/debugging/failure_signal_handler.cc:139:32: error: no matching function for call to ‘max(long int, int)’
  139 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12.1.0/algorithm:60,
                 from /home/snogard/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/debugging/failure_signal_handler.cc:36:
/usr/include/c++/12.1.0/bits/stl_algobase.h:254:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/12.1.0/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
/home/snogard/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/debugging/failure_signal_handler.cc:139:32: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long int’ and ‘int’)
  139 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/12.1.0/bits/stl_algobase.h:300:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/12.1.0/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
/home/snogard/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/debugging/failure_signal_handler.cc:139:32: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long int’ and ‘int’)
  139 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12.1.0/algorithm:61:
/usr/include/c++/12.1.0/bits/stl_algo.h:5746:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)’
 5746 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/12.1.0/bits/stl_algo.h:5746:5: note:   template argument deduction/substitution failed:
/home/snogard/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/debugging/failure_signal_handler.cc:139:32: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long int’
  139 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/12.1.0/bits/stl_algo.h:5756:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)’
 5756 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/12.1.0/bits/stl_algo.h:5756:5: note:   template argument deduction/substitution failed:
/home/snogard/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/debugging/failure_signal_handler.cc:139:32: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long int’
  139 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~
make[2]: *** [oead/lib/abseil/absl/debugging/CMakeFiles/absl_failure_signal_handler.dir/build.make:76: oead/lib/abseil/absl/debugging/CMakeFiles/absl_failure_signal_handler.dir/failure_signal_handler.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1378: oead/lib/abseil/absl/debugging/CMakeFiles/absl_failure_signal_handler.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 83%] Linking CXX static library libabsl_cordz_handle.a
[ 83%] Built target absl_cordz_handle
[ 83%] Linking CXX static library libabsl_hashtablez_sampler.a
[ 83%] Built target absl_hashtablez_sampler
make: *** [Makefile:136: all] Error 2
Traceback (most recent call last):
  File "/home/snogard/.cache/paru/clone/python-oead/src/oead/setup.py", line 64, in <module>
    setuptools.setup(
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.10/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/snogard/.cache/paru/clone/python-oead/src/oead/setup.py", line 29, in run
    self.build_extension(ext)
  File "/home/snogard/.cache/paru/clone/python-oead/src/oead/setup.py", line 55, in build_extension
    subprocess.check_call([cmake_name, '--build', '.'] + build_args, cwd=self.build_temp)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '-j4', '--config', 'Release']' returned non-zero exit status 2.
==> ERROR: A failure occurred in build().
    Aborting...
error: failed to build 'python-oead-1.2.3-2': 
error: packages failed to build: python-oead-1.2.3-2

Building oead fails

This is what happens when I try to install oead:

C:\Users\mariokirby1703>pip install oead
Collecting oead
  Using cached oead-1.2.7.tar.gz (4.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: oead
  Building wheel for oead (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for oead (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      C:\Users\mariokirby1703\AppData\Local\Temp\pip-build-env-knxs5mg0\overlay\Lib\site-packages\setuptools\dist.py:508: InformationOnly: Normalizing 'v1.2.7' to '1.2.7'
        self.metadata.version = self._normalize_version(
      running bdist_wheel
      running build
      running build_ext
      error: [WinError 2] Das System kann die angegebene Datei nicht finden
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for oead
Failed to build oead
ERROR: Could not build wheels for oead, which is required to install pyproject.toml-based projects

Help would be greatly appreciated! ^^

utils has no attribute "make_test_cases"

im trying to modify one of the default python scripts but when i run, its giving me this error. i did pip install utils but nothing. forgive me if this is a bad question im still new to coding

Can't build with Clang 14.0.6

I was trying to build oead using Clang (v. 14.0.6), but it always throws out this error:

oead/src/yaz0.cpp:168:20: error: invalid value '0'; must be positive
[build] #pragma GCC unroll 0
[build]                    ^
[build] 1 error generated.

Bulding with GCC does work though, so it can be built using that.

Error while generating package metadata

While I try to pip install bcml, here is what I get:

  Using cached oead-1.2.7.tar.gz (4.2 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      /private/var/folders/p0/83wz866d50xfhv49j51sfd6r0000gn/T/pip-install-8uo0j8yo/oead_7a24d08f414e47bbbc1c104cd092ebca/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/p0/83wz866d50xfhv49j51sfd6r0000gn/T/pip-install-8uo0j8yo/oead_7a24d08f414e47bbbc1c104cd092ebca/setup.py", line 66, in <module>
          version=versioneer.get_version(),
                  ^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/p0/83wz866d50xfhv49j51sfd6r0000gn/T/pip-install-8uo0j8yo/oead_7a24d08f414e47bbbc1c104cd092ebca/versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "/private/var/folders/p0/83wz866d50xfhv49j51sfd6r0000gn/T/pip-install-8uo0j8yo/oead_7a24d08f414e47bbbc1c104cd092ebca/versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/p0/83wz866d50xfhv49j51sfd6r0000gn/T/pip-install-8uo0j8yo/oead_7a24d08f414e47bbbc1c104cd092ebca/versioneer.py", line 342, in get_config_from_root
          parser = configparser.SafeConfigParser()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?

From another repo, it looks like versioneer is deprecated.

Update lib abseil

Hi.
I cannot compile oead because of an update.
It looks like updating lib abseil would fix this issue.
The compiler error seems to be caused by a missing #include:

In file included from /home/user/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/strings/internal/str_format/extension.cc:16:
/home/user/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/strings/internal/str_format/extension.h:34:6: warning: elaborated-type-specifier for a scoped enum must not use the ‘class’ keyword
   34 | enum class FormatConversionChar : uint8_t;
      | ~~~~ ^~~~~
      |      -----
/home/user/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/strings/internal/str_format/extension.h:34:33: error: found ‘:’ in nested-name-specifier, expected ‘::’
   34 | enum class FormatConversionChar : uint8_t;
      |                                 ^
      |                                 ::
/home/user/.cache/paru/clone/python-oead/src/oead/lib/abseil/absl/strings/internal/str_format/extension.h:34:12: error: ‘FormatConversionChar’ has not been declared
   34 | enum class FormatConversionChar : uint8_t;
      |            ^~~~~~~~~~~~~~~~~~~~

Thanks.

oead cannot be installed pip, but shown via search

Running pip3 install oead results in the error below. Running pip3 search oead shows that the package exists. According to a user on stackoverflow this issue is solved via the package author themselves.

ERROR: Could not find a version that satisfies the requirement oead (from versions: none)
ERROR: No matching distribution found for oead

oead 1.2.5 & 1.2.5.post1- BCML issues

The following versions completely break Linkle 3.0.1 and Girly Animation Pack specifically, there are other mods that just hang on the title screen also for wiiu/switch users. Downgrading to oead 1.2.4.post2 fixes these issues and allows said mods to work flawlessly.

1.2.4-1 does not contain the readme.rst file

Looks like the 1.2.4-1 tar.gz file is missing the readme.rst

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Rahul\AppData\Local\Temp\pip-install-9pju7qrd\oead\setup.py", line 58, in
with open("readme.rst", "r") as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'readme.rst'

No available build for ARM64 systems

I've been trying to install oead on some ARM64 systems lately, and keep running into the issue of there not being a package on pip for that architecture. I've tried building from the source, but haven't had any luck with that either. I was wondering if you would mind creating and uploading a package that functions on ARM64 devices? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.