diff --git a/.CI/SetupHomebrewDeps.sh b/.CI/SetupHomebrewDeps.sh index ab61d01a688..632ed136e4d 100755 --- a/.CI/SetupHomebrewDeps.sh +++ b/.CI/SetupHomebrewDeps.sh @@ -73,8 +73,8 @@ do arch -x86_64 "$x86_64_homebrew_dir/bin/brew" install $(arch -x86_64 "$x86_64_homebrew_dir/bin/brew" --cache --bottle-tag=x86_64_ventura "$dep") done -echo "Relinking boost libraries" -c2-make-universal-dylib lib/libboost_random-mt.dylib +# echo "Relinking boost libraries" +# c2-make-universal-dylib lib/libboost_random-mt.dylib echo "Relinking OpenSSL 3 libcrypto" c2-make-universal-dylib lib/libcrypto.dylib diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 372b15abc1a..20e654070d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,9 +19,7 @@ env: C2_ENABLE_LTO: ${{ github.ref == 'refs/heads/chatterino7' || startsWith(github.ref, 'refs/heads/bugfix-release') || startsWith(github.ref, 'refs/heads/release/')}} CHATTERINO_REQUIRE_CLEAN_GIT: On C2_BUILD_WITH_QT6: Off - # Last known good conan version - # 2.0.3 has a bug on Windows (conan-io/conan#13606) - CONAN_VERSION: 2.4.0 + CONAN_VERSION: 2.11.0 jobs: build-ubuntu-docker: @@ -184,32 +182,32 @@ jobs: key: ${{ runner.os }}-conan-user-${{ hashFiles('**/conanfile.py') }}${{ env.C2_CONAN_CACHE_SUFFIX }} path: ~/.conan2/ - - name: Install Conan (Windows) - if: startsWith(matrix.os, 'windows') - run: | - python3 -c "import site; import sys; print(f'{site.USER_BASE}\\Python{sys.version_info.major}{sys.version_info.minor}\\Scripts')" >> "$GITHUB_PATH" - pip3 install --user "conan==${{ env.CONAN_VERSION }}" - shell: powershell + - name: Setup Python (Windows/macOS) + uses: actions/setup-python@v5 + if: startsWith(matrix.os, 'windows') || startsWith(matrix.os, 'macos') + with: + python-version: "3.13" - - name: Setup Conan (Windows) - if: startsWith(matrix.os, 'windows') + - name: Install and Setup Conan (Windows/macOS) + if: startsWith(matrix.os, 'windows') || startsWith(matrix.os, 'macos') run: | + pip install conan==${{env.CONAN_VERSION}} conan --version conan profile detect -f - shell: powershell + shell: bash - - name: Install dependencies (Windows) - if: startsWith(matrix.os, 'windows') + - name: Install dependencies (Windows/macOS) + if: startsWith(matrix.os, 'windows') || startsWith(matrix.os, 'macos') run: | mkdir build cd build - conan install .. ` - -s build_type=RelWithDebInfo ` - -c tools.cmake.cmaketoolchain:generator="NMake Makefiles" ` - -b missing ` - --output-folder=. ` - -o with_openssl3="$Env:C2_USE_OPENSSL3" - shell: powershell + conan install .. \ + -s build_type=${{startsWith(matrix.os, 'macos') && 'Release' || 'RelWithDebInfo'}} \ + -c tools.cmake.cmaketoolchain:generator="Ninja" \ + -b missing \ + --output-folder=. \ + -o with_openssl3="$C2_USE_OPENSSL3" + shell: bash - name: Build (Windows) if: startsWith(matrix.os, 'windows') @@ -278,11 +276,8 @@ jobs: - name: Install dependencies (MacOS) if: startsWith(matrix.os, 'macos') run: | - brew tap-new gh/local-boost - brew tap homebrew/core --force - brew extract --version=1.86.0 boost gh/local-boost # binary dependencies - ./.CI/SetupHomebrewDeps.sh boost@1.86.0 openssl@3 + ./.CI/SetupHomebrewDeps.sh openssl@3 # build and header-only dependencies brew install rapidjson p7zip create-dmg cmake tree shell: bash @@ -290,10 +285,11 @@ jobs: - name: Build (MacOS) if: startsWith(matrix.os, 'macos') run: | - mkdir build + mkdir -p build cd build cmake \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" \ -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0 \ -DUSE_PRECOMPILED_HEADERS=OFF \ -DCHATTERINO_LTO="$C2_ENABLE_LTO" \ diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 95436335863..ae508d8bffb 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -12,6 +12,7 @@ env: QT_QPA_PLATFORM: minimal HOMEBREW_NO_AUTO_UPDATE: 1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 + CONAN_VERSION: 2.11.0 concurrency: group: test-macos-${{ github.ref }} @@ -23,7 +24,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-13] + os: [macos-latest] qt-version: [6.7.1] plugins: [true] fail-fast: false @@ -55,13 +56,24 @@ jobs: modules: ${{ env.QT_MODULES }} version: ${{ matrix.qt-version }} + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + - name: Install dependencies run: | - brew install openssl rapidjson p7zip create-dmg cmake - brew tap-new gh/local-boost - brew tap homebrew/core --force - brew extract --version=1.86.0 boost gh/local-boost - brew install boost@1.86.0 + brew install openssl rapidjson p7zip create-dmg cmake ninja + + pip install conan==${{env.CONAN_VERSION}} + conan --version + conan profile detect -f + mkdir build-test + cd build-test + conan install .. \ + -s build_type=RelWithDebInfo \ + -c tools.cmake.cmaketoolchain:generator="Ninja" \ + -b missing \ + --output-folder=. - name: Install httpbox run: | @@ -72,10 +84,11 @@ jobs: - name: Build run: | - mkdir build-test + mkdir -p build-test cd build-test cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" \ -DBUILD_TESTS=On \ -DBUILD_APP=OFF \ -DUSE_PRECOMPILED_HEADERS=OFF \ diff --git a/CMakeLists.txt b/CMakeLists.txt index c12075e350c..76cf1b7fabd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,7 +177,7 @@ if (BUILD_WITH_QTKEYCHAIN) endif() endif() -find_package(RapidJSON REQUIRED) +find_package(RapidJSON MODULE REQUIRED) find_package(Websocketpp REQUIRED) diff --git a/conanfile.py b/conanfile.py index b5b2ebc4baa..bef8904f9d3 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile from conan.tools.files import copy +from conan.tools.cmake import CMakeToolchain from os import path class Chatterino(ConanFile): name = "Chatterino" - requires = "libavif/1.0.4" settings = "os", "compiler", "build_type", "arch" default_options = { "with_benchmark": False, @@ -18,19 +18,32 @@ class Chatterino(ConanFile): # Qt is built with OpenSSL 3 from version 6.5.0 onwards "with_openssl3": [True, False], } - generators = "CMakeDeps", "CMakeToolchain" + generators = "CMakeDeps" def requirements(self): + self.requires("boost/1.86.0") + if self.settings.os != "Windows": return - self.requires("boost/1.85.0") + self.requires("libavif/1.1.1") if self.options.get_safe("with_benchmark", False): - self.requires("benchmark/1.8.4") + self.requires("benchmark/1.9.0") - self.requires("openssl/3.2.2") + self.requires("openssl/3.3.2") def generate(self): + tc = CMakeToolchain(self) + tc.blocks.remove("compilers") + tc.blocks.remove("cmake_flags_init") + tc.blocks.remove("cppstd") + tc.blocks.remove("libcxx") + tc.blocks.remove("generic_system") + tc.blocks.remove("user_toolchain") + tc.blocks.remove("output_dirs") + tc.blocks.remove("apple_system") + tc.generate() + def copy_bin(dep, selector, subdir): src = path.realpath(dep.cpp_info.bindirs[0]) dst = path.realpath(path.join(self.build_folder, subdir))