|
| 1 | +# Building P4Ruby from Source |
| 2 | + |
| 3 | + |
| 4 | +1. Download the Perforce C++ API from the Perforce FTP site at |
| 5 | + ftp://ftp.perforce.com/perforce. \ |
| 6 | + The API archive is located in release and platform-specific subdirectories and is named |
| 7 | + *"p4api-glibc2.3-openssl1.1.1.tgz".<br><br>* |
| 8 | + |
| 9 | + **Note: 32-bit builds of P4Ruby require a 32-bit version of the C++ API and a 32-bit version of Ruby.\ |
| 10 | + 64-bit builds of P4Ruby require a 64-bit version of the C++ API and a 64-bit version of Ruby.<br><br>** |
| 11 | + Unzip the archive into an empty directory.<br><br> |
| 12 | + |
| 13 | +2. Extract the P4Ruby API archive into a new, empty directory.<br><br> |
| 14 | + |
| 15 | +3. Execute the build commands:<br><br> |
| 16 | + |
| 17 | + *bundle install \ |
| 18 | + bundle exec rake compile -- --with-p4api_dir=<absolute path to Perforce C++ API> \ |
| 19 | + --with-ssl-dir=<absolute path to OpenSSL libraries matching Perforce C++ API><br><br>* |
| 20 | + |
| 21 | + OR pass through environment variables\ |
| 22 | + *bundle exec rake compile p4api_dir=<*absolute path to Perforce C++ API*><br><br>* |
| 23 | + |
| 24 | + **Note: If the --p4api_dir flag is not provided, P4Ruby will attempt\ |
| 25 | + to download and extract correct version of Perforce C++ API<br><br>** |
| 26 | + |
| 27 | +4. Test your distribution.<br><br> |
| 28 | + |
| 29 | + *bundle exec rake test<br><br>* |
| 30 | + |
| 31 | + Tests require the perforce server binary (p4d) present in the path.<br><br> |
| 32 | + |
| 33 | +5. Install P4Ruby into your local gem cache:<br><br> |
| 34 | + |
| 35 | + *bundle exec rake install* |
| 36 | + |
| 37 | +## SSL support |
| 38 | + |
| 39 | +Perforce Server 2012.1 and later supports SSL connections and the |
| 40 | +C++ API has been compiled with this support. |
| 41 | + |
| 42 | +If the P4Ruby build detects that OpenSSL is available, it will be |
| 43 | +included by default. If you want to use libraries deployed to nonstandard |
| 44 | +paths, use the --ssl_dir=<*path to Openssl include and lib folders*> |
0 commit comments