Graham
fe2977afaf
|
5 years ago | |
---|---|---|
gl-dri-natives | 5 years ago | |
gl-natives | 5 years ago | |
misc-natives | 5 years ago | |
.gitignore | 5 years ago | |
COPYING | 5 years ago | |
COPYING.LESSER | 5 years ago | |
README.md | 5 years ago | |
aol.properties | 5 years ago | |
pom.xml | 5 years ago |
README.md
OpenRS2 Natives
Introduction
OpenRS2 Natives are open-source replacements for the jaggl, jaggl_dri and jagmisc native libraries.
Prerequisites
Building OpenRS2 Natives requires the following pieces of software on all platforms:
- Java Development Kit (version 7 or later)
- Apache Maven (version 3.3.9 or later)
Platform-specific dependencies
Your platform's standard C compiler and OpenGL development headers must be installed.
Windows
Install the Build Tools for Visual Studio (2019 or later), which provide a command-line version of the Visual C++ compiler. The full GUI version of Visual Studio will also work, but it is not required.
The Visual C++ tools must be present on your %PATH%
when building OpenRS2
Natives. The easiest way to achieve this is to open the command prompt with the
'Developer Command Prompt for VS 2019' item from the start menu.
The Java Development Kit and Apache Maven bin
directories must be manually
added to your %PATH%
variable.
Cross-compiling
To compile a 32-bit DLL on a 64-bit Windows system, open the 'x64_x86 Cross Tools Command Prompt for VS 2019' instead.
Maven's nar.javaHome
variable must point to a 32-bit JDK and nar.arch
must
be set to x86
:
-Dnar.javaHome="C:\Program Files (x86)\path\to\jdk" -Dnar.arch=x86
macOS
Run xcode-select --install
from the terminal to install the Xcode
command-line tools.
The easiest way to install the Java Development Kit and Apache Maven is with the
Homebrew package manager. After installing Homebrew, run
brew cask install java
and brew install maven
.
Cross-compiling
The last version of Java to support the 32-bit version of Mac OS X is the legacy Java 6 runtime.
Pass the following flags to Maven to compile against the 32-bit version of the legacy runtime on a 64-bit macOS system:
-Dnar.javaHome=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home -Dnar.arch=i386
UNIX
OpenRS2 Natives requires the GNU Compiler Collection and the Mesa 3D Graphics Library on UNIX-like systems (e.g. Linux).
The easiest way to install all the dependencies is with your system's package manager. For example:
- Debian-based systems:
apt install openjdk-12-jdk maven gcc libgl1-mesa-dev
- RPM-based systems:
yum install java-12-openjdk-devel maven gcc mesa-libGL-devel
- ArchLinux-based systems:
pacman -S jdk-openjdk maven gcc mesa
-headless
packages are not sufficient as the gl-natives
module is linked
with libjawt
.
Compatibility
The aol.properties
file uses the normalized os.name
property as part of the
architecture/operating system/linker key. It currently only contains properties
for Linux. While the default settings will probably work for other UNIX-like
systems, the defaults are not ideal. For example, g++
will be used as the
linker instead of gcc
, introducing a redundant dependency on libstdc++
.
Cross-compiling
To compile a 32-bit shared object on a 64-bit UNIX system, Maven's
nar.javaHome
variable must point to a 32-bit JDK and nar.arch
must be set
to i386
:
-Dnar.javaHome=/path/to/jdk -Dnar.arch=i386
Building
Run mvn verify
to build the code and package it.
License
All code and data is licensed under version 3.0 (and only version 3.0) of the
GNU Lesser General Public License. The full terms are available in the
COPYING.LESSER
file.
Copyright
Copyright (c) 2019 OpenRS2 Authors
OpenRS2 Natives is free software: you can redistribute it and/or modify it under the terms of version 3.0 of the GNU Lesser General Public License as published by the Free Software Foundation.
OpenRS2 Natives is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with OpenRS2 Natives. If not, see https://www.gnu.org/licenses/.