Skip to content

Commit

Permalink
Merge pull request #819 from qw-ctf/vcpkg
Browse files Browse the repository at this point in the history
BUILD: Vcpkg instead of vendored binary blobs in the repo.
  • Loading branch information
tcsabina authored Sep 18, 2023
2 parents 2ad44c2 + 368b6a5 commit c24e00c
Show file tree
Hide file tree
Showing 473 changed files with 150 additions and 261,371 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build-and-deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ jobs:
- target: windows-multi-x64
config: rls-all
platform: x64
triplet: x64-windows-static

steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: true

- name: Setup vcpkg (it does not install any package yet)
uses: lukka/run-vcpkg@v11

- name: Add msbuild to PATH
uses: microsoft/[email protected]

Expand All @@ -34,7 +38,10 @@ jobs:
run: cp misc\vstudio\txt2c\.vs\txt2c.exe .vs\

- name: Build ezquake
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }}
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }} -property:VcpkgEnableManifest=true
env:
VcpkgConfiguration: Release
VcpkgTriplet: ${{ matrix.triplet }}

- name: Create checksum
run: |
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-and-deploy-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ jobs:
- target: windows-multi-x64
config: rls-all
platform: x64
triplet: x64-windows-static

steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: true

- name: Setup vcpkg (it does not install any package yet)
uses: lukka/run-vcpkg@v11

- name: Add msbuild to PATH
uses: microsoft/[email protected]

Expand All @@ -32,7 +36,10 @@ jobs:
run: cp misc\vstudio\txt2c\.vs\txt2c.exe .vs\

- name: Build ezquake
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }}
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }} -property:VcpkgEnableManifest=true
env:
VcpkgConfiguration: Release
VcpkgTriplet: ${{ matrix.triplet }}

- name: Create checksum
run: |
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ jobs:
- target: windows-multi-x64
config: rls-all
platform: x64
triplet: x64-windows-static

steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: true

- name: Setup vcpkg (it does not install any package yet)
uses: lukka/run-vcpkg@v11

- name: Add msbuild to PATH
uses: microsoft/[email protected]

Expand All @@ -32,7 +36,10 @@ jobs:
run: cp misc\vstudio\txt2c\.vs\txt2c.exe .vs\

- name: Build ezquake
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }}
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }} -property:VcpkgEnableManifest=true
env:
VcpkgConfiguration: Release
VcpkgTriplet: ${{ matrix.triplet }}

- name: Archive client
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scripts/homebrew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies=(
libpng
jpeg-turbo
libmodplug
minizip
mpg123
speex
speexdsp
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ ezQuake.aps
SysPrintf.log
.ezquake/
.vs
*.json.c
*.glsl.c
vcpkg_installed/
src/.msversion.h

!.gitignore
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = src/qwprot
url = https://github.com/QW-Group/qwprot.git
branch = master
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/Microsoft/vcpkg
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)vcpkg\scripts\buildsystems\msbuild\vcpkg.props" />
</Project>
3 changes: 3 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)vcpkg\scripts\buildsystems\msbuild\vcpkg.targets" />
</Project>
19 changes: 5 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ JANSSON_LIBS ?= $(shell pkg-config jansson --libs)
CFLAGS += $(JANSSON_CFLAGS)
LIBS_c += $(JANSSON_LIBS)

MINIZIP_CFLAGS ?= $(shell pkg-config --cflags minizip)
MINIZIP_LIBS ?= $(shell pkg-config --libs minizip)
CFLAGS_c += $(MINIZIP_CFLAGS)
LIBS_c += $(MINIZIP_LIBS)

SPEEX_LIBS ?= $(shell pkg-config speex --libs) $(shell pkg-config speexdsp --libs)
ifdef SPEEX_LIBS
CFLAGS_c += $(shell pkg-config speex --cflags) $(shell pkg-config speexdsp --cflags) -DWITH_SPEEX
Expand Down Expand Up @@ -554,27 +559,13 @@ LIBS_c += -lm
endif
endif

