stub Hasher and remove OpenSSL dependency, add zlib wrap

This commit is contained in:
Tropical 2026-04-10 14:10:53 -07:00
parent 027f87f653
commit 5c248704ac
4 changed files with 35 additions and 22 deletions

View file

@ -1,15 +0,0 @@
[wrap-file]
directory = openssl-3.0.8
source_url = https://www.openssl.org/source/openssl-3.0.8.tar.gz
source_filename = openssl-3.0.8.tar.gz
source_hash = 6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e
patch_filename = openssl_3.0.8-3_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/openssl_3.0.8-3/get_patch
patch_hash = 300da189e106942347d61a4a4295aa2edbcf06184f8d13b4cee0bed9fb936963
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/openssl_3.0.8-3/openssl-3.0.8.tar.gz
wrapdb_version = 3.0.8-3
[provide]
libcrypto = libcrypto_dep
libssl = libssl_dep
openssl = openssl_dep

14
subprojects/zlib.wrap Normal file
View file

@ -0,0 +1,14 @@
[wrap-file]
directory = zlib-1.3.2
source_url = https://zlib.net/zlib-1.3.2.tar.xz
source_fallback_url = https://wrapdb.mesonbuild.com/v2/zlib_1.3.2-1/get_source/zlib-1.3.2.tar.xz
source_filename = zlib-1.3.2.tar.xz
source_hash = d7a0654783a4da529d1bb793b7ad9c3318020af77667bcae35f95d0e42a792f3
patch_filename = zlib_1.3.2-1_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/zlib_1.3.2-1/get_patch
patch_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/zlib_1.3.2-1/zlib_1.3.2-1_patch.zip
patch_hash = 5ae7a2e92f823df118cfb8c1b23d94e3117864392b3446581d669049b2fba6dd
wrapdb_version = 1.3.2-1
[provide]
dependency_names = zlib

View file

@ -9,7 +9,7 @@ minecraft_sources = files(fs.read('sources.txt').strip().split('\n'))
lib_minecraft = static_library('minecraft',
minecraft_sources,
dependencies : [
dependency('libcrypto'), # for MD5 in Hasher.cpp on Linux
# dependency('libcrypto'), # for MD5 in Hasher.cpp on Linux
dependency('zlib'),
dependency('glm'),
nbt_dep,

View file

@ -1,17 +1,30 @@
#if defined(_WIN32)
#include <xhash>
#else
// #if defined(_WIN32)
// #include <xhash>
// #else
#include <iomanip>
#include <sstream>
#endif // _WIN32
#include <openssl/evp.h>
#include <openssl/types.h>
// #endif // _WIN32
// #include <openssl/evp.h>
// #include <openssl/types.h>
#include "Hasher.h"
Hasher::Hasher(std::string& salt) { this->salt = salt; }
std::string Hasher::getHash(std::string& name) {
// 4jcraft: stubbed for portability reasons.
//
// The OpenSSL meson is broken on windows and expects winsock to
// be statically linked (which is dumb since we only want libcrypto
// for MD5 hashing), and avoiding a dependency on libcrypto here is
// probably a good thing either way for some platforms.
//
// Given that this class isn't used and im lazy, we're just gonna do
// this until it becomes a problem. This class isnt actually used
// anywhere at the moment anyways so it's whatever.
return "";
#if 0
#if defined(_WIN32)
// 4J Stu - Removed try/catch
// try {
@ -46,4 +59,5 @@ std::string Hasher::getHash(std::string& name) {
std::string hash_str = ss.str();
return std::string(hash_str.begin(), hash_str.end());
#endif
#endif
}