Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit b24dd11
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 11:36:05 2023 -0500

    Remove duplicate sndfile.dll

commit bbb1c70
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 11:31:52 2023 -0500

    Try to fix sndfile copy

commit a2edaa4
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 11:28:36 2023 -0500

    Try to fix folder creation

commit eff07d7
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 11:27:13 2023 -0500

    Copy sndfile to package

commit b830dba
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 11:22:30 2023 -0500

    Download metahook

commit 595b33e
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 10:59:12 2023 -0500

    Try to copy only metaaudio.dll

commit c8b0780
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 08:30:40 2023 -0500

    Updated sndfile

commit bf04c37
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 08:22:57 2023 -0500

    Fix upload path

commit be62f27
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 08:11:41 2023 -0500

    Upload artifact

commit 40da0c6
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 08:07:00 2023 -0500

    Move OpenAL SDK to externals

commit 632da1a
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 08:06:09 2023 -0500

    Set OpenAL and sndfile libraries the cmake file

commit e859c7e
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 07:58:23 2023 -0500

    Do not use temp dir for OpenAL

commit aa6993a
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 07:53:34 2023 -0500

    Rename branches.tml to build.yml

commit 7dca180
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 07:51:43 2023 -0500

    Do not create release for other branches

commit 6111940
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 07:45:06 2023 -0500

    Remove unavailable metahook target

commit b372f45
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 07:41:02 2023 -0500

    Checkout and fetch submodules

commit 0712060
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 07:37:49 2023 -0500

    Jsut to test it out

commit a71c738
Author: LAGonauta <lagonauta@gmail.com>
Date:   Sun Nov 19 07:36:36 2023 -0500

    Initial github action based on MetaHookSv
  • Loading branch information
LAGonauta committed Nov 19, 2023
1 parent 605ecee commit 84f76ef
Show file tree
Hide file tree
Showing 41 changed files with 266 additions and 4,131 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: windows

on: push

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

jobs:
build:

runs-on: windows-2019
if: github.repository == 'LAGonauta/MetaAudio'

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Init dependencies
working-directory: ${{env.GITHUB_WORKSPACE}}
run: build-initdeps.bat
shell: cmd

- name: Build MetaAudio.dll
working-directory: ${{env.GITHUB_WORKSPACE}}
run: build-MetaAudio.bat
shell: cmd

- name: Create Output directory
working-directory: ${{env.GITHUB_WORKSPACE}}
run: mkdir Output
shell: cmd

- name: Copy Build to Output
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
mkdir "Output\${{env.BUILD_CONFIGURATION}}"
xcopy "Build\${{env.BUILD_CONFIGURATION}}\MetaAudio.dll" "Output\${{env.BUILD_CONFIGURATION}}" /y /e
shell: cmd

- name: Copy SteamAppsLocation to Output
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
mkdir "Output\SteamAppsLocation"
copy "SteamAppsLocation\SteamAppsLocation.exe" "Output\SteamAppsLocation" /y
copy "SteamAppsLocation\steam_appid.txt" "Output\SteamAppsLocation" /y
copy "SteamAppsLocation\steam_api.dll" "Output\SteamAppsLocation" /y
shell: cmd

- name: Copy sndfile to Output
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
xcopy "externals\libsndfile\lib\sndfile.dll" "Output\externals\libsndfile\lib\" /y /e
shell: cmd

- name: Copy install bat to Output
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
copy "install-to-OpposingForce.bat" "Output" /y
copy "install-to-HalfLife.bat" "Output" /y
copy "install-to-DayOfDefeat.bat" "Output" /y
copy "install-to-CSCZDeletedScenes.bat" "Output" /y
copy "install-to-CounterStrike.bat" "Output" /y
copy "install-to-ConditionZero.bat" "Output" /y
copy "install-to-BlueShift.bat" "Output" /y
shell: cmd

- name: Download MetaHook
run: |
Invoke-WebRequest -Uri https://github.com/hzqst/MetaHookSv/releases/download/v20231119b/MetaHookSv-windows-x86.zip -OutFile MetaHook.zip
if (!(Get-FileHash ./MetaHook.zip).Hash.Equals("BEC1D222274B43B2A2F1E2BFA619BE59A3361F8C0AB1FEA08A375ECC6FBB4ED4")) {
Exit -1
}
Expand-Archive ./MetaHook.zip -DestinationPath MetaHook/
New-Item -Type dir -Force ./Output/${{env.BUILD_CONFIGURATION}}
Copy-Item ./MetaHook/Build/svencoop.exe ./Output/${{env.BUILD_CONFIGURATION}}/metahook.exe
shell: pwsh

- uses: actions/upload-artifact@v3
with:
name: MetaAudio
path: Output/
108 changes: 108 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: windows

on:
push:
tags:
- "v*"
pull_request:
tags:
- "v*"

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

jobs:
build:

