Skip to content

Commit

Permalink
Homebrew Troubleshooting - 0.8.x (#824)
Browse files Browse the repository at this point in the history
* Add Brewfile; add a few entries to .gitignore

* Add .github/dependabot.yml and script/bootstrap-on-macos.sh; update Brewfile and .github/workflows/macos-ci.yml

* Slight adjustment to macos-ci.yml

* ...

* ...

* Add Brewfile.lock.json, among other things

* Add brew update back in

* Omit Brewfile.lock.json

* gl_init.cpp: Check for macOS by checking whether __APPLE__ and __MACH__ are defined, rather than __MACOSX__

* 22 files: Check for macOS by checking whether __APPLE__ and __MACH__ are defined, rather than MACOSX

* Trying yet another approach

* bootstrap-on-macos.sh: ...

* bootstrap-on-macos.sh: ...

* bootstrap-on-macos.sh, macos-ci.yml: Add "[email protected]" to the to-install list, alongside "[email protected]". Clean up commented-out code
  • Loading branch information
stephengtuggy authored Apr 21, 2024
1 parent ff497c6 commit 0f09688
Show file tree
Hide file tree
Showing 28 changed files with 314 additions and 309 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
allow:
# Allow both direct and indirect updates for all packages
- dependency-type: "all"
60 changes: 3 additions & 57 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,9 @@ jobs:
- macos-12
python-version:
- 3.12
homebrew-gl:
- true
homebrew-al:
- true
- false

env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_UPGRADE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_VERBOSE: 1
PYTHON_VERSION_STRING: "python@${{ matrix.python-version }}"

steps:
Expand All @@ -42,55 +35,8 @@ jobs:
fetch-depth: 2
submodules: false

# The following dependencies are already present within macos-* images:
# - clang (llvm)
# - cmake
# - expat
# - gcc
# - git
# - jpeg
# - libpng
# - libvorbis
# - python
#
# Note, though, that the Python version "varies between runners and can be changed unexpectedly",
# according to https://github.com/actions/setup-python#basic-usage .
# Hence the need to specify a particular Python version.
#- name: Set up Python
# uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 #v4.7.1
# with:
# python-version: ${{ matrix.python-version }}
# check-latest: true

- name: Install dependencies using homebrew
run: |
brew update
. ./script/brew-install-for-cmake.sh openssl@3 0
. ./script/brew-install-for-cmake.sh $PYTHON_VERSION_STRING 0
. ./script/brew-install-for-cmake.sh boost 0
. ./script/brew-install-for-cmake.sh boost-python3 0
. ./script/brew-install-for-cmake.sh gtk+3 1
. ./script/brew-install-for-cmake.sh gtkglext 1
. ./script/brew-install-for-cmake.sh sdl12-compat 1
# The following Apple-provided libraries are deprecated:
# * OpenGL as of macOS 10.14
# * GLUT as of macOS 10.9
- name: Optionally install homebrewed OpenGL and GLUT
if: ${{ matrix.homebrew-gl }}
run: |
. ./script/brew-install-for-cmake.sh mesa 1
. ./script/brew-install-for-cmake.sh mesa-glu 1
. ./script/brew-install-for-cmake.sh freeglut 1
ln -s /usr/local/include/GL /usr/local/include/OpenGL
ln -s /usr/local/include/GL /usr/local/include/GLUT
# The Apple-provided OpenAL is deprecated as of macOS 10.15
- name: Optionally install homebrewed OpenAL
if: ${{ matrix.homebrew-al }}
run: |
. ./script/brew-install-for-cmake.sh openal-soft 1
export OPENALDIR=$(brew --prefix openal-soft)
- name: Bootstrap it
run: script/bootstrap-on-macos.sh

- name: Build it
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ packages/
*.kdev4
.vs/
.vscode/
.idea/
engine/.idea/
engine/.run/
.editorconfig
**/CMakeUserPresets.json

engine/src/version.h
engine/setup/src/include/version.h
19 changes: 19 additions & 0 deletions Brewfile.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
tap "homebrew/core"
tap "homebrew/bundle"
tap "homebrew/cask"
brew "openssl@3", link: false
brew "[email protected]" force: true
brew "boost"
brew "boost-python3"
brew "gtk+3"
brew "gtkglext"
brew "sdl12-compat"
brew "mesa"
brew "mesa-glu"
brew "freeglut"
brew "openal-soft"
brew "cmake"
brew "expat"
brew "jpeg"
brew "libpng"
brew "libvorbis"
8 changes: 4 additions & 4 deletions engine/launcher/general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* copyright : (C) 2001 by David Ranger
* email : [email protected]
* copyright : (C) 2020 pyramid3d
* copyright : (C) 2020 Stephen G. Tuggy
* copyright : (C) 2020-2023 Stephen G. Tuggy
**************************************************************************/

/***************************************************************************
Expand All @@ -21,7 +21,7 @@
* This allows it to be used with other programs with minimal changes */

#include "general.h"
#if defined(__APPLE__) || defined(MACOSX)
#if defined(__APPLE__) && defined(__MACH__)
#include <sys/param.h> // For MAXPATHLEN
#endif
#ifdef __MINGW32__
Expand Down Expand Up @@ -448,7 +448,7 @@ int isdir(const char *file) {
glob_t *FindPath(char *path, int type) {
glob_t *FILES = new glob_t;
string mypath(path);
#if defined(__APPLE__) || defined(MACOSX)
#if defined(__APPLE__) && defined(__MACH__)
char thispath[MAXPATHLEN];
#else
char thispath[800000];
Expand All @@ -460,7 +460,7 @@ glob_t *FindPath(char *path, int type) {
dirent *entry;
unsigned int cur;
char *newpath = 0;
#if defined(__APPLE__) || defined(MACOSX)
#if defined(__APPLE__) && defined(__MACH__)
getcwd(thispath, MAXPATHLEN);
#else
getcwd(thispath, 790000);
Expand Down
2 changes: 1 addition & 1 deletion engine/objconv/basemaker/base_maker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <sys/stat.h> //for mkdir
#include <sys/types.h>

#if defined (__APPLE__) || defined (MACOSX)
#if defined(__APPLE__) && defined(__MACH__)
#include <GLUT/glut.h>
#include <OpenGL/glext.h>
#else
Expand Down
49 changes: 24 additions & 25 deletions engine/objconv/basemaker/sprite.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
/**
* sprite.h
*
* Copyright (C) 2001-2002 Daniel Horn
* Copyright (C) 2002-2019 pyramid3d and other Vega Strike Contributors
* Copyright (C) 2019-2022 Stephen G. Tuggy and other Vega Strike Contributors
*
* https://github.com/vegastrike/Vega-Strike-Engine-Source
*
* This file is part of Vega Strike.
*
* Vega Strike is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Vega Strike 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
*/
/*
* sprite.h
*
* Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy,
* and other Vega Strike Contributors
*
* https://github.com/vegastrike/Vega-Strike-Engine-Source
*
* This file is part of Vega Strike.
*
* Vega Strike is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Vega Strike 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef SPRITE_H
#define SPRITE_H
Expand All @@ -32,7 +31,7 @@
#include "gfx/hud.h"
#include "vs_globals.h"

#if defined (__APPLE__) || defined (MACOSX)
#if defined(__APPLE__) && defined(__MACH__)
#include <GLUT/glut.h>
#include <OpenGL/glext.h>
#else
Expand Down
13 changes: 6 additions & 7 deletions engine/src/cg_global.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/**
/*
* cg_global.h
*
* Copyright (C) Daniel Horn
* Copyright (C) 2020 pyramid3d, Stephen G. Tuggy, and other Vega Strike
* contributors
* Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy,
* and other Vega Strike contributors
*
* https://github.com/vegastrike/Vega-Strike-Engine-Source
*
Expand All @@ -16,11 +15,11 @@
*
* Vega Strike 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
*/


Expand All @@ -29,7 +28,7 @@

#if defined (CG_SUPPORT)

#if defined (__APPLE__) || defined (MACOSX)
#if defined(__APPLE__) && defined(__MACH__)
#define MACOS 1
#elif !defined (WIN32)
#define UNIX 1
Expand Down
13 changes: 6 additions & 7 deletions engine/src/cmd/ai/flykeyboard.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/**
/*
* flykeyboard.h
*
* Copyright (C) Daniel Horn
* Copyright (C) 2020 pyramid3d, Stephen G. Tuggy, and other Vega Strike
* contributors
* Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy,
* and other Vega Strike contributors
*
* https://github.com/vegastrike/Vega-Strike-Engine-Source
*
Expand All @@ -16,18 +15,18 @@
*
* Vega Strike 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
*/


#ifndef _IN_AI_H_
#define _IN_AI_H_
#include "in.h"
#if defined (__APPLE__) || defined (MACOSX)
#if defined(__APPLE__) && defined(__MACH__)
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
Expand Down
2 changes: 1 addition & 1 deletion engine/src/cmd/script/c_alike/c_alike.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <linux/slab.h>
#elif defined(HAVE_LINUX_MALLOC_H)
#include <linux/malloc.h>
#elif defined(__APPLE__) || defined(MACOSX)
#elif defined(__APPLE__) && defined(__MACH__)
#include <sys/malloc.h>
#elif defined(HAVE_MALLOC_H)
#include <malloc.h>
Expand Down
51 changes: 25 additions & 26 deletions engine/src/gfx/mesh_poly.cpp
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
/**
* mesh_poly.cpp
*
* Copyright (C) 2001-2002 Daniel Horn
* Copyright (C) 2002-2019 pyramid3d and other Vega Strike Contributors
* Copyright (C) 2019-2022 Stephen G. Tuggy and other Vega Strike Contributors
*
* https://github.com/vegastrike/Vega-Strike-Engine-Source
*
* This file is part of Vega Strike.
*
* Vega Strike is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Vega Strike 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
*/
/*
* mesh_poly.cpp
*
* Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy,
* and other Vega Strike Contributors
*
* https://github.com/vegastrike/Vega-Strike-Engine-Source
*
* This file is part of Vega Strike.
*
* Vega Strike is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Vega Strike 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>.
*/

#include "mesh.h"
#include "aux_texture.h"
#if !defined (_WIN32) && !defined (__CYGWIN__) && !(defined (__APPLE__) || defined (MACOSX ) ) && !defined (BSD) && !defined(__HAIKU__)
#if !defined (_WIN32) && !defined (__CYGWIN__) && !(defined(__APPLE__) && defined(__MACH__)) && !defined (BSD) && !defined(__HAIKU__)
#include <values.h>
#endif
#include <float.h>
Expand Down Expand Up @@ -210,7 +209,7 @@ void Mesh::GetPolys( vector< mesh_polygon > &polys )
int offset = 0;
int last = numtris;
mesh_polygon tmppolygon;
// Unroll this loop a bit to remove conditional
// Unroll this loop a bit to remove conditional
for (i = 0; i < last; i++) {
polys.push_back( tmppolygon );
for (int j = 0; j < 3; j++,polys.back().v.push_back(vv)) {
Expand Down
Loading

0 comments on commit 0f09688

Please sign in to comment.