Skip to content

Commit

Permalink
Merge branch 'obsproject:master' into windows-arm64-3
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyvct committed Feb 27, 2023
2 parents 2f1e6de + 6e54f46 commit a26c964
Show file tree
Hide file tree
Showing 29 changed files with 1,043 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build-deps.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ package() {
popd
}

if [[ -d share ]] rm -rf share/^(swig)(N)
if [[ -d share ]] rm -rf share/^(swig|cmake)(N)
if [[ -d cmake ]] rm -rf cmake
if [[ -d man ]] rm -rf man
}
Expand Down
4 changes: 2 additions & 2 deletions deps.ffmpeg/80-amf.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ autoload -Uz log_debug log_error log_info log_status log_output dep_checkout

## Dependency Information
local name='amf'
local version='1.4.26'
local version='1.4.29'
local url='https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git'
local hash='5c78f194a396938ff0e72128712252151238e372'
local hash='bc64bf6e8bfca3083755b7cbec3c23d5546fb04a'

## Dependency Overrides
local targets=('windows-x*')
Expand Down
26 changes: 26 additions & 0 deletions deps.macos/80-asio.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
autoload -Uz log_debug log_error log_info log_status log_output

## Dependency Information
local name='asio'
local version='1.12.1'
local url='https://github.com/chriskohlhoff/asio.git'
local hash='b73dc1d2c0ecb9452a87c26544d7f71e24342df6'

## Build Steps
setup() {
log_info "Setup (%F{3}${target}%f)"
setup_dep ${url} ${hash}
}

install() {
autoload -Uz progress

log_info "Install (%F{3}${target}%f)"
cd "${dir}/asio"

mkdir -p ${target_config[output_dir]}/include

log_debug "Copying headers to ${target_config[output_dir]}/include"
cp -R include/(asio|asio.hpp) "${target_config[output_dir]}/include"
log_status "Copied headers to ${target_config[output_dir]}/include"
}
63 changes: 63 additions & 0 deletions deps.macos/80-nlohmann-json.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
autoload -Uz log_debug log_error log_info log_status log_output

## Dependency Information
local name='nlohmann-json'
local version='3.11.2'
local url='https://github.com/nlohmann/json.git'
local hash='bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d'

## Build Steps
setup() {
log_info "Setup (%F{3}${target}%f)"
setup_dep ${url} ${hash}
}

clean() {
cd "${dir}"

if [[ ${clean_build} -gt 0 && -d "build_${arch}" ]] {
log_info "Clean build directory (%F{3}${target}%f)"

rm -rf "build_${arch}"
}
}

config() {
autoload -Uz mkcd progress

log_info "Config (%F{3}${target}%f)"

args=(
${cmake_flags}
-DJSON_BuildTests=OFF
)

cd "${dir}"
log_debug "CMake configure options: ${args}"
progress cmake -S . -B "build_${arch}" -G Ninja ${args}
}

build() {
autoload -Uz mkcd

log_info "Build (%F{3}${target}%f)"

cd "${dir}"
cmake --build "build_${arch}" --config "${config}"
}

install() {
autoload -Uz progress

log_info "Install (%F{3}${target}%f)"

args=(
--install "build_${arch}"
--config "${config}"
)

if [[ "${config}" =~ "Release|MinSizeRel" ]] args+=(--strip)

cd "${dir}"
progress cmake ${args}
}
87 changes: 87 additions & 0 deletions deps.macos/80-websocketpp.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
autoload -Uz log_debug log_error log_info log_status log_output

## Dependency Information
local name='websocketpp'
local version='0.8.2'
local url='https://github.com/zaphoyd/websocketpp.git'
local hash='56123c87598f8b1dd471be83ca841ceae07f95ba'
local patches=(
"${0:a:h}/patches/websocketpp/0001-update-minimum-cmake.patch \
61aa39ebe761f71b05306c5a6f025207c494e07b01f29fb6d3746865e93b6d4c"
)

## Build Steps
setup() {
log_info "Setup (%F{3}${target}%f)"
setup_dep ${url} ${hash}
}