runs-on: windows-2019
if: github.repository == 'LAGonauta/MetaAudio'

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Init dependencies
working-directory: ${{env.GITHUB_WORKSPACE}}
run: build-initdeps.bat
shell: cmd

- name: Build MetaAudio.dll
working-directory: ${{env.GITHUB_WORKSPACE}}
run: build-MetaAudio.bat
shell: cmd

- name: Create Output directory
working-directory: ${{env.GITHUB_WORKSPACE}}
run: mkdir Output
shell: cmd

- name: Copy Build to Output
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
mkdir "Output\${{env.BUILD_CONFIGURATION}}"
xcopy "Build\${{env.BUILD_CONFIGURATION}}\MetaAudio.dll" "Output\${{env.BUILD_CONFIGURATION}}" /y /e
shell: cmd

- name: Copy SteamAppsLocation to Output
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
mkdir "Output\SteamAppsLocation"
copy "SteamAppsLocation\SteamAppsLocation.exe" "Output\SteamAppsLocation" /y
copy "SteamAppsLocation\steam_appid.txt" "Output\SteamAppsLocation" /y
copy "SteamAppsLocation\steam_api.dll" "Output\SteamAppsLocation" /y
shell: cmd

- name: Copy sndfile to Output
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
xcopy "externals\libsndfile\lib\sndfile.dll" "Output\externals\libsndfile\lib\" /y /e
shell: cmd

- name: Copy install bat to Output
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
copy "install-to-OpposingForce.bat" "Output" /y
copy "install-to-HalfLife.bat" "Output" /y
copy "install-to-DayOfDefeat.bat" "Output" /y
copy "install-to-CSCZDeletedScenes.bat" "Output" /y
copy "install-to-CounterStrike.bat" "Output" /y
copy "install-to-ConditionZero.bat" "Output" /y
copy "install-to-BlueShift.bat" "Output" /y
shell: cmd

- name: Download MetaHook
run: |
Invoke-WebRequest -Uri https://github.com/hzqst/MetaHookSv/releases/download/v20231119b/MetaHookSv-windows-x86.zip -OutFile MetaHook.zip
if (!(Get-FileHash ./MetaHook.zip).Hash.Equals("BEC1D222274B43B2A2F1E2BFA619BE59A3361F8C0AB1FEA08A375ECC6FBB4ED4")) {
Exit -1
}
Expand-Archive ./MetaHook.zip -DestinationPath MetaHook/
New-Item -Type dir -Force ./Output/${{env.BUILD_CONFIGURATION}}
Copy-Item ./MetaHook/Build/svencoop.exe ./Output/${{env.BUILD_CONFIGURATION}}/metahook.exe
shell: pwsh

- name: Zipping All
uses: vimtor/action-zip@v1.1
with:
files: Output/
dest: MetaAudio-windows-x86.zip

- uses: actions/upload-artifact@v3
with:
name: MetaAudio
path: MetaAudio-windows-x86.zip

- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: MetaAudio-${{ github.ref }}
files: |
MetaAudio-windows-x86.zip
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 3.27)

project(MetaAudio)

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

set(OPENAL_LIBRARY ${PROJECT_SOURCE_DIR}/externals/OpenAL-SDK/libs/Win32/OpenAL32.lib)
set(OPENAL_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/externals/OpenAL-SDK/include)

set(SNDFILE_LIBRARY ${PROJECT_SOURCE_DIR}/externals/libsndfile/lib/sndfile.lib)
set(SNDFILE_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/externals/libsndfile/include)

# Configure Alure2 the way we need it
option(METAAUDIO_STATIC_ALURE "Link Alure2 statically" ON)
if(METAAUDIO_STATIC_ALURE)
Expand Down Expand Up @@ -65,7 +71,6 @@ target_include_directories(MetaAudio
${PROJECT_SOURCE_DIR}/externals/picojson
${PROJECT_SOURCE_DIR}/externals/steamaudio/include
${PROJECT_SOURCE_DIR}/externals/alure/include/AL
${PROJECT_SOURCE_DIR}/externals/openal-soft/include/AL
${PROJECT_SOURCE_DIR}/externals/MetaHookSv
${PROJECT_SOURCE_DIR}/externals/MetaHookSv/Interface
${PROJECT_SOURCE_DIR}/externals/MetaHookSv/HLSDK/common
Expand Down
2 changes: 1 addition & 1 deletion SteamAppsLocation/steam_appid.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
225840
70
11 changes: 2 additions & 9 deletions build-MetaAudio.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
mkdir "%temp%\OpenAL-SDK"

xcopy "%~dp0OpenAL-SDK\" "%temp%\OpenAL-SDK\" /y /e

call cmake -B "build" -A Win32 -D "OPENAL_INCLUDE_DIR=%temp%\OpenAL-SDK\include" -D "OPENAL_LIBRARY=%temp%\OpenAL-SDK\libs\Win32\OpenAL32.lib" -D "SNDFILE_LIBRARY=%~dp0externals/libsndfile/lib/sndfile.lib" -D "SNDFILE_INCLUDE_DIR=%~dp0externals/libsndfile/include"
call cmake -B "build" -A Win32

call powershell -Command "(gc build\MetaAudio.vcxproj) -replace 'Label=\"PropertySheets\">', 'Label=\"PropertySheets\" ><Import Project=\"..\global.props\" /><Import Project=\"..\MetaAudio.props\" />' | Out-File build\MetaAudio.vcxproj"

Expand All @@ -15,7 +11,4 @@ if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
"%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x86

MSBuild.exe "build\MetaAudio.sln" /t:MetaAudio /p:Configuration=Release /p:Platform="Win32"
MSBuild.exe "build\MetaAudio.sln" /t:metahook /p:Configuration=Release /p:Platform="Win32"
)