ifeq ($(SYS),NetBSD)
USE_SYSTEM_MINIZIP=1
endif

#ifdef CONFIG_OGG
# OGG_CFLAGS ?= $(shell pkg-config vorbisfile --cflags) -DWITH_OGG_VORBIS
# OGG_LIBS ?= $(shell pkg-config vorbisfile --libs)
# CFLAGS_c += $(OGG_CFLAGS)
# LIBS_c += $(OGG_LIBS)
#endif

ifeq ($(USE_SYSTEM_MINIZIP),1)
MINIZIP_CFLAGS ?= $(shell pkg-config --cflags minizip)
MINIZIP_LIBS ?= $(shell pkg-config --libs minizip)
CFLAGS_c += $(MINIZIP_CFLAGS)
LIBS_c += $(MINIZIP_LIBS)
else
OBJS_c += $(SRC_DIR)/minizip/ioapi.o $(SRC_DIR)/minizip/unzip.o
CFLAGS_c += -I$(SRC_DIR)/minizip
endif

### Targets ###

ifdef CONFIG_WINDOWS
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ Clone the ezQuake source code:
```
git clone --recurse-submodules https://github.com/ezQuake/ezquake-source.git ezquake
```

Initialize Vcpkg, and refresh submodules if needed:
```
bootstrap.bat
```

Load the solution into VS, and compile your preferred target.


Expand Down
2 changes: 2 additions & 0 deletions bootstrap.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git submodule update --init --recursive
vcpkg/bootstrap-vcpkg.bat -disableMetrics
8 changes: 4 additions & 4 deletions build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ NC='\e[0m'

BUILD_LOG=/tmp/ezquake-build.log

PKGS_DEB="git build-essential libsdl2-2.0-0 libsdl2-dev libjansson-dev libexpat1-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libspeex-dev libspeexdsp-dev libfreetype6-dev libsndfile1-dev libpcre3-dev"
PKGS_RPM="pcre-devel mesa-libGL-devel SDL2-devel make gcc jansson-devel expat-devel libcurl-devel libpng-devel libjpeg-turbo-devel speex-devel speexdsp-devel freetype-devel libsndfile-devel libXxf86vm-devel"
PKGS_ARCH="base-devel libpng libjpeg-turbo sdl2 expat libcurl-compat freetype2 speex speexdsp jansson libsndfile"
PKGS_VOID="base-devel SDL2-devel pcre-devel jansson-devel expat-devel libcurl-devel libpng-devel libjpeg-turbo-devel speex-devel speexdsp-devel freetype-devel libsndfile-devel libXxf86vm-devel"
PKGS_DEB="git build-essential libsdl2-2.0-0 libsdl2-dev libjansson-dev libexpat1-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libspeex-dev libspeexdsp-dev libfreetype6-dev libsndfile1-dev libpcre3-dev libminizip-dev"
PKGS_RPM="pcre-devel mesa-libGL-devel SDL2-devel make gcc jansson-devel expat-devel libcurl-devel libpng-devel libjpeg-turbo-devel speex-devel speexdsp-devel freetype-devel libsndfile-devel libXxf86vm-devel minizip-devel"
PKGS_ARCH="base-devel libpng libjpeg-turbo sdl2 expat libcurl-compat freetype2 speex speexdsp jansson libsndfile minizip"
PKGS_VOID="base-devel SDL2-devel pcre-devel jansson-devel expat-devel libcurl-devel libpng-devel libjpeg-turbo-devel speex-devel speexdsp-devel freetype-devel libsndfile-devel libXxf86vm-devel minizip"

CPU=$(uname -m | sed -e s/i.86/i386/ -e s/amd64/x86_64/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/)

Expand Down
Loading

0 comments on commit c24e00c

Please sign in to comment.