clean() {
cd "${dir}"

if [[ ${clean_build} -gt 0 && -d "build_${arch}" ]] {
log_info "Clean build directory (%F{3}${target}%f)"

rm -rf "build_${arch}"
}
}

patch() {
autoload -Uz apply_patch

log_info "Patch (%F{3}${target}%f)"
cd "${dir}"
case "${target}" {
macos-*)
local patch
for patch (${patches}) {
local _url
local _hash
read _url _hash <<< "${patch}"
apply_patch "${_url}" "${_hash}"
}
;;
}
}

config() {
autoload -Uz mkcd progress

log_info "Config (%F{3}${target}%f)"

args=(
${cmake_flags}
-DENABLE_CPP11=ON
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTS=OFF
)

cd "${dir}"
log_debug "CMake configure options: ${args}"
progress cmake -S . -B "build_${arch}" -G Ninja ${args}
}

build() {
autoload -Uz mkcd

log_info "Build (%F{3}${target}%f)"

cd "${dir}"
cmake --build "build_${arch}" --config "${config}"
}

install() {
autoload -Uz progress

log_info "Install (%F{3}${target}%f)"

args=(
--install "build_${arch}"
--config "${config}"
)

if [[ "${config}" =~ "Release|MinSizeRel" ]] args+=(--strip)

cd "${dir}"
progress cmake ${args}
}
13 changes: 13 additions & 0 deletions deps.macos/patches/websocketpp/0001-update-minimum-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9043db327..1b345c353 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@
############ Setup project and cmake
# Minimum cmake requirement. We should require a quite recent
# cmake for the dependency find macros etc. to be up to date.
-cmake_minimum_required (VERSION 2.8.8)
+cmake_minimum_required (VERSION 2.8.12)

############ Paths

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0a64421d9c2469c2c48490a032ab91d547017c9cc171f3f8070bc31888f24e03 qtbase-everywhere-src-6.3.1.tar.xz

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ad0312b8dfbbb67f729bfadbfcd47246ee4a128b717731ba158c41d01fde212f qtimageformats-everywhere-src-6.3.1.tar.xz

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7e03242aadd634ff2d9fcf08948290f03da3d9a5012369d908da89f82b1d7336 qtmultimedia-everywhere-src-6.3.1.tar.xz

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
59b77176961528cc7b0c9325134655e273aa87b4cb386c0f4683d8f2852e435a qtshadertools-everywhere-src-6.3.1.tar.xz

This file was deleted.

1 change: 1 addition & 0 deletions deps.qt/checksums/qtsvg-everywhere-src-6.3.1.tar.xz.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7b19f418e6f7b8e23344082dd04440aacf5da23c5a73980ba22ae4eba4f87df7 qtsvg-everywhere-src-6.3.1.tar.xz
1 change: 0 additions & 1 deletion deps.qt/checksums/qtsvg-everywhere-src-6.4.1.tar.xz.sha256

This file was deleted.

