Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace git revision with tag #449

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,17 @@ jobs:

macos:
name: macOS ${{ matrix.arch }} ${{ matrix.build_type }}
runs-on: macos-12
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
arch: [x86_64]
runner: [macos-12, macos-14]
build_type: [Debug, Release]
include:
- runner: macos-12
arch: x86_64
- runner: macos-14
arch: arm64

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -195,6 +200,7 @@ jobs:
mv ./japp-linux-x86-Release/* japp-linux-x86.tar.gz
mv ./japp-linux-x86_64-Release/* japp-linux-x86_64.tar.gz
mv ./japp-macos-x86_64-Release/* japp-macos-x86_64.tar.gz
mv ./japp-macos-arm64-Release/* japp-macos-arm64.tar.gz

- name: Create latest build
uses: marvinpinto/action-automatic-releases@latest
Expand Down Expand Up @@ -234,6 +240,10 @@ jobs:
artifact_name: japp-macos-x86_64.tar.gz
zip: false

- artifact_dir: japp-macos-arm64-Release
artifact_name: japp-macos-arm64.tar.gz
zip: false

steps:
- uses: actions/checkout@v3
with:
Expand Down
46 changes: 35 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# ja++

ja++ modification for jedi academy - best used with [openjk](http://github.com/JACoders/OpenJK)
see [japp.jkhub.org](http://japp.jkhub.org) for more information
ja++ modification for jedi academy - best used with [openjk](https://github.com/JACoders/OpenJK)
see [japp.jkhub.org](https://japp.jkhub.org) for more information.

assets can be found here: [Razish/japp-assets](https://github.com/Razish/japp-assets)

[![build](https://github.com/Razish/japp/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/Razish/japp/releases/tag/latest)

Expand All @@ -11,35 +13,57 @@ see [japp.jkhub.org](http://japp.jkhub.org) for more information
| - | - | - | - |
| x86 | ✅ | ✅ | ❓ |
| x86_64 | ✅ | ✅ | ✅ |
| Arm (RPi) | ❌ | ✅ | ❌ |
| Apple Silicon | ❌ | | ✅ |
| armhf | ❌ | ✅ | ❌ |
| arm64 | ❌ | | ✅ |

## development requirements (general)

- Python 3.11
- [Scons](https://github.com/SCons/scons) 4.4
- zip or 7zip on your `PATH` (for packaging)

### windows

[TDM-GCC](https://jmeubank.github.io/tdm-gcc/) or MSVC (if you pass `tools=default` to scons)
[TDM-GCC](https://jmeubank.github.io/tdm-gcc/) or Visual Studio (if you pass `tools=default` to scons)

### linux (debian-based)

- `git scons gcc g++ libreadline-dev`
- [asdf-vm](https://asdf-vm.com/guide/getting-started.html) (optional, recommended)
install packages: `git scons gcc g++ libreadline-dev libglib2.0-dev libgtk2.0-dev libnotify-dev`

### asdf-vm + lua setup (optional, recommended)

install [asdf-vm](https://asdf-vm.com/guide/getting-started.html):

```sh
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
```

add the following to your shell rc (e.g. `~/.bashrc`) and restart your shell:

```sh
. "$HOME/.asdf/asdf.sh"
```

```sh
asdf plugin-add python
asdf plugin-add lua https://github.com/Stratus3D/asdf-lua.git
asdf install # install required versions
luarocks install luafilesystem
luarocks install luacheck
```

## compiling

just run `scons` or `build.sh`
just run `scons` or `build.sh` followed by `lua package.lua`

Options:
options:

- `force32` 1 to build a 32-bit binary on a 64-bit machine
- `debug` 1 to generate debug information, 2 to also optimise code
- `no_sql` 1 to disable MySQL/SQLite support
- `no_crashhandler` 1 to disable the crash handler/logger functionality

Environment Variables
environment variables:

- `NO_SSE` 1 to not generate SSE2 instructions - closer to basejka. This is used for official builds
- `MORE_WARNINGS` 1 to enable more compiler warnings
Expand All @@ -49,7 +73,7 @@ Environment Variables
- Raz0r (lead)
- AstralSerpent
- Ensiform
- EpicLoyd
- Exmirai
- Morabis
- teh

Expand Down
32 changes: 12 additions & 20 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ if bits == 32:
else:
raise RuntimeError("unexpected platform: " + target_plat)
elif bits == 64:
if platform.machine()[:3] == "arm":
if platform.machine()[:3] == "arm" or platform.machine()[:5] == "aarch":
arch = "arm64"
else:
arch = "x86_64"
Expand Down Expand Up @@ -149,9 +149,9 @@ colours["orange"] = "\033[33m" if enableColours else ""
colours["green"] = "\033[92m" if enableColours else ""
colours["end"] = "\033[0m" if enableColours else ""

env["SHCCCOMSTR"] = env["SHCXXCOMSTR"] = env["CCCOMSTR"] = env[
"CXXCOMSTR"
] = f"{colours['cyan']} compiling: {colours['white']}$SOURCE{colours['end']}"
env["SHCCCOMSTR"] = env["SHCXXCOMSTR"] = env["CCCOMSTR"] = env["CXXCOMSTR"] = (
f"{colours['cyan']} compiling: {colours['white']}$SOURCE{colours['end']}"
)
env["ARCOMSTR"] = f"{colours['orange']} archiving: {colours['white']}$TARGET{colours['end']}"
env["RANLIBCOMSTR"] = f"{colours['orange']} indexing: {colours['white']}$TARGET{colours['end']}"
env["ASCOMSTR"] = f"{colours['orange']}assembling: {colours['white']}$TARGET{colours['end']}"
Expand All @@ -173,21 +173,13 @@ def get_compiler_version():
ccversion = get_compiler_version()


# git revision
# TODO: consider tags
def get_git_revision():
cmd_status, rawrevision = run_command("git rev-parse --short HEAD")
git_revision = None if cmd_status else rawrevision

if git_revision:
cmd_status, _ = run_command("git diff-index --quiet HEAD")
if cmd_status:
git_revision += "*"

return git_revision
# git tag
def get_git_tag():
cmd_status, rawtag = run_command("git describe --tags --exclude=latest")
return None if cmd_status else rawtag


revision = get_git_revision()
git_tag = get_git_tag()


# set job/thread count
Expand Down Expand Up @@ -215,7 +207,7 @@ env.SetOption("num_jobs", GetNumCores())
# notify the user of the build configuration
if not env.GetOption("clean"):
# build tools
msg = "Building " + ((revision + " ") if revision else "")
msg = "Building " + ((git_tag + " ") if git_tag else "")
msg += (
"using "
+ str(env.GetOption("num_jobs"))
Expand Down Expand Up @@ -652,8 +644,8 @@ if debug:
"_DEBUG",
]

if revision:
env["CPPDEFINES"] += ['REVISION=\\"' + revision + '\\"']
if git_tag:
env["CPPDEFINES"] += ['GIT_TAG=\\"' + git_tag + '\\"']

# override options
if target_plat != "Linux":
Expand Down
2 changes: 1 addition & 1 deletion cgame/cg_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3294,7 +3294,7 @@ static float CG_DrawTeamOverlay(float y, qboolean right, qboolean upper) {
} else {
xx = x + w - TINYCHAR_WIDTH * cgs.widthRatioCoef;
}
for (j = 0; j <= PW_NUM_POWERUPS; j++) {
for (j = 0; j < PW_NUM_POWERUPS; j++) {
if (ci->powerups & (1 << j)) {

item = BG_FindItemForPowerup((powerup_e)j);
Expand Down
Loading
Loading