Merge pull request 'Update the windows build from sources' (#137) from arittner/documentation:fix_win_from_sources into main

Reviewed-on: #137
pull/138/head
KitaitiMakoto 2 years ago
commit f900bf3a7f

@ -19,13 +19,17 @@ Plume on Windows devices.
b. For PostgreSQL:
Download [PostgreSQL Binaries](https://www.enterprisedb.com/download-postgresql-binaries), extract to an easy place (i.e. C:\Extra\pgsql), and add the bin folder to your system path variable.
Download [PostgreSQL Binaries](https://www.enterprisedb.com/download-postgresql-binaries), extract to an easy place (i.e. `C:\Extra\pgsql`), and add the bin folder to your system path variable (which is needed to load the `libpq.dll` later on).
4. Download and install [OpenSSL](https://slproweb.com/products/Win32OpenSSL.html) (i.e. C:\Extra\ssl)
5. Create new system variable called "OPENSSL_DIR" with a value of `C:\Extra\ssl` (or wherever you installed OpenSSL **NOTE**: this is _not_ to the bin folder, it must be to root to get the bin and lib folders!)
To support the linker, add a `PQ_LIB_DIR` environment variable and point the postgres `lib`-folder to it (e.g. `C:\Extra\pgsql\lib`). Without this hint, the linker may stop with `LINK : fatal error LNK1181: cannot open input file 'libpq.lib'`
4. Download and install [OpenSSL](https://slproweb.com/products/Win32OpenSSL.html) (i.e. `C:\Extra\ssl`). If not done by installer, add the bin folder to your system path variable (plume and plm will need `libcrypto-3-x64.dll` and `libssl-3-x64.dll`)
5. Create new system variable called `OPENSSL_DIR` with a value of `C:\Extra\ssl` (or wherever you installed OpenSSL **NOTE**: this is _not_ to the bin folder, it must be to root to get the bin and lib folders!)
6. Download and install [LLVM (libclang)](http://releases.llvm.org/9.0.0/LLVM-9.0.0-win64.exe) (i.e. C:\Extra\LLVM)
7. Create new system variable called "LIBCLANG_PATH" with a value of `C:\Extra\LLVM\bin` (or wherever you installed LLVM to)
8. Reboot your PC to continue
7. Create new system variable called `LIBCLANG_PATH` with a value of `C:\Extra\LLVM\bin` (or wherever you installed LLVM to)
8. Currently, the build process depends on few Linux commands (e.g. `xargs`, `stat`, ...). These commands are not available in a normal Windows environment. The simplest workaround is to install [Cygwin](https://www.cygwin.com/install.html) and later run the `cargo` commands from the Cygwin terminal. A minimum package is sufficient. If this is not the case, the creation process panics with `thread 'main' panicked at 'failed xargs command: Error { kind: NotFound, message: "program not found" }', build.rs...`. These dependencies may be removed in future releases to simplify the build process again.
9. The build needs [GNUgettext](https://github.com/vslavik/gettext-tools-windows/releases) to support text resources and internationalization. Download the zip file and extract it (e.g. to `C:\Extra\gnugettext`). Add the `bin`-folder to your `PATH` environment variable (e.g. `C:\Extra\gnugettext\bin`). As an alternative the `gettext` package of Cygwin can be used. However, since the goal is not to have Cygwin as a mandatory installation for the build, it is recommended to install GNUgettext as Windows binaries. If you miss GNUgettext, you will run in errors on building with `wasm-pack` (because the makros `compile_i18n!()` and `include_i18n!()` will not work)
10. Reboot your PC to continue
Now that these dependencies have been installed, we need to install Rust which has a special installer.

@ -12,6 +12,8 @@ cd Plume
Then, you'll need to install Plume and the CLI tools to manage your instance.
Run the following commands.
---
For **GNU/Linux** and **Mac OS X**:
```bash
@ -37,6 +39,8 @@ cargo install --no-default-features --features DATABASE,search-lindera --path pl
And then, you can configure Plume by `SEARCH_TAG_TOKENIZER`, `SEARCH_CONTENT_TOKENIZER` and/or `SEARCH_LANG` environment variables. See [Useful Environment Variables](../../../environment/) for details.
---
For **Windows**, if you are going to use SQLite, launch an additional cmd.exe as admin and do the following:
```
@ -51,17 +55,26 @@ lib /MACHINE:x64 /def:sqlite3.def /out:sqlite3.lib
copy C:\ProgramData\chocolatey\lib\SQLite\tools\sqlite3.lib C:\Users\%USERNAME%\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\sqlite3.lib
```
You may close that cmd.exe window and proceed with your regularly scheduled installation. Remember to replace DATABASE
You may close that cmd.exe window and proceed with your regularly scheduled installation. Remember to replace `DATABASE`
with postgres or sqlite depending on what you want to use:
```
# Install diesel_cli
cargo +stable install diesel_cli --no-default-features --features DATABASE --version '=1.3.0' --verbose
```
# Build the front-end
Currently, the installation of `wasm-pack` may fail on Windows 64bit with the latest stable version. If this problem persists, set the version to `0.9.1` (which is the easiest workaround). (see [can't install cargo wasm-pack - Stackoverflow](https://stackoverflow.com/questions/68646684/cant-install-cargo-wasm-pack)). As an alternative, you can use one of the fix-steps mentioned in the Stackoverflow solution.
```
# Install wasm-pack
cargo install wasm-pack
# if the install fails, use:
# cargo install wasm-pack --vers 0.9.1
# Build the front-end
wasm-pack build --target web --release plume-front
```
```
# If using SQLite, copy sqlite3.lib from the stable version of RustUp to the nightly that was just installed
copy C:\Users\%USERNAME%\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\sqlite3.lib C:\Users\%USERNAME%\.rustup\toolchains\nightly-2020-01-15-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\sqlite3.lib

Loading…
Cancel
Save