17 changes: 17 additions & 0 deletions deps.qt/patches/Qt6/win/0001-QTBUG-86344.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Submodule qtbase contains modified content
diff --git a/qtbase/src/widgets/styles/qwindowsstyle.cpp b/qtbase/src/widgets/styles/qwindowsstyle.cpp
index 39fabd1218..a2b4cc0ccc 100644
--- a/qtbase/src/widgets/styles/qwindowsstyle.cpp
+++ b/qtbase/src/widgets/styles/qwindowsstyle.cpp
@@ -409,7 +409,10 @@ static QScreen *screenOf(const QWidget *w)
// and account for secondary screens with differing logical DPI.
qreal QWindowsStylePrivate::nativeMetricScaleFactor(const QWidget *widget)
{
- qreal result = qreal(1) / QWindowsStylePrivate::devicePixelRatio(widget);
+ const QPlatformScreen *screen = screenOf(widget)->handle();
+ const qreal scale = screen ? (screen->logicalDpi().first / screen->logicalBaseDpi().first)
+ : QWindowsStylePrivate::appDevicePixelRatio();
+ qreal result = qreal(1) / scale;
if (QGuiApplicationPrivate::screen_list.size() > 1) {
const QScreen *primaryScreen = QGuiApplication::primaryScreen();
const QScreen *screen = screenOf(widget);
10 changes: 8 additions & 2 deletions deps.qt/qt6.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
param(
[string] $Name = 'qt6',
[string] $Version = '6.4.1',
[string] $Version = '6.3.1',
[string] $Uri = 'https://github.com/qt/qt5.git',
[string] $Hash = '19263d39aad47771e53d3cf70d286d049412f589'
[string] $Hash = 'c3d2dfa229f87374fc5919b5c44606445cf94bd8',
[array] $Patches = @(
@{
PatchFile = "${PSScriptRoot}/patches/Qt6/win/0001-QTBUG-86344.patch"
HashSum = "688E7787CEA28047DF819AA00E16A81CA3BB7E331E7620268CCD38D1D533B4ED"
}
)
)

# References:
Expand Down
4 changes: 2 additions & 2 deletions deps.qt/qt6.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ autoload -Uz log_debug log_error log_info log_status log_output

## Dependency Information
local name='qt6'
local version=6.4.1
local url='https://download.qt.io/official_releases/qt/6.4/6.4.1'
local version=6.3.1
local url='https://download.qt.io/official_releases/qt/6.3/6.3.1'
local hash="${0:a:h}/checksums"
local -a patches=()

Expand Down
37 changes: 37 additions & 0 deletions deps.windows/60-asio.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
param(
[string] $Name = 'asio',
[string] $Version = '1.12.1',
[string] $Uri = 'https://github.com/chriskohlhoff/asio.git',
[string] $Hash = "b73dc1d2c0ecb9452a87c26544d7f71e24342df6"
)

function Setup {
Setup-Dependency -Uri $Uri -Hash $Hash -DestinationPath $Path
}

function Install {
Log-Information "Install (${Target})"
Set-Location "$Path/asio"

New-Item -Path "$($ConfigData.OutputPath)/include" -ItemType Directory -Force *> $null

$Items = @(
@{
Path = "include/asio.hpp"
Destination = "$($ConfigData.OutputPath)/include"
ErrorAction = 'SilentlyContinue'
}
@{
Path = "include/asio"
Destination = "$($ConfigData.OutputPath)/include"
Recurse = $true
ErrorAction = 'SilentlyContinue'
}
)

$Items | ForEach-Object {
$Item = $_
Log-Output ('{0} => {1}' -f ($Item.Path -join ", "), $Item.Destination)
Copy-Item @Item
}
}
63 changes: 63 additions & 0 deletions deps.windows/60-nlohmann-json.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
param(
[string] $Name = 'nlohmann-json',
[string] $Version = '3.11.2',
[string] $Uri = 'https://github.com/nlohmann/json.git',
[string] $Hash = 'bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d'
)

function Setup {
Setup-Dependency -Uri $Uri -Hash $Hash -DestinationPath $Path
}

function Clean {
Set-Location $Path

if ( Test-Path "build_${Target}" ) {
Log-Information "Clean build directory (${Target})"
Remove-Item -Path "build_${Target}" -Recurse -Force
}
}

function Configure {
Log-Information "Configure (${Target})"
Set-Location $Path

$Options = @(
$CmakeOptions
'-DJSON_BuildTests=OFF'
)

Invoke-External cmake -S . -B "build_${Target}" @Options
}

function Build {
Log-Information "Build (${Target})"
Set-Location $Path

$Options = @(
'--build', "build_${Target}"
'--config', $Configuration
)

if ( $VerbosePreference -eq 'Continue' ) {
$Options += '--verbose'
}

Invoke-External cmake @Options
}

function Install {
Log-Information "Install (${Target})"
Set-Location $Path

$Options = @(
'--install', "build_${Target}"
'--config', $Configuration
)

if ( $Configuration -match "(Release|MinSizeRel)" ) {
$Options += '--strip'
}

Invoke-External cmake @Options
}

0 comments on commit a26c964

Please sign in to comment.