Skip to content

Commit

Permalink
Upgrade to Python 3.12
Browse files Browse the repository at this point in the history
- Should manage most external dependencies for python
  • Loading branch information
Silarn committed May 20, 2024
1 parent a7ee59c commit b7d7166
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 77 deletions.
8 changes: 4 additions & 4 deletions mob.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ plugins = check_fnis bsapacker bsa_extractor diagnose_basic installer_* plugin_p
[task]
enabled = true
mo_org = ModOrganizer2
mo_branch = master
mo_fallback =
mo_branch = dev/deps-upgrade-20240518
mo_fallback = master
no_pull = false
ignore_ts = false
revert_ts = false
Expand Down Expand Up @@ -87,7 +87,7 @@ pull = true
boost = true
lz4 = true
openssl = true
pyqt = true
pyqt = false
python = true
usvfs = false

Expand All @@ -108,7 +108,7 @@ openssl = 3.3.0
pyqt = 6.7.0
pyqt_builder = 1.16.2
pyqt_sip = 13.7.0
python = v3.11.9
python = v3.12.3
pybind11 = v2.12.0
bzip2 = 1.0.8
sip = 6.8.3
Expand Down
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ namespace mob {
.add_task<libbsarch>()
.add_task<libloot>()
.add_task<openssl>()
.add_task<libffi>()
.add_task<bzip2>();

add_task<parallel_tasks>()
Expand Down
51 changes: 0 additions & 51 deletions src/tasks/libffi.cpp

This file was deleted.

15 changes: 12 additions & 3 deletions src/tasks/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ namespace mob::tasks {

void python::build_and_install_from_source()
{
// download externals
prepare_dependencies();

// build
run_tool(create_msbuild_tool());

Expand All @@ -172,6 +175,14 @@ namespace mob::tasks {
copy_files();
}

void python::prepare_dependencies()
{
const auto bat = source_path() / "PCBuild" / "get_externals.bat";
run_tool(process_runner(process()
.binary(bat)
.cwd(source_path())));
}

void python::package()
{
if (fs::exists(python_core_zip_file())) {
Expand Down Expand Up @@ -224,9 +235,7 @@ namespace mob::tasks {
{"bz2Dir=" + path_to_utf8(bzip2::source_path()),
"zlibDir=" + path_to_utf8(zlib::source_path()),
"opensslIncludeDir=" + path_to_utf8(openssl::include_path()),
"opensslOutDir=" + path_to_utf8(openssl::source_path()),
"libffiIncludeDir=" + path_to_utf8(libffi::include_path()),
"libffiOutDir=" + path_to_utf8(libffi::lib_path())}));
"opensslOutDir=" + path_to_utf8(openssl::source_path())}));
}

fs::path python::python_exe()
Expand Down
19 changes: 1 addition & 18 deletions src/tasks/tasks.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,6 @@ namespace mob::tasks {
void do_build_and_install() override;
};

// needed by python
//
class libffi : public basic_task<libffi> {
public:
libffi();

static std::string version();
static bool prebuilt();

static fs::path source_path();
static fs::path include_path();
static fs::path lib_path();

protected:
void do_clean(clean c) override;
void do_fetch() override;
};

class libloot : public basic_task<libloot> {
public:
libloot();
Expand Down Expand Up @@ -462,6 +444,7 @@ namespace mob::tasks {
void build_and_install_prebuilt();
void build_and_install_from_source();

void prepare_dependencies();
void package();
void install_pip();
void copy_files();
Expand Down

0 comments on commit b7d7166

Please sign in to comment.