1
0
Fork 0

Simplify package listing script and standardize workflows

The commit makes the following changes:
 - The package listing script now requires the user specify which package manager
   they're using. This approach resolves the ambiguity if a system has more than
   one package manager (ie: macports & brew)

 - Adds packages for Fedora, RedHat/CentOS, Arch, and OpenSuse

 - Eliminates unecessary code in the package manager script
   (more can be eliminate at the expense of complexity)

 - Made a couple minor fixes to the build script

 - Tried to further "standardize" the workflows as follows:

     - names are Compiler Version (Environment)

     - Sorted them alphabetically in their respective YAMLs

     - Minor spacing adjustment to align values (where it makes sense)

     - Dropped quotes around some of the string values because I'd
       rather our YAML be consistent and propper instead of changing our
       YAML to suite the limitations of an editor (can a different plugin
       or better parser be used?)

     - Added macOS workflows for Homebrew and MacPorts, both ready to
       go and tested, but with the build step just commented out
This commit is contained in:
krcroft 2019-10-28 12:57:54 -07:00
parent af6557ae70
commit 85039a6033
No known key found for this signature in database
GPG key ID: 94D8F8D0D171A64B
9 changed files with 458 additions and 539 deletions

View file

@ -1,33 +1,30 @@
# DOSBox build script
# DOSBox Build Script
A helper-script that builds DOSBox with varying compilers, release types, and versions
on MacOS, Linux, and Windows.
A script that builds DOSBox with your choice of compiler, release types, and
additional optimization options on MacOS, Linux, and Windows.
A second script, **list-build-dependencies.sh** prints a list of package and library
dependencies used to build and link DOSBox, customized for your hardware, operating system,
and selected compiler and its version. You can use this script's output to install
those necessary packages.
If this is the first time you are attempting to build DOSBox, then you need to
first install the development tools and DOSBox's development packages prior to
building. To help in this regard, the **list-build-dependencies.sh** script
prints a list of packages that you can use to install these dependencies.
Use of both scripts is described below.
## Requirements
- **Windows newer than XP**
- **NTFS-based C:**, because msys2 doesn't work on FAT filesystems
- **Chocolately**, to install msys2
- **MacOS** 10.x
- **brew**, as the package manager
- **Ubuntu** 16.04 or newer
- **apt**, as the package manager
- **sudo**, to permit installation of depedencies (optional)
- **Build dependencies (all operating systems)**
- Per those listed by the accompanying list-build-dependencies.sh script
- **Fedora** up-to-date
- **RedHat or CentOS** 7 or newer
- **Arch-based distribution** up-to-date
- **OpenSUSE Leap** 15 or newer
## Windows Installation and Usage
1. Download and install Chocolatey: https://chocolatey.org/install
1. Open a console and run Cholocatey's command line interface (CLI) to install msys2:
1. Open a console and run Cholocatey's command line interface (CLI) to install msys2 and git:
`choco install msys2 git --no-progress`
```
@ -47,48 +44,82 @@ those necessary packages.
PATH environment variable does not have C:\tools\msys64 in it. Adding...
```
1. Open a new console and clone the DOSBox staging repository:
`git clone https://github.com/dreamer/dosbox-staging.git`
1. Launch a new MSYS2 terminal (not a CMD prompt or Powershell window):
1. Start Menu > Run ... `c:\tools\msys64\msys2_shell.cmd`
1. Run all subsequent steps within this terminal.
1. [optional] Install the build tools and package dependencies, if not yet done so:
``` shell
cd dosbox-staging
SET CWD=%cd%
bash -lc "pacman -S --noconfirm $($CWD/scripts/list-build-dependencies.sh)"
```
1. Clone and enter the repository's directory:
1. `git clone https://github.com/dreamer/dosbox-staging.git`
1. `cd dosbox-staging`
1. Run all subsequent steps while residing in the repo's directory.
1. (🏁 first-time-only) Install the build tools and package dependencies:
`./scripts/list-build-dependencies.sh -p msys2 | xargs pacman -S --noconfirm`
1. Launch the build script with default settings:
`./scripts/build.sh --bin-path /mingw64/bin`
1. Launch the build script with default settings:
``` shell
cd dosbox-staging
SET CWD=%cd%
bash -lc "$CWD/scripts/build.sh --bin-path /mingw64/bin --src-path $CWD"
```
## MacOS Installation and Usage
1. Download and install brew: https://brew.sh
1. Install git: `brew install git`
Builds on Mac can be performed with Clang or GCC.
If you only plan on only building with Clang, then follow the Brew installation steps.
If you're interested in building with GCC, then either Brew or MacPorts will work.
Both can be installed without conflicting with eachother.
Before installing either, the Xcode tools need to be installed and the license agreed to:
### Xcode Installation
1. Install the command line tools: `xcode-select --install`
1. Accept the license agreement: `sudo xcodebuild -license`
### Brew Installation
1. Download and install brew per the instructions here: https://brew.sh
1. Update it with: `brew update`
1. Install git with: `brew install git`
1. Install DOSBox dependencies: `brew install $(./scripts/list-build-dependencies.sh -p brew)`
### MacPorts Installation
1. Build and install MacPorts along with DOSBox dependencies with the following sequence:
``` shell
git clone --quiet --depth=1 https://github.com/macports/macports-base.git
cd macports-base
./configure
make -j"$(sysctl -n hw.physicalcpu || echo 4)"
sudo make install
PREFIX="/opt/local"
PATH="${PREFIX}/sbin:${PREFIX}/bin:${PATH}"
sudo port -q selfupdate
sudo port -q install $(/scripts/list-build-dependencies.sh -p macports)
```
### Build DOSBox (common for all of the above)
1. Clone the repository: `git clone https://github.com/dreamer/dosbox-staging.git`
1. Change directories into the repo: `cd dosbox-staging`
1. [optional] Install the build tools and package dependencies, if not yet done so:
``` shell
brew update
brew install $(./scripts/list-build-dependencies.sh)
```
1. Build DOSBox: `./scripts/build.sh`
1. Build DOSBox:
- Clang: `./scripts/build.sh --compiler clang --bin-path /usr/local/bin`
- GCC (brew): `./scripts/build.sh --compiler-version 9 --bin-path /usr/local/bin`
- GCC (macports): `./scripts/build.sh --compiler-version mp-9 --bin-path /opt/local/bin`
## Linux (Ubuntu/Debian-based) Installation and Usage
## Linux Installation
1. (🏁 first-time-only) Install dependencies based on your package manager; apt in this example:
`sudo apt install -y $(./scripts/list-build-dependencies.sh -p apt)`
For other supported package managers, run:
`./scripts/list-build-dependencies.sh --help`
1. Install git: `sudo apt install -y git`
1. Clone the repository: `git clone https://github.com/dreamer/dosbox-staging.git`
1. Change directories into the repo: `cd dosbox-staging`
1. [optional] Install the build tools and package dependencies, if not yet done so:
``` shell
sudo apt update -y
sudo apt install -y $(./scripts/list-build-dependencies.sh)
```
1. Build DOSBox: `./scripts/build.sh`
## Additional Tips
The compiler, version, and bit-depth can be selected by passing the following common
@ -97,7 +128,7 @@ options to the **list-build-dependencies.sh** and **build.sh** scripts:
* `--compiler-version 8`, to use a specific version of compiler (if available in your package manager)
* `--bit-depth 32`, to build a 32-bit binary instead of 64-bit
After building, your binary will reside inside the src/ directory.
After building, your `dosbox` or `dosbox.exe` binary will reside inside `./dosbox-staging/src/`.
Build flags you might be interested in:
* `--release debug`, to build a binary containing debug symbols (instead of **fast** or **small**)
@ -107,4 +138,3 @@ The above flags are othogonal and thus can be mixed-and-matched as desired.
If you want to run multiple back-to-back builds from the same directory with different settings then
add the `--clean` flag to ensure previous objects and binaries are removed.