soarqin / finalhe

Final h-encore, a tool to push h-encore exploit for PS VITA/PS TV automatically
GNU General Public License v3.0
620 stars 115 forks source link

MacOS build instruction fixes #101

Closed nighto closed 2 years ago

nighto commented 3 years ago

Fixes #60.

prestoncrawford commented 3 years ago

Is this all you had to do? On make I'm seeing the following error.

Consolidate compiler generated dependencies of target vitapkg [ 31%] Building C object deps/psvlib/pkg/CMakeFiles/vitapkg.dir/pkg_sys.c.o /Users/prestonc/Downloads/VITA/finalhe-1.92/deps/psvlib/pkg/pkg_sys.c:211:13: error: implicit declaration of function '_error_func' is invalid in C99 [-Werror,-Wimplicit-function-declaration] _error_func(NULL, "ERROR: cannot create '%s' folder\n", path);

suicvne commented 3 years ago

I was able to fix the build error on macOS Big Sir (11.3). The result is a 4mb Unix binary called "FinalHE" that I can just double click to open:

by default 2021-06-01 at 3 47 40 PM

I have yet to test it. The cosmic red 1000 I just bought needs to charge before I can try this, but I wanted to ensure I was prepared for when it was charged.

I fixed it by modifying the following files:

deps/psvlib/pkg/pkg_sys.c @ line 176 (after all other includes)

#ifdef __APPLE__
extern pkg_output_func _output_func;
extern pkg_error_func _error_func;
#endif

deps/psvlib/img/backup.c @ line 28 (after all other includes, before defines and pragmas)

#ifdef __APPLE__
#include <string.h>
#endif

I then had a cmake policy 0100 error on version 3.20.0 installed from homebrew (it caused a linker error later on), so I then added the following to src/CMakeLists.txt (after policy CMP0071 is checked and set to new)

if(POLICY CMP0100)
    cmake_policy(SET CMP0100 NEW)
endif ()

These are external dependencies, but they're stored in this project's directory. Should I make a pull request here?

suicvne commented 3 years ago

Successfully able to push h-encore2 to a Vita 1000 running 3.73 with my home built version with above modifications^

EDIT: These problems will only happen if you're trying to build the source.zip from the latest release. The repo's master branch is already updated with the fixes necessary.

b4mboo commented 3 years ago

@nighto This was really helpful to me. Thank you! ✨

JoeMatt commented 2 years ago

Thank you.

Confirming this works on macOS Monterey 12.0 Beta with XCode 12.5.1.

brew install dyld-headers libusb pkg-config qt5
cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt@5 .
open src/FinalHE 
sudot0ph commented 2 years ago

Brew instructions should be brew install libusb pkg-config qt@5

followed by brew link qt@5, or qmake might not be recognized.

Builds without issues via qmake on Big Sur 11.5.