rmdir /s /q "%temp%\OpenAL-SDK"
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 11 additions & 3 deletions externals/libsndfile/cmake/SndFileConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(SndFile_VERSION 1.2.0)
set(SndFile_VERSION 1.2.2)
set(SndFile_VERSION_MAJOR 1)
set(SndFile_VERSION_MINOR 2)
set(SndFile_VERSION_PATCH 0)
set(SndFile_VERSION_PATCH 2)

set (SndFile_WITH_EXTERNAL_LIBS 1)
set (SndFile_WITH_MPEG 1)
Expand Down Expand Up @@ -34,6 +34,10 @@ endmacro()

include (CMakeFindDependencyMacro)

if (NOT TRUE)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
endif ()

if (SndFile_WITH_EXTERNAL_LIBS AND NOT TRUE)
find_dependency (Ogg 1.3)
find_dependency (Vorbis)
Expand All @@ -43,7 +47,11 @@ endif ()

if (SndFile_WITH_MPEG AND NOT TRUE)
find_dependency (mp3lame)
find_dependency (MPG123)
find_dependency (mpg123)
endif ()

if (NOT TRUE)
list (REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
endif ()

include (${CMAKE_CURRENT_LIST_DIR}/SndFileTargets.cmake)
Expand Down
11 changes: 3 additions & 8 deletions externals/libsndfile/cmake/SndFileConfigVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
# The variable CVF_VERSION must be set before calling configure_file().


set(PACKAGE_VERSION "1.2.0")
set(PACKAGE_VERSION "1.2.2")

if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()

if("1.2.0" MATCHES "^([0-9]+)\\.")
if("1.2.2" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
endif()
else()
set(CVF_VERSION_MAJOR "1.2.0")
set(CVF_VERSION_MAJOR "1.2.2")
endif()

if(PACKAGE_FIND_VERSION_RANGE)
Expand Down Expand Up @@ -52,11 +52,6 @@ else()
endif()


# if the installed project requested no architecture check, don't perform the check
if("FALSE")
return()
endif()

# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "4" STREQUAL "")
return()
Expand Down
2 changes: 1 addition & 1 deletion externals/libsndfile/cmake/SndFileTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.8.3...3.22)
cmake_policy(VERSION 2.8.3...3.24)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
Expand Down
32 changes: 31 additions & 1 deletion externals/libsndfile/include/sndfile.hh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ class SndfileHandle
SndfileHandle (const SndfileHandle &orig) ;
SndfileHandle & operator = (const SndfileHandle &rhs) ;

#if (__cplusplus >= 201100L)
SndfileHandle (SndfileHandle &&orig) noexcept ;
SndfileHandle & operator = (SndfileHandle &&rhs) noexcept ;
#endif

/* Mainly for debugging/testing. */
int refCount (void) const { return (p == SF_NULL) ? 0 : p->ref ; }

Expand Down Expand Up @@ -288,7 +293,32 @@ SndfileHandle::operator = (const SndfileHandle &rhs)
++ p->ref ;

return *this ;
} /* SndfileHandle assignment operator */
} /* SndfileHandle copy assignment */

#if (__cplusplus >= 201100L)

inline
SndfileHandle::SndfileHandle (SndfileHandle &&orig) noexcept
: p (orig.p)
{
orig.p = SF_NULL ;
} /* SndfileHandle move constructor */

inline SndfileHandle &
SndfileHandle::operator = (SndfileHandle &&rhs) noexcept
{
if (&rhs == this)
return *this ;
if (p != SF_NULL && -- p->ref == 0)
delete p ;

p = rhs.p ;
rhs.p = SF_NULL ;

return *this ;
} /* SndfileHandle move assignment */

#endif

inline int
SndfileHandle::error (void) const
Expand Down
Binary file added externals/libsndfile/lib/sndfile.dll
Binary file not shown.
Binary file modified externals/libsndfile/lib/sndfile.lib
Binary file not shown.
Loading

0 comments on commit 84f76ef

Please sign in to comment.