From 73b6b1ea96ce1211716a1d52ee76b438dec11ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Isager=20Dalsgar=C3=B0?= Date: Mon, 11 Nov 2024 11:14:00 +0100 Subject: [PATCH] Use `cmake-fetch` for dependencies --- .github/workflows/test.yml | 7 +++---- .gitignore | 3 ++- .gitmodules | 4 ---- CMakeLists.txt | 6 +++--- package.json | 17 +++++++++++++++++ vendor/libuv | 1 - 6 files changed, 25 insertions(+), 13 deletions(-) delete mode 100644 .gitmodules create mode 100644 package.json delete mode 160000 vendor/libuv diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 95e9c74..864e7b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,16 +29,15 @@ jobs: runs-on: ${{ matrix.os }} name: ${{ matrix.platform }}-${{ matrix.arch }} steps: - - if: ${{ matrix.platform == 'linux' }} - run: | + - run: | sudo apt update sudo apt install -y libgtk-4-dev + if: ${{ matrix.platform == 'linux' }} - uses: actions/checkout@v4 - with: - submodules: recursive - uses: actions/setup-node@v4 with: node-version: lts/* - run: npm install -g bare-make + - run: npm install - run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} --debug - run: bare-make build diff --git a/.gitignore b/.gitignore index bc95448..009351a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -.cache/ build/ +node_modules/ +package-lock.json diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0e52ced..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "vendor/libuv"] - path = vendor/libuv - url = ../../libuv/libuv.git - shallow = true diff --git a/CMakeLists.txt b/CMakeLists.txt index b1e2147..05cf170 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.25) +find_package(cmake-fetch REQUIRED PATHS node_modules/cmake-fetch) + project(fx C) if(APPLE) @@ -10,9 +12,7 @@ if(WIN32) enable_language(CXX) endif() -if(NOT TARGET uv) - add_subdirectory(vendor/libuv EXCLUDE_FROM_ALL) -endif() +fetch_package("github:libuv/libuv@1.48.0") add_library(fx OBJECT) diff --git a/package.json b/package.json new file mode 100644 index 0000000..430e145 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "libfx", + "repository": { + "type": "git", + "url": "git+https://github.com/holepunchto/libfx.git" + }, + "author": "Holepunch", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/holepunchto/libfx/issues" + }, + "homepage": "https://github.com/holepunchto/libfx#readme", + "devDependencies": { + "cmake-fetch": "^1.0.0" + } +} diff --git a/vendor/libuv b/vendor/libuv deleted file mode 160000 index be6b81a..0000000 --- a/vendor/libuv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit be6b81a352d17513c95be153afcb3148f1a451cd