mirror of
https://github.com/ModOrganizer2/mob.git
synced 2026-07-27 14:07:05 -07:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4db6ff40f1 | ||
|
|
b0d26f30a9 | ||
|
|
13b76ecfa5 | ||
|
|
b7d716651b | ||
|
|
a7ee59c7bd |
@@ -10,8 +10,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Check format
|
||||
uses: ModOrganizer2/check-formatting-action@master
|
||||
- name: Run clang-format
|
||||
uses: jidicula/clang-format-action@v4.11.0
|
||||
with:
|
||||
clang-format-version: "16"
|
||||
check-path: "."
|
||||
exclude-regex: "third-party"
|
||||
|
||||
@@ -89,6 +89,7 @@ lz4 = true
|
||||
openssl = true
|
||||
pyqt = true
|
||||
python = true
|
||||
usvfs = false
|
||||
|
||||
[versions]
|
||||
vs = 17
|
||||
@@ -116,7 +117,7 @@ qt = 6.7.0
|
||||
qt_vs = 2019
|
||||
zlib = v1.3.1
|
||||
libbsarch = 0.0.9
|
||||
usvfs = master
|
||||
usvfs = qt6
|
||||
explorerpp = 1.4.0
|
||||
|
||||
ss_paper_lad_6788 = 7.2
|
||||
|
||||
@@ -25,51 +25,26 @@
|
||||
|
||||
|
||||
## Quick start
|
||||
```powershell
|
||||
```
|
||||
> git clone https://github.com/ModOrganizer2/mob
|
||||
> cd mob
|
||||
> bootstrap
|
||||
> mob -d c:\somewhere build
|
||||
```
|
||||
|
||||
## Extended start
|
||||
|
||||
### Qt - CLI based install using [aqt](https://github.com/miurahr/aqtinstall)
|
||||
|
||||
[aqt](https://github.com/miurahr/aqtinstall) is a CLI installer for Qt, it makes installing Qt extremely quick and painless, and doesn't require a login
|
||||
|
||||
#### Installing aqt via package manager
|
||||
- Start an administrative terminal
|
||||
- Install aqt using one of the two popular packaage managers
|
||||
- `winget install --id=miurahr.aqtinstall -e`
|
||||
- `choco install aqt`
|
||||
|
||||
#### Installing aqt via python/pip
|
||||
|
||||
- Install [Python 3.9](https://www.python.org/downloads/release/python-390/)
|
||||
- Install [aqt](https://github.com/miurahr/aqtinstall) using `pip`
|
||||
|
||||
#### Using aqt
|
||||
- Open a terminal with administrative rights, and run
|
||||
```powershell
|
||||
aqt install-qt --outputdir "C:\Qt" windows desktop 6.7.0 win64_msvc2019_64 -m qtwebengine qtimageformats qtpositioning qtserialport qtwebchannel qtwebsockets
|
||||
```
|
||||
|
||||
### Qt - Manual installation
|
||||
- Install Qt 6.7.0 ([Installer](https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe)) and select these components:
|
||||
## Slow start
|
||||
- Install Qt 6.5.1 ([Installer](https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe)) and select these components:
|
||||
- MSVC 2019 64-bit
|
||||
- Additional Libraries:
|
||||
- Qt WebEngine (display nexus pages)
|
||||
- Qt Image Formats (display images in image tab and preview)
|
||||
- Qt Positioning (required by QtWebEngine)
|
||||
- Qt Serial Port (required by Qt Core)
|
||||
- Qt WebChannel (required by QtWebEngine)
|
||||
- Qt Web Channel (required by QtWebEngine)
|
||||
- Qt WebSockets (Nexus api/download)
|
||||
- Optional:
|
||||
- Qt Source Files
|
||||
- Qt Debug Files
|
||||
|
||||
### Visual Studio
|
||||
- Install Visual Studio 2022 ([Installer](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&channel=Release&version=VS2022&source=VSLandingPage&cid=2030&passive=false))
|
||||
- Desktop development with C++
|
||||
- Desktop .NET desktop development (needed by OMOD and FOMOD installers)
|
||||
@@ -81,21 +56,23 @@ aqt install-qt --outputdir "C:\Qt" windows desktop 6.7.0 win64_msvc2019_64 -m qt
|
||||
- C++ /CLI support for v143 build Tools (Latest) (for OMOD and FOMOD installers)
|
||||
- Windows 11 SDK (get latest)
|
||||
- C++ Build Tools core features
|
||||
- Git for Windows (Skip if you have this already installed outside of the VS installer)
|
||||
- CMake tools for Windows (Skip if you have this already installed outside of the VS installer)
|
||||
|
||||
## Setting up MOB
|
||||
- Open a shell. If you've installed Git or CMake through the VS installer, they won't be on your PATH, so you must use x64 Native Tools Command Prompt for VS 2022.- Pick a folder to develop MO2 in, for these steps it'll be `C:\dev`
|
||||
- Execute these commands
|
||||
```powershell
|
||||
mkdir C:\dev
|
||||
cd C:\dev
|
||||
git clone https://github.com/ModOrganizer2/mob
|
||||
./bootstrap.ps1
|
||||
mob -d C:\dev\modorganizer build
|
||||
```
|
||||
- Optional:
|
||||
- Git for Windows (if you don't have git already installed)
|
||||
- Start a shell
|
||||
- If you have git in your path, a regular cmd shell works.
|
||||
- If not, start the _x64 Native Tools Command Prompt for VS 2019_, it'll use Git for Windows installed above.
|
||||
- Do:
|
||||
```
|
||||
mkdir C:\dev
|
||||
cd C:\dev
|
||||
git clone https://github.com/ModOrganizer2/mob
|
||||
cd mob
|
||||
bootstrap
|
||||
mob -d C:\dev\modorganizer build
|
||||
```
|
||||
- Once `mob` is finished, everything will be in `C:\dev\modorganizer`. Mod Organizer can be run from `install\bin\ModOrganizer.exe`. The Visual Studio solution for Mod Organizer itself is `build\modorganizer_super\modorganizer\vsbuild\organizer.sln`.
|
||||
|
||||
|
||||
### Prebuilts
|
||||
Some third-parties are not normally built from source, but this can be changed in the options by setting the various tasks in `[prebuilt]` to `false`. If OpenSSL is built from source, perl is required ([Strawberry Perl 5.30.2.1 installer](http://strawberryperl.com/download/5.30.2.1/strawberry-perl-5.30.2.1-64bit.msi)).
|
||||
|
||||
|
||||
+2
-2
@@ -116,8 +116,8 @@ namespace mob {
|
||||
if (!task)
|
||||
return 1;
|
||||
|
||||
u8cout << "checking out pr " << pr.number << " "
|
||||
<< "in " << task->name() << "\n";
|
||||
u8cout << "checking out pr " << pr.number << " " << "in "
|
||||
<< task->name() << "\n";
|
||||
|
||||
git_wrap g(task->source_path());
|
||||
|
||||
|
||||
@@ -646,10 +646,21 @@ namespace mob::tasks {
|
||||
void do_build_and_install() override;
|
||||
|
||||
private:
|
||||
void fetch_prebuilt();
|
||||
void fetch_from_source();
|
||||
void build_and_install_prebuilt();
|
||||
void build_and_install_from_source();
|
||||
|
||||
void download_from_appveyor(arch a);
|
||||
void copy_prebuilt(arch a);
|
||||
|
||||
msbuild create_msbuild_tool(arch a, msbuild::ops o = msbuild::build) const;
|
||||
|
||||
std::vector<std::shared_ptr<downloader>>
|
||||
create_appveyor_downloaders(arch a,
|
||||
downloader::ops o = downloader::download) const;
|
||||
|
||||
std::string prebuilt_directory_name(arch a) const;
|
||||
};
|
||||
|
||||
class zlib : public basic_task<zlib> {
|
||||
|
||||
+146
-12
@@ -22,7 +22,7 @@ namespace mob::tasks {
|
||||
|
||||
bool usvfs::prebuilt()
|
||||
{
|
||||
return false;
|
||||
return conf().prebuilt().get<bool>("usvfs");
|
||||
}
|
||||
|
||||
fs::path usvfs::source_path()
|
||||
@@ -32,29 +32,68 @@ namespace mob::tasks {
|
||||
|
||||
void usvfs::do_clean(clean c)
|
||||
{
|
||||
// delete the whole directory
|
||||
if (is_set(c, clean::reclone)) {
|
||||
git_wrap::delete_directory(cx(), source_path());
|
||||
if (prebuilt()) {
|
||||
if (is_set(c, clean::redownload)) {
|
||||
// the `downloader` class knows how to delete its own files, so
|
||||
// create the same downloaders and ask them to clean
|
||||
|
||||
// nothing more to do
|
||||
return;
|
||||
const auto x86_dls =
|
||||
create_appveyor_downloaders(arch::x86, downloader::clean);
|
||||
|
||||
const auto x64_dls =
|
||||
create_appveyor_downloaders(arch::x64, downloader::clean);
|
||||
|
||||
for (auto dl : x86_dls)
|
||||
run_tool(*dl);
|
||||
|
||||
for (auto dl : x64_dls)
|
||||
run_tool(*dl);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// delete the whole directory
|
||||
if (is_set(c, clean::reclone)) {
|
||||
git_wrap::delete_directory(cx(), source_path());
|
||||
|
||||
if (is_set(c, clean::rebuild)) {
|
||||
// msbuild clean
|
||||
run_tool(create_msbuild_tool(arch::x86, msbuild::clean));
|
||||
run_tool(create_msbuild_tool(arch::x64, msbuild::clean));
|
||||
// nothing more to do
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_set(c, clean::rebuild)) {
|
||||
// msbuild clean
|
||||
run_tool(create_msbuild_tool(arch::x86, msbuild::clean));
|
||||
run_tool(create_msbuild_tool(arch::x64, msbuild::clean));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void usvfs::do_fetch()
|
||||
{
|
||||
fetch_from_source();
|
||||
if (prebuilt())
|
||||
fetch_prebuilt();
|
||||
else
|
||||
fetch_from_source();
|
||||
}
|
||||
|
||||
void usvfs::do_build_and_install()
|
||||
{
|
||||
build_and_install_from_source();
|
||||
if (prebuilt())
|
||||
build_and_install_prebuilt();
|
||||
else
|
||||
build_and_install_from_source();
|
||||
}
|
||||
|
||||
void usvfs::fetch_prebuilt()
|
||||
{
|
||||
fetch_from_source();
|
||||
download_from_appveyor(arch::x64);
|
||||
download_from_appveyor(arch::x86);
|
||||
}
|
||||
|
||||
void usvfs::build_and_install_prebuilt()
|
||||
{
|
||||
copy_prebuilt(arch::x86);
|
||||
copy_prebuilt(arch::x64);
|
||||
}
|
||||
|
||||
void usvfs::fetch_from_source()
|
||||
@@ -71,6 +110,41 @@ namespace mob::tasks {
|
||||
run_tool(create_msbuild_tool(arch::x64));
|
||||
}
|
||||
|
||||
void usvfs::download_from_appveyor(arch a)
|
||||
{
|
||||
// create all downloaders, run them in parallel
|
||||
|
||||
parallel_functions v;
|
||||
|
||||
for (auto dl : create_appveyor_downloaders(a))
|
||||
v.emplace_back("usvfs", [this, dl] {
|
||||
run_tool(*dl);
|
||||
});
|
||||
|
||||
parallel(v);
|
||||
}
|
||||
|
||||
void usvfs::copy_prebuilt(arch a)
|
||||
{
|
||||
const auto path = conf().path();
|
||||
const auto src = path.build() / prebuilt_directory_name(a);
|
||||
|
||||
// dlls and exes to install/bin/
|
||||
op::copy_glob_to_dir_if_better(cx(), src / "*.dll", path.install_bin(),
|
||||
op::copy_files);
|
||||
|
||||
op::copy_glob_to_dir_if_better(cx(), src / "*.exe", path.install_bin(),
|
||||
op::copy_files);
|
||||
|
||||
// pdbs
|
||||
op::copy_glob_to_dir_if_better(cx(), src / "*.pdb", path.install_pdbs(),
|
||||
op::copy_files);
|
||||
|
||||
// libs
|
||||
op::copy_glob_to_dir_if_better(cx(), src / "*.lib", path.install_libs(),
|
||||
op::copy_files);
|
||||
}
|
||||
|
||||
msbuild usvfs::create_msbuild_tool(arch a, msbuild::ops o) const
|
||||
{
|
||||
// usvfs doesn't use "Win32" for 32-bit, it uses "x86"
|
||||
@@ -97,4 +171,64 @@ namespace mob::tasks {
|
||||
.set("BOOST_PATH", path_to_utf8(boost::source_path()))));
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<downloader>>
|
||||
usvfs::create_appveyor_downloaders(arch a, downloader::ops o) const
|
||||
{
|
||||
std::string arch_s;
|
||||
|
||||
switch (a) {
|
||||
case arch::x86:
|
||||
arch_s = "x86";
|
||||
break;
|
||||
|
||||
case arch::x64:
|
||||
arch_s = "x64";
|
||||
break;
|
||||
|
||||
case arch::dont_care:
|
||||
default:
|
||||
cx().bail_out(context::generic, "bad arch");
|
||||
}
|
||||
|
||||
// returns an appveyor downloader for the given filename that outputs into
|
||||
// build/usvfs_bin[_32]/
|
||||
auto make_dl = [&](std::string filename) {
|
||||
const auto u = make_appveyor_artifact_url(a, "usvfs", filename);
|
||||
const std::string dir = prebuilt_directory_name(a);
|
||||
|
||||
auto dl = std::make_shared<downloader>(o);
|
||||
|
||||
dl->url(u);
|
||||
dl->file(conf().path().build() / dir / u.filename());
|
||||
|
||||
return dl;
|
||||
};
|
||||
|
||||
std::vector<std::shared_ptr<downloader>> v;
|
||||
|
||||
// five downloaders for the pdbs, dlls, libs and exes
|
||||
v.push_back(make_dl("lib/usvfs_" + arch_s + ".pdb"));
|
||||
v.push_back(make_dl("lib/usvfs_" + arch_s + ".dll"));
|
||||
v.push_back(make_dl("lib/usvfs_" + arch_s + ".lib"));
|
||||
v.push_back(make_dl("bin/usvfs_proxy_" + arch_s + ".exe"));
|
||||
v.push_back(make_dl("bin/usvfs_proxy_" + arch_s + ".pdb"));
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
std::string usvfs::prebuilt_directory_name(arch a) const
|
||||
{
|
||||
switch (a) {
|
||||
case arch::x86:
|
||||
return "usvfs_bin_32";
|
||||
|
||||
case arch::x64:
|
||||
return "usvfs_bin";
|
||||
|
||||
case arch::dont_care:
|
||||
default:
|
||||
cx().bail_out(context::generic, "bad arch");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mob::tasks
|
||||
|
||||
Reference in New Issue
Block a user