diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 461663d0a..07831307a 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -12,12 +12,13 @@ jobs: matrix: os: [ubuntu-latest] arch: [armeabi-v7a, arm64-v8a] + ndk: ["r22", "r26b"] ndk_sdkver: ["29", "21"] runs-on: ${{ matrix.os }} concurrency: - group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Android-${{ matrix.arch }}-${{ matrix.ndk_sdkver }} + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Android-${{ matrix.arch }}-${{ matrix.ndk }}-${{ matrix.ndk_sdkver }} cancel-in-progress: true steps: - uses: actions/checkout@v1 @@ -25,13 +26,19 @@ jobs: with: xmake-version: branch@master actions-cache-folder: '.xmake-cache' + actions-cache-key: 'android' - name: Prepare run: | - wget -q https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip - unzip -q -o ./android-ndk-r22-linux-x86_64.zip + if test ${{ matrix.ndk }} = "r26b"; then + wget -q https://dl.google.com/android/repository/android-ndk-r26b-linux.zip + unzip -q -o ./android-ndk-r26b-linux.zip + else + wget -q https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip + unzip -q -o ./android-ndk-r22-linux-x86_64.zip + fi - name: Tests run: | - xmake l ./scripts/test.lua -D -p android --ndk=`pwd`/android-ndk-r22 --ndk_sdkver=${{ matrix.ndk_sdkver }} -a ${{ matrix.arch }} + xmake l ./scripts/test.lua -D -p android --ndk=`pwd`/android-ndk-${{ matrix.ndk }} --ndk_sdkver=${{ matrix.ndk_sdkver }} -a ${{ matrix.arch }} diff --git a/.github/workflows/android_windows.yml b/.github/workflows/android_windows.yml new file mode 100644 index 000000000..0d20d5009 --- /dev/null +++ b/.github/workflows/android_windows.yml @@ -0,0 +1,58 @@ +name: Android (Windows) + +on: + pull_request: + branches: + - dev + +jobs: + build: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + arch: [armeabi-v7a, arm64-v8a] + ndk: ["r22", "r26c"] + ndk_sdkver: ["29"] + + concurrency: + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Android-Windows-${{ matrix.arch }}-${{ matrix.ndk }}-${{ matrix.ndk_sdkver }} + cancel-in-progress: true + steps: + - uses: actions/checkout@v1 + - uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: branch@master + + - name: Configure Pagefile + uses: al-cheb/configure-pagefile-action@v1.2 + with: + minimum-size: 8GB + maximum-size: 32GB + disk-root: "D:" + + - name: Prepare + run: | + if ("${{ matrix.ndk }}" -eq "r26c") { + curl -fsSL "https://dl.google.com/android/repository/android-ndk-r26c-windows.zip" -o android-ndk-r26c-windows.zip + Expand-Archive ./android-ndk-r26c-windows.zip -DestinationPath ./ndk + } else { + curl -fsSL "https://dl.google.com/android/repository/android-ndk-r22-windows-x86_64.zip" -o android-ndk-r22-windows-x86_64.zip + Expand-Archive ./android-ndk-r22-windows-x86_64.zip -DestinationPath ./ndk + } + + - name: Tests + run: | + git clone https://github.com/xmake-io/xmake.git --recurse-submodules -b master xmakesrc + cd xmakesrc/core + xmake + cd ../.. + Copy-Item ./xmakesrc/core/build/xmake.exe ./xmakesrc/xmake + Copy-Item ./xmakesrc/scripts/xrepo.bat ./xmakesrc/xmake + Copy-Item ./xmakesrc/scripts/xrepo.ps1 ./xmakesrc/xmake + $Env:XMAKE_MAIN_REPO = "https://github.com/xmake-io/xmake-repo.git" + $Env:XMAKE_PROGRAM_DIR = $(Resolve-Path ./xmakesrc/xmake) + Set-Item -Path Env:Path -Value ($Env:XMAKE_PROGRAM_DIR + ";" + $Env:Path) + xmake --version + xmake l ./scripts/test.lua -D -p android --ndk=D:/a/xmake-repo/xmake-repo/ndk/android-ndk-${{ matrix.ndk }} --ndk_sdkver=${{ matrix.ndk_sdkver }} -a ${{ matrix.arch }} + diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml new file mode 100644 index 000000000..a19e7e3aa --- /dev/null +++ b/.github/workflows/autoupdate.yml @@ -0,0 +1,43 @@ +name: Auto-update packages + +on: + schedule: # execute every 24 hours + - cron: "0 */24 * * *" + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v1 + - uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: branch@master + + - name: Installation + run: | + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + sudo apt update + sudo apt install -y gh unzip zip + echo ${{ secrets.XMAKE_REPO_TOKEN }} | gh auth login --with-token + git config --global user.email "waruqi@gmail.com" + git config --global user.name "ruki" + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa # optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} + + - name: Auto-update packages + if: ${{ github.repository }} == "xmake-io/xmake-repo" + run: | + xmake l -vD scripts/autoupdate.lua + + diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5d8a85cd9..76518a09a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,6 +35,13 @@ jobs: tar -xvf node-v14.15.4-linux-x64.tar.xz export PATH=`pwd`/node-v14.15.4-linux-x64/bin:$PATH sudo npm install markdown-to-html -g + git config --global user.email "waruqi@gmail.com" + git config --global user.name "ruki" + + - name: Build artifacts + if: ${{ github.repository }} == "xmake-io/xmake-repo" + run: | + xmake l scripts/build_artifacts.lua - name: Publish documents run: | @@ -45,14 +52,8 @@ jobs: git remote set-url --add all git@gitee.com:xmake-io/xrepo-docs.git git remote set-url --add all git@gitlab.com:xmake-io/xrepo-docs.git xmake l -vD `pwd`/build.lua - git config --global user.email "waruqi@gmail.com" - git config --global user.name "ruki" git status git add -A git diff-index --quiet HEAD || git commit -m "autoupdate docs by xmake-repo/ci" git push all master - - name: Build artifacts - run: | - xmake l scripts/build_artifacts.lua - diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index 5a4dc6dbc..94de85c5c 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -22,7 +22,7 @@ jobs: - name: Installation run: | uname -a - dnf -y install gfortran p7zip + dnf -y install gfortran p7zip which dnf -y install mesa-libGL-devel mesa-libGLU-devel dnf -y install @development-tools @rpm-development-tools dnf -y install copr-cli make gcc-c++ libatomic libcxx-devel @@ -35,6 +35,7 @@ jobs: with: xmake-version: branch@master actions-cache-folder: '.xmake-cache' + actions-cache-key: 'fedora' - name: Tests env: diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 17b710997..d2aa0b5d1 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - os: [macOS-12] + os: [ubuntu-latest] kind: [static, shared] runs-on: ${{ matrix.os }} @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v1 - name: Tests - uses: vmactions/freebsd-vm@v0 + uses: vmactions/freebsd-vm@v1 with: usesh: true sync: sshfs @@ -30,6 +30,7 @@ jobs: copyback: false prepare: pkg install -y git curl unzip gmake llvm gsed bash perl5 openssl run: | + git config --global --add safe.directory `pwd` git clone --recurse-submodules https://github.com/xmake-io/xmake.git /tmp/xmake -b dev cd /tmp/xmake ./configure @@ -37,7 +38,6 @@ jobs: gmake install export XMAKE_ROOT=y cd - - git config --global --add safe.directory /Users/runner/work/xmake-repo/xmake-repo xmake l ./scripts/test.lua -D -k ${{ matrix.kind }} -vD diff --git a/.github/workflows/macos.yml b/.github/workflows/macos_arm64.yml similarity index 72% rename from .github/workflows/macos.yml rename to .github/workflows/macos_arm64.yml index c46e4c66e..a551c1687 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos_arm64.yml @@ -1,4 +1,4 @@ -name: macOS +name: macOS (arm64) on: pull_request: @@ -8,14 +8,16 @@ on: jobs: build: strategy: + fail-fast: false matrix: - os: [macOS-latest] + os: [macos-14] + arch: [arm64] kind: [static, shared] runs-on: ${{ matrix.os }} concurrency: - group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-macOS-${{ matrix.kind }} + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-macOS-${{ matrix.arch }}-${{ matrix.kind }} cancel-in-progress: true steps: - uses: actions/checkout@v1 @@ -28,5 +30,4 @@ jobs: run: | wget https://curl.haxx.se/ca/cacert.pem -O /tmp/cacert.pem export CURL_CA_BUNDLE=/tmp/cacert.pem - xmake l ./scripts/test.lua -D -k ${{ matrix.kind }} - + xmake l ./scripts/test.lua -D -a ${{ matrix.arch }} -k ${{ matrix.kind }} diff --git a/.github/workflows/macos_x86_64.yml b/.github/workflows/macos_x86_64.yml new file mode 100644 index 000000000..b04b51e0d --- /dev/null +++ b/.github/workflows/macos_x86_64.yml @@ -0,0 +1,33 @@ +name: macOS (x86_64) + +on: + pull_request: + branches: + - dev + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [macos-12] + arch: [x86_64] + kind: [static, shared] + + runs-on: ${{ matrix.os }} + + concurrency: + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-macOS-${{ matrix.arch }}-${{ matrix.kind }} + cancel-in-progress: true + steps: + - uses: actions/checkout@v1 + - uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: branch@master + actions-cache-folder: '.xmake-cache' + + - name: Tests + run: | + wget https://curl.haxx.se/ca/cacert.pem -O /tmp/cacert.pem + export CURL_CA_BUNDLE=/tmp/cacert.pem + xmake l ./scripts/test.lua -D -a ${{ matrix.arch }} -k ${{ matrix.kind }} diff --git a/.github/workflows/mingw_macos.yml b/.github/workflows/mingw_macos.yml index 24913dbba..57dbefa34 100644 --- a/.github/workflows/mingw_macos.yml +++ b/.github/workflows/mingw_macos.yml @@ -11,11 +11,12 @@ jobs: matrix: os: [macOS-latest] kind: [static, shared] + arch: [i386, x86_64] runs-on: ${{ matrix.os }} concurrency: - group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-MingW-macOS-${{ matrix.kind }} + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-MingW-macOS-${{ matrix.kind }}-${{ matrix.arch }} cancel-in-progress: true steps: - uses: actions/checkout@v1 @@ -30,5 +31,4 @@ jobs: - name: Tests run: | - xmake l ./scripts/test.lua -D -p mingw -k ${{ matrix.kind }} - + xmake l ./scripts/test.lua -D -p mingw -a ${{ matrix.arch }} -k ${{ matrix.kind }} diff --git a/.github/workflows/mingw_msys2.yml b/.github/workflows/mingw_msys2.yml index 05e1dee52..681d1ed1a 100644 --- a/.github/workflows/mingw_msys2.yml +++ b/.github/workflows/mingw_msys2.yml @@ -33,7 +33,7 @@ jobs: - name: Prepare shell: msys2 {0} run: | - git clone https://github.com/xmake-io/xmake.git --recurse-submodules -b dev + git clone https://github.com/xmake-io/xmake.git --recurse-submodules -b master cd xmake ./configure make -j4 diff --git a/.github/workflows/monkey_freebsd.yml b/.github/workflows/monkey_freebsd.yml deleted file mode 100644 index 8d158459a..000000000 --- a/.github/workflows/monkey_freebsd.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Monkey (FreeBSD) - -on: - schedule: # execute every 24 hours - - cron: "0 */24 * * *" - -jobs: - build: - strategy: - matrix: - os: [macOS-12] - kind: [static, shared] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v1 - - - name: Tests - uses: vmactions/freebsd-vm@v0 - with: - usesh: true - mem: 4096 - copyback: false - prepare: pkg install -y git curl unzip gmake llvm gsed bash perl5 - run: | - git clone --recurse-submodules https://github.com/xmake-io/xmake.git /tmp/xmake -b dev - cd /tmp/xmake - ./configure - gmake -j4 - gmake install - export XMAKE_ROOT=y - git clone https://github.com/xmake-io/xmake-repo.git /tmp/xmake-repo -b dev --depth 2 - cd /tmp/xmake-repo - xmake l ./scripts/monkey.lua -D -k ${{ matrix.kind }} - - diff --git a/.github/workflows/monkey_linux.yml b/.github/workflows/monkey_linux.yml deleted file mode 100644 index 8037b902b..000000000 --- a/.github/workflows/monkey_linux.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Monkey (Linux) - -on: - schedule: # execute every 24 hours - - cron: "0 */24 * * *" - -jobs: - build: - strategy: - matrix: - os: [ubuntu-latest] - kind: [static, shared] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v1 - - uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: branch@master - - - name: Installation - run: | - # TODO we will remove it later - sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev p7zip - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 60 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 - sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-9 60 - sudo update-alternatives --set g++ /usr/bin/g++-9 - sudo update-alternatives --set gcc /usr/bin/gcc-9 - sudo update-alternatives --set cpp /usr/bin/cpp-9 - - - name: Tests - run: | - xmake l ./scripts/monkey.lua -D -k ${{ matrix.kind }} - diff --git a/.github/workflows/monkey_macos.yml b/.github/workflows/monkey_macos.yml deleted file mode 100644 index dee7f748d..000000000 --- a/.github/workflows/monkey_macos.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Monkey (macOS) - -on: - schedule: # execute every 24 hours - - cron: "0 */24 * * *" - -jobs: - build: - strategy: - matrix: - os: [macOS-latest] - kind: [static, shared] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v1 - - uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: branch@master - - - name: Tests - run: | - xmake l ./scripts/monkey.lua -D -k ${{ matrix.kind }} - diff --git a/.github/workflows/monkey_windows.yml b/.github/workflows/monkey_windows.yml deleted file mode 100644 index c49ce1918..000000000 --- a/.github/workflows/monkey_windows.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Monkey (Windows) - -on: - schedule: # execute every 24 hours - - cron: "0 */24 * * *" - -jobs: - build: - strategy: - matrix: - os: [windows-latest] - kind: [static, shared] - arch: [x64, x86, arm64] - vs_runtime: [MT, MD] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v1 - - uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: branch@master - - - name: Configure Pagefile - uses: al-cheb/configure-pagefile-action@v1.2 - with: - minimum-size: 8GB - maximum-size: 32GB - disk-root: "D:" - - - name: Tests - run: | - xmake l ./scripts/monkey.lua -D -a ${{ matrix.arch }} -k ${{ matrix.kind }} --vs_runtime=${{ matrix.vs_runtime }} --vs_sdkver=10.0.19041.0 - diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 61dfd46fe..ebdb69e94 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -43,6 +43,8 @@ jobs: known_hosts: ${{ secrets.KNOWN_HOSTS }} - name: Update + if: ${{ github.repository }} == "xmake-io/xmake-repo" run: | export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" xmake l -vD ./scripts/sync.lua + xmake l -vD ./scripts/automerge.lua diff --git a/.github/workflows/sync_packagerefs.yml b/.github/workflows/sync_packagerefs.yml new file mode 100644 index 000000000..390fa1891 --- /dev/null +++ b/.github/workflows/sync_packagerefs.yml @@ -0,0 +1,34 @@ +name: Sync Packagerefs + +on: + schedule: # execute every 24 hours + - cron: "0 */24 * * *" + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v1 + - uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: branch@master + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa # optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} + + - name: Build artifacts for packagerefs + if: ${{ github.repository }} == "xmake-io/xmake-repo" + run: | + git config --global user.email "waruqi@gmail.com" + git config --global user.name "ruki" + xmake l scripts/build_artifacts.lua true + diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index a97a5f901..be882cffa 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -24,6 +24,7 @@ jobs: with: xmake-version: branch@master actions-cache-folder: '.xmake-cache' + actions-cache-key: 'ubuntu' - name: Installation run: | diff --git a/.github/workflows/ubuntu_clang.yml b/.github/workflows/ubuntu_clang.yml index 40db0e2bd..e652c5d57 100644 --- a/.github/workflows/ubuntu_clang.yml +++ b/.github/workflows/ubuntu_clang.yml @@ -23,13 +23,21 @@ jobs: with: xmake-version: branch@master actions-cache-folder: '.xmake-cache' + actions-cache-key: 'ubuntu_clang' - name: Installation run: | # TODO we will remove it later sudo apt-get update - sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev clang libc++-dev p7zip + sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev p7zip + + - name: Clang Toolchain Installation + run: | + # https://apt.llvm.org/ + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 17 all - name: Tests run: | - xmake l ./scripts/test.lua -vD --toolchain=clang -k ${{ matrix.kind }} + xmake l ./scripts/test.lua -D --toolchain=clang-17 -k ${{ matrix.kind }} diff --git a/.github/workflows/wasm_ubuntu.yml b/.github/workflows/wasm_ubuntu.yml index 006b24da3..03db8b934 100644 --- a/.github/workflows/wasm_ubuntu.yml +++ b/.github/workflows/wasm_ubuntu.yml @@ -23,12 +23,11 @@ jobs: with: xmake-version: branch@master actions-cache-folder: '.xmake-cache' + actions-cache-key: 'wasm' - name: Prepare - uses: mymindstorm/setup-emsdk@v11 + uses: mymindstorm/setup-emsdk@v14 with: - # Make sure to set a version number! - version: 3.1.28 # This is the name of the cache folder. # The cache folder will be placed in the build directory, # so make sure it doesn't conflict with anything! diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 266c37122..74e0d77ab 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,12 +13,12 @@ jobs: os: [windows-2019, windows-2022] kind: [static, shared] arch: [x64, x86, arm64] - vs_runtime: [MT, MD] + runtimes: [MT, MD] runs-on: ${{ matrix.os }} concurrency: - group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Windows-${{ matrix.os }}-${{ matrix.kind }}-${{ matrix.arch }}-${{ matrix.vs_runtime }} + group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Windows-${{ matrix.os }}-${{ matrix.kind }}-${{ matrix.arch }}-${{ matrix.runtimes }} cancel-in-progress: true steps: - uses: actions/checkout@v1 @@ -35,9 +35,20 @@ jobs: - name: Tests run: | + git clone https://github.com/xmake-io/xmake.git --recurse-submodules -b master xmakesrc + cd xmakesrc/core + xmake + cd ../.. + Copy-Item ./xmakesrc/core/build/xmake.exe ./xmakesrc/xmake + Copy-Item ./xmakesrc/scripts/xrepo.bat ./xmakesrc/xmake + Copy-Item ./xmakesrc/scripts/xrepo.ps1 ./xmakesrc/xmake + $Env:XMAKE_MAIN_REPO = "https://github.com/xmake-io/xmake-repo.git" + $Env:XMAKE_PROGRAM_DIR = $(Resolve-Path ./xmakesrc/xmake) + Set-Item -Path Env:Path -Value ($Env:XMAKE_PROGRAM_DIR + ";" + $Env:Path) + xmake --version if ("${{ matrix.os }}" -eq "windows-2019") { - xmake l ./scripts/test.lua -vD -a ${{ matrix.arch }} -k ${{ matrix.kind }} --vs_runtime=${{ matrix.vs_runtime }} --vs_sdkver=10.0.19041.0 --linkjobs=2 + xmake l ./scripts/test.lua -vD -a ${{ matrix.arch }} -k ${{ matrix.kind }} --runtimes=${{ matrix.runtimes }} --vs_sdkver=10.0.19041.0 --linkjobs=2 } else { - xmake l ./scripts/test.lua -vD -a ${{ matrix.arch }} -k ${{ matrix.kind }} --vs_runtime=${{ matrix.vs_runtime }} --linkjobs=2 + xmake l ./scripts/test.lua -vD -a ${{ matrix.arch }} -k ${{ matrix.kind }} --runtimes=${{ matrix.runtimes }} --linkjobs=2 } diff --git a/packages/a/abseil/xmake.lua b/packages/a/abseil/xmake.lua index f2a1c6b34..308603052 100644 --- a/packages/a/abseil/xmake.lua +++ b/packages/a/abseil/xmake.lua @@ -12,30 +12,13 @@ package("abseil") add_versions("20211102.0", "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4") add_versions("20220623.0", "4208129b49006089ba1d6710845a45e31c59b0ab6bff9e5788a87f55c5abd602") add_versions("20230125.2", "9a2b5752d7bfade0bdeee2701de17c9480620f8b237e1964c1b9967c75374906") + add_versions("20230802.1", "987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed") + add_versions("20240116.1", "3c743204df78366ad2eaf236d6631d83f6bc928d1705dd0000b872e53b73dc6a") + add_versions("20240116.2", "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc") add_deps("cmake") - add_links( - "absl_status", "absl_cord", - "absl_flags", "absl_flags_parse", "absl_flags_internal", "absl_flags_reflection", "absl_flags_marshalling", - "absl_flags_commandlineflag_internal", "absl_synchronization", "absl_time", "absl_hash", "absl_city", "absl_time_zone", - "absl_spinlock_wait", "absl_failure_signal_handler", "absl_bad_optional_access", "absl_flags_commandlineflag", - "absl_random_internal_pool_urbg", - "absl_cordz_info", "absl_cord_internal", "absl_cordz_functions", "absl_cordz_handle", "absl_cordz_sample_token", - "absl_base", "absl_bad_any_cast_impl", "absl_periodic_sampler", "absl_random_distributions", - "absl_flags_usage_internal", "absl_random_seed_sequences", - "absl_throw_delegate", "absl_stacktrace", "absl_symbolize", "absl_debugging_internal", - "absl_flags_private_handle_accessor", - "absl_strings", "absl_flags_config", "absl_malloc_internal", "absl_str_format_internal", - "absl_flags_usage", "absl_strings_internal", "absl_flags_program_name", "absl_int128", - "absl_scoped_set_env", "absl_raw_hash_set", "absl_random_internal_seed_material", - "absl_random_internal_randen", "absl_random_internal_randen_slow", "absl_random_internal_randen_hwaes_impl", - "absl_random_internal_randen_hwaes", - "absl_graphcycles_internal", "absl_exponential_biased", "absl_bad_variant_access", "absl_statusor", - "absl_random_internal_distribution_test_util", "absl_random_internal_platform", - "absl_hashtablez_sampler", "absl_demangle_internal", "absl_leak_check", "absl_log_severity", "absl_raw_logging_internal", - "absl_strerror", "absl_examine_stack", "absl_low_level_hash", "absl_random_seed_gen_exception", "absl_civil_time", - "absl_crc_cord_state", "absl_crc32c", "absl_crc_cpu_detect", "absl_crc_internal") + add_configs("cxx_standard", {description = "Select c++ standard to build.", default = "17", type = "string", values = {"14", "17", "20"}}) if is_plat("macosx") then add_frameworks("CoreFoundation") @@ -44,30 +27,58 @@ package("abseil") on_load(function (package) if package:is_plat("windows") and package:config("shared") then package:add("defines", "ABSL_CONSUME_DLL") - package:add("links", "abseil_dll") end end) on_install("macosx", "linux", "windows", "mingw", "cross", function (package) - local configs = {"-DCMAKE_CXX_STANDARD=17"} + if package:version() and package:version():eq("20230802.1") and package:is_plat("mingw") then + io.replace(path.join("absl", "synchronization", "internal", "pthread_waiter.h"), "#ifndef _WIN32", "#if !defined(_WIN32) && !defined(__MINGW32__)", {plain = true}) + io.replace(path.join("absl", "synchronization", "internal", "win32_waiter.h"), "#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA", "#if defined(_WIN32) && !defined(__MINGW32__) && _WIN32_WINNT >= _WIN32_WINNT_VISTA", {plain = true}) + end + local configs = {"-DCMAKE_CXX_STANDARD=" .. package:config("cxx_standard"), "-DABSL_ENABLE_INSTALL=ON", "-DABSL_PROPAGATE_CXX_STD=ON"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs, {buildir = os.tmpfile() .. ".dir"}) + + -- get links and ensure link order + import("core.base.graph") + local dag = graph.new(true) + local pkgconfigdir = package:installdir("lib", "pkgconfig") + for _, pcfile in ipairs(os.files(path.join(pkgconfigdir, "*.pc"))) do + local link = path.basename(pcfile) + local content = io.readfile(pcfile) + for _, line in ipairs(content:split("\n")) do + if line:startswith("Requires: ") then + local requires = line:sub(10):split(",") + for _, dep in ipairs(requires) do + dep = dep:split("=")[1]:trim() + dag:add_edge(link, dep) + end + end + end + end + local links = dag:topological_sort() + package:add("links", links) + + local cycle = dag:find_cycle() + if cycle then + wprint("cycle links found", cycle) + end end) on_test(function (package) assert(package:check_cxxsnippets({test = [[ + #include "absl/strings/numbers.h" + #include "absl/strings/str_join.h" #include #include #include - #include "absl/strings/numbers.h" - #include "absl/strings/str_join.h" - void test () { - std::vector v = {"foo","bar","baz"}; - std::string s = absl::StrJoin(v, "-"); - int result = 0; - auto a = absl::SimpleAtoi("123", &result); - std::cout << "Joined string: " << s << "\\n"; + void test() { + std::vector v = {"foo", "bar", "baz"}; + std::string s = absl::StrJoin(v, "-"); + int result = 0; + auto a = absl::SimpleAtoi("123", &result); + std::cout << "Joined string: " << s << "\\n"; } - ]]}, {configs = {languages = "c++17"}})) + ]]}, {configs = {languages = "cxx17"}})) end) diff --git a/packages/a/access_private/xmake.lua b/packages/a/access_private/xmake.lua new file mode 100644 index 000000000..e43a5ab57 --- /dev/null +++ b/packages/a/access_private/xmake.lua @@ -0,0 +1,32 @@ +package("access_private") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/martong/access_private") + set_description("Access private members and statics of a C++ class") + set_license("MIT") + + add_urls("https://github.com/martong/access_private.git") + add_versions("2024.02.01", "9e47d135067ecfe569158b2f42ead9c6db9aaedf") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + + class A { + int m_i = 3; + int m_f(int p) { return 14 * p; } + }; + + ACCESS_PRIVATE_FIELD(A, int, m_i) + ACCESS_PRIVATE_FUN(A, int(int), m_f) + + void test() { + A a; + auto &i = access_private::m_i(a); + auto res = call_private::m_f(a, 3); + } + ]]}, {configs = {languages = "cxx11"}})) + end) diff --git a/packages/a/acl/xmake.lua b/packages/a/acl/xmake.lua index 0a76a8c9d..0ed30adae 100644 --- a/packages/a/acl/xmake.lua +++ b/packages/a/acl/xmake.lua @@ -5,6 +5,7 @@ package("acl") set_license("GPL-2.0") add_urls("http://download.savannah.nongnu.org/releases/acl/acl-$(version).tar.gz") + add_versions("2.3.2", "5f2bdbad629707aa7d85c623f994aa8a1d2dec55a73de5205bac0bf6058a2f7c") add_versions("2.3.1", "760c61c68901b37fdd5eefeeaf4c0c7a26bdfdd8ac747a1edff1ce0e243c11af") add_deps("pkgconf", "attr") diff --git a/packages/a/actor-framework/xmake.lua b/packages/a/actor-framework/xmake.lua index 6b4a5d6a7..44edaaaa5 100644 --- a/packages/a/actor-framework/xmake.lua +++ b/packages/a/actor-framework/xmake.lua @@ -6,6 +6,7 @@ package("actor-framework") add_urls("https://github.com/actor-framework/actor-framework/archive/refs/tags/$(version).tar.gz", "https://github.com/actor-framework/actor-framework.git") + add_versions("0.19.6", "48dc4c4abf5ab5a7c6f84b9259cc8be1b02c601d31893647ab44e143cdc4b6d5") add_versions("0.19.2", "aa3fcc494424e0e20b177125458a6a6ed39c751a3d3d5193054e88bdf8a146d2") add_configs("profiler", {description = "Enable experimental profiler API", default = false, type = "boolean"}) diff --git a/packages/a/ada/xmake.lua b/packages/a/ada/xmake.lua index 6d55c857b..871ddd6af 100644 --- a/packages/a/ada/xmake.lua +++ b/packages/a/ada/xmake.lua @@ -1,5 +1,4 @@ package("ada") - set_homepage("https://www.ada-url.com") set_description("WHATWG-compliant and fast URL parser written in modern C++") set_license("Apache-2.0") @@ -7,6 +6,10 @@ package("ada") set_urls("https://github.com/ada-url/ada/archive/refs/tags/v$(version).tar.gz", "https://github.com/ada-url/ada.git") + add_versions("2.8.0", "83b77fb53d1a9eea22b1484472cea0215c50478c9ea2b4b44b0ba3b52e07c139") + add_versions("2.7.8", "8de067b7cb3da1808bf5439279aee6048d761ba246bf8a854c2af73b16b41c75") + add_versions("2.7.7", "7116d86a80b79886efbc9d946d3919801815060ae62daf78de68c508552af554") + add_versions("2.7.6", "e2822783913c50b9f5c0f20b5259130a7bdc36e87aba1cc38a5de461fe45288f") add_versions("2.3.1", "298992ec0958979090566c7835ea60c14f5330d6372ee092ef6eee1d2e6ac079") add_versions("2.4.0", "14624f1dfd966fee85272688064714172ff70e6e304a1e1850f352a07e4c6dc7") add_versions("2.4.1", "e9359937e7aeb8e5889515c0a9e22cd5da50e9b053038eb092135a0e64888fe7") @@ -21,8 +24,8 @@ package("ada") local configs = {"-DBUILD_TESTING=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - io.replace("CMakeLists.txt", " add_subdirectory(singleheader)", "", {plain = true}) - io.replace("CMakeLists.txt", " add_subdirectory(tools)", "", {plain = true}) + io.replace("CMakeLists.txt", "add_subdirectory(singleheader)", "", {plain = true}) + io.replace("CMakeLists.txt", "add_subdirectory(tools)", "", {plain = true}) import("package.tools.cmake").install(package, configs) end) diff --git a/packages/a/ade/xmake.lua b/packages/a/ade/xmake.lua new file mode 100644 index 000000000..ca20bc334 --- /dev/null +++ b/packages/a/ade/xmake.lua @@ -0,0 +1,23 @@ +package("ade") + set_homepage("https://github.com/opencv/ade") + set_description("ADE Framework is a graph construction, manipulation, and processing framework.") + set_license("Apache-2.0") + + add_urls("https://github.com/opencv/ade/archive/refs/tags/$(version).tar.gz", + "https://github.com/opencv/ade.git") + + add_versions("v0.1.2d", "edefba61a33d6cd4b78a9976cb3309c95212610a81ba6dade09882d1794198ff") + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_WITH_STATIC_CRT=" .. (package:has_runtime("MT") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cxxtypes("ade::Graph", {configs = {languages = "c++11"}, includes = "ade/graph.hpp"})) + end) diff --git a/packages/a/agg/xmake.lua b/packages/a/agg/xmake.lua new file mode 100644 index 000000000..f85266fa4 --- /dev/null +++ b/packages/a/agg/xmake.lua @@ -0,0 +1,40 @@ +package("agg") + + set_homepage("https://agg.sourceforge.net/antigrain.com/index.html") + set_description("Anti-Grain Geometry: A High Quality Rendering Engine for C++") + set_license("BSD-3-Clause") + + add_urls("https://github.com/aggeom/agg-2.6/archive/refs/tags/agg-$(version).zip", + "https://github.com/aggeom/agg-2.6.git") + add_versions("2.7.1", "d7b86cdf55282e798aba43194a87705ad30ba950b5723144524e08fe8477db80") + + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + add_configs("freetype", {description = "Use Freetype library.", default = false, type = "boolean", readonly = true}) + + add_deps("cmake") + if is_plat("macosx", "linux") then + add_deps("libx11", "libxext") + end + add_links("aggctrl", "aggplatform", "agg") + on_load("windows", "macosx", "linux", "mingw", function (package) + if package:config("freetype") then + package:add("deps", "freetype") + end + end) + + on_install("windows", "macosx", "linux", "mingw", function (package) + io.replace("src/platform/CMakeLists.txt", "IF(APPLE)", "IF(FALSE)", {plain = true}) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-Dagg_USE_FREETYPE=" .. (package:config("freetype") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + agg::rasterizer_scanline_aa<> ras; + ras.reset(); + } + ]]}, {configs = {languages = "c++11"}, includes = "agg/agg_rasterizer_scanline_aa.h"})) + end) diff --git a/packages/a/aitoolkit/xmake.lua b/packages/a/aitoolkit/xmake.lua new file mode 100644 index 000000000..3465d85e1 --- /dev/null +++ b/packages/a/aitoolkit/xmake.lua @@ -0,0 +1,20 @@ +package("aitoolkit") + set_kind("library", {headeronly = true}) + set_homepage("https://linkdd.github.io/aitoolkit/") + set_description("Give a brain to your game's NPCs") + set_license("MIT") + + add_urls("https://github.com/linkdd/aitoolkit/archive/refs/tags/$(version).tar.gz", + "https://github.com/linkdd/aitoolkit.git") + + add_versions("v0.5.1", "25ce3e5225d9ab3e4aa5b5cf41b790d17c8d6586a06fa70e18ae7aad7ca6ac26") + add_versions("v0.5.0", "e2f59412a6cdc7389f25f4b85847e81c39866d33367515bd02e38be4d54ac74c") + add_versions("v0.3.0", "8cbe1d281235a3486c5840c7f9782f2b3b2ed181d76e8cbe83a2b1395d21ab8a") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:has_cxxincludes("aitoolkit/fsm.hpp", {configs = {languages = "c++20"}})) + end) diff --git a/packages/a/alembic/xmake.lua b/packages/a/alembic/xmake.lua new file mode 100644 index 000000000..7fbf148c7 --- /dev/null +++ b/packages/a/alembic/xmake.lua @@ -0,0 +1,37 @@ +package("alembic") + + set_homepage("https://alembic.io/") + set_description("Open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications.") + set_license("BSD-3-Clause") + + add_urls("https://github.com/alembic/alembic/archive/refs/tags/$(version).tar.gz", + "https://github.com/alembic/alembic.git") + add_versions("1.8.6", "c572ebdea3a5f0ce13774dd1fceb5b5815265cd1b29d142cf8c144b03c131c8c") + add_versions("1.8.5", "180a12f08d391cd89f021f279dbe3b5423b1db751a9898540c8059a45825c2e9") + + add_deps("cmake", "imath") + if is_plat("linux") then + add_syslinks("m") + end + on_load("windows", function (package) + if package:config("shared") then + package:add("defines", "ALEMBIC_DLL") + end + end) + + on_install("windows", "macosx", "linux", function (package) + local configs = {"-DBUILD_TESTING=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DALEMBIC_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + Alembic::Abc::OArchive archive; + Alembic::Abc::OObject object = archive.getTop(); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/a/alsa-lib/xmake.lua b/packages/a/alsa-lib/xmake.lua index 2cf8e7a06..b879a4359 100644 --- a/packages/a/alsa-lib/xmake.lua +++ b/packages/a/alsa-lib/xmake.lua @@ -1,26 +1,37 @@ package("alsa-lib") set_homepage("https://alsa-project.org/wiki/Main_Page") set_description("The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI functionality to the Linux operating system.") + set_license("LGPL-2.1") - set_urls("http://www.alsa-project.org/files/pub/lib/alsa-lib-$(version).tar.bz2") + add_urls("http://www.alsa-project.org/files/pub/lib/alsa-lib-$(version).tar.bz2", {alias = "home"}) + add_urls("https://github.com/alsa-project/alsa-lib/archive/refs/tags/v$(version).tar.gz", {alias = "github"}) + add_versions("home:1.2.10", "c86a45a846331b1b0aa6e6be100be2a7aef92efd405cf6bac7eef8174baa920e") + add_versions("github:1.2.10", "f55749847fd98274501f4691a2d847e89280c07d40a43cdac43d6443f69fc939") - add_versions("1.2.10", "c86a45a846331b1b0aa6e6be100be2a7aef92efd405cf6bac7eef8174baa920e") + add_configs("versioned", {description = "pass flag --without-versioned", default = true, type = "boolean"}) + + if is_plat("linux") then + add_syslinks("pthread") + add_extsources("pacman::alsa-lib", "apt::libasound2-dev") + end + + if not is_plat("windows") then + add_deps("autoconf", "automake", "libtool", "m4") + end on_install("linux", function (package) - local configs = {"--without-versioned"} + local configs = {} table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) if package:is_debug() then table.insert(configs, "--enable-debug") end + if package:config("versioned")then + table.insert(configs, "--without-versioned") + end import("package.tools.autoconf").install(package, configs) end) on_test(function (package) - assert(package:check_csnippets({test = [[ - void test() { - snd_ctl_card_info_t *info; - snd_ctl_card_info_alloca(&info); - } - ]]}, {includes = {"alsa/asoundlib.h"}})) + assert(package:has_cfuncs("snd_pcm_open", {includes = "alsa/asoundlib.h"})) end) diff --git a/packages/a/amgx/patches/2.4.0/msvc.patch b/packages/a/amgx/patches/2.4.0/msvc.patch new file mode 100644 index 000000000..6cfc17535 --- /dev/null +++ b/packages/a/amgx/patches/2.4.0/msvc.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7bc0f1b9..7b0b606e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -30,6 +30,7 @@ cmake_minimum_required (VERSION 3.18) + project (AMG LANGUAGES C CXX CUDA) + + find_package(MPI) ++find_package(OpenMP) + + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake" ${CMAKE_MODULE_PATH}) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index b7fbef7d..0d77ddc7 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -107,9 +107,7 @@ ELSE() + set(libs_all CUDA::cusparse CUDA::cublas rt dl) + ENDIF() + +-add_dependencies(amgx_tests_launcher amgx_tests_library) +- +-target_link_libraries(amgx_tests_launcher amgxsh ${libs_all} OpenMP::OpenMP_C) ++target_link_libraries(amgx_tests_launcher amgx_tests_library amgxsh ${libs_all} OpenMP::OpenMP_C) + + if(MPI_FOUND) + target_link_libraries(amgx_tests_launcher MPI::MPI_CXX) diff --git a/packages/a/amgx/xmake.lua b/packages/a/amgx/xmake.lua new file mode 100644 index 000000000..f23ebf60f --- /dev/null +++ b/packages/a/amgx/xmake.lua @@ -0,0 +1,42 @@ +package("amgx") + + set_homepage("https://developer.nvidia.com/amgx") + set_description("Distributed multigrid linear solver library on GPU") + set_license("BSD-3-Clause") + + add_urls("https://github.com/NVIDIA/AMGX.git") + add_versions("v2.4.0", "2b4762f02af2ed136134c7f0570646219753ab3e") + + add_patches("2.4.0", "patches/2.4.0/msvc.patch", "46dcb9a5e1b4157fce91e06050c1d70f5e4fe34d7bf085216629c4f8708f90a5") + + if is_plat("windows") then + set_policy("platform.longpaths", true) + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("cmake", "openmp") + on_load("windows", function (package) + package:add("deps", "cuda", {system = true, configs = {utils = {"cublas", "cusparse", "cusolver"}}}) + if not package:config("shared") then + package:add("defines", "AMGX_API_NO_IMPORTS") + end + end) + + on_load("linux", function (package) + package:add("deps", "cuda", {system = true, configs = {utils = {"cublas", "cusparse", "cusolver"}}}) + package:add("deps", "nvtx") + package:add("syslinks", "pthread", "m") + end) + + on_install("windows", "linux", function (package) + io.replace("CMakeLists.txt", "/Zl", "", {plain = true}) + io.replace("CMakeLists.txt", "add_subdirectory(examples)", "", {plain = true}) + local configs = {"-DCMAKE_NO_MPI=ON"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + import("package.tools.cmake").install(package, configs) + package:add("links", package:config("shared") and "amgxsh" or "amgx") + end) + + on_test(function (package) + assert(package:has_cfuncs("AMGX_initialize", {includes = "amgx_c.h"})) + end) diff --git a/packages/a/amqp-cpp/xmake.lua b/packages/a/amqp-cpp/xmake.lua new file mode 100644 index 000000000..ee5071ae2 --- /dev/null +++ b/packages/a/amqp-cpp/xmake.lua @@ -0,0 +1,43 @@ +package("amqp-cpp") + set_homepage("https://github.com/CopernicaMarketingSoftware/AMQP-CPP") + set_description("C++ library for asynchronous non-blocking communication with RabbitMQ") + set_license("Apache-2.0") + + add_urls("https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/refs/tags/$(version).tar.gz", + "https://github.com/CopernicaMarketingSoftware/AMQP-CPP.git") + + add_versions("v4.3.26", "2baaab702f3fd9cce40563dc1e23f433cceee7ec3553bd529a98b1d3d7f7911c") + + if is_plat("windows", "mingw") then + add_syslinks("ws2_32") + elseif is_plat("linux") then + add_configs("tcp", {description = "Build TCP module.", default = false, type = "boolean"}) + add_syslinks("pthread", "dl") + end + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") then + package:add("defines", "NOMINMAX") + if package:config("shared") and package:version():le("4.3.26") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end + elseif package:is_plat("linux") then + table.insert(configs, "-DAMQP-CPP_LINUX_TCP=" .. (package:config("tcp") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + AMQP::Connection connection(nullptr, AMQP::Login("guest","guest"), "/"); + AMQP::Channel channel(nullptr); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/a/angelscript/patches/msvc-arm64.patch b/packages/a/angelscript/patches/msvc-arm64.patch new file mode 100644 index 000000000..cb1b6ca48 --- /dev/null +++ b/packages/a/angelscript/patches/msvc-arm64.patch @@ -0,0 +1,27 @@ +diff --git a/angelscript/source/as_callfunc_arm64_msvc.asm b/angelscript/source/as_callfunc_arm64_msvc.asm +index ce43c75..1059246 100644 +--- a/angelscript/source/as_callfunc_arm64_msvc.asm ++++ b/angelscript/source/as_callfunc_arm64_msvc.asm +@@ -68,7 +68,7 @@ GetHFAReturnDouble PROC + ALIGN 4 + GetHFAReturnFloat PROC + adr x9, |populateFloats| +- sub x9, x9, x2 // x9 -= returnSize; (already 4 bytes per return) ++ sub x9, x9, x2 ; x9 -= returnSize; (already 4 bytes per return) + br x9 + + str s3, [x1, #0x4] +@@ -185,6 +185,7 @@ CallARM64Ret128 PROC + ldp fp, lr, [sp],#0x20 + + ret ; CallARM64Ret128 ++ ENDP + + ALIGN 4 + CallARM64RetInMemory PROC +@@ -202,4 +203,4 @@ CallARM64RetInMemory PROC + + ret ; CallARM64RetInMemory + +- END ++ ENDP diff --git a/packages/a/angelscript/port/xmake.lua b/packages/a/angelscript/port/xmake.lua new file mode 100644 index 000000000..3459f2b5e --- /dev/null +++ b/packages/a/angelscript/port/xmake.lua @@ -0,0 +1,36 @@ +add_rules("mode.debug", "mode.release") +add_rules("utils.install.cmake_importfiles") +set_languages("c++11") + +option("exceptions", {showmenu = true, default = false}) + +target("angelscript") + set_kind("shared") + add_files("angelscript/source/*.cpp") + add_headerfiles("angelscript/include/*.h") + add_includedirs("angelscript/include") + + add_defines("ANGELSCRIPT_EXPORT") + if not has_config("exceptions") then + add_defines("AS_NO_EXCEPTIONS") + end + + if is_plat("windows") then + if is_arch("x64") then + add_files("angelscript/source/as_callfunc_x64_msvc_asm.asm") + elseif is_arch("arm64") then + add_files("angelscript/source/as_callfunc_arm64_msvc.asm") + -- elseif is_arch("arm32") then + -- add_files("angelscript/source/as_callfunc_arm_msvc.asm") + end + else + if is_arch("arm32") then + add_files("angelscript/source/as_callfunc_arm_gcc.S") + elseif is_arch("arm64") then + add_files("angelscript/source/as_callfunc_arm64_gcc.S") + end + + if is_plat("linux") then + add_syslinks("pthread") + end + end diff --git a/packages/a/angelscript/xmake.lua b/packages/a/angelscript/xmake.lua index f45e866ca..3862dad7a 100644 --- a/packages/a/angelscript/xmake.lua +++ b/packages/a/angelscript/xmake.lua @@ -1,31 +1,45 @@ package("angelscript") - set_homepage("http://angelcode.com/angelscript/") set_description("Extremely flexible cross-platform scripting library designed to allow applications to extend their functionality through external scripts") set_license("zlib") add_urls("http://angelcode.com/angelscript/sdk/files/angelscript_$(version).zip") + add_versions("2.36.0", "33f95f7597bc0d88b097d35e7b1320d15419ffc5779851d9d2a6cccec57811b3") add_versions("2.35.1", "5c1096b6d6cf50c7e77ae93c736d35b69b07b1e5047161c7816bca25b413a18b") add_versions("2.35.0", "010dd45e23e734d46f5891d70e268607a12cb9ab12503dda42f842d9db7e8857") add_versions("2.34.0", "6faa043717522ae0fb2677d907ca5b0e35a79d28e5f83294565e6c6229bfbdf7") + add_patches(">=2.34.0", "patches/msvc-arm64.patch", "1433f474870102e6fd8d0c9978b6d122a098cdecded29be70176b9dab534564f") + + add_configs("exceptions", {description = "Enable exception handling in script context", default = false, type = "boolean"}) + if is_plat("linux") then add_syslinks("pthread") end - add_deps("cmake") + on_load("windows|x86", "windows|x64", "linux", "android", "msys", "mingw", function (package) + package:add("deps", "cmake") + end) - on_install("windows", "linux", "android", "msys", "mingw", function (package) + on_install("windows|x86", "windows|x64", "linux", "android", "msys", "mingw", function (package) os.cd("angelscript/projects/cmake") local configs = {} table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DAS_NO_EXCEPTIONS=" .. (package:config("exceptions") and "OFF" or "ON")) if package:is_plat("android") then io.gsub("CMakeLists.txt", "set_property", "#set_property") end import("package.tools.cmake").install(package, configs) end) + on_install("windows|arm64", function (package) + local configs = {} + configs.exceptions = package:config("exceptions") + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, configs) + end) + on_test(function (package) assert(package:check_cxxsnippets({test = [[ #include @@ -34,4 +48,4 @@ package("angelscript") std::cout << asGetLibraryVersion() << "\n"; } ]]}, {configs = {languages = "c++11"}, includes = "angelscript.h"})) - end) \ No newline at end of file + end) diff --git a/packages/a/angle/port/6288/xmake.lua b/packages/a/angle/port/6288/xmake.lua new file mode 100644 index 000000000..2ecd87511 --- /dev/null +++ b/packages/a/angle/port/6288/xmake.lua @@ -0,0 +1,1243 @@ +set_project("angle") +set_version("6288") +set_languages("c99", "c++17") + +add_rules("mode.debug", "mode.release") + +add_requires("python 3.x", {kind = "binary"}) +add_requires("zlib") +-- add_requires("chromium_zlib") + +function angle_define_option(name, opt) +local opt = opt or {} +option(name) + set_default(false) + before_check(function (option) + if opt.default then option:enable(true) end + end) +option_end() +end + +-- gni/angle.gni +angle_define_option("enable_cl", {default=false}) +angle_define_option("with_capture", {default=false}) +angle_define_option("use_x11", {default=is_plat("linux")}) +angle_define_option("use_wayland", {default=false}) +angle_define_option("use_libpci", {default=false}) + +if has_config("use_x11") then + add_requires("libx11", "libxext", "libxi") +end +if has_config("use_wayland") then + add_requires("wayland") +end +if has_config("use_libpci") then + add_requires("pciutils") +end + +-- backends +angle_define_option("enable_null", {default=false}) +angle_define_option("enable_d3d9", {default=is_plat("windows")}) +angle_define_option("enable_d3d11", {default=is_plat("windows")}) +angle_define_option("enable_gl", {default=true}) +angle_define_option("enable_metal", {default=is_plat("macosx")}) +angle_define_option("enable_vulkan", {default=false}) +angle_define_option("enable_gl_desktop", {default=is_plat("windows", "macosx", "linux")}) + +angle_define_option("enable_hlsl", {default=is_plat("windows")}) +angle_define_option("enable_essl", {default=true}) +angle_define_option("enable_glsl", {default=true}) + +-- loaders +angle_define_option("enable_wgpu", {default=false}) +angle_define_option("enable_cgl", {default=is_plat("macosx")}) +angle_define_option("enable_eagl", {default=is_plat("iphoneos")}) + +if has_config("enable_gl_desktop") then + add_requires("opengl") +end +if has_config("enable_vulkan") then + add_requires("vulkansdk") +end + +local zlib_wrapper_sources = { + "third_party/zlib/google/compression_utils_portable.cc" +} +-- src/compiler.gni +local angle_translator_sources = { + "src/compiler/translator/BaseTypes.cpp", + "src/compiler/translator/BuiltInFunctionEmulator.cpp", + "src/compiler/translator/CallDAG.cpp", + "src/compiler/translator/CodeGen.cpp", + "src/compiler/translator/CollectVariables.cpp", + "src/compiler/translator/Compiler.cpp", + "src/compiler/translator/ConstantUnion.cpp", + "src/compiler/translator/Declarator.cpp", + "src/compiler/translator/Diagnostics.cpp", + "src/compiler/translator/DirectiveHandler.cpp", + "src/compiler/translator/ExtensionBehavior.cpp", + "src/compiler/translator/FlagStd140Structs.cpp", + "src/compiler/translator/FunctionLookup.cpp", + "src/compiler/translator/HashNames.cpp", + "src/compiler/translator/ImmutableStringBuilder.cpp", + "src/compiler/translator/InfoSink.cpp", + "src/compiler/translator/Initialize.cpp", + "src/compiler/translator/InitializeDll.cpp", + "src/compiler/translator/IntermNode.cpp", + "src/compiler/translator/IsASTDepthBelowLimit.cpp", + "src/compiler/translator/Operator.cpp", + "src/compiler/translator/OutputTree.cpp", + "src/compiler/translator/ParseContext.cpp", + "src/compiler/translator/PoolAlloc.cpp", + "src/compiler/translator/QualifierTypes.cpp", + "src/compiler/translator/ShaderLang.cpp", + "src/compiler/translator/ShaderVars.cpp", + "src/compiler/translator/Symbol.cpp", + "src/compiler/translator/SymbolTable.cpp", + "src/compiler/translator/SymbolUniqueId.cpp", + "src/compiler/translator/Types.cpp", + "src/compiler/translator/ValidateAST.cpp", + "src/compiler/translator/ValidateBarrierFunctionCall.cpp", + "src/compiler/translator/ValidateClipCullDistance.cpp", + "src/compiler/translator/ValidateGlobalInitializer.cpp", + "src/compiler/translator/ValidateLimitations.cpp", + "src/compiler/translator/ValidateMaxParameters.cpp", + "src/compiler/translator/ValidateOutputs.cpp", + "src/compiler/translator/ValidateSwitch.cpp", + "src/compiler/translator/ValidateTypeSizeLimitations.cpp", + "src/compiler/translator/ValidateVaryingLocations.cpp", + "src/compiler/translator/VariablePacker.cpp", + "src/compiler/translator/blocklayout.cpp", + "src/compiler/translator/glslang_lex_autogen.cpp", + "src/compiler/translator/glslang_tab_autogen.cpp", + "src/compiler/translator/tree_ops/ClampFragDepth.cpp", + "src/compiler/translator/tree_ops/ClampIndirectIndices.cpp", + "src/compiler/translator/tree_ops/ClampPointSize.cpp", + "src/compiler/translator/tree_ops/DeclareAndInitBuiltinsForInstancedMultiview.cpp", + "src/compiler/translator/tree_ops/DeclarePerVertexBlocks.cpp", + "src/compiler/translator/tree_ops/DeferGlobalInitializers.cpp", + "src/compiler/translator/tree_ops/EmulateGLFragColorBroadcast.cpp", + "src/compiler/translator/tree_ops/EmulateMultiDrawShaderBuiltins.cpp", + "src/compiler/translator/tree_ops/FoldExpressions.cpp", + "src/compiler/translator/tree_ops/ForcePrecisionQualifier.cpp", + "src/compiler/translator/tree_ops/InitializeVariables.cpp", + "src/compiler/translator/tree_ops/MonomorphizeUnsupportedFunctions.cpp", + "src/compiler/translator/tree_ops/PreTransformTextureCubeGradDerivatives.cpp", + "src/compiler/translator/tree_ops/PruneEmptyCases.cpp", + "src/compiler/translator/tree_ops/PruneNoOps.cpp", + "src/compiler/translator/tree_ops/RecordConstantPrecision.cpp", + "src/compiler/translator/tree_ops/RemoveArrayLengthMethod.cpp", + "src/compiler/translator/tree_ops/RemoveAtomicCounterBuiltins.cpp", + "src/compiler/translator/tree_ops/RemoveDynamicIndexing.cpp", + "src/compiler/translator/tree_ops/RemoveInactiveInterfaceVariables.cpp", + "src/compiler/translator/tree_ops/RemoveInvariantDeclaration.cpp", + "src/compiler/translator/tree_ops/RemoveUnreferencedVariables.cpp", + "src/compiler/translator/tree_ops/RescopeGlobalVariables.cpp", + "src/compiler/translator/tree_ops/RewriteArrayOfArrayOfOpaqueUniforms.cpp", + "src/compiler/translator/tree_ops/RewriteAtomicCounters.cpp", + "src/compiler/translator/tree_ops/RewriteCubeMapSamplersAs2DArray.cpp", + "src/compiler/translator/tree_ops/RewriteDfdy.cpp", + "src/compiler/translator/tree_ops/RewritePixelLocalStorage.cpp", + "src/compiler/translator/tree_ops/RewriteStructSamplers.cpp", + "src/compiler/translator/tree_ops/RewriteTexelFetchOffset.cpp", + "src/compiler/translator/tree_ops/SeparateDeclarations.cpp", + "src/compiler/translator/tree_ops/SeparateStructFromUniformDeclarations.cpp", + "src/compiler/translator/tree_ops/SimplifyLoopConditions.cpp", + "src/compiler/translator/tree_ops/SplitSequenceOperator.cpp", + "src/compiler/translator/tree_util/DriverUniform.cpp", + "src/compiler/translator/tree_util/FindFunction.cpp", + "src/compiler/translator/tree_util/FindMain.cpp", + "src/compiler/translator/tree_util/FindPreciseNodes.cpp", + "src/compiler/translator/tree_util/FindSymbolNode.cpp", + "src/compiler/translator/tree_util/IntermNodePatternMatcher.cpp", + "src/compiler/translator/tree_util/IntermNode_util.cpp", + "src/compiler/translator/tree_util/IntermTraverse.cpp", + "src/compiler/translator/tree_util/ReplaceArrayOfMatrixVarying.cpp", + "src/compiler/translator/tree_util/ReplaceClipCullDistanceVariable.cpp", + "src/compiler/translator/tree_util/ReplaceShadowingVariables.cpp", + "src/compiler/translator/tree_util/ReplaceVariable.cpp", + "src/compiler/translator/tree_util/RewriteSampleMaskVariable.cpp", + "src/compiler/translator/tree_util/RunAtTheBeginningOfShader.cpp", + "src/compiler/translator/tree_util/RunAtTheEndOfShader.cpp", + "src/compiler/translator/tree_util/SpecializationConstant.cpp", + "src/compiler/translator/util.cpp", +} +local angle_translator_glsl_base_sources = { + "src/compiler/translator/glsl/OutputGLSLBase.cpp", +} +local angle_translator_glsl_and_vulkan_base_sources = { + "src/compiler/translator/glsl/OutputGLSL.cpp", +} +local angle_translator_essl_sources = { + "src/compiler/translator/glsl/OutputESSL.cpp", + "src/compiler/translator/glsl/TranslatorESSL.cpp", +} +local angle_translator_glsl_sources = { + "src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp", + "src/compiler/translator/glsl/ExtensionGLSL.cpp", + "src/compiler/translator/glsl/TranslatorGLSL.cpp", + "src/compiler/translator/glsl/VersionGLSL.cpp", + "src/compiler/translator/tree_ops/glsl/RegenerateStructNames.cpp", + "src/compiler/translator/tree_ops/glsl/RewriteRepeatedAssignToSwizzled.cpp", + "src/compiler/translator/tree_ops/glsl/ScalarizeVecAndMatConstructorArgs.cpp", + "src/compiler/translator/tree_ops/glsl/UseInterfaceBlockFields.cpp", +} +local angle_translator_glsl_apple_sources = { + "src/compiler/translator/tree_ops/glsl/apple/AddAndTrueToLoopCondition.cpp", + "src/compiler/translator/tree_ops/glsl/apple/RewriteDoWhile.cpp", + "src/compiler/translator/tree_ops/glsl/apple/RewriteRowMajorMatrices.cpp", + "src/compiler/translator/tree_ops/glsl/apple/RewriteUnaryMinusOperatorFloat.cpp", + "src/compiler/translator/tree_ops/glsl/apple/UnfoldShortCircuitAST.cpp", +} +local angle_translator_hlsl_sources = { + "src/compiler/translator/hlsl/ASTMetadataHLSL.cpp", + "src/compiler/translator/hlsl/AtomicCounterFunctionHLSL.cpp", + "src/compiler/translator/hlsl/BuiltInFunctionEmulatorHLSL.cpp", + "src/compiler/translator/hlsl/ImageFunctionHLSL.cpp", + "src/compiler/translator/hlsl/OutputHLSL.cpp", + "src/compiler/translator/hlsl/ResourcesHLSL.cpp", + "src/compiler/translator/hlsl/ShaderStorageBlockFunctionHLSL.cpp", + "src/compiler/translator/hlsl/ShaderStorageBlockOutputHLSL.cpp", + "src/compiler/translator/hlsl/StructureHLSL.cpp", + "src/compiler/translator/hlsl/TextureFunctionHLSL.cpp", + "src/compiler/translator/hlsl/TranslatorHLSL.cpp", + "src/compiler/translator/hlsl/UtilsHLSL.cpp", + "src/compiler/translator/hlsl/blocklayoutHLSL.cpp", + "src/compiler/translator/hlsl/emulated_builtin_functions_hlsl_autogen.cpp", + "src/compiler/translator/tree_ops/hlsl/AddDefaultReturnStatements.cpp", + "src/compiler/translator/tree_ops/hlsl/AggregateAssignArraysInSSBOs.cpp", + "src/compiler/translator/tree_ops/hlsl/AggregateAssignStructsInSSBOs.cpp", + "src/compiler/translator/tree_ops/hlsl/ArrayReturnValueToOutParameter.cpp", + "src/compiler/translator/tree_ops/hlsl/BreakVariableAliasingInInnerLoops.cpp", + "src/compiler/translator/tree_ops/hlsl/ExpandIntegerPowExpressions.cpp", + "src/compiler/translator/tree_ops/hlsl/RecordUniformBlocksWithLargeArrayMember.cpp", + "src/compiler/translator/tree_ops/hlsl/RemoveSwitchFallThrough.cpp", + "src/compiler/translator/tree_ops/hlsl/RewriteAtomicFunctionExpressions.cpp", + "src/compiler/translator/tree_ops/hlsl/RewriteElseBlocks.cpp", + "src/compiler/translator/tree_ops/hlsl/RewriteExpressionsWithShaderStorageBlock.cpp", + "src/compiler/translator/tree_ops/hlsl/RewriteUnaryMinusOperatorInt.cpp", + "src/compiler/translator/tree_ops/hlsl/SeparateArrayConstructorStatements.cpp", + "src/compiler/translator/tree_ops/hlsl/SeparateArrayInitialization.cpp", + "src/compiler/translator/tree_ops/hlsl/SeparateExpressionsReturningArrays.cpp", + "src/compiler/translator/tree_ops/hlsl/UnfoldShortCircuitToIf.cpp", + "src/compiler/translator/tree_ops/hlsl/WrapSwitchStatementsInBlocks.cpp", +} +local angle_translator_lib_spirv_sources = { + "src/compiler/translator/spirv/BuildSPIRV.cpp", + "src/compiler/translator/spirv/BuiltinsWorkaround.cpp", + "src/compiler/translator/spirv/OutputSPIRV.cpp", + "src/compiler/translator/spirv/TranslatorSPIRV.cpp", + "src/compiler/translator/tree_ops/spirv/EmulateAdvancedBlendEquations.cpp", + "src/compiler/translator/tree_ops/spirv/EmulateDithering.cpp", + "src/compiler/translator/tree_ops/spirv/EmulateFragColorData.cpp", + "src/compiler/translator/tree_ops/spirv/EmulateFramebufferFetch.cpp", + "src/compiler/translator/tree_ops/spirv/EmulateYUVBuiltIns.cpp", + "src/compiler/translator/tree_ops/spirv/FlagSamplersWithTexelFetch.cpp", + "src/compiler/translator/tree_ops/spirv/ReswizzleYUVOps.cpp", + "src/compiler/translator/tree_ops/spirv/RewriteInterpolateAtOffset.cpp", + "src/compiler/translator/tree_ops/spirv/RewriteR32fImages.cpp", +} +local angle_translator_essl_symbol_table_sources = { + "src/compiler/translator/ImmutableString_ESSL_autogen.cpp", + "src/compiler/translator/SymbolTable_ESSL_autogen.cpp", +} +local angle_translator_glsl_symbol_table_sources = { + "src/compiler/translator/ImmutableString_autogen.cpp", + "src/compiler/translator/SymbolTable_autogen.cpp", +} +local angle_translator_lib_msl_sources = { + "src/compiler/translator/msl/AstHelpers.cpp", + "src/compiler/translator/msl/ConstantNames.cpp", + "src/compiler/translator/msl/DiscoverDependentFunctions.cpp", + "src/compiler/translator/msl/DiscoverEnclosingFunctionTraverser.cpp", + "src/compiler/translator/msl/DriverUniformMetal.cpp", + "src/compiler/translator/msl/EmitMetal.cpp", + "src/compiler/translator/msl/IdGen.cpp", + "src/compiler/translator/msl/IntermRebuild.cpp", + "src/compiler/translator/msl/Layout.cpp", + "src/compiler/translator/msl/MapFunctionsToDefinitions.cpp", + "src/compiler/translator/msl/MapSymbols.cpp", + "src/compiler/translator/msl/ModifyStruct.cpp", + "src/compiler/translator/msl/Name.cpp", + "src/compiler/translator/msl/Pipeline.cpp", + "src/compiler/translator/msl/ProgramPrelude.cpp", + "src/compiler/translator/msl/RewritePipelines.cpp", + "src/compiler/translator/msl/SymbolEnv.cpp", + "src/compiler/translator/msl/ToposortStructs.cpp", + "src/compiler/translator/msl/TranslatorMSL.cpp", + "src/compiler/translator/msl/UtilsMSL.cpp", + "src/compiler/translator/tree_ops/msl/AddExplicitTypeCasts.cpp", + "src/compiler/translator/tree_ops/msl/ConvertUnsupportedConstructorsToFunctionCalls.cpp", + "src/compiler/translator/tree_ops/msl/FixTypeConstructors.cpp", + "src/compiler/translator/tree_ops/msl/GuardFragDepthWrite.cpp", + "src/compiler/translator/tree_ops/msl/HoistConstants.cpp", + "src/compiler/translator/tree_ops/msl/IntroduceVertexIndexID.cpp", + "src/compiler/translator/tree_ops/msl/NameEmbeddedUniformStructsMetal.cpp", + "src/compiler/translator/tree_ops/msl/ReduceInterfaceBlocks.cpp", + "src/compiler/translator/tree_ops/msl/RewriteCaseDeclarations.cpp", + "src/compiler/translator/tree_ops/msl/RewriteInterpolants.cpp", + "src/compiler/translator/tree_ops/msl/RewriteOutArgs.cpp", + "src/compiler/translator/tree_ops/msl/RewriteUnaddressableReferences.cpp", + "src/compiler/translator/tree_ops/msl/SeparateCompoundExpressions.cpp", + "src/compiler/translator/tree_ops/msl/SeparateCompoundStructDeclarations.cpp", + "src/compiler/translator/tree_ops/msl/TransposeRowMajorMatrices.cpp", + "src/compiler/translator/tree_ops/msl/WrapMain.cpp", +} +local angle_preprocessor_sources = { + "src/compiler/preprocessor/DiagnosticsBase.cpp", + "src/compiler/preprocessor/DirectiveHandlerBase.cpp", + "src/compiler/preprocessor/DirectiveParser.cpp", + "src/compiler/preprocessor/Input.cpp", + "src/compiler/preprocessor/Lexer.cpp", + "src/compiler/preprocessor/Macro.cpp", + "src/compiler/preprocessor/MacroExpander.cpp", + "src/compiler/preprocessor/Preprocessor.cpp", + "src/compiler/preprocessor/Token.cpp", + "src/compiler/preprocessor/preprocessor_lex_autogen.cpp", + "src/compiler/preprocessor/preprocessor_tab_autogen.cpp", +} +-- end src/compiler.gni + +-- src/libGLESv2.gni +local libangle_common_sources = { + "src/common/Float16ToFloat32.cpp", + "src/common/MemoryBuffer.cpp", + "src/common/PackedEGLEnums_autogen.cpp", + "src/common/PackedEnums.cpp", + "src/common/PackedGLEnums_autogen.cpp", + "src/common/PoolAlloc.cpp", + "src/common/RingBufferAllocator.cpp", + "src/common/WorkerThread.cpp", + "src/common/aligned_memory.cpp", + "src/common/android_util.cpp", + "src/common/angleutils.cpp", + "src/common/base/anglebase/sha1.cc", + "src/common/debug.cpp", + "src/common/entry_points_enum_autogen.cpp", + "src/common/event_tracer.cpp", + "src/common/mathutil.cpp", + "src/common/matrix_utils.cpp", + "src/common/platform_helpers.cpp", + "src/common/string_utils.cpp", + "src/common/system_utils.cpp", + "src/common/tls.cpp", + "src/common/uniform_type_info_autogen.cpp", + "src/common/utilities.cpp", +} +if is_plat("android") then + table.join2(libangle_common_sources, "src/common/backtrace_utils_android.cpp") +else + table.join2(libangle_common_sources, "src/common/backtrace_utils_noop.cpp") +end +if is_plat("linux", "android") then + table.join2(libangle_common_sources, "src/common/system_utils_linux.cpp") + table.join2(libangle_common_sources, "src/common/system_utils_posix.cpp") +end +if is_plat("macosx", "iphoneos") then + table.join2(libangle_common_sources, { + "src/common/apple_platform_utils.mm", + "src/common/system_utils_apple.cpp", + "src/common/system_utils_posix.cpp", + }) + if is_plat("macosx") then + table.join2(libangle_common_sources, "src/common/gl/cgl/FunctionsCGL.cpp") + table.join2(libangle_common_sources, "src/common/system_utils_mac.cpp") + elseif is_plat("iphoneos") then + table.join2(libangle_common_sources, "src/common/system_utils_ios.cpp") + end +end +if is_plat("windows") then + table.join2(libangle_common_sources, "src/common/system_utils_win.cpp") + table.join2(libangle_common_sources, "src/common/system_utils_win32.cpp") +end +local libangle_common_shader_state_sources = { + "src/common/CompiledShaderState.cpp" +} +local libangle_common_cl_sources = { + "src/common/PackedCLEnums_autogen.cpp" +} +local xxhash_sources = { + "src/common/third_party/xxhash/xxhash.c" +} +local libangle_image_util_sources = { + "src/image_util/copyimage.cpp", + "src/image_util/imageformats.cpp", + "src/image_util/loadimage.cpp", + "src/image_util/loadimage_astc.cpp", + "src/image_util/loadimage_etc.cpp", + "src/image_util/loadimage_paletted.cpp", + "src/image_util/storeimage_paletted.cpp", + -- no astc encoder + "src/image_util/AstcDecompressorNoOp.cpp" +} +local libangle_gpu_info_util_sources = { "src/gpu_info_util/SystemInfo.cpp" } +local libangle_gpu_info_util_win_sources = { "src/gpu_info_util/SystemInfo_win.cpp" } +local libangle_gpu_info_util_android_sources = { "src/gpu_info_util/SystemInfo_android.cpp" } +local libangle_gpu_info_util_linux_sources = { "src/gpu_info_util/SystemInfo_linux.cpp" } +local libangle_gpu_info_util_vulkan_sources = { "src/gpu_info_util/SystemInfo_vulkan.cpp" } +local libangle_gpu_info_util_libpci_sources = { "src/gpu_info_util/SystemInfo_libpci.cpp" } +local libangle_gpu_info_util_x11_sources = { "src/gpu_info_util/SystemInfo_x11.cpp" } +local libangle_gpu_info_util_mac_sources = { + "src/gpu_info_util/SystemInfo_apple.mm", + "src/gpu_info_util/SystemInfo_macos.mm", +} +local libangle_gpu_info_util_ios_sources = { + "src/gpu_info_util/SystemInfo_apple.mm", + "src/gpu_info_util/SystemInfo_ios.cpp", +} +local libXNVCtrl_sources = { "src/third_party/libXNVCtrl/NVCtrl.c" } +local libangle_headers = { "src/libANGLE/entry_points_utils.cpp" } +local libangle_sources = { + "src/libANGLE/AttributeMap.cpp", + "src/libANGLE/BlobCache.cpp", + "src/libANGLE/Buffer.cpp", + "src/libANGLE/Caps.cpp", + "src/libANGLE/Compiler.cpp", + "src/libANGLE/Config.cpp", + "src/libANGLE/Context.cpp", + "src/libANGLE/ContextMutex.cpp", + "src/libANGLE/Context_gles_1_0.cpp", + "src/libANGLE/Debug.cpp", + "src/libANGLE/Device.cpp", + "src/libANGLE/Display.cpp", + "src/libANGLE/EGLSync.cpp", + "src/libANGLE/Error.cpp", + "src/libANGLE/Fence.cpp", + "src/libANGLE/Framebuffer.cpp", + "src/libANGLE/FramebufferAttachment.cpp", + "src/libANGLE/GLES1Renderer.cpp", + "src/libANGLE/GLES1State.cpp", + "src/libANGLE/GlobalMutex.cpp", + "src/libANGLE/HandleAllocator.cpp", + "src/libANGLE/Image.cpp", + "src/libANGLE/ImageIndex.cpp", + "src/libANGLE/IndexRangeCache.cpp", + "src/libANGLE/LoggingAnnotator.cpp", + "src/libANGLE/MemoryObject.cpp", + "src/libANGLE/MemoryProgramCache.cpp", + "src/libANGLE/MemoryShaderCache.cpp", + "src/libANGLE/Observer.cpp", + "src/libANGLE/Overlay.cpp", + "src/libANGLE/OverlayWidgets.cpp", + "src/libANGLE/Overlay_autogen.cpp", + "src/libANGLE/Overlay_font_autogen.cpp", + "src/libANGLE/PixelLocalStorage.cpp", + "src/libANGLE/Platform.cpp", + "src/libANGLE/Program.cpp", + "src/libANGLE/ProgramExecutable.cpp", + "src/libANGLE/ProgramLinkedResources.cpp", + "src/libANGLE/ProgramPipeline.cpp", + "src/libANGLE/Query.cpp", + "src/libANGLE/Renderbuffer.cpp", + "src/libANGLE/ResourceManager.cpp", + "src/libANGLE/Sampler.cpp", + "src/libANGLE/Semaphore.cpp", + "src/libANGLE/Shader.cpp", + "src/libANGLE/ShareGroup.cpp", + "src/libANGLE/State.cpp", + "src/libANGLE/Stream.cpp", + "src/libANGLE/Surface.cpp", + "src/libANGLE/Texture.cpp", + "src/libANGLE/Thread.cpp", + "src/libANGLE/TransformFeedback.cpp", + "src/libANGLE/Uniform.cpp", + "src/libANGLE/VaryingPacking.cpp", + "src/libANGLE/VertexArray.cpp", + "src/libANGLE/VertexAttribute.cpp", + "src/libANGLE/angletypes.cpp", + "src/libANGLE/context_private_call_gles.cpp", + "src/libANGLE/es3_copy_conversion_table_autogen.cpp", + "src/libANGLE/format_map_autogen.cpp", + "src/libANGLE/format_map_desktop.cpp", + "src/libANGLE/formatutils.cpp", + "src/libANGLE/gles_extensions_autogen.cpp", + "src/libANGLE/queryconversions.cpp", + "src/libANGLE/queryutils.cpp", + "src/libANGLE/renderer/BufferImpl.cpp", + "src/libANGLE/renderer/ContextImpl.cpp", + "src/libANGLE/renderer/DeviceImpl.cpp", + "src/libANGLE/renderer/DisplayImpl.cpp", + "src/libANGLE/renderer/EGLReusableSync.cpp", + "src/libANGLE/renderer/EGLSyncImpl.cpp", + "src/libANGLE/renderer/Format_table_autogen.cpp", + "src/libANGLE/renderer/FramebufferImpl.cpp", + "src/libANGLE/renderer/ImageImpl.cpp", + "src/libANGLE/renderer/ProgramImpl.cpp", + "src/libANGLE/renderer/ProgramPipelineImpl.cpp", + "src/libANGLE/renderer/QueryImpl.cpp", + "src/libANGLE/renderer/RenderbufferImpl.cpp", + "src/libANGLE/renderer/ShaderImpl.cpp", + "src/libANGLE/renderer/SurfaceImpl.cpp", + "src/libANGLE/renderer/TextureImpl.cpp", + "src/libANGLE/renderer/TransformFeedbackImpl.cpp", + "src/libANGLE/renderer/VertexArrayImpl.cpp", + "src/libANGLE/renderer/driver_utils.cpp", + "src/libANGLE/renderer/load_functions_table_autogen.cpp", + "src/libANGLE/renderer/renderer_utils.cpp", + "src/libANGLE/validationEGL.cpp", + "src/libANGLE/validationES.cpp", + "src/libANGLE/validationES1.cpp", + "src/libANGLE/validationES2.cpp", + "src/libANGLE/validationES3.cpp", + "src/libANGLE/validationES31.cpp", + "src/libANGLE/validationES32.cpp", + "src/libANGLE/validationESEXT.cpp", +} +local libangle_gl_sources = { + "src/libANGLE/Context_gl.cpp", + "src/libANGLE/context_private_call_gl.cpp", + "src/libANGLE/validationGL1.cpp", + "src/libANGLE/validationGL2.cpp", + "src/libANGLE/validationGL3.cpp", + "src/libANGLE/validationGL4.cpp", +} +local libangle_cl_sources = { + "src/libANGLE/CLBuffer.cpp", + "src/libANGLE/CLCommandQueue.cpp", + "src/libANGLE/CLContext.cpp", + "src/libANGLE/CLDevice.cpp", + "src/libANGLE/CLEvent.cpp", + "src/libANGLE/CLImage.cpp", + "src/libANGLE/CLKernel.cpp", + "src/libANGLE/CLMemory.cpp", + "src/libANGLE/CLObject.cpp", + "src/libANGLE/CLPlatform.cpp", + "src/libANGLE/CLProgram.cpp", + "src/libANGLE/CLSampler.cpp", + "src/libANGLE/cl_utils.cpp", + "src/libANGLE/renderer/CLCommandQueueImpl.cpp", + "src/libANGLE/renderer/CLContextImpl.cpp", + "src/libANGLE/renderer/CLDeviceImpl.cpp", + "src/libANGLE/renderer/CLEventImpl.cpp", + "src/libANGLE/renderer/CLExtensions.cpp", + "src/libANGLE/renderer/CLKernelImpl.cpp", + "src/libANGLE/renderer/CLMemoryImpl.cpp", + "src/libANGLE/renderer/CLPlatformImpl.cpp", + "src/libANGLE/renderer/CLProgramImpl.cpp", + "src/libANGLE/renderer/CLSamplerImpl.cpp", + "src/libANGLE/validationCL.cpp", +} +local libangle_mac_sources = { + "src/libANGLE/renderer/driver_utils_mac.mm", +} +local libangle_capture_sources = { + "src/libANGLE/capture/FrameCapture.cpp", + "src/libANGLE/capture/capture_egl_autogen.cpp", + "src/libANGLE/capture/capture_gl_1_autogen.cpp", + "src/libANGLE/capture/capture_gl_1_params.cpp", + "src/libANGLE/capture/capture_gl_2_autogen.cpp", + "src/libANGLE/capture/capture_gl_2_params.cpp", + "src/libANGLE/capture/capture_gl_3_autogen.cpp", + "src/libANGLE/capture/capture_gl_3_params.cpp", + "src/libANGLE/capture/capture_gl_4_autogen.cpp", + "src/libANGLE/capture/capture_gl_4_params.cpp", + "src/libANGLE/capture/capture_gles_1_0_autogen.cpp", + "src/libANGLE/capture/capture_gles_1_0_params.cpp", + "src/libANGLE/capture/capture_gles_2_0_autogen.cpp", + "src/libANGLE/capture/capture_gles_2_0_params.cpp", + "src/libANGLE/capture/capture_gles_3_0_autogen.cpp", + "src/libANGLE/capture/capture_gles_3_0_params.cpp", + "src/libANGLE/capture/capture_gles_3_1_autogen.cpp", + "src/libANGLE/capture/capture_gles_3_1_params.cpp", + "src/libANGLE/capture/capture_gles_3_2_autogen.cpp", + "src/libANGLE/capture/capture_gles_3_2_params.cpp", + "src/libANGLE/capture/capture_gles_ext_autogen.cpp", + "src/libANGLE/capture/capture_gles_ext_params.cpp", +} +local libglesv2_sources = { + "src/libGLESv2/egl_ext_stubs.cpp", + "src/libGLESv2/egl_stubs.cpp", + "src/libGLESv2/entry_points_egl_autogen.cpp", + "src/libGLESv2/entry_points_egl_ext_autogen.cpp", + "src/libGLESv2/entry_points_gles_1_0_autogen.cpp", + "src/libGLESv2/entry_points_gles_2_0_autogen.cpp", + "src/libGLESv2/entry_points_gles_3_0_autogen.cpp", + "src/libGLESv2/entry_points_gles_3_1_autogen.cpp", + "src/libGLESv2/entry_points_gles_3_2_autogen.cpp", + "src/libGLESv2/entry_points_gles_ext_autogen.cpp", + "src/libGLESv2/global_state.cpp", + "src/libGLESv2/libGLESv2_autogen.cpp", + "src/libGLESv2/proc_table_egl_autogen.cpp", +} +local libglesv2_gl_sources = { + "src/libGLESv2/entry_points_gl_1_autogen.cpp", + "src/libGLESv2/entry_points_gl_2_autogen.cpp", + "src/libGLESv2/entry_points_gl_3_autogen.cpp", + "src/libGLESv2/entry_points_gl_4_autogen.cpp", +} +local libglesv2_cl_sources = { + "src/libGLESv2/cl_dispatch_table.cpp", + "src/libGLESv2/cl_stubs.cpp", + "src/libGLESv2/entry_points_cl_autogen.cpp", + "src/libGLESv2/entry_points_cl_utils.cpp", + "src/libGLESv2/proc_table_cl_autogen.cpp", +} +local libglesv1_cm_sources = { + "src/libGLESv1_CM/libGLESv1_CM.cpp", +} +if is_plat("windows") then + table.join2(libglesv1_cm_sources, "src/libGLESv1_CM/libGLESv1_CM.rc") +end +local libegl_sources = { + "src/libEGL/libEGL_autogen.cpp", +} +-- end src/libGLESv2.gni + +-- src/common/linux/BUILD.gn +local angle_dma_buf = { + "src/common/linux/dma_buf_utils.cpp", +} +-- end src/common/linux/BUILD.gn + +-- src/libANGLE/renderer/null/null_backend.gni +local null_backend_sources = { + "src/libANGLE/renderer/null/BufferNULL.cpp", + "src/libANGLE/renderer/null/CompilerNULL.cpp", + "src/libANGLE/renderer/null/ContextNULL.cpp", + "src/libANGLE/renderer/null/DeviceNULL.cpp", + "src/libANGLE/renderer/null/DisplayNULL.cpp", + "src/libANGLE/renderer/null/FenceNVNULL.cpp", + "src/libANGLE/renderer/null/FramebufferNULL.cpp", + "src/libANGLE/renderer/null/ImageNULL.cpp", + "src/libANGLE/renderer/null/ProgramExecutableNULL.cpp", + "src/libANGLE/renderer/null/ProgramNULL.cpp", + "src/libANGLE/renderer/null/ProgramPipelineNULL.cpp", + "src/libANGLE/renderer/null/QueryNULL.cpp", + "src/libANGLE/renderer/null/RenderbufferNULL.cpp", + "src/libANGLE/renderer/null/SamplerNULL.cpp", + "src/libANGLE/renderer/null/ShaderNULL.cpp", + "src/libANGLE/renderer/null/SurfaceNULL.cpp", + "src/libANGLE/renderer/null/SyncNULL.cpp", + "src/libANGLE/renderer/null/TextureNULL.cpp", + "src/libANGLE/renderer/null/TransformFeedbackNULL.cpp", + "src/libANGLE/renderer/null/VertexArrayNULL.cpp", +} +-- end src/libANGLE/renderer/null/null_backend.gni + +-- src/libANGLE/renderer/cl/BUILD.gn +local cl_backend_sources = { + "src/libANGLE/renderer/cl/CLCommandQueueCL.cpp", + "src/libANGLE/renderer/cl/CLContextCL.cpp", + "src/libANGLE/renderer/cl/CLDeviceCL.cpp", + "src/libANGLE/renderer/cl/CLEventCL.cpp", + "src/libANGLE/renderer/cl/CLKernelCL.cpp", + "src/libANGLE/renderer/cl/CLMemoryCL.cpp", + "src/libANGLE/renderer/cl/CLPlatformCL.cpp", + "src/libANGLE/renderer/cl/CLProgramCL.cpp", + "src/libANGLE/renderer/cl/CLSamplerCL.cpp", + "src/libANGLE/renderer/cl/cl_util.cpp", +} +-- end src/libANGLE/renderer/cl/BUILD.gn + +-- src/libANGLE/renderer/d3d/d3d_backend.gni +local d3d_shared_sources = { + "src/libANGLE/renderer/d3d/BufferD3D.cpp", + "src/libANGLE/renderer/d3d/CompilerD3D.cpp", + "src/libANGLE/renderer/d3d/DeviceD3D.cpp", + "src/libANGLE/renderer/d3d/DisplayD3D.cpp", + "src/libANGLE/renderer/d3d/DynamicHLSL.cpp", + "src/libANGLE/renderer/d3d/DynamicImage2DHLSL.cpp", + "src/libANGLE/renderer/d3d/EGLImageD3D.cpp", + "src/libANGLE/renderer/d3d/FramebufferD3D.cpp", + "src/libANGLE/renderer/d3d/HLSLCompiler.cpp", + "src/libANGLE/renderer/d3d/ImageD3D.cpp", + "src/libANGLE/renderer/d3d/IndexBuffer.cpp", + "src/libANGLE/renderer/d3d/IndexDataManager.cpp", + "src/libANGLE/renderer/d3d/NativeWindowD3D.cpp", + "src/libANGLE/renderer/d3d/ProgramD3D.cpp", + "src/libANGLE/renderer/d3d/ProgramExecutableD3D.cpp", + "src/libANGLE/renderer/d3d/RenderTargetD3D.cpp", + "src/libANGLE/renderer/d3d/RenderbufferD3D.cpp", + "src/libANGLE/renderer/d3d/RendererD3D.cpp", + "src/libANGLE/renderer/d3d/ShaderD3D.cpp", + "src/libANGLE/renderer/d3d/ShaderExecutableD3D.cpp", + "src/libANGLE/renderer/d3d/SurfaceD3D.cpp", + "src/libANGLE/renderer/d3d/SwapChainD3D.cpp", + "src/libANGLE/renderer/d3d/TextureD3D.cpp", + "src/libANGLE/renderer/d3d/VertexBuffer.cpp", + "src/libANGLE/renderer/d3d/VertexDataManager.cpp", + "src/libANGLE/renderer/d3d/driver_utils_d3d.cpp", +} +local d3d9_backend_sources = { + "src/libANGLE/renderer/d3d/d3d9/Blit9.cpp", + "src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp", + "src/libANGLE/renderer/d3d/d3d9/Context9.cpp", + "src/libANGLE/renderer/d3d/d3d9/DebugAnnotator9.cpp", + "src/libANGLE/renderer/d3d/d3d9/Fence9.cpp", + "src/libANGLE/renderer/d3d/d3d9/Framebuffer9.cpp", + "src/libANGLE/renderer/d3d/d3d9/Image9.cpp", + "src/libANGLE/renderer/d3d/d3d9/IndexBuffer9.cpp", + "src/libANGLE/renderer/d3d/d3d9/NativeWindow9.cpp", + "src/libANGLE/renderer/d3d/d3d9/Query9.cpp", + "src/libANGLE/renderer/d3d/d3d9/RenderTarget9.cpp", + "src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp", + "src/libANGLE/renderer/d3d/d3d9/ShaderExecutable9.cpp", + "src/libANGLE/renderer/d3d/d3d9/StateManager9.cpp", + "src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp", + "src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp", + "src/libANGLE/renderer/d3d/d3d9/VertexBuffer9.cpp", + "src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.cpp", + "src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp", + "src/libANGLE/renderer/d3d/d3d9/renderer9_utils.cpp", +} +local d3d11_backend_sources = { + "src/libANGLE/renderer/d3d/d3d11/Blit11.cpp", + "src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp", + "src/libANGLE/renderer/d3d/d3d11/Clear11.cpp", + "src/libANGLE/renderer/d3d/d3d11/Context11.cpp", + "src/libANGLE/renderer/d3d/d3d11/DebugAnnotator11.cpp", + "src/libANGLE/renderer/d3d/d3d11/ExternalImageSiblingImpl11.cpp", + "src/libANGLE/renderer/d3d/d3d11/Fence11.cpp", + "src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp", + "src/libANGLE/renderer/d3d/d3d11/Image11.cpp", + "src/libANGLE/renderer/d3d/d3d11/IndexBuffer11.cpp", + "src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp", + "src/libANGLE/renderer/d3d/d3d11/MappedSubresourceVerifier11.cpp", + "src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp", + "src/libANGLE/renderer/d3d/d3d11/Program11.cpp", + "src/libANGLE/renderer/d3d/d3d11/ProgramPipeline11.cpp", + "src/libANGLE/renderer/d3d/d3d11/Query11.cpp", + "src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp", + "src/libANGLE/renderer/d3d/d3d11/RenderTarget11.cpp", + "src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp", + "src/libANGLE/renderer/d3d/d3d11/ResourceManager11.cpp", + "src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp", + "src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp", + "src/libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.cpp", + "src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp", + "src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp", + "src/libANGLE/renderer/d3d/d3d11/TransformFeedback11.cpp", + "src/libANGLE/renderer/d3d/d3d11/Trim11.cpp", + "src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp", + "src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp", + "src/libANGLE/renderer/d3d/d3d11/formatutils11.cpp", + "src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp", + "src/libANGLE/renderer/d3d/d3d11/texture_format_table.cpp", + "src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp", + "src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp", + "src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.cpp", +} +-- end src/libANGLE/renderer/d3d/d3d_backend.gni + +-- src/libANGLE/renderer/gl/gl_backend.gni +local gl_backend_sources = { + "src/libANGLE/renderer/gl/BlitGL.cpp", + "src/libANGLE/renderer/gl/BufferGL.cpp", + "src/libANGLE/renderer/gl/ClearMultiviewGL.cpp", + "src/libANGLE/renderer/gl/CompilerGL.cpp", + "src/libANGLE/renderer/gl/ContextGL.cpp", + "src/libANGLE/renderer/gl/DispatchTableGL_autogen.cpp", + "src/libANGLE/renderer/gl/DisplayGL.cpp", + "src/libANGLE/renderer/gl/FenceNVGL.cpp", + "src/libANGLE/renderer/gl/FramebufferGL.cpp", + "src/libANGLE/renderer/gl/FunctionsGL.cpp", + "src/libANGLE/renderer/gl/ImageGL.cpp", + "src/libANGLE/renderer/gl/MemoryObjectGL.cpp", + "src/libANGLE/renderer/gl/PLSProgramCache.cpp", + "src/libANGLE/renderer/gl/ProgramExecutableGL.cpp", + "src/libANGLE/renderer/gl/ProgramGL.cpp", + "src/libANGLE/renderer/gl/ProgramPipelineGL.cpp", + "src/libANGLE/renderer/gl/QueryGL.cpp", + "src/libANGLE/renderer/gl/RenderbufferGL.cpp", + "src/libANGLE/renderer/gl/RendererGL.cpp", + "src/libANGLE/renderer/gl/SamplerGL.cpp", + "src/libANGLE/renderer/gl/SemaphoreGL.cpp", + "src/libANGLE/renderer/gl/ShaderGL.cpp", + "src/libANGLE/renderer/gl/StateManagerGL.cpp", + "src/libANGLE/renderer/gl/SurfaceGL.cpp", + "src/libANGLE/renderer/gl/SyncGL.cpp", + "src/libANGLE/renderer/gl/TextureGL.cpp", + "src/libANGLE/renderer/gl/TransformFeedbackGL.cpp", + "src/libANGLE/renderer/gl/VertexArrayGL.cpp", + "src/libANGLE/renderer/gl/formatutilsgl.cpp", + "src/libANGLE/renderer/gl/renderergl_utils.cpp", + "src/libANGLE/renderer/gl/null_functions.cpp", +} +local gl_backend_sources_wgl = { + "src/libANGLE/renderer/gl/wgl/ContextWGL.cpp", + "src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp", + "src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp", + "src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp", + "src/libANGLE/renderer/gl/wgl/FunctionsWGL.cpp", + "src/libANGLE/renderer/gl/wgl/PbufferSurfaceWGL.cpp", + "src/libANGLE/renderer/gl/wgl/RendererWGL.cpp", + "src/libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp", + "src/libANGLE/renderer/gl/wgl/wgl_utils.cpp", +} +if is_plat("windows") then + table.join2(gl_backend_sources, gl_backend_sources_wgl) +end +local gl_backend_sources_glx = { + "src/libANGLE/renderer/gl/glx/DisplayGLX.cpp", + "src/libANGLE/renderer/gl/glx/FunctionsGLX.cpp", + "src/libANGLE/renderer/gl/glx/PbufferSurfaceGLX.cpp", + "src/libANGLE/renderer/gl/glx/PixmapSurfaceGLX.cpp", + "src/libANGLE/renderer/gl/glx/WindowSurfaceGLX.cpp", + "src/libANGLE/renderer/gl/glx/glx_utils.cpp", +} +if has_config("use_x11") then + table.join2(gl_backend_sources, gl_backend_sources_glx) +end +local gl_backend_sources_egl = { + "src/libANGLE/renderer/gl/egl/ContextEGL.cpp", + "src/libANGLE/renderer/gl/egl/DeviceEGL.cpp", + "src/libANGLE/renderer/gl/egl/DisplayEGL.cpp", + "src/libANGLE/renderer/gl/egl/DmaBufImageSiblingEGL.cpp", + "src/libANGLE/renderer/gl/egl/FunctionsEGL.cpp", + "src/libANGLE/renderer/gl/egl/FunctionsEGLDL.cpp", + "src/libANGLE/renderer/gl/egl/ImageEGL.cpp", + "src/libANGLE/renderer/gl/egl/PbufferSurfaceEGL.cpp", + "src/libANGLE/renderer/gl/egl/RendererEGL.cpp", + "src/libANGLE/renderer/gl/egl/SurfaceEGL.cpp", + "src/libANGLE/renderer/gl/egl/SyncEGL.cpp", + "src/libANGLE/renderer/gl/egl/WindowSurfaceEGL.cpp", + "src/libANGLE/renderer/gl/egl/egl_utils.cpp", +} +if is_plat("linux") or is_plat("android") then + table.join2(gl_backend_sources, gl_backend_sources_egl) +end +local gl_backend_sources_android = { + "src/libANGLE/renderer/gl/egl/android/DisplayAndroid.cpp", + "src/libANGLE/renderer/gl/egl/android/NativeBufferImageSiblingAndroid.cpp", +} +if is_plat("android") then + table.join2(gl_backend_sources, gl_backend_sources_android) +end +local gl_backend_sources_cgl = { + "src/libANGLE/renderer/gl/cgl/ContextCGL.cpp", + "src/libANGLE/renderer/gl/cgl/DeviceCGL.cpp", + "src/libANGLE/renderer/gl/cgl/DisplayCGL.mm", + "src/libANGLE/renderer/gl/cgl/IOSurfaceSurfaceCGL.cpp", + "src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.cpp", + "src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm", +} +if has_config("enable_cgl") then + table.join2(gl_backend_sources, gl_backend_sources_cgl) +end +local gl_backend_sources_eagl = { + "src/libANGLE/renderer/gl/eagl/ContextEAGL.cpp", + "src/libANGLE/renderer/gl/eagl/DeviceEAGL.cpp", + "src/libANGLE/renderer/gl/eagl/DisplayEAGL.mm", + "src/libANGLE/renderer/gl/eagl/FunctionsEAGL.mm", + "src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.mm", + "src/libANGLE/renderer/gl/eagl/PbufferSurfaceEAGL.cpp", + "src/libANGLE/renderer/gl/eagl/WindowSurfaceEAGL.mm", +} +if has_config("enable_eagl") then + table.join2(gl_backend_sources, gl_backend_sources_eagl) +end +-- end src/libANGLE/renderer/gl/gl_backend.gni + +-- src/libANGLE/renderer/metal/metal_backend.gni +local metal_backend_sources = { + "src/libANGLE/renderer/metal/BufferMtl.mm", + "src/libANGLE/renderer/metal/CompilerMtl.mm", + "src/libANGLE/renderer/metal/ContextMtl.mm", + "src/libANGLE/renderer/metal/DeviceMtl.mm", + "src/libANGLE/renderer/metal/DisplayMtl.mm", + "src/libANGLE/renderer/metal/FrameBufferMtl.mm", + "src/libANGLE/renderer/metal/IOSurfaceSurfaceMtl.mm", + "src/libANGLE/renderer/metal/ImageMtl.mm", + "src/libANGLE/renderer/metal/ProgramExecutableMtl.mm", + "src/libANGLE/renderer/metal/ProgramMtl.mm", + "src/libANGLE/renderer/metal/ProvokingVertexHelper.mm", + "src/libANGLE/renderer/metal/QueryMtl.mm", + "src/libANGLE/renderer/metal/RenderBufferMtl.mm", + "src/libANGLE/renderer/metal/RenderTargetMtl.mm", + "src/libANGLE/renderer/metal/SamplerMtl.mm", + "src/libANGLE/renderer/metal/ShaderMtl.mm", + "src/libANGLE/renderer/metal/SurfaceMtl.mm", + "src/libANGLE/renderer/metal/SyncMtl.mm", + "src/libANGLE/renderer/metal/TextureMtl.mm", + "src/libANGLE/renderer/metal/TransformFeedbackMtl.mm", + "src/libANGLE/renderer/metal/VertexArrayMtl.mm", + "src/libANGLE/renderer/metal/blocklayoutMetal.cpp", + "src/libANGLE/renderer/metal/mtl_buffer_manager.mm", + "src/libANGLE/renderer/metal/mtl_buffer_pool.mm", + "src/libANGLE/renderer/metal/mtl_command_buffer.mm", + "src/libANGLE/renderer/metal/mtl_common.mm", + "src/libANGLE/renderer/metal/mtl_context_device.mm", + "src/libANGLE/renderer/metal/mtl_format_table_autogen.mm", + "src/libANGLE/renderer/metal/mtl_format_utils.mm", + "src/libANGLE/renderer/metal/mtl_library_cache.mm", + "src/libANGLE/renderer/metal/mtl_msl_utils.mm", + "src/libANGLE/renderer/metal/mtl_occlusion_query_pool.mm", + "src/libANGLE/renderer/metal/mtl_pipeline_cache.mm", + "src/libANGLE/renderer/metal/mtl_render_utils.mm", + "src/libANGLE/renderer/metal/mtl_resources.mm", + "src/libANGLE/renderer/metal/mtl_state_cache.mm", + "src/libANGLE/renderer/metal/mtl_utils.mm", + "src/libANGLE/renderer/metal/process.cpp", + "src/libANGLE/renderer/metal/renderermtl_utils.cpp", +} +-- end src/libANGLE/renderer/metal/metal_backend.gni + +-- src/libANGLE/renderer/vulkan/vulkan_backend.gni +local vulkan_backend_sources = { + "src/libANGLE/renderer/vulkan/AllocatorHelperPool.cpp", + "src/libANGLE/renderer/vulkan/AllocatorHelperRing.cpp", + "src/libANGLE/renderer/vulkan/BufferVk.cpp", + "src/libANGLE/renderer/vulkan/CommandProcessor.cpp", + "src/libANGLE/renderer/vulkan/CompilerVk.cpp", + "src/libANGLE/renderer/vulkan/ContextVk.cpp", + "src/libANGLE/renderer/vulkan/DebugAnnotatorVk.cpp", + "src/libANGLE/renderer/vulkan/DeviceVk.cpp", + "src/libANGLE/renderer/vulkan/DisplayVk.cpp", + "src/libANGLE/renderer/vulkan/FenceNVVk.cpp", + "src/libANGLE/renderer/vulkan/FramebufferVk.cpp", + "src/libANGLE/renderer/vulkan/ImageVk.cpp", + "src/libANGLE/renderer/vulkan/MemoryObjectVk.cpp", + "src/libANGLE/renderer/vulkan/MemoryTracking.cpp", + "src/libANGLE/renderer/vulkan/OverlayVk.cpp", + "src/libANGLE/renderer/vulkan/PersistentCommandPool.cpp", + "src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp", + "src/libANGLE/renderer/vulkan/ProgramPipelineVk.cpp", + "src/libANGLE/renderer/vulkan/ProgramVk.cpp", + "src/libANGLE/renderer/vulkan/QueryVk.cpp", + "src/libANGLE/renderer/vulkan/RenderTargetVk.cpp", + "src/libANGLE/renderer/vulkan/RenderbufferVk.cpp", + "src/libANGLE/renderer/vulkan/RendererVk.cpp", + "src/libANGLE/renderer/vulkan/ResourceVk.cpp", + "src/libANGLE/renderer/vulkan/SamplerVk.cpp", + "src/libANGLE/renderer/vulkan/SecondaryCommandBuffer.cpp", + "src/libANGLE/renderer/vulkan/SecondaryCommandPool.cpp", + "src/libANGLE/renderer/vulkan/SemaphoreVk.cpp", + "src/libANGLE/renderer/vulkan/ShaderInterfaceVariableInfoMap.cpp", + "src/libANGLE/renderer/vulkan/ShaderVk.cpp", + "src/libANGLE/renderer/vulkan/ShareGroupVk.cpp", + "src/libANGLE/renderer/vulkan/Suballocation.cpp", + "src/libANGLE/renderer/vulkan/SurfaceVk.cpp", + "src/libANGLE/renderer/vulkan/SyncVk.cpp", + "src/libANGLE/renderer/vulkan/TextureVk.cpp", + "src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp", + "src/libANGLE/renderer/vulkan/UtilsVk.cpp", + "src/libANGLE/renderer/vulkan/VertexArrayVk.cpp", + "src/libANGLE/renderer/vulkan/VkImageImageSiblingVk.cpp", + "src/libANGLE/renderer/vulkan/VulkanSecondaryCommandBuffer.cpp", + "src/libANGLE/renderer/vulkan/android/vk_android_utils.cpp", + "src/libANGLE/renderer/vulkan/spv_utils.cpp", + "src/libANGLE/renderer/vulkan/vk_cache_utils.cpp", + "src/libANGLE/renderer/vulkan/vk_caps_utils.cpp", + "src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp", + "src/libANGLE/renderer/vulkan/vk_format_utils.cpp", + "src/libANGLE/renderer/vulkan/vk_helpers.cpp", + "src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp", + "src/libANGLE/renderer/vulkan/vk_mandatory_format_support_table_autogen.cpp", + "src/libANGLE/renderer/vulkan/vk_utils.cpp", +} +-- end src/libANGLE/renderer/vulkan/vulkan_backend.gni + +-- BUILD.gn +local angle_capture_common = { + "src/common/frame_capture_utils.cpp", + "src/common/frame_capture_utils_autogen.cpp", +} +local angle_version_info = { "src/common/angle_version_info.cpp" } +local angle_d3d_format_tables = { + "src/libANGLE/renderer/dxgi_format_map_autogen.cpp", + "src/libANGLE/renderer/dxgi_support_table_autogen.cpp", + "src/libANGLE/renderer/d3d_format.cpp", +} +local angle_frame_capture_mock = { + "src/libANGLE/capture/FrameCapture_mock.cpp", + "src/libANGLE/capture/serialize_mock.cpp", +} +local angle_gl_enum_utils = { + "src/common/gl_enum_utils.cpp", + "src/common/gl_enum_utils_autogen.cpp", +} + +if is_kind("static") then + add_defines({ + "ANGLE_EXPORT=", + "ANGLE_STATIC=1", + "ANGLE_UTIL_EXPORT=", + "EGLAPI=", + "GL_APICALL=", + "GL_API=", + }) +end + +target("ANGLE") + if is_plat("windows") then + set_basename("libANGLE") + end + set_kind("static") + add_defines("LIBANGLE_IMPLEMENTATION") + add_defines("GL_GLES_PROTOTYPES=0", "EGL_EGL_PROTOTYPES=0") + add_includedirs("src", "include", "$(buildir)/gen/angle", {public = true}) + add_includedirs("src/common/base", + "src/common/third_party/xxhash", + "src/third_party/khronos", + "third_party/zlib/google", {public = true}) + add_files(libangle_headers) + add_files(libangle_sources) + add_files(libangle_common_sources) + add_files(libangle_common_shader_state_sources) + add_files(libangle_image_util_sources) + add_files(angle_preprocessor_sources) + add_files(angle_translator_sources) + add_files(angle_frame_capture_mock) + add_files(angle_version_info) + add_files(xxhash_sources) + add_files(zlib_wrapper_sources) + + -- gpuinfo util + add_files(libangle_gpu_info_util_sources) + if is_plat("windows") then + add_files(libangle_gpu_info_util_win_sources) + add_syslinks("setupapi", "dxgi") + end + if is_plat("linux") then + add_files(libangle_gpu_info_util_linux_sources) + end + if is_plat("macosx") then + add_files(libangle_gpu_info_util_mac_sources) + add_frameworks("CoreFoundation", "CoreGraphics", "IOKit") + end + if is_plat("android") then + add_files(libangle_gpu_info_util_android_sources) + end + if is_plat("iphoneos") then + add_files(libangle_gpu_info_util_ios_sources) + end + if has_config("use_x11") then + add_packages("libx11", "libxext", "libxi") + add_files(libangle_gpu_info_util_x11_sources) + add_files(libXNVCtrl_sources) + add_defines("GPU_INFO_USE_X11") + end + if has_config("use_libpci") then + add_packages("pciutils") + add_files(libangle_gpu_info_util_libpci_sources) + add_defines("GPU_INFO_USE_LIBPCI") + end + + -- backend + if has_config("enable_null") then + add_defines("ANGLE_ENABLE_NULL") + end + if has_config("enable_cl") then + add_defines("ANGLE_ENABLE_CL_PASSTHROUGH") + add_files("libangle_common_cl_sources") + end + if has_config("enable_glsl") then + add_files(angle_translator_glsl_sources) + add_files(angle_translator_glsl_base_sources) + add_files(angle_translator_glsl_and_vulkan_base_sources) + if is_plat("macosx", "iphoneos") then + add_files(angle_translator_glsl_apple_sources) + end + add_defines("ANGLE_ENABLE_GLSL") + end + if has_config("enable_essl") then + add_files(angle_translator_essl_sources) + add_defines("ANGLE_ENABLE_ESSL") + end + if has_config("enable_hlsl") then + add_files(angle_translator_hlsl_sources) + add_defines("ANGLE_ENABLE_HLSL") + end + if is_plat("windows") then + if has_config("enable_d3d9") or has_config("enable_d3d11") then + add_defines("ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ \"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }") + add_files(d3d_shared_sources) + end + if has_config("enable_d3d9") or has_config("enable_d3d11") or has_config("enable_gl") then + add_files(angle_d3d_format_tables) + end + if has_config("enable_d3d9") then + add_syslinks("d3d9", "delayimp") + add_defines("ANGLE_ENABLE_D3D9") + add_ldflags("/DELAYLOAD:d3d9.dll") + add_files(d3d9_backend_sources) + end + if has_config("enable_d3d11") then + add_syslinks("dxguid") + add_defines("ANGLE_ENABLE_D3D11") + add_defines("ANGLE_ENABLE_D3D11_COMPOSITOR_NATIVE_WINDOW") + add_files(d3d11_backend_sources) + end + end + if has_config("enable_gl") then + add_defines("ANGLE_ENABLE_OPENGL") + add_defines("ANGLE_ENABLE_OPENGL_NULL") + add_files(gl_backend_sources) + if has_config("enable_cgl") then + add_defines("GL_SILENCE_DEPRECATION", "ANGLE_ENABLE_CGL") + if is_plat("macosx") then + add_frameworks("OpenGL") + end + end + if has_config("enable_eagl") then + add_defines("GL_SILENCE_DEPRECATION", "ANGLE_ENABLE_EAGL") + if is_plat("macosx", "iphoneos") then + add_frameworks("OpenGLES") + end + end + if is_plat("linux") or is_plat("android") then + add_files(angle_dma_buf) + end + if is_plat("macosx") or is_plat("iphoneos") then + add_frameworks("IOSurface", "QuartzCore") + if is_plat("macosx") then + add_frameworks("Cocoa") + end + end + end + if has_config("enable_gl_desktop") then + add_packages("opengl") + add_defines("ANGLE_ENABLE_GL_DESKTOP_BACKEND") + add_files(angle_translator_glsl_symbol_table_sources) + else + add_files(angle_translator_essl_symbol_table_sources) + end + if has_config("enable_metal") then + add_defines("ANGLE_ENABLE_METAL") + add_frameworks("Metal") + add_files(metal_backend_sources) + add_files(angle_translator_lib_msl_sources) + end + if has_config("enable_vulkan") then + add_defines("ANGLE_ENABLE_VULKAN") + add_files(vulkan_backend_sources) + add_packages("vulkansdk") + -- TODO + end + + -- miscellanous + add_headerfiles("include/(**.h)|export.h") + add_defines("ANGLE_OUTSIDE_WEBKIT") + add_defines("ANGLE_ENABLE_SHARE_CONTEXT_LOCK=1", "ANGLE_ENABLE_CONTEXT_MUTEX=1") + add_packages("python") + add_packages("zlib") + -- add_packages("chromium_zlib") + if has_config("with_capture") then + add_defines("ANGLE_CAPTURE_ENABLED=1") + add_files("src/libANGLE/capture/serialize_mock.cpp") + add_files("angle_gl_enum_utils") + else + add_defines("ANGLE_CAPTURE_ENABLED=0") + end + if has_config("use_x11") then + add_defines("ANGLE_USE_X11") + end + if has_config("use_wayland") then + add_defines("ANGLE_USE_WAYLAND") + end + if is_plat("android") then + add_defines("ANGLE_USE_ANDROID_TLS_SLOT=1") + add_defines("ANGLE_ENABLE_GLOBAL_MUTEX_LOAD_TIME_ALLOCATE=1") + else + add_defines("ANGLE_PLATFORM_EXPORT=") + end + if is_plat("windows") then + add_defines("ANGLE_IS_WIN") + add_defines("WIN32_LEAN_AND_MEAN", "NOMINMAX", {public = true}) + add_syslinks("user32", "gdi32") + elseif is_plat("macosx") then + set_values("objc++.build.arc", false) + add_files(libangle_mac_sources) + elseif is_plat("linux") then + add_defines("ANGLE_IS_LINUX") + add_links("dl") + elseif is_plat("iphoneos") then + set_values("objc++.build.arc", false) + add_files("src/libANGLE/renderer/driver_utils_ios.mm") + end + before_build(function (target) + import("lib.detect.find_tool") + import("core.tool.toolchain") + import("core.base.option") + + -- generate version info + local python = find_tool("python") + assert(python, "python not found!") + local buildir = val("buildir") + if not os.isdir(buildir .. "/gen/angle") then + os.mkdir(buildir .. "/gen/angle") + end + io.writefile(buildir .. "/gen/response", "") + if option.get("verbose") then + print(python.program .. " " .. "./src/commit_id.py gen " .. buildir .. "/gen/angle/angle_commit.h") + end + os.vrunv(python.program, {"./src/commit_id.py", "gen", buildir .. "/gen/angle/angle_commit.h"}) + if option.get("verbose") then + print(python.program .. " " .. "./src/commit_id.py gen " .. buildir .. "/gen/angle/angle_commit_autogen.cpp") + end + os.vrunv(python.program, {"./src/program_serialize_data_version.py", buildir .. "/gen/angle/ANGLEShaderProgramVersion.h", buildir .. "/gen/response"}) + if option.get("verbose") then + print("Done generating version info for ANGLE.") + end + + -- add android syslinks + if target:is_plat("android") then + local ndk = toolchain.load("ndk") + local ndk_sdkver = ndk:config("ndk_sdkver") + if ndk_sdkver and tonumber(ndk_sdkver) >= 26 then + target:add("syslinks", "nativewindow") + else + target:add("syslinks", "android") + end + end + end) + +target("GLESv2") + set_kind("$(kind)") + add_deps("ANGLE") + add_defines("LIBGLESV2_IMPLEMENTATION") + add_defines("GL_GLES_PROTOTYPES=1", "EGL_EGL_PROTOTYPES=1", "GL_GLEXT_PROTOTYPES", "EGL_EGLEXT_PROTOTYPES") + add_files(libglesv2_sources) + if is_plat("windows") then + set_basename("libGLESv2") + add_files("src/libGLESv2/libGLESv2.rc") + add_files("src/libGLESv2/libGLESv2_autogen.def") + end + if is_plat("android") then + set_basename("GLESv2_angle") + end + if has_config("enable_cl") then + add_files(libglesv2_cl_sources) + end + if is_kind("shared") then + if is_plat("windows") then + add_defines("GL_APICALL=", "GL_API=") + else + add_defines( + "GL_APICALL=__attribute__((visibility(\"default\")))", + "GL_API=__attribute__((visibility(\"default\")))") + end + end + after_install(function (target) + if target:is_plat("windows") and target:kind() == "shared" then + local vcvars = import("core.tool.toolchain").load("msvc"):config("vcvars") + local winsdkdir = vcvars["WindowsSdkDir"] + local d3dcompiler = path.join(winsdkdir, "Redist", "D3D", target:arch(), "d3dcompiler_47.dll") + os.cp(d3dcompiler, path.join(target:installdir(), "bin")) + end + end) + +target("EGL") + set_kind("$(kind)") + add_deps("GLESv2") + add_defines("LIBEGL_IMPLEMENTATION") + add_defines("GL_GLES_PROTOTYPES=1", "EGL_EGL_PROTOTYPES=1", "GL_GLEXT_PROTOTYPES", "EGL_EGLEXT_PROTOTYPES") + add_files(libegl_sources) + add_defines("ANGLE_DISPATCH_LIBRARY=\"libGLESv2\"") + if is_plat("windows") then + set_basename("libEGL") + add_files("src/libEGL/libEGL.rc") + add_files("src/libEGL/libEGL_autogen.def") + end + if is_plat("android") then + set_basename("EGL_angle") + end + if is_kind("shared") then + add_files("src/libEGL/egl_loader_autogen.cpp") + add_defines("ANGLE_USE_EGL_LOADER") + if is_plat("windows") then + add_defines("EGLAPI=") + else + add_defines("EGLAPI=__attribute__((visibility(\"default\")))") + end + end diff --git a/packages/a/angle/xmake.lua b/packages/a/angle/xmake.lua new file mode 100644 index 000000000..6a5ef79f7 --- /dev/null +++ b/packages/a/angle/xmake.lua @@ -0,0 +1,51 @@ +package("angle") + + set_homepage("https://chromium.googlesource.com/angle/angle") + set_description("ANGLE - Almost Native Graphics Layer Engine") + set_license("BSD-3-Clause") + + add_urls("https://github.com/google/angle/archive/refs/heads/chromium/$(version).zip") + add_versions("6288", "0d3bcf5bfd9eecd2b1635a6220a18f52a27ae5823928d4b6b083c54c163f963b") + + add_resources(">=6288", "chromium_zlib", "https://github.com/xmake-mirror/chromium_zlib.git", "646b7f569718921d7d4b5b8e22572ff6c76f2596") + + add_deps("python 3.x", {kind = "binary"}) + add_deps("zlib") + add_deps("opengl") + if is_plat("windows") then + add_links("libEGL", "libGLESv2", "libANGLE") + add_syslinks("user32", "gdi32", "dxgi", "dxguid", "d3d9", "delayimp") + add_ldflags("/DELAYLOAD:d3d9.dll") + else + if is_plat("macosx") then + add_syslinks("objc") + add_frameworks("CoreFoundation", "CoreGraphics", "IOKit", "Metal", "IOSurface", "QuartzCore", "Cocoa") + end + if is_plat("linux") then + add_deps("libx11", "libxext", "libxi") + end + add_links("EGL", "GLESv2", "ANGLE") + end + on_load("windows", "macosx", "linux", function (package) + if not package:config("shared") then + package:add("defines", "KHRONOS_STATIC") + end + end) + + on_install("windows", "macosx", "linux", function (package) + local zlib_dir = package:resourcefile("chromium_zlib") + os.cp(path.join(zlib_dir, "google"), "third_party/zlib") + os.cp(path.join(os.scriptdir(), "port", package:version_str(), "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + const char *extensionString = + static_cast(eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS)); + EGLint res = eglGetError(); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/a/apr/xmake.lua b/packages/a/apr/xmake.lua index 5dbd0663c..18fb315b7 100644 --- a/packages/a/apr/xmake.lua +++ b/packages/a/apr/xmake.lua @@ -5,6 +5,7 @@ package("apr") add_urls("https://github.com/apache/apr/archive/refs/tags/$(version).tar.gz", "https://github.com/apache/apr.git") + add_versions("1.7.4", "060b6e5ca8b3251545a93777c9ef744ceff02d4a59bb60a7dd9b3da9da33673e") add_versions("1.7.0", "a7e2c5e6d60f6c7b1611b31a2f914a3e58f44eded5b064f0bae43ff30b16a4e6") if is_plat("linux") then @@ -15,7 +16,7 @@ package("apr") add_syslinks("wsock32", "ws2_32", "advapi32", "shell32", "rpcrt4") end - on_install("linux", "macosx", function (package) + on_install("linux", "macosx|x86_64", function (package) local configs = {} if package:is_plat("linux") then os.vrunv("sh", {"./buildconf"}) @@ -36,7 +37,7 @@ package("apr") package:add("includedirs", "include/apr-1") end) - on_install("windows", function (package) + on_install("windows|x86", "windows|x64", function (package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DAPR_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) diff --git a/packages/a/aqt/xmake.lua b/packages/a/aqt/xmake.lua index a3b73c3a4..103640050 100644 --- a/packages/a/aqt/xmake.lua +++ b/packages/a/aqt/xmake.lua @@ -6,7 +6,7 @@ package("aqt") if is_host("windows") and (os.arch() == "x64" or os.arch() == "x86") then add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true}) - add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) + add_configs("runtimes", {description = "Set compiler runtimes.", default = "MD", readonly = true}) if os.arch() == "x86" then add_urls("https://github.com/miurahr/aqtinstall/releases/download/v$(version)/aqt_x86_signed.exe", { alias = "signed" }) @@ -30,7 +30,7 @@ package("aqt") on_install("@macosx", "@linux", "@windows", "@msys", function (package) if is_host("windows") and (os.arch() == "x64" or os.arch() == "x86") then - os.mv(package:originfile(), path.join(package:installdir("bin"), "aqt.exe")) + os.cp(package:originfile(), path.join(package:installdir("bin"), "aqt.exe")) else -- ensurepip has been dropped in recent releases try {function () os.vrunv("python3", {"-m", "ensurepip"}) end} diff --git a/packages/a/arduinojson/xmake.lua b/packages/a/arduinojson/xmake.lua new file mode 100644 index 000000000..8a3567318 --- /dev/null +++ b/packages/a/arduinojson/xmake.lua @@ -0,0 +1,29 @@ +package("arduinojson") + set_kind("library", {headeronly = true}) + set_homepage("https://arduinojson.org") + set_description("📟 JSON library for Arduino and embedded C++. Simple and efficient.") + set_license("MIT") + + add_urls("https://github.com/bblanchon/ArduinoJson/archive/refs/tags/$(version).tar.gz", + "https://github.com/bblanchon/ArduinoJson.git") + + add_versions("v7.0.4", "98ca14d98e9f1e8978ce5ad3ca0eeda3d22419d17586c60f299f369078929917") + add_versions("v7.0.3", "6da2d069e0caa0c829444912ee13e78bdf9cc600be632428a164c92e69528000") + add_versions("v6.21.4", "9551af9282372f6e64cf4009fc43be7f2df6eb96fe9c0aab44d4eed217d09747") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package, {"-DBUILD_TESTING=OFF"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}"; + DynamicJsonDocument doc(1024); + deserializeJson(doc, json); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/a/argparse/xmake.lua b/packages/a/argparse/xmake.lua index fbb6e3bcc..84caf01d3 100644 --- a/packages/a/argparse/xmake.lua +++ b/packages/a/argparse/xmake.lua @@ -6,6 +6,7 @@ package("argparse") add_urls("https://github.com/p-ranav/argparse/archive/refs/tags/v$(version).zip", "https://github.com/p-ranav/argparse.git") + add_versions("3.0", "674e724c2702f0bfef1619161815257a407e1babce30d908327729fba6ce4124") add_versions("2.6", "ce4e58d527b83679bdcc4adfa852af7ec9df16b76c11637823ef642cb02d2618") add_versions("2.7", "58cf098fd195895aeb9b9120d96f1e310994b2f44d72934c438ec91bf2191f46") add_versions("2.8", "9381b9ec2bdd2a350d1a0bf96d631969e3fda0cf2696e284d1359b5ee4ebb465") diff --git a/packages/a/asio/xmake.lua b/packages/a/asio/xmake.lua index da6bd7acc..28a2b5776 100644 --- a/packages/a/asio/xmake.lua +++ b/packages/a/asio/xmake.lua @@ -7,13 +7,15 @@ package("asio") add_urls("https://sourceforge.net/projects/asio/files/asio/$(version) (Stable)/asio-$(version).tar.gz", {alias = "sourceforge"}) add_urls("https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-$(version).tar.gz", {alias = "github", version = function (version) return version:gsub("%.", "-") end}) + add_versions("github:1.30.2", "755bd7f85a4b269c67ae0ea254907c078d408cce8e1a352ad2ed664d233780e8") + add_versions("github:1.29.0", "44305859b4e6664dbbf853c1ef8ca0259d694f033753ae309fcb2534ca20f721") add_versions("github:1.28.0", "226438b0798099ad2a202563a83571ce06dd13b570d8fded4840dbc1f97fa328") add_versions("github:1.24.0", "cbcaaba0f66722787b1a7c33afe1befb3a012b5af3ad7da7ff0f6b8c9b7a8a5b") add_versions("github:1.21.0", "5d2d2dcb7bfb39bff941cabbfc8c27ee322a495470bf0f3a7c5238648cf5e6a9") add_versions("sourceforge:1.20.0", "4cd5cd0ad97e752a4075f02778732a3737b587f5eeefab59cd98dc43b0dcadb3") add_versions("github:1.20.0", "34a8f07be6f54e3753874d46ecfa9b7ab7051c4e3f67103c52a33dfddaea48e6") - on_install(function (package) + on_install("!wasm", function (package) if os.isdir("asio") then os.cp("asio/include/asio.hpp", package:installdir("include")) os.cp("asio/include/asio", package:installdir("include")) diff --git a/packages/a/asio2/xmake.lua b/packages/a/asio2/xmake.lua new file mode 100644 index 000000000..cfe70a9f2 --- /dev/null +++ b/packages/a/asio2/xmake.lua @@ -0,0 +1,25 @@ +package("asio2") + + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/zhllxt/asio2") + set_description("Header only c++ network library, based on asio, support tcp,udp,http,websocket,rpc,ssl,icmp,serial_port.") + set_license("BSL-1.0") + + add_urls("https://github.com/zhllxt/asio2.git") + add_versions("2023.05.09", "ac8c79964d79020091e38fcbb4ae9dccccb3b03c") + + add_deps("asio", "cereal", "fmt", "openssl3") + add_deps("spdlog", { configs = { header_only = false, fmt_external = true } }) + + on_install("windows", "linux", "macosx", "mingw", "bsd", function (package) + os.cp(path.join("include", "*"), package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + asio2::tcp_server server; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/a/asio3/xmake.lua b/packages/a/asio3/xmake.lua new file mode 100644 index 000000000..b6c5f8d9f --- /dev/null +++ b/packages/a/asio3/xmake.lua @@ -0,0 +1,26 @@ +package("asio3") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/zhllxt/asio3") + set_description("Header only c++ network library, based on c++ 20 coroutine and asio") + set_license("BSL-1.0") + + add_urls("https://github.com/zhllxt/asio3.git") + add_versions("2023.12.03", "66e76da69b359540fdf15b85bd5f3612b358c1da") + + add_deps("asio", "cereal", "fmt", "openssl3", "nlohmann_json") + add_deps("spdlog", { configs = { header_only = false, fmt_external = true } }) + + on_install("windows", "linux", "macosx", "mingw", "bsd", function (package) + os.cp(path.join("include"), package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + namespace net = ::asio; + void test() { + net::io_context ctx; + net::tcp_client client(ctx.get_executor()); + } + ]]}, {configs = {languages = "c++23"}})) + end) diff --git a/packages/a/asmjit/xmake.lua b/packages/a/asmjit/xmake.lua index e779112aa..8ada93d8b 100644 --- a/packages/a/asmjit/xmake.lua +++ b/packages/a/asmjit/xmake.lua @@ -1,24 +1,25 @@ package("asmjit") - set_homepage("https://asmjit.com/") set_description("AsmJit is a lightweight library for machine code generation written in C++ language.") set_license("zlib") add_urls("https://github.com/asmjit/asmjit.git") + add_versions("2024.05.21", "55c5d6cef59619fb81014531b32f434a793cfb18") + add_versions("2024.03.09", "268bce7952883dec5015ae539906e9e9d7fb65a0") add_versions("2022.01.18", "9a92d2f97260749f6f29dc93e53c743448f0137a") add_versions("2021.06.27", "d02235b83434943b52a6d7c57118205c5082de08") - add_deps("cmake") - if is_plat("linux") then - add_syslinks("rt") + if is_plat("linux", "bsd") then + add_syslinks("pthread", "rt", "m") end - on_load("windows", "macosx", "linux", function (package) + + add_deps("cmake") + + on_install("!iphoneos", function (package) if not package:config("shared") then package:add("defines", "ASMJIT_STATIC") end - end) - on_install("windows", "macosx", "linux", function (package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DASMJIT_STATIC=" .. (package:config("shared") and "OFF" or "ON")) diff --git a/packages/a/asmtk/xmake.lua b/packages/a/asmtk/xmake.lua index 0f77a2126..a4d05ee2d 100644 --- a/packages/a/asmtk/xmake.lua +++ b/packages/a/asmtk/xmake.lua @@ -1,15 +1,17 @@ package("asmtk") - set_homepage("https://github.com/asmjit/asmtk") set_description("Assembler toolkit based on AsmJit") set_license("zlib") set_urls("https://github.com/asmjit/asmtk.git") - add_versions("2023.6.14", "6e25b8983fbd8bf455c01ed7c5dd40c99b789565") + add_versions("2023.07.18", "e2752c85d39da4b0c5c729737a6faa25286b8e0c") add_deps("asmjit") - on_install("windows", "linux", "macosx", function (package) + on_install("!iphoneos", function (package) + if not package:config("shared") then + package:add("defines", "ASMTK_STATIC") + end io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") add_requires("asmjit") @@ -18,6 +20,11 @@ package("asmtk") add_files("src/**.cpp") add_headerfiles("src/(**.h)") set_languages("c++11") + if is_kind("static") then + add_defines("ASMTK_STATIC") + elseif is_kind("shared") then + add_defines("ASMTK_EXPORTS") + end if is_plat("windows") then add_cxxflags("/GR-", "/GF", "/Zc:inline", "/Zc:strictStrings", "/Zc:threadSafeInit-") if is_mode("debug") then @@ -25,30 +32,26 @@ package("asmtk") else add_cxxflags("/GS-", "/Oi") end - if is_kind("shared") then - add_rules("utils.symbols.export_all", {export_classes = true}) - end else add_cxxflags("-fno-math-errno", "-fno-threadsafe-statics") end add_packages("asmjit") ]]) - local configs = {} - if package:config("shared") then - configs.kind = "shared" - end import("package.tools.xmake").install(package, configs) end) on_test(function (package) assert(package:check_cxxsnippets({test = [[ #include + #include using namespace asmjit; using namespace asmtk; void test() { Environment env(Arch::kX64); CodeHolder code; code.init(env); + x86::Assembler a(&code); + AsmParser p(&a); } ]]}, {configs = {languages = "c++11"}})) end) diff --git a/packages/a/assimp/xmake.lua b/packages/a/assimp/xmake.lua index 03cd4c69c..aedd90ab5 100644 --- a/packages/a/assimp/xmake.lua +++ b/packages/a/assimp/xmake.lua @@ -1,11 +1,14 @@ package("assimp") - set_homepage("https://assimp.org") set_description("Portable Open-Source library to import various well-known 3D model formats in a uniform manner") set_license("BSD-3-Clause") - set_urls("https://github.com/assimp/assimp/archive/$(version).zip", + set_urls("https://github.com/assimp/assimp/archive/refs/tags/$(version).zip", "https://github.com/assimp/assimp.git") + add_versions("v5.4.1", "08837ee7c50b98ca72d2c9e66510ca6640681db8800aa2d3b1fcd61ccc615113") + add_versions("v5.4.0", "0f3698e9ba0110df0b636dbdd95706e7e28d443ff3dbaf5828926c23bfff778d") + add_versions("v5.3.1", "f4020735fe4601de9d85cb335115568cce0e027a65e546dd8895081696d624bd") + add_versions("v5.3.0", "cccbd20522b577613096b0b157f62c222f844bc177356b8301cd74eee3fecadb") add_versions("v5.2.5", "5384877d53be7b5bbf50c26ab3f054bec91b3df8614372dcd7240f44f61c509b") add_versions("v5.2.4", "713e9aa035ae019e5f3f0de1605de308d63538897249a2ba3a2d7d40036ad2b1") add_versions("v5.2.3", "9667cfc8ddabd5dd5e83f3aebb99dbf232fce99f17b9fe59540dccbb5e347393") @@ -46,9 +49,24 @@ package("assimp") add_syslinks("advapi32") end + if on_check then + on_check("android", function (package) + import("core.tool.toolchain") + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndk_sdkver = ndk:config("ndk_sdkver") + assert(ndk_sdkver and tonumber(ndk_sdkver) >= 26, "package(assimp): need ndk api level >= 26 for android") + end) + end + on_load(function (package) - if not package:gitref() and package:version():le("5.1.0") then - package:add("deps", "irrxml") + if not package:gitref() then + if package:version():le("5.1.0") then + package:add("deps", "irrxml") + end + if package:version():eq("5.3.0") then + package:add("deps", "utfcpp") + package:add("defines", "ASSIMP_USE_HUNTER") + end end if package:is_plat("linux", "macosx") and package:config("shared") then package:add("links", "assimp" .. (package:is_debug() and "d" or "")) @@ -56,6 +74,13 @@ package("assimp") end) on_install(function (package) + if package:is_plat("android") then + import("core.tool.toolchain") + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndk_sdkver = ndk:config("ndk_sdkver") + assert(ndk_sdkver and tonumber(ndk_sdkver) >= 26, "package(assimp): need ndk api level >= 26 for android") + end + local configs = {"-DASSIMP_BUILD_SAMPLES=OFF", "-DASSIMP_BUILD_TESTS=OFF", "-DASSIMP_BUILD_DOCS=OFF", @@ -85,18 +110,17 @@ package("assimp") table.insert(configs, "-DASSIMP_BUILD_ASSIMP_TOOLS=OFF") end - if not package:gitref() and package:version():lt("v5.2.4") then - -- ASSIMP_WARNINGS_AS_ERRORS is not supported before v5.2.4 + -- ASSIMP_WARNINGS_AS_ERRORS maybe does not work for some old versions + for _, cmakefile in ipairs(table.join("CMakeLists.txt", os.files("**/CMakeLists.txt"))) do if package:is_plat("windows") then - io.replace("code/CMakeLists.txt", "TARGET_COMPILE_OPTIONS(assimp PRIVATE /W4 /WX)", "", {plain = true}) + io.replace(cmakefile, "/W4 /WX", "", {plain = true}) else - io.replace("code/CMakeLists.txt", "TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror)", "", {plain = true}) + io.replace(cmakefile, "-Werror", "", {plain = true}) end end - if not package:gitref() and package:version():eq("v5.2.5") then - -- Remove /WX from CMakeLists for MSVC: https://github.com/assimp/assimp/pull/5183 - io.replace("CMakeLists.txt", "ADD_COMPILE_OPTIONS(/bigobj /W4 /WX )", "ADD_COMPILE_OPTIONS(/bigobj)", {plain = true}) - io.replace("CMakeLists.txt", "ADD_COMPILE_OPTIONS(/MP /bigobj /W4 /WX)", "ADD_COMPILE_OPTIONS(/MP /bigobj)", {plain = true}) + -- fix cmake_install failed + if not package:gitref() and package:version():ge("v5.3.0") and package:is_plat("windows") and package:is_debug() then + io.replace("code/CMakeLists.txt", "IF(GENERATOR_IS_MULTI_CONFIG)", "IF(TRUE)", {plain = true}) end if package:is_plat("mingw") and package:version():lt("v5.1.5") then -- CMAKE_COMPILER_IS_MINGW has been removed: https://github.com/assimp/assimp/pull/4311 @@ -104,21 +128,30 @@ package("assimp") end -- Assimp CMakeLists doesn't find minizip on Windows - local ldflags + local packagedeps if package:is_plat("windows") then local minizip = package:dep("minizip") if minizip and not minizip:is_system() then - local fetchinfo = minizip:fetch({external = false}) - if fetchinfo then - ldflags = {} - for _, linkdir in ipairs(fetchinfo.linkdirs) do - table.insert(ldflags, "/LIBPATH:" .. linkdir:gsub("\\", "/")) - end + packagedeps = table.join2(packagedeps or {}, "minizip") + end + end + + local zlib = package:dep("zlib") + if zlib and not zlib:is_system() then + local fetchinfo = zlib:fetch({external = false}) + if fetchinfo then + local includedirs = fetchinfo.includedirs or fetchinfo.sysincludedirs + if includedirs and #includedirs > 0 then + table.insert(configs, "-DZLIB_INCLUDE_DIR=" .. table.concat(includedirs, " ")) + end + local libfiles = fetchinfo.libfiles + if libfiles then + table.insert(configs, "-DZLIB_LIBRARY=" .. table.concat(libfiles, " ")) end end end - import("package.tools.cmake").install(package, configs, {ldflags = ldflags, shflags = ldflags}) + import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps}) -- copy pdb if package:is_plat("windows") then diff --git a/packages/a/astc-encoder/xmake.lua b/packages/a/astc-encoder/xmake.lua new file mode 100644 index 000000000..095b6cac6 --- /dev/null +++ b/packages/a/astc-encoder/xmake.lua @@ -0,0 +1,72 @@ +package("astc-encoder") + set_homepage("https://developer.arm.com/graphics") + set_description("The Arm ASTC Encoder, a compressor for the Adaptive Scalable Texture Compression data format.") + set_license("Apache-2.0") + + add_urls("https://github.com/ARM-software/astc-encoder/archive/refs/tags/$(version).tar.gz", + "https://github.com/ARM-software/astc-encoder.git") + + add_versions("4.8.0", "6c12f4656be21a69cbacd9f2c817283405decb514072dc1dcf51fd9a0b659852") + add_versions("4.7.0", "a57c81f79055aa7c9f8c82ac5464284e3df9bba682895dee09fa35bd1fdbab93") + add_versions("4.6.1", "a73c7afadb2caba00339a8f715079d43f9b7e75cf57463477e5ac36ef7defd26") + + add_configs("avx2", {description = "Enable astcenc builds for AVX2 SIMD", default = false, type = "boolean"}) + add_configs("sse41", {description = "Enable astcenc builds for SSE4.1 SIMD", default = false, type = "boolean"}) + add_configs("sse2", {description = "Enable astcenc builds for SSE2 SIMD", default = false, type = "boolean"}) + add_configs("neon", {description = "Enable astcenc builds for NEON SIMD", default = false, type = "boolean"}) + add_configs("none", {description = "Enable astcenc builds for no SIMD", default = false, type = "boolean"}) + add_configs("native", {description = "Enable astcenc builds for native SIMD", default = false, type = "boolean"}) + add_configs("decompressor", {description = "Enable astcenc builds for decompression only", default = false, type = "boolean"}) + add_configs("diagnostics", {description = "Enable astcenc builds with diagnostic trace", default = false, type = "boolean"}) + add_configs("asan", {description = "Enable astcenc builds with address sanitizer", default = false, type = "boolean"}) + + add_configs("invariance", {description = "Enable astcenc floating point invariance", default = true, type = "boolean"}) + add_configs("cli", {description = "Enable build of astcenc command line tools", default = true, type = "boolean"}) + + add_deps("cmake") + + on_install("windows|x64", "windows|x86", "mingw|x86_64", "linux", function (package) + io.replace("Source/cmake_core.cmake", "-Werror", "", {plain = true}) + + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DASTCENC_SHAREDLIB=" .. (package:config("shared") and "ON" or "OFF")) + + table.insert(configs, "-DASTCENC_ISA_AVX2=" .. (package:config("avx2") and "ON" or "OFF")) + table.insert(configs, "-DASTCENC_ISA_SSE41=" .. (package:config("sse41") and "ON" or "OFF")) + table.insert(configs, "-DASTCENC_ISA_SSE2=" .. (package:config("sse2") and "ON" or "OFF")) + table.insert(configs, "-DASTCENC_ISA_NEON=" .. (package:config("neon") and "ON" or "OFF")) + table.insert(configs, "-DASTCENC_ISA_NONE=" .. (package:config("none") and "ON" or "OFF")) + table.insert(configs, "-DASTCENC_ISA_NATIVE=" .. (package:config("native") and "ON" or "OFF")) + table.insert(configs, "-DASTCENC_DECOMPRESSOR=" .. (package:config("decompressor") and "ON" or "OFF")) + table.insert(configs, "-DASTCENC_DIAGNOSTICS=" .. (package:config("diagnostics") and "ON" or "OFF")) + table.insert(configs, "-DASTCENC_ASAN=" .. (package:config("asan") and "ON" or "OFF")) + table.insert(configs, "-DASTCENC_INVARIANCE=" .. (package:config("invariance") and "ON" or "OFF")) + table.insert(configs, "-DASTCENC_CLI=" .. (package:config("cli") and "ON" or "OFF")) + + import("package.tools.cmake").install(package, configs) + + os.cp("Source/astcenc.h", package:installdir("include")) + if package:config("shared") then + package:add("linkdirs", "bin") + end + if package:config("cli") then + local exe_prefix = package:is_plat("mingw", "windows") and ".exe" or "" + os.mv(path.join(package:installdir("bin"), "astcenc-native" .. exe_prefix), path.join(package:installdir("bin"), "astcenc" .. exe_prefix)) + package:addenv("PATH", "bin") + end + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + astcenc_context* context; + astcenc_config* config = new astcenc_config(); + astcenc_error status = astcenc_context_alloc(config, 1, &context); + } + ]]}, {configs = {languages = "c++14"}})) + if package:config("cli") and (not package:is_cross()) then + os.vrun("astcenc -help") + end + end) diff --git a/packages/a/async_simple/xmake.lua b/packages/a/async_simple/xmake.lua index 4aec5f0db..c66f2df6f 100644 --- a/packages/a/async_simple/xmake.lua +++ b/packages/a/async_simple/xmake.lua @@ -1,12 +1,15 @@ package("async_simple") - set_homepage("https://github.com/alibaba/async_simple") set_description("Simple, light-weight and easy-to-use asynchronous components") set_license("Apache-2.0") add_urls("https://github.com/alibaba/async_simple/archive/refs/tags/$(version).tar.gz", + "https://github.com/alibaba/async_simple/archive/refs/tags/v$(version).tar.gz", "https://github.com/alibaba/async_simple.git") + add_versions("1.1", "32d1ea16dfc1741206b6e4a3fbe532eeb1c378619766c1abe11a9efc53109c10") + add_versions("1.2", "a59a2674ac2b0a3997b90873b2bf0fbe4d96fdedbe6a2628c16c92a65a3fa39a") + add_versions("1.3", "0ba0dc3397882611b538d04b8ee6668b1a04ce046128599205184c598b718743") add_configs("aio", {description = "default not open aio", default = false, type = "boolean"}) add_configs("modules", {description = "default not use modules", default = false, type = "boolean"}) @@ -14,16 +17,24 @@ package("async_simple") add_deps("cmake") on_install("windows", "linux", "macosx", function (package) - local configs = {"-DASYNC_SIMPLE_ENABLE_TESTS=OFF", - "-DASYNC_SIMPLE_BUILD_DEMO_EXAMPLE=OFF"} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + if package:version():le("1.3") then + io.replace("async_simple/CMakeLists.txt", + [[file(GLOB coro_header "coro/*.h")]], + "file(GLOB coro_header \"coro/*.h\")\nfile(GLOB executors_header \"executors/*.h\")", {plain = true}) + end + + local configs = { + "-DASYNC_SIMPLE_ENABLE_TESTS=OFF", + "-DASYNC_SIMPLE_BUILD_DEMO_EXAMPLE=OFF" + } + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DASYNC_SIMPLE_DISABLE_AIO=" .. (package:config("aio") and "OFF" or "ON")) table.insert(configs, "-DASYNC_SIMPLE_BUILD_MODULES=" .. (package:config("modules") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) if package:config("shared") then os.rm(package:installdir("lib/libasync_simple.a")) else - os.rm(package:installdir("lib/libasync_simple.so")) + os.rm(package:installdir("lib/*.so*")) end end) diff --git a/packages/a/atomic_queue/xmake.lua b/packages/a/atomic_queue/xmake.lua new file mode 100644 index 000000000..10073c886 --- /dev/null +++ b/packages/a/atomic_queue/xmake.lua @@ -0,0 +1,26 @@ +package("atomic_queue") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/max0x7ba/atomic_queue") + set_description("C++ lockless queue.") + set_license("MIT") + + add_urls("https://github.com/max0x7ba/atomic_queue/archive/refs/tags/$(version).tar.gz", + "https://github.com/max0x7ba/atomic_queue.git") + add_versions("v1.5", "599b76a0222e7b54118d6f0fb686845c9d323107f2de76b3f68292b057e5a99f") + add_versions("v1.6.3", "0ad6e0203d90367f6a4e496449dfd9ad65b80168fadafef4eac08820c6bda79c") + + on_install(function (package) + os.cp("include/atomic_queue/", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + int test(int argc, char* argv[]) { + using Queue = atomic_queue::AtomicQueue; + Queue q{}; + q.try_push(10); + return 0; + } + ]]}, {configs = {languages = "cxx14"}, includes = "atomic_queue/atomic_queue.h"})) + end) diff --git a/packages/a/attr/xmake.lua b/packages/a/attr/xmake.lua index 9717e7831..758c1dee3 100644 --- a/packages/a/attr/xmake.lua +++ b/packages/a/attr/xmake.lua @@ -4,16 +4,14 @@ package("attr") set_description("Commands for Manipulating Filesystem Extended Attributes") set_license("GPL-2.0") - add_urls("http://download.savannah.nongnu.org/releases/attr/attr-$(version).tar.gz") + add_urls("https://github.com/xmake-mirror/attr/releases/download/v$(version)/attr-$(version).tar.gz", + "http://download.savannah.nongnu.org/releases/attr/attr-$(version).tar.gz") add_versions("2.5.1", "bae1c6949b258a0d68001367ce0c741cebdacdd3b62965d17e5eb23cd78adaf8") on_install("linux", function (package) local configs = {} table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) - if package:config("pic") ~= false then - table.insert(configs, "--with-pic") - end import("package.tools.autoconf").install(package, configs) end) diff --git a/packages/a/audiofile/xmake.lua b/packages/a/audiofile/xmake.lua new file mode 100644 index 000000000..594bc55f4 --- /dev/null +++ b/packages/a/audiofile/xmake.lua @@ -0,0 +1,37 @@ +package("audiofile") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/adamstark/AudioFile") + set_description("A simple C++ library for reading and writing audio files.") + set_license("MIT") + + add_urls("https://github.com/adamstark/AudioFile/archive/refs/tags/$(version).tar.gz", + "https://github.com/adamstark/AudioFile.git") + + add_versions("1.1.1", "664f9d5fbbf1ff6c603ae054a35224f12e9856a1d8680be567909015ccaac328") + add_versions("1.1.0", "7546e39ca17ac09c653f46bfecce4a9936fae3784209ad53094915c78792a327") + add_versions("1.0.9", "1d609b80496fc5c688d8e83086cdcad5b60ddb20f02d160f80be271fab97c4c0") + add_versions("1.0.8", "f9ecc578425cb90a4a846b32c8ac162c9a61952713bd07525337245a8dee8ad2") + add_versions("1.0.7", "a03c8dfee26e34e96ca07065b72a9a6860cf9a78849abf26c32a4db42469f6e6") + add_versions("1.0.6", "ac802070beb217c373a0fba83d3e7542672cf8118763677bb8c5de396030cf40") + add_versions("1.0.5", "61b7328459591aa11edfee7377acffa3c5638bac71a0fa57ddafe95b696eeed1") + add_versions("1.0.4", "cb57df92f252d194b911eebe6dedaba2c063a02c2579e00bf0a18cac92793027") + add_versions("1.0.3", "7c5d2b89b2c8675faee36de63ddcb5df3f9e1514439c2578e462b8ab2950571d") + add_versions("1.0.2", "63b7f0b76318299be7f74944f50967825240124aab3c0f82f1753689c2c5a092") + add_versions("1.0.1", "c52957662b717addd32b6c72b279d0c82fb5cf0fe74f98fa74469ae6bcba5b26") + add_versions("1.0.0", "2740f8b7b5f70f6ac848e3e2814ceeae141d806c07424a0cd03fde2ecaf463f1") + + on_install(function (package) + os.cp("AudioFile.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + + void test () { + AudioFile audioFile; + audioFile.load("somerandomfile.wav"); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/a/autoconf-archive/xmake.lua b/packages/a/autoconf-archive/xmake.lua index 6a61d07dd..21e8639ce 100644 --- a/packages/a/autoconf-archive/xmake.lua +++ b/packages/a/autoconf-archive/xmake.lua @@ -3,8 +3,8 @@ package("autoconf-archive") set_description("A mirror of the GNU Autoconf Archive, a collection of more than 500 macros for GNU Autoconf that have been contributed as free software by friendly supporters of the cause from all over the Internet.") set_license("GPL-3.0-or-later") - add_urls("https://ftp.gnu.org/gnu/autoconf-archive/autoconf-archive-$(version).tar.xz", - "https://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-$(version).tar.xz") + add_urls("https://ftpmirror.gnu.org/autoconf-archive/autoconf-archive-$(version).tar.xz", + "https://ftp.gnu.org/gnu/autoconf-archive/autoconf-archive-$(version).tar.xz") add_versions("2023.02.20", "71d4048479ae28f1f5794619c3d72df9c01df49b1c628ef85fde37596dc31a33") add_deps("autoconf") diff --git a/packages/a/autoconf/xmake.lua b/packages/a/autoconf/xmake.lua index 615f6c466..4db7d6944 100644 --- a/packages/a/autoconf/xmake.lua +++ b/packages/a/autoconf/xmake.lua @@ -4,7 +4,8 @@ package("autoconf") set_homepage("https://www.gnu.org/software/autoconf/autoconf.html") set_description("An extensible package of M4 macros that produce shell scripts to automatically configure software source code packages.") - add_urls("http://ftp.gnu.org/gnu/autoconf/autoconf-$(version).tar.gz", + add_urls("http://ftpmirror.gnu.org/gnu/autoconf/autoconf-$(version).tar.gz", + "http://ftp.gnu.org/gnu/autoconf/autoconf-$(version).tar.gz", "https://mirrors.ustc.edu.cn/gnu/autoconf/autoconf-$(version).tar.gz", "git://git.sv.gnu.org/autoconf") add_versions("2.68", "eff70a2916f2e2b3ed7fe8a2d7e63d72cf3a23684b56456b319c3ebce0705d99") diff --git a/packages/a/autodiff/xmake.lua b/packages/a/autodiff/xmake.lua index 455557d8f..411e4d2c7 100644 --- a/packages/a/autodiff/xmake.lua +++ b/packages/a/autodiff/xmake.lua @@ -8,6 +8,7 @@ package("autodiff") add_urls("https://github.com/autodiff/autodiff/archive/refs/tags/$(version).tar.gz", "https://github.com/autodiff/autodiff.git") + add_versions("v1.1.2", "86f68aabdae1eed214bfbf0ddaa182c78ea1bb99e4df404efb7b94d30e06b744") add_versions("v1.0.3", "21b57ce60864857913cacb856c3973ae10f7539b6bb00bcc04f85b2f00db0ce2") add_deps("cmake", "eigen") diff --git a/packages/a/automake/xmake.lua b/packages/a/automake/xmake.lua index adda19ad9..f8d3ea046 100644 --- a/packages/a/automake/xmake.lua +++ b/packages/a/automake/xmake.lua @@ -4,8 +4,10 @@ package("automake") set_homepage("https://www.gnu.org/software/automake/") set_description("A tool for automatically generating Makefile.in files compliant with the GNU Coding Standards.") - add_urls("https://ftp.gnu.org/gnu/automake/automake-$(version).tar.gz", + add_urls("https://ftpmirror.gnu.org/gnu/automake/automake-$(version).tar.gz", + "https://ftp.gnu.org/gnu/automake/automake-$(version).tar.gz", "https://mirrors.ustc.edu.cn/gnu/automake/automake-$(version).tar.gz") + add_versions("1.16.5", "07bd24ad08a64bc17250ce09ec56e921d6343903943e99ccf63bbf0705e34605") add_versions("1.16.4", "8a0f0be7aaae2efa3a68482af28e5872d8830b9813a6a932a2571eac63ca1794") add_versions("1.16.1", "608a97523f97db32f1f5d5615c98ca69326ced2054c9f82e65bade7fc4c9dea8") add_versions("1.15.1", "988e32527abe052307d21c8ca000aa238b914df363a617e38f4fb89f5abf6260") diff --git a/packages/a/aws-c-auth/xmake.lua b/packages/a/aws-c-auth/xmake.lua new file mode 100644 index 000000000..2af588439 --- /dev/null +++ b/packages/a/aws-c-auth/xmake.lua @@ -0,0 +1,38 @@ +package("aws-c-auth") + set_homepage("https://github.com/awslabs/aws-c-auth") + set_description("C99 library implementation of AWS client-side authentication: standard credentials providers and signing.") + set_license("Apache-2.0") + + add_urls("https://github.com/awslabs/aws-c-auth/archive/refs/tags/$(version).tar.gz", + "https://github.com/awslabs/aws-c-auth.git") + + add_versions("v0.7.22", "f249a12a6ac319e929c005fb7efd5534c83d3af3a3a53722626ff60a494054bb") + add_versions("v0.7.18", "c705199655066f1f874bc3758683f32e288024196a22f28360d336231e45406f") + add_versions("v0.7.17", "8fe380255a71a2d5c9acd4979c135f9842135ce6385010ea562bc0b532bf5b84") + add_versions("v0.7.3", "22e334508b76f1beddefbf877f200c8a5ace4e3956c6be6545b7572762afe8c5") + + add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"}) + add_configs("assert_lock_help", {description = "Enable ASSERT_SYNCED_DATA_LOCK_HELD for checking thread issue", default = false, type = "boolean"}) + + add_deps("cmake", "aws-c-common", "aws-c-cal", "aws-c-io", "aws-c-sdkutils", "aws-c-http") + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", "cross", function (package) + local cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake") + if package:is_plat("windows") then + cmakedir = cmakedir:gsub("\\", "/") + end + + local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_MODULE_PATH=" .. cmakedir} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF")) + table.insert(configs, "-DASSERT_LOCK_HELD=" .. (package:config("assert_lock_help") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("aws_auth_library_init", {includes = "aws/auth/auth.h"})) + end) diff --git a/packages/a/aws-c-cal/xmake.lua b/packages/a/aws-c-cal/xmake.lua index c1e063c0a..3509a9901 100644 --- a/packages/a/aws-c-cal/xmake.lua +++ b/packages/a/aws-c-cal/xmake.lua @@ -6,6 +6,9 @@ package("aws-c-cal") add_urls("https://github.com/awslabs/aws-c-cal/archive/refs/tags/$(version).tar.gz", "https://github.com/awslabs/aws-c-cal.git") + add_versions("v0.6.14", "2326304b15bec45b212f6b738020c21afa41f9da295936687e103f9f2efb7b5e") + add_versions("v0.6.12", "1ec1bc9a50df8d620f226480b420ec69d4fefd3792fb4e877aa7e350c2b174dc") + add_versions("v0.6.11", "e1b0af88c14300e125e86ee010d4c731292851fff16cfb67eb6ba6036df2d648") add_versions("v0.6.2", "777feb1e88b261415e1ad607f7e420a743c3b432e21a66a5aaf9249149dc6fef") add_configs("openssl", {description = "Set this if you want to use your system's OpenSSL 1.0.2/1.1.1 compatible libcrypto", default = false, type = "boolean"}) diff --git a/packages/a/aws-c-common/xmake.lua b/packages/a/aws-c-common/xmake.lua index fe35e8589..878e921bd 100644 --- a/packages/a/aws-c-common/xmake.lua +++ b/packages/a/aws-c-common/xmake.lua @@ -6,6 +6,11 @@ package("aws-c-common") add_urls("https://github.com/awslabs/aws-c-common/archive/refs/tags/$(version).tar.gz", "https://github.com/awslabs/aws-c-common.git") + add_versions("v0.9.19", "196430fda1bca2c77df7d9199232956d371a92f49ee48fd6c29ff969410ca0ed") + add_versions("v0.9.17", "82f1a88494c5563892f0e048f0f56acfe7e10e5aa3fe9267b956dbabcc043440") + add_versions("v0.9.15", "8f36c7a6a5d2e17365759d15591f800d3e76dcaa34a226389b92647cbd92393a") + add_versions("v0.9.14", "70b10ebbf40e3b6c1b36d81d5e4b63fe430414a81f76293a65e42dfa5def571e") + add_versions("v0.9.13", "6d2044fc58e5d7611610976602f3fc2173676726b00eed026526962c599ece1d") add_versions("v0.9.3", "389eaac7f64d7d5a91ca3decad6810429eb5a65bbba54798b9beffcb4d1d1ed6") add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"}) diff --git a/packages/a/aws-c-compression/xmake.lua b/packages/a/aws-c-compression/xmake.lua index 7df274b48..d1d5208d8 100644 --- a/packages/a/aws-c-compression/xmake.lua +++ b/packages/a/aws-c-compression/xmake.lua @@ -6,6 +6,7 @@ package("aws-c-compression") add_urls("https://github.com/awslabs/aws-c-compression/archive/refs/tags/$(version).tar.gz", "https://github.com/awslabs/aws-c-compression.git") + add_versions("v0.2.18", "517c361f3b7fffca08efd5ad251a20489794f056eab0dfffacc6d5b341df8e86") add_versions("v0.2.17", "703d1671e395ea26f8b0b70d678ed471421685a89e127f8aa125e2b2ecedb0e0") add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"}) @@ -18,7 +19,7 @@ package("aws-c-compression") on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", "android", "iphoneos", "cross", "wasm", function (package) local aws_cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake") local aws_c_common_configdir = package:dep("aws-c-common"):installdir("lib", "aws-c-common", "cmake") - if package:is_plat("windows") then + if is_host("windows") then aws_cmakedir = aws_cmakedir:gsub("\\", "/") aws_c_common_configdir = aws_c_common_configdir:gsub("\\", "/") end diff --git a/packages/a/aws-c-event-stream/xmake.lua b/packages/a/aws-c-event-stream/xmake.lua new file mode 100644 index 000000000..308cbb33b --- /dev/null +++ b/packages/a/aws-c-event-stream/xmake.lua @@ -0,0 +1,35 @@ +package("aws-c-event-stream") + set_homepage("https://github.com/awslabs/aws-c-event-stream") + set_description("C99 implementation of the vnd.amazon.eventstream content-type.") + set_license("Apache-2.0") + + add_urls("https://github.com/awslabs/aws-c-event-stream/archive/refs/tags/$(version).tar.gz", + "https://github.com/awslabs/aws-c-event-stream.git") + + add_versions("v0.4.2", "c98b8fa05c2ca10aacfce7327b92a84669c2da95ccb8e7d7b3e3285fcec8beee") + add_versions("v0.4.1", "f8915fba57c86148f8df4c303ca6f31de6c23375de554ba8d6f9aef2a980e93e") + add_versions("v0.3.2", "3134b35a45e9f9d974c2b78ee44fd2ea0aebc04df80236b80692aa63bee2092e") + + add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"}) + + add_deps("cmake", "aws-c-common", "aws-c-io", "aws-checksums") + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", "cross", function (package) + local cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake") + if package:is_plat("windows") then + cmakedir = cmakedir:gsub("\\", "/") + end + + local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_MODULE_PATH=" .. cmakedir} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("aws_event_stream_library_init", {includes = "aws/event-stream/event_stream.h"})) + end) diff --git a/packages/a/aws-c-http/xmake.lua b/packages/a/aws-c-http/xmake.lua new file mode 100644 index 000000000..fdc075a65 --- /dev/null +++ b/packages/a/aws-c-http/xmake.lua @@ -0,0 +1,34 @@ +package("aws-c-http") + set_homepage("https://github.com/awslabs/aws-c-http") + set_description("C99 implementation of the HTTP/1.1 and HTTP/2 specifications") + set_license("Apache-2.0") + + add_urls("https://github.com/awslabs/aws-c-http/archive/refs/tags/$(version).tar.gz", + "https://github.com/awslabs/aws-c-http.git") + + add_versions("v0.8.1", "83fb47e2d7956469bb328f16dea96663e96f8f20dc60dc4e9676b82804588530") + add_versions("v0.7.12", "0f92f295c96e10aa9c1e66ac73c038ee9d9c61e1be7551e721ee0dab9c89fc6f") + + add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"}) + + add_deps("cmake", "aws-c-cal", "aws-c-io", "aws-c-compression") + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", "cross", function (package) + local cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake") + if package:is_plat("windows") then + cmakedir = cmakedir:gsub("\\", "/") + end + + local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_MODULE_PATH=" .. cmakedir} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("aws_http_message_new_request", {includes = "aws/http/request_response.h"})) + end) diff --git a/packages/a/aws-c-io/xmake.lua b/packages/a/aws-c-io/xmake.lua new file mode 100644 index 000000000..8c274a9ad --- /dev/null +++ b/packages/a/aws-c-io/xmake.lua @@ -0,0 +1,45 @@ +package("aws-c-io") + set_homepage("https://github.com/awslabs/aws-c-io") + set_description("This is a module for the AWS SDK for C. It handles all IO and TLS work for application protocols. ") + set_license("Apache-2.0") + + add_urls("https://github.com/awslabs/aws-c-io/archive/refs/tags/$(version).tar.gz", + "https://github.com/awslabs/aws-c-io.git") + + add_versions("v0.14.8", "d50e21fdbd5170a4071fe067ef4ce297b02cb058ad47e118305e25f6e07d9cf0") + add_versions("v0.14.7", "ecf1f660d7d43913aa8a416be6a2027101ce87c3b241344342d608335b4df7d4") + add_versions("v0.14.6", "bb3af305af748185b1c7b17afa343e54f2d494ccff397402f1b17041b0967865") + add_versions("v0.14.5", "2700bcde062f7de1c1cbfd236b9fdfc9b24b4aa6dc0fb09bb156e16e07ebd0b6") + add_versions("v0.13.32", "2a6b18c544d014ca4f55cb96002dbbc1e52a2120541c809fa974cb0838ea72cc") + + add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"}) + + if is_plat("windows") then + add_syslinks("advapi32", "crypt32", "secur32", "ncrypt") + elseif is_plat("linux", "bsd", "cross") then + add_deps("s2n-tls") + elseif is_plat("macosx") then + add_frameworks("Security") + end + + add_deps("cmake", "aws-c-common", "aws-c-cal") + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", "cross", function (package) + local cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake") + if package:is_plat("windows") then + cmakedir = cmakedir:gsub("\\", "/") + end + + local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_MODULE_PATH=" .. cmakedir} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("aws_io_library_init", {includes = "aws/io/io.h"})) + end) diff --git a/packages/a/aws-c-mqtt/xmake.lua b/packages/a/aws-c-mqtt/xmake.lua new file mode 100644 index 000000000..54f00f16c --- /dev/null +++ b/packages/a/aws-c-mqtt/xmake.lua @@ -0,0 +1,37 @@ +package("aws-c-mqtt") + set_homepage("https://github.com/awslabs/aws-c-mqtt") + set_description("C99 implementation of the MQTT 3.1.1 specification.") + set_license("Apache-2.0") + + add_urls("https://github.com/awslabs/aws-c-mqtt/archive/refs/tags/$(version).tar.gz", + "https://github.com/awslabs/aws-c-mqtt.git") + + add_versions("v0.10.4", "6a41456f9eee15d71e4e2ee162b354865809f26620f1e6e5acb237f190f77f3f") + add_versions("v0.10.3", "bb938d794b0757d669b5877526363dc6f6f0e43869ca19fc196ffd0f7a35f5b9") + add_versions("v0.9.5", "987289535d3c988fe949f49d81268736c96fe27b27c98c899f0a148577f6627b") + + add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"}) + add_configs("assert_lock_help", {description = "Enable ASSERT_SYNCED_DATA_LOCK_HELD for checking thread issue", default = false, type = "boolean"}) + + add_deps("cmake", "aws-c-http", "aws-c-io", "aws-c-cal", "aws-c-common") + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", "cross", function (package) + local cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake") + if package:is_plat("windows") then + cmakedir = cmakedir:gsub("\\", "/") + end + + local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_MODULE_PATH=" .. cmakedir} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF")) + table.insert(configs, "-DASSERT_LOCK_HELD=" .. (package:config("assert_lock_help") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("aws_mqtt_library_init", {includes = "aws/mqtt/mqtt.h"})) + end) diff --git a/packages/a/aws-c-s3/xmake.lua b/packages/a/aws-c-s3/xmake.lua new file mode 100644 index 000000000..6681b2c6d --- /dev/null +++ b/packages/a/aws-c-s3/xmake.lua @@ -0,0 +1,37 @@ +package("aws-c-s3") + set_homepage("https://github.com/awslabs/aws-c-s3") + set_description("C99 library implementation for communicating with the S3 service, designed for maximizing throughput on high bandwidth EC2 instances.") + set_license("Apache-2.0") + + add_urls("https://github.com/awslabs/aws-c-s3/archive/refs/tags/$(version).tar.gz", + "https://github.com/awslabs/aws-c-s3.git") + + add_versions("v0.5.9", "7a337195b295406658d163b6dac64ff81f7556291b8a8e79e58ebaa2d55178ee") + add_versions("v0.5.7", "2f2eab9bf90a319030fd3525953dc7ac00c8dc8c0d33e3f0338f2a3b554d3b6a") + add_versions("v0.3.17", "72fd93a2f9a7d9f205d66890da249944b86f9528216dc0321be153bf19b2ecd5") + + add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"}) + add_configs("assert_lock_help", {description = "Enable ASSERT_SYNCED_DATA_LOCK_HELD for checking thread issue", default = false, type = "boolean"}) + + add_deps("cmake", "aws-c-common", "aws-checksums", "aws-c-io", "aws-c-http", "aws-c-auth") + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", "cross", function (package) + local cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake") + if package:is_plat("windows") then + cmakedir = cmakedir:gsub("\\", "/") + end + + local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_MODULE_PATH=" .. cmakedir} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF")) + table.insert(configs, "-DASSERT_LOCK_HELD=" .. (package:config("assert_lock_help") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("aws_s3_library_init", {includes = "aws/s3/s3.h"})) + end) diff --git a/packages/a/aws-c-sdkutils/xmake.lua b/packages/a/aws-c-sdkutils/xmake.lua new file mode 100644 index 000000000..e7ab511d0 --- /dev/null +++ b/packages/a/aws-c-sdkutils/xmake.lua @@ -0,0 +1,45 @@ +package("aws-c-sdkutils") + set_homepage("https://github.com/awslabs/aws-c-sdkutils") + set_description("C99 library implementing AWS SDK specific utilities. Includes utilities for ARN parsing, reading AWS profiles, etc...") + set_license("Apache-2.0") + + add_urls("https://github.com/awslabs/aws-c-sdkutils/archive/refs/tags/$(version).tar.gz", + "https://github.com/awslabs/aws-c-sdkutils.git") + + add_versions("v0.1.16", "4a818563d7c6636b5b245f5d22d4d7c804fa33fc4ea6976e9c296d272f4966d3") + add_versions("v0.1.15", "15fa30b8b0a357128388f2f40ab0ba3df63742fd333cc2f89cb91a9169f03bdc") + add_versions("v0.1.12", "c876c3ce2918f1181c24829f599c8f06e29733f0bd6556d4c4fb523390561316") + + add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"}) + if is_plat("wasm") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("cmake", "aws-c-common") + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", "android", "iphoneos", "cross", "wasm", function (package) + local aws_cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake") + local aws_c_common_configdir = package:dep("aws-c-common"):installdir("lib", "aws-c-common", "cmake") + if is_host("windows") then + aws_cmakedir = aws_cmakedir:gsub("\\", "/") + aws_c_common_configdir = aws_c_common_configdir:gsub("\\", "/") + end + + local configs = + { + "-DBUILD_TESTING=OFF", + "-DCMAKE_MODULE_PATH=" .. aws_cmakedir, + "-Daws-c-common_DIR=" .. aws_c_common_configdir + } + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("aws_sdkutils_library_init", {includes = "aws/sdkutils/sdkutils.h"})) + end) diff --git a/packages/a/aws-checksums/xmake.lua b/packages/a/aws-checksums/xmake.lua index 67418336f..33786cf77 100644 --- a/packages/a/aws-checksums/xmake.lua +++ b/packages/a/aws-checksums/xmake.lua @@ -3,29 +3,29 @@ package("aws-checksums") set_description("Cross platform HW accelerated CRC32c and CRC32 with fallback to efficient SW implementations - C interface with language bindings for AWS SDKs") set_license("Apache-2.0") - add_urls("https://github.com/awslabs/aws-checksums/archive/$(version).tar.gz", + add_urls("https://github.com/awslabs/aws-checksums/archive/refs/tags/$(version).tar.gz", "https://github.com/awslabs/aws-checksums.git") - add_versions("v0.1.12", "394723034b81cc7cd528401775bc7aca2b12c7471c92350c80a0e2fb9d2909fe") - if is_plat("linux") then - add_deps("cmake") - end + add_versions("v0.1.18", "bdba9d0a8b8330a89c6b8cbc00b9aa14f403d3449b37ff2e0d96d62a7301b2ee") + add_versions("v0.1.17", "83c1fbae826631361a529e9565e64a942c412baaec6b705ae5da3f056b97b958") - on_load(function (package) - if package:config("shared") then - package:add("deps", "aws-c-common", {configs = {shared = true}}) - else - package:add("deps", "aws-c-common") + add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"}) + + add_deps("cmake", "aws-c-common") + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", "cross", function (package) + local cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake") + if package:is_plat("windows") then + cmakedir = cmakedir:gsub("\\", "/") end - end) - on_install("linux", function (package) - local configs = {} - local common_cmake_dir = package:dep("aws-c-common"):installdir("lib", "cmake") - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_MODULE_PATH=" .. cmakedir} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - io.replace("CMakeLists.txt", "list(APPEND CMAKE_MODULE_PATH ${AWS_MODULE_PATH})", - "list(APPEND CMAKE_MODULE_PATH \"" .. common_cmake_dir .. "\")", {plain = true}) + table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end import("package.tools.cmake").install(package, configs) end) diff --git a/packages/a/aws-crt-cpp/xmake.lua b/packages/a/aws-crt-cpp/xmake.lua new file mode 100644 index 000000000..06e7b6173 --- /dev/null +++ b/packages/a/aws-crt-cpp/xmake.lua @@ -0,0 +1,49 @@ +package("aws-crt-cpp") + set_homepage("https://github.com/awslabs/aws-crt-cpp") + set_description("C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.") + set_license("Apache-2.0") + + add_urls("https://github.com/awslabs/aws-crt-cpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/awslabs/aws-crt-cpp.git") + + add_versions("v0.26.11", "23acb2b14019182dd73fe6779ec266ee4d8937f19a99803da6407937fa22db7d") + add_versions("v0.26.9", "5b5760d34fbbfcc971f561296e828de4c788750472fd9bd3ac20068a083620f2") + add_versions("v0.26.8", "36ced4fb54c8eb7325b4576134e01f93bfaca2709565b5ad036d198d703e4c8f") + add_versions("v0.26.4", "486113a556614b7b824e1aefec365a2261154fe06321b85601aefe2f65bd0706") + add_versions("v0.23.1", "8f7029fea12907564b80260cbea4a2b268ca678e7427def3e0c46871e9b42d16") + + add_configs("openssl", {description = "Set this if you want to use your system's OpenSSL 1.0.2/1.1.1 compatible libcrypto", default = false, type = "boolean"}) + + add_deps("cmake", "aws-c-common", "aws-c-io", "aws-checksums", "aws-c-event-stream", + "aws-c-http", "aws-c-mqtt", "aws-c-auth", "aws-c-s3") + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "msys", function (package) + local cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake") + if package:is_plat("windows") then + cmakedir = cmakedir:gsub("\\", "/") + end + + local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_MODULE_PATH=" .. cmakedir, "-DBUILD_DEPS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + + io.replace("include/aws/crt/Exports.h", "WIN32", "_WIN32", {plain = true}) + if package:config("shared") then + package:add("defines", "AWS_CRT_CPP_USE_IMPORT_EXPORT") + end + end + table.insert(configs, "-DUSE_OPENSSL=" .. (package:config("openssl") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + Aws::Crt::ApiHandle apiHandle; + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/b/b2/xmake.lua b/packages/b/b2/xmake.lua index efda6991a..3c13e708a 100644 --- a/packages/b/b2/xmake.lua +++ b/packages/b/b2/xmake.lua @@ -6,6 +6,9 @@ package("b2") set_license("BSL-1.0") add_urls("https://github.com/bfgroup/b2/releases/download/$(version)/b2-$(version).zip") + add_versions("5.1.0", "2bf9618a0baa132d22fdfebf6b40436329172e3ca4b7b8a33e06ed97cd603dad") + add_versions("5.0.1", "5d3b98c63ed4d0f6114f660bd4eca5df32afa332310878b35c0d0faa04a3b6dd") + add_versions("5.0.0", "d5f280f466b80b694ccb9696413375522d16e6f811918daeb44a917d5bd6c7b5") add_versions("4.9.6", "a049f7fdfae4b62353a3f76f34a72c8c87324d1c026cf87febe6c563311bf687") on_install("@windows", function (package) diff --git a/packages/b/backportcpp/xmake.lua b/packages/b/backportcpp/xmake.lua new file mode 100644 index 000000000..74a3ba7d5 --- /dev/null +++ b/packages/b/backportcpp/xmake.lua @@ -0,0 +1,25 @@ +package("backportcpp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/bitwizeshift/BackportCpp") + set_description("Library of backported modern C++ types to work with C++11") + set_license("MIT") + + add_urls("https://github.com/bitwizeshift/BackportCpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/bitwizeshift/BackportCpp.git") + + add_versions("v1.2.0", "8efded40a1d0e6674824336499d8706043a62bd8ae8aef62210c8c215f710b84") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + bpstd::string_view view; + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/b/backward-cpp/xmake.lua b/packages/b/backward-cpp/xmake.lua index 10e1c3a05..7bfdb784f 100644 --- a/packages/b/backward-cpp/xmake.lua +++ b/packages/b/backward-cpp/xmake.lua @@ -4,6 +4,8 @@ package("backward-cpp") set_description("Backward is a beautiful stack trace pretty printer for C++.") set_license("MIT") + add_configs("bfd", {description = "Get stack trace with details about your sources by using libbfd from binutils.", default = false, type = "boolean"}) + add_urls("https://github.com/bombela/backward-cpp/archive/refs/tags/$(version).zip", "https://github.com/bombela/backward-cpp.git") add_versions("v1.6", "9b07e12656ab9af8779a84e06865233b9e30fadbb063bf94dd81d318081db8c2") @@ -18,7 +20,17 @@ package("backward-cpp") add_deps("cmake") - on_install("linux", "mingw", "macosx", "windows", function (package) + on_load("linux", "mingw@msys", "macos", function (package) + if package:config("bfd") then + package:add("deps", "binutils") + end + end) + + on_install("linux", "mingw", "macosx", "windows|!arm*", function (package) + if package:config("bfd") and package:is_plat("linux", "mingw@msys", "macos") then + package:add("syslinks", "bfd") + package:add("defines", "BACKWARD_HAS_BFD=1") + end local configs = {"-DBACKWARD_TESTS=OFF"} table.insert(configs, "-DBACKWARD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) @@ -28,3 +40,4 @@ package("backward-cpp") on_test(function (package) assert(package:has_cxxtypes("backward::SignalHandling", {configs = {languages = "c++11"}, includes = "backward/backward.hpp"})) end) + diff --git a/packages/b/basisu/port/xmake.lua b/packages/b/basisu/port/xmake.lua new file mode 100644 index 000000000..55b6b0456 --- /dev/null +++ b/packages/b/basisu/port/xmake.lua @@ -0,0 +1,37 @@ +option("opencl", {default = false}) +option("tools", {default = false}) + +add_rules("mode.debug", "mode.release") + +set_languages("c++11") +add_rules("utils.install.cmake_importfiles") + +if has_config("opencl") then + add_requires("opencl") + add_packages("opencl") + add_defines("BASISU_SUPPORT_OPENCL") +end + +add_requires("zstd") +add_packages("zstd") +add_defines("BASISD_SUPPORT_KTX2_ZSTD") + +target("basisu") + set_kind("$(kind)") + add_files("encoder/*.cpp", "transcoder/*.cpp") + add_headerfiles("(encoder/*.h)", "(transcoder/*.h)", "(transcoder/*.inc)", {prefixdir = "basisu"}) + + add_vectorexts("all") + + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + elseif is_plat("linux", "bsd") then + add_syslinks("m", "pthread") + end + +if has_config("tools") then + target("basisu_tool") + set_kind("binary") + add_files("basisu_tool.cpp") + add_deps("basisu") +end diff --git a/packages/b/basisu/xmake.lua b/packages/b/basisu/xmake.lua new file mode 100644 index 000000000..39acbd7c7 --- /dev/null +++ b/packages/b/basisu/xmake.lua @@ -0,0 +1,43 @@ +package("basisu") + set_homepage("https://github.com/BinomialLLC/basis_universal") + set_description("Basis Universal GPU Texture Codec") + set_license("Apache-2.0") + + add_urls("https://github.com/BinomialLLC/basis_universal/archive/refs/tags/$(version).tar.gz", + "https://github.com/BinomialLLC/basis_universal.git") + + add_versions("1.16.4", "e5740fd623a2f8472c9700b9447a8725a6f27d65b0b47c3e3926a60db41b8a64") + + add_configs("opencl", {description = "Enable opencl", default = false, type = "boolean"}) + add_configs("tools", {description = "Build tools", default = false, type = "boolean"}) + + if is_plat("linux", "bsd") then + add_syslinks("m", "pthread") + end + + add_deps("zstd") + + on_load(function (package) + if package:config("opencl") then + package:add("deps", "opencl") + end + end) + + on_install(function (package) + io.replace("encoder/basisu_comp.cpp", "../zstd/zstd.h", "zstd.h", {plain = true}) + + local configs = { + opencl = package:config("opencl"), + tools = package:config("tools"), + } + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + basist::basisu_transcoder_init(); + } + ]]}, {configs = {languages = "c++11"}, includes = "basisu/transcoder/basisu_transcoder.h"})) + end) diff --git a/packages/b/bazel/xmake.lua b/packages/b/bazel/xmake.lua index f00346b29..96c611680 100644 --- a/packages/b/bazel/xmake.lua +++ b/packages/b/bazel/xmake.lua @@ -7,18 +7,23 @@ package("bazel") if is_host("windows") and os.arch() == "x64" then add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-windows-x86_64.exe") add_versions("5.0.0", "452217bcc4f8153c521fd985256316cd0bcad869fd192e1afd406dcb16f880d6") + add_versions("7.1.0", "f3e01effd7674364ef2d7539d5ece6cd2f68d212ee94652623ae2405b53feeaf") elseif is_host("macosx") and os.arch() == "x86_64" then add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-darwin-x86_64") add_versions("5.0.0", "60558f06b9410b15602d6f41a294cec2cb69436c6e64d72ea78f42056373b8b9") + add_versions("7.1.0", "52ad8d57c22e4f873c724473a09ecfd98966c3a2950e102a7bd7e8c612b8001c") elseif is_host("macosx") and os.arch() == "arm64" then - add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-darwin-x86_64") + add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-darwin-arm64") add_versions("5.0.0", "86ba0e31b61b675afdfe393bd3b02e12b8fe1196eb5ea045da86f067547fe90f") + add_versions("7.1.0", "fb5e7bc62fc3c8f2511e3b64d795296444129b26f13d8dece4d4cee1845b758f") elseif is_host("linux") and os.arch() == "x86_64" then add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-linux-x86_64") add_versions("5.0.0", "399eedb225cff7a13f9f027f7ea2aad02ddb668a8eb89b1d975d222e4dc12ed9") + add_versions("7.1.0", "62d62c699c1eb9f9be6a88030912a54d19fe45ae29329c7e5c53aba787492522") elseif is_host("linux") and os.arch() == "arm64" then add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-linux-arm64") add_versions("5.0.0", "4a88b8f48cac3bf6fe657332631c36b4d255628c87bd77eb3159f4eb166f5e66") + add_versions("7.1.0", "b8cb5f842ce457606fbff3dba7a47e973f72bba0af1b7575ae500ca5a3d44282") end on_install("@windows|x64", "@macosx", "@linux|x86_64", "@linux|arm64", function (package) diff --git a/packages/b/bc/xmake.lua b/packages/b/bc/xmake.lua index 61febc789..2af582a93 100644 --- a/packages/b/bc/xmake.lua +++ b/packages/b/bc/xmake.lua @@ -5,8 +5,8 @@ package("bc") set_description("Arbitrary precision numeric processing language") set_license("GPL-3.0-or-later") - set_urls("https://ftp.gnu.org/gnu/bc/bc-$(version).tar.gz", - "https://ftpmirror.gnu.org/bc/bc-$(version).tar.gz") + set_urls("https://ftpmirror.gnu.org/bc/bc-$(version).tar.gz", + "https://ftp.gnu.org/gnu/bc/bc-$(version).tar.gz") add_versions("1.07.1", "62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a") add_deps("flex", "bison", "ed", "texinfo") diff --git a/packages/b/bcg729/xmake.lua b/packages/b/bcg729/xmake.lua new file mode 100644 index 000000000..f6a560856 --- /dev/null +++ b/packages/b/bcg729/xmake.lua @@ -0,0 +1,35 @@ +package("bcg729") + set_homepage("http://linphone.org") + set_description("Bcg729 is an opensource implementation of both encoder and decoder of the ITU G729 Annex A/B speech codec.") + + add_urls("https://github.com/BelledonneCommunications/bcg729/archive/refs/tags/$(version).tar.gz", + "https://github.com/BelledonneCommunications/bcg729.git") + add_versions("1.0.4", "94b3542a06cbd96306efc19f959f9febae62806a22599063f82a8c33e989d48b") + add_versions("1.1.1", "68599a850535d1b182932b3f86558ac8a76d4b899a548183b062956c5fdc916d") + + add_deps("cmake") + + on_load(function (package) + if not package:config("shared") then + package:add("defines", "BCG729_STATIC") + end + end) + + on_install(function (package) + local configs = {"-DENABLE_TESTS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + if package:config("shared") then + table.insert(configs, "-DENABLE_SHARED=ON") + table.insert(configs, "-DENABLE_STATIC=OFF") + else + table.insert(configs, "-DENABLE_SHARED=OFF") + table.insert(configs, "-DENABLE_STATIC=ON") + end + + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("bcg729Decoder", {includes = "bcg729/decoder.h"})) + assert(package:has_cfuncs("bcg729Encoder", {includes = "bcg729/encoder.h"})) + end) diff --git a/packages/b/bdwgc/xmake.lua b/packages/b/bdwgc/xmake.lua index af75120f0..0d150d93c 100644 --- a/packages/b/bdwgc/xmake.lua +++ b/packages/b/bdwgc/xmake.lua @@ -5,6 +5,7 @@ package("bdwgc") add_urls("https://github.com/ivmai/bdwgc/-/archive/$(version).tar.gz", "https://github.com/ivmai/bdwgc.git") + add_versions("v8.2.6", "3bfc2b1dd385bfb46d2dab029211a66249a309795b6893f4e00554904999e40a") add_versions("v8.2.4", "18e63ab1428bd52e691da107a6a56651c161210b11fbe22e2aa3c31f7fa00ca5") add_deps("cmake") diff --git a/packages/b/benchmark/xmake.lua b/packages/b/benchmark/xmake.lua index 706b6c08e..7d375c12e 100644 --- a/packages/b/benchmark/xmake.lua +++ b/packages/b/benchmark/xmake.lua @@ -16,6 +16,8 @@ package("benchmark") add_versions("1.7.0", "3aff99169fa8bdee356eaa1f691e835a6e57b1efeadb8a0f9f228531158246ac") add_versions("1.7.1", "6430e4092653380d9dc4ccb45a1e2dc9259d581f4866dc0759713126056bc1d7") add_versions("1.8.0", "ea2e94c24ddf6594d15c711c06ccd4486434d9cf3eca954e2af8a20c88f9f172") + add_versions("1.8.3", "6bc180a57d23d4d9515519f92b0c83d61b05b5bab188961f36ac7b06b0d9e9ce") + add_versions("1.8.4", "3e7059b6b11fb1bbe28e33e02519398ca94c1818874ebed18e504dc6f709be45") if is_plat("mingw") and is_subhost("msys") then add_extsources("pacman::benchmark") @@ -27,10 +29,14 @@ package("benchmark") if is_plat("linux") then add_syslinks("pthread") - elseif is_plat("windows") then + elseif is_plat("windows", "mingw") then add_syslinks("shlwapi") end + if is_plat("mingw") then + add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) + end + add_deps("cmake") add_links("benchmark_main", "benchmark") on_load("windows", function (package) @@ -39,7 +45,7 @@ package("benchmark") end end) - on_install("macosx", "linux", "windows", function (package) + on_install("macosx", "linux", "windows", "mingw", function (package) local configs = {"-DBENCHMARK_ENABLE_TESTING=OFF", "-DBENCHMARK_INSTALL_DOCS=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) @@ -54,4 +60,4 @@ package("benchmark") BENCHMARK(BM_empty); BENCHMARK(BM_empty)->ThreadPerCpu(); ]]}, {configs = {languages = "c++14"}, includes = "benchmark/benchmark.h"})) - end) + end) \ No newline at end of file diff --git a/packages/b/bgfx/rules/shaders.lua b/packages/b/bgfx/rules/shaders.lua new file mode 100644 index 000000000..5499e8868 --- /dev/null +++ b/packages/b/bgfx/rules/shaders.lua @@ -0,0 +1,135 @@ +-- Compile bgfx shader files. Substitution for scripts/shader.mk. +-- +-- Usage: +-- +-- add_rules("@bgfx/shaders") +-- add_files("shader.vert", {type = "vertex", output_dir = "shaders", output_name = "shader.vert.bin", profiles = {glsl = "330"}}) + +rule("shaders") + set_extensions(".vert", ".frag", ".comp") + on_buildcmd_file(function (target, batchcmds, shaderfile, opt) + import("lib.detect.find_program") + import("core.base.option") + + batchcmds:show_progress(opt.progress, "${color.build.object}compiling.shaderc %s", shaderfile) + + -- get bgfx shaderc + local shaderc = find_program("shadercRelease") or find_program("shadercDebug") + assert(shaderc, "bgfx shaderc not found! please check your bgfx installation.") + + -- determine arguments for shaderc from fileconfig + local fileconfig = target:fileconfig(shaderfile) + + local output_filename + if fileconfig and fileconfig.output_name then + output_filename = fileconfig.output_name + else + output_filename = path.filename(shaderfile) .. ".bin" + end + + local output_dir + if fileconfig and fileconfig.output_dir then + output_dir = fileconfig.output_dir + else + output_dir = "shaders" + end + + local vardef_filename + if fileconfig and fileconfig.vardef then + vardef_filename = fileconfig.vardef + else + vardef_filename = path.join( + path.directory(shaderfile), + path.basename(shaderfile) .. ".varying.def.sc") + end + + local shader_type + if fileconfig and fileconfig.type then + if table.contains(bgfx_types, fileconfig.type) then + shader_type = fileconfig.type + else + raise("unsupported shader type " .. fileconfig.type) + end + elseif shaderfile:match("%.vert$") then + shader_type = "vertex" + elseif shaderfile:match("%.frag$") then + shader_type = "fragment" + elseif shaderfile:match("%.comp$") then + shader_type = "compute" + else + raise("cannot determine shader type from file name " .. path.filename(shaderfile)) + end + + -- determine platform-specific shaderc arguments + local bgfx_platforms = { + windows = "windows", + macosx = "osx", + linux = "linux" + } + local bgfx_types = { + "vertex", + "fragment", + "compute" + } + local bgfx_default_profiles = { + windows = { + vertex = {dx9 = "s_3_0", dx11 = "s_5_0", glsl = "120"}, + fragment = {dx9 = "s_3_0", dx11 = "s_5_0", glsl = "120"}, + compute = {dx11 = "s_5_0", glsl = "430"}, + }, + macosx = { + vertex = {metal = "metal", glsl = "120"}, + fragment = {metal = "metal", glsl = "120"}, + compute = {metal = "metal", glsl = "430"} + }, + linux = { + vertex = {glsl = "120", spirv = "spirv"}, + fragment = {glsl = "120", spirv = "spirv"}, + compute = {glsl = "430", spirv = "spirv"} + } + } + + -- build command args + local args = { + "-f", shaderfile, + "--type", shader_type, + "--varyingdef", vardef_filename, + "--platform", bgfx_platforms[target:plat()], + } + for _, includedir in ipairs(target:get("includedirs")) do + table.insert(args, "-i") + table.insert(args, includedir) + end + + local mtime = 0 + local shader_profiles + if fileconfig and fileconfig.profiles then + shader_profiles = fileconfig.profiles + else + shader_profiles = bgfx_default_profiles[target:plat()][shader_type] + end + for folder, profile in pairs(shader_profiles) do + -- set output dir + local outputdir = path.join(target:targetdir(), output_dir, folder) + batchcmds:mkdir(outputdir) + local binary = path.join(outputdir, output_filename) + + -- compiling + local real_args = {} + table.join2(real_args, args) + table.insert(real_args, "-o") + table.insert(real_args, binary) + table.insert(real_args, "--profile") + table.insert(real_args, profile) + if option.get("verbose") then + batchcmds:show(shaderc .. " " .. os.args(real_args)) + end + batchcmds:vrunv(shaderc, real_args) + + if (mtime == 0) then mtime = os.mtime(binary) end + end + + -- add deps + batchcmds:add_depfiles(shaderfile) + batchcmds:set_depmtime(mtime) + end) diff --git a/packages/b/bgfx/xmake.lua b/packages/b/bgfx/xmake.lua index c40a47285..08258644c 100644 --- a/packages/b/bgfx/xmake.lua +++ b/packages/b/bgfx/xmake.lua @@ -7,11 +7,14 @@ package("bgfx") add_urls("https://github.com/bkaradzic/bgfx.git") add_versions("7816", "5ecddbf4d51e2dda2a56ae8cafef4810e3a45d87") add_versions("8203", "484a5f0c25b53584a6b7fce0702a6bb580072d81") + add_versions("8674", "f42134876038027667ef7e47c9a612dca1051ef2") add_resources("7816", "bx", "https://github.com/bkaradzic/bx.git", "51f25ba638b9cb35eb2ac078f842a4bed0746d56") add_resources("8203", "bx", "https://github.com/bkaradzic/bx.git", "b9501348c596b68e5e655a8308df5c55f61ecd80") + add_resources("8674", "bx", "https://github.com/bkaradzic/bx.git", "67dfdf34f642a4a807b75eb600f82f4f04027963") add_resources("7816", "bimg", "https://github.com/bkaradzic/bimg.git", "8355d36befc90c1db82fca8e54f38bfb7eeb3530") add_resources("8203", "bimg", "https://github.com/bkaradzic/bimg.git", "663f724186e26caf46494e389ed82409106205fb") + add_resources("8674", "bimg", "https://github.com/bkaradzic/bimg.git", "964a5b85483cdf59a30dc006e9bd8bbdde6cb2be") if is_plat("windows") then add_syslinks("user32", "gdi32", "psapi") @@ -34,7 +37,7 @@ package("bgfx") package:add("defines", "BX_CONFIG_DEBUG=" .. (package:debug() and "1" or "0")) end) - on_install("windows", "macosx", "linux", function (package) + on_install("windows|native", "macosx", "linux", function (package) local bxdir = package:resourcefile("bx") local bimgdir = package:resourcefile("bimg") local genie = is_host("windows") and "genie.exe" or "genie" diff --git a/packages/b/bght/xmake.lua b/packages/b/bght/xmake.lua new file mode 100644 index 000000000..db6f2c4b2 --- /dev/null +++ b/packages/b/bght/xmake.lua @@ -0,0 +1,17 @@ +package("bght") + + set_kind("library", {headeronly = true}) + set_homepage("https://owensgroup.github.io/BGHT/") + set_description("BGHT: Better GPU Hash Tables") + set_license("Apache-2.0") + + add_urls("https://github.com/owensgroup/BGHT.git") + add_versions("2024.03.06", "fd58966b20f76c7cd1aa1bdae58e28f6e3a7d242") + + on_install(function (package) + os.cp("include/bght", package:installdir("include")) + end) + + on_test(function (package) + assert(os.isfile(path.join(package:installdir("include"), "bght", "bcht.hpp"))) + end) diff --git a/packages/b/binutils/xmake.lua b/packages/b/binutils/xmake.lua index 35234cb24..cd41c5172 100644 --- a/packages/b/binutils/xmake.lua +++ b/packages/b/binutils/xmake.lua @@ -5,8 +5,9 @@ package("binutils") set_description("GNU binary tools for native development") set_license("GPL-2.0") - set_urls("https://ftp.gnu.org/gnu/binutils/binutils-$(version).tar.xz", - "https://ftpmirror.gnu.org/binutils/binutils-$(version).tar.xz") + set_urls("https://ftpmirror.gnu.org/binutils/binutils-$(version).tar.xz", + "https://ftp.gnu.org/gnu/binutils/binutils-$(version).tar.xz") + add_versions("2.41", "ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450") add_versions("2.38", "e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024") add_versions("2.34", "f00b0e8803dc9bab1e2165bd568528135be734df3fabf8d0161828cd56028952") @@ -18,6 +19,8 @@ package("binutils") add_extsources("brew::binutils") end + add_deps("bison") + on_install("@linux", "@macosx", "@msys", function (package) local configs = {"--disable-debug", "--disable-dependency-tracking", diff --git a/packages/b/bison/xmake.lua b/packages/b/bison/xmake.lua index ebc9cc60a..7ffd49d85 100644 --- a/packages/b/bison/xmake.lua +++ b/packages/b/bison/xmake.lua @@ -5,7 +5,8 @@ package("bison") set_license("GPL-3.0") if not is_plat("windows") then - add_urls("http://ftp.gnu.org/gnu/bison/bison-$(version).tar.gz") + add_urls("http://ftpmirror.gnu.org/gnu/bison/bison-$(version).tar.gz", + "http://ftp.gnu.org/gnu/bison/bison-$(version).tar.gz") end add_versions("3.7.4", "fbabc7359ccd8b4b36d47bfe37ebbce44805c052526d5558b95eda125d1677e2") diff --git a/packages/b/bitsery/patches/5.2.3/cstdint-include.patch b/packages/b/bitsery/patches/5.2.3/cstdint-include.patch new file mode 100644 index 000000000..2c54d9b33 --- /dev/null +++ b/packages/b/bitsery/patches/5.2.3/cstdint-include.patch @@ -0,0 +1,12 @@ +diff --git a/include/bitsery/details/adapter_common.h b/include/bitsery/details/adapter_common.h +index 7f665d4..166d188 100644 +--- a/include/bitsery/details/adapter_common.h ++++ b/include/bitsery/details/adapter_common.h +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + namespace bitsery { + diff --git a/packages/b/bitsery/xmake.lua b/packages/b/bitsery/xmake.lua new file mode 100644 index 000000000..ccfc133e6 --- /dev/null +++ b/packages/b/bitsery/xmake.lua @@ -0,0 +1,50 @@ +package("bitsery") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/fraillt/bitsery") + set_description("Header only C++ binary serialization library. It is designed around the networking requirements for real-time data delivery, especially for games.") + set_license("MIT") + + add_urls("https://github.com/fraillt/bitsery/archive/refs/tags/$(version).tar.gz", + "https://github.com/fraillt/bitsery.git") + add_versions("v5.2.3", "896d82ab4ccea9899ff2098aa69ad6d25e524ee1d4c747ce3232d0afe3cd05a5") + + add_patches("5.2.3", path.join(os.scriptdir(), "patches", "5.2.3", "cstdint-include.patch"), "bb9ea1f68b219249395f3f3f9404d6e5c150144d793b6707f51facd1ff751f2c") + + on_install(function (package) + os.cp(path.join("include", "*"), package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + enum class MyEnum:uint16_t { V1,V2,V3 }; + struct MyStruct { + uint32_t i; + MyEnum e; + std::vector fs; + }; + + template + void serialize(S& s, MyStruct& o) { + s.value4b(o.i); + s.value2b(o.e); + s.container4b(o.fs, 10); + } + + using Buffer = std::vector; + using OutputAdapter = bitsery::OutputBufferAdapter; + using InputAdapter = bitsery::InputBufferAdapter; + + void test() { + MyStruct data{8941, MyEnum::V2, {15.0f, -8.5f, 0.045f}}; + MyStruct res{}; + + Buffer buffer; + + auto writtenSize = bitsery::quickSerialization(buffer, data); + auto state = bitsery::quickDeserialization({buffer.begin(), writtenSize}, res); + + assert(state.first == bitsery::ReaderError::NoError && state.second); + assert(data.fs == res.fs && data.i == res.i && data.e == res.e); + } + ]]}, {configs = {languages = "c++11"}, includes = {"bitsery/bitsery.h", "bitsery/adapter/buffer.h", "bitsery/traits/vector.h"}})) + end) diff --git a/packages/b/blake3/xmake.lua b/packages/b/blake3/xmake.lua index c9fdb88ad..8d54364f1 100644 --- a/packages/b/blake3/xmake.lua +++ b/packages/b/blake3/xmake.lua @@ -5,10 +5,12 @@ package("blake3") add_urls("https://github.com/BLAKE3-team/BLAKE3/archive/refs/tags/$(version).tar.gz", "https://github.com/BLAKE3-team/BLAKE3.git") + add_versions("1.5.1", "822cd37f70152e5985433d2c50c8f6b2ec83aaf11aa31be9fe71486a91744f37") + add_versions("1.5.0", "f506140bc3af41d3432a4ce18b3b83b08eaa240e94ef161eb72b2e57cdc94c69") add_versions("1.3.3", "27d2bc4ee5945ba75434859521042c949463ee7514ff17aaef328e23ef83fec0") add_versions("1.3.1", "112becf0983b5c83efff07f20b458f2dbcdbd768fd46502e7ddd831b83550109") - on_install("windows", "linux", "macosx", "bsd", "mingw|x86_64", "android", "iphoneos", "cross", function (package) + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "mingw|x86_64", "android", "iphoneos", "cross", function (package) local configs = {} io.writefile("xmake.lua", [[ diff --git a/packages/b/blend2d/xmake.lua b/packages/b/blend2d/xmake.lua index 7f7711c4e..243081e2a 100644 --- a/packages/b/blend2d/xmake.lua +++ b/packages/b/blend2d/xmake.lua @@ -3,29 +3,54 @@ package("blend2d") set_description("2D Vector Graphics Engine Powered by a JIT Compiler") set_license("zlib") - add_urls("https://github.com/blend2d/blend2d.git") - add_versions("2022.05.12", "84987c5f76c1b8f271e8556a4b87bcab78094c70") + set_urls("https://blend2d.com/download/blend2d-$(version).tar.gz", + "https://github.com/blend2d/blend2d.git") + + add_versions("0.11.1", "f46d61b6aa477fea1a353a41f5906d4e861817ae059ed22fc6ecdd50ff859dd2") + + add_configs("jit", {description = "Enable JIT compiler support", default = true, type = "boolean"}) add_deps("cmake") - add_deps("asmjit") - if is_plat("linux") then + if is_plat("linux", "bsd") then add_syslinks("pthread") end + on_check("windows", function (package) + import("core.tool.toolchain") + + local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + if msvc and package:is_arch("arm.*") then + local vs = msvc:config("vs") + assert(vs and tonumber(vs) >= 2022, "package(blend2d/arm): need vs >= 2022") + end + end) + on_load(function (package) - package:add("deps", "asmjit", {configs = {shared = package:config("shared")}}) + if package:config("jit") then + package:add("deps", "asmjit") + end if not package:config("shared") then package:add("defines", "BL_STATIC") end end) - on_install("windows", "macosx", "linux", function (package) - local configs = {"-DBLEND2D_TEST=OFF", "-DBLEND2D_NO_STDCXX=0"} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + on_install("!iphoneos", function (package) + local configs = {} + if package:config("jit") then + table.insert(configs, "-DBLEND2D_EXTERNAL_ASMJIT=TRUE") + table.insert(configs, "-DBLEND2D_NO_JIT=OFF") + else + table.insert(configs, "-DBLEND2D_NO_JIT=ON") + end + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBLEND2D_STATIC=" .. (package:config("shared") and "FALSE" or "TRUE")) - io.replace("CMakeLists.txt", 'include("${ASMJIT_DIR}/CMakeLists.txt")', "", {plain = true}) - import("package.tools.cmake").install(package, configs, {packagedeps = "asmjit"}) + + local cxflags + if package:is_plat("windows") and package:is_arch("arm.*") then + cxflags = "-D__ARM_NEON" + end + import("package.tools.cmake").install(package, configs, {cxflags = cxflags}) end) on_test(function (package) diff --git a/packages/b/blosc/xmake.lua b/packages/b/blosc/xmake.lua index c480b069f..f4e8e8c98 100644 --- a/packages/b/blosc/xmake.lua +++ b/packages/b/blosc/xmake.lua @@ -4,8 +4,9 @@ package("blosc") set_description("A blocking, shuffling and loss-less compression library") set_license("BSD-3-Clause") - add_urls("https://github.com/Blosc/c-blosc/archive/$(version).tar.gz", + add_urls("https://github.com/Blosc/c-blosc/archive/refs/tags/$(version).tar.gz", "https://github.com/Blosc/c-blosc.git") + add_versions("v1.21.5", "32e61961bbf81ffea6ff30e9d70fca36c86178afd3e3cfa13376adec8c687509") add_versions("v1.21.4", "e72bd03827b8564bbb3dc3ea0d0e689b4863871ce3861d946f2efd7a186ecf3e") add_versions("v1.21.1", "f387149eab24efa01c308e4cba0f59f64ccae57292ec9c794002232f7903b55b") add_versions("v1.20.1", "42c4d3fcce52af9f8e2078f8f57681bfc711706a3330cb72b9b39e05ae18a413") diff --git a/packages/b/bluez/xmake.lua b/packages/b/bluez/xmake.lua index 1d5eed6fe..8b5ba0bfc 100644 --- a/packages/b/bluez/xmake.lua +++ b/packages/b/bluez/xmake.lua @@ -1,9 +1,11 @@ package("bluez") set_homepage("http://www.bluez.org") set_description("Library for the Bluetooth protocol stack for Linux") - set_license("GPL-2.0") + set_license("GPL-2.0-or-later") add_urls("https://git.kernel.org/pub/scm/bluetooth/bluez.git") + add_versions("5.70", "c56970cbea3b5482a586b7570e79a28e7d84d295") + add_versions("5.69", "bbe41152d4c1c3fd608f3d933dba445a790a5331") add_versions("5.68", "d764f78f27653bc1df71c462e9aca7a18bc75f9f") on_install("linux", function (package) diff --git a/packages/b/boost/xmake.lua b/packages/b/boost/xmake.lua index c034c9ca0..92c4c182c 100644 --- a/packages/b/boost/xmake.lua +++ b/packages/b/boost/xmake.lua @@ -4,25 +4,27 @@ package("boost") set_description("Collection of portable C++ source libraries.") set_license("BSL-1.0") - add_urls("https://boostorg.jfrog.io/artifactory/main/release/$(version).tar.bz2", {version = function (version) - return version .. "/source/boost_" .. (version:gsub("%.", "_")) - end}) - add_urls("https://github.com/xmake-mirror/boost/releases/download/boost-$(version).tar.bz2", {version = function (version) + add_urls("https://github.com/boostorg/boost/releases/download/boost-$(version)/boost-$(version)-b2-nodocs.tar.gz") + add_urls("https://github.com/boostorg/boost/releases/download/boost-$(version)/boost-$(version).tar.gz") + add_urls("https://github.com/xmake-mirror/boost/releases/download/boost-$(version).tar.bz2", {alias = "mirror", version = function (version) return version .. "/boost_" .. (version:gsub("%.", "_")) end}) - add_versions("1.83.0", "6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e") - add_versions("1.82.0", "a6e1ab9b0860e6a2881dd7b21fe9f737a095e5f33a3a874afc6a345228597ee6") - add_versions("1.81.0", "71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa") - add_versions("1.80.0", "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0") - add_versions("1.79.0", "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39") - add_versions("1.78.0", "8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc") - add_versions("1.77.0", "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854") - add_versions("1.76.0", "f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41") - add_versions("1.75.0", "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb") - add_versions("1.74.0", "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1") - add_versions("1.73.0", "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402") - add_versions("1.72.0", "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722") - add_versions("1.70.0", "430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778") + + add_versions("1.85.0", "f4a7d3f81b8a0f65067b769ea84135fd7b72896f4f59c7f405086c8c0dc61434") + add_versions("1.84.0", "4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95") + add_versions("1.83.0", "0c6049764e80aa32754acd7d4f179fd5551d8172a83b71532ae093e7384e98da") + add_versions("1.82.0", "b62bd839ea6c28265af9a1f68393eda37fab3611425d3b28882d8e424535ec9d") + add_versions("1.81.0", "121da556b718fd7bd700b5f2e734f8004f1cfa78b7d30145471c526ba75a151c") + add_versions("mirror:1.80.0", "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0") + add_versions("mirror:1.79.0", "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39") + add_versions("mirror:1.78.0", "8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc") + add_versions("mirror:1.77.0", "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854") + add_versions("mirror:1.76.0", "f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41") + add_versions("mirror:1.75.0", "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb") + add_versions("mirror:1.74.0", "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1") + add_versions("mirror:1.73.0", "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402") + add_versions("mirror:1.72.0", "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722") + add_versions("mirror:1.70.0", "430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778") if is_plat("mingw") and is_subhost("msys") then add_extsources("pacman::boost") @@ -112,18 +114,21 @@ package("boost") end return linkname end - -- we need the fixed link order - local sublibs = {log = {"log_setup", "log"}, - python = {"python", "numpy"}, - stacktrace = {"stacktrace_backtrace", "stacktrace_basic"}} - for _, libname in ipairs(libnames) do - local libs = sublibs[libname] - if libs then - for _, lib in ipairs(libs) do - package:add("links", get_linkname(package, lib)) + + if not package:is_plat("windows") then + -- we need the fixed link order + local sublibs = {log = {"log_setup", "log"}, + python = {"python", "numpy"}, + stacktrace = {"stacktrace_backtrace", "stacktrace_basic"}} + for _, libname in ipairs(libnames) do + local libs = sublibs[libname] + if libs then + for _, lib in ipairs(libs) do + package:add("links", get_linkname(package, lib)) + end + else + package:add("links", get_linkname(package, libname)) end - else - package:add("links", get_linkname(package, libname)) end end -- disable auto-link all libs @@ -142,17 +147,7 @@ package("boost") on_install("macosx", "linux", "windows", "bsd", "mingw", "cross", function (package) import("core.base.option") - -- get toolchain - local toolchain - if package:is_plat("windows") then - toolchain = package:toolchain("clang-cl") or package:toolchain("msvc") or - import("core.tool.toolchain").load("msvc", {plat = package:plat(), arch = package:arch()}) - end - - -- force boost to compile with the desired compiler - local win_toolset - local file = io.open("user-config.jam", "a") - if file then + function get_compiler(package, toolchain) local cxx = package:build_getenv("cxx") if package:is_plat("macosx") then -- we uses ld/clang++ for link stdc++ for shared libraries @@ -161,11 +156,11 @@ package("boost") if cc and cc:find("clang", 1, true) and cc:find("Xcode", 1, true) then cc = "xcrun -sdk macosx clang++" end - file:print("using darwin : : %s ;", cc) + return format("using darwin : : %s ;", cc) elseif package:is_plat("windows") then local vs_toolset = toolchain:config("vs_toolset") local msvc_ver = "" - win_toolset = "msvc" + local win_toolset = "msvc" if toolchain:name() == "clang-cl" then win_toolset = "clang-win" cxx = cxx:gsub("(clang%-cl)$", "%1.exe", 1) @@ -177,12 +172,35 @@ package("boost") -- Specifying a version will disable b2 from forcing tools -- from the latest installed msvc version. - file:print("using %s : %s : \"%s\" ;", win_toolset, msvc_ver, cxx:gsub("\\", "\\\\")) + return format("using %s : %s : \"%s\" ;", win_toolset, msvc_ver, cxx:gsub("\\", "\\\\")) else cxx = cxx:gsub("gcc$", "g++") + cxx = cxx:gsub("gcc%-", "g++-") cxx = cxx:gsub("clang$", "clang++") - file:print("using gcc : : %s ;", cxx:gsub("\\", "/")) + cxx = cxx:gsub("clang%-", "clang++-") + if cxx and cxx:find("clang", 1, true) then + return format("using clang : : \"%s\" ;", cxx:gsub("\\", "/")) + else + return format("using gcc : : \"%s\" ;", cxx:gsub("\\", "/")) + end end + end + + -- get host toolchain + import("core.tool.toolchain") + local host_toolchain + if package:is_plat("windows") then + host_toolchain = toolchain.load("msvc", {plat = "windows", arch = os.arch()}) + if not host_toolchain:check() then + host_toolchain = toolchain.load("clang-cl", {plat = "windows", arch = os.arch()}) + end + assert(host_toolchain:check(), "host msvc or clang-cl not found!") + end + + -- force boost to compile with the desired compiler + local file = io.open("user-config.jam", "w") + if file then + file:write(get_compiler(package, host_toolchain)) file:close() end @@ -193,12 +211,14 @@ package("boost") "--without-icu" } - local runenvs + if package:has_tool("cxx", "clang", "clangxx") then + table.insert(bootstrap_argv, "--with-toolset=clang") + end + if package:is_plat("windows") then - runenvs = toolchain:runenvs() -- for bootstrap.bat, all other arguments are useless bootstrap_argv = { "msvc" } - os.vrunv("bootstrap.bat", bootstrap_argv, {envs = runenvs}) + os.vrunv("bootstrap.bat", bootstrap_argv, {envs = host_toolchain:runenvs()}) elseif package:is_plat("mingw") and is_host("windows") then bootstrap_argv = { "gcc" } os.vrunv("bootstrap.bat", bootstrap_argv) @@ -207,6 +227,29 @@ package("boost") else os.vrunv("./bootstrap.sh", bootstrap_argv) end + + -- get build toolchain + local build_toolchain + local build_toolset + local runenvs + if package:is_plat("windows") then + if package:has_tool("cxx", "clang_cl") then + build_toolset = "clang-win" + build_toolchain = package:toolchain("clang-cl") + elseif package:has_tool("cxx", "cl") then + build_toolset = "msvc" + build_toolchain = package:toolchain("msvc") + end + if build_toolchain then + runenvs = build_toolchain:runenvs() + end + end + + local file = io.open("user-config.jam", "w") + if file then + file:write(get_compiler(package, build_toolchain)) + file:close() + end os.vrun("./b2 headers") local njobs = option.get("jobs") or tostring(os.default_njob()) @@ -241,6 +284,11 @@ package("boost") else table.insert(argv, "address-model=32") end + + local cxxflags = {} + local linkflags = {} + table.join2(cxxflags, table.wrap(package:config("cxflags"))) + table.join2(cxxflags, table.wrap(package:config("cxxflags"))) if package:is_plat("windows") then local vs_runtime = package:config("vs_runtime") if package:config("shared") then @@ -250,16 +298,54 @@ package("boost") else table.insert(argv, "runtime-link=shared") end - table.insert(argv, "cxxflags=-std:c++14") - table.insert(argv, "toolset=" .. win_toolset) + table.insert(argv, "toolset=" .. build_toolset) + table.insert(cxxflags, "-std:c++14") elseif package:is_plat("mingw") then table.insert(argv, "toolset=gcc") + elseif package:is_plat("macosx") then + table.insert(argv, "toolset=darwin") + + -- fix macosx arm64 build issue https://github.com/microsoft/vcpkg/pull/18529 + table.insert(cxxflags, "-std=c++14") + table.insert(cxxflags, "-arch") + table.insert(cxxflags, package:arch()) + local xcode = package:toolchain("xcode") or import("core.tool.toolchain").load("xcode", {plat = package:plat(), arch = package:arch()}) + if xcode:check() then + local xcode_dir = xcode:config("xcode") + local xcode_sdkver = xcode:config("xcode_sdkver") + local target_minver = xcode:config("target_minver") + if xcode_dir and xcode_sdkver then + local xcode_sdkdir = xcode_dir .. "/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX" .. xcode_sdkver .. ".sdk" + table.insert(cxxflags, "-isysroot") + table.insert(cxxflags, xcode_sdkdir) + end + if target_minver then + table.insert(cxxflags, "-mmacosx-version-min=" .. target_minver) + end + end else - table.insert(argv, "cxxflags=-std=c++14") + table.insert(cxxflags, "-std=c++14") if package:config("pic") ~= false then - table.insert(argv, "cxxflags=-fPIC") + table.insert(cxxflags, "-fPIC") end end + if package.has_runtime and package:has_runtime("c++_shared", "c++_static") then + table.insert(cxxflags, "-stdlib=libc++") + table.insert(linkflags, "-stdlib=libc++") + if package:has_runtime("c++_static") then + table.insert(linkflags, "-static-libstdc++") + end + end + if package:config("asan") then + table.insert(cxxflags, "-fsanitize=address") + table.insert(linkflags, "-fsanitize=address") + end + if cxxflags then + table.insert(argv, "cxxflags=" .. table.concat(cxxflags, " ")) + end + if linkflags then + table.insert(argv, "linkflags=" .. table.concat(linkflags, " ")) + end for _, libname in ipairs(libnames) do if package:config("all") or package:config(libname) then table.insert(argv, "--with-" .. libname) @@ -270,7 +356,22 @@ package("boost") table.insert(argv, "pch=off") end - os.vrunv("./b2", argv, {envs = runenvs}) + if package:is_plat("windows") and package:version():le("1.85.0") then + local vs_toolset = build_toolchain:config("vs_toolset") + local vs_toolset_ver = import("core.base.semver").new(vs_toolset) + local minor = vs_toolset_ver:minor() + if minor and minor >= 40 then + io.replace("tools/build/src/engine/config_toolset.bat", "vc143", "vc144", {plain = true}) + io.replace("tools/build/src/engine/build.bat", "vc143", "vc144", {plain = true}) + io.replace("tools/build/src/engine/guess_toolset.bat", "vc143", "vc144", {plain = true}) + io.replace("tools/build/src/tools/intel-win.jam", "14.3", "14.4", {plain = true}) + io.replace("tools/build/src/tools/msvc.jam", "14.3", "14.4", {plain = true}) + end + end + local ok = os.execv("./b2", argv, {envs = runenvs, try = true, stdout = "boost-log.txt"}) + if ok ~= 0 then + raise("boost build failed, please check log in " .. path.join(os.curdir(), "boost-log.txt")) + end end) on_test(function (package) diff --git a/packages/b/boost_di/xmake.lua b/packages/b/boost_di/xmake.lua new file mode 100644 index 000000000..91ebb02df --- /dev/null +++ b/packages/b/boost_di/xmake.lua @@ -0,0 +1,39 @@ +package("boost_di") + set_kind("library", {headeronly = true}) + set_homepage("https://boost-ext.github.io/di") + set_description("DI: C++14 Dependency Injection Library") + + add_urls("https://github.com/boost-ext/di/archive/refs/tags/$(version).tar.gz", + "https://github.com/boost-ext/di.git") + + add_versions("v1.3.0", "853e02ade9bf39f2863b470350c3ef55caffc3090d7d9a503724ff480c8d7eff") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + namespace di = boost::di; + class ctor { + public: + explicit ctor(int i) : i(i) {} + int i; + }; + struct aggregate { + double d; + }; + class example { + public: + example(aggregate a, const ctor& c) {} + }; + void test() { + const auto injector = di::make_injector( + di::bind.to(42), + di::bind.to(87.0) + ); + injector.create(); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/b/boost_reflect/xmake.lua b/packages/b/boost_reflect/xmake.lua new file mode 100644 index 000000000..90375cec3 --- /dev/null +++ b/packages/b/boost_reflect/xmake.lua @@ -0,0 +1,25 @@ +package("boost_reflect") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/boost-ext/reflect") + set_description("C++20 static reflection library") + + add_urls("https://github.com/boost-ext/reflect/archive/refs/tags/$(version).tar.gz", + "https://github.com/boost-ext/reflect.git") + + add_versions("v1.1.1", "49b20cbc0e5d9f94bcdc96056f8c5d91ee2e45d8642e02cb37e511079671ad48") + + on_install("linux", function (package) + os.cp("reflect", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + enum E { A, B }; + struct foo { int a; E b; }; + void test() { + constexpr auto f = foo{.a = 42, .b = B}; + static_assert(2 == reflect::size(f)); + } + ]]}, {configs = {languages = "c++20"}})) + end) diff --git a/packages/b/boost_sml/xmake.lua b/packages/b/boost_sml/xmake.lua index ec22c10d8..2035c8bef 100644 --- a/packages/b/boost_sml/xmake.lua +++ b/packages/b/boost_sml/xmake.lua @@ -7,6 +7,7 @@ package("boost_sml") add_urls("https://github.com/boost-ext/sml/archive/refs/tags/$(version).tar.gz", "https://github.com/boost-ext/sml.git") + add_versions("v1.1.11", "8773efd639ce9649dc449135c8c53232e1cb5f4037d44be02c1b9ccc343f246d") add_versions("v1.1.8", "d2626b2fd249fa0788ca364a2f8dcb4762dd72195f86d43370e4cad4c02262c5") add_deps("cmake") diff --git a/packages/b/boost_ut/xmake.lua b/packages/b/boost_ut/xmake.lua index ff9c598ce..85f30aa23 100644 --- a/packages/b/boost_ut/xmake.lua +++ b/packages/b/boost_ut/xmake.lua @@ -7,6 +7,7 @@ package("boost_ut") add_urls("https://github.com/boost-ext/ut/archive/refs/tags/$(version).tar.gz") add_urls("https://github.com/boost-ext/ut.git") add_versions("v1.1.9", "1a666513157905aa0e53a13fac602b5673dcafb04a869100a85cd3f000c2ed0d") + add_versions("v2.0.1", "1e43be17045a881c95cedc843d72fe9c1e53239b02ed179c1e39e041ebcd7dad") add_configs("modules", {description = "Enable C++20 modules", default = false, type = "boolean", readonly = true}) diff --git a/packages/b/boringssl/patches/2022.06.13/cmake.patch b/packages/b/boringssl/patches/2022.06.13/cmake.patch new file mode 100644 index 000000000..94da9df7d --- /dev/null +++ b/packages/b/boringssl/patches/2022.06.13/cmake.patch @@ -0,0 +1,180 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aadcb9b..e8e1f50 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -567,8 +567,6 @@ endif() + + # Add minimal googletest targets. The provided one has many side-effects, and + # googletest has a very straightforward build. +-add_library(boringssl_gtest third_party/googletest/src/gtest-all.cc) +-target_include_directories(boringssl_gtest PRIVATE third_party/googletest) + + include_directories(third_party/googletest/include) + +@@ -594,15 +592,14 @@ add_custom_command( + DEPENDS util/embed_test_data.go ${CRYPTO_TEST_DATA} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +-add_library(crypto_test_data OBJECT crypto_test_data.cc) + + add_subdirectory(crypto) + add_subdirectory(ssl) +-add_subdirectory(ssl/test) ++# add_subdirectory(ssl/test) + add_subdirectory(tool) + add_subdirectory(util/fipstools) + add_subdirectory(util/fipstools/acvp/modulewrapper) +-add_subdirectory(decrepit) ++# add_subdirectory(decrepit) + + if(FUZZ) + if(LIBFUZZER_FROM_DEPS) +@@ -653,16 +650,7 @@ else() + add_custom_target(fips_specific_tests_if_any) + endif() + +-add_custom_target( +- run_tests +- COMMAND ${GO_EXECUTABLE} run util/all_tests.go -build-dir +- ${CMAKE_BINARY_DIR} +- COMMAND cd ssl/test/runner && +- ${GO_EXECUTABLE} test -shim-path $ +- ${HANDSHAKER_ARGS} ${RUNNER_ARGS} +- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} +- DEPENDS all_tests bssl_shim handshaker fips_specific_tests_if_any +- USES_TERMINAL) ++ + + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt +index cf7199c..73cdd70 100644 +--- a/crypto/CMakeLists.txt ++++ b/crypto/CMakeLists.txt +@@ -91,7 +91,6 @@ function(perlasm dest src) + endfunction() + + add_subdirectory(fipsmodule) +-add_subdirectory(test) + + if(FIPS_DELOCATE OR FIPS_SHARED) + SET_SOURCE_FILES_PROPERTIES(fipsmodule/bcm.o PROPERTIES EXTERNAL_OBJECT true) +@@ -478,93 +477,3 @@ endif() + # urandom_test is a separate binary because it needs to be able to observe the + # PRNG initialisation, which means that it can't have other tests running before + # it does. +-add_executable( +- urandom_test +- +- fipsmodule/rand/urandom_test.cc +-) +- +-target_link_libraries(urandom_test test_support_lib boringssl_gtest crypto) +- +-add_dependencies(urandom_test global_target) +-add_dependencies(all_tests urandom_test) +- +-add_executable( +- crypto_test +- +- abi_self_test.cc +- asn1/asn1_test.cc +- base64/base64_test.cc +- bio/bio_test.cc +- blake2/blake2_test.cc +- buf/buf_test.cc +- bytestring/bytestring_test.cc +- chacha/chacha_test.cc +- cipher_extra/aead_test.cc +- cipher_extra/cipher_test.cc +- compiler_test.cc +- conf/conf_test.cc +- constant_time_test.cc +- cpu_arm_linux_test.cc +- crypto_test.cc +- curve25519/ed25519_test.cc +- curve25519/spake25519_test.cc +- curve25519/x25519_test.cc +- ecdh_extra/ecdh_test.cc +- dh_extra/dh_test.cc +- digest_extra/digest_test.cc +- dsa/dsa_test.cc +- err/err_test.cc +- evp/evp_extra_test.cc +- evp/evp_test.cc +- evp/pbkdf_test.cc +- evp/scrypt_test.cc +- fipsmodule/aes/aes_test.cc +- fipsmodule/bn/bn_test.cc +- fipsmodule/cmac/cmac_test.cc +- fipsmodule/ec/ec_test.cc +- fipsmodule/ec/p256-nistz_test.cc +- fipsmodule/ecdsa/ecdsa_test.cc +- fipsmodule/md5/md5_test.cc +- fipsmodule/modes/gcm_test.cc +- fipsmodule/rand/ctrdrbg_test.cc +- fipsmodule/rand/fork_detect_test.cc +- fipsmodule/service_indicator/service_indicator_test.cc +- fipsmodule/sha/sha_test.cc +- hkdf/hkdf_test.cc +- hpke/hpke_test.cc +- hmac_extra/hmac_test.cc +- hrss/hrss_test.cc +- impl_dispatch_test.cc +- lhash/lhash_test.cc +- obj/obj_test.cc +- pem/pem_test.cc +- pkcs7/pkcs7_test.cc +- pkcs8/pkcs8_test.cc +- pkcs8/pkcs12_test.cc +- poly1305/poly1305_test.cc +- pool/pool_test.cc +- rand_extra/rand_test.cc +- refcount_test.cc +- rsa_extra/rsa_test.cc +- self_test.cc +- stack/stack_test.cc +- siphash/siphash_test.cc +- test/file_test_gtest.cc +- thread_test.cc +- trust_token/trust_token_test.cc +- x509/x509_test.cc +- x509/x509_time_test.cc +- x509v3/tab_test.cc +- +- $ +- $ +-) +- +-add_dependencies(crypto_test global_target) +- +-target_link_libraries(crypto_test test_support_lib boringssl_gtest crypto) +-if(WIN32) +- target_link_libraries(crypto_test ws2_32) +-endif() +-add_dependencies(all_tests crypto_test) +diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt +index 67a72ae..249f9e2 100644 +--- a/ssl/CMakeLists.txt ++++ b/ssl/CMakeLists.txt +@@ -52,20 +52,3 @@ add_dependencies(ssl global_target) + + target_link_libraries(ssl crypto) + +-add_executable( +- ssl_test +- +- span_test.cc +- ssl_test.cc +- ssl_c_test.c +- +- $ +-) +- +-add_dependencies(ssl_test global_target) +- +-target_link_libraries(ssl_test test_support_lib boringssl_gtest ssl crypto) +-if(WIN32) +- target_link_libraries(ssl_test ws2_32) +-endif() +-add_dependencies(all_tests ssl_test) diff --git a/packages/b/boringssl/xmake.lua b/packages/b/boringssl/xmake.lua index a1c2713ab..b25da8bff 100644 --- a/packages/b/boringssl/xmake.lua +++ b/packages/b/boringssl/xmake.lua @@ -1,24 +1,36 @@ package("boringssl") set_homepage("https://boringssl.googlesource.com/boringssl") - set_description("A fork of OpenSSL that is designed to meet Google's needs.") + set_description("BoringSSL is a fork of OpenSSL that is designed to meet Google's needs.") + add_urls("https://github.com/google/boringssl/archive/refs/tags/$(version).tar.gz", {version = function (version) return "fips-" .. version:gsub("%.", "") end}) add_urls("https://github.com/google/boringssl.git") + + add_versions("2022.06.13", "a343962da2fbb10d8fa2cd9a2832839a23045a197c0ff306dc0fa0abb85759b3") add_versions("2021.12.29", "d80f17d5c94b21c4fb2e82ee527bfe001b3553f2") + add_patches("2022.06.13", path.join(os.scriptdir(), "patches", "2022.06.13", "cmake.patch"), "c44e5c2b4b4f010a6fab1c0bce22a50feb5d85f37a870cf9a71f8d58bdfbd169") add_patches("2021.12.29", path.join(os.scriptdir(), "patches", "2021.12.29", "cmake.patch"), "d8bb6312b87b8aad434ea3f9f4275f769af3cdbaab78adf400e8e3907443b505") - add_deps("cmake", "go") - if is_plat("linux") then add_syslinks("pthread", "dl", "m") elseif is_plat("windows") then add_syslinks("advapi32") add_deps("nasm") end + add_links("ssl", "crypto") - on_install("linux", "macosx", "windows", function (package) + add_deps("cmake", "go") + + on_load("windows", function (package) + if package:is_plat("windows") and package:version():ge("2022.06.13") and (not package:is_precompiled()) then + package:add("deps", "strawberry-perl") + end + end) + + on_install("linux", "macosx", "windows|!arm64", function (package) import("net.fasturl") + local configs = {} local proxyurls = {"https://goproxy.cn", "https://proxy.golang.org"} fasturl.add(proxyurls) @@ -26,35 +38,48 @@ package("boringssl") if #proxyurls > 0 then os.setenv("GOPROXY", proxyurls[1]) end - -- we need suppress "hidden symbol ... is referenced by DSO" - local cxflags - if not package:config("shared") and package:is_plat("linux") then - cxflags = "-DBORINGSSL_SHARED_LIBRARY" - end - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + io.replace("CMakeLists.txt", "-WX", "", {plain = true}) - import("package.tools.cmake").install(package, configs, {cxflags = cxflags, buildir = "build"}) - os.cp("include", package:installdir()) - if package:config("shared") then + io.replace("CMakeLists.txt", "-Werror", "", {plain = true}) + + if package:version():ge("2022.06.13") then + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) if package:is_plat("windows") then - os.cp("build/ssl/*/ssl.dll", package:installdir("bin")) + os.mv(package:installdir("lib/*.dll"), package:installdir("bin")) + end + else + -- we need suppress "hidden symbol ... is referenced by DSO" + local cxflags + if not package:config("shared") and package:is_plat("linux") then + cxflags = "-DBORINGSSL_SHARED_LIBRARY" + end + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs, {cxflags = cxflags, buildir = "build"}) + os.cp("include", package:installdir()) + if package:config("shared") then + if package:is_plat("windows") then + os.cp("build/ssl/*/ssl.dll", package:installdir("bin")) + os.cp("build/ssl/*/ssl.lib", package:installdir("lib")) + os.cp("build/crypto/*/crypto.dll", package:installdir("bin")) + os.cp("build/crypto/*/crypto.lib", package:installdir("lib")) + elseif package:is_plat("macosx") then + os.cp("build/ssl/libssl.dylib", package:installdir("lib")) + os.cp("build/crypto/libcrypto.dylib", package:installdir("lib")) + else + os.cp("build/ssl/libssl.so", package:installdir("lib")) + os.cp("build/crypto/libcrypto.so", package:installdir("lib")) + end + elseif package:is_plat("windows") then os.cp("build/ssl/*/ssl.lib", package:installdir("lib")) - os.cp("build/crypto/*/crypto.dll", package:installdir("bin")) os.cp("build/crypto/*/crypto.lib", package:installdir("lib")) - elseif package:is_plat("macosx") then - os.cp("build/ssl/libssl.dylib", package:installdir("lib")) - os.cp("build/crypto/libcrypto.dylib", package:installdir("lib")) else - os.cp("build/ssl/libssl.so", package:installdir("lib")) - os.cp("build/crypto/libcrypto.so", package:installdir("lib")) + os.cp("build/ssl/libssl.a", package:installdir("lib")) + os.cp("build/crypto/libcrypto.a", package:installdir("lib")) end - elseif package:is_plat("windows") then - os.cp("build/ssl/*/ssl.lib", package:installdir("lib")) - os.cp("build/crypto/*/crypto.lib", package:installdir("lib")) - else - os.cp("build/ssl/libssl.a", package:installdir("lib")) - os.cp("build/crypto/libcrypto.a", package:installdir("lib")) end end) diff --git a/packages/b/botan/xmake.lua b/packages/b/botan/xmake.lua new file mode 100644 index 000000000..63cbf943e --- /dev/null +++ b/packages/b/botan/xmake.lua @@ -0,0 +1,201 @@ +package("botan") + set_homepage("https://botan.randombit.net") + set_description("Cryptography Toolkit") + set_license("BSD-2-Clause") + + set_urls("https://github.com/randombit/botan/archive/refs/tags/$(version).tar.gz", + "https://github.com/randombit/botan.git") + + add_versions("3.4.0", "6ef2a16a0527b1cfc9648a644877f7b95c4d07e8ef237273b030c623418c5e5b") + + add_configs("tools", {description = "Build tools.", default = false, type = "boolean"}) + add_configs("python", {description = "Enable python module", default = false, type = "boolean"}) + add_configs("endian", {description = [[The parameter should be either “little” or “big”. If not used then if the target architecture has a default, that is used. Otherwise left unspecified, which causes less optimal codepaths to be used but will work on either little or big endian.]], default = nil, type = "string", values = {"little", "big"}}) + add_configs("modules", {description = [[Enable modules, example: {configs = {modules = {"zlib", "lzma"}}}]], type = "table"}) + if is_plat("wasm") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("python 3.x", "ninja", {kind = "binary"}) + + if is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::libbotan") + elseif is_plat("linux") then + add_extsources("pacman::botan", "apt::libbotan-2-dev") + elseif is_plat("macosx") then + add_extsources("brew::botan") + end + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + if on_check then + on_check("windows", function (package) + import("core.tool.toolchain") + + local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + if msvc then + local vs = msvc:config("vs") + assert(vs and tonumber(vs) >= 2022, "package(botan): current version need vs >= 2022") + end + end) + end + + on_load(function (package) + import("core.base.hashset") + + local major = "3" + if package:version() then + major = package:version():major() + end + package:add("includedirs", "include/botan-" .. major) + + local modules = package:config("modules") + if modules then + local deps = hashset.from(modules) + if deps then + for _, dep in ipairs({"boost", "bzip2", "lzma", "sqlite3", "zlib"}) do + if deps:has(dep) then + if dep == "boost" then + package:add("deps", "boost", {configs = {filesystem = true}}) + elseif dep == "lzma" then + package:add("deps", "xz") + else + package:add("deps", dep) + end + end + end + end + end + end) + + on_install("windows", "linux", "macosx|native", "bsd", "mingw@windows", "msys", "wasm", function (package) + -- https://botan.randombit.net/handbook/building.html + local configs = { + "configure.py", + "--prefix=" .. package:installdir(), + "--build-tool=ninja", + "--without-documentation", + "--minimized-build", + } + + local cc + local envs + if package:is_plat("windows") then + local msvc = package:toolchain("msvc") + assert(msvc:check(), "vs not found!") + + local vs = msvc:config("vs") + if tonumber(vs) < 2019 then + raise("This version of Botan requires at least msvc 19.30") + end + + envs = msvc:runenvs() + table.insert(configs, "--msvc-runtime=" .. package:runtimes()) + + if package:has_tool("cxx", "cl") then + cc = "msvc" + elseif package:has_tool("cxx", "clang_cl") then + raise("Unsupported toolchains on windows") + end + else + local cxx = package:build_getenv("cxx") + + if cxx:find("clang", 1, true) then + cc = "clang" + elseif cxx:find("gcc", 1, true) then + cc = "gcc" + end + + local cc_bin + if package:is_plat("mingw") then + cc = "gcc" + cc_bin = cxx + elseif package:is_plat("wasm") then + cc = "emcc" + cc_bin = cxx + end + end + + if cc then + table.insert(configs, "--cc=" .. cc) + end + if cc_bin then + table.insert(configs, "--cc-bin=" .. cc_bin) + end + + if package:is_plat("wasm") then + table.insert(configs, "--os=emscripten") + table.insert(configs, "--cpu=wasm") + else + if package:is_plat("iphoneos") then + table.insert(configs, "--os=ios") + elseif not package:is_plat("bsd") then + -- let configure.py detech bsd host name + table.insert(configs, "--os=" .. package:plat()) + end + table.insert(configs, "--cpu=" .. package:arch()) + end + + if package:is_debug() then + table.insert(configs, "--debug-mode") + end + + local targets = (package:config("shared") and "shared" or "static") + if package:config("tools") then + targets = targets .. ",cli" + end + table.insert(configs, "--build-targets=" .. targets) + + local modules = package:config("modules") + if modules then + table.insert(configs, "--enable-modules=" .. table.concat(modules, ",")) + end + + if not package:config("python") then + table.insert(configs, "--no-install-python-module") + end + + if package:config("endian") then + table.insert(configs, "--with-endian=" .. package:config("endian")) + end + + local cxflags = {} + table.join2(cxflags, table.wrap(package:config("cxflags"))) + table.join2(cxflags, table.wrap(package:config("cxxflags"))) + for _, flag in ipairs(cxflags) do + table.insert(configs, "--extra-cxxflags=" .. flag) + end + + for _, dep in ipairs({"boost", "bzip2", "xz", "sqlite3", "zlib"}) do + local packagedep = package:dep(dep) + if packagedep then + local fetchinfo = packagedep:fetch() + if fetchinfo then + for _, includedir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do + table.insert(configs, "--with-external-includedir=" .. includedir) + end + for _, linkdir in ipairs(fetchinfo.linkdirs) do + table.insert(configs, "--with-external-libdir=" .. linkdir) + end + end + end + end + + os.vrunv("python3", configs, {envs = envs}) + import("package.tools.ninja").install(package, {}, {envs = envs}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + std::vector key = Botan::hex_decode("000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"); + } + ]]}, {configs = {languages = "c++20"}})) + + if not package:is_cross() and package:config("tools") then + os.vrun("botan-cli version") + end + end) diff --git a/packages/b/breakpad/port/xmake.lua b/packages/b/breakpad/port/xmake.lua new file mode 100644 index 000000000..d68d81d82 --- /dev/null +++ b/packages/b/breakpad/port/xmake.lua @@ -0,0 +1,133 @@ +-- ref: https://github.com/microsoft/vcpkg/blob/master/ports/breakpad/CMakeLists.txt +add_rules("mode.debug", "mode.release") + +set_languages("c++17") + +add_requires("libdisasm") + +target("breakpad") + set_kind("$(kind)") + + add_includedirs("src") + add_headerfiles("src/(google_breakpad/**.h)") + add_packages("libdisasm") + + if is_plat("android") then + add_files("android/google_breakpad/Android.mk") + else + add_files("src/processor/*.cc") + remove_files("src/processor/*test*.cc", + "src/processor/microdump_stackwalk.cc", + "src/processor/synth_minidump.cc", + "src/processor/minidump_dump.cc", + "src/processor/minidump_stackwalk.cc") + add_headerfiles("src/(processor/*.h)") + remove_headerfiles("src/processor/*test*.h", "src/processor/synth_minidump.h") + + add_files("src/common/*.cc", "src/client/*.cc") + remove_files("src/common/*test*.cc", "src/client/*test*.cc") + add_headerfiles("src/(common/*.h)", "src/(client/*.h)") + remove_headerfiles("src/common/*test*.h", "src/client/*test*.h") + + if is_plat("windows") then + add_defines("UNICODE", + "WIN32_LEAN_AND_MEAN", + "_CRT_SECURE_NO_WARNINGS", + "_CRT_SECURE_NO_DEPRECATE", + "_CRT_NONSTDC_NO_DEPRECATE") + add_files("src/common/windows/*.cc", + "src/client/windows/crash_generation/*.cc", + "src/client/windows/handler/*.cc") + remove_files("src/common/windows/*test*.cc", + "src/common/language.cc", + "src/common/path_helper.cc", + "src/common/stabs_to_module.cc", + "src/common/stabs_reader.cc", + "src/common/dwarf*.cc", + "src/client/minidump_file_writer.cc") + add_headerfiles("src/(common/windows/*.h)", + "src/(client/windows/common/*.h)", + "src/(client/windows/crash_generation/*.h)", + "src/(client/windows/handler/*.h)") + remove_headerfiles("src/common/windows/*test*.h", + "src/common/language.h", + "src/common/path_helper.h", + "src/common/stabs_to_module.h", + "src/common/stabs_reader.h", + "src/common/dwarf*.h", + "src/client/minidump_file_writer.h") + + add_syslinks("wininet", "dbghelp", "imagehlp") + if is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + else + add_files("src/common/dwarf/*.cc") + remove_files("src/common/dwarf/*test*.cc") + add_headerfiles("src/(common/dwarf/*.h)") + remove_headerfiles("src/common/dwarf/*test*.h") + + if is_plat("macosx") then + add_defines("HAVE_MACH_O_NLIST_H") + add_files("src/common/mac/MachIPC.mm", + "src/common/mac/*.cc", + "src/client/mac/crash_generation/*.cc", + "src/client/mac/handler/*.cc") + remove_files("src/common/mac/*test*.cc") + add_headerfiles("src/(common/mac/*.h)", + "src/(client/mac/crash_generation/*.h)", + "src/(client/mac/handler/*.h)") + + add_frameworks("CoreFoundation") + else + add_defines("HAVE_A_OUT_H") + add_files("src/client/linux/**.cc", "src/common/linux/**.cc") + remove_files("src/client/linux/sender/*test*.cc", + "src/client/linux/handler/*test*.cc", + "src/client/linux/microdump_writer/*test*.cc", + "src/client/linux/minidump_writer/*test*.cc") + add_headerfiles("src/(client/linux/**.h)", "src/(common/linux/**.h)") + add_syslinks("pthread") + end + end + end + + on_config(function (target) + if target:is_plat("windows") then + local msvc = target:toolchain("msvc") + if msvc then + local envs = msvc:runenvs() + local VSInstallDir = envs and envs.VSInstallDir + if VSInstallDir then + local dir = path.join(VSInstallDir, "DIA SDK") + target:add("includedirs", path.join(dir, "include")) + target:add("syslinks", "diaguids") + if os.isdir(dir) then + if target:is_arch("x86") then + target:add("runenvs", path.join(dir, "bin")) + target:add("linkdirs", path.join(dir, "lib")) + else + local arch + if target:is_arch("x64") then + arch = "amd64" + elseif target:is_arch("arm") then + arch = "arm" + elseif target:is_arch("arm64") then + arch = "arm64" + else + raise("Unsupported arch") + end + target:add("runenvs", path.join(dir, "bin", arch)) + target:add("linkdirs", path.join(dir, "lib", arch)) + end + end + end + end + elseif not target:is_plat("macosx") then + if target:has_cfuncs("getcontext", {includes = "ucontext.h"}) then + target:add("defines", "HAVE_GETCONTEXT=1") + else + target:add("files", path.join(os.projectdir(), "src/common/linux/breakpad_getcontext.S")) + end + end + end) diff --git a/packages/b/breakpad/xmake.lua b/packages/b/breakpad/xmake.lua new file mode 100644 index 000000000..d24ca8c05 --- /dev/null +++ b/packages/b/breakpad/xmake.lua @@ -0,0 +1,67 @@ +package("breakpad") + set_homepage("https://chromium.googlesource.com/breakpad/breakpad") + set_description("Mirror of Google Breakpad project") + + add_urls("https://github.com/google/breakpad/archive/refs/tags/$(version).tar.gz", + "https://github.com/google/breakpad.git", + "https://chromium.googlesource.com/breakpad/breakpad.git") + + add_versions("v2023.01.27", "f187e8c203bd506689ce4b32596ba821e1e2f034a83b8e07c2c635db4de3cc0b") + + if is_plat("windows") then + add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true}) + end + + if is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::breakpad") + end + + if is_plat("windows") then + add_syslinks("wininet", "dbghelp", "imagehlp") + elseif is_plat("linux") then + add_syslinks("pthread") + elseif is_plat("macosx") then + add_frameworks("CoreFoundation") + end + + add_deps("libdisasm") + + on_install("windows|x64", "windows|x86", function (package) + io.replace("src/processor/disassembler_x86.h", "third_party/", "", {plain = true}) + io.replace("src/processor/exploitability_win.cc", "third_party/", "", {plain = true}) + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + local plat + local snippets + if package:is_plat("windows") then + plat = "windows" + snippets = [[ + void test() { + std::wstring dump_path; + google_breakpad::ExceptionHandler handler(dump_path, nullptr, nullptr, nullptr, 0); + } + ]] + elseif package:is_plat("macosx") then + plat = "mac" + snippets = [[ + void test() { + std::string dump_path; + google_breakpad::ExceptionHandler handler( + dump_path, nullptr, nullptr, nullptr, false, nullptr); + } + ]] + else + plat = "linux" + snippets = [[ + void test() { + google_breakpad::MinidumpDescriptor descriptor("/tmp"); + } + ]] + end + + local header = "client/" .. plat .. "/handler/exception_handler.h" + assert(package:check_cxxsnippets({test = snippets}, {configs = {languages = "c++11"}, includes = header})) + end) diff --git a/packages/b/brpc/patches/1.6.1/cmake.patch b/packages/b/brpc/patches/1.6.1/cmake.patch new file mode 100644 index 000000000..59fc4b611 --- /dev/null +++ b/packages/b/brpc/patches/1.6.1/cmake.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f364cd13..b5017cdd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -225,14 +225,13 @@ set(DYNAMIC_LIB + ${CMAKE_THREAD_LIBS_INIT} + ${THRIFT_LIB} + ${THRIFTNB_LIB} +- ${OPENSSL_CRYPTO_LIBRARY} + dl + z) + + if(WITH_MESALINK) + list(APPEND DYNAMIC_LIB ${MESALINK_LIB}) + else() +- list(APPEND DYNAMIC_LIB ${OPENSSL_SSL_LIBRARY}) ++ list(APPEND DYNAMIC_LIB ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) + endif() + + if(WITH_RDMA) diff --git a/packages/b/brpc/patches/1.7.0/cmake.patch b/packages/b/brpc/patches/1.7.0/cmake.patch new file mode 100644 index 000000000..61409c8db --- /dev/null +++ b/packages/b/brpc/patches/1.7.0/cmake.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 71838043..88448d2e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -227,14 +227,13 @@ set(DYNAMIC_LIB + ${PROTOC_LIB} + ${CMAKE_THREAD_LIBS_INIT} + ${THRIFT_LIB} +- ${OPENSSL_CRYPTO_LIBRARY} + dl + z) + + if(WITH_MESALINK) + list(APPEND DYNAMIC_LIB ${MESALINK_LIB}) + else() +- list(APPEND DYNAMIC_LIB ${OPENSSL_SSL_LIBRARY}) ++ list(APPEND DYNAMIC_LIB ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) + endif() + + if(WITH_RDMA) diff --git a/packages/b/brpc/patches/1.8.0/cmake.patch b/packages/b/brpc/patches/1.8.0/cmake.patch new file mode 100644 index 000000000..7e4111491 --- /dev/null +++ b/packages/b/brpc/patches/1.8.0/cmake.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0a70bb1..7dd74f5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -283,11 +283,10 @@ if(WITH_BORINGSSL) + list(APPEND DYNAMIC_LIB ${BORINGSSL_SSL_LIBRARY}) + list(APPEND DYNAMIC_LIB ${BORINGSSL_CRYPTO_LIBRARY}) + else() +- list(APPEND DYNAMIC_LIB ${OPENSSL_CRYPTO_LIBRARY}) + if(WITH_MESALINK) + list(APPEND DYNAMIC_LIB ${MESALINK_LIB}) + else() +- list(APPEND DYNAMIC_LIB ${OPENSSL_SSL_LIBRARY}) ++ list(APPEND DYNAMIC_LIB ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) + endif() + endif() + diff --git a/packages/b/brpc/xmake.lua b/packages/b/brpc/xmake.lua index da5b0f90b..27bc743f3 100644 --- a/packages/b/brpc/xmake.lua +++ b/packages/b/brpc/xmake.lua @@ -1,13 +1,22 @@ package("brpc") set_homepage("https://github.com/apache/incubator-brpc") set_description("brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc.") + set_license("Apache-2.0") add_urls("https://github.com/apache/brpc/archive/refs/tags/$(version).tar.gz") + + add_versions("1.8.0", "13ffb2f1f57c679379a20367c744b3e597614a793ec036cd7580aae90798019d") + add_versions("1.7.0", "48668cbc943edd1b72551e99c58516249d15767b46ea13a843eb8df1d3d1bc42") + add_versions("1.6.1", "d9eb93683b0e4cb583aacdf2357c3e3e613fbf797c4fafd0eae1d09d5ea50964") + add_versions("1.4.0", "6ea39d8984217f62ef954b7ebc0dfa724c62472a5ae7033ed189f994f28b9e30") add_versions("1.5.0", "5ce178e3070ecdf9576a8917e3f65d96085f437bfbf9f1d09d46bca1375938cf") + add_versions("1.3.0", "b9d638b76725552ed11178c650d7fc95e30f252db7972a93dc309a0698c7d2b8") + + add_patches("1.8.0", path.join(os.scriptdir(), "patches", "1.8.0", "cmake.patch"), "315889dcca66331932a8ce90bbdc5f71e336ca39d625ff85a589ee2bf10155ee") + add_patches("1.7.0", path.join(os.scriptdir(), "patches", "1.7.0", "cmake.patch"), "801920d6fcd20f3da68c1846dc22d26d2d320e48b06b6b5bd38bbed11e5ebd2c") + add_patches("1.6.1", path.join(os.scriptdir(), "patches", "1.6.1", "cmake.patch"), "046e590994ad302127d4cb7b1b2d8231db5f7c30c3948a0172d0dca9bef1da0b") add_patches("1.5.0", path.join(os.scriptdir(), "patches", "1.5.0", "cmake.patch"), "af6eb76c9eccedaba1ff39d8f36280a09f0476848b24ef5330a350cd06900244") - add_versions("1.4.0", "6ea39d8984217f62ef954b7ebc0dfa724c62472a5ae7033ed189f994f28b9e30") add_patches("1.4.0", path.join(os.scriptdir(), "patches", "1.4.0", "cmake.patch"), "006fa842e84a6e8091f236a12e7c44dd60962cc61fddf46bcfc65a2093383cef") - add_versions("1.3.0", "b9d638b76725552ed11178c650d7fc95e30f252db7972a93dc309a0698c7d2b8") add_patches("1.3.0", path.join(os.scriptdir(), "patches", "1.3.0", "cmake.patch"), "a71bf46a4a6038a89da3ee9057dea5f452155a2da1f1c9bdcae7ecd0bb5e0510") -- we enable zlib in protobuf-cpp, because brpc need google/protobuf/io/gzip_stream.h diff --git a/packages/b/bullet3/xmake.lua b/packages/b/bullet3/xmake.lua index da00fcc8e..7826c60e3 100644 --- a/packages/b/bullet3/xmake.lua +++ b/packages/b/bullet3/xmake.lua @@ -36,8 +36,9 @@ package("bullet3") table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DUSE_DOUBLE_PRECISION=" .. (package:config("double_precision") and "ON" or "OFF")) table.insert(configs, "-DBUILD_EXTRAS=" .. (package:config("extras") and "ON" or "OFF")) - if package:is_plat("windows") then - table.insert(configs, "-DUSE_MSVC_RUNTIME_LIBRARY_DLL=" .. (package:config("vs_runtime"):startswith("MD") and "ON" or "OFF")) + table.insert(configs, "-DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON") -- setting this to ON prevents Bullet from replacing flags + if package:is_plat("windows") and not package:config("vs_runtime"):endswith("d") then + table.insert(configs, "-DUSE_MSVC_RELEASE_RUNTIME_ALWAYS=ON") -- required to remove _DEBUG from cmake flags end import("package.tools.cmake").install(package, configs) end) diff --git a/packages/b/bzip2/port/xmake.lua b/packages/b/bzip2/port/xmake.lua index e95871fc2..01d0aff70 100644 --- a/packages/b/bzip2/port/xmake.lua +++ b/packages/b/bzip2/port/xmake.lua @@ -22,6 +22,7 @@ target("bz2") if is_plat("wasm") then add_defines("BZ_STRICT_ANSI") end + add_cflags("clang::-Wno-error=int-conversion") if has_config("enable_tools") then diff --git a/packages/b/bzip3/xmake.lua b/packages/b/bzip3/xmake.lua new file mode 100644 index 000000000..a84b72b12 --- /dev/null +++ b/packages/b/bzip3/xmake.lua @@ -0,0 +1,30 @@ +package("bzip3") + set_homepage("https://github.com/kspalaiologos/bzip3") + set_description("A better and stronger spiritual successor to BZip2.") + set_license("LGPL-3.0") + + add_urls("https://github.com/kspalaiologos/bzip3/archive/refs/tags/$(version).tar.gz", + "https://github.com/kspalaiologos/bzip3.git") + + add_versions("1.4.0", "d70334c19c7cce2cc6c823566b7d8968ff08a52043d518f55caebd2e407b2233") + + add_configs("native", {description = "Enable CPU-specific optimizations", default = false, type = "boolean"}) + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + add_deps("cmake") + + on_install(function (package) + local configs = {"-DBZIP3_BUILD_APPS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBZIP3_ENABLE_ARCH_NATIVE=" .. (package:config("native") and "ON" or "OFF")) + table.insert(configs, "-DBZIP3_ENABLE_PTHREAD=" .. (package:is_plat("linux", "bsd") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("bz3_compress", {includes = "libbz3.h"})) + end) diff --git a/packages/c/c-ares/xmake.lua b/packages/c/c-ares/xmake.lua index e82ebc082..80f1b548b 100644 --- a/packages/c/c-ares/xmake.lua +++ b/packages/c/c-ares/xmake.lua @@ -7,6 +7,8 @@ package("c-ares") add_urls("https://github.com/c-ares/c-ares/releases/download/cares-$(version).tar.gz", {version = function (version) return version:gsub("%.", "_") .. "/c-ares-" .. version end}) + add_versions("1.28.1", "675a69fc54ddbf42e6830bc671eeb6cd89eeca43828eb413243fd2c0a760809d") + add_versions("1.27.0", "0a72be66959955c43e2af2fbd03418e82a2bd5464604ec9a62147e37aceb420b") add_versions("1.16.1", "d08312d0ecc3bd48eee0a4cc0d2137c9f194e0a28de2028928c0f6cae85f86ce") add_versions("1.17.0", "1cecd5dbe21306c7263f8649aa6e9a37aecb985995a3489f487d98df2b40757d") add_versions("1.17.1", "d73dd0f6de824afd407ce10750ea081af47eba52b8a6cb307d220131ad93fc40") diff --git a/packages/c/c-blosc2/xmake.lua b/packages/c/c-blosc2/xmake.lua index 4112f15ba..2c460d9f9 100644 --- a/packages/c/c-blosc2/xmake.lua +++ b/packages/c/c-blosc2/xmake.lua @@ -6,6 +6,9 @@ package("c-blosc2") add_urls("https://github.com/Blosc/c-blosc2/archive/refs/tags/$(version).tar.gz", "https://github.com/Blosc/c-blosc2.git") + add_versions("v2.14.4", "b5533c79aacc9ac152c80760ed1295a6608938780c3e1eecd7e53ea72ad986b0") + add_versions("v2.14.3", "2b94c2014ba455e8136e16bf0738ec64c246fcc1a77122d824257caf64aaf441") + add_versions("v2.13.2", "f2adcd9615f138d1bb16dc27feadab1bb1eab01d77e5e2323d14ad4ca8c3ca21") add_versions("v2.10.2", "069785bc14c006c7dab40ea0c620bdf3eb8752663fd55c706d145bceabc2a31d") add_configs("lz4", {description = "Enable LZ4 support.", default = true, type = "boolean"}) diff --git a/packages/c/ca-certificates/xmake.lua b/packages/c/ca-certificates/xmake.lua index 398498349..958c709e0 100644 --- a/packages/c/ca-certificates/xmake.lua +++ b/packages/c/ca-certificates/xmake.lua @@ -8,6 +8,7 @@ package("ca-certificates") add_versions("20211118", "5d8b1f11d5c746d5af425063ba1f4acee4b18c681e7df2050f1b81cef079c227") add_versions("20220604", "a56ded4677055bbf05d94c32bddd76b22a134cab764e1ed8da8e3c080ca80ca6") add_versions("20230306", "f9228e16c17b411de9d592e43242b4405568daad029380b2db7e3e4227d5a6a6") + add_versions("20240207", "8f533c3791c6d3249eddb181ae4ff06b20facdefba1f514d9fed03f48ffc4c09") on_install(function (package) os.cp("cacert.pem", package:installdir()) diff --git a/packages/c/cairo/patches/1.18.0/alloca.patch b/packages/c/cairo/patches/1.18.0/alloca.patch new file mode 100644 index 000000000..4f46e306c --- /dev/null +++ b/packages/c/cairo/patches/1.18.0/alloca.patch @@ -0,0 +1,14 @@ +diff --git a/src/cairo-colr-glyph-render.c b/src/cairo-colr-glyph-render.c +--- a/src/cairo-colr-glyph-render.c ++++ b/src/cairo-colr-glyph-render.c +@@ -43,6 +43,10 @@ + #include + #include + ++#ifdef _MSC_VER ++#include ++#endif ++ + #if HAVE_FT_COLR_V1 + + #include diff --git a/packages/c/cairo/xmake.lua b/packages/c/cairo/xmake.lua index 16a0a8ea7..eaa7260f5 100644 --- a/packages/c/cairo/xmake.lua +++ b/packages/c/cairo/xmake.lua @@ -2,23 +2,35 @@ package("cairo") set_homepage("https://cairographics.org/") set_description("Vector graphics library with cross-device output support.") + set_license("MPL-1.1") add_urls("https://gitlab.freedesktop.org/cairo/cairo/-/archive/$(version)/cairo-$(version).tar.gz") add_urls("https://gitlab.freedesktop.org/cairo/cairo.git") add_versions("1.17.6", "a2227afc15e616657341c42af9830c937c3a6bfa63661074eabef13600e8936f") add_versions("1.17.8", "b4ed6d33037171d4c6594345b42d81796f335a6995fdf5638db0d306c17a0d3e") + add_versions("1.18.0", "39a78afdc33a435c0f2ab53a5ec2a693c3c9b6d2ec9783ceecb2b94d54d942b0") + + add_patches("1.18.0", path.join(os.scriptdir(), "patches", "1.18.0", "alloca.patch"), "55f8577929537d43eed9f74241560821001b6c8613d6a7a21cff83f8431c6a70") + + add_configs("freetype", {description = "Enable freetype support.", default = true, type = "boolean"}) + add_configs("fontconfig", {description = "Enable fontconfig support.", default = true, type = "boolean"}) + add_configs("xlib", {description = "Enable x11 surface backend.", default = is_plat("linux"), type = "boolean"}) + add_configs("glib", {description = "Enable glib dependency.", default = false, type = "boolean"}) add_deps("meson", "ninja") - add_deps("libpng", "pixman", "zlib", "freetype", "glib") + add_deps("libpng", "pixman", "zlib") if is_plat("windows") then - add_deps("pkgconf") + add_deps("pkgconf", "libintl") + elseif is_plat("macosx") then + add_deps("libiconv", {system = true}) + elseif is_plat("linux") then + add_deps("libiconv") end add_includedirs("include", "include/cairo") if is_plat("linux", "macosx") then add_syslinks("pthread") - add_deps("fontconfig") end if is_plat("windows") then @@ -27,10 +39,22 @@ package("cairo") add_frameworks("CoreGraphics", "CoreFoundation", "CoreText", "Foundation") end - on_load("windows", function (package) - if not package:config("shared") then + on_load("windows|x64", "windows|x86", "macosx", "linux", function (package) + if package:is_plat("windows") and not package:config("shared") then package:add("defines", "CAIRO_WIN32_STATIC_BUILD=1") end + if package:config("freetype") then + package:add("deps", "freetype") + end + if package:config("fontconfig") then + package:add("deps", "fontconfig") + end + if package:config("xlib") then + package:add("deps", "libx11", "libxrender", "libxext") + end + if package:config("glib") then + package:add("deps", "glib") + end end) on_install("windows|x64", "windows|x86", "macosx", "linux", function (package) @@ -40,24 +64,19 @@ package("cairo") "--wrap-mode=nopromote", "-Dtests=disabled", "-Dgtk_doc=false", - "-Dfreetype=enabled", "-Dgtk2-utils=disabled", "-Dpng=enabled", "-Dzlib=enabled", - "-Dglib=enabled" } - if package:is_plat("macosx") or package:is_plat("linux") then - table.insert(configs, "-Dfontconfig=enabled") - else - table.insert(configs, "-Dfontconfig=disabled") - end - table.insert(configs, "-Ddebug=" .. (package:debug() and "true" or "false")) table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + table.insert(configs, "-Dfreetype=" .. (package:config("freetype") and "enabled" or "disabled")) + table.insert(configs, "-Dfontconfig=" .. (package:config("fontconfig") and "enabled" or "disabled")) + table.insert(configs, "-Dxlib=" .. (package:config("xlib") and "enabled" or "disabled")) + table.insert(configs, "-Dglib=" .. (package:config("glib") and "enabled" or "disabled")) io.replace("meson.build", "subdir('fuzzing')", "", {plain = true}) io.replace("meson.build", "subdir('docs')", "", {plain = true}) - io.replace("meson.build", "subdir('util')", "", {plain = true}) io.replace("meson.build", "'CoreFoundation'", "'CoreFoundation', 'Foundation'", {plain = true}) - local envs = meson.buildenvs(package) + local envs = meson.buildenvs(package, {packagedeps = {"libintl", "libiconv"}}) if package:is_plat("windows") then envs.PATH = package:dep("pkgconf"):installdir("bin") .. path.envsep() .. envs.PATH end diff --git a/packages/c/cargs/xmake.lua b/packages/c/cargs/xmake.lua index 7650c57a6..8166cf30c 100644 --- a/packages/c/cargs/xmake.lua +++ b/packages/c/cargs/xmake.lua @@ -5,6 +5,7 @@ package("cargs") add_urls("https://github.com/likle/cargs/archive/refs/tags/$(version).tar.gz", "https://github.com/likle/cargs.git") + add_versions("v1.1.0", "87e7da5b539f574d48529870cb0620ef5a244a5ee2eac73cc7559dedc04128ca") add_versions("v1.0.3", "ddba25bd35e9c6c75bc706c126001b8ce8e084d40ef37050e6aa6963e836eb8b") add_deps("cmake") diff --git a/packages/c/cartographer/patches/1.0.0/fix-build-error.patch b/packages/c/cartographer/patches/1.0.0/fix-build-error.patch new file mode 100644 index 000000000..b1f15a150 --- /dev/null +++ b/packages/c/cartographer/patches/1.0.0/fix-build-error.patch @@ -0,0 +1,39 @@ +diff --git a/cartographer/common/math.h b/cartographer/common/math.h +index c4a77ef..0248f66 100644 +--- a/cartographer/common/math.h ++++ b/cartographer/common/math.h +@@ -17,6 +17,10 @@ + #ifndef CARTOGRAPHER_COMMON_MATH_H_ + #define CARTOGRAPHER_COMMON_MATH_H_ + ++#ifndef M_PI ++#define M_PI 3.14159265358979323846 ++#endif ++ + #include + #include + +diff --git a/cartographer/common/thread_pool.cc b/cartographer/common/thread_pool.cc +index bc3c743..c61704d 100644 +--- a/cartographer/common/thread_pool.cc ++++ b/cartographer/common/thread_pool.cc +@@ -16,7 +16,6 @@ + + #include "cartographer/common/thread_pool.h" + +-#include + #include + #include + #include +diff --git a/cartographer/mapping/pose_graph_interface.h b/cartographer/mapping/pose_graph_interface.h +index 6483ef4..6456720 100644 +--- a/cartographer/mapping/pose_graph_interface.h ++++ b/cartographer/mapping/pose_graph_interface.h +@@ -18,6 +18,7 @@ + #define CARTOGRAPHER_MAPPING_POSE_GRAPH_INTERFACE_H_ + + #include ++#include + + #include "cartographer/common/optional.h" + #include "cartographer/mapping/id.h" diff --git a/packages/c/cartographer/patches/1.0.0/remove-boost.patch b/packages/c/cartographer/patches/1.0.0/remove-boost.patch new file mode 100644 index 000000000..401fb6154 --- /dev/null +++ b/packages/c/cartographer/patches/1.0.0/remove-boost.patch @@ -0,0 +1,87 @@ +diff --git a/cartographer/common/port.h b/cartographer/common/port.h +index 338861f..252c566 100644 +--- a/cartographer/common/port.h ++++ b/cartographer/common/port.h +@@ -19,11 +19,12 @@ + + #include + #include ++#include + #include ++#include ++#include + +-#include +-#include +-#include ++#include + + namespace cartographer { + +@@ -48,22 +49,54 @@ inline int64 RoundToInt64(const double x) { return std::lround(x); } + + inline void FastGzipString(const std::string& uncompressed, + std::string* compressed) { +- boost::iostreams::filtering_ostream out; +- out.push( +- boost::iostreams::gzip_compressor(boost::iostreams::zlib::best_speed)); +- out.push(boost::iostreams::back_inserter(*compressed)); +- boost::iostreams::write(out, +- reinterpret_cast(uncompressed.data()), +- uncompressed.size()); ++ z_stream zs; ++ memset(&zs, 0, sizeof(zs)); ++ ++ if (deflateInit(&zs, Z_BEST_SPEED) != Z_OK) ++ throw std::runtime_error("deflateInit failed while compressing."); ++ ++ zs.next_in = reinterpret_cast(const_cast(uncompressed.data())); ++ zs.avail_in = static_cast(uncompressed.size()); ++ ++ int ret; ++ char buffer[4096]; ++ ++ do { ++ zs.next_out = reinterpret_cast(buffer); ++ zs.avail_out = sizeof(buffer); ++ ++ ret = deflate(&zs, Z_FINISH); ++ ++ compressed->append(buffer, sizeof(buffer) - zs.avail_out); ++ } while (zs.avail_out == 0); ++ ++ deflateEnd(&zs); + } + + inline void FastGunzipString(const std::string& compressed, + std::string* decompressed) { +- boost::iostreams::filtering_ostream out; +- out.push(boost::iostreams::gzip_decompressor()); +- out.push(boost::iostreams::back_inserter(*decompressed)); +- boost::iostreams::write(out, reinterpret_cast(compressed.data()), +- compressed.size()); ++ z_stream zs; ++ memset(&zs, 0, sizeof(zs)); ++ ++ if (inflateInit(&zs) != Z_OK) ++ throw std::runtime_error("inflateInit failed while decompressing."); ++ ++ zs.next_in = reinterpret_cast(const_cast(compressed.data())); ++ zs.avail_in = static_cast(compressed.size()); ++ ++ int ret; ++ char buffer[4096]; ++ ++ do { ++ zs.next_out = reinterpret_cast(buffer); ++ zs.avail_out = sizeof(buffer); ++ ++ ret = inflate(&zs, Z_NO_FLUSH); ++ ++ decompressed->append(buffer, sizeof(buffer) - zs.avail_out); ++ } while (zs.avail_out == 0); ++ ++ inflateEnd(&zs); + } + + } // namespace common diff --git a/packages/c/cartographer/patches/2.0.0/fix-build-error.patch b/packages/c/cartographer/patches/2.0.0/fix-build-error.patch new file mode 100644 index 000000000..757890cff --- /dev/null +++ b/packages/c/cartographer/patches/2.0.0/fix-build-error.patch @@ -0,0 +1,39 @@ +diff --git a/cartographer/common/math.h b/cartographer/common/math.h +index c4a77ef..0248f66 100644 +--- a/cartographer/common/math.h ++++ b/cartographer/common/math.h +@@ -17,6 +17,10 @@ + #ifndef CARTOGRAPHER_COMMON_MATH_H_ + #define CARTOGRAPHER_COMMON_MATH_H_ + ++#ifndef M_PI ++#define M_PI 3.14159265358979323846 ++#endif ++ + #include + #include + +diff --git a/cartographer/mapping/pose_graph_interface.h b/cartographer/mapping/pose_graph_interface.h +index 68551f1..6055485 100644 +--- a/cartographer/mapping/pose_graph_interface.h ++++ b/cartographer/mapping/pose_graph_interface.h +@@ -19,6 +19,7 @@ + + #include + #include ++#include + + #include "absl/types/optional.h" + #include "cartographer/mapping/id.h" +diff --git a/cartographer/mapping/value_conversion_tables.h b/cartographer/mapping/value_conversion_tables.h +index 56924f0..f67854f 100644 +--- a/cartographer/mapping/value_conversion_tables.h ++++ b/cartographer/mapping/value_conversion_tables.h +@@ -19,6 +19,7 @@ + + #include + #include ++#include + + #include "cartographer/common/port.h" + #include "glog/logging.h" diff --git a/packages/c/cartographer/patches/2.0.0/remove-boost.patch b/packages/c/cartographer/patches/2.0.0/remove-boost.patch new file mode 100644 index 000000000..0e5913b0b --- /dev/null +++ b/packages/c/cartographer/patches/2.0.0/remove-boost.patch @@ -0,0 +1,89 @@ +diff --git a/cartographer/common/port.h b/cartographer/common/port.h +index eec8469..96881ad 100644 +--- a/cartographer/common/port.h ++++ b/cartographer/common/port.h +@@ -17,12 +17,14 @@ + #ifndef CARTOGRAPHER_COMMON_PORT_H_ + #define CARTOGRAPHER_COMMON_PORT_H_ + +-#include +-#include +-#include + #include ++#include + #include + #include ++#include ++#include ++ ++#include + + namespace cartographer { + +@@ -47,22 +49,54 @@ inline int64 RoundToInt64(const double x) { return std::lround(x); } + + inline void FastGzipString(const std::string& uncompressed, + std::string* compressed) { +- boost::iostreams::filtering_ostream out; +- out.push( +- boost::iostreams::gzip_compressor(boost::iostreams::zlib::best_speed)); +- out.push(boost::iostreams::back_inserter(*compressed)); +- boost::iostreams::write(out, +- reinterpret_cast(uncompressed.data()), +- uncompressed.size()); ++ z_stream zs; ++ memset(&zs, 0, sizeof(zs)); ++ ++ if (deflateInit(&zs, Z_BEST_SPEED) != Z_OK) ++ throw std::runtime_error("deflateInit failed while compressing."); ++ ++ zs.next_in = reinterpret_cast(const_cast(uncompressed.data())); ++ zs.avail_in = static_cast(uncompressed.size()); ++ ++ int ret; ++ char buffer[4096]; ++ ++ do { ++ zs.next_out = reinterpret_cast(buffer); ++ zs.avail_out = sizeof(buffer); ++ ++ ret = deflate(&zs, Z_FINISH); ++ ++ compressed->append(buffer, sizeof(buffer) - zs.avail_out); ++ } while (zs.avail_out == 0); ++ ++ deflateEnd(&zs); + } + + inline void FastGunzipString(const std::string& compressed, + std::string* decompressed) { +- boost::iostreams::filtering_ostream out; +- out.push(boost::iostreams::gzip_decompressor()); +- out.push(boost::iostreams::back_inserter(*decompressed)); +- boost::iostreams::write(out, reinterpret_cast(compressed.data()), +- compressed.size()); ++ z_stream zs; ++ memset(&zs, 0, sizeof(zs)); ++ ++ if (inflateInit(&zs) != Z_OK) ++ throw std::runtime_error("inflateInit failed while decompressing."); ++ ++ zs.next_in = reinterpret_cast(const_cast(compressed.data())); ++ zs.avail_in = static_cast(compressed.size()); ++ ++ int ret; ++ char buffer[4096]; ++ ++ do { ++ zs.next_out = reinterpret_cast(buffer); ++ zs.avail_out = sizeof(buffer); ++ ++ ret = inflate(&zs, Z_NO_FLUSH); ++ ++ decompressed->append(buffer, sizeof(buffer) - zs.avail_out); ++ } while (zs.avail_out == 0); ++ ++ inflateEnd(&zs); + } + + } // namespace common diff --git a/packages/c/cartographer/port/xmake.lua b/packages/c/cartographer/port/xmake.lua new file mode 100644 index 000000000..38052ffbc --- /dev/null +++ b/packages/c/cartographer/port/xmake.lua @@ -0,0 +1,55 @@ +add_rules("mode.debug", "mode.release") + +add_requires("ceres-solver 2.1.0", {configs = {suitesparse = true}}) +add_requires("abseil", "cairo", "eigen", "glog", "lua", "zlib") +add_requires("protobuf-cpp 3.19.4") + +target("cartographer") + set_kind("$(kind)") + set_languages("cxx17") + + add_packages( + "abseil", + "ceres-solver", + "cairo", + "eigen", + "glog", + "lua", + "zlib" + ) + + add_packages("protobuf-cpp", {public = true}) + add_rules("protobuf.cpp") + + add_files("cartographer/**.proto", {proto_rootdir = "cartographer", proto_autogendir = path.join("$(buildir)", "proto") , proto_public = true}) + + add_includedirs("$(buildir)/proto/cartographer") + add_includedirs("$(buildir)/proto", { public = true }) + + add_headerfiles("$(buildir)/proto/(cartographer/**.h)") + add_headerfiles("$(buildir)/proto/cartographer/(**.h)") + + remove_files("cartographer/**_service.proto") + + add_headerfiles("(cartographer/**.h)") + add_files("cartographer/**.cc") + + remove_files("cartographer/io/serialization_format_migration.cc") + remove_headerfiles("cartographer/io/serialization_format_migration.h") + + remove_files("cartographer/io/internal/pbstream_migrate.cc", "cartographer/io/internal/pbstream_info.cc") + remove_headerfiles("cartographer/io/internal/pbstream_migrate.h", "cartographer/io/internal/pbstream_info.h") + + remove_headerfiles("**/fake_*.h", "**/*test*.h", "**/mock*.h") + remove_files("**/fake_*.cc", "**/mock*.cc", "**/*_main.cc", "**/*test*.cc") + + -- BUILD_GRPC is not enabled + remove_headerfiles("cartographer/cloud/**.h") + remove_files("cartographer/cloud/**.cc") + remove_files("cartographer/cloud/proto/**.proto") + + add_includedirs(".", { public = true }) + + if is_plat("windows") then + add_defines("NOMINMAX") + end diff --git a/packages/c/cartographer/xmake.lua b/packages/c/cartographer/xmake.lua new file mode 100644 index 000000000..f1753bc36 --- /dev/null +++ b/packages/c/cartographer/xmake.lua @@ -0,0 +1,53 @@ +package("cartographer") + set_homepage("https://github.com/cartographer-project/cartographer") + set_description("Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.") + set_license("Apache-2.0") + + add_urls("https://github.com/cartographer-project/cartographer/archive/refs/tags/$(version).tar.gz", + "https://github.com/cartographer-project/cartographer.git") + + add_versions("1.0.0", "474a410bf6457eb8a0fd92ea412d7889fb013051e625d3ee25e8d65e4113fd6c") + add_versions("2.0.0", "abba0daa348095a5e821ee5e8037bad5d06f89f4c21ea850da5ab8a7e6997a2a") + + add_patches("1.0.0", path.join(os.scriptdir(), "patches", "1.0.0", "fix-build-error.patch"), "a4bb53d6f098c77a397d72c244d4283af1f9eec8a4ca7a7fa28de77b06d1201e") + add_patches("1.0.0", path.join(os.scriptdir(), "patches", "1.0.0", "remove-boost.patch"), "bd0666bbf4eff2f4fda0c6bd55c960fd60af848f7d750a9c1efaffda2abc1e9b") + add_patches("2.0.0", path.join(os.scriptdir(), "patches", "2.0.0", "fix-build-error.patch"), "5b59ffeb1ef339759e8def5c3a4e4793d5efc9d2af6feb782cae09afd3dd7a04") + add_patches("2.0.0", path.join(os.scriptdir(), "patches", "2.0.0", "remove-boost.patch"), "9b323141681748e3191c9964c7774bbb5acf17292dda76554763da4999a6358e") + + if is_plat("windows") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("cmake") + add_deps("zlib") + add_deps("ceres-solver 2.1.0", {configs = {suitesparse = true}}) + add_deps("protobuf-cpp 3.19.4") + add_deps("abseil", "cairo", "eigen", "lua") + + on_install("windows|x64", "windows|x86", "macosx|x86_64", "linux", function (package) + for _, headerfile in ipairs(os.files("cartographer/**.h")) do + io.replace(headerfile, "cairo/cairo.h", "cairo.h", {plain = true}) + end + for _, file in ipairs(table.join(os.files("cartographer/**.cc"), os.files("cartographer/**.h"))) do + io.replace(file, "LOCKS_EXCLUDED", "ABSL_LOCKS_EXCLUDED", {plain = true}) + io.replace(file, "GUARDED_BY", "ABSL_GUARDED_BY", {plain = true}) + io.replace(file, "EXCLUSIVE_LOCKS_REQUIRED", "ABSL_EXCLUSIVE_LOCKS_REQUIRED", {plain = true}) + end + for _, protofile in ipairs(os.files("cartographer/**.proto")) do + io.replace(protofile, [[import "cartographer/]], [[import "]], {plain = true}) + end + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + io.replace("cartographer/common/configuration_file_resolver.cc", [[#include "cartographer/common/config.h"]], "", {plain = true}) + io.replace("cartographer/common/configuration_file_resolver.cc", [[configuration_files_directories_.push_back(kConfigurationFilesDirectory);]], "", {plain = true}) + local configs = {} + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "cartographer/mapping/proto/map_builder_options.pb.h" + void test() { + cartographer::mapping::proto::MapBuilderOptions map_builder_options; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/c/catch2/patches/3.5.4/windows_arm64.patch b/packages/c/catch2/patches/3.5.4/windows_arm64.patch new file mode 100644 index 000000000..a1dae2dfb --- /dev/null +++ b/packages/c/catch2/patches/3.5.4/windows_arm64.patch @@ -0,0 +1,24 @@ +diff --git a/src/catch2/internal/catch_random_integer_helpers.hpp b/src/catch2/internal/catch_random_integer_helpers.hpp +index 10d82559..cb5e004f 100644 +--- a/src/catch2/internal/catch_random_integer_helpers.hpp ++++ b/src/catch2/internal/catch_random_integer_helpers.hpp +@@ -21,7 +21,10 @@ + // it, and it provides an escape hatch to the users who need it. + #if defined( __SIZEOF_INT128__ ) + # define CATCH_CONFIG_INTERNAL_UINT128 +-#elif defined( _MSC_VER ) && ( defined( _WIN64 ) || defined( _M_ARM64 ) ) ++// Unlike GCC, MSVC does not polyfill umul as mulh + mul pair on ARM machines. ++// Currently we do not bother doing this ourselves, but we could if it became ++// important for perf. ++#elif defined( _MSC_VER ) && defined( _M_X64 ) + # define CATCH_CONFIG_INTERNAL_MSVC_UMUL128 + #endif + +@@ -36,7 +39,6 @@ + !defined( CATCH_CONFIG_MSVC_UMUL128 ) + # define CATCH_CONFIG_MSVC_UMUL128 + # include +-# pragma intrinsic( _umul128 ) + #endif + + diff --git a/packages/c/catch2/xmake.lua b/packages/c/catch2/xmake.lua index 8ea2c2923..a843b9756 100644 --- a/packages/c/catch2/xmake.lua +++ b/packages/c/catch2/xmake.lua @@ -1,11 +1,16 @@ package("catch2") - set_homepage("https://github.com/catchorg/Catch2") set_description("Catch2 is a multi-paradigm test framework for C++. which also supports Objective-C (and maybe C). ") set_license("BSL-1.0") add_urls("https://github.com/catchorg/Catch2/archive/refs/tags/$(version).zip", "https://github.com/catchorg/Catch2.git") + add_versions("v3.6.0", "aa0ebf551ffbf098ec1e253b5fee234c30b4ee54a31b1be63cb1a7735d3cf391") + add_versions("v3.5.4", "190a236fe0772ac4f5eebfdebfc18f92eeecfd270c55a1e5095ae4f10be2343f") + add_versions("v3.5.3", "2de1868288b26a19c2aebfc3fe53a748ec3ec5fc32cc742dfccaf6c685a0dc07") + add_versions("v3.5.2", "85fcc78d0c3387b15ad82f22a94017b29e4fe7c1cf0a05c3dd465b2746eef73f") + add_versions("v3.5.1", "b422fcd526a95e6057839f93a18099261bdc8c595f932ed4b1a978b358b3f1ed") + add_versions("v3.5.0", "82079168b2304cfd0dfc70338f0c4b3caa4f3ef76b2643110d3f74a632252fc6") add_versions("v3.4.0", "cd175f5b7e62c29558d4c17d2b94325ee0ab6d0bf1a4b3d61bc8dbcc688ea3c2") add_versions("v3.3.2", "802a1d7f98f8e38a7913b596c5e3356ea76c544acb7c695bfd394544556359f3") add_versions("v3.2.1", "bfee681eaa920c6ddbe05c1eef1912440d38c5f9a7924f68a6aa219ed1a39c0f") @@ -20,22 +25,30 @@ package("catch2") add_versions("v2.13.5", "728679b056dc1248cc79b3a1999ff7453f76422c68417563fc47a0ac2aaeeaef") add_versions("v2.9.2", "dc486300de22b0d36ddba1705abb07b9e5780639d824ba172ddf7062b2a1bf8f") + if is_plat("windows") then + add_patches("v3.5.4", path.join(os.scriptdir(), "patches", "3.5.4", "windows_arm64.patch"), "36fa29bd38fc97d3d3563bc4e7fab0810e899f8a2d8f8418555e2a4c051ad947") + end + add_configs("cxx17", {description = "Compiles Catch as a C++17 library (requires a C++17 compiler).", default = true, type = "boolean"}) if is_plat("mingw") and is_subhost("msys") then add_extsources("pacman::catch") elseif is_plat("linux") then - add_extsources("pacman::catch2-git", "apt::catch2") - elseif is_plat("macosx") then - add_extsources("brew::catch2") + add_extsources("pacman::catch2", "apt::catch2") end on_load(function (package) if package:version():ge("3.0") then package:add("deps", "cmake") package:add("components", "main", "lib") + if package:is_plat("macosx") then + package:add("extsources", "brew::catch2/catch2-with-main") + end else package:set("kind", "library", {headeronly = true}) + if package:is_plat("macosx") then + package:add("extsources", "brew::catch2") + end end end) @@ -46,7 +59,11 @@ package("catch2") end component:add("links", link) if package:is_plat("windows") then - component:add("ldflags", "-subsystem:console") + if package:has_tool("cxx", "cl") then + component:add("ldflags", "-subsystem:console") + elseif package:has_tool("cxx", "clang", "clangxx") then + component:add("ldflags", "-Wl,/subsystem:console") + end end end) diff --git a/packages/c/celero/xmake.lua b/packages/c/celero/xmake.lua index 7f93128d5..925fbd88b 100644 --- a/packages/c/celero/xmake.lua +++ b/packages/c/celero/xmake.lua @@ -6,6 +6,7 @@ package("celero") add_urls("https://github.com/DigitalInBlue/Celero/archive/refs/tags/$(version).tar.gz", "https://github.com/DigitalInBlue/Celero.git") + add_versions("v2.9.0", "d59df84696e0dd58022d2c42837362c06eba6d1e29bac61f7b3143bc73d779e5") add_versions("v2.8.5", "1f319661c4bee1f6855e45c1764be6cd38bfe27e8afa8da1ad7060c1a793aa20") add_versions("v2.8.2", "7d2131ba27ca5343b31f1e04777ed3e666e2ad7f785e79c960c872fc48cd5f88") diff --git a/packages/c/cello/xmake.lua b/packages/c/cello/xmake.lua new file mode 100644 index 000000000..c2e45c6e9 --- /dev/null +++ b/packages/c/cello/xmake.lua @@ -0,0 +1,49 @@ +package("cello") + set_homepage("http://libcello.org/") + set_description("Higher level programming in C") + + add_urls("https://github.com/orangeduck/Cello/archive/refs/tags/$(version).tar.gz", + "https://github.com/orangeduck/Cello.git") + + add_versions("2.1.0", "c138d974325fcb9640307c8b2d5dcc2d7127a1ccc5589d6c0794f86a5cb4001d") + + if is_plat("windows", "mingw") then + add_syslinks("dbghelp") + elseif is_plat("linux", "bsd") then + add_syslinks("pthread") + if is_plat("bsd") then + add_syslinks("execinfo") + end + elseif is_plat("cross", "android", "wasm") then + add_defines("CELLO_NSTRACE") + end + + on_install("!wasm and (windows|!arm64 or !windows)", function(package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("cello") + set_kind("$(kind)") + add_files("src/*.c") + add_headerfiles("include/Cello.h") + add_includedirs("include") + + if is_plat("windows", "mingw") then + add_syslinks("dbghelp") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + elseif is_plat("linux", "bsd") then + add_syslinks("pthread") + if is_plat("bsd") then + add_syslinks("execinfo") + end + elseif is_plat("cross", "android", "wasm") then + add_defines("CELLO_NSTRACE") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function(package) + assert(package:has_cfuncs("name", {includes = "Cello.h"})) + end) diff --git a/packages/c/ceres-solver/patches/2.1.0/int64.patch b/packages/c/ceres-solver/patches/2.1.0/int64.patch new file mode 100644 index 000000000..a7a97fb4d --- /dev/null +++ b/packages/c/ceres-solver/patches/2.1.0/int64.patch @@ -0,0 +1,13 @@ +diff --git a/internal/ceres/covariance_impl.cc b/internal/ceres/covariance_impl.cc +index 324b553..d80554b 100644 +--- a/internal/ceres/covariance_impl.cc ++++ b/internal/ceres/covariance_impl.cc +@@ -630,7 +630,7 @@ bool CovarianceImpl::ComputeCovarianceValuesUsingSuiteSparseQR() { + // separately. + const SuiteSparse_long rank = SuiteSparseQR(SPQR_ORDERING_BESTAMD, + SPQR_DEFAULT_TOL, +- cholmod_jacobian.ncol, ++ static_cast(cholmod_jacobian.ncol), + &cholmod_jacobian, + &R, + &permutation, diff --git a/packages/c/ceres-solver/xmake.lua b/packages/c/ceres-solver/xmake.lua index dd69454a8..443203549 100644 --- a/packages/c/ceres-solver/xmake.lua +++ b/packages/c/ceres-solver/xmake.lua @@ -1,34 +1,54 @@ package("ceres-solver") - set_homepage("http://ceres-solver.org/") set_description("Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems.") + set_license("BSD-3-Clause") add_urls("http://ceres-solver.org/ceres-solver-$(version).tar.gz") add_versions("2.0.0", "10298a1d75ca884aa0507d1abb0e0f04800a92871cd400d4c361b56a777a7603") add_versions("2.1.0", "f7d74eecde0aed75bfc51ec48c91d01fe16a6bf16bce1987a7073286701e2fc6") + add_versions("2.2.0", "48b2302a7986ece172898477c3bcd6deb8fb5cf19b3327bc49969aad4cede82d") + + add_patches("2.1.0", "patches/2.1.0/int64.patch", "1df14f30abf1a942204b408c780eabbeac0859ba5a6db3459b55c47479583c57") - add_configs("blas", {description = "Choose BLAS library to use.", default = "openblas", type = "string", values = {"mkl", "openblas"}}) + add_configs("blas", {description = "Choose BLAS library to use.", default = "openblas", type = "string", values = {"mkl", "openblas"}}) add_configs("suitesparse", {description = "Enable SuiteSparse.", default = true, type = "boolean"}) + add_configs("cuda", {description = "Enable CUDA support.", default = false, type = "boolean"}) add_deps("cmake", "eigen", "glog", "gflags") - on_load("windows", "linux", "macosx", function (package) + + on_load(function (package) if package:config("suitesparse") then package:add("deps", "suitesparse", {configs = {blas = package:config("blas")}}) + package:add("deps", "openmp") + end + if package:config("cuda") then + package:add("deps", "cuda") end end) - on_install("windows", "linux", "macosx", function (package) - local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_DOCUMENTATION=OFF", "-DBUILD_EXAMPLES=OFF", "-DBUILD_BENCHMARKS=OFF"} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + on_install("windows|x64", "windows|x86", "linux", "macosx", function (package) + local configs = { + "-DBUILD_TESTING=OFF", + "-DBUILD_DOCUMENTATION=OFF", + "-DBUILD_EXAMPLES=OFF", + "-DBUILD_BENCHMARKS=OFF", + "-DCXSPARSE=OFF" + } + + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) if package:is_plat("windows") then table.insert(configs, "-DMSVC_USE_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) end table.insert(configs, "-DSUITESPARSE=" .. (package:config("suitesparse") and "ON" or "OFF")) - table.insert(configs, "-DCXSPARSE=" .. (package:config("suitesparse") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) + table.insert(configs, "-DUSE_CUDA=" .. (package:config("cuda") and "ON" or "OFF")) + if package:config("suitesparse") then + import("package.tools.cmake").install(package, configs, {packagedeps = {"openmp", "libomp"}}) + else + import("package.tools.cmake").install(package, configs) + end end) on_test(function (package) - assert(package:has_cxxtypes("ceres::Problem", {configs = {languages = "c++14"}, includes = "ceres/ceres.h"})) + assert(package:has_cxxtypes("ceres::Problem", {configs = {languages = "c++17"}, includes = "ceres/ceres.h"})) end) diff --git a/packages/c/ceval/xmake.lua b/packages/c/ceval/xmake.lua index 1811267b8..e0064e1e2 100644 --- a/packages/c/ceval/xmake.lua +++ b/packages/c/ceval/xmake.lua @@ -7,6 +7,7 @@ package("ceval") add_urls("https://github.com/erstan/ceval/archive/refs/tags/$(version).tar.gz", "https://github.com/erstan/ceval.git") + add_versions("1.0.1", "fb5508fc40715d1f1a50a1fa737f3c88cb7aeb187fb2aede7c35f0758f277779") add_versions("1.0.0", "3bb8cca8f0f7bf6f5ee6e7198d1174eab4d493318b6d97cc739343017090573e") on_install(function (package) diff --git a/packages/c/cgal/xmake.lua b/packages/c/cgal/xmake.lua index ae4bc06f6..918f4b88b 100644 --- a/packages/c/cgal/xmake.lua +++ b/packages/c/cgal/xmake.lua @@ -5,6 +5,7 @@ package("cgal") set_license("LGPL-3.0") add_urls("https://github.com/CGAL/cgal/releases/download/v$(version)/CGAL-$(version)-library.zip") + add_versions("5.6.1", "cf3900280d96847db8ac5e174d5e889f9764c7fa4e3d99f316f89910058335e6") add_versions("5.1.1", "ceca7ea896505941878f6c1fb7a7ae86653fdd9b3d87b276da72227f173a9cd2") add_versions("5.2.1", "ccdea67db79153417504f50c534cea3bb6b0e9754e7f32fb753fc19005114db0") add_versions("5.3", "49ccfb6b72a78d03ab026c6502099ba9358cf604d9d1f51c33e90b314635fe35") diff --git a/packages/c/cgif/xmake.lua b/packages/c/cgif/xmake.lua new file mode 100644 index 000000000..d1d450aa1 --- /dev/null +++ b/packages/c/cgif/xmake.lua @@ -0,0 +1,36 @@ +package("cgif") + set_homepage("https://github.com/dloebl/cgif") + set_description("GIF encoder written in C") + set_license("MIT") + + add_urls("https://github.com/dloebl/cgif/archive/refs/tags/$(version).tar.gz", + "https://github.com/dloebl/cgif.git") + + add_versions("v0.4.0", "130ff8a604f047449e81ddddf818bd0e03826b5f468e989b02726b16b7d4742e") + + if is_plat("linux") then + add_extsources("apt::libcgif-dev", "pacman::libcgif") + elseif is_plat("macosx") then + add_extsources("brew::cgif") + end + + add_deps("meson", "ninja") + + on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", "iphoneos", "cross", function (package) + local opt = {} + if package:is_plat("windows") and package:config("shared") then + io.replace("inc/cgif.h", "CGIF* cgif_newgif", "LIBRARY_API CGIF* cgif_newgif", {plain = true}) + io.replace("inc/cgif.h", "int cgif_addframe", "LIBRARY_API int cgif_addframe", {plain = true}) + io.replace("inc/cgif.h", "int cgif_close", "LIBRARY_API int cgif_close", {plain = true}) + opt.cxflags = "-DLIBRARY_API=__declspec(dllexport)" + package:add("defines", "LIBRARY_API=__declspec(dllimport)") + end + + local configs = {"-Dexamples=false", "-Dtests=false"} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + import("package.tools.meson").install(package, configs, opt) + end) + + on_test(function (package) + assert(package:has_cfuncs("cgif_newgif", {includes = "cgif.h"})) + end) diff --git a/packages/c/cglm/xmake.lua b/packages/c/cglm/xmake.lua index 3310290c8..248e7aae9 100644 --- a/packages/c/cglm/xmake.lua +++ b/packages/c/cglm/xmake.lua @@ -5,10 +5,27 @@ package("cglm") add_urls("https://github.com/recp/cglm/archive/refs/tags/$(version).tar.gz", "https://github.com/recp/cglm.git") + + add_versions("v0.9.4", "101376d9f5db7139a54db35ccc439e40b679bc2efb756d3469d39ee38e69c41b") + add_versions("v0.9.3", "4eda95e34f116c36203777f4fe770d64a3158b1450ea40364abb111cf4ba4773") + add_versions("v0.9.2", "5c0639fe125c00ffaa73be5eeecd6be999839401e76cf4ee05ac2883447a5b4d") add_versions("v0.9.0", "9b688bc52915cdd4ad8b7d4080ef59cc92674d526856d8f16bb3a114db1dd794") add_deps("cmake") + if on_check then + on_check("windows", function (package) + import("core.tool.toolchain") + import("core.base.semver") + + local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + if msvc then + local vs_sdkver = msvc:config("vs_sdkver") + assert(vs_sdkver and semver.match(vs_sdkver):gt("10.0.19041"), "package(cglm): need vs_sdkver > 10.0.19041.0") + end + end) + end + on_install(function (package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) diff --git a/packages/c/cgns/xmake.lua b/packages/c/cgns/xmake.lua index 09eca8569..b2a7fae07 100644 --- a/packages/c/cgns/xmake.lua +++ b/packages/c/cgns/xmake.lua @@ -4,6 +4,7 @@ package("cgns") set_description("CFD General Notation System") add_urls("https://github.com/CGNS/CGNS/archive/refs/tags/$(version).tar.gz") + add_versions("v4.4.0", "3b0615d1e6b566aa8772616ba5fd9ca4eca1a600720e36eadd914be348925fe2") add_versions("v4.2.0", "090ec6cb0916d90c16790183fc7c2bd2bd7e9a5e3764b36c8196ba37bf1dc817") add_configs("hdf5", {description = "Enable HDF5 interface.", default = false, type = "boolean"}) diff --git a/packages/c/cgraph/xmake.lua b/packages/c/cgraph/xmake.lua new file mode 100644 index 000000000..bd0ab4e44 --- /dev/null +++ b/packages/c/cgraph/xmake.lua @@ -0,0 +1,32 @@ +package("cgraph") + set_kind("library", {headeronly = true}) + set_homepage("http://www.chunel.cn") + set_description("A common used C++ DAG framework") + set_license("MIT") + + add_urls("https://github.com/ChunelFeng/CGraph/archive/refs/tags/$(version).tar.gz", + "https://github.com/ChunelFeng/CGraph.git") + + add_versions("v2.5.4", "fd5a53dc0d7e3fc11050ccc13fac987196ad42184a4e244b9d5e5d698b1cb101") + + if is_plat("windows") then + add_cxxflags("/source-charset:utf-8") + end + + on_install(function (package) + os.vcp("src/*", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + class MyNode1 : public CGraph::GNode { + public: + CStatus run() override { + CGRAPH_SLEEP_SECOND(1) + return CStatus(); + } + }; + void test() {} + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/c/charls/xmake.lua b/packages/c/charls/xmake.lua new file mode 100644 index 000000000..cb60bdc02 --- /dev/null +++ b/packages/c/charls/xmake.lua @@ -0,0 +1,31 @@ +package("charls") + set_homepage("https://github.com/team-charls/charls") + set_description("CharLS, a C++ JPEG-LS library implementation") + set_license("BSD-3-Clause") + + add_urls("https://github.com/team-charls/charls/archive/refs/tags/$(version).tar.gz", + "https://github.com/team-charls/charls.git") + + add_versions("2.4.2", "d1c2c35664976f1e43fec7764d72755e6a50a80f38eca70fcc7553cad4fe19d9") + + add_deps("cmake") + + on_install(function (package) + local configs = { + "-DCHARLS_BUILD_TESTS=OFF", + "-DCHARLS_BUILD_AFL_FUZZ_TEST=OFF", + "-DCHARLS_BUILD_LIBFUZZER_FUZZ_TEST=OFF", + "-DCHARLS_BUILD_SAMPLES=OFF", + "-DCHARLS_INSTALL=ON", + } + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + if not package:config("shared") then + package:add("defines", "CHARLS_STATIC") + end + end) + + on_test(function (package) + assert(package:has_cfuncs("charls_jpegls_encoder_create", {includes = "charls/charls.h"})) + end) diff --git a/packages/c/chipmunk2d/patches/7.0.3/android.patch b/packages/c/chipmunk2d/patches/7.0.3/android.patch index ed5f8f272..6250b995f 100644 --- a/packages/c/chipmunk2d/patches/7.0.3/android.patch +++ b/packages/c/chipmunk2d/patches/7.0.3/android.patch @@ -15,6 +15,20 @@ index 9544da8..82d027e 100644 #endif /// @defgroup basicTypes Basic Types +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 34882d1..56589fb 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -31,6 +31,9 @@ if(BUILD_SHARED) + # need to explicitly link to the math library because the CMake/Android toolchains may not do it automatically + target_link_libraries(chipmunk m) + endif(ANDROID OR UNIX) ++ if(ANDROID) ++ target_link_libraries(chipmunk log) ++ endif(ANDROID) + install(TARGETS chipmunk RUNTIME DESTINATION ${BIN_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/cpHastySpace.c b/src/cpHastySpace.c index 8dca425..fa3074d 100644 --- a/src/cpHastySpace.c diff --git a/packages/c/chipmunk2d/xmake.lua b/packages/c/chipmunk2d/xmake.lua index 5cb623047..ced073b5e 100644 --- a/packages/c/chipmunk2d/xmake.lua +++ b/packages/c/chipmunk2d/xmake.lua @@ -1,5 +1,4 @@ package("chipmunk2d") - set_homepage("https://chipmunk-physics.net/") set_description("A fast and lightweight 2D game physics library.") set_license("MIT") @@ -9,7 +8,9 @@ package("chipmunk2d") add_versions("archive:7.0.3", "1e6f093812d6130e45bdf4cb80280cb3c93d1e1833d8cf989d554d7963b7899a") add_versions("github:7.0.3", "87340c216bf97554dc552371bbdecf283f7c540e") - add_patches("7.0.3", path.join(os.scriptdir(), "patches", "7.0.3", "android.patch"), "08e80020880e9bf3c61b48d41537d953e7bf6a63797eb8bcd6b78ba038b79d8f") + add_patches("7.0.3", path.join(os.scriptdir(), "patches", "7.0.3", "android.patch"), "d0bbefe66852cdadb974dce24d4383c356bc3fa88656739ff1d5baf4e3792a96") + + add_configs("precision", {description = "Which precision to use (defaults is double on most platforms except ARM 32bits)", default = "default", type = "string", values = {"default", "single", "double"}}) if is_plat("mingw") and is_subhost("msys") then add_extsources("pacman::chipmunk") @@ -23,8 +24,24 @@ package("chipmunk2d") if is_plat("linux") then add_syslinks("pthread", "m") + elseif is_plat("android") then + add_syslinks("log", "m") end + on_load(function (package) + if package:config("precision") == "double" then + package:add("defines", "CP_USE_DOUBLES=1") + if package:is_plat("macosx", "iphoneos") then + package:add("defines", "CP_USE_CGTYPES=1") + end + elseif package:config("precision") == "single" then + package:add("defines", "CP_USE_DOUBLES=0") + if package:is_plat("macosx", "iphoneos") then + package:add("defines", "CP_USE_CGTYPES=0") + end + end + end) + on_install("windows", "linux", "macosx", "iphoneos", "mingw", "android", "wasm", function (package) local configs = {"-DBUILD_DEMOS=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) @@ -35,8 +52,21 @@ package("chipmunk2d") else table.insert(configs, "-DBUILD_SHARED=OFF") table.insert(configs, "-DBUILD_STATIC=ON") + table.insert(configs, "-DINSTALL_STATIC=ON") + end + local opt = {} + if package:config("precision") == "double" then + opt.cxflags = {"-DCP_USE_DOUBLES=1"} + if package:is_plat("macosx", "iphoneos") then + table.insert(opt.cxflags, "-DCP_USE_CGTYPES=1") + end + elseif package:config("precision") == "single" then + opt.cxflags = {"-DCP_USE_DOUBLES=0"} + if package:is_plat("macosx", "iphoneos") then + table.insert(opt.cxflags, "-DCP_USE_CGTYPES=0") + end end - import("package.tools.cmake").install(package, configs) + import("package.tools.cmake").install(package, configs, opt) os.vcp("include/chipmunk", package:installdir("include")) end) diff --git a/packages/c/chromium_zlib/port/xmake.lua b/packages/c/chromium_zlib/port/xmake.lua index fa8876c42..2af75dbc0 100644 --- a/packages/c/chromium_zlib/port/xmake.lua +++ b/packages/c/chromium_zlib/port/xmake.lua @@ -42,32 +42,32 @@ target("zlib") if is_arch(".+64") then add_defines("INFLATE_CHUNK_READ_64LE") end - -- arm optimization disabled on windows, see http://crbug.com/v8/10012. + -- arm optimization disabled on windows, see https://github.com/xmake-mirror/chromium_zlib/blob/zlib/BUILD.gn#L73. elseif is_arch("arm.*") and not is_plat("windows") then add_defines("ADLER32_SIMD_NEON", "INFLATE_CHUNK_SIMD_NEON") add_files("adler32_simd.c", "contrib/optimizations/inffast_chunk.c", "contrib/optimizations/inflate.c") if is_arch(".+64") then add_defines("INFLATE_CHUNK_READ_64LE") end - if not is_plat("iphoneos") then - -- ARM v8 architecture - add_defines("CRC32_ARMV8_CRC32") - if not is_plat("windows", "android") then - add_cflags("-march=armv8-a+crc") - end - if is_plat("android") then - add_defines("ARMV8_OS_ANDROID") - elseif is_plat("linux") then - add_defines("ARMV8_OS_LINUX") - elseif is_plat("windows") then - add_defines("ARMV8_OS_WINDOWS") - elseif is_plat("macosx") then - add_defines("ARMV8_OS_MACOS") - else - os.raise("Unsupported ARM OS") - end - add_files("crc32_simd.c") + -- ARM v8 architecture + add_defines("CRC32_ARMV8_CRC32") + if not is_plat("windows", "macosx", "android", "iphoneos") then + add_cflags("-march=armv8-a+aes+crc") end + if is_plat("android") then + add_defines("ARMV8_OS_ANDROID") + elseif is_plat("linux") then + add_defines("ARMV8_OS_LINUX") + elseif is_plat("windows") then + add_defines("ARMV8_OS_WINDOWS") + elseif is_plat("macosx") then + add_defines("ARMV8_OS_MACOS") + elseif is_plat("iphoneos") then + add_defines("ARMV8_OS_IOS") + else + os.raise("Unsupported ARM OS") + end + add_files("crc32_simd.c") else add_defines("CPU_NO_SIMD") add_files("inflate.c") @@ -85,7 +85,7 @@ target("minizip") if is_plat("windows") then add_files("contrib/minizip/iowin32.c") add_headerfiles("contrib/minizip/iowin32.h") - elseif is_plat("macosx", "iphoneos") then + elseif is_plat("macosx", "android", "iphoneos") then add_defines("USE_FILE32API") end diff --git a/packages/c/chromium_zlib/xmake.lua b/packages/c/chromium_zlib/xmake.lua index 0f6529011..35814b77f 100644 --- a/packages/c/chromium_zlib/xmake.lua +++ b/packages/c/chromium_zlib/xmake.lua @@ -8,12 +8,14 @@ package("chromium_zlib") add_urls("https://chromium.googlesource.com/chromium/src/third_party/zlib.git") add_versions("2022.02.22", "6f44c22c1f003bd20011062abec283678842567c") add_versions("2023.03.14", "5edb52d4302d7aef232d585ec9ae27ef5c3c5438") + add_versions("2024.01.29", "646b7f569718921d7d4b5b8e22572ff6c76f2596") add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) if is_plat("linux") then add_syslinks("pthread") end + add_links("compression_utils_portable", "minizip", "z", "zlib") on_install(function (package) for _, f in ipairs(table.join(os.files("contrib/minizip/*.c"), os.files("contrib/minizip/*.h"))) do diff --git a/packages/c/cinatra/patches/0.8.9/windows-move.patch b/packages/c/cinatra/patches/0.8.9/windows-move.patch new file mode 100644 index 000000000..618dc8cda --- /dev/null +++ b/packages/c/cinatra/patches/0.8.9/windows-move.patch @@ -0,0 +1,16 @@ +diff --git a/include/cinatra/ylt/coro_io/channel.hpp b/include/cinatra/ylt/coro_io/channel.hpp +index bdaec57..ed6dab6 100644 +--- a/include/cinatra/ylt/coro_io/channel.hpp ++++ b/include/cinatra/ylt/coro_io/channel.hpp +@@ -160,10 +160,7 @@ class channel { + channel(const channel& o) = delete; + channel& operator=(const channel& o) = delete; + +- auto send_request(auto op, typename client_t::config& config) +- -> decltype(std::declval().send_request(std::move(op), +- std::string_view{}, +- config)) { ++ auto send_request(auto op, typename client_t::config& config) { + std::shared_ptr client_pool; + if (client_pools_.size() > 1) { + client_pool = co_await std::visit( diff --git a/packages/c/cinatra/xmake.lua b/packages/c/cinatra/xmake.lua index c6c4fa112..4f4b9bf3c 100644 --- a/packages/c/cinatra/xmake.lua +++ b/packages/c/cinatra/xmake.lua @@ -1,5 +1,4 @@ package("cinatra") - set_kind("library", {headeronly = true}) set_homepage("https://github.com/qicosmos/cinatra") set_description("modern c++(c++20), cross-platform, header-only, easy to use http framework") @@ -8,10 +7,16 @@ package("cinatra") add_urls("https://github.com/qicosmos/cinatra/archive/refs/tags/v$(version).tar.gz", "https://github.com/qicosmos/cinatra.git") + add_versions("0.8.9", "007dc38aceedf42d03a9c05dc9aa6d2f303456ae7ce1100800df7a565b83b510") add_versions("0.8.0", "4e14d5206408eccb43b3e810d3a1fe228fbc7496ded8a16b041ed12cbcce4479") + add_patches("0.8.9", "patches/0.8.9/windows-move.patch", "c913ed0e9044ffc0ced40516245ec0d55262f8eabd30244d9911c3f0427a60f5") + add_configs("ssl", {description = "Enable SSL", default = false, type = "boolean"}) add_configs("gzip", {description = "Enable GZIP", default = false, type = "boolean"}) + add_configs("sse42", {description = "Enable sse4.2 instruction set", default = false, type = "boolean"}) + add_configs("avx2", {description = "Enable avx2 instruction set", default = false, type = "boolean"}) + add_configs("aarch64", {description = "Enable aarch64 instruction set (only arm)", default = false, type = "boolean"}) add_deps("asio") add_deps("async_simple", {configs = {aio = false}}) @@ -26,6 +31,18 @@ package("cinatra") package:add("deps", "zlib") package:add("defines", "CINATRA_ENABLE_GZIP") end + + local configdeps = { + sse42 = "CINATRA_SSE", + avx2 = "CINATRA_AVX2", + aarch64 = "CINATRA_ARM_OPT" + } + + for name, item in pairs(configdeps) do + if package:config(name) then + package:add("defines", item) + end + end end) on_install("windows", "linux", "macosx", function (package) @@ -33,16 +50,5 @@ package("cinatra") end) on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - #include - using namespace cinatra; - void test() { - http_server server(std::thread::hardware_concurrency()); - server.listen("0.0.0.0", "8080"); - server.set_http_handler("/", [](request& req, response& res) { - res.set_status_and_content(status_type::ok, "hello world"); - }); - server.run(); - } - ]]}, {configs = {languages = "c++20"}})) + assert(package:has_cxxincludes("cinatra.hpp", {configs = {languages = "c++20"}})) end) diff --git a/packages/c/cista/xmake.lua b/packages/c/cista/xmake.lua new file mode 100644 index 000000000..080f8ce28 --- /dev/null +++ b/packages/c/cista/xmake.lua @@ -0,0 +1,45 @@ +package("cista") + set_kind("library", {headeronly = true}) + set_homepage("https://cista.rocks") + set_description("Cista is a simple, high-performance, zero-copy C++ serialization & reflection library.") + set_license("MIT") + + add_urls("https://github.com/felixguendling/cista/archive/refs/tags/$(version).tar.gz", + "https://github.com/felixguendling/cista.git") + + add_versions("v0.15", "f807d3282f68a74eed94d6e829763244ae22993169ab6ece7fd7c22bd2f08330") + add_versions("v0.14", "9844a55fd3fd35a15614de01ff54e97ad0216d7b3d3952f14bfd6ebd7d6ff58f") + + add_deps("cmake") + + on_install("windows|x64", "windows|x86","linux", "macosx", "bsd", "android", "iphoneos", "cross", function (package) + if package:is_plat("android") then + import("core.tool.toolchain") + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndk_sdkver = ndk:config("ndk_sdkver") + assert(ndk_sdkver and tonumber(ndk_sdkver) > 21, "package(cista): need ndk api level > 21 for android") + end + import("package.tools.cmake").install(package, {"-DCISTA_INSTALL=ON"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + namespace data = cista::raw; + struct my_struct { + int a_{0}; + struct inner { + data::string b_; + } j; + }; + void test() { + std::vector buf; + { + my_struct obj{1, {data::string{"test"}}}; + buf = cista::serialize(obj); + } + auto deserialized = cista::deserialize(buf); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/c/ck/xmake.lua b/packages/c/ck/xmake.lua index d4998adb3..ed035c47a 100644 --- a/packages/c/ck/xmake.lua +++ b/packages/c/ck/xmake.lua @@ -4,6 +4,7 @@ package("ck") add_urls("https://github.com/concurrencykit/ck/archive/refs/tags/$(version).tar.gz", "https://github.com/concurrencykit/ck.git") + add_versions("0.7.2", "568ebe0bc1988a23843fce6426602e555b7840bf6714edcdf0ed530214977f1b") add_versions("0.7.1", "97d2a21d5326ef79b4668be2e6eda6284ee77a64c0981b35fd9695c736c3d4ac") on_install("macosx", "linux", function (package) diff --git a/packages/c/clblast/xmake.lua b/packages/c/clblast/xmake.lua index 0d386db54..06ab0bdb5 100644 --- a/packages/c/clblast/xmake.lua +++ b/packages/c/clblast/xmake.lua @@ -50,3 +50,19 @@ package("clblast") import("package.tools.cmake").install(package, configs) end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test () { + clblast::ClearCache(); + } + ]]}, {configs = {languages = "c++11"}})) + + assert(package:check_csnippets({test = [[ + #include + void test () { + CLBlastClearCache(); + } + ]]}, {configs = {languages = "c11"}})) + end) \ No newline at end of file diff --git a/packages/c/cli/xmake.lua b/packages/c/cli/xmake.lua index 036196b82..e46d36e35 100644 --- a/packages/c/cli/xmake.lua +++ b/packages/c/cli/xmake.lua @@ -5,6 +5,7 @@ package("cli") add_urls("https://github.com/daniele77/cli/archive/refs/tags/$(version).tar.gz", "https://github.com/daniele77/cli.git") + add_versions("v2.1.0", "dfc9fc7c72a6cdfdf852d89f151699b57460ff49775a8ff27d2a69477649acf9") add_versions("v2.0.0", "0fac3c9fab4527e6141f8fae92dabbd575b6cc71c42c3de76cb28725df68919a") add_deps("cmake") diff --git a/packages/c/cli11/xmake.lua b/packages/c/cli11/xmake.lua index 551e0ae17..0c9f1c0e7 100644 --- a/packages/c/cli11/xmake.lua +++ b/packages/c/cli11/xmake.lua @@ -6,6 +6,8 @@ package("cli11") add_urls("https://github.com/CLIUtils/CLI11/archive/refs/tags/$(version).tar.gz", "https://github.com/CLIUtils/CLI11.git") + add_versions("v2.4.2", "f2d893a65c3b1324c50d4e682c0cdc021dd0477ae2c048544f39eed6654b699a") + add_versions("v2.4.1", "73b7ec52261ce8fe980a29df6b4ceb66243bb0b779451dbd3d014cfec9fdbb58") add_versions("v2.3.2", "aac0ab42108131ac5d3344a9db0fdf25c4db652296641955720a4fbe52334e22") add_versions("v2.2.0", "d60440dc4d43255f872d174e416705f56ba40589f6eb07727f76376fb8378fd6") diff --git a/packages/c/clip/xmake.lua b/packages/c/clip/xmake.lua index 3768a3d88..2d9c6b111 100644 --- a/packages/c/clip/xmake.lua +++ b/packages/c/clip/xmake.lua @@ -4,6 +4,8 @@ package("clip") set_license("MIT") set_urls("https://github.com/dacap/clip/archive/refs/tags/v$(version).zip") + add_versions("1.9", "905615eb1ceef15e96468891ad85b7aa6836bcda690006d61fa061ca029b2060") + add_versions("1.8", "9df8728c9ce7c3afcfc9a0c6718e064319f0cdffb927243ac1ca3be591578d00") add_versions("1.5", "4ed7f54184c27c79a8f2382ba747dce11aeb4552017abf5588587369a6caeb6b") add_deps("cmake", "libpng") diff --git a/packages/c/clipboard_lite/xmake.lua b/packages/c/clipboard_lite/xmake.lua new file mode 100644 index 000000000..12e9298fd --- /dev/null +++ b/packages/c/clipboard_lite/xmake.lua @@ -0,0 +1,59 @@ +package("clipboard_lite") + set_homepage("https://github.com/smasherprog/clipboard_lite") + set_description("cross platform clipboard library") + set_license("MIT") + + add_urls("https://github.com/smasherprog/clipboard_lite.git") + add_versions("2023.10.16", "ffff8f452af0c3587e9789ec40692d519c6170f0") + + if is_plat("windows", "mingw") then + add_syslinks("user32", "gdi32", "shlwapi") + elseif is_plat("linux") then + add_deps("libx11") + add_syslinks("pthread") + elseif is_plat("macosx") then + add_frameworks("CoreFoundation", "Cocoa") + end + + on_install("windows", "macosx", "mingw", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + if is_plat("linux") then + add_requires("libx11") + end + set_languages("c++14") + target("clipboard_lite") + set_kind("$(kind)") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + + add_files("src/*.cpp") + add_includedirs("include") + add_headerfiles("include/Clipboard_Lite.h") + if is_plat("windows", "mingw") then + add_files("src/windows/*.cpp") + add_includedirs("include/windows") + add_syslinks("user32", "gdi32", "shlwapi") + elseif is_plat("linux") then + add_files("src/linux/*.cpp") + add_includedirs("include/linux") + add_syslinks("pthread") + add_packages("libx11") + elseif is_plat("macosx") then + add_files("src/ios/*.mm") + add_includedirs("include/ios") + add_frameworks("CoreFoundation", "Cocoa") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + auto clipboard = SL::Clipboard_Lite::CreateClipboard(); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/c/clipper2/xmake.lua b/packages/c/clipper2/xmake.lua index b4acc12dd..2ee82433c 100644 --- a/packages/c/clipper2/xmake.lua +++ b/packages/c/clipper2/xmake.lua @@ -6,6 +6,9 @@ package("clipper2") add_urls("https://github.com/AngusJohnson/Clipper2/archive/refs/tags/Clipper2_$(version).tar.gz", "https://github.com/AngusJohnson/Clipper2.git") + add_versions("1.3.0", "8e537ec320e140afaa8fba1f23120416693cc1d71b0f76ad801d24b88b5e0b3c") + add_versions("1.2.4", "a013d391c25c5f665cdb5cbd75cdd842dcc28f6e1bd098454beb359f6f212f33") + add_versions("1.2.3", "d65bd45f50331e9dd2de3c68137c6be069fe25732095bef0128d547c997b1fda") add_versions("1.2.2", "e893e3560383744a13b896225a1ae97cf910fa30125cad66264b18446b9f931e") add_configs("use_z", {description = "Build Clipper2Z", default = "OFF", type = "string", values = {"ON", "OFF", "ONLY"}}) diff --git a/packages/c/clove-unit/xmake.lua b/packages/c/clove-unit/xmake.lua new file mode 100644 index 000000000..047896016 --- /dev/null +++ b/packages/c/clove-unit/xmake.lua @@ -0,0 +1,22 @@ +package("clove-unit") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/fdefelici/clove-unit") + set_description("Single-Header Unit Testing framework for C (interoperable with C++) with test autodiscovery feature") + set_license("MIT") + + add_urls("https://github.com/fdefelici/clove-unit/archive/refs/tags/$(version).tar.gz", + "https://github.com/fdefelici/clove-unit.git") + + add_versions("v2.4.4", "25e611e1d4286c73d9cce7bbc99f83e00629551602351fec1edcbb669243e047") + + on_install(function (package) + os.vcp("clove-unit.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_csnippets({test = [[ + CLOVE_TEST(test) { + CLOVE_IS_TRUE(1); + } + ]]}, {includes = "clove-unit.h"})) + end) diff --git a/packages/c/cmake/xmake.lua b/packages/c/cmake/xmake.lua index c6c8d2be8..53c7b3130 100644 --- a/packages/c/cmake/xmake.lua +++ b/packages/c/cmake/xmake.lua @@ -1,5 +1,4 @@ package("cmake") - set_kind("binary") set_homepage("https://cmake.org") set_description("A cross-platform family of tool designed to build, test and package software") @@ -19,6 +18,9 @@ package("cmake") add_versions("3.24.1", "71bb8db69826d74c395a3c3bbf8b773dbe9f54a2c7331266ba70da303e9c97a1") add_versions("3.24.2", "efb11a78c064dd7c54a50b8da247254d252112c402c6e48cb7db3f9c84a4e5ad") add_versions("3.26.4", "5417fb979c1f82aaffe4420112e2c84562c024b6683161afb520c9e378161340") + add_versions("3.28.1", "0e0942bb5ed7ee1aeda0c00b3cb7738f2590865f1d69fe1d5212cbc26fc040a5") + add_versions("3.28.3", "d9e2c22fec920a4d1f6b0d0683c035d799475c179c91e41e1a7fbfab610a0305") + add_versions("3.29.2", "0d670b59dddd064d24cf8c386abf3590bda2642bb169e11534cf1e3d1ae3a76a") elseif is_host("linux") then if os.arch():find("arm64.*") then add_urls("https://cmake.org/files/v$(version)-aarch64.tar.gz", {version = function (version) @@ -29,6 +31,9 @@ package("cmake") end}) add_versions("3.24.2", "5f1c0d49bac89915b5c68811c2430e5de6c8e606785b9f2919eabee86c2f12b4") add_versions("3.26.4", "1c9843c92f40bee1a16baa12871693d3e190c9a222259a89e406d4d9aae6cf74") + add_versions("3.28.1", "e84d88e46ed8c85fbe259bcd4ca07df7a928df87e84013e0da34d91b01a25d71") + add_versions("3.28.3", "bbf023139f944cefe731d944f2864d8ea3ea0c4f9310b46ac72b3cb4e314b023") + add_versions("3.29.2", "ca883c6dc3ce9eebd833804f0f940ecbbff603520cfd169ee58916dbbc23c2b8") else add_urls("https://cmake.org/files/v$(version)-x86_64.tar.gz", {version = function (version) return table.concat(table.slice((version):split('%.'), 1, 2), '.') .. "/cmake-" .. version .. (version:ge("3.20") and "-linux" or "-Linux") @@ -44,6 +49,9 @@ package("cmake") add_versions("3.24.1", "827bf068cfaa23a9fb95f990c9f8a7ed8f2caeb3af62b5c0a2fed7a8dd6dde3e") add_versions("3.24.2", "71a776b6a08135092b5beb00a603b60ca39f8231c01a0356e205e0b4631747d9") add_versions("3.26.4", "ba1e0dcc710e2f92be6263f9617510b3660fa9dc409ad2fb8190299563f952a0") + add_versions("3.28.1", "f76398c24362ad87bad1a3d6f1e8f4377632b5b1c360c4ba1fd7cd205fd9d8d4") + add_versions("3.28.3", "804d231460ab3c8b556a42d2660af4ac7a0e21c98a7f8ee3318a74b4a9a187a6") + add_versions("3.29.2", "0416c70cf88e8f92efcbfe292e181bc09ead7d70e29ab37b697522c01121eab5") end elseif is_host("windows") then if os.arch() == "x64" then @@ -61,7 +69,10 @@ package("cmake") add_versions("3.24.1", "c1b17431a16337d517f7ba78c7067b6f143a12686cb8087f3dd32f3fa45f5aae") add_versions("3.24.2", "6af30354eecbb7113b0f0142d13c03d21abbc9f4dbdcddaf88df1f9ca1bc4d6f") add_versions("3.26.4", "62c35427104a4f8205226f72708d71334bd36a72cf72c60d0e3a766d71dcc78a") - else + add_versions("3.28.1", "671332249bc7cc7424523d6c2b5edd3e3de90a43b8b82e8782f42da4fe4c562d") + add_versions("3.28.3", "cac7916f7e1e73a25de857704c94fd5b72ba9fe2f055356b5602d2f960e50e5b") + add_versions("3.29.2", "86b5de51f60a0e9d62be4d8ca76ea467d154083d356fcc9af1409606be341cd8") + elseif os.arch() == "x86" then add_urls("https://cmake.org/files/v$(version).zip", {excludes = {"*/doc/*"}, version = function (version) return table.concat(table.slice((version):split('%.'), 1, 2), '.') .. "/cmake-" .. version .. (version:ge("3.20") and "-windows-i386" or "-win32-x86") end}) @@ -76,6 +87,19 @@ package("cmake") add_versions("3.24.1", "a0b894e2a814d2353f1e581eb6ca3c878a39c071624495729dbcf9978e1579f2") add_versions("3.24.2", "52f174dc7f52a9c496c7a49ee35456466c07c8ce29aa2092f4b4536ce5d7ed57") add_versions("3.26.4", "342ca44f494985f8ef43676eb8a0404b2c68321036e28aa221ceab51d377b158") + add_versions("3.28.1", "e9591cfdb1d394eee84acdecf880cbd91cf0707dfd0d58bf3796b88475f46cb9") + add_versions("3.28.3", "411812b6b29ac793faf69bdbd36c612f72659363c5491b9f0a478915db3fc58c") + add_versions("3.29.2", "e51b281c9dfd1498834729b33bf49fc668ad1dadbc2eaba7b693d0f7d748450d") + elseif os.arch() == "arm64" then + add_urls("https://cmake.org/files/v$(version).zip", {excludes = {"*/doc/*"}, version = function (version) + return table.concat(table.slice((version):split('%.'), 1, 2), '.') .. "/cmake-" .. version .. "-windows-arm64" + end}) + add_urls("https://github.com/Kitware/CMake/releases/download/v$(version).zip", {excludes = {"*/doc/*"}, version = function (version) + return version .. "/cmake-" .. version .. "-windows-arm64" + end}) + add_versions("3.28.1", "a839b8d32c11b24f078142b5b8c3361a955ebc65788f0f0353b2121fe2f74e49") + add_versions("3.28.3", "cfe023b7e82812ef802fb1ec619f6cfa2fdcb58ee61165fc315086286fe9cdcc") + add_versions("3.29.2", "5b16a0db4966c04582c40131038de49d5b0161fcd950dc9e955753dfab858882") end else add_urls("https://github.com/Kitware/CMake/releases/download/v$(version)/cmake-$(version).tar.gz") @@ -85,6 +109,9 @@ package("cmake") add_versions("3.24.1", "4931e277a4db1a805f13baa7013a7757a0cbfe5b7932882925c7061d9d1fa82b") add_versions("3.24.2", "0d9020f06f3ddf17fb537dc228e1a56c927ee506b486f55fe2dc19f69bf0c8db") add_versions("3.26.4", "313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208") + add_versions("3.28.1", "15e94f83e647f7d620a140a7a5da76349fc47a1bfed66d0f5cdee8e7344079ad") + add_versions("3.28.3", "72b7570e5c8593de6ac4ab433b73eab18c5fb328880460c86ce32608141ad5c1") + add_versions("3.29.2", "36db4b6926aab741ba6e4b2ea2d99c9193222132308b4dc824d4123cb730352e") end if is_plat("mingw") and is_subhost("msys") then @@ -106,7 +133,8 @@ package("cmake") end) on_install("@bsd", function (package) - os.vrunv("sh", {"./bootstrap", "--prefix=" .. package:installdir()}) + import("core.base.option") + os.vrunv("sh", {"./bootstrap", "--parallel=" .. (option.get("jobs") or tostring(os.default_njob())), "--prefix=" .. package:installdir()}) import("package.tools.make").install(package) end) diff --git a/packages/c/cmark/xmake.lua b/packages/c/cmark/xmake.lua new file mode 100644 index 000000000..ee8a80af8 --- /dev/null +++ b/packages/c/cmark/xmake.lua @@ -0,0 +1,22 @@ +package("cmark") + set_homepage("https://github.com/commonmark/cmark") + set_description("CommonMark parsing and rendering library and program in C") + + add_urls("https://github.com/commonmark/cmark/archive/refs/tags/$(version).tar.gz", + "https://github.com/commonmark/cmark.git") + + add_versions("0.31.0", "bbcb8f8c03b5af33fcfcf11a74e9499f20a9043200b8552f78a6e8ba76e04d11") + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_TESTING=OFF") + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("cmark_markdown_to_html", {includes = "cmark.h"})) + end) diff --git a/packages/c/cminpack/xmake.lua b/packages/c/cminpack/xmake.lua new file mode 100644 index 000000000..194cc1d3c --- /dev/null +++ b/packages/c/cminpack/xmake.lua @@ -0,0 +1,40 @@ +package("cminpack") + set_homepage("https://devernay.github.io/cminpack/") + set_description("A C/C++ rewrite of the MINPACK software (originally in FORTRAN) for solving nonlinear equations and nonlinear least squares problems") + + add_urls("https://github.com/devernay/cminpack/archive/$(version).tar.gz", + "https://github.com/devernay/cminpack.git") + + add_versions("v1.3.9", "aa37bac5b5caaa4f5805ea5c4240e3834c993672f6dab0b17190ee645e251c9f") + + add_configs("blas", {description = "Compile cminpack using cblas library if possible", default = false, type = "boolean"}) + + if is_plat("linux") then + add_syslinks("m") + end + + add_includedirs("include/cminpack-1") + + add_deps("cmake") + + on_load(function (package) + if package:config("blas") then + package:add("deps", "openblas") + end + end) + + on_install("windows", "linux", "macosx", "mingw", "msys", "android", "iphoneos", "wasm", function (package) + if package:is_plat("windows", "mingw") and (not package:config("shared")) then + package:add("defines", "CMINPACK_NO_DLL") + end + + local configs = {"-DBUILD_EXAMPLES=OFF", "-DENABLE_TESTING=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DUSE_BLAS=" .. (package:config("blas") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("lmdif", {includes = "minpack.h"})) + end) diff --git a/packages/c/concurrencpp/xmake.lua b/packages/c/concurrencpp/xmake.lua index 7cd953fa6..667ac4f1b 100644 --- a/packages/c/concurrencpp/xmake.lua +++ b/packages/c/concurrencpp/xmake.lua @@ -9,6 +9,7 @@ package("concurrencpp") add_urls("https://github.com/David-Haim/concurrencpp.git") add_versions("0.1.5", "330150ebe11b3d30ffcb3efdecc184a34cf50a6bd43b68e294a496225d286651") add_versions("0.1.6", "e7d5c23a73ff1d7199d361d3402ad2a710dfccf7630b622346df94a7532b4221") + add_versions("0.1.7", "049f3e83ad1828e0b8b518652de1a3160d5849fdff03d521d0a5af0167338e89") add_deps("cmake") diff --git a/packages/c/concurrentqueue/xmake.lua b/packages/c/concurrentqueue/xmake.lua index 43a742f44..095897cea 100644 --- a/packages/c/concurrentqueue/xmake.lua +++ b/packages/c/concurrentqueue/xmake.lua @@ -1,24 +1,66 @@ package("concurrentqueue") - set_homepage("https://github.com/cameron314/concurrentqueue") - set_description("An industrial-strength lock-free queue for C++.") + set_description("A fast multi-producer, multi-consumer lock-free concurrent queue for C++11") + set_license("BSD") + + add_urls("https://github.com/cameron314/concurrentqueue/archive/refs/tags/$(version).tar.gz", + "https://github.com/cameron314/concurrentqueue.git") + + add_versions("v1.0.4", "87fbc9884d60d0d4bf3462c18f4c0ee0a9311d0519341cac7cbd361c885e5281") + + add_configs("c_api", {description = "Build C API", default = false, type = "boolean"}) + + add_deps("cmake") + + add_includedirs("include", "include/concurrentqueue/moodycamel") - add_urls("https://github.com/cameron314/concurrentqueue.git") + on_load(function (package) + if not package:config("c_api") then + package:set("kind", "library", {headeronly = true}) + end + end) on_install(function (package) - os.cp("*.h", package:installdir("include/concurrentqueue")) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + + io.writefile(path.join(package:installdir("include"), "concurrentqueue", "concurrentqueue.h"), [[ +#pragma once + +#pragma message please update include to +#include "moodycamel/concurrentqueue.h" + ]]) + + if package:config("c_api") then + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + target("concurrentqueue-c") + set_kind("$(kind)") + add_files("c_api/*.cpp") + add_headerfiles("(c_api/concurrentqueue.h)") + if is_plat("windows") and is_kind("shared") then + add_defines("DLL_EXPORT") + end + ]]) + import("package.tools.xmake").install(package) + + if package:is_plat("windows") and (not package:config("shared")) then + package:add("defines", "MOODYCAMEL_STATIC") + end + end end) on_test(function (package) assert(package:check_cxxsnippets({test = [[ - #include - static void test() { + #include + void test() { moodycamel::ConcurrentQueue q; - bool success = q.enqueue(25); - int item; - bool found = q.try_dequeue(item); - assert(found && item == 25); + q.enqueue(25); } - ]]}, {configs = {languages = "c++11"}, includes = "concurrentqueue/concurrentqueue.h"})) + ]]}, {configs = {languages = "c++11"}})) + if package:config("c_api") then + assert(package:has_cfuncs("moodycamel_cq_create", {includes = "c_api/concurrentqueue.h"})) + end end) - diff --git a/packages/c/console-bridge/xmake.lua b/packages/c/console-bridge/xmake.lua index e2975d309..f94611481 100644 --- a/packages/c/console-bridge/xmake.lua +++ b/packages/c/console-bridge/xmake.lua @@ -7,10 +7,11 @@ package("console-bridge") add_urls("https://github.com/ros/console_bridge/archive/refs/tags/$(version).tar.gz", "https://github.com/ros/console_bridge.git") add_versions("1.0.1", "2ff175a9bb2b1849f12a6bf972ce7e4313d543a2bbc83b60fdae7db6e0ba353f") + add_versions("1.0.2", "303a619c01a9e14a3c82eb9762b8a428ef5311a6d46353872ab9a904358be4a4") add_deps("cmake") on_install("windows", "macosx", "linux", function (package) - local configs = {"-DCMAKE_INSTALL_LIBDIR=lib", "-DBUILD_TESTING=OFF"} + local configs = {"-DBUILD_TESTING=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) diff --git a/packages/c/continuable/xmake.lua b/packages/c/continuable/xmake.lua new file mode 100644 index 000000000..ab73d9b16 --- /dev/null +++ b/packages/c/continuable/xmake.lua @@ -0,0 +1,41 @@ +package("continuable") + set_kind("library", {headeronly = true}) + set_homepage("https://naios.github.io/continuable/") + set_description("C++14 asynchronous allocation aware futures (supporting then, exception handling, coroutines and connections)") + set_license("MIT") + + add_urls("https://github.com/Naios/continuable/archive/refs/tags/$(version).tar.gz", + "https://github.com/Naios/continuable.git", {submodules = false}) + + add_versions("4.2.2", "49bf82a349b26c01194631e4fe5d1dbad080b3b4a347eebc5cf95326ea130fba") + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + add_deps("cmake") + add_deps("function2") + + on_install(function (package) + local configs = + { + "-DCTI_CONTINUABLE_WITH_INSTALL=ON", + "-DCTI_CONTINUABLE_WITH_TESTS=OFF", + "-DCTI_CONTINUABLE_WITH_EXAMPLES=OFF" + } + io.replace("CMakeLists.txt", "add_subdirectory(dep)", "", {plain = true}) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + cti::continuable http_request(std::string /*url*/) { + return cti::make_ready_continuable("..."); + } + void test() { + http_request("github.com") && http_request("atom.io"); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/c/coost/xmake.lua b/packages/c/coost/xmake.lua index 96ce20282..ef15b1a3d 100644 --- a/packages/c/coost/xmake.lua +++ b/packages/c/coost/xmake.lua @@ -1,13 +1,17 @@ package("coost") set_homepage("https://github.com/idealvin/coost") set_description("A tiny boost library in C++11.") + set_license("MIT") add_urls("https://github.com/idealvin/coost/archive/refs/tags/$(version).tar.gz", "https://github.com/idealvin/coost.git") + add_versions("v3.0.2", "922ba21fb9a922c84f6a4b3bd568ed3b3463ccb1ae906cd7c49d90c7f0359b24") add_versions("v3.0.1", "f2285d59dc8317dd2494d7628a56f10de9b814d90b86aedf93a3305f94c6ae1a") add_versions("v3.0.0", "f962201201cd77aaf45f33d72bd012231a31d4310d30e9bb580ffb1e94c8148d") + add_patches("3.0.2", "https://github.com/idealvin/coost/commit/c9488af72e9086ef1d910e29f9efa4b4210a5190.patch", "837feb2b49dc5d162f27175627689680a61e54e761dcf972f0e27896249addc6") + for _, name in ipairs({"libcurl", "openssl", "libbacktrace"}) do local default = false if name == "libbacktrace" and is_plat("linux") then diff --git a/packages/c/corrade/patches/2020.06/msvc.patch b/packages/c/corrade/patches/2020.06/msvc.patch new file mode 100644 index 000000000..791db044a --- /dev/null +++ b/packages/c/corrade/patches/2020.06/msvc.patch @@ -0,0 +1,67 @@ +diff --git a/src/Corrade/Containers/GrowableArray.h b/src/Corrade/Containers/GrowableArray.h +index f866bea..4bb8b12 100644 +--- a/src/Corrade/Containers/GrowableArray.h ++++ b/src/Corrade/Containers/GrowableArray.h +@@ -1166,13 +1166,13 @@ template void arrayResize(Array& array, NoInitT, co + template void arrayResize(Array& array, DefaultInitT, const std::size_t size) { + const std::size_t prevSize = array.size(); + arrayResize(array, NoInit, size); +- Implementation::arrayConstruct(DefaultInit, array + prevSize, array.end()); ++ Implementation::arrayConstruct(DefaultInit, array.data() + prevSize, array.end()); + } + + template void arrayResize(Array& array, ValueInitT, const std::size_t size) { + const std::size_t prevSize = array.size(); + arrayResize(array, NoInit, size); +- Implementation::arrayConstruct(ValueInit, array + prevSize, array.end()); ++ Implementation::arrayConstruct(ValueInit, array.data() + prevSize, array.end()); + } + + template void arrayResize(Array& array, DirectInitT, const std::size_t size, Args&&... args) { +diff --git a/src/Corrade/Utility/Format.cpp b/src/Corrade/Utility/Format.cpp +index 1d4c23c..7fe825f 100644 +--- a/src/Corrade/Utility/Format.cpp ++++ b/src/Corrade/Utility/Format.cpp +@@ -383,7 +383,7 @@ std::size_t formatInto(const Containers::ArrayView& buffer, const char* co + CORRADE_ASSERT(data.size() <= buffer.size(), + "Utility::formatInto(): buffer too small, expected at least" << bufferOffset + data.size() << "but got" << bufferOffset + buffer.size(), ); + /* strncpy() would stop on \0 characters */ +- std::memcpy(buffer + bufferOffset, data, data.size()); ++ std::memcpy(buffer.data() + bufferOffset, data, data.size()); + } + bufferOffset += data.size(); + }, [&buffer, &bufferOffset](BufferFormatter& formatter, int precision, FormatType type) { +diff --git a/src/Corrade/Utility/String.cpp b/src/Corrade/Utility/String.cpp +index 1b05870..0cdd472 100644 +--- a/src/Corrade/Utility/String.cpp ++++ b/src/Corrade/Utility/String.cpp +@@ -129,7 +129,7 @@ bool beginsWith(Containers::ArrayView string, const Containers::Arra + bool endsWith(Containers::ArrayView string, const Containers::ArrayView suffix) { + if(string.size() < suffix.size()) return false; + +- return std::strncmp(string + string.size() - suffix.size(), suffix, suffix.size()) == 0; ++ return std::strncmp(string.data() + string.size() - suffix.size(), suffix, suffix.size()) == 0; + } + + std::string stripPrefix(std::string string, const Containers::ArrayView prefix) { +diff --git a/src/Corrade/Utility/TweakableParser.cpp b/src/Corrade/Utility/TweakableParser.cpp +index 4991991..993d107 100644 +--- a/src/Corrade/Utility/TweakableParser.cpp ++++ b/src/Corrade/Utility/TweakableParser.cpp +@@ -37,12 +37,12 @@ namespace Corrade { namespace Utility { + namespace { + std::pair integerBase(Containers::ArrayView value) { + if(String::viewBeginsWith(value, "0x") || String::viewBeginsWith(value, "0X")) +- return {value + 2, 16}; ++ return {value.data() + 2, 16}; + if(String::viewBeginsWith(value, "0b") || String::viewBeginsWith(value, "0B")) +- return {value + 2, 2}; ++ return {value.data() + 2, 2}; + if(String::viewBeginsWith(value, "0")) +- return {value + 1, 8}; +- return {value, 10}; ++ return {value.data() + 1, 8}; ++ return {value.data(), 10}; + } + } + diff --git a/packages/c/corrade/rules/resource.lua b/packages/c/corrade/rules/resource.lua new file mode 100644 index 000000000..6643926a0 --- /dev/null +++ b/packages/c/corrade/rules/resource.lua @@ -0,0 +1,54 @@ +-- Compile corrade resource files. Substitution for cmake corrade_add_resource. +-- +-- Usage: +-- +-- add_rules("@corrade/resource") +-- add_files("resources.conf", {rule = "@corrade/resource", single = false}) + +rule("resource") + set_extensions(".conf") + on_buildcmd_file(function (target, batchcmds, sourcefile, opt) + import("core.base.option") + import("lib.detect.find_program") + + batchcmds:show_progress(opt.progress, "${color.build.object}compiling.corrade %s", sourcefile) + + -- get corrade-rc program + local corrade = find_program("corrade-rc", {check = "-h"}) + assert(corrade, "corrade-rc not found! please check your corrade installation.") + + -- generate source file + local basename = path.basename(sourcefile) + local sourcefile_cx = path.join(target:autogendir(), "rules", "autogen", basename .. ".cpp") + local objectfile = target:objectfile(sourcefile_cx) + table.insert(target:objectfiles(), objectfile) + + -- compile + batchcmds:mkdir(path.directory(sourcefile_cx)) + local args = {} + local fileconf = target:fileconfig(sourcefile) + if fileconf and fileconf.single then + table.insert(args, "--single") + end + if fileconf and fileconf.name then + table.insert(args, fileconf.name) + else + table.insert(args, basename) + end + local workdir = path.directory(sourcefile) + table.insert(args, path.filename(sourcefile)) + table.insert(args, path.relative(sourcefile_cx, workdir)) + if option.get("verbose") then + batchcmds:show(corrade .. " " .. os.args(args)) + end + local currentdir = os.curdir() + batchcmds:cd(workdir) + batchcmds:vrunv(corrade, args) + batchcmds:cd(currentdir) + batchcmds:compile(sourcefile_cx, objectfile) + + -- add dependency + batchcmds:add_depfiles(sourcefile) + batchcmds:set_depmtime(os.mtime(objectfile)) + batchcmds:set_depcache(target:dependfile(objectfile)) + end) diff --git a/packages/c/corrade/xmake.lua b/packages/c/corrade/xmake.lua index 78c24cad5..73de2dd89 100644 --- a/packages/c/corrade/xmake.lua +++ b/packages/c/corrade/xmake.lua @@ -8,22 +8,39 @@ package("corrade") "https://github.com/mosra/corrade.git") add_versions("v2020.06", "d89a06128c334920d91fecf23cc1df48fd6be26543dc0ed81b2f819a92d70e72") + add_patches("2020.06", "patches/2020.06/msvc.patch", "af90c9bad846a2cbe834fe270860446f6329636f9b9b7ad23454cf479c1dc05f") + if is_plat("windows") then add_syslinks("shell32") elseif is_plat("linux") then add_syslinks("dl") end add_deps("cmake") + on_load("windows", "linux", "macosx", function (package) + if package:is_cross() then + package:add("deps", "corrade", {host = true, private = true}) + end + end) + on_install("windows", "linux", "macosx", function (package) + io.replace("src/Corrade/Utility/StlForwardTuple.h", "__tuple", "tuple") + local configs = {"-DBUILD_TESTS=OFF", "-DLIB_SUFFIX="} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DCORRADE_BUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON")) table.insert(configs, "-DBUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON")) import("package.tools.cmake").install(package, configs) - package:addenv("PATH", "bin") + if package:is_cross() then + os.rm(path.join(package:installdir("bin"), "*")) + else + package:addenv("PATH", "bin") + end end) on_test(function (package) - os.vrun("corrade-rc --help") + if not package:is_cross() then + os.vrun("corrade-rc --help") + end assert(package:check_cxxsnippets({test = [[ #include void test() { diff --git a/packages/c/cosmocc/xmake.lua b/packages/c/cosmocc/xmake.lua new file mode 100644 index 000000000..0e4aedf2e --- /dev/null +++ b/packages/c/cosmocc/xmake.lua @@ -0,0 +1,27 @@ +package("cosmocc") + set_kind("toolchain") + set_homepage("https://github.com/jart/cosmopolitan") + set_description("build-once run-anywhere c library") + + add_urls("https://cosmo.zip/pub/cosmocc/cosmocc-$(version).zip", + "https://github.com/xmake-mirror/cosmopolitan/releases/download/$(version)/cosmocc-$(version).zip") + add_versions("3.2.4", "d2fa6dbf6f987310494581deff5b915dbdc5ca701f20f7613bb0dcf1de2ee511") + add_versions("3.3.2", "a695012ffbeac5e26e3c4a740debc15273f47e9a8bdc55e8b76a623154d5914b") + add_versions("3.3.4", "98e5b361c525603f5296351e0c11820fd25908b52fe1ce8ff394d66b1537a259") + + on_load("@windows|x64", function (package) + package:add("deps", "msys2") + end) + + on_install("@windows", "@macosx", "@linux", "@bsd", "@cygwin", "@msys", function (package) + if is_host("windows") then + import("lib.detect.find_tool") + assert(find_tool("sh"), "cosmocc need sh/bash, please install it first!") + end + os.cp("*", package:installdir(), {symlink = true}) + end) + + on_test(function (package) + local cosmocc = path.join(package:installdir("bin"), "cosmocc") + os.vrunv(cosmocc, {"--version"}, {shell = true}) + end) diff --git a/packages/c/cpp-dump/xmake.lua b/packages/c/cpp-dump/xmake.lua new file mode 100644 index 000000000..03b137197 --- /dev/null +++ b/packages/c/cpp-dump/xmake.lua @@ -0,0 +1,27 @@ +package("cpp-dump") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/philip82148/cpp-dump") + set_description("A C++ library for debugging purposes that can print any variable, even user-defined types.") + set_license("MIT") + + add_urls("https://github.com/philip82148/cpp-dump/archive/refs/tags/$(version).tar.gz", + "https://github.com/philip82148/cpp-dump.git") + + add_versions("v0.6.0", "22bc5fafa22ac7c1e99db8824fdabec4af6baabed0c8b7cc80a0205dfb550414") + add_versions("v0.5.0", "31fa8b03c9ee820525137be28f37b36e2abe7fd91df7d67681cb894db2230fe6") + + on_install(function (package) + os.cp("hpp", package:installdir("include/cpp-dump")) + os.cp("dump.hpp", package:installdir("include/cpp-dump")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include "cpp-dump/dump.hpp" + void test() { + std::vector> my_vector{{3, 5, 8, 9, 7}, {9, 3, 2, 3, 8}}; + cpp_dump(my_vector); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/c/cpp-httplib/xmake.lua b/packages/c/cpp-httplib/xmake.lua index f2cd6c47a..7496eb217 100644 --- a/packages/c/cpp-httplib/xmake.lua +++ b/packages/c/cpp-httplib/xmake.lua @@ -1,33 +1,56 @@ package("cpp-httplib") - + set_kind("library", {headeronly = true}) set_homepage("https://github.com/yhirose/cpp-httplib") set_description("A C++11 single-file header-only cross platform HTTP/HTTPS library.") + set_license("MIT") - set_urls("https://github.com/yhirose/cpp-httplib/archive/v$(version).zip", + set_urls("https://github.com/yhirose/cpp-httplib/archive/v$(version).tar.gz", "https://github.com/yhirose/cpp-httplib.git") - add_versions("0.8.5", "57d2a7e67ae6944292cd08cb16083463a93c7c139f6698560e872ade63b9b463") - add_versions("0.9.2", "87131d53c14b921ca1a4fae0d5d4081c218dd18004b768a8069de29b130ab6bc") - add_versions("0.12.1", "bd2e98842208df1c6c19f5446b7b0fe8f094ad7c931db0fefe52055c496c9d13") - add_versions("0.12.6", "bdeb6be5f30cce0544204ed50bcb9b15ca0f9b360c148cbf75f0664584ac92d9") + + add_versions("0.8.5", "b353f3e7c124a08940d9425aeb7206183fa29857a8f720c162f8fd820cc18f0e") + add_versions("0.9.2", "bfef2587a2aa31c85fb361df71c720be97076f8083e4f3881da8572f6a58054f") + add_versions("0.12.1", "0e56c25c63e730ebd42e2beda6e7cb1b950131d8fc00d3158b1443a8d76f41ca") + add_versions("0.12.6", "24bc594a9efcc08a5a6f3928e848d046d411a88b07bcd6f7f3851227a1f0133e") + add_versions("0.14.0", "3a92248ef8cf2c32ad07f910b8e3052ff2427022b2adb871cf326fb620d2438e") + add_versions("0.14.1", "2d4fb5544da643e5d0a82585555d8b7502b4137eb321a4abbb075e21d2f00e96") + add_versions("0.14.2", "dbcf5590e8ed35c6745c2ad659a5ebec92f05187d1506eec24449d6db95e5084") + add_versions("0.14.3", "dcf6486d9030937636d8a4f820ca9531808fd7edb283893dddbaa05f99357e63") + add_versions("0.15.0", "b658e625e283e2c81437a485a95f3acf8b1d32c53d8147b1ccecc8f630e1f7bb") + add_versions("0.15.1", "8d6a4a40ee8fd3f553b7e895882e60e674bd910883fc1857587dbbabee3cdb91") + add_versions("0.15.2", "4afbcf4203249d2cbcb698e46e1f6fb61b479013a84844d6bb1c044e233cab6a") + add_versions("0.15.3", "2121bbf38871bb2aafb5f7f2b9b94705366170909f434428352187cb0216124e") add_configs("ssl", { description = "Requires OpenSSL", default = false, type = "boolean"}) add_configs("zlib", { description = "Requires Zlib", default = false, type = "boolean"}) add_configs("brotli", { description = "Requires Brotli", default = false, type = "boolean"}) + add_configs("exceptions", {description = "Enable the use of C++ exceptions", default = true, type = "boolean"}) add_deps("cmake") on_load(function (package) if package:config("ssl") then - package:add("deps", "openssl") + package:add("deps", "openssl" .. (package:version():ge("0.15.0") and "3" or "")) + package:add("defines", "CPPHTTPLIB_OPENSSL_SUPPORT") end if package:config("zlib") then package:add("deps", "zlib") + package:add("defines", "CPPHTTPLIB_ZLIB_SUPPORT") end if package:config("brotli") then package:add("deps", "brotli") + package:add("defines", "CPPHTTPLIB_BROTLI_SUPPORT") end end) + if on_check then + on_check("android", function (package) + import("core.tool.toolchain") + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndk_sdkver = ndk:config("ndk_sdkver") + assert(ndk_sdkver and tonumber(ndk_sdkver) >= 24, "package(httplib): need ndk api level >= 24 for android") + end) + end + on_install(function (package) if package:is_plat("android") then import("core.tool.toolchain") @@ -35,11 +58,12 @@ package("cpp-httplib") local ndk_sdkver = ndk:config("ndk_sdkver") assert(ndk_sdkver and tonumber(ndk_sdkver) >= 24, "package(httplib): need ndk api level >= 24 for android") end - local configs = {} + local configs = {"-DHTTPLIB_COMPILE=OFF"} table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DHTTPLIB_REQUIRE_OPENSSL=" .. (package:config("ssl") and "ON" or "OFF")) table.insert(configs, "-DHTTPLIB_REQUIRE_ZLIB=" .. (package:config("zlib") and "ON" or "OFF")) table.insert(configs, "-DHTTPLIB_REQUIRE_BROTLI=" .. (package:config("brotli") and "ON" or "OFF")) + table.insert(configs, "-DHTTPLIB_NO_EXCEPTIONS=" .. (package:config("exceptions") and "OFF" or "ON")) import("package.tools.cmake").install(package, configs) end) diff --git a/packages/c/cpp-ipc/xmake.lua b/packages/c/cpp-ipc/xmake.lua index d61adf52e..44786a021 100644 --- a/packages/c/cpp-ipc/xmake.lua +++ b/packages/c/cpp-ipc/xmake.lua @@ -7,6 +7,7 @@ package("cpp-ipc") set_urls("https://github.com/mutouyun/cpp-ipc/archive/refs/tags/v$(version).zip", "https://github.com/mutouyun/cpp-ipc.git") + add_versions("1.3.0", "898f97a36c855a58dfe9645b73c388e6df7bcd3762a5c9a6a75b4bca60d72b4b") add_versions("1.2.0", "31739760d8f191c7aaf71d1c453fce1989d1f74fdee9a61f9fdd475b29fe1888") add_deps("cmake") diff --git a/packages/c/cpp-jwt/xmake.lua b/packages/c/cpp-jwt/xmake.lua new file mode 100644 index 000000000..67ae20303 --- /dev/null +++ b/packages/c/cpp-jwt/xmake.lua @@ -0,0 +1,29 @@ +package("cpp-jwt") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/arun11299/cpp-jwt") + set_description("JSON Web Token library for C++") + set_license("MIT") + + add_urls("https://github.com/arun11299/cpp-jwt/archive/refs/tags/$(version).tar.gz", + "https://github.com/arun11299/cpp-jwt.git") + + add_versions("v1.4", "1cb8039ee15bf9bf735c26082d7ff50c23d2886d65015dd6b0668c65e17dd20f") + + add_deps("nlohmann_json", "openssl3") + + on_install("!wasm@macosx and !iphoneos@macosx and !android",function (package) + os.cp("include/jwt", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + using namespace jwt::params; + jwt::jwt_object obj{algorithm("HS256"), secret("secret")}; + obj.add_claim("test", "12345"); + assert(obj.has_claim("test")); + } + ]]}, {configs = {languages = "cxx17"}})) + end) diff --git a/packages/c/cpp-lazy/xmake.lua b/packages/c/cpp-lazy/xmake.lua index d1eac5132..1eea636c4 100644 --- a/packages/c/cpp-lazy/xmake.lua +++ b/packages/c/cpp-lazy/xmake.lua @@ -7,6 +7,7 @@ package("cpp-lazy") "https://github.com/MarcDirven/cpp-lazy.git") add_versions("v7.0.2", "7a5c2a42ce5c98343676d09761959b9821ec125dbff7b9f2028792c117de0b09") + add_versions("v8.0.0", "315a94a25004fadcc003ba30e2a5d91e1b2482ab") add_deps("fmt") diff --git a/packages/c/cpp-peglib/xmake.lua b/packages/c/cpp-peglib/xmake.lua index 1a21885b5..4f7bcf134 100644 --- a/packages/c/cpp-peglib/xmake.lua +++ b/packages/c/cpp-peglib/xmake.lua @@ -8,6 +8,7 @@ package("cpp-peglib") set_urls("https://github.com/yhirose/cpp-peglib/archive/refs/tags/v$(version).tar.gz", "https://github.com/yhirose/cpp-peglib.git") + add_versions("1.8.8", "3019d8084a146562fe2fd4c71e3226ac6e3994e8cee21cab27b3cd5a86bcef34") add_versions("1.8.3", "3de8aeb44a262f9c2478e2a7e7bc2bb9426a2bdd176cf0654ff5a3d291c77b73") on_install(function (package) diff --git a/packages/c/cpp-semver/xmake.lua b/packages/c/cpp-semver/xmake.lua index 0e90dc8e6..e05e3f125 100644 --- a/packages/c/cpp-semver/xmake.lua +++ b/packages/c/cpp-semver/xmake.lua @@ -7,6 +7,7 @@ package("cpp-semver") add_urls("https://github.com/z4kn4fein/cpp-semver/archive/refs/tags/$(version).tar.gz", "https://github.com/z4kn4fein/cpp-semver.git") + add_versions("v0.3.3", "05d59da347b5b5b4f34670d32704a54219657c9856a7af6645f06064006c6c68") add_versions("v0.3.1", "9168cc815d8b9a5b3d73d2a158efec467eff844f1cab929bc145312cfc3958ae") on_install(function (package) diff --git a/packages/c/cpp-tbox/xmake.lua b/packages/c/cpp-tbox/xmake.lua new file mode 100644 index 000000000..8ea1b72a2 --- /dev/null +++ b/packages/c/cpp-tbox/xmake.lua @@ -0,0 +1,44 @@ +package("cpp-tbox") + set_homepage("https://github.com/cpp-main/cpp-tbox") + set_description("A complete Linux application software development tool library and runtime framework, aim at make C++ development easy.") + set_license("MIT") + + add_urls("https://github.com/cpp-main/cpp-tbox.git") + add_versions("2023.12.13", "1666e59a1ff2407a692d619691d744d52c1c057d") + add_configs("mqtt", {description = "Enable mosquitto", default = false, type = "boolean"}) + + add_deps("cmake") + add_deps("dbus", "nlohmann_json") + + on_load(function (package) + if package:config("mqtt") then + add_deps("mosquitto") + end + end) + + on_install("linux", function (package) + local configs = {"-DCMAKE_ENABLE_TEST=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DTBOX_ENABLE_MQTT=" .. (package:config("mqtt") and "ON" or "OFF")) + table.insert(configs, "-DTBOX_BUILD_LIB_TYPE=" .. (package:config("shared") and "SHARED" or "STATIC")) + import("package.tools.cmake").install(package, configs) + local httpdir = path.join(package:installdir(),"include", "tbox", "http") + os.mv(path.join(httpdir, "types.h"), path.join(httpdir, "server", "types.h")) + os.mv(path.join(httpdir, "server.h"), path.join(httpdir, "server", "server.h")) + os.mv(path.join(httpdir, "context.h"), path.join(httpdir, "server", "context.h")) + os.mv(path.join(httpdir, "middleware.h"), path.join(httpdir, "server", "middleware.h")) + os.mv(path.join(httpdir, "router.h"), path.join(httpdir, "server", "router.h")) + os.mv(path.join(httpdir, "client.h"), path.join(httpdir, "client", "client.h")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include + using namespace tbox; + void test() { + LogOutput_Enable(); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/c/cppcheck/xmake.lua b/packages/c/cppcheck/xmake.lua new file mode 100644 index 000000000..167c1c905 --- /dev/null +++ b/packages/c/cppcheck/xmake.lua @@ -0,0 +1,24 @@ +package("cppcheck") + set_kind("binary") + set_homepage("https://cppcheck.sourceforge.io/") + set_description("A static analysis tool for C/C++ code") + + add_urls("https://github.com/danmar/cppcheck/archive/refs/tags/$(version).tar.gz") + add_versions("2.13.4", "d6ea064ebab76c6aa000795440479767d8d814dd29405918df4c1bbfcd6cb86c") + add_versions("2.13.0", "8229afe1dddc3ed893248b8a723b428dc221ea014fbc76e6289840857c03d450") + + add_deps("cmake") + + on_install("windows|x64", "macosx", "linux", "msys", function (package) + local configs = {} + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") + end + + io.replace("cmake/compileroptions.cmake", "add_compile_options($<$>:/MD>)", "", {plain = true}) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + os.vrun("cppcheck --version") + end) diff --git a/packages/c/cppcodec/xmake.lua b/packages/c/cppcodec/xmake.lua new file mode 100644 index 000000000..3def237c5 --- /dev/null +++ b/packages/c/cppcodec/xmake.lua @@ -0,0 +1,23 @@ +package("cppcodec") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/tplgy/cppcodec") + set_description("Header-only C++11 library to encode/decode base64, base64url, base32, base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus Crockford's base32. MIT licensed with consistent, flexible API.") + set_license("MIT") + + add_urls("https://github.com/tplgy/cppcodec.git") + + add_versions("2022.09.07", "8019b8b580f8573c33c50372baec7039dfe5a8ce") + + on_install(function (package) + os.vcp("cppcodec", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + using base64 = cppcodec::base64_rfc4648; + void test() { + std::vector decoded = base64::decode("YW55IGNhcm5hbCBwbGVhc3VyZQ=="); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/c/cppfront/xmake.lua b/packages/c/cppfront/xmake.lua index 44af8c740..7ba0726f1 100644 --- a/packages/c/cppfront/xmake.lua +++ b/packages/c/cppfront/xmake.lua @@ -3,8 +3,9 @@ package("cppfront") set_homepage("https://github.com/hsutter/cppfront") set_description("A personal experimental C++ Syntax 2 -> Syntax 1 compiler") + add_urls("https://github.com/hsutter/cppfront/archive/refs/tags/$(version).tar.gz") add_urls("https://github.com/hsutter/cppfront.git") - add_versions("2023.08.29", "b757afd9b0051a40278706cdfc57971e371e4e32") + add_versions("v0.7.0", "d4ffb37d19a2b7c054d005cf4687439577ef2f3d93b340a342704e064cd1d047") on_fetch(function (package, opt) if opt.system then @@ -12,7 +13,7 @@ package("cppfront") end end) - on_install("windows", "linux", function (package) + on_install("windows", "linux", "macosx|x86_64", function (package) local configs = {} io.writefile("xmake.lua", [[ add_rules("mode.release", "mode.debug") diff --git a/packages/c/cppgpio/xmake.lua b/packages/c/cppgpio/xmake.lua new file mode 100644 index 000000000..75d4c48f7 --- /dev/null +++ b/packages/c/cppgpio/xmake.lua @@ -0,0 +1,33 @@ +package("cppgpio") + set_homepage("https://github.com/JoachimSchurig/CppGPIO") + set_description("C++14 GPIO library for embedded systems on Linux") + + set_urls("https://github.com/JoachimSchurig/CppGPIO.git") + + add_versions("2022.02.20", "f76e8fc8f8fa8d8b5643ba9dfac44de7664c9c23") + add_versions("2016.04.04", "2653a5876df8d23041eddc56e57ebd5e3ac167d1") + add_versions("2016.03.11", "ba6fc634ebe2b519dba98dd11dc36dbda331ecc0") + + on_install("linux", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("cppgpio") + set_kind("$(kind)") + set_languages("cxx14") + add_files("src/*.cpp") + add_includedirs("include") + add_headerfiles("include/(**.hpp)") + add_headerfiles("src/tools.hpp") + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + using namespace GPIO; + void test() { + PWMOut pwm(23, 100, 0); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/c/cppp-reiconv/xmake.lua b/packages/c/cppp-reiconv/xmake.lua new file mode 100644 index 000000000..b43cbd986 --- /dev/null +++ b/packages/c/cppp-reiconv/xmake.lua @@ -0,0 +1,39 @@ +package("cppp-reiconv") + + set_homepage("https://github.com/cppp-project/cppp-reiconv") + set_description("A character set conversion library based on GNU LIBICONV.") + + add_urls("https://github.com/cppp-project/cppp-reiconv/releases/download/$(version)/cppp-reiconv-$(version).zip") + + add_versions("v2.1.0", "3e539785a437843793c5ce2f8a72cb08f2b543cba11635b06db25cfc6d9cc3a4") + + add_deps("cmake", "python") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_EXTRA=ON") + table.insert(configs, "-DENABLE_TEST=OFF") + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include + using namespace cppp::base::reiconv; + + void test() + { + iconv_t cd = iconv_open("UTF-8", "UTF-8"); + if (cd == (iconv_t)(-1)) + { + abort(); + } + iconv_close(cd); + } + ]]}, {configs = {languages = "c++14"}})) + end) + diff --git a/packages/c/cpptrace/xmake.lua b/packages/c/cpptrace/xmake.lua index 8ac1f3ecd..f2fea4f22 100644 --- a/packages/c/cpptrace/xmake.lua +++ b/packages/c/cpptrace/xmake.lua @@ -3,28 +3,58 @@ package("cpptrace") set_description("Lightweight, zero-configuration-required, and cross-platform stacktrace library for C++") set_license("MIT") - add_urls("https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/archive/$(version).tar.gz", + add_urls("https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/$(version).tar.gz", "https://github.com/jeremy-rifkin/cpptrace.git") - add_versions("v0.1", "411bf19e079b550c50e6d39c82e3cb8d4a7dd2e9a8107a8f1843929c4b4e63de") + add_versions("v0.6.0", "7c2996f03d15f61016bc81fe7fa5220b1cc42498333c5c0e699ad2f96b918b96") + add_versions("v0.5.4", "bab0f76330f90c445216ccade1a3ff29c9c4bbd44805be34d52095cd95b02df4") + add_versions("v0.5.2", "d148998e175b9c69ffb4383ab321a0d27487392e4eee3f39441d35b6856c8f78") + add_versions("v0.5.1", "27b9f862ec6185f570ee59c07fdd12bebb55a986191518e896621317d2654f26") + add_versions("v0.4.0", "eef368f5bed2d85c976ea90b325e4c9bfc1b9618cbbfa15bf088adc8fa98ff89") + add_versions("v0.3.1", "3c4c5b3406c2b598e5cd2a8cb97f9e8e1f54d6df087a0e62564e6fb68fed852d") + add_versions("v0.1", "244bdf092ba7b9493102b8bb926be4ab355c40d773d4f3ee2774ccb761eb1dda") + + add_patches("0.5.2", "https://github.com/jeremy-rifkin/cpptrace/commit/599d6abd6cc74e80e8429fc309247be5f7edd5d7.patch", "977e6c17400ff2f85362ca1d6959038fdb5d9e5b402cfdd705b422c566e8e87a") add_deps("cmake") if is_plat("windows") then add_syslinks("dbghelp") + elseif is_plat("linux", "macosx") then + add_deps("libdwarf") + elseif is_plat("mingw") then + add_deps("libdwarf") + add_syslinks("dbghelp") end - on_install("linux", "macosx", "windows", function (package) + on_install("linux", "macosx", "windows", "mingw", function (package) + io.replace("CMakeLists.txt", "/WX", "", {plain = true}) + local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + package:add("links", "cpptrace") + if not package:config("shared") then + package:add("defines", "CPPTRACE_STATIC_DEFINE") + end import("package.tools.cmake").install(package, configs) end) on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - void test() { - cpptrace::print_trace(); - } - ]]}, {configs = {languages = "c++11"}, includes = {"cpptrace/cpptrace.hpp"}})) + local code + if package:version():le("0.1") then + code = [[ + void test() { + cpptrace::print_trace(); + } + ]] + else + code = [[ + void test() { + cpptrace::generate_trace().print(); + } + ]] + end + + assert(package:check_cxxsnippets({test = code}, {configs = {languages = "c++11"}, includes = {"cpptrace/cpptrace.hpp"}})) end) diff --git a/packages/c/cpr/xmake.lua b/packages/c/cpr/xmake.lua index 551fd0a81..064c4d214 100644 --- a/packages/c/cpr/xmake.lua +++ b/packages/c/cpr/xmake.lua @@ -12,11 +12,12 @@ package("cpr") add_versions("1.9.4", "2fbb27716c010d8a28e52d5bc8f108e0d073ca3b3f5a48a2696b0231ea5196d5") add_versions("1.10.2", "044e98079032f7abf69c4c82f90ee2b4e4a7d2f28245498a5201ad6e8d0b1d08") add_versions("1.10.3", "d7f2574bd9dae8adb0ce6cf1afab119b509c297fffcb4204a1bb3e4e731074f2") + add_versions("1.10.5", "c8590568996cea918d7cf7ec6845d954b9b95ab2c4980b365f582a665dea08d8") add_configs("ssl", {description = "Enable SSL.", default = false, type = "boolean"}) add_deps("cmake") - if is_plat("mingw") then + if is_plat("mingw", "linux") then add_syslinks("pthread") end add_links("cpr") diff --git a/packages/c/cpuinfo/clog.lua b/packages/c/cpuinfo/clog.lua new file mode 100644 index 000000000..846521ebf --- /dev/null +++ b/packages/c/cpuinfo/clog.lua @@ -0,0 +1,10 @@ +function main(package) + os.cd("deps/clog") + local configs = {"-DCLOG_BUILD_TESTS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DCLOG_RUNTIME_TYPE=" .. (package:config("shared") and "shared" or "static")) + if package:config("shared") and package:is_plat("windows") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end + import("package.tools.cmake").install(package, configs) +end diff --git a/packages/c/cpuinfo/xmake.lua b/packages/c/cpuinfo/xmake.lua index e1cffad4b..4d253fe11 100644 --- a/packages/c/cpuinfo/xmake.lua +++ b/packages/c/cpuinfo/xmake.lua @@ -10,6 +10,7 @@ package("cpuinfo") if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end + add_configs("clog", {description = "Build clog library.", default = false, type = "boolean"}) add_deps("cmake") if is_plat("windows") then @@ -18,7 +19,18 @@ package("cpuinfo") add_syslinks("pthread") end - on_install("windows", "linux", "macosx", "bsd", "android", function (package) + on_check("windows", function (package) + import("core.tool.toolchain") + import("core.base.semver") + + local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + if msvc and package:is_arch("arm.*") then + local vs_sdkver = msvc:config("vs_sdkver") + assert(vs_sdkver and semver.match(vs_sdkver):gt("10.0.19041"), "package(cpuinfo): need vs_sdkver > 10.0.19041.0") + end + end) + + on_install("!cross", function (package) local configs = {"-DCPUINFO_BUILD_TOOLS=OFF", "-DCPUINFO_BUILD_UNIT_TESTS=OFF", "-DCPUINFO_BUILD_MOCK_TESTS=OFF", @@ -26,6 +38,15 @@ package("cpuinfo") "-DCPUINFO_BUILD_PKG_CONFIG=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DCPUINFO_LIBRARY_TYPE=" .. (package:config("shared") and "shared" or "static")) + + if package:is_plat("mingw") then + table.insert(configs, "-DCMAKE_SYSTEM_PROCESSOR=Windows") + end + if (package:is_cross() or package:is_plat("mingw")) and (not package:is_plat("android")) then + io.replace("CMakeLists.txt", [[SET(CPUINFO_TARGET_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")]], "", {plain = true}) + table.insert(configs, "-DCPUINFO_TARGET_PROCESSOR=" .. package:arch()) + end + if package:is_plat("windows") then table.insert(configs, "-DCPUINFO_RUNTIME_TYPE=" .. (package:config("vs_runtime"):startswith("MT") and "static" or "shared")) local vs_sdkver = import("core.tool.toolchain").load("msvc"):config("vs_sdkver") @@ -37,6 +58,10 @@ package("cpuinfo") end end import("package.tools.cmake").install(package, configs) + + if package:config("clog") then + import("clog")(package) + end end) on_test(function (package) @@ -47,4 +72,8 @@ package("cpuinfo") std::cout << "Running on CPU " << cpuinfo_get_package(0)->name; } ]]}, {configs = {languages = "c++11"}, includes = "cpuinfo.h"})) + + if package:config("clog") then + assert(package:has_cfuncs("clog_vlog_info", {includes = "clog.h"})) + end end) diff --git a/packages/c/crashpad/xmake.lua b/packages/c/crashpad/xmake.lua index a6068d0e3..8a1652c62 100644 --- a/packages/c/crashpad/xmake.lua +++ b/packages/c/crashpad/xmake.lua @@ -1,37 +1,35 @@ package("crashpad") set_homepage("https://chromium.googlesource.com/crashpad/crashpad/+/refs/heads/main/README.md") set_description("Crashpad is a crash-reporting system.") + set_license("Apache-2.0") - if is_host("windows") then - - local map = { - ["2021.8.1"] = "stable", - ["2022.4.16"] = "latest" - } - - function map_version(version) - return map[tostring(version)] - end - - if is_arch("x64", "x86_64") then - set_urls("http://get.backtrace.io/crashpad/builds/crashpad-release-x86-64-$(version).zip", {version = map_version}) - add_versions("2021.8.1", "b3facf8a802dfd12daf4d9fba416f4d4b5df0ae544afa14080662fa978aa18cb") - add_versions("2022.4.16", "7705073dfff89c376303cacea3a6f8c63322f77566ad5cdbe37060cf3cef9f8b") - else - set_urls("http://get.backtrace.io/crashpad/builds/crashpad-release-x86-$(version).zip", {version = map_version}) - add_versions("2021.8.1", "699fdf741f39da1c68069820ce891b6eb8b48ef29ab399fc1bcf210b67ff8547") - add_versions("2022.4.16", "c3bffb64d1087198946739dfb30d24b2355e49ddfe90d8e2a75ed373ed6e3377") - end - end + add_urls("https://github.com/getsentry/crashpad.git") + add_versions("2024.04.15", "96e301b7d6b81990a244d7de41a0d36eeb60899e") + + add_includedirs("include/crashpad", "include/crashpad/mini_chromium") + add_links("crashpad_client", "crashpad_util", "mini_chromium") - add_includedirs("include", "include/mini_chromium") + add_deps("cmake") + add_deps("libcurl") - on_install("windows", function (package) - os.cp("include/*", package:installdir("include")) - os.cp("bin/crashpad_handler.exe", package:installdir("bin")) - if package:config("shared") then - os.cp("lib_md/*", package:installdir("lib")) - else - os.cp("lib_mt/*", package:installdir("lib")) + on_install("linux", "windows|x64", "windows|x86", function(package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs, {packagedeps = "libcurl"}) + package:addenv("PATH", "bin") + end) + + on_test(function(package) + if not package:is_cross() then + os.vrun("crashpad_handler --help") end - end) + + assert(package:check_cxxsnippets({test = [[ + #include "client/crashpad_client.h" + using namespace crashpad; + void test() { + CrashpadClient *client = new CrashpadClient(); + } + ]]}, {configs = {languages = "cxx17"}})) + end) diff --git a/packages/c/croaring/xmake.lua b/packages/c/croaring/xmake.lua new file mode 100644 index 000000000..126e38c51 --- /dev/null +++ b/packages/c/croaring/xmake.lua @@ -0,0 +1,64 @@ +package("croaring") + set_homepage("http://roaringbitmap.org/") + set_description("Roaring bitmaps in C (and C++), with SIMD (AVX2, AVX-512 and NEON) optimizations: used by Apache Doris, ClickHouse, and StarRocks") + set_license("Apache-2.0") + + add_urls("https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/$(version).tar.gz", + "https://github.com/RoaringBitmap/CRoaring.git") + + add_versions("v4.0.0", "a8b98db3800cd10979561a1388e4e970886a24015bd6cfabb08ba7917f541b0d") + add_versions("v3.0.1", "a1cac9489b1c806c5594073e5db36475e247604282a47b650f4166c185ab061f") + add_versions("v2.0.4", "3c962c196ba28abf2639067f2e2fd25879744ba98152a4e0e74556ca515eda33") + + add_configs("exceptions", {description = "Enable exception-throwing interface", default = false, type = "boolean"}) + add_configs("x64", {description = "Enable x64 optimizations even if hardware supports it (this disables AVX)", default = false, type = "boolean"}) + add_configs("avx", {description = "Enable AVX even if hardware supports it", default = false, type = "boolean"}) + add_configs("neon", {description = "Enable NEON even if hardware supports it", default = false, type = "boolean"}) + add_configs("avx512", {description = "Enable AVX512 even if compiler supports it", default = false, type = "boolean"}) + add_configs("c_as_cpp", {description = "Build library C files using C++ compilation", default = false, type = "boolean"}) + + add_deps("cmake") + + on_install(function (package) + if package:is_plat("bsd") then + -- https://man.freebsd.org/cgi/man.cgi?query=bswap64 + io.replace("include/roaring/portability.h", "byteswap.h", "sys/endian.h", {plain = true}) + end + + local configs = {"-DBUILD_TESTING=OFF", "-DENABLE_ROARING_TESTS=OFF", "-DROARING_USE_CPM=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DROARING_BUILD_LTO=" .. (package:config("lto") and "ON" or "OFF")) + table.insert(configs, "-DROARING_SANITIZE=" .. (package:config("asan") and "ON" or "OFF")) + table.insert(configs, "-DROARING_BUILD_C_AS_CPP=" .. (package:config("c_as_cpp") and "ON" or "OFF")) + table.insert(configs, "-DROARING_EXCEPTIONS=" .. (package:config("exceptions") and "ON" or "OFF")) + if package:config("x64") then + table.insert(configs, "-DROARING_DISABLE_X64=OFF") + else + package:add("defines", "ROARING_DISABLE_X64=1") + table.insert(configs, "-DROARING_DISABLE_X64=ON") + end + if package:config("avx") then + table.insert(configs, "-DROARING_DISABLE_AVX=OFF") + else + package:add("defines", "ROARING_DISABLE_AVX=1") + table.insert(configs, "-DROARING_DISABLE_AVX=ON") + end + if package:config("neon") then + table.insert(configs, "-DROARING_DISABLE_NEON=OFF") + else + package:add("defines", "DISABLENEON=1") + table.insert(configs, "-DROARING_DISABLE_NEON=ON") + end + if package:config("avx512") then + table.insert(configs, "-DROARING_DISABLE_AVX512=OFF") + else + package:add("defines", "CROARING_COMPILER_SUPPORTS_AVX512=0") + table.insert(configs, "-DROARING_DISABLE_AVX512=ON") + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("roaring_bitmap_create", {includes = "roaring/roaring.h"})) + end) diff --git a/packages/c/crow/xmake.lua b/packages/c/crow/xmake.lua index 117ee5236..f710b9e4a 100644 --- a/packages/c/crow/xmake.lua +++ b/packages/c/crow/xmake.lua @@ -6,6 +6,7 @@ package("crow") set_urls("https://github.com/CrowCpp/Crow.git") add_versions("2023.06.26", "13a91a1941fbabfc289dddcdeab08b80193f7c6c") + add_versions("2023.07.22", "4f3f5deaaa01825c63c83431bfa96ccec195f741") add_configs("zlib", {description = "ZLib for HTTP Compression", default = true, type = "boolean"}) add_configs("ssl", {description = "OpenSSL for HTTPS support", default = true, type = "boolean"}) diff --git a/packages/c/cryptopp/xmake.lua b/packages/c/cryptopp/xmake.lua index 5cb365bd8..8242f877d 100644 --- a/packages/c/cryptopp/xmake.lua +++ b/packages/c/cryptopp/xmake.lua @@ -4,11 +4,13 @@ package("cryptopp") set_description("free C++ class library of cryptographic schemes") add_urls("https://github.com/weidai11/cryptopp/archive/CRYPTOPP_$(version).tar.gz", {version = function (version) return version:gsub("%.", "_") end}) + add_versions("8.9.0", "ab5174b9b5c6236588e15a1aa1aaecb6658cdbe09501c7981ac8db276a24d9ab") add_versions("8.7.0", "8d6a4064b8e9f34cd3e838f5a12c40067ee7b95ee37d9173ec273cb0913e7ca2") add_versions("8.6.0", "9304625f4767a13e0a5f26d0f019d78cf9375604a33e5391c3bf2e81399dfeb8") add_versions("8.5.0", "8f64cf09cf4f61d5d74bca53574b8cc9959186cc0f072a2e6597e4999d6ad5db") add_versions("8.4.0", "6687dfc1e33b084aeab48c35a8550b239ee5f73a099a3b6a0918d70b8a89e654") - + + add_resources("8.9.0", "cryptopp_cmake", "https://github.com/abdes/cryptopp-cmake/archive/CRYPTOPP_8_9_0.tar.gz", "191d69061c56602de1610ebf03b44dcf75636006e7e60ef8105bee6472ec0caf") add_resources("8.7.0", "cryptopp_cmake", "https://github.com/abdes/cryptopp-cmake/archive/CRYPTOPP_8_7_0_1.tar.gz", "49800456bec6432eff4a798d37f6c7760b887adc9f8928e66f44bcb8bf81f157") add_resources("8.6.0", "cryptopp_cmake", "https://github.com/noloader/cryptopp-cmake/archive/CRYPTOPP_8_6_0.tar.gz", "970b20d55dbf9d6335485e72c9f8967d878bf64bbd3de6aa28436beb6799c493") add_resources("8.5.0", "cryptopp_cmake", "https://github.com/noloader/cryptopp-cmake/archive/CRYPTOPP_8_5_0.tar.gz", "10685209405e676993873fcf638ade5f8f99d7949afa6b2045289ce9cc6d90ac") diff --git a/packages/c/cs_libguarded/xmake.lua b/packages/c/cs_libguarded/xmake.lua new file mode 100644 index 000000000..d06415d64 --- /dev/null +++ b/packages/c/cs_libguarded/xmake.lua @@ -0,0 +1,23 @@ +package("cs_libguarded") + set_kind("library", {headeronly = true}) + set_homepage("https://www.copperspice.com/") + set_description("Header-only library for multithreaded programming") + set_license("BSD-2-Clause") + + add_urls("https://github.com/copperspice/cs_libguarded.git") + add_versions("2023.08.02", "1940568f8f21c2ef3d57551682dfc038772df6f6") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package, {"-DCMAKE_INSTALL_INCLUDEDIR=include"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + libguarded::cow_guarded data(0); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/c/csvparser/xmake.lua b/packages/c/csvparser/xmake.lua index e5ba66abf..a6b41c48f 100644 --- a/packages/c/csvparser/xmake.lua +++ b/packages/c/csvparser/xmake.lua @@ -4,6 +4,9 @@ package("csvparser") set_description("A modern C++ library for reading, writing, and analyzing CSV (and similar) files (by vincentlaucsb)") add_urls("https://github.com/vincentlaucsb/csv-parser/archive/refs/tags/$(version).zip") + add_versions("2.2.2", "e8fb8693680f2a0931ef28cb67a1ea007123201c74073fc588c18f5151e29cfd") + add_versions("2.2.1", "96fd6a468f56fc157a11fcbc5cece6da952b06190837c46465d091eff674a813") + add_versions("2.2.0", "b7744b28f3ac5f92c17379f323733cb8872ea48ef2347842604dc54285d60640") add_versions("2.1.1", "5fb6fc1c32196fb8cda144f192964b5bbedf61da9015d6c0edb8cb39b0dacff8") on_install(function (package) diff --git a/packages/c/cthash/xmake.lua b/packages/c/cthash/xmake.lua new file mode 100644 index 000000000..61ceb5de6 --- /dev/null +++ b/packages/c/cthash/xmake.lua @@ -0,0 +1,23 @@ +package("cthash") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/hanickadot/cthash") + set_description("constexpr implementation of SHA-2 and SHA-3 family of hashes") + set_license("Apache-2.0") + + add_urls("https://github.com/hanickadot/cthash.git") + add_versions("2023.10.24", "21d581e0a6bd7040c282af1e43faab9d44f47744") + + on_install("linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", "cross", "wasm", function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + using namespace cthash::literals; + void test() { + constexpr auto my_hash = cthash::simple("hello there!"); + static_assert(my_hash == "c7fd85f649fba4bd6fb605038ae8530cf2239152bbbcb9d91d260cc2a90a9fea"_sha3_256); + } + ]]}, {configs = {languages = "c++20"}})) + end) diff --git a/packages/c/ctre/xmake.lua b/packages/c/ctre/xmake.lua index 4c2aa93f9..96395e9a6 100644 --- a/packages/c/ctre/xmake.lua +++ b/packages/c/ctre/xmake.lua @@ -5,6 +5,11 @@ package("ctre") set_urls("https://github.com/hanickadot/compile-time-regular-expressions/archive/refs/tags/v$(version).zip") add_versions("3.4.1", "099d6503cddd8e086b71247321ac64d91976136aa727d0de3ad5f9fd1897c5c7") + add_versions("3.5", "335180eaa44d60cec0fec445bafad78509f03c6e8a8bd9d24591d4d38333f78d") + add_versions("3.6", "f99f9c8bd3154d76305ef4fbde2c6622ed309c5a3401168732048fbc31e93f5d") + add_versions("3.7.2", "1dbcd96d279b5be27e9c90d2952533db10bc0e5d8ff6224a3c6d538fd94ab18f") + add_versions("3.8.1", "7c7a936145defe56e886bac7731ea16a52de65d73bda2b56702d0d0a61101c76") + add_versions("3.9.0", "8d0c061faf6b41c6913cac39af1d8cc8272e693b442c32f4fa762b505490fb36") add_configs("header_only", {description = "Use header only version.", default = false, type = "boolean"}) @@ -25,17 +30,16 @@ package("ctre") on_test(function (package) assert(package:check_cxxsnippets({test = [[ - #include - #include - #include - #include - + #include + #include + #include + #include static void test() { std::string str = "Hello World"; - static constexpr auto pattern = ctll::fixed_string{ R"(\s+)" }; - for(auto e: ctre::split(str)) { + static constexpr auto pattern = ctll::fixed_string{R"(\s+)"}; + for (auto e : ctre::split(str)) { std::cout << std::string(e.get<0>()) << std::endl; } } ]]}, {configs = {languages = "c++20"}, includes = "ctre.hpp"})) - end) \ No newline at end of file + end) diff --git a/packages/c/ctrl-c/xmake.lua b/packages/c/ctrl-c/xmake.lua new file mode 100644 index 000000000..996d647e2 --- /dev/null +++ b/packages/c/ctrl-c/xmake.lua @@ -0,0 +1,43 @@ +package("ctrl-c") + set_homepage("https://github.com/evgenykislov/ctrl-c") + set_description("Crossplatform code to handle Ctrl+C signal") + set_license("MIT") + + add_urls("https://github.com/evgenykislov/ctrl-c.git") + add_versions("2023.09.02", "98b39d689ecb1a7193a3647c9a7d58a521892f9b") + + on_install("windows", "macosx", "linux", "mingw", "android", "msys", "iphoneos", "cross", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + target("ctrl-c") + set_kind("$(kind)") + add_headerfiles("src/(ctrl-c.h)") + add_files("src/ctrl-c.cpp") + set_languages("c++11") + if is_plat("windows") then + add_defines("_WIN32") + end + if is_plat("linux") then + add_defines("__linux__") + end + if is_plat("macosx") then + add_defines("__APPLE__") + end + ]]) + local configs = {} + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + + void test() { + std::function _exit = [](CtrlCLibrary::CtrlSignal signal) -> bool + { + return true; + }; + CtrlCLibrary::SetCtrlCHandler(_exit); + } + ]]}, {configs = {languages = "cxx11"}})) + end) diff --git a/packages/c/cuda-samples/xmake.lua b/packages/c/cuda-samples/xmake.lua new file mode 100644 index 000000000..06383bd79 --- /dev/null +++ b/packages/c/cuda-samples/xmake.lua @@ -0,0 +1,35 @@ +package("cuda-samples") + + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/NVIDIA/cuda-samples") + set_description("CUDA Sample Utility Code") + set_license("BSD-3-Clause") + + add_urls("https://github.com/NVIDIA/cuda-samples/archive/refs/tags/$(version).tar.gz", + "https://github.com/NVIDIA/cuda-samples.git") + add_versions("v12.4.1", "01bb311cc8f802a0d243700e4abe6a2d402132c9d97ecf2c64f3fbb1006c304c") + add_versions("v11.8", "1bc02c0ca42a323f3c7a05b5682eae703681a91e95b135bfe81f848b2d6a2c51") + add_versions("v12.3", "a40e4d3970185f38477dd8b5bdbd81642b04648d8b812af914333b8f83355efe") + + on_fetch(function (package, opt) + if opt.system and package:is_plat("windows") then + import("lib.detect.find_path") + local paths = { + "C:\\ProgramData\\NVIDIA Corporation\\CUDA Samples\\v*\\common" + } + local headerpath = find_path("helper_cuda.h", paths, {suffixes = {"inc"}}) + if headerpath then + vprint("CUDA Samples Found: " .. path.directory(headerpath)) + return {includedirs = {headerpath}} + end + end + end) + + add_includedirs("include/Common") + on_install(function (package) + os.cp("Common", package:installdir("include")) + end) + + on_test(function (package) + assert(os.isfile(path.join(package:installdir("include"), "Common", "helper_cuda.h"))) + end) diff --git a/packages/c/curl/xmake.lua b/packages/c/curl/xmake.lua new file mode 100644 index 000000000..e49b56d59 --- /dev/null +++ b/packages/c/curl/xmake.lua @@ -0,0 +1,17 @@ +package("curl") + set_kind("binary") + set_base("libcurl") + + on_load(function (package) + package:base():plat_set(package:plat()) + package:base():arch_set(package:arch()) + package:base():script("load")(package) + end) + + on_install("@windows", "@macosx", "@linux", function (package) + package:base():script("install")(package) + end) + + on_test(function (package) + os.vrun("curl --version") + end) diff --git a/packages/c/curlcpp/xmake.lua b/packages/c/curlcpp/xmake.lua new file mode 100644 index 000000000..75135eebe --- /dev/null +++ b/packages/c/curlcpp/xmake.lua @@ -0,0 +1,45 @@ +package("curlcpp") + set_homepage("https://josephp91.github.io/curlcpp") + set_description("An object oriented C++ wrapper for CURL (libcurl)") + set_license("MIT") + + add_urls("https://github.com/JosephP91/curlcpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/JosephP91/curlcpp.git") + + add_versions("3.1", "ba7aeed9fde9e5081936fbe08f7a584e452f9ac1199e5fabffbb3cfc95e85f4b") + + if is_plat("macosx") then + add_extsources("brew::curlcpp") + end + + add_deps("libcurl >=7.34.0") + + on_install("windows", "linux", "macosx", "cross", function (package) + io.writefile("xmake.lua", [[ + add_requires("libcurl >=7.34.0") + add_rules("mode.debug", "mode.release") + set_languages("c++11") + target("curlcpp") + set_kind("$(kind)") + add_files("src/*.cpp") + add_includedirs("include") + add_headerfiles("include/*.h", {prefixdir = "curlcpp"}) + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + add_packages("libcurl") + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + using curl::curl_easy; + void test() { + curl_easy easy; + easy.add("http://"); + easy.add(1L); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/c/curlpp/xmake.lua b/packages/c/curlpp/xmake.lua new file mode 100644 index 000000000..c7ad6be1a --- /dev/null +++ b/packages/c/curlpp/xmake.lua @@ -0,0 +1,38 @@ +package("curlpp") + set_homepage("http://www.curlpp.org") + set_description("C++ wrapper around libcURL") + set_license("MIT") + + add_urls("https://github.com/jpbarrette/curlpp.git") + add_versions("2023.07.27", "1d8c7876cc81d7d125b663066282b207d9cbfe9a") + + add_deps("libcurl") + + on_install("windows", "linux", "macosx", "mingw", "cross", function (package) + io.writefile("xmake.lua", ([[ + set_languages("c++11") + add_rules("mode.debug", "mode.release") + add_requires("libcurl") + target("curlpp") + set_kind("$(kind)") + add_files("src/**.cpp") + add_includedirs("include/") + add_headerfiles("include/(**.hpp)", "include/(**.inl)") + add_packages("libcurl") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + ]])) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + int main() { + curlpp::Cleanup cleaner; + curlpp::Easy request; + request.setOpt("https://example.com"); + } + ]]}, { configs = {languages = "c++11"}, includes = {"curlpp/cURLpp.hpp", "curlpp/Easy.hpp", "curlpp/Options.hpp"} + })) + end) diff --git a/packages/c/cutlass/xmake.lua b/packages/c/cutlass/xmake.lua new file mode 100644 index 000000000..fee32bc04 --- /dev/null +++ b/packages/c/cutlass/xmake.lua @@ -0,0 +1,23 @@ +package("cutlass") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/NVIDIA/cutlass") + set_description("CUDA Templates for Linear Algebra Subroutines") + + add_urls("https://github.com/NVIDIA/cutlass/archive/refs/tags/$(version).tar.gz", + "https://github.com/NVIDIA/cutlass.git") + + add_versions("v3.5.0", "ef6af8526e3ad04f9827f35ee57eec555d09447f70a0ad0cf684a2e426ccbcb6") + add_versions("v3.4.1", "aebd4f9088bdf2fd640d65835de30788a6c7d3615532fcbdbc626ec3754becd4") + add_versions("v3.2.0", "9637961560a9d63a6bb3f407faf457c7dbc4246d3afb54ac7dc1e014dd7f172f") + + on_install(function (package) + local source = os.dirs("cutlass*") + if source and #source ~= 0 then + os.cd(source[1]) + end + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:has_cxxincludes("cutlass/cutlass.h", {configs = {languages = "c++17"}})) + end) diff --git a/packages/c/cxxgraph/xmake.lua b/packages/c/cxxgraph/xmake.lua new file mode 100644 index 000000000..b5e81eed9 --- /dev/null +++ b/packages/c/cxxgraph/xmake.lua @@ -0,0 +1,30 @@ +package("cxxgraph") + set_kind("library", {headeronly = true}) + set_homepage("https://zigrazor.github.io/CXXGraph") + set_description("Header-Only C++ Library for Graph Representation and Algorithms") + set_license("AGPL-3.0") + + add_urls("https://github.com/ZigRazor/CXXGraph/archive/refs/tags/$(version).tar.gz", + "https://github.com/ZigRazor/CXXGraph.git") + + add_versions("v3.1.0", "54838d0d35a6f2685cf45e50e888146aef3c1a10fbbdddb939b3985c7953087a") + + if on_check then + on_check("windows", function (package) + import("core.tool.toolchain") + + local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + if msvc then + local vs = msvc:config("vs") + assert(vs and tonumber(vs) >= 2022, "package(cxxgraph): need vs >= 2022") + end + end) + end + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:has_cxxtypes("CXXGraph::Graph", {configs = {languages = "c++20"}, includes = {"algorithm", "CXXGraph/CXXGraph.hpp"}})) + end) diff --git a/packages/c/cxxopts/xmake.lua b/packages/c/cxxopts/xmake.lua index 34f6ee416..e1cb2ba60 100644 --- a/packages/c/cxxopts/xmake.lua +++ b/packages/c/cxxopts/xmake.lua @@ -7,6 +7,8 @@ package("cxxopts") add_urls("https://github.com/jarro2783/cxxopts.git") add_urls("https://github.com/jarro2783/cxxopts/archive/$(version).tar.gz") + add_versions("v3.2.1", "841f49f2e045b9c6365997c2a8fbf76e6f215042dda4511a5bb04bc5ebc7f88a") + add_versions("v3.2.0", "9f43fa972532e5df6c5fd5ad0f5bac606cdec541ccaf1732463d8070bbb7f03b") add_versions("v3.1.1", "523175f792eb0ff04f9e653c90746c12655f10cb70f1d5e6d6d9491420298a08") add_versions("v3.0.0", "36f41fa2a46b3c1466613b63f3fa73dc24d912bc90d667147f1e43215a8c6d00") add_versions("v2.2.0", "447dbfc2361fce9742c5d1c9cfb25731c977b405f9085a738fbd608626da8a4d") @@ -35,6 +37,5 @@ package("cxxopts") ("f,file", "File name", cxxopts::value()) ("v,verbose", "Verbose output", cxxopts::value()->default_value("false")); } - ]]}, {configs = {languages = "c++11"}, includes = "cxxopts.hpp"})) + ]]}, {configs = {languages = "c++14"}, includes = "cxxopts.hpp"})) end) - diff --git a/packages/d/daemonpp/xmake.lua b/packages/d/daemonpp/xmake.lua new file mode 100644 index 000000000..dcd5e161f --- /dev/null +++ b/packages/d/daemonpp/xmake.lua @@ -0,0 +1,43 @@ +package("daemonpp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/baderouaich/daemonpp") + set_description("Simple C++ header only template for creating Linux daemons") + set_license("MIT") + + add_urls("https://github.com/baderouaich/daemonpp.git") + add_versions("2023.05.01", "0989a8296e1f8b4075db7deb0c3474a5d3780954") + + on_install("linux", function (package) + os.cp("include/*", package:installdir("include/daemonpp")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + + using namespace daemonpp; + + class my_daemon : public daemon + { + public: + void on_start(const dconfig& cfg) override { + } + void on_update() override { + } + void on_stop() override { + } + void on_reload(const dconfig& cfg) override { + } + }; + + int test(int argc, const char* argv[]) { + my_daemon dmn; + dmn.set_name("my_daemon"); + dmn.set_update_duration(std::chrono::seconds(3)); + dmn.set_cwd("/"); + dmn.run(argc, argv); + return 0; + } + ]]}, {configs = {languages = "cxx11"}})) + end) diff --git a/packages/d/dataframe/xmake.lua b/packages/d/dataframe/xmake.lua index 08d658b01..a9da40056 100644 --- a/packages/d/dataframe/xmake.lua +++ b/packages/d/dataframe/xmake.lua @@ -1,37 +1,38 @@ -package("dataframe") - set_homepage("https://github.com/hosseinmoein/DataFrame") - set_description("This is a C++ analytical library that provides interface and functionality similar to packages/libraries in Python and R.") - set_license("MIT") - - add_urls("https://github.com/hosseinmoein/DataFrame/archive/refs/tags/$(version).tar.gz", - "https://github.com/hosseinmoein/DataFrame.git") - - add_versions("1.21.0", "a6b07eaaf628225a34e4402c1a6e311430e8431455669ac03691d92f44081172") - add_versions("1.22.0", "4b244241cd56893fccb22f7c874588f0d86b444912382ed6e9a4cf95e55ffda2") - - add_deps("cmake") - - on_install("windows", "macosx", "linux", function (package) - local configs = {} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) - end) - - on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - #include - #include - #include - #include - #include - #include - using namespace hmdf; - using ULDataFrame = StdDataFrame; - void test() { - std::vector idx_col1 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; - ULDataFrame ul_df1; - ul_df1.load_index(std::move(idx_col1)); - } - ]]}, {configs = {languages = "c++17"}})) - end) +package("dataframe") + set_homepage("https://github.com/hosseinmoein/DataFrame") + set_description("This is a C++ analytical library that provides interface and functionality similar to packages/libraries in Python and R.") + set_license("MIT") + + add_urls("https://github.com/hosseinmoein/DataFrame/archive/refs/tags/$(version).tar.gz", + "https://github.com/hosseinmoein/DataFrame.git") + + add_versions("3.0.0", "9266fb85c518a251a5440e490c81615601791f2de2fad8755aa09f13a0c541f9") + add_versions("1.21.0", "a6b07eaaf628225a34e4402c1a6e311430e8431455669ac03691d92f44081172") + add_versions("1.22.0", "4b244241cd56893fccb22f7c874588f0d86b444912382ed6e9a4cf95e55ffda2") + + add_deps("cmake") + + on_install("windows", "macosx", "linux", function (package) + local configs = {"-DCMAKE_CXX_STANDARD=23"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include + #include + #include + #include + using namespace hmdf; + using ULDataFrame = StdDataFrame; + void test() { + std::vector idx_col1 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + ULDataFrame ul_df1; + ul_df1.load_index(std::move(idx_col1)); + } + ]]}, {configs = {languages = "c++23"}})) + end) diff --git a/packages/d/davix/xmake.lua b/packages/d/davix/xmake.lua new file mode 100644 index 000000000..9a3277410 --- /dev/null +++ b/packages/d/davix/xmake.lua @@ -0,0 +1,48 @@ +package("davix") + + set_homepage("https://davix.web.cern.ch/") + set_description("High-performance file management over WebDAV/HTTP") + set_license("LGPL-2.1") + + add_urls("https://github.com/cern-fts/davix/releases/download/R_$(version).tar.gz", {version = function (version) + return format("%s/davix-%s", version:gsub("%.", "_"), version) + end}) + add_urls("https://github.com/cern-fts/davix.git") + add_versions("0.8.5", "f9ce21bcc2ed248f7825059d17577876616258c35177d74fad8f854a818a87f9") + + add_deps("python 3.x", {kind = "binary"}) + add_deps("cmake", "openssl", "libcurl", "libxml2") + add_deps("util-linux", {configs = {libuuid = true}}) + add_includedirs("include/davix") + if is_plat("linux") then + add_syslinks("pthread") + end + on_install("macosx", "linux", function (package) + local configs = {"-DDAVIX_TESTS=OFF", "-DEMBEDDED_LIBCURL=OFF", "-DLIB_SUFFIX="} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DSHARED_LIBRARY=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DSTATIC_LIBRARY=" .. (package:config("shared") and "OFF" or "ON")) + local utlinux = package:dep("util-linux"):fetch() + if utlinux then + for _, dir in ipairs(utlinux.includedirs or utlinux.sysincludedirs) do + table.insert(configs, "-DUUID_INCLUDE_DIR=" .. dir) + break + end + for _, dir in ipairs(utlinux.linkdirs) do + table.insert(configs, "-DUUID_LIBRARY=" .. dir .. "/libuuid.a") + break + end + end + import("package.tools.cmake").install(package, configs, {packagedeps = "libcurl"}) + package:addenv("PATH", "bin") + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + Davix::Context context; + context.loadModule("grid"); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/d/daw_header_libraries/xmake.lua b/packages/d/daw_header_libraries/xmake.lua index bc2d29f50..c27a361ed 100644 --- a/packages/d/daw_header_libraries/xmake.lua +++ b/packages/d/daw_header_libraries/xmake.lua @@ -6,6 +6,8 @@ package("daw_header_libraries") add_urls("https://github.com/beached/header_libraries/archive/refs/tags/$(version).tar.gz", "https://github.com/beached/header_libraries.git") + add_versions("v2.106.0", "7838ada09afa69e7a42d742991c4b24b32ba27681e7b4dadf7b1e45c168937b5") + add_versions("v2.102.0", "bc80936b439da0ef8a432175732e94573b14069a778b83d5f26ce8847f11ebb8") add_versions("v2.96.1", "2a9a5c33baa9e3adc1d82fa13a56522638af13cc39372a0c1c8f5c5d984f1464") add_deps("cmake") diff --git a/packages/d/daw_json_link/xmake.lua b/packages/d/daw_json_link/xmake.lua new file mode 100644 index 000000000..b443ead0f --- /dev/null +++ b/packages/d/daw_json_link/xmake.lua @@ -0,0 +1,35 @@ +package("daw_json_link") + set_kind("library", {headeronly = true}) + set_homepage("https://beached.github.io/daw_json_link/") + set_description("Fast, convenient JSON serialization and parsing in C++") + set_license("BSL-1.0") + + add_urls("https://github.com/beached/daw_json_link/archive/refs/tags/$(version).tar.gz", + "https://github.com/beached/daw_json_link.git") + + add_versions("v3.24.0", "7cecb2acde88028043e343ed4da7cde84c565a38125d3edb90db90daf881240a") + add_versions("v3.23.2", "fd1234a14c126c79076e0b6e6eceae42afd465c419dc7a7393c69c28aa7f53d4") + add_versions("v3.20.1", "046638bc4437d138cc8bdc882027d318ca3e267f33d1b419c5bdecb45b595a47") + + add_deps("cmake") + + on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", "android@linux,macosx", "iphoneos", "cross", function (package) + if package:is_plat("android") then + import("core.tool.toolchain") + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndk_sdkver = ndk:config("ndk_sdkver") + assert(ndk_sdkver and tonumber(ndk_sdkver) > 21, "package(daw_json_link): need ndk api level > 21 for android") + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + std::string json_data = "[1, 2, 3, 4, 5]"; + auto const obj = daw::json::from_json_array(json_data); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/d/dbg-macro/xmake.lua b/packages/d/dbg-macro/xmake.lua index 719ba9b0b..43cc325f9 100644 --- a/packages/d/dbg-macro/xmake.lua +++ b/packages/d/dbg-macro/xmake.lua @@ -6,6 +6,7 @@ package("dbg-macro") add_urls("https://github.com/sharkdp/dbg-macro/archive/refs/tags/$(version).tar.gz", "https://github.com/sharkdp/dbg-macro.git") + add_versions("v0.5.1", "fffea75f067c69995853dc790626887788e2c4c9eb0a5a0014a4501d2b6b9909") add_versions("v0.4.0", "e44a1206fbfd1d3dc8ad649f387df479d288b08c80cf2f1239ccb4e26148d781") add_versions("v0.5.0", "dac4907aadf39dbd9eac279a214c59ad30af6c0c3d585688242f73cb1a9ce243") diff --git a/packages/d/depot_tools/xmake.lua b/packages/d/depot_tools/xmake.lua index 8ea5336ff..2a4d9f740 100644 --- a/packages/d/depot_tools/xmake.lua +++ b/packages/d/depot_tools/xmake.lua @@ -6,6 +6,10 @@ package("depot_tools") add_urls("https://github.com/xmake-mirror/depot_tools.git", "https://chromium.googlesource.com/chromium/tools/depot_tools.git") add_versions("2022.2.1", "8a6d00f116d6de9d5c4e92acb519fd0859c6449a") + add_versions("2024.2.29", "50de666ba40a4808daf9791fece3d8a43228a1de") + + -- we use external ninja instead of depot_tools/ninja which eating ram until VM exhaustion (16GB) + add_deps("ninja", {private = true, system = false}) on_load(function (package) package:addenv("PATH", ".") @@ -17,6 +21,10 @@ package("depot_tools") on_install("linux", "macosx", "windows", function (package) import("core.base.global") + local ninja = path.join(package:dep("ninja"):installdir("bin"), "ninja" .. (is_host("windows") and ".exe" or "")) + if ninja and os.isfile(ninja) then + os.trycp(ninja, os.curdir()) + end os.cp("*", package:installdir()) os.cd(package:installdir()) -- maybe we need set proxy, e.g. `xmake g --proxy=http://127.0.0.1:xxxx` @@ -28,11 +36,16 @@ package("depot_tools") envs.HTTPS_PROXY = proxy envs.ALL_PROXY = proxy end + envs.PATH = table.join(os.curdir(), path.splitenv(os.getenv("PATH"))) + -- skip to check and update obsolete URL + io.replace("./update_depot_tools", + 'CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools.git"', + 'CANONICAL_GIT_URL="https://github.com/xmake-mirror/depot_tools.git"', {plain = true}) -- we need fetch some files when running gclient for the first time if is_host("windows") then os.vrunv("gclient.bat", {"--verbose"}, {envs = envs}) else - os.vrunv("sh", {"./gclient", "--verbose"}, {envs = envs}) + os.vrunv("./gclient", {"--verbose"}, {shell = true, envs = envs}) end end) diff --git a/packages/d/dfdutils/xmake.lua b/packages/d/dfdutils/xmake.lua new file mode 100644 index 000000000..bd403c548 --- /dev/null +++ b/packages/d/dfdutils/xmake.lua @@ -0,0 +1,30 @@ +package("dfdutils") + set_homepage("https://github.com/KhronosGroup/dfdutils") + set_description("Utilities for working with Khronos data format descriptors") + set_license("Apache-2.0") + + add_urls("https://github.com/KhronosGroup/dfdutils.git") + add_versions("2023.10.27", "854792a6ced4cb7cce64f26bf297bf7ea294a9b6") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("dfdutils") + set_kind("$(kind)") + add_files( + "createdfd.c", "colourspaces.c", "interpretdfd.c", + "printdfd.c", "queries.c", "vk2dfd.c" + ) + add_headerfiles("dfd.h", {prefixdir = "dfdutils"}) + add_headerfiles("(vulkan/*.h)", "(KHR/*.h)") + add_includedirs(".", "KHR") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("vk2dfd", {includes = "dfdutils/dfd.h"})) + end) diff --git a/packages/d/digestpp/xmake.lua b/packages/d/digestpp/xmake.lua new file mode 100644 index 000000000..c2086a470 --- /dev/null +++ b/packages/d/digestpp/xmake.lua @@ -0,0 +1,22 @@ +package("digestpp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/kerukuro/digestpp") + set_description("C++11 header-only message digest library") + set_license("MIT") + + add_urls("https://github.com/kerukuro/digestpp.git") + add_versions("2023.11.8", "ebb699402c244e22c3aff61d2239bcb2e87b8ef8") + + on_install(function (package) + os.cp("*", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include "digestpp.hpp" + void test() { + std::cout << digestpp::blake2b().absorb("The quick brown fox jumps over the lazy dog").hexdigest(); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/d/directx-headers/xmake.lua b/packages/d/directx-headers/xmake.lua index 509b66a16..234f9f3a3 100644 --- a/packages/d/directx-headers/xmake.lua +++ b/packages/d/directx-headers/xmake.lua @@ -6,6 +6,9 @@ package("directx-headers") add_urls("https://github.com/microsoft/DirectX-Headers/archive/refs/tags/$(version).zip", "https://github.com/microsoft/DirectX-Headers.git") + add_versions("v1.614.0", "9305df61de9916cc206b3b466fcb0afa4312664ef512f93939242adcfa029554") + add_versions("v1.613.1", "c356d242e63f6c8e6fa8dec01f7d526b172621f0f6687611239f772095842e4c") + add_versions("v1.613.0", "38852327d998e54d9faac93be28c1f8b6489442832eb380004e2fecedd907eef") add_versions("v1.610.0", "ce8036d57e4b3b87167bf82a0236fc09cba4ffa7088322912b8ce82f284555db") add_patches("1.610.0", path.join(os.scriptdir(), "patches", "1.610.0", "mingw.patch"), "7409d90adb1513e8683cc6d16aba1a3e73643c3e04b9af70474a5b13323be0fb") diff --git a/packages/d/directxmath/xmake.lua b/packages/d/directxmath/xmake.lua index aa4a8d2c8..a21ef7c42 100644 --- a/packages/d/directxmath/xmake.lua +++ b/packages/d/directxmath/xmake.lua @@ -7,13 +7,15 @@ package("directxmath") local tag = { ["2022.12"] = "dec2022", + ["2024.02"] = "feb2024" } add_urls("https://github.com/microsoft/DirectXMath/archive/refs/tags/$(version).zip", {version = function (version) return tag[tostring(version)] end}) add_urls("https://github.com/microsoft/DirectXMath.git") add_versions("2022.12", "2ed0ae7d7fe5d11ad11f6d3d9b31ce686024a551cf82ade723de86aa7b4b57e1") + add_versions("2024.02", "214d71420107249dfb4bbc37a573f288b0951cc9ffe323dbf662101f3df4d766") if is_plat("linux") then - add_resources("2022.12", "headers", "https://raw.githubusercontent.com/dotnet/runtime/2201016c1e13bdb9abf49e2e38cadf4ee0568df2/src/coreclr/pal/inc/rt/sal.h", "7dae281adc3a09a691291fb90526f05e4f9ef8b16d7f33d716ba690f7241a492") + add_resources(">=2022.12", "headers", "https://raw.githubusercontent.com/dotnet/runtime/2201016c1e13bdb9abf49e2e38cadf4ee0568df2/src/coreclr/pal/inc/rt/sal.h", "7dae281adc3a09a691291fb90526f05e4f9ef8b16d7f33d716ba690f7241a492") end add_deps("cmake") diff --git a/packages/d/directxshadercompiler/xmake.lua b/packages/d/directxshadercompiler/xmake.lua index 571d515e7..0c8fcc7b3 100644 --- a/packages/d/directxshadercompiler/xmake.lua +++ b/packages/d/directxshadercompiler/xmake.lua @@ -7,16 +7,19 @@ package("directxshadercompiler") local date = {["1.5.2010"] = "2020_10-22", ["1.6.2104"] = "2021_04-20", ["1.6.2106"] = "2021_07_01", - ["1.7.2212"] = "2022_12_16"} + ["1.7.2212"] = "2022_12_16", + ["1.8.2403"] = "2024_03_07"} if is_plat("windows") then add_urls("https://github.com/microsoft/DirectXShaderCompiler/releases/download/v$(version).zip", {version = function (version) return version .. "/dxc_" .. date[tostring(version)] end}) add_versions("1.5.2010", "b691f63778f470ebeb94874426779b2f60685fc8711adf1b1f9f01535d9b67f8") add_versions("1.6.2104", "ee5e96d58134957443ded04be132e2e19240c534d7602e3ab8fd5adc5156014a") add_versions("1.6.2106", "053b2d90c227cae84e7ce636bc4f7c25acd224c31c11a324885acbf5dd8b7aac") add_versions("1.7.2212", "ed77c7775fcf1e117bec8b5bb4de6735af101b733d3920dda083496dceef130f") + add_versions("1.8.2403", "7a916a49b3ca81d803ca1bcd1ae859e7f317ce2fcf875bd34147aa2c57d1e392") elseif is_plat("linux") and is_arch("x86_64") then add_urls("https://github.com/microsoft/DirectXShaderCompiler.git") add_versions("v1.7.2212", "f2643f8699299ab4e77421952e9c24f7483b46896d9f4cc6b4790b22c90d2ff0") + add_versions("v1.8.2403", "4211ea2cffc3575cf58556ebbc31c64adb73b1b8f68e47456c2048b60de4a24c") add_patches("v1.7.2212", path.join(os.scriptdir(), "patches", "disable_go_bindings.patch"), "2337f4f94d4c27c3caf0e6b0f00efd1bee719f79c0bb3b0d7e74c2859546c73a") diff --git a/packages/d/directxtk/xmake.lua b/packages/d/directxtk/xmake.lua index 53e090e7f..eb023a3f4 100644 --- a/packages/d/directxtk/xmake.lua +++ b/packages/d/directxtk/xmake.lua @@ -9,13 +9,15 @@ package("directxtk") local versions = { ["20.9.0"] = "sept2020", ["21.4.0"] = "apr2021", - ["21.11.0"] = "nov2021" + ["21.11.0"] = "nov2021", + ["24.2.0"] = "feb2024" } return versions[tostring(version)] end}) add_versions("20.9.0", "9d5131243bf3e33db2e3a968720d860abdcbbe7cb037c2cb5dd06046d439ed09") add_versions("21.4.0", "481e769b1aabd08b46659bbec8363a2429f04d3bb9a1e857eb0ebd163304d1bf") add_versions("21.11.0", "d25e634b0e225ae572f82d0d27c97051b0069c6813d7be12453039a504dffeb8") + add_versions("24.2.0", "edb643b2444ff24925339cfb1bc9f76c671d5404a5549d32ecaa0d61bbab28c9") on_install("windows", function (package) local configs = {} diff --git a/packages/d/dirent_h/xmake.lua b/packages/d/dirent_h/xmake.lua new file mode 100644 index 000000000..44a692f0a --- /dev/null +++ b/packages/d/dirent_h/xmake.lua @@ -0,0 +1,16 @@ +package("dirent_h") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/win32ports/dirent_h") + set_description("header-only Windows implementation of the header") + set_license("MIT") + + add_urls("https://github.com/win32ports/dirent_h.git") + add_versions("2021.09.25", "0170b775ae7cede136c0c1f71b8e5002cc36288b") + + on_install("windows", function (package) + os.cp("dirent.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:has_cfuncs("opendir", {includes = "dirent.h"})) + end) diff --git a/packages/d/dispenso/patches/1.2.0/namespace.patch b/packages/d/dispenso/patches/1.2.0/namespace.patch new file mode 100644 index 000000000..64bb2f68e --- /dev/null +++ b/packages/d/dispenso/patches/1.2.0/namespace.patch @@ -0,0 +1,22 @@ +diff --git a/dispenso/detail/quanta.cpp b/dispenso/detail/quanta.cpp +index fbab069..a587e86 100644 +--- a/dispenso/detail/quanta.cpp ++++ b/dispenso/detail/quanta.cpp +@@ -5,12 +5,15 @@ + * LICENSE file in the root directory of this source tree. + */ + ++#ifdef _WIN32 ++#include ++#include ++#endif ++ + #include + + namespace dispenso { + #ifdef _WIN32 +-#include +-#include + + namespace { + struct OsQuantaSetter { diff --git a/packages/d/dispenso/xmake.lua b/packages/d/dispenso/xmake.lua new file mode 100644 index 000000000..b90344ea1 --- /dev/null +++ b/packages/d/dispenso/xmake.lua @@ -0,0 +1,45 @@ +package("dispenso") + set_homepage("https://github.com/facebookincubator/dispenso") + set_description("The project provides high-performance concurrency, enabling highly parallel computation.") + set_license("MIT") + + add_urls("https://github.com/facebookincubator/dispenso/archive/refs/tags/$(version).tar.gz", + "https://github.com/facebookincubator/dispenso.git") + + add_versions("v1.3.0", "824afe8d0d36bfd9bc9b1cbe9be89e7f3ed642a3612766d1c99d5f8dfc647c63") + add_versions("v1.2.0", "a44d9cf2f9234f5cbdbe4050fd26e63f3266b64955731651adf04dbb7f6b31df") + add_versions("v1.1.0", "581f95c16cd479692bc89448d0648f6ce24162454308c544c4d35bf5e9efe5c8") + + add_patches("1.2.0", "patches/1.2.0/namespace.patch", "a0c00cad221f05f9624a28c2e22f6e419b21b9832281cb875283bf89847b50f1") + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + elseif is_plat("windows", "mingw") then + add_defines("NOMINMAX") + add_syslinks("winmm", "synchronization") + end + + add_deps("cmake") + add_deps("concurrentqueue") + + on_install("windows|x64", "linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", "cross", "wasm", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DDISPENSO_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF")) + + io.replace("dispenso/CMakeLists.txt", "-Werror", "", {plain = true}) + io.replace("dispenso/CMakeLists.txt", "/WX", "", {plain = true}) + io.replace("dispenso/CMakeLists.txt", "Synchronization", "Synchronization winmm", {plain = true}) + import("package.tools.cmake").install(package, configs) + + os.tryrm(package:installdir("include/dispenso/third-party")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + dispenso::ThreadPool& threadPool = dispenso::globalThreadPool(); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/d/distorm/xmake.lua b/packages/d/distorm/xmake.lua new file mode 100644 index 000000000..e406eed0f --- /dev/null +++ b/packages/d/distorm/xmake.lua @@ -0,0 +1,25 @@ +package("distorm") + set_homepage("https://github.com/gdabah/distorm") + set_description("Powerful Disassembler Library For x86/AMD64") + + add_urls("https://github.com/gdabah/distorm.git") + add_versions("2021.12.18", "7a02caa1a936f0a653fc75f1aaea9bd3fa654603") + + on_install(function (package) + io.replace("src/textdefs.c", "RSHORT(&s->p[i]) = RSHORT(&TextBTable[(*buf) * 2]);", "s->p[i] = TextBTable[(*buf) * 2];s->p[i + 1] = TextBTable[(*buf) * 2 + 1];", {plain = true}) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("distorm") + set_kind("$(kind)") + add_files("src/*.c") + add_headerfiles("include/*.h", {prefixdir = "distorm"}) + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("distorm_version", {includes = "distorm/distorm.h"})) + end) diff --git a/packages/d/dlfcn-win32/xmake.lua b/packages/d/dlfcn-win32/xmake.lua new file mode 100644 index 000000000..83e0bbe8b --- /dev/null +++ b/packages/d/dlfcn-win32/xmake.lua @@ -0,0 +1,25 @@ +package("dlfcn-win32") + set_homepage("https://github.com/dlfcn-win32/dlfcn-win32") + set_description("Official dlfcn-win32 repo") + set_license("MIT") + + add_urls("https://github.com/dlfcn-win32/dlfcn-win32/archive/refs/tags/$(version).tar.gz", + "https://github.com/dlfcn-win32/dlfcn-win32.git") + + add_versions("v1.4.1", "30a9f72bdf674857899eb7e553df1f0d362c5da2a576ae51f886e1171fbdb399") + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + if package:config("shared") then + package:add("defines", "DLFCN_WIN32_SHARED") + end + end) + + on_test(function (package) + assert(package:has_cfuncs("dlopen", {includes = "dlfcn.h"})) + end) diff --git a/packages/d/dlib/xmake.lua b/packages/d/dlib/xmake.lua index c27e6b60c..19cb17b06 100644 --- a/packages/d/dlib/xmake.lua +++ b/packages/d/dlib/xmake.lua @@ -1,20 +1,102 @@ package("dlib") - - set_kind("library", {headeronly = true}) set_homepage("https://dlib.net") set_description("A toolkit for making real world machine learning and data analysis applications in C++") set_license("Boost") add_urls("https://github.com/davisking/dlib/archive/refs/tags/$(version).tar.gz", "https://github.com/davisking/dlib.git") + + add_versions("v19.24.4", "d881911d68972d11563bb9db692b8fcea0ac1b3fd2e3f03fa0b94fde6c739e43") add_versions("v19.22", "5f44b67f762691b92f3e41dcf9c95dd0f4525b59cacb478094e511fdacb5c096") + add_configs("png", {description = "Enable png", default = false, type = "boolean"}) + add_configs("jpg", {description = "Enable jpg", default = false, type = "boolean"}) + add_configs("gif", {description = "Enable gif", default = false, type = "boolean"}) + add_configs("sqlite3", {description = "Enable sqlite3", default = false, type = "boolean"}) + add_configs("blas", {description = "Enable blas", default = false, type = "boolean"}) + add_configs("mkl", {description = "Enable mkl", default = false, type = "boolean"}) + add_configs("jxl", {description = "Enable jpeg xl", default = false, type = "boolean"}) + add_configs("ffmpeg", {description = "Enable ffmpeg", default = false, type = "boolean"}) + add_configs("webp", {description = "Enable webp", default = false, type = "boolean"}) + + add_configs("simd", {description = "SIMD acceleration architecture.", type = "string", values = {"sse2", "sse4", "avx", "neon"}}) + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + add_deps("cmake") - on_install("windows", "linux", "macosx", function (package) - import("package.tools.cmake").install(package) + + on_load(function (package) + if package:config("png") then + package:add("deps", "libpng") + end + if package:config("png") then + package:add("deps", "libjpeg") + end + if package:config("gif") then + package:add("deps", "giflib") + end + if package:config("sqlite3") then + package:add("deps", "sqlite3") + end + if package:config("blas") then + package:add("deps", "openblas") + end + if package:config("mkl") then + package:add("deps", "mkl") + end + if package:config("jxl") then + package:add("deps", "libjxl") + end + if package:config("ffmpeg") then + package:add("deps", "ffmpeg") + end + if package:version():ge("19.24") and package:config("webp") then + package:add("deps", "libwebp") + end + end) + + on_install(function (package) + local configs = { + "-DDLIB_IN_PROJECT_BUILD=OFF", + "-DDLIB_ISO_CPP_ONLY=OFF", + "-DDLIB_NO_GUI_SUPPORT=ON" + } + if package:is_plat("windows") then + if package:is_debug() then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") + end + if package:config("shared") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + io.replace("dlib/CMakeLists.txt", [[message(FATAL_ERROR "Building dlib as a standalone dll is not supported when using Visual Studio. You are highly encouraged to use static linking instead. See https://github.com/davisking/dlib/issues/1483 for a discussion.")]], "", {plain = true}) + end + end + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + + table.insert(configs, "-DDLIB_PNG_SUPPORT=" .. (package:config("png") and "ON" or "OFF")) + table.insert(configs, "-DDLIB_JPEG_SUPPORT=" .. (package:config("jpg") and "ON" or "OFF")) + table.insert(configs, "-DDLIB_GIF_SUPPORT=" .. (package:config("jpg") and "ON" or "OFF")) + table.insert(configs, "-DDLIB_LINK_WITH_SQLITE3=" .. (package:config("sqlite3") and "ON" or "OFF")) + table.insert(configs, "-DDLIB_USE_BLAS=" .. (package:config("blas") and "ON" or "OFF")) + table.insert(configs, "-DDLIB_USE_MKL_FFT=" .. (package:config("mkl") and "ON" or "OFF")) + table.insert(configs, "-DDLIB_JXL_SUPPORT=" .. (package:config("jxl") and "ON" or "OFF")) + table.insert(configs, "-DDLIB_USE_FFMPEG=" .. (package:config("ffmpeg") and "ON" or "OFF")) + table.insert(configs, "-DDLIB_WEBP_SUPPORT=" .. (package:config("webp") and "ON" or "OFF")) + + local simd = package:config("simd") + table.insert(configs, "-DUSE_NEON_INSTRUCTIONS=" .. ((simd == "neon") and "ON" or "OFF")) + table.insert(configs, "-DUSE_SSE2_INSTRUCTIONS=" .. ((simd == "sse2") and "ON" or "OFF")) + table.insert(configs, "-DUSE_SSE4_INSTRUCTIONS=" .. ((simd == "sse4") and "ON" or "OFF")) + table.insert(configs, "-DUSE_AVX_INSTRUCTIONS=" .. ((simd == "avx") and "ON" or "OFF")) + if simd == "sse4" then + package:add("defines", "DLIB_HAVE_SSE2", "DLIB_HAVE_SSE3", "DLIB_HAVE_SSE41") + end + import("package.tools.cmake").install(package, configs) end) on_test(function (package) assert(package:has_cxxtypes("dlib::command_line_parser", { - includes = "dlib/cmd_line_parser.h", configs = {languages = "c++11"}})) + includes = "dlib/cmd_line_parser.h", configs = {languages = "c++14"}})) end) diff --git a/packages/d/dotnet/xmake.lua b/packages/d/dotnet/xmake.lua index 8bd96d145..e5f887a48 100644 --- a/packages/d/dotnet/xmake.lua +++ b/packages/d/dotnet/xmake.lua @@ -5,41 +5,115 @@ package("dotnet") if is_host("windows") then if is_arch("x64") then - set_urls("https://download.visualstudio.microsoft.com/download/pr/e2f99985-b54a-43a2-85cf-cfc9a1e0a307/171339e000ade0b6e10c3cb010ed45ba/dotnet-sdk-7.0.202-win-x64.zip") - add_versions("7.0.202", "1cc74b279cffe42f757b3adeeeec87e351f0fb806016167ffb6b3842d4d6bcd5") + local versions = { + ["7.0.4"] = "e2f99985-b54a-43a2-85cf-cfc9a1e0a307/171339e000ade0b6e10c3cb010ed45ba/dotnet-sdk-7.0.202-win-x64", + ["7.0.15"] = "2133b143-9c4f-4daa-99b0-34fa6035d67b/193ede446d922eb833f1bfe0239be3fc/dotnet-sdk-7.0.405-win-x64", + ["8.0.1"] = "6902745c-34bd-4d66-8e84-d5b61a17dfb7/e61732b00f7e144e162d7e6914291f16/dotnet-sdk-8.0.101-win-x64" + } + set_urls("https://download.visualstudio.microsoft.com/download/pr/$(version).zip", {version = function (version) + return versions[tostring(version)] + end}) + + add_versions("7.0.4", "1cc74b279cffe42f757b3adeeeec87e351f0fb806016167ffb6b3842d4d6bcd5") + add_versions("7.0.15", "a158307a32caee886e24a2cc5114c3fba230f8c6173a1b707dc112ff377607b7") + add_versions("8.0.1", "2fa8eb34ce5a03a6fc606b35cfd6ff1d1ac36dfd35a4772d6a6ec1939de46244") + elseif is_arch("arm64") then + local versions = { + ["7.0.4"] = "h52f31250-1961-4203-9f51-9b9afce0db15/129915360a0e0e6ee59e895efd389b0a/dotnet-sdk-7.0.202-win-arm64", + ["7.0.15"] = "5079d3e3-3fa9-4ffa-92fc-bbf17e2d3543/634299784e4c6f7a1f5b06cf5070d505/dotnet-sdk-7.0.405-win-arm64", + ["8.0.1"] = "bfcfe7c7-d722-45b0-80df-663516a401ce/d7b91a51df647c710c96cde20aa8b100/dotnet-sdk-8.0.101-win-arm64" + } + set_urls("https://download.visualstudio.microsoft.com/download/pr/$(version).zip", {version = function (version) + return versions[tostring(version)] + end}) + + add_versions("7.0.4", "5b2d8d381fc52379d25f5ccfa0882476b6003060682abf19fd96151a08d4298b") + add_versions("7.0.15", "272156f0cfc4752eaae580196eb0f3287c1c758c99a116a70062a2083cafa0bd") + add_versions("8.0.1", "feca0648fa200fd19ea3cb00266a76488d76880243b5c57bf9ecf9d91892ddfe") else - set_urls("https://download.visualstudio.microsoft.com/download/pr/c7213e17-4955-4fae-a405-1b7101086daf/71963248a7de64c4b00219a8199e7429/dotnet-sdk-7.0.202-win-x86.zip") - add_versions("7.0.202", "8541bc89a12dac90ba1d6a7c1b6875b9314fc8af04602210be07daa16cfd5e9a") + local versions = { + ["7.0.4"] = "c7213e17-4955-4fae-a405-1b7101086daf/71963248a7de64c4b00219a8199e7429/dotnet-sdk-7.0.202-win-x86", + ["7.0.15"] = "bf8a63f5-f029-4d0a-8027-975284829ad0/e1fb2ba0532d63c6cec0fb04987a91bf/dotnet-sdk-7.0.405-win-x86", + ["8.0.1"] = "059613f3-d3e9-4585-b8a9-3814e675b6d0/01150dbaaa7f392f103137bd325786b6/dotnet-sdk-8.0.101-win-x86" + } + set_urls("https://download.visualstudio.microsoft.com/download/pr/$(version).zip", {version = function (version) + return versions[tostring(version)] + end}) + + add_versions("7.0.4", "8541bc89a12dac90ba1d6a7c1b6875b9314fc8af04602210be07daa16cfd5e9a") + add_versions("7.0.15", "77907f8db16228b04421bb8c63e89fa2c6d7e728c1e5cd0187b87d4aafa0acc0") + add_versions("8.0.1", "af9feebee04bc25ac2a0f98dc37c8808da4a9c7586c55de8aafafab2d2ad8b98") end elseif is_host("linux") then if is_arch("x64", "x86_64") then - set_urls("https://download.visualstudio.microsoft.com/download/pr/bda88810-e1a6-4cf0-8139-7fd7fe7b2c7a/7a9ffa3e12e5f1c3d8b640e326c1eb14/dotnet-sdk-7.0.202-linux-x64.tar.gz") - add_versions("7.0.202", "405f15e437582be260460f48eda9dfe613fd87b2557667f20d6ecfa34b09c221") + local versions = { + ["7.0.4"] = "bda88810-e1a6-4cf0-8139-7fd7fe7b2c7a/7a9ffa3e12e5f1c3d8b640e326c1eb14/dotnet-sdk-7.0.202-linux-x64", + ["7.0.15"] = "5202b091-2406-445c-b40a-68a5b97c882b/b509f2a7a0eb61aea145b990b40b6d5b/dotnet-sdk-7.0.405-linux-x64", + ["8.0.1"] = "9454f7dc-b98e-4a64-a96d-4eb08c7b6e66/da76f9c6bc4276332b587b771243ae34/dotnet-sdk-8.0.101-linux-x64" + } + set_urls("https://download.visualstudio.microsoft.com/download/pr/$(version).tar.gz", {version = function (version) + return versions[tostring(version)] + end}) + + add_versions("7.0.4", "405f15e437582be260460f48eda9dfe613fd87b2557667f20d6ecfa34b09c221") + add_versions("7.0.15", "db1f6226039313ceda561de803298fc6df0a0f34e1b214629225bb20e2c03e90") + add_versions("8.0.1", "3c61ffcee8947e0ead6196799d058e671b00bc6b983983f2bde5d29f702de2fe") elseif is_arch("arm64", "arm64-v8a") then - set_urls("https://download.visualstudio.microsoft.com/download/pr/c1fd11b0-186a-4aa1-a578-bb1b6613886e/b67e1c9d6d90b1c99b23935273921fa1/dotnet-sdk-7.0.202-linux-arm64.tar.gz") - add_versions("7.0.202", "5a5d29f3f7515f6df888047eeb9571a2fa06b728a97e30536b1473d2abce0b32") + local versions = { + ["7.0.4"] = "c1fd11b0-186a-4aa1-a578-bb1b6613886e/b67e1c9d6d90b1c99b23935273921fa1/dotnet-sdk-7.0.202-linux-arm64", + ["7.0.15"] = "bdfe4e91-3a24-421f-881a-47b6d91404cb/cfe786933a6a7fd358b799af23542827/dotnet-sdk-7.0.405-linux-arm64", + ["8.0.1"] = "092bec24-9cad-421d-9b43-458b3a7549aa/84280dbd1eef750f9ed1625339235c22/dotnet-sdk-8.0.101-linux-arm64" + } + set_urls("https://download.visualstudio.microsoft.com/download/pr/$(version).tar.gz", {version = function (version) + return versions[tostring(version)] + end}) + + add_versions("7.0.4", "5a5d29f3f7515f6df888047eeb9571a2fa06b728a97e30536b1473d2abce0b32") + add_versions("7.0.15", "83b18606c055b528856ad5642828627542d339510f33155ff126bb2522a5c68d") + add_versions("8.0.1", "6e6d9c0d20e9b87247638eff4e66eccf04078ca956cecb9be53f155f44a2c508") end elseif is_host("macosx") then if is_arch("x64", "x86_64") then - set_urls("https://download.visualstudio.microsoft.com/download/pr/d3fe9043-0ff4-4584-aacf-1ad41c47407b/7b84ed341359488cd0de21de1b4df6d0/dotnet-sdk-7.0.202-osx-x64.tar.gz") - add_versions("7.0.202", "1531bfa7bf384f8b5c433d87af170f7839b130ea9c20b617aaf41742a13eefa9") + local versions = { + ["7.0.4"] = "d3fe9043-0ff4-4584-aacf-1ad41c47407b/7b84ed341359488cd0de21de1b4df6d0/dotnet-sdk-7.0.202-osx-x64", + ["7.0.15"] = "77e1c2df-aaa1-44aa-abc5-ffca44b1dfc9/1fea5228f09398a885ca956d1b537f02/dotnet-sdk-7.0.405-osx-x64", + ["8.0.1"] = "c7f806d2-1483-4a52-893a-4de1054b0bff/a6f52ed50876c45f859192b6576a14d5/dotnet-sdk-8.0.101-osx-x64" + } + set_urls("https://download.visualstudio.microsoft.com/download/pr/$(version).tar.gz", {version = function (version) + return versions[tostring(version)] + end}) + + add_versions("7.0.4", "1531bfa7bf384f8b5c433d87af170f7839b130ea9c20b617aaf41742a13eefa9") + add_versions("7.0.15", "f8ff3c54f633e3f8dc0208c97b43a6ad53442a6139dbb11e6957129a7a20bf79") + add_versions("8.0.1", "cad53a19dd0ad86c814bbf24f8449e068ffbc3749a285e41b7b6e6004fa3881f") elseif is_arch("arm64") then - set_urls("https://download.visualstudio.microsoft.com/download/pr/4402413a-ef81-4732-a0c0-38f11694b226/e205b8bf48d95902a6dbe1c3cccca272/dotnet-sdk-7.0.202-osx-arm64.tar.gz") - add_versions("7.0.202", "7f8201d42d31d6985288d0e31a32aa3b1dff40fceb8cb202993c0b72883bcebb") + local versions = { + ["7.0.4"] = "4402413a-ef81-4732-a0c0-38f11694b226/e205b8bf48d95902a6dbe1c3cccca272/dotnet-sdk-7.0.202-osx-arm64", + ["7.0.15"] = "5bb0e0e4-2a8d-4aba-88ad-232e1f65c281/ee6d35f762d81965b4cf336edde1b318/dotnet-sdk-7.0.405-osx-arm64", + ["8.0.1"] = "ef083c06-7aee-4a4f-b18b-50c9a8990753/e206864e7910e81bbd9cb7e674ff1b4c/dotnet-sdk-8.0.101-osx-arm64" + } + set_urls("https://download.visualstudio.microsoft.com/download/pr/$(version).tar.gz", {version = function (version) + return versions[tostring(version)] + end}) + + add_versions("7.0.4", "7f8201d42d31d6985288d0e31a32aa3b1dff40fceb8cb202993c0b72883bcebb") + add_versions("7.0.15", "b1b822bc2e7041f7ed6708ec8a41d417f6fa1c962b051681cf36a91d6929fefa") + add_versions("8.0.1", "aa56166e43f19ab9a71bf1203a9028920f2f555d985f8f1fe0ed0fe221b109bd") end end - on_install("windows|x86", "windows|x64", "linux|x64", "linux|x86_64", "linux|arm64", "linux|arm64-v8a", "macosx|x86_64", "macosx|x64", "macosx|arm64", function (package) - + on_install("windows|x86", "windows|x64", "windows|arm64", "linux|x64", "linux|x86_64", "linux|arm64", "linux|arm64-v8a", "macosx|x86_64", "macosx|x64", "macosx|arm64", function (package) + local version_str = package:version_str() local out_path = "packs" if package:is_plat("windows") then - out_path = path.join(out_path, "Microsoft.NETCore.App.Host.win-" .. (package:is_arch("x64") and "x64" or "x86"), "7.0.4", "runtimes", "win-" .. (package:is_arch("x64") and "x64" or "x86"), "native") - + local arch = package:is_arch("x64") and "x64" or (package:is_arch("arm64") and "arm64" or "x86") + out_path = path.join(out_path, "Microsoft.NETCore.App.Host.win-" .. arch, version_str, "runtimes", "win-" .. arch, "native") + os.cp(path.join(out_path, "nethost.dll"), package:installdir("bin")) os.cp(path.join(out_path, "nethost.lib"), package:installdir("lib")) elseif package:is_plat("linux") then - local is_arm = package:is_arch("arm64", "arm64-v8a") - out_path = path.join(out_path, "Microsoft.NETCore.App.Host.linux-" .. (is_arm and "arm64" or "x64"), "7.0.4", "runtimes", "linux-" .. (is_arm and "arm64" or "x64"), "native") + local arch = package:is_arch("arm64", "arm64-v8a") and "arm64" or "x64" + out_path = path.join(out_path, "Microsoft.NETCore.App.Host.linux-" .. arch, version_str, "runtimes", "linux-" .. arch, "native") if package:config("shared") then os.cp(path.join(out_path, "*.so"), package:installdir("lib")) @@ -47,7 +121,8 @@ package("dotnet") os.cp(path.join(out_path, "*.a"), package:installdir("lib")) end elseif package:is_plat("macosx") then - out_path = path.join(out_path, "Microsoft.NETCore.App.Host.osx-" .. (package:is_arch("arm64") and "arm64" or "x64"), "7.0.4", "runtimes", "osx-" .. (package:is_arch("arm64") and "arm64" or "x64"), "native") + local arch = package:is_arch("arm64") and "arm64" or "x64" + out_path = path.join(out_path, "Microsoft.NETCore.App.Host.osx-" .. arch, version_str, "runtimes", "osx-" .. arch, "native") if package:config("shared") then os.cp(path.join(out_path, "*.dylib"), package:installdir("lib")) @@ -58,7 +133,7 @@ package("dotnet") os.cp(path.join(out_path, "*.h"), package:installdir("include")) package:add("links", "nethost") - + end) on_test(function (package) diff --git a/packages/d/double-conversion/xmake.lua b/packages/d/double-conversion/xmake.lua index 30ec848da..4a009eadc 100644 --- a/packages/d/double-conversion/xmake.lua +++ b/packages/d/double-conversion/xmake.lua @@ -6,6 +6,7 @@ package("double-conversion") add_urls("https://github.com/google/double-conversion/archive/refs/tags/$(version).tar.gz", "https://github.com/google/double-conversion.git") + add_versions("v3.3.0", "04ec44461850abbf33824da84978043b22554896b552c5fd11a9c5ae4b4d296e") add_versions("v3.1.5", "a63ecb93182134ba4293fd5f22d6e08ca417caafa244afaa751cbfddf6415b13") add_deps("cmake") diff --git a/packages/d/doxygen/xmake.lua b/packages/d/doxygen/xmake.lua index adbbab36f..0b90e0738 100644 --- a/packages/d/doxygen/xmake.lua +++ b/packages/d/doxygen/xmake.lua @@ -10,9 +10,11 @@ package("doxygen") }) add_urls("https://github.com/doxygen/doxygen.git", {alias = "github"}) + add_versions("archive:1.10.0", "dd7c556b4d96ca5e682534bc1f1a78a5cfabce0c425b14c1b8549802686a4442") add_versions("archive:1.9.6", "297f8ba484265ed3ebd3ff3fe7734eb349a77e4f95c8be52ed9977f51dea49df") add_versions("archive:1.9.5", "55b454b35d998229a96f3d5485d57a0a517ce2b78d025efb79d57b5a2e4b2eec") add_versions("archive:1.9.3", "f352dbc3221af7012b7b00935f2dfdc9fb67a97d43287d2f6c81c50449d254e0") + add_versions("github:1.10.0", "Release_1_10_0") add_versions("github:1.9.6", "Release_1_9_6") add_versions("github:1.9.5", "Release_1_9_5") add_versions("github:1.9.3", "Release_1_9_3") @@ -32,8 +34,17 @@ package("doxygen") end) on_install("@windows", "@macosx", "@linux", function (package) + local configs = {} + local cxflags = {} + if package:is_plat("windows") then + -- these 2 flags are required to make doxygen compile on windows + table.insert(cxflags, "/utf-8") + table.insert(cxflags, "/DGHC_WITH_EXCEPTIONS") + table.insert(cxflags, "/EHsc") -- to reduce warnings + end + os.rm("templates/*/PaxHeader") - import("package.tools.cmake").install(package) + import("package.tools.cmake").install(package, configs, {cxflags = cxflags, jobs = 1}) end) on_test(function (package) diff --git a/packages/d/dpp/xmake.lua b/packages/d/dpp/xmake.lua index 7db4d371b..fc0d40de5 100644 --- a/packages/d/dpp/xmake.lua +++ b/packages/d/dpp/xmake.lua @@ -5,7 +5,12 @@ package("dpp") add_urls("https://github.com/brainboxdotcc/DPP/archive/refs/tags/$(version).tar.gz", "https://github.com/brainboxdotcc/DPP.git") - + + add_versions("v10.0.30", "fb7019770bd5c5f0539523536250da387ee1fa9c92e59c0bcff6c9adaf3d77e8") + add_versions("v10.0.29", "a37e91fbdabee20cb0313700588db4077abf0ebabafe386457d999d22d2d0682") + add_versions("v10.0.28", "aa0c16a1583f649f28ec7739c941e9f2bf9c891c0b87ef8278420618f8bacd46") + add_versions("v10.0.27", "525a5c10a5fdd69996f48826ea1c37a3f08ba934c95e4cb9738afd209a2ecdb7") + add_versions("v10.0.26", "038e95c3ef8228957bf2a84d4ff73ca1dd95ecb2cf7478ca57137d5d99f7e709") add_versions("v10.0.25", "bd39d24e01748ff4cc34ad7ca0faaa0f53542efd8843d4bcc75566a11f0f248b") add_versions("v10.0.24", "e5d561b864a7397caeb5616d388ebbd79a8f21077f3b13ac6ccd7e29c746daa9") add_versions("v10.0.23", "8f9db61c3586a492ada378235300c509e3bc2fc090cef32de0a8241741038df0") @@ -77,7 +82,7 @@ package("dpp") end end) - on_install("windows", "linux", "macosx", "mingw", function (package) + on_install("windows", "linux", "macosx", function (package) -- fix dpp dependencies for _, file in ipairs(table.join(os.files("include/**.h"), os.files("src/**.cpp"))) do io.replace(file, "#include ", "#include ", {plain = true}) os.rmdir("include/dpp/nlohmann") + local configs = {} + if package:version():ge("v10.0.29") and package:is_plat("windows") then + configs.cxflags = "/bigobj /Gy" + end os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") - import("package.tools.xmake").install(package) + import("package.tools.xmake").install(package, configs) end) on_test(function (package) diff --git a/packages/d/dr_flac/xmake.lua b/packages/d/dr_flac/xmake.lua index 79b2e4458..a30b56000 100644 --- a/packages/d/dr_flac/xmake.lua +++ b/packages/d/dr_flac/xmake.lua @@ -4,7 +4,8 @@ package("dr_flac") set_description("Single file audio decoding libraries for C/C++.") set_license("MIT") - set_urls("https://github.com/mackron/dr_libs.git") + set_urls("https://github.com/mackron/dr_libs.git", {submodules = false}) + add_versions("0.12.42", "39ce69188eab79a913aa23423eef9da5f3dcd142") add_versions("0.12.41", "056b6f5e1f7cc5046aac33e6331551b6b2813292") add_versions("0.12.39", "7d3638f215599e4b576fe5d4be4f6820b9988e48") add_versions("0.12.29", "343aa923439e59e7a9f7726f70edc77a4500bdec") diff --git a/packages/d/dr_mp3/xmake.lua b/packages/d/dr_mp3/xmake.lua index 9e4337d22..93cd46f2b 100644 --- a/packages/d/dr_mp3/xmake.lua +++ b/packages/d/dr_mp3/xmake.lua @@ -4,7 +4,9 @@ package("dr_mp3") set_description("Single file audio decoding libraries for C/C++.") set_license("MIT") - set_urls("https://github.com/mackron/dr_libs.git") + set_urls("https://github.com/mackron/dr_libs.git", {submodules = false}) + add_versions("0.6.39", "da35f9d6c7374a95353fd1df1d394d44ab66cf01") + add_versions("0.6.38", "01d23df76776faccee3bc456f685900dcc273b4c") add_versions("0.6.37", "1b0bc87c6b9b04052e6ef0117396dab8482c250e") add_versions("0.6.36", "b7f4c04e77b4c14347b74503e4ce93494e314283") add_versions("0.6.34", "dd762b861ecadf5ddd5fb03e9ca1db6707b54fbb") diff --git a/packages/d/dr_wav/xmake.lua b/packages/d/dr_wav/xmake.lua index bb175b1ae..040b86329 100644 --- a/packages/d/dr_wav/xmake.lua +++ b/packages/d/dr_wav/xmake.lua @@ -4,7 +4,9 @@ package("dr_wav") set_description("Single file audio decoding libraries for C/C++.") set_license("MIT") - set_urls("https://github.com/mackron/dr_libs.git") + set_urls("https://github.com/mackron/dr_libs.git", {submodules = false}) + add_versions("0.13.16", "4ec70a37c4450b021a6653f0813f1b9ceaae65fb") + add_versions("0.13.13", "9eed1be421749ba68a87e5b4c3b10858f8580689") add_versions("0.13.12", "d35a3bc5efd02455d98cbe12b94647136f09b42d") add_versions("0.13.11", "e07e2b8264da5fa1331a0ca3d30a3606084c311f") add_versions("0.13.10", "dbbd08d81fd2b084c5ae931531871d0c5fd83b87") diff --git a/packages/d/draco/xmake.lua b/packages/d/draco/xmake.lua index 92f959806..6af889076 100644 --- a/packages/d/draco/xmake.lua +++ b/packages/d/draco/xmake.lua @@ -6,6 +6,7 @@ package("draco") add_urls("https://github.com/google/draco/archive/refs/tags/$(version).tar.gz", "https://github.com/google/draco.git") + add_versions("1.5.7", "bf6b105b79223eab2b86795363dfe5e5356050006a96521477973aba8f036fe1") add_versions("1.4.1", "83aa5637d36a835103a61f96af7ff04c6d6528e643909466595d51ee715417a9") add_versions("1.5.0", "81a91dcc6f22170a37ef67722bb78d018e642963e6c56e373560445ce7468a20") add_versions("1.5.6", "2cc1f0904545e2a5d1f8fa060509e454bfd59363dff9263dbe0601571594279b") diff --git a/packages/d/dragonbox/xmake.lua b/packages/d/dragonbox/xmake.lua new file mode 100644 index 000000000..34c85f088 --- /dev/null +++ b/packages/d/dragonbox/xmake.lua @@ -0,0 +1,44 @@ +package("dragonbox") + set_homepage("https://github.com/jk-jeon/dragonbox") + set_description("Reference implementation of Dragonbox in C++") + set_license("Apache-2.0") + + add_urls("https://github.com/jk-jeon/dragonbox/archive/refs/tags/$(version).tar.gz", + "https://github.com/jk-jeon/dragonbox.git") + + add_versions("1.1.3", "09d63b05e9c594ec423778ab59b7a5aa1d76fdd71d25c7048b0258c4ec9c3384") + + if is_plat("windows") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("cmake") + + on_install(function (package) + io.replace("CMakeLists.txt", "STATIC", "", {plain = true}) + io.replace("CMakeLists.txt", [[set(dragonbox_directory "dragonbox-${PROJECT_VERSION}")]], "set(dragonbox_directory )", {plain = true}) + + local configs = {"-DDRAGONBOX_INSTALL_TO_CHARS=ON"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") + if package:config("shared") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + constexpr int buffer_length = 1 + // for '\0' + jkj::dragonbox::max_output_string_length; + double x = 1.234; + char buffer[buffer_length]; + char* end_ptr = jkj::dragonbox::to_chars(x, buffer); + end_ptr = jkj::dragonbox::to_chars_n(x, buffer); + } + ]]}, {configs = {languages = "c++17"}, includes = "dragonbox/dragonbox_to_chars.h"})) + end) diff --git a/packages/d/drogon/patches/1.8.0/check.patch b/packages/d/drogon/patches/1.8.0/check.patch new file mode 100644 index 000000000..85e6babca --- /dev/null +++ b/packages/d/drogon/patches/1.8.0/check.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d9dbd66..87c92e6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -379,8 +379,7 @@ if (BUILD_MYSQL) + + if (DROGON_FOUND_MYSQL) + message(STATUS "Ok! We find mariadb!") +- include(CheckLibraryExists) +- check_library_exists(${MYSQL_LIB_NAME} mysql_optionsv "" HAS_MYSQL_OPTIONSV) ++ set(HAS_MYSQL_OPTIONSV TRUE) + if (HAS_MYSQL_OPTIONSV) + message(STATUS "Mariadb support mysql_optionsv") + add_definitions(-DHAS_MYSQL_OPTIONSV) diff --git a/packages/d/drogon/patches/1.8.2/gcc13.patch b/packages/d/drogon/patches/1.8.2/gcc13.patch new file mode 100644 index 000000000..477d23fb1 --- /dev/null +++ b/packages/d/drogon/patches/1.8.2/gcc13.patch @@ -0,0 +1,12 @@ +diff --git a/lib/inc/drogon/RateLimiter.h b/lib/inc/drogon/RateLimiter.h +index 3b8706b..dece795 100644 +--- a/lib/inc/drogon/RateLimiter.h ++++ b/lib/inc/drogon/RateLimiter.h +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + namespace drogon + { diff --git a/packages/d/drogon/patches/1.9.1/resolv.patch b/packages/d/drogon/patches/1.9.1/resolv.patch new file mode 100644 index 000000000..a4f463112 --- /dev/null +++ b/packages/d/drogon/patches/1.9.1/resolv.patch @@ -0,0 +1,29 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fbe2288..d7218a6 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -367,11 +367,10 @@ endif (NOT WIN32) + + if (BUILD_POSTGRESQL) + # find postgres +- find_package(pg) +- if (pg_FOUND) +- message(STATUS "libpq inc path:" ${PG_INCLUDE_DIRS}) +- message(STATUS "libpq lib:" ${PG_LIBRARIES}) +- target_link_libraries(${PROJECT_NAME} PRIVATE pg_lib) ++ find_package(PostgreSQL REQUIRED) ++ if(PostgreSQL_FOUND) ++ set(pg_FOUND true) ++ target_link_libraries(${PROJECT_NAME} PRIVATE PostgreSQL::PostgreSQL) + set(DROGON_SOURCES + ${DROGON_SOURCES} + orm_lib/src/postgresql_impl/PostgreSQLResultImpl.cc +@@ -401,7 +400,7 @@ if (BUILD_POSTGRESQL) + ${private_headers} + orm_lib/src/postgresql_impl/PgConnection.h) + endif (libpq_supports_batch) +- endif (pg_FOUND) ++ endif (PostgreSQL_FOUND) + endif (BUILD_POSTGRESQL) + + if (BUILD_MYSQL) diff --git a/packages/d/drogon/xmake.lua b/packages/d/drogon/xmake.lua index 408f6e722..a3c5b02f5 100644 --- a/packages/d/drogon/xmake.lua +++ b/packages/d/drogon/xmake.lua @@ -6,6 +6,8 @@ package("drogon") add_urls("https://github.com/an-tao/drogon/archive/refs/tags/$(version).tar.gz", "https://github.com/an-tao/drogon.git") + add_versions("v1.9.4", "b23d9d01d36fb1221298fcdbedcf7fd3e1b8b8821bf6fb8ed073c8b0c290d11d") + add_versions("v1.9.3", "fb4ef351b3e4c06ed850cfbbf50c571502decb1738fb7d62a9d7d70077c9fc23") add_versions("v1.4.1", "ad794d7744b600240178348c15e216c919fe7a2bc196cf1239f129aee2af19c7") add_versions("v1.6.0", "9f8802b579aac29e9eddfb156e432276727a3d3c49fffdf453a2ddcd1cb69093") add_versions("v1.7.1", "a0bce1f32b6e1321486bb25c55ca7bd7a577cbd53f1e7be47367d0f9733730f1") @@ -14,6 +16,7 @@ package("drogon") add_versions("v1.8.0", "bc6503cf213ed961d4a5e9fd7cb8e75b6b11045a67840ea2241e57321dd8711b") add_versions("v1.8.1", "9665f001355cc72a5a9db941ae349cec50959d18bf44eb6c09311bf9c78336a4") add_versions("v1.8.2", "1182cab00c33e400eac617c6dbf44fa2f358e1844990b6b8c5c87783024f9971") + add_versions("v1.9.1", "0f8bab22e02681d05787c88cbef5d04b105f6644ebf7cf29898d0a52ebe959e4") add_patches("1.4.1", path.join(os.scriptdir(), "patches", "1.4.1", "trantor.patch"), "7f9034a27bb63de8dedb80dd9f246ea7aa7724c87f2c0d0054f4b6097ea2a862") add_patches("1.4.1", path.join(os.scriptdir(), "patches", "1.4.1", "resolv.patch" ), "a1054822bf91f5f06de8bca9b1bd8859233228159a8ff8014ce6329d6c000f26") @@ -24,14 +27,19 @@ package("drogon") add_patches(">=1.7.3 <1.8.0", path.join(os.scriptdir(), "patches", "1.7.3", "trantor.patch"), "27e479dd0e3f8adc75c9c21fe895937f727c3102e5bfb21ac3289d6ad2795b7a") add_patches(">=1.7.3 <1.8.0", path.join(os.scriptdir(), "patches", "1.7.3", "resolv.patch" ), "49694f090e169a5c0e524726e8b85ad0bac76c05ed633c60e986849c2e5adb85") add_patches("1.8.0", path.join(os.scriptdir(), "patches", "1.8.0", "redis.patch" ), "cf09beb4f07fd970ef4ad8911eec71ce7c94609ad9fbf1626b5ca8fcd070e09e") - add_patches(">=1.8.0", path.join(os.scriptdir(), "patches", "1.8.0", "resolv.patch"), "e9b6b320c70d17024931be8481f7b6413681216113466b5d6699431bb98d50e2") + add_patches(">=1.8.0 <1.8.4", path.join(os.scriptdir(), "patches", "1.8.0", "resolv.patch"), "e9b6b320c70d17024931be8481f7b6413681216113466b5d6699431bb98d50e2") add_patches(">=1.8.0", path.join(os.scriptdir(), "patches", "1.8.0", "config.patch"), "67a921899a24c1646be6097943cc2ed8228c40f177493451f011539c6df0ed76") + add_patches(">=1.8.0", path.join(os.scriptdir(), "patches", "1.8.0", "check.patch"), "e4731995bb754f04e1bb813bfe3dfb480a850fbbd5cdb48d5a53b32b4ed8669c") + add_patches(">=1.8.2 <1.8.5", path.join(os.scriptdir(), "patches", "1.8.2", "gcc13.patch"), "d2842a734df52c590ab950414c7a95a1ac1be48f8680f909d0eeba5f36087cb0") + add_patches("1.9.1", path.join(os.scriptdir(), "patches", "1.9.1", "resolv.patch"), "2b511e60fe99062396accab6b25d0092e111a83db11cffc23ce8e790370d017c") add_configs("c_ares", {description = "Enable async DNS query support.", default = false, type = "boolean"}) add_configs("mysql", {description = "Enable mysql support.", default = false, type = "boolean"}) add_configs("openssl", {description = "Enable openssl support.", default = true, type = "boolean"}) add_configs("postgresql", {description = "Enable postgresql support.", default = false, type = "boolean"}) add_configs("sqlite3", {description = "Enable sqlite3 support.", default = false, type = "boolean"}) + add_configs("redis", {description = "Enable redis support.", default = false, type = "boolean"}) + add_configs("yaml", {description = "Enable yaml support.", default = false, type = "boolean"}) add_deps("cmake") add_deps("trantor", "jsoncpp", "brotli", "zlib") @@ -47,22 +55,30 @@ package("drogon") on_load(function(package) local configdeps = {c_ares = "c-ares", - mysql = "mysql", + mysql = "mariadb-connector-c", openssl = "openssl", postgresql = "postgresql", - sqlite3 = "sqlite3"} + sqlite3 = "sqlite3", + redis = "hiredis", + yaml = "yaml-cpp"} for name, dep in pairs(configdeps) do if package:config(name) then package:add("deps", dep) end end + end) - on_install("windows|x64", "macosx", "linux", function (package) + on_install("windows", "macosx", "linux", function (package) io.replace("cmake/templates/config.h.in", "\"@COMPILATION_FLAGS@@DROGON_CXX_STANDARD@\"", "R\"(@COMPILATION_FLAGS@@DROGON_CXX_STANDARD@)\"", {plain = true}) + io.replace("cmake_modules/FindMySQL.cmake", "PATH_SUFFIXES mysql", "PATH_SUFFIXES mysql mariadb", {plain = true}) local configs = {"-DBUILD_EXAMPLES=OFF"} + local version = package:version() + if version:ge("1.8.4") then + table.insert(configs, "-DUSE_SUBMODULE=OFF") + end table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) -- no support for windows shared library @@ -72,19 +88,15 @@ package("drogon") for name, enabled in pairs(package:configs()) do if not package:extraconf("configs", name, "builtin") then - if enabled then - if name == "sqlite3" then - table.insert(configs, "-DBUILD_SQLITE=ON") - else - table.insert(configs, "-DBUILD_" .. name:upper() .. "=ON") - end - else if name == "sqlite3" then - table.insert(configs, "-DBUILD_SQLITE=OFF") + table.insert(configs, "-DBUILD_SQLITE=" .. (enabled and "ON" or "OFF")) + elseif name == "yaml" then + if version:ge("1.8.4") then + table.insert(configs, "-DBUILD_YAML_CONFIG=" .. (enabled and "ON" or "OFF")) + end else - table.insert(configs, "-DBUILD_" .. name:upper() .. "=OFF") + table.insert(configs, "-DBUILD_" .. name:upper() .. "=" .. (enabled and "ON" or "OFF")) end - end end end diff --git a/packages/d/duckdb/xmake.lua b/packages/d/duckdb/xmake.lua new file mode 100644 index 000000000..3b84f1351 --- /dev/null +++ b/packages/d/duckdb/xmake.lua @@ -0,0 +1,36 @@ +package("duckdb") + set_homepage("http://duckdb.org/") + set_description("DuckDB is an in-process SQL OLAP Database Management System") + set_license("MIT") + + add_urls("https://github.com/duckdb/duckdb/releases/download/$(version)/libduckdb-src.zip", + "https://github.com/duckdb/duckdb.git") + add_versions("v1.0.0", "482c7f090cac4408eed5b02708b6a54168c1875c2c6d8042d8344edee3f70eb7") + add_versions("v0.10.3", "f22ed5058188c81886dfdda80c6c46b7df2ed0a623a348c78ac8372451c84497") + add_versions("v0.10.0", "385e27aa67712813e4a07389465c4c5c45c431d97cddd35713b8a306d2a86f2d") + add_versions("v0.10.1", "70ec6ffefd9a04bf9fcdc1a4949611f9633f10f0e3b9cead1425b926a54d0f89") + add_versions("v0.10.2", "6bab203dc2e10432edbefda7be7043f73f17c8898ba81ce3aa2319e7e2d5af10") + + on_install("macosx", "linux", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + set_languages("c++17") + target("duckdb") + set_kind("$(kind)") + add_files("duckdb.cpp") + add_headerfiles("duckdb.hpp", "duckdb.h") + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "duckdb.hpp" + using namespace duckdb; + + void test() { + DuckDB db(nullptr); + Connection con(db); + } + ]]}, {configs = {languages = "cxx17"}})) + end) diff --git a/packages/d/duckx/xmake.lua b/packages/d/duckx/xmake.lua new file mode 100644 index 000000000..d236998b4 --- /dev/null +++ b/packages/d/duckx/xmake.lua @@ -0,0 +1,41 @@ +package("duckx") + set_homepage("https://github.com/amiremohamadi/DuckX") + set_description("C++ library for creating and modifying Microsoft Word (.docx) files") + set_license("MIT") + + add_urls("https://github.com/amiremohamadi/DuckX.git") + add_versions("2021.08.05", "6b6656309d7a46a483267abd1d591ef41226badd") + + add_deps("kuba-zip", "pugixml") + + on_install("windows", "linux", "macosx", "mingw", function (package) + io.writefile("xmake.lua", [[ + add_requires("kuba-zip", "pugixml") + add_rules("mode.debug", "mode.release") + set_languages("c++11") + target("duckx") + set_kind("$(kind)") + add_files("src/duckx.cpp") + add_includedirs("include") + add_headerfiles("include/*.hpp", {prefixdir = "duckx"}) + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + add_packages("kuba-zip", "pugixml") + ]]) + io.replace("include/duckx.hpp", "zip.h", "zip/zip.h", {plain = true}) + io.replace("include/duckx.hpp", "", [["constants.hpp"]], {plain = true}) + io.replace("include/duckx.hpp", "", [["duckxiterator.hpp"]], {plain = true}) + io.replace("src/duckx.cpp", "zip_total_entries", "zip_entries_total", {plain = true}) + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + duckx::Document doc("file.docx"); + doc.open(); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/d/dylib/xmake.lua b/packages/d/dylib/xmake.lua new file mode 100644 index 000000000..678f51c6b --- /dev/null +++ b/packages/d/dylib/xmake.lua @@ -0,0 +1,24 @@ +package("dylib") + set_kind("library", {headeronly = true}) + set_homepage("https://conan.io/center/recipes/dylib") + set_description("C++ cross-platform wrapper around dynamic loading of shared libraries (dll, so, dylib)") + set_license("MIT") + + add_urls("https://github.com/martin-olivier/dylib/archive/refs/tags/$(version).tar.gz", + "https://github.com/martin-olivier/dylib.git") + + add_versions("v2.2.1", "6af0d2a91860743dc9f564ba0ab7f036a9b37c904395610288791571d4dbea5b") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + dylib lib("foo"); + } + ]]}, {configs = {languages = "c++11"}, includes = "dylib.hpp"})) + end) diff --git a/packages/d/dynareadout/xmake.lua b/packages/d/dynareadout/xmake.lua index f73bda62e..696f7231e 100644 --- a/packages/d/dynareadout/xmake.lua +++ b/packages/d/dynareadout/xmake.lua @@ -5,14 +5,22 @@ package("dynareadout") add_urls("https://github.com/PucklaJ/dynareadout/archive/refs/tags/$(version).tar.gz", "https://github.com/PucklaJ/dynareadout.git") + add_versions("24.03", "d91feb2ebfa604b543dd6d98c3dd5aee5c489e6987159fef78dfcea1aad64bd5") add_versions("22.12", "2e430c718c610d4425e23d4c6c87fe4794bb8c76d3cc015988706dbf5027daa4") - add_versions("23.01", "578080c734927cc925e7e91a52317bc3e710965071f1da50853b1e48f81a1c0f") - add_versions("23.02", "054949a8774089fc217d7c0ec02996b53d331794c41941ed5006b90715bb4d30") - add_versions("23.04", "929efad70c68931f35c76336ea8b23bf2da46022d5fd570f4efc06d776a94604") - add_versions("23.05", "d33bb3acf6f62f7801c58755efbd49bfec2def37aee5397a17e2c38d8216bff6") - add_versions("23.06", "515f0b0d20c46e00f393fb9bb0f2baf303244d39e35a080741276681eb454926") - add_versions("23.07", "6db52a13771cdb7613b97cf0d2bcffdb87ce0cce4cba7e6d80330977b2ac6210") - add_versions("23.08", "5be972426f67ce63a7ac3beaf3866b824abbc9c15af2d47d1fea21687417b493") + add_versions("23.01", "578080c734927cc925e7e91a52317bc3e710965071f1da50853b1e48f81a1c0f") + add_versions("23.02", "054949a8774089fc217d7c0ec02996b53d331794c41941ed5006b90715bb4d30") + add_versions("23.04", "929efad70c68931f35c76336ea8b23bf2da46022d5fd570f4efc06d776a94604") + add_versions("23.05", "d33bb3acf6f62f7801c58755efbd49bfec2def37aee5397a17e2c38d8216bff6") + add_versions("23.06", "515f0b0d20c46e00f393fb9bb0f2baf303244d39e35a080741276681eb454926") + add_versions("23.07", "6db52a13771cdb7613b97cf0d2bcffdb87ce0cce4cba7e6d80330977b2ac6210") + add_versions("23.08", "5be972426f67ce63a7ac3beaf3866b824abbc9c15af2d47d1fea21687417b493") + add_versions("23.09", "a62e0575521aacf3f567dfd578d6edc51edc07d4b744e5b5ae5d30f662be424b") + add_versions("23.10", "834d356e80019a7288001c2796c9ce14c2a8e5494c1051fae402f4503b10c1e5") + add_versions("23.10.1", "6ebb6e9d9b3db637476cc9bd5342e4779be175f87225261da35c9270790e77d7") + add_versions("23.11", "2222bea87af9289dbc1a52adc5f09058863c503003e94193ca9388eff9e4ff04") + add_versions("23.12", "6afc9c0857b6227e39466aae00db606d3376e61d518bb73544d8240fe3a66a90") + add_versions("24.01", "f39094567272816c9a7dd84d3eaa0ef5c26309eeeadba814cac12f82e93ae0e1") + add_versions("24.02", "acd483bd737a7769087befa1eb2010426c1328bb84ab0481ea11cdeb7655c64e") add_configs("cpp", {description = "Build the C++ bindings", default = true, type = "boolean"}) add_configs("profiling", {description = "Build with profiling features", default = false, type = "boolean"}) @@ -24,6 +32,9 @@ package("dynareadout") else package:add("links", "dynareadout") end + if package:is_plat("macosx") then + package:add("deps", "boost") + end end) on_install("windows", "linux", "macosx", "mingw", function (package) diff --git a/packages/e/eastl/xmake.lua b/packages/e/eastl/xmake.lua index b9726b051..79844d5a4 100644 --- a/packages/e/eastl/xmake.lua +++ b/packages/e/eastl/xmake.lua @@ -4,9 +4,11 @@ package("eastl") set_description("EASTL stands for Electronic Arts Standard Template Library.") set_license("BSD-3-Clause") - add_urls("https://github.com/electronicarts/EASTL/archive/$(version).tar.gz") + set_urls("https://github.com/electronicarts/EASTL/archive/refs/tags/$(version).tar.gz", + "https://github.com/electronicarts/EASTL.git") add_versions("3.17.03", "50a072066e30fda364d482df6733572d8ca440a33825d81254b59a6ca9f4375a") add_versions("3.17.06", "9ebeef26cdf091877ee348450d2711cd0bb60ae435309126c0adf8fec9a01ea5") + add_versions("3.18.00", "a3c5b970684be02e81fb16fbf92ed2584e055898704fde87c72d0331afdea12b") add_versions("3.21.12", "2a4d77e5eda23ec52fea8b22abbf2ea8002f38396d2a3beddda3ff2e17f7db2e") add_deps("cmake") diff --git a/packages/e/easyloggingpp/xmake.lua b/packages/e/easyloggingpp/xmake.lua index 4ba96a9fa..8eb766bc3 100644 --- a/packages/e/easyloggingpp/xmake.lua +++ b/packages/e/easyloggingpp/xmake.lua @@ -6,6 +6,7 @@ package("easyloggingpp") add_urls("https://github.com/amrayn/easyloggingpp/archive/refs/tags/$(version).tar.gz", "https://github.com/amrayn/easyloggingpp.git") + add_versions("v9.97.1", "ebe473e17b13f1d1f16d0009689576625796947a711e14aec29530f39560c7c2") add_versions("v9.97.0", "9110638e21ef02428254af8688bf9e766483db8cc2624144aa3c59006907ce22") add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) diff --git a/packages/e/easywsclient/patches/2021.01.12/add_cstdint.patch b/packages/e/easywsclient/patches/2021.01.12/add_cstdint.patch new file mode 100644 index 000000000..5211abc91 --- /dev/null +++ b/packages/e/easywsclient/patches/2021.01.12/add_cstdint.patch @@ -0,0 +1,42 @@ +diff --git a/easywsclient.cpp b/easywsclient.cpp +index 0c98098..750d513 100644 +--- a/easywsclient.cpp ++++ b/easywsclient.cpp +@@ -26,17 +26,6 @@ + #ifndef snprintf + #define snprintf _snprintf_s + #endif +- #if _MSC_VER >=1600 +- // vs2010 or later +- #include +- #else +- typedef __int8 int8_t; +- typedef unsigned __int8 uint8_t; +- typedef __int32 int32_t; +- typedef unsigned __int32 uint32_t; +- typedef __int64 int64_t; +- typedef unsigned __int64 uint64_t; +- #endif + #define socketerrno WSAGetLastError() + #define SOCKET_EAGAIN_EINPROGRESS WSAEINPROGRESS + #define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK +@@ -52,7 +41,6 @@ + #include + #include + #include +- #include + #ifndef _SOCKET_T_DEFINED + typedef int socket_t; + #define _SOCKET_T_DEFINED +diff --git a/easywsclient.hpp b/easywsclient.hpp +index 08c4a7b..df60500 100644 +--- a/easywsclient.hpp ++++ b/easywsclient.hpp +@@ -10,6 +10,7 @@ + + #include + #include ++#include + + namespace easywsclient { + diff --git a/packages/e/easywsclient/patches/2021.01.12/move_import.patch b/packages/e/easywsclient/patches/2021.01.12/move_import.patch new file mode 100644 index 000000000..5941ef7e5 --- /dev/null +++ b/packages/e/easywsclient/patches/2021.01.12/move_import.patch @@ -0,0 +1,18 @@ +diff --git a/easywsclient.cpp b/easywsclient.cpp +index 0c98098..aca7e77 100644 +--- a/easywsclient.cpp ++++ b/easywsclient.cpp +@@ -1,3 +1,4 @@ ++#include "easywsclient.hpp" + + #ifdef _WIN32 + #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) +@@ -73,8 +74,6 @@ + #include + #include + +-#include "easywsclient.hpp" +- + using easywsclient::Callback_Imp; + using easywsclient::BytesCallback_Imp; + diff --git a/packages/e/easywsclient/xmake.lua b/packages/e/easywsclient/xmake.lua new file mode 100644 index 000000000..73270643c --- /dev/null +++ b/packages/e/easywsclient/xmake.lua @@ -0,0 +1,43 @@ +package("easywsclient") + set_homepage("https://github.com/dhbaird/easywsclient") + set_description("A short and sweet WebSocket client for C++") + set_license("MIT") + + add_urls("https://github.com/dhbaird/easywsclient.git") + add_versions("2021.01.12", "afc1d8cfc584e0f1f4a77e8c0ce3e979d9fe7ce2") + add_patches("2021.01.12", path.join(os.scriptdir(), "patches", "2021.01.12", "add_cstdint.patch"), "babddf02e9eae42cc11e5458478f207837a402c425b31dafd2ef63a29b7d6744") + add_patches("2021.01.12", path.join(os.scriptdir(), "patches", "2021.01.12", "move_import.patch"), "9265412268390cbfcb799f40324c3e255ae6fc01c292e749c131f1c3c19e32bd") + + if is_plat("mingw") then + add_syslinks("ws2_32") + end + + on_install(function (package) + local configs = {} + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("easywsclient") + set_kind("$(kind)") + set_languages("cxx11") + add_files("easywsclient.cpp") + add_headerfiles("(easywsclient.hpp)") + if is_plat("windows") then + add_defines("_WIN32") + end + if is_plat("mingw") then + add_syslinks("ws2_32") + end + ]]) + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include "easywsclient.hpp" + void test() { + std::unique_ptr ws(easywsclient::WebSocket::from_url("ws://echo.websocket.org")); + ws->send("Hello World!"); + } + ]]}), {configs = {languages = "cxx11"}}) + end) diff --git a/packages/e/edlib/xmake.lua b/packages/e/edlib/xmake.lua new file mode 100644 index 000000000..572255cb7 --- /dev/null +++ b/packages/e/edlib/xmake.lua @@ -0,0 +1,28 @@ +package("edlib") + set_homepage("http://martinsos.github.io/edlib") + set_description("Lightweight, super fast C/C++ (& Python) library for sequence alignment using edit (Levenshtein) distance.") + set_license("MIT") + + add_urls("https://github.com/Martinsos/edlib/archive/refs/tags/$(version).tar.gz", + "https://github.com/Martinsos/edlib.git") + + add_versions("v1.2.7", "8767bc1b04a1a67282d57662e5702c4908996e96b1753b5520921ff189974621") + + add_configs("tools", {description = "Build tools", default = false, type = "boolean"}) + + add_deps("cmake") + + on_install(function (package) + local configs = {"-DBUILD_TESTING=OFF", "-DEDLIB_BUILD_EXAMPLES=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DEDLIB_BUILD_UTILITIES=" .. (package:config("tools") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + if package:config("shared") and package:is_plat("windows") then + package:add("defines", "EDLIB_SHARED") + end + end) + + on_test(function (package) + assert(package:has_cfuncs("edlibAlign", {includes = "edlib.h"})) + end) diff --git a/packages/e/effolkronium-random/xmake.lua b/packages/e/effolkronium-random/xmake.lua index d620595b0..3d973d605 100644 --- a/packages/e/effolkronium-random/xmake.lua +++ b/packages/e/effolkronium-random/xmake.lua @@ -6,6 +6,7 @@ package("effolkronium-random") add_urls("https://github.com/effolkronium/random/archive/refs/tags/$(version).tar.gz", "https://github.com/effolkronium/random.git") + add_versions("v1.5.0", "c05a042f8daf54913e3a836e10a213bbbeaf09a89630649bd0011fe65eff50d9") add_versions("v1.4.1", "ec6beb67496ad2ce722d311d3fa5efb7e847dac5fd1c16b8920b51562fe20f53") on_install(function (package) diff --git a/packages/e/egl-headers/xmake.lua b/packages/e/egl-headers/xmake.lua new file mode 100644 index 000000000..f12a7841a --- /dev/null +++ b/packages/e/egl-headers/xmake.lua @@ -0,0 +1,22 @@ +package("egl-headers") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/KhronosGroup/EGL-Registry") + set_description("EGL API and Extension Registry") + set_license("MIT") + + add_urls("https://github.com/KhronosGroup/EGL-Registry.git") + + add_versions("2023.12.16", "a03692eea13514d9aef01822b2bc6575fcabfac2") + + on_install(function (package) + os.vcp("api/EGL", package:installdir("include")) + os.vcp("api/KHR", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_csnippets({test = [[ + void test() { + int version = EGL_VERSION; + } + ]]}, {includes = "EGL/egl.h"})) + end) diff --git a/packages/e/elfutils/patches/0.189/configure.patch b/packages/e/elfutils/patches/0.189/configure.patch new file mode 100644 index 000000000..59f77a785 --- /dev/null +++ b/packages/e/elfutils/patches/0.189/configure.patch @@ -0,0 +1,81 @@ +diff --git a/configure b/configure +index acc483f..244e733 100755 +--- a/configure ++++ b/configure +@@ -9363,76 +9363,6 @@ See \`config.log' for more details" "$LINENO" 5; } ;; + esac + + +-saved_LIBS="$LIBS" +-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing _obstack_free" >&5 +-printf %s "checking for library containing _obstack_free... " >&6; } +-if test ${ac_cv_search__obstack_free+y} +-then : +- printf %s "(cached) " >&6 +-else $as_nop +- ac_func_search_save_LIBS=$LIBS +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-char _obstack_free (); +-int +-main (void) +-{ +-return _obstack_free (); +- ; +- return 0; +-} +-_ACEOF +-for ac_lib in '' obstack +-do +- if test -z "$ac_lib"; then +- ac_res="none required" +- else +- ac_res=-l$ac_lib +- LIBS="-l$ac_lib $ac_func_search_save_LIBS" +- fi +- if ac_fn_c_try_link "$LINENO" +-then : +- ac_cv_search__obstack_free=$ac_res +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.beam \ +- conftest$ac_exeext +- if test ${ac_cv_search__obstack_free+y} +-then : +- break +-fi +-done +-if test ${ac_cv_search__obstack_free+y} +-then : +- +-else $as_nop +- ac_cv_search__obstack_free=no +-fi +-rm conftest.$ac_ext +-LIBS=$ac_func_search_save_LIBS +-fi +-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search__obstack_free" >&5 +-printf "%s\n" "$ac_cv_search__obstack_free" >&6; } +-ac_res=$ac_cv_search__obstack_free +-if test "$ac_res" != no +-then : +- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +- +-fi +- +-LIBS="$saved_LIBS" +-case "$ac_cv_search__obstack_free" in +- no) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error $? "failed to find _obstack_free +-See \`config.log' for more details" "$LINENO" 5; } ;; +- -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;; +- *) obstack_LIBS= ;; +-esac +- + + + ac_config_files="$ac_config_files doc/Makefile" diff --git a/packages/e/elfutils/xmake.lua b/packages/e/elfutils/xmake.lua index ed671f2f3..faba20b01 100644 --- a/packages/e/elfutils/xmake.lua +++ b/packages/e/elfutils/xmake.lua @@ -6,18 +6,16 @@ package("elfutils") set_urls("https://sourceware.org/elfutils/ftp/$(version)/elfutils-$(version).tar.bz2") add_versions("0.183", "c3637c208d309d58714a51e61e63f1958808fead882e9b607506a29e5474f2c5") + add_versions("0.189", "39bd8f1a338e2b7cd4abc3ff11a0eddc6e690f69578a57478d8179b4148708c8") add_patches("0.183", path.join(os.scriptdir(), "patches", "0.183", "configure.patch"), "7a16719d9e3d8300b5322b791ba5dd02986f2663e419c6798077dd023ca6173a") + add_patches("0.189", path.join(os.scriptdir(), "patches", "0.189", "configure.patch"), "b4016a97e6aaad92b15fad9a594961b1fc77a6d054ebadedef9bb3a55e99a8f8") add_configs("libelf", {description = "Enable libelf", default = true, type = "boolean"}) - add_configs("libcpu", {description = "Enable libcpu", default = false, type = "boolean"}) - add_configs("libebl", {description = "Enable libebl", default = false, type = "boolean"}) - add_configs("libdw", {description = "Enable libdw", default = false, type = "boolean"}) - add_configs("libdwelf", {description = "Enable libdwelf", default = false, type = "boolean"}) - add_configs("libdwfl", {description = "Enable libdwfl", default = false, type = "boolean"}) + add_configs("libdw", {description = "Enable libdw", default = true, type = "boolean"}) add_configs("libasm", {description = "Enable libasm", default = false, type = "boolean"}) - add_deps("m4", "zlib") + add_deps("m4", "zstd", "zlib") if is_plat("android") then add_deps("libintl", "argp-standalone") end @@ -34,23 +32,23 @@ package("elfutils") "--disable-debuginfod", "--disable-libdebuginfod"} local cflags = {} - if package:config("pic") ~= false then - table.insert(cflags, "-fPIC") - end for _, makefile in ipairs(os.files(path.join("*/Makefile.in"))) do io.replace(makefile, "-Wtrampolines", "", {plain = true}) io.replace(makefile, "-Wimplicit-fallthrough=5", "", {plain = true}) + io.replace(makefile, "-Werror", "", {plain = true}) if package:has_tool("cc", "clang") then io.replace(makefile, "-Wno-packed-not-aligned", "", {plain = true}) end end local subdirs = {} - for name, enabled in pairs(package:configs()) do - if not package:extraconf("configs", name, "builtin") then - if enabled then - table.insert(subdirs, name) - end - end + if package:config("libelf") then + table.insert(subdirs, "libelf") + end + if package:config("libdw") then + table.join2(subdirs, "libcpu", "backends", "libebl", "libdwelf", "libdwfl", "libdw") + end + if package:config("libasm") then + table.insert(subdirs, "libasm") end io.replace("Makefile.in", [[SUBDIRS = config lib libelf libcpu backends libebl libdwelf libdwfl libdw \ libasm debuginfod src po doc tests]], "SUBDIRS = lib " .. table.concat(subdirs, " "), {plain = true}) @@ -77,7 +75,9 @@ package("elfutils") os.rm(path.join(package:installdir("lib"), "*.a")) else os.rm(path.join(package:installdir("lib"), "*.so")) + os.tryrm(path.join(package:installdir("lib"), "*.so.*")) end + os.trycp("libelf/elf.h", package:installdir("include")) end) on_test(function (package) diff --git a/packages/e/embree/xmake.lua b/packages/e/embree/xmake.lua index d5a5255a8..8c8967d6d 100644 --- a/packages/e/embree/xmake.lua +++ b/packages/e/embree/xmake.lua @@ -11,6 +11,7 @@ package("embree") add_versions("v3.13.3", "74ec785afb8f14d28ea5e0773544572c8df2e899caccdfc88509f1bfff58716f") add_versions("v3.13.4", "e6a8d1d4742f60ae4d936702dd377bc4577a3b034e2909adb2197d0648b1cb35") add_versions("v3.13.5", "b8c22d275d9128741265537c559d0ea73074adbf2f2b66b0a766ca52c52d665b") + add_versions("v4.3.0", "baf0a57a45837fc055ba828a139467bce0bc0c6a9a5f2dccb05163d012c12308") -- Not recommanded to build embree as a static library. add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"}) @@ -19,9 +20,11 @@ package("embree") if is_plat("windows") then add_syslinks("advapi32") end - add_links("embree3", "embree_sse42", "embree_avx", "embree_avx2", "embree_avx512", "tasking", "simd", "lexers", "math", "sys") on_install("macosx", "linux", "windows|x64", "windows|x86", function (package) + if package:version():lt("4.0.0") then + package:add("links", "embree3", "embree_sse42", "embree_avx", "embree_avx2", "embree_avx512", "tasking", "simd", "lexers", "math", "sys") + end io.replace("common/tasking/CMakeLists.txt", "include(installTBB)", "", {plain = true}) local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_DOC=OFF", "-DEMBREE_TUTORIALS=OFF", "-DEMBREE_ISPC_SUPPORT=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) @@ -36,11 +39,13 @@ package("embree") end) on_test(function (package) + local major_version = package:version():major() + local includes = "embree" .. major_version .. "/rtcore.h" assert(package:check_cxxsnippets({test = [[ #include void test() { RTCDevice device = rtcNewDevice(NULL); assert(device != NULL); } - ]]}, {configs = {languages = "c++11"}, includes = "embree3/rtcore.h"})) + ]]}, {configs = {languages = "c++11"}, includes = includes})) end) diff --git a/packages/e/emhash/xmake.lua b/packages/e/emhash/xmake.lua new file mode 100644 index 000000000..1560766a8 --- /dev/null +++ b/packages/e/emhash/xmake.lua @@ -0,0 +1,20 @@ +package("emhash") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/ktprime/emhash") + set_description("Fast and memory efficient c++ flat hash map/set") + set_license("MIT") + + add_urls("https://github.com/ktprime/emhash.git") + add_versions("2024.06.01", "3efa77ef32786a033b379071fe8af3dc705736ca") + + on_install(function (package) + os.cp("*.hpp", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + emhash5::HashMap m1(4); + } + ]]}, {configs = {languages = "c++11"}, includes = "hash_table5.hpp"})) + end) diff --git a/packages/e/emio/xmake.lua b/packages/e/emio/xmake.lua new file mode 100644 index 000000000..fa900ffa7 --- /dev/null +++ b/packages/e/emio/xmake.lua @@ -0,0 +1,27 @@ +package("emio") + set_kind("library", {headeronly = true}) + set_homepage("https://viatorus.github.io/emio/") + set_description("A safe and fast high-level and low-level character input/output library for bare-metal and RTOS based embedded systems with a very small binary footprint.") + + add_urls("https://github.com/viatorus/emio/archive/refs/tags/$(version).tar.gz", + "https://github.com/viatorus/emio.git") + + add_versions("0.7.0", "1ef5304964eee109c13477f2d84822ee474612475049a377b59e33a5fe05d7eb") + add_versions("0.4.0", "847198a37fbf9dcc00ac85fbc64b283e41a018f53c39363129a4bdb9939338a6") + + add_deps("cmake") + + add_includedirs("include/emio") + + on_install("linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", "cross", "wasm", function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + emio::format("{0}", 42); + } + ]]}, {configs = {languages = "c++20"}})) + end) diff --git a/packages/e/emmylua_debugger/xmake.lua b/packages/e/emmylua_debugger/xmake.lua index 64e4a691d..a9276db0b 100644 --- a/packages/e/emmylua_debugger/xmake.lua +++ b/packages/e/emmylua_debugger/xmake.lua @@ -6,6 +6,8 @@ package("emmylua_debugger") add_urls("https://github.com/EmmyLua/EmmyLuaDebugger/archive/refs/tags/$(version).tar.gz", "https://github.com/EmmyLua/EmmyLuaDebugger.git") + add_versions("1.8.0", "21e5ba1c82e4386cd8ad4f8c76511d70319b899b414d29ecdaba35649325d2ee") + add_versions("1.7.1", "8757d372c146d9995b6e506d42f511422bcb1dc8bacbc3ea1a5868ebfb30015f") add_versions("1.6.3", "4e10cf1c729fc58f72880895e63618cb91d186ff3b55f270cdaa089a2f8b20bc") add_configs("luasrc", {description = "Use lua source.", default = true, type = "boolean"}) diff --git a/packages/e/emscripten/xmake.lua b/packages/e/emscripten/xmake.lua index 092e18431..569c88fbf 100644 --- a/packages/e/emscripten/xmake.lua +++ b/packages/e/emscripten/xmake.lua @@ -5,6 +5,7 @@ package("emscripten") set_license("MIT") set_urls("https://github.com/emscripten-core/emsdk.git") + add_versions("3.1.55", "7815dcaa5c97ee387e925137a42dd4219e7cec82") add_versions("3.1.42", "c2260b4f28f53b411032de0955a6fe6b6bcf3edd") add_versions("3.1.25", "92d9023adc4dbc66424df9483cee302c68817d3c") add_versions("3.1.14", "517e02fac88b48c74da14b1cf7c6d51e489a5793") diff --git a/packages/e/enet/patches/cmake.patch b/packages/e/enet/patches/v1.3.17/cmake.patch similarity index 100% rename from packages/e/enet/patches/cmake.patch rename to packages/e/enet/patches/v1.3.17/cmake.patch diff --git a/packages/e/enet/patches/v1.3.18/cmake.patch b/packages/e/enet/patches/v1.3.18/cmake.patch new file mode 100644 index 000000000..3b93b8461 --- /dev/null +++ b/packages/e/enet/patches/v1.3.18/cmake.patch @@ -0,0 +1,40 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c6459b62..66d67884 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -84,19 +84,26 @@ set(SOURCE_FILES + source_group(include FILES ${INCLUDE_FILES}) + source_group(source FILES ${SOURCE_FILES}) + +-add_library(enet STATIC ++if(WIN32 AND BUILD_SHARED_LIBS AND (MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")) ++ add_definitions(-DENET_DLL=1) ++ add_definitions(-DENET_BUILDING_LIB) ++endif() ++ ++add_library(enet + ${INCLUDE_FILES} + ${SOURCE_FILES} + ) + +-if (MINGW) ++if (WIN32) + target_link_libraries(enet winmm ws2_32) + endif() + ++include(GNUInstallDirs) + install(TARGETS enet +- RUNTIME DESTINATION bin +- ARCHIVE DESTINATION lib/static +- LIBRARY DESTINATION lib) +- +-install(DIRECTORY include/ +- DESTINATION include) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/enet ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) +\ No newline at end of file diff --git a/packages/e/enet/xmake.lua b/packages/e/enet/xmake.lua index 8a6602d52..77cb48299 100644 --- a/packages/e/enet/xmake.lua +++ b/packages/e/enet/xmake.lua @@ -1,5 +1,4 @@ package("enet") - set_homepage("http://enet.bespin.org") set_description("Reliable UDP networking library.") set_license("MIT") @@ -7,8 +6,11 @@ package("enet") add_urls("https://github.com/lsalzman/enet/archive/refs/tags/$(version).tar.gz", "https://github.com/lsalzman/enet.git") + add_versions("v1.3.18", "28603c895f9ed24a846478180ee72c7376b39b4bb1287b73877e5eae7d96b0dd") add_versions("v1.3.17", "1e0b4bc0b7127a2d779dd7928f0b31830f5b3dcb7ec9588c5de70033e8d2434a") - add_patches("v1.3.17", path.join(os.scriptdir(), "patches", "cmake.patch"), "e77d2d129952443d67c1ec432de81843d72b854d25bbd6fb244b0f85804d21d1") + + add_patches("v1.3.18", "patches/v1.3.18/cmake.patch", "8feb51d3220d04c53d93aea053db522a0429bb3a0236039a2b62d8f01a3f638b") + add_patches("v1.3.17", "patches/v1.3.17/cmake.patch", "e77d2d129952443d67c1ec432de81843d72b854d25bbd6fb244b0f85804d21d1") if is_plat("mingw") and is_subhost("msys") then add_extsources("pacman::enet") @@ -38,25 +40,5 @@ package("enet") end) on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - void test() - { - if (enet_initialize () != 0) - return; - - ENetAddress address; - ENetHost* server; - address.host = ENET_HOST_ANY; - address.port = 1234; - server = enet_host_create (&address, 32, 2, 0, 0); - if (server == NULL) - return; - - ENetEvent event; - while (enet_host_service (server, &event, 1000) > 0); - - enet_host_destroy(server); - enet_deinitialize(); - } - ]]}, {includes = {"enet/enet.h"}})) + assert(package:has_cfuncs("enet_initialize", {includes = "enet/enet.h"})) end) diff --git a/packages/e/enet6/xmake.lua b/packages/e/enet6/xmake.lua new file mode 100644 index 000000000..4299e16bc --- /dev/null +++ b/packages/e/enet6/xmake.lua @@ -0,0 +1,52 @@ +package("enet6") + set_homepage("https://github.com/SirLynix/enet6") + set_description("A fork of ENet (reliable UDP networking library) in order to add IPv6 support.") + set_license("MIT") + + add_urls("https://github.com/SirLynix/enet6/archive/refs/tags/$(version).tar.gz", + "https://github.com/SirLynix/enet6.git") + + add_versions("v6.1.0", "d4cdf02651d0b7c48150b07dba127951141f8c52a8ae002c1056dc6a018a6d10") + add_versions("v6.0.2", "e4678f2d22ea689b7de66bffb553c9f60d429051f44ca6177e8364eb960c7503") + add_versions("v6.0.1", "8df91f35d2edc78113924de95946680175007e249c3afd401ec4ad9a1e9572d9") + add_versions("v6.0.0", "4a6358fcf81a0011d7342349d60941201f88c1c88f124f583a502e4591030a88") + + if is_plat("windows", "mingw") then + add_syslinks("winmm", "ws2_32") + end + + on_load("windows", "mingw", function (package) + if package:config("shared") then + package:add("defines", "ENET_DLL") + end + end) + + on_install(function (package) + local configs = {} + configs.examples = false + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() + { + if (enet_initialize () != 0) + return; + + ENetAddress address; + ENetHost* server; + enet_address_build_any(&address, ENET_ADDRESS_TYPE_IPV6); + address.port = 1234; + server = enet_host_create (ENET_ADDRESS_TYPE_ANY, &address, 32, 2, 0, 0); + if (server == NULL) + return; + + ENetEvent event; + while (enet_host_service (server, &event, 1000) > 0); + + enet_host_destroy(server); + enet_deinitialize(); + } + ]]}, {includes = {"enet6/enet.h"}})) + end) diff --git a/packages/e/enkits/xmake.lua b/packages/e/enkits/xmake.lua index 758770daf..56ba5dfc8 100644 --- a/packages/e/enkits/xmake.lua +++ b/packages/e/enkits/xmake.lua @@ -1,11 +1,12 @@ package("enkits") - set_homepage("https://github.com/dougbinks/enkiTS") set_description("A permissively licensed C and C++ Task Scheduler for creating parallel programs.") set_license("zlib") add_urls("https://github.com/dougbinks/enkiTS/archive/refs/tags/$(version).tar.gz", "https://github.com/dougbinks/enkiTS.git") + + add_versions("v1.11", "b57a782a6a68146169d29d180d3553bfecb9f1a0e87a5159082331920e7d297e") add_versions("v1.10", "578f285fc7c2744bf831548f35b855c6ab06c0d541d08c9cc50b6b72a250811a") add_deps("cmake") @@ -14,6 +15,7 @@ package("enkits") if is_plat("linux") then add_syslinks("pthread", "rt") end + on_load("windows", function (package) if package:config("shared") then package:add("defines", "ENKITS_DLL") @@ -21,6 +23,10 @@ package("enkits") end) on_install("windows", "macosx", "linux", function (package) + if package:is_plat("linux") then + io.replace("src/TaskScheduler.h", "#include ", "#include \n#include \n", {plain = true}) + end + local configs = {"-DENKITS_BUILD_EXAMPLES=OFF", "-DENKITS_INSTALL=ON"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DENKITS_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) diff --git a/packages/e/entt/xmake.lua b/packages/e/entt/xmake.lua index 211b86972..9e7dfccbb 100644 --- a/packages/e/entt/xmake.lua +++ b/packages/e/entt/xmake.lua @@ -6,6 +6,9 @@ package("entt") set_urls("https://github.com/skypjack/entt/archive/$(version).tar.gz", "https://github.com/skypjack/entt.git") + add_versions("v3.13.2", "cb556aa543d01177b62de41321759e02d96078948dda72705b3d7fe68af88489") + add_versions("v3.13.1", "a4f290b601a70333126abd2cec7b0c232c74a4f85dcf1e04d969e8122dae8652") + add_versions("v3.13.0", "dc0ab3ee136a1fe7f92df8898ff215dff1fe4d05d81b60144c7c0468446540a9") add_versions("v3.12.2", "3f3e43988218daecc0530ccaf45e960f7f7416e1fcf2c69799160c18b6a2fee3") add_versions("v3.12.1", "7dc4fc74cc32c1ec74b37419140d9334563bb22ab1b92ad9be580703da05b8ac") add_versions("v3.11.1", "0ac010f232d3089200c5e545bcbd6480cf68b705de6930d8ff7cdb0a29f5b47b") diff --git a/packages/e/etl/xmake.lua b/packages/e/etl/xmake.lua index fbf7e21d7..7c49b2bfc 100644 --- a/packages/e/etl/xmake.lua +++ b/packages/e/etl/xmake.lua @@ -7,6 +7,11 @@ package("etl") add_urls("https://github.com/ETLCPP/etl/archive/refs/tags/$(version).tar.gz", "https://github.com/ETLCPP/etl.git") + add_versions("20.38.17", "5b490aca3faad3796a48bf0980e74f2a67953967fad3c051a6d4981051cb0b9a") + add_versions("20.38.16", "6d05e33d6e7eb2c8d4654c77dcd083adc70da29aba808f471ba7c6e2b8fcbf03") + add_versions("20.38.13", "e606083e189a8fe6211c30c8c579b60c29658a531b5cafbb511daab1a2861a69") + add_versions("20.38.11", "c73b6b076ab59e02398a9f90a66198a9f8bf0cfa91af7be2eebefb3bb264ba83") + add_versions("20.38.10", "562f9b5d9e6786350b09d87be9c5f030073e34d7bf0a975de3e91476ddd471a3") add_versions("20.38.0", "7e29ce81a2a2d5826286502a2ad5bde1f4b591d2c9e0ef7ccc335e75445223cd") add_deps("cmake") diff --git a/packages/e/eve/xmake.lua b/packages/e/eve/xmake.lua new file mode 100644 index 000000000..33eccbd7a --- /dev/null +++ b/packages/e/eve/xmake.lua @@ -0,0 +1,24 @@ +package("eve") + set_kind("library", {headeronly = true}) + set_homepage("https://jfalcou.github.io/eve/") + set_description("Expressive Vector Engine - SIMD in C++ Goes Brrrr") + set_license("BSL-1.0") + + add_urls("https://github.com/jfalcou/eve/archive/refs/tags/v$(version).tar.gz", {excludes = {"*.paxheader", "*.data"}}) + add_urls("https://github.com/jfalcou/eve.git") + + add_versions("2023.02.15", "7a5fb59c0e6ef3bef3e8b36d62e138d31e7f2a9f1bdfe95a8e96512b207f84c5") + + on_install(function (package) + print(os.filedirs("*")) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + eve::wide x( [](auto i, auto) { return 1.f+i; } ); + } + ]]}, {configs = {languages = "c++20"}})) + end) diff --git a/packages/e/eventpp/xmake.lua b/packages/e/eventpp/xmake.lua new file mode 100644 index 000000000..92eb509f7 --- /dev/null +++ b/packages/e/eventpp/xmake.lua @@ -0,0 +1,25 @@ +package("eventpp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/wqking/eventpp") + set_description("Event Dispatcher and callback list for C++") + set_license("Apache-2.0") + + add_urls("https://github.com/wqking/eventpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/wqking/eventpp.git") + + add_versions("v0.1.3", "d87aba67223fd9aced2ba55eb82bd534007e43e1b919106a53fcd3070fa125ea") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package, {"-DEVENTPP_INSTALL=ON"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + eventpp::CallbackList callbackList; + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/e/expat/xmake.lua b/packages/e/expat/xmake.lua index ae2566884..6b71ee429 100644 --- a/packages/e/expat/xmake.lua +++ b/packages/e/expat/xmake.lua @@ -5,6 +5,7 @@ package("expat") set_license("MIT") set_urls("https://github.com/libexpat/libexpat/releases/download/R_$(version).tar.bz2", {version = function (version) return version:gsub("%.", "_") .. "/expat-" .. version end}) + add_versions("2.6.2", "9c7c1b5dcbc3c237c500a8fb1493e14d9582146dd9b42aa8d3ffb856a3b927e0") add_versions("2.5.0", "6f0e6e01f7b30025fa05c85fdad1e5d0ec7fd35d9f61b22f34998de11969ff67") add_versions("2.4.8", "a247a7f6bbb21cf2ca81ea4cbb916bfb9717ca523631675f99b3d4a5678dcd16") add_versions("2.4.7", "e149bdd8b90254c62b3d195da53a09bd531a4d63a963b0d8a5268d48dd2f6a65") @@ -14,6 +15,8 @@ package("expat") add_versions("2.2.10", "b2c160f1b60e92da69de8e12333096aeb0c3bf692d41c60794de278af72135a5") add_versions("2.2.6", "17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2") + add_configs("char_type", {description = "Character type to use", default = "char", type = "string", values = {"char", "ushort", "wchar_t"}}) + add_deps("cmake") on_load("windows", function (package) if not package:config("shared") then @@ -21,10 +24,11 @@ package("expat") end end) - on_install("windows", "linux", "macosx", "mingw", "cross", function (package) + on_install("windows", "linux", "macosx", "android", "mingw", "cross", function (package) local configs = {"-DEXPAT_BUILD_EXAMPLES=OFF", "-DEXPAT_BUILD_TESTS=OFF", "-DEXPAT_BUILD_DOCS=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DEXPAT_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DEXPAT_CHAR_TYPE=" .. package:config("char_type")) if package:is_plat("windows") then table.insert(configs, "-DEXPAT_MSVC_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) end diff --git a/packages/f/fakeit/xmake.lua b/packages/f/fakeit/xmake.lua new file mode 100644 index 000000000..e431e691d --- /dev/null +++ b/packages/f/fakeit/xmake.lua @@ -0,0 +1,54 @@ +package("fakeit") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/eranpeer/FakeIt") + set_description("C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.") + set_license("MIT") + + add_urls("https://github.com/eranpeer/FakeIt/archive/refs/tags/$(version).tar.gz", + "https://github.com/eranpeer/FakeIt.git") + + add_versions("2.4.0", "eb79459ad6a97a5c985e3301b0d44538bdce2ba26115afe040f3874688edefb5") + + local test_frameworks = { + "gtest", + "mstest", + "boost", + "catch", + "tpunit", + "mettle", + "qtest", + "nunit", + "cute", + "doctest", + "standalone", + } + + add_configs("framework", {description = "Choose test library to use", default = "standalone", type = "string", values = test_frameworks}) + + on_load(function (package) + local framework = package:config("framework") + if framework == "gtest" then + package:add("deps", "gtest") + elseif framework == "boost" then + package:add("deps", "boost", {configs = {test = true}}) + elseif framework == "catch" then + package:add("deps", "catch2") + elseif framework == "doctest" then + package:add("deps", "doctest") + end + end) + + on_install(function (package) + os.vcp(path.join("single_header", package:config("framework"), "*"), package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + struct SomeInterface { + virtual int foo(int) = 0; + }; + void test() { + fakeit::Mock mock; + } + ]]}, {configs = {languages = "c++11"}, includes = "fakeit.hpp"})) + end) diff --git a/packages/f/fast-cdr/xmake.lua b/packages/f/fast-cdr/xmake.lua index 6c1ecb9e5..78626e69f 100644 --- a/packages/f/fast-cdr/xmake.lua +++ b/packages/f/fast-cdr/xmake.lua @@ -6,6 +6,8 @@ package("fast-cdr") add_urls("https://github.com/eProsima/Fast-CDR/archive/refs/tags/$(version).tar.gz", "https://github.com/eProsima/Fast-CDR.git") + add_versions("v2.2.1", "11079a534cda791a8fc28d93ecb518bbd3804c0d4e9ca340ab24dcc21ad69a04") + add_versions("v2.1.3", "9a992cf20d8df727df1cd389cc36039c92bbe86762b2c17a479f4f59a499b1ea") add_versions("v1.1.0", "5c4b2ad5493abd30b9475b14856641a8944c98077a36bd0760c1d83c65216e67") add_deps("cmake") diff --git a/packages/f/fast_double_parser/xmake.lua b/packages/f/fast_double_parser/xmake.lua index e7ded5e29..2c0a64d0e 100644 --- a/packages/f/fast_double_parser/xmake.lua +++ b/packages/f/fast_double_parser/xmake.lua @@ -9,6 +9,7 @@ package("fast_double_parser") "https://github.com/lemire/fast_double_parser.git") add_versions("v0.5.0", "afbd2d42facd037bf3859856a8fe4112e4d7ded942255f6c0e6c17689d41f645") add_versions("v0.7.0", "eb80a1d9c406bbe8cb22fffd3c007651f716abd03225009302d8aba8e9c4df77") + add_versions("v0.8.0", "9ad74e059cc7c3e53a3057ca97a74c88ae2a6a7d36ce470193557cbd05ee8f92") on_install("windows|x64", "macosx", "linux", "mingw", "android", function (package) os.cp("include", package:installdir()) diff --git a/packages/f/fast_float/xmake.lua b/packages/f/fast_float/xmake.lua index 2f71a5055..f33737d4a 100644 --- a/packages/f/fast_float/xmake.lua +++ b/packages/f/fast_float/xmake.lua @@ -10,6 +10,10 @@ package("fast_float") add_versions("v3.5.1", "8558bf9c66ccd2f7d03c94461a107f49ad9cf6e4f6c0c84e148fec0aa32b4dd9") add_versions("v3.10.1", "d162c21c1dc538dbc6b3bb6d1317a7808f2eccef78638445630533f5bed902ee") add_versions("v5.2.0", "72bbfd1914e414c920e39abdc81378adf910a622b62c45b4c61d344039425d18") + add_versions("v5.3.0", "2f3bc50670455534dcaedc9dcd0517b71152f319d0cec8625f21c51d23eaf4b9") + add_versions("v6.0.0", "7e98671ef4cc7ed7f44b3b13f80156c8d2d9244fac55deace28bd05b0a2c7c8e") + add_versions("v6.1.0", "a9c8ca8ca7d68c2dbb134434044f9c66cfd4c383d5e85c36b704d30f6be82506") + add_versions("v6.1.1", "10159a4a58ba95fe9389c3c97fe7de9a543622aa0dcc12dd9356d755e9a94cb4") if is_plat("wasm") then add_patches("v3.4.0", path.join(os.scriptdir(), "patches", "emscripten_fix.patch"), "482705431f67e6f0a375ed7bfe87d6856e7d13f071db6157e1d5659834b0eb50") @@ -28,5 +32,5 @@ package("fast_float") double result; auto answer = fast_float::from_chars(input.data(), input.data()+input.size(), result); } - ]]}, {configs = {languages = "c++11"}, includes = {"fast_float/fast_float.h"}})) + ]]}, {configs = {languages = "c++14"}, includes = {"fast_float/fast_float.h"}})) end) diff --git a/packages/f/fast_io/xmake.lua b/packages/f/fast_io/xmake.lua index 085dfe74d..a310e972d 100644 --- a/packages/f/fast_io/xmake.lua +++ b/packages/f/fast_io/xmake.lua @@ -9,15 +9,24 @@ package("fast_io") add_urls("https://gitee.com/qabeowjbtkwb/fast_io.git") add_versions("2023.1.28", "b99b32ab429eb6256fd8de1e17fe38e4c54eb49c") + add_versions("2024.3.31", "a13c3ed1cd6da64b381322f3466f3b4fc9a80ff2") on_install("windows", "linux", "macosx", "msys", "mingw", function (package) os.cp("include", package:installdir()) end) on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - void test() { - print("Hello, fast_io world!\n"); - } - ]]}, {configs = {languages = "c++20"}, includes = {"fast_io.h"}})) + if package:version() == "2023.1.28" then + assert(package:check_cxxsnippets({test = [[ + void test() { + print("Hello, fast_io world!\n"); + } + ]]}, {configs = {languages = "c++20"}, includes = {"fast_io.h"}})) + else + assert(package:check_cxxsnippets({test = [[ + void test() { + fast_io::io::print("Hello, fast_io world!\n"); + } + ]]}, {configs = {languages = "c++20"}, includes = {"fast_io.h"}})) + end end) diff --git a/packages/f/fastgltf/patches/0.7.1/cmake-simdjson.patch b/packages/f/fastgltf/patches/0.7.1/cmake-simdjson.patch new file mode 100644 index 000000000..50fe169ab --- /dev/null +++ b/packages/f/fastgltf/patches/0.7.1/cmake-simdjson.patch @@ -0,0 +1,56 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ba4ea84..d5eedcb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,50 +47,7 @@ if (TARGET simdjson::simdjson) + target_link_libraries(fastgltf PRIVATE simdjson::simdjson) + else() + # Try to find simdjson through a find_package call. +- find_package(simdjson CONFIG) +- if (simdjson_FOUND) +- message(STATUS "fastgltf: Found simdjson config") +- target_link_libraries(fastgltf PUBLIC simdjson::simdjson) +- else() +- # Download and configure simdjson +- set(SIMDJSON_TARGET_VERSION "3.7.0") +- set(SIMDJSON_DL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/deps/simdjson") +- file(MAKE_DIRECTORY ${SIMDJSON_DL_DIR}) +- +- set(SIMDJSON_HEADER_FILE "${SIMDJSON_DL_DIR}/simdjson.h") +- set(SIMDJSON_SOURCE_FILE "${SIMDJSON_DL_DIR}/simdjson.cpp") +- +- macro(download_simdjson) +- file(DOWNLOAD "https://raw.githubusercontent.com/simdjson/simdjson/v${SIMDJSON_TARGET_VERSION}/singleheader/simdjson.h" ${SIMDJSON_HEADER_FILE}) +- file(DOWNLOAD "https://raw.githubusercontent.com/simdjson/simdjson/v${SIMDJSON_TARGET_VERSION}/singleheader/simdjson.cpp" ${SIMDJSON_SOURCE_FILE}) +- endmacro() +- +- if (EXISTS ${SIMDJSON_HEADER_FILE}) +- # Look for the SIMDJSON_VERSION define in the header to check the version. +- file(STRINGS ${SIMDJSON_HEADER_FILE} SIMDJSON_HEADER_VERSION_LINE REGEX "^#define SIMDJSON_VERSION ") +- string(REGEX MATCHALL "[0-9.]+" SIMDJSON_HEADER_VERSION "${SIMDJSON_HEADER_VERSION_LINE}") +- message(STATUS "fastgltf: Found simdjson (Version ${SIMDJSON_HEADER_VERSION})") +- +- if (SIMDJSON_HEADER_VERSION STREQUAL "") +- message(FATAL_ERROR "fastgltf: Failed to download simdjson") +- endif() +- +- if (SIMDJSON_HEADER_VERSION VERSION_LESS SIMDJSON_TARGET_VERSION) +- message(STATUS "fastgltf: simdjson outdated, downloading...") +- download_simdjson() +- endif() +- else() +- message(STATUS "fastgltf: Did not find simdjson, downloading...") +- download_simdjson() +- +- if (NOT EXISTS "${SIMDJSON_HEADER_FILE}") +- message(FATAL_ERROR "fastgltf: Failed to download simdjson.") +- endif() +- endif() +- +- fastgltf_add_source_directory(TARGET fastgltf FOLDER ${SIMDJSON_DL_DIR}) +- target_include_directories(fastgltf PUBLIC $ $) +- endif() ++ + endif() + + if (SIMDJSON_TARGET_VERSION) diff --git a/packages/f/fastgltf/xmake.lua b/packages/f/fastgltf/xmake.lua new file mode 100644 index 000000000..c08de04e2 --- /dev/null +++ b/packages/f/fastgltf/xmake.lua @@ -0,0 +1,37 @@ +package("fastgltf") + set_homepage("https://fastgltf.readthedocs.io/v0.7.x/") + set_description("A modern C++17 glTF 2.0 library focused on speed, correctness, and usability") + set_license("MIT") + + add_urls("https://github.com/spnda/fastgltf/archive/refs/tags/$(version).tar.gz", + "https://github.com/spnda/fastgltf.git") + + add_versions("v0.7.1", "44bcb025dd5cd480236a3bc7a3f8c9a708a801ed773b7859677440d22e0e1e7c") + + add_patches("0.7.1", "patches/0.7.1/cmake-simdjson.patch", "943828708f0e011122249196dc70d9a1f026e3212e1c1c35f6988907a6ea4e49") + + add_configs("small_vector", {description = "Uses a custom SmallVector type optimised for small arrays", default = false, type = "boolean"}) + add_configs("memory_pool", {description = "Disables the memory allocation algorithm based on polymorphic resources", default = false, type = "boolean"}) + add_configs("f64", {description = "Default to 64-bit double precision floats for everything", default = false, type = "boolean"}) + add_configs("cxx_standard", {description = "Select c++ standard to build.", default = "17", type = "string", values = {"17", "20"}}) + if is_plat("linux", "mingw") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("cmake") + add_deps("simdjson") + + on_install("windows|x64", "mingw|x86_64", "macosx|x86_64", "linux|x86_64", "linux|arm64", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DFASTGLTF_USE_CUSTOM_SMALLVECTOR=" .. (package:config("small_vector") and "ON" or "OFF")) + table.insert(configs, "-DFASTGLTF_DISABLE_CUSTOM_MEMORY_POOL=" .. (package:config("memory_pool") and "ON" or "OFF")) + table.insert(configs, "-DFASTGLTF_USE_64BIT_FLOAT=" .. (package:config("f64") and "ON" or "OFF")) + table.insert(configs, "-DFASTGLTF_COMPILE_AS_CPP20=" .. ((package:config("cxx_standard") == "20") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs, {packagedeps = "simdjson"}) + end) + + on_test(function (package) + assert(package:has_cxxtypes("fastgltf::Parser", {configs = {languages = "c++" .. package:config("cxx_standard")}, includes = "fastgltf/core.hpp"})) + end) diff --git a/packages/f/fbgemm/patches/0.7.0/dep-unbundle.patch b/packages/f/fbgemm/patches/0.7.0/dep-unbundle.patch new file mode 100644 index 000000000..078616e5c --- /dev/null +++ b/packages/f/fbgemm/patches/0.7.0/dep-unbundle.patch @@ -0,0 +1,57 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0b51071..ecc2c9e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -240,8 +240,8 @@ message(WARNING "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") + message(WARNING "CMAKE_CXX_FLAGS_DEBUG is ${CMAKE_CXX_FLAGS_DEBUG}") + message(WARNING "CMAKE_CXX_FLAGS_RELEASE is ${CMAKE_CXX_FLAGS_RELEASE}") + message(WARNING "==========") +- +-if(NOT TARGET asmjit) ++find_package(asmjit CONFIG REQUIRED) ++if(0) + #Download asmjit from github if ASMJIT_SRC_DIR is not specified. + if(NOT DEFINED ASMJIT_SRC_DIR) + set(ASMJIT_SRC_DIR "${FBGEMM_SOURCE_DIR}/third_party/asmjit" +@@ -269,8 +269,8 @@ if(NOT TARGET asmjit) + target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable) + endif() + endif() +- +-if(NOT TARGET cpuinfo) ++find_package(cpuinfo CONFIG REQUIRED) ++if(0) + #Download cpuinfo from github if CPUINFO_SOURCE_DIR is not specified. + if(NOT DEFINED CPUINFO_SOURCE_DIR) + set(CPUINFO_SOURCE_DIR "${FBGEMM_SOURCE_DIR}/third_party/cpuinfo" +@@ -354,12 +354,7 @@ target_include_directories(fbgemm BEFORE + PUBLIC $ + PUBLIC $) + +-target_link_libraries(fbgemm +- $ +- $) +-add_dependencies(fbgemm +- asmjit +- cpuinfo) ++target_link_libraries(fbgemm asmjit cpuinfo) + + if(OpenMP_FOUND) + target_link_libraries(fbgemm OpenMP::OpenMP_CXX) +@@ -383,12 +378,12 @@ install( + + if(MSVC) + if(FBGEMM_LIBRARY_TYPE STREQUAL "shared") +- install( +- FILES $ $ +- DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL) ++ # install( ++ # FILES $ $ ++ # DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL) + endif() + install(TARGETS fbgemm DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- install(TARGETS asmjit DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ # install(TARGETS asmjit DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + #Make project importable from the build directory diff --git a/packages/f/fbgemm/xmake.lua b/packages/f/fbgemm/xmake.lua new file mode 100644 index 000000000..a22bc9b32 --- /dev/null +++ b/packages/f/fbgemm/xmake.lua @@ -0,0 +1,46 @@ +package("fbgemm") + set_homepage("https://github.com/pytorch/FBGEMM") + set_description("FB (Facebook) + GEMM (General Matrix-Matrix Multiplication) - https://code.fb.com/ml-applications/fbgemm/") + set_license("BSD") + + add_urls("https://github.com/pytorch/FBGEMM/archive/refs/tags/$(version).tar.gz", + "https://github.com/pytorch/FBGEMM.git") + + add_versions("v0.7.0", "c51ac26bc0aa8fef7e80631c4abdd3a7c33d1a097359cef9b008bf9e1203c071") + + add_patches("0.7.0", "patches/0.7.0/dep-unbundle.patch", "f3117ff728989146d5ab0c370fe410c73459091f65cae5f6b304e5637889fb8f") + + -- need libtorch + add_configs("gpu", {description = "Build fbgemm_gpu library", default = false, type = "boolean"}) + add_configs("cpu", {description = "Build FBGEMM_GPU without GPU support", default = false, type = "boolean"}) + add_configs("rocm", {description = "Build FBGEMM_GPU for ROCm", default = false, type = "boolean"}) + + add_deps("cmake", "python", {kind = "binary"}) + add_deps("asmjit", "cpuinfo", "openmp") + + -- mingw support: https://github.com/pytorch/FBGEMM/pull/2114 + -- arm support: https://github.com/pytorch/FBGEMM/issues/2074 + on_install("windows|x64", "linux|x86_64", "macosx|x86_64", function (package) + io.replace("CMakeLists.txt", "-Werror", "", {plain = true}) + + if not package:config("shared") then + package:add("defines", "FBGEMM_STATIC") + end + + local configs = {"-DFBGEMM_BUILD_TESTS=OFF", "-DFBGEMM_BUILD_BENCHMARKS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DFBGEMM_LIBRARY_TYPE=" .. (package:config("shared") and "shared" or "static")) + + table.insert(configs, "-DFBGEMM_BUILD_FBGEMM_GPU=" .. (package:config("gpu") and "ON" or "OFF")) + table.insert(configs, "-DFBGEMM_CPU_ONLY=" .. (package:config("cpu") and "ON" or "OFF")) + table.insert(configs, "-DUSE_ROCM=" .. (package:config("rocm") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs, {packagedeps = {"asmjit", "cpuinfo"}}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + fbgemm::Xor128(); + } + ]]}, {configs = {languages = "c++20"}, includes = "fbgemm/QuantUtilsAvx2.h"})) + end) diff --git a/packages/f/fbthrift/xmake.lua b/packages/f/fbthrift/xmake.lua new file mode 100644 index 000000000..ba9118fd5 --- /dev/null +++ b/packages/f/fbthrift/xmake.lua @@ -0,0 +1,27 @@ +package("fbthrift") + set_homepage("https://github.com/facebook/fbthrift") + set_description("Facebook's branch of Apache Thrift, including a new C++ server.") + set_license("Apache-2.0") + + add_urls("https://github.com/facebook/fbthrift/archive/refs/tags/v$(version).00.tar.gz", + "https://github.com/facebook/fbthrift.git") + add_versions("2024.03.04", "b4981e2ec827fdf2992cb834a6c3da7d475c9dd374b8ada333d4f578b5107460") + add_versions("2024.03.11", "decfd7e211d61159778501d3847673d0212303999bbfa15913b0c05567641b84") + add_versions("2024.03.18", "e1d8d7cc0a718e3c18934ac198ee3ad63848b90e8a19d62b2b7d54f0c878089c") + add_versions("2024.03.25", "2a325446cd3a149a892c0c6abcb0f6f6cf83b72266d83ad279d2fdd9340aeef2") + add_versions("2024.04.01", "e408a973a59a37def97a8e0ec368ee9fa39c8d49c925ecf7335f1c0463c1a819") + + add_deps("cmake", "folly", "fizz", "wangle", "mvfst", "zstd", "python") + + on_install("linux", function (package) + local configs = {"-DBUILD_TESTS=OFF", + "-DBUILD_EXAMPLES=OFF", + "-DCMAKE_CXX_STANDARD=17"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cxxincludes("thrift/lib/cpp2/async/HeaderClientChannel.h", {configs = {languages = "c++17"}})) + end) diff --git a/packages/f/fcl/xmake.lua b/packages/f/fcl/xmake.lua index 25636dc4f..4e5bc195a 100644 --- a/packages/f/fcl/xmake.lua +++ b/packages/f/fcl/xmake.lua @@ -12,13 +12,21 @@ package("fcl") if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end + add_configs("octomap", {description = "Enable OctoMap library support.", default = false, type = "boolean"}) add_deps("cmake") - add_deps("eigen", "libccd", "octomap") + add_deps("eigen", "libccd") + on_load(function (package) + if package:config("octomap") then + package:add("deps", "octomap") + end + end) + on_install("windows", "macosx", "linux", function (package) local configs = {"-DFCL_BUILD_TESTS=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DFCL_STATIC_LIBRARY=" .. (package:config("shared") and "OFF" or "ON")) + table.insert(configs, "-DFCL_WITH_OCTOMAP=" .. (package:config("octomap") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) end) diff --git a/packages/f/fdk-aac/xmake.lua b/packages/f/fdk-aac/xmake.lua index fe46db1b8..20a5f919c 100644 --- a/packages/f/fdk-aac/xmake.lua +++ b/packages/f/fdk-aac/xmake.lua @@ -5,6 +5,7 @@ package("fdk-aac") add_urls("https://github.com/mstorsjo/fdk-aac/archive/refs/tags/v$(version).tar.gz", "https://github.com/mstorsjo/fdk-aac.git") + add_versions("2.0.3", "e25671cd96b10bad896aa42ab91a695a9e573395262baed4e4a2ff178d6a3a78") add_versions("2.0.0", "6e6c7921713788e31df655911e1d42620b057180b00bf16874f5d630e1d5b9a2") add_versions("2.0.1", "a4142815d8d52d0e798212a5adea54ecf42bcd4eec8092b37a8cb615ace91dc6") add_versions("2.0.2", "7812b4f0cf66acda0d0fe4302545339517e702af7674dd04e5fe22a5ade16a90") diff --git a/packages/f/ffmpeg/xmake.lua b/packages/f/ffmpeg/xmake.lua index add67e0c2..794852dc5 100644 --- a/packages/f/ffmpeg/xmake.lua +++ b/packages/f/ffmpeg/xmake.lua @@ -1,125 +1,132 @@ package("ffmpeg") - set_homepage("https://www.ffmpeg.org") set_description("A collection of libraries to process multimedia content such as audio, video, subtitles and related metadata.") set_license("GPL-3.0") - if is_plat("windows", "mingw") then - add_urls("https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-$(version)-full_build-shared.7z") - add_versions("5.1.2", "d9eb97b72d7cfdae4d0f7eaea59ccffb8c364d67d88018ea715d5e2e193f00e9") - add_versions("5.0.1", "ded28435b6f04b74f5ef5a6a13761233bce9e8e9f8ecb0eabe936fd36a778b0c") + add_urls("https://ffmpeg.org/releases/ffmpeg-$(version).tar.bz2", {alias = "home"}) + add_urls("https://github.com/FFmpeg/FFmpeg/archive/n$(version).zip", {alias = "github"}) + add_urls("https://git.ffmpeg.org/ffmpeg.git", "https://github.com/FFmpeg/FFmpeg.git", {alias = "git"}) - add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true}) - add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) - else - add_urls("https://ffmpeg.org/releases/ffmpeg-$(version).tar.bz2", {alias = "home"}) - add_urls("https://github.com/FFmpeg/FFmpeg/archive/n$(version).zip", {alias = "github"}) - add_urls("https://git.ffmpeg.org/ffmpeg.git", "https://github.com/FFmpeg/FFmpeg.git", {alias = "git"}) - add_versions("home:5.1.2", "39a0bcc8d98549f16c570624678246a6ac736c066cebdb409f9502e915b22f2b") - add_versions("home:5.1.1", "cd0e16f903421266d5ccddedf7b83b9e5754aef4b9f7a7f06ce9e4c802f0545b") - add_versions("home:5.0.1", "28df33d400a1c1c1b20d07a99197809a3b88ef765f5f07dc1ff067fac64c59d6") - add_versions("home:4.0.2", "346c51735f42c37e0712e0b3d2f6476c86ac15863e4445d9e823fe396420d056") - add_versions("github:5.1.2", "0c99f3609160f40946e2531804175eea16416320c4b6365ad075e390600539db") - add_versions("github:5.1.1", "a886fcc94792764c27c88ebe71dffbe5f0d37df8f06f01efac4833ac080c11bf") - add_versions("github:5.0.1", "f9c2e06cafa4381df8d5c9c9e14d85d9afcbc10c516c6a206f821997cc7f6440") - add_versions("github:4.0.2", "4df1ef0bf73b7148caea1270539ef7bd06607e0ea8aa2fbf1bb34062a097f026") - add_versions("git:5.1.2", "n5.1.2") - add_versions("git:5.1.1", "n5.1.1") - add_versions("git:5.0.1", "n5.0.1") - add_versions("git:4.0.2", "n4.0.2") + add_versions("home:7.0", "a24d9074bf5523a65aaa9e7bd02afe4109ce79d69bd77d104fed3dab4b934d7a") + add_versions("home:6.1", "eb7da3de7dd3ce48a9946ab447a7346bd11a3a85e6efb8f2c2ce637e7f547611") + add_versions("home:6.0.1", "2c6e294569d1ba8e99cbf1acbe49e060a23454228a540a0f45d679d72ec69a06") + add_versions("home:5.1.2", "39a0bcc8d98549f16c570624678246a6ac736c066cebdb409f9502e915b22f2b") + add_versions("home:5.1.1", "cd0e16f903421266d5ccddedf7b83b9e5754aef4b9f7a7f06ce9e4c802f0545b") + add_versions("home:5.0.1", "28df33d400a1c1c1b20d07a99197809a3b88ef765f5f07dc1ff067fac64c59d6") + add_versions("home:4.4.4", "47b1fbf70a2c090d9c0fae5910da11c6406ca92408bb69d8c935cd46c622c7ce") + add_versions("home:4.0.2", "346c51735f42c37e0712e0b3d2f6476c86ac15863e4445d9e823fe396420d056") + add_versions("github:7.0", "9ea4f1e934b1655c9a6dad579fd52fa299cd4f6a5f2b82be97daa98ff2e798d0") + add_versions("github:6.1", "7da07ff7e30bca95c0593db20442becba13ec446dd9c3331ca3d1b40eecd3c93") + add_versions("github:6.0.1", "2acb5738a1b4b262633ac2d646340403ae47120d9eb289ecad23fc90093c0d6c") + add_versions("github:5.1.2", "0c99f3609160f40946e2531804175eea16416320c4b6365ad075e390600539db") + add_versions("github:5.1.1", "a886fcc94792764c27c88ebe71dffbe5f0d37df8f06f01efac4833ac080c11bf") + add_versions("github:5.0.1", "f9c2e06cafa4381df8d5c9c9e14d85d9afcbc10c516c6a206f821997cc7f6440") + add_versions("github:4.4.4", "b0d16b48bd8ccb160e14291145294b0b12597e32b17175f7604288a8c73216de") + add_versions("github:4.0.2", "4df1ef0bf73b7148caea1270539ef7bd06607e0ea8aa2fbf1bb34062a097f026") + add_versions("git:7.0", "n7.0") + add_versions("git:6.1", "n6.1") + add_versions("git:6.0.1", "n6.0.1") + add_versions("git:5.1.2", "n5.1.2") + add_versions("git:5.1.1", "n5.1.1") + add_versions("git:5.0.1", "n5.0.1") + add_versions("git:4.0.2", "n4.0.2") - add_configs("gpl", {description = "Enable GPL code", default = true, type = "boolean"}) - add_configs("ffprobe", {description = "Enable ffprobe program.", default = false, type = "boolean"}) - add_configs("ffmpeg", {description = "Enable ffmpeg program.", default = true, type = "boolean"}) - add_configs("ffplay", {description = "Enable ffplay program.", default = false, type = "boolean"}) - add_configs("zlib", {description = "Enable zlib compression library.", default = false, type = "boolean"}) - add_configs("lzma", {description = "Enable liblzma compression library.", default = false, type = "boolean"}) - add_configs("bzlib", {description = "Enable bzlib compression library.", default = false, type = "boolean"}) - add_configs("libx264", {description = "Enable libx264 decoder.", default = false, type = "boolean"}) - add_configs("libx265", {description = "Enable libx265 decoder.", default = false, type = "boolean"}) - add_configs("iconv", {description = "Enable libiconv library.", default = false, type = "boolean"}) - add_configs("vaapi", {description = "Enable vaapi library.", default = false, type = "boolean"}) - add_configs("vdpau", {description = "Enable vdpau library.", default = false, type = "boolean"}) - add_configs("hardcoded-tables", {description = "Enable hardcoded tables.", default = true, type = "boolean"}) + add_configs("gpl", {description = "Enable GPL code", default = true, type = "boolean"}) + add_configs("ffprobe", {description = "Enable ffprobe program.", default = false, type = "boolean"}) + add_configs("ffmpeg", {description = "Enable ffmpeg program.", default = true, type = "boolean"}) + add_configs("ffplay", {description = "Enable ffplay program.", default = false, type = "boolean"}) + add_configs("zlib", {description = "Enable zlib compression library.", default = false, type = "boolean"}) + add_configs("lzma", {description = "Enable liblzma compression library.", default = false, type = "boolean"}) + add_configs("bzlib", {description = "Enable bzlib compression library.", default = false, type = "boolean"}) + add_configs("libx264", {description = "Enable libx264 encoder.", default = false, type = "boolean"}) + add_configs("libx265", {description = "Enable libx265 encoder.", default = false, type = "boolean"}) + add_configs("iconv", {description = "Enable libiconv library.", default = false, type = "boolean"}) + add_configs("vaapi", {description = "Enable vaapi library.", default = false, type = "boolean"}) + add_configs("vdpau", {description = "Enable vdpau library.", default = false, type = "boolean"}) + add_configs("hardcoded-tables", {description = "Enable hardcoded tables.", default = true, type = "boolean"}) + if is_plat("linux") then + add_configs("libdrm", {description = "Enable libdrm hardware acceleration", default = true, type = "boolean"}) end add_links("avfilter", "avdevice", "avformat", "avcodec", "swscale", "swresample", "avutil") - if is_plat("macosx") then - add_frameworks("CoreFoundation", "Foundation", "CoreVideo", "CoreMedia", "AudioToolbox", "VideoToolbox", "Security") + if is_plat("macosx", "iphoneos") then + add_frameworks("CoreFoundation", "Foundation", "CoreVideo", "CoreMedia", "VideoToolbox", "Security") + if is_plat("iphoneos") then + add_frameworks("AVFoundation") + else + add_frameworks("AudioToolbox") + end elseif is_plat("linux") then - add_syslinks("pthread") + add_syslinks("dl", "pthread") + elseif is_plat("android") then + add_syslinks("dl", "android") end - if is_plat("linux", "macosx") then - add_deps("yasm") - end + add_deps("nasm") - if on_fetch then - on_fetch("mingw", "linux", "macosx", function (package, opt) - import("lib.detect.find_tool") - if opt.system then - local result - for _, name in ipairs({"libavcodec", "libavdevice", "libavfilter", "libavformat", "libavutil", "libpostproc", "libswresample", "libswscale"}) do - local pkginfo = package:find_package("pkgconfig::" .. name, opt) - if pkginfo then - pkginfo.version = nil - if not result then - result = pkginfo - else - result = result .. pkginfo - end + on_fetch("mingw", "linux", "macosx", function (package, opt) + import("lib.detect.find_tool") + if opt.system then + local result + for _, name in ipairs({"libavcodec", "libavdevice", "libavfilter", "libavformat", "libavutil", "libpostproc", "libswresample", "libswscale"}) do + local pkginfo = package:find_package("pkgconfig::" .. name, opt) + if pkginfo then + pkginfo.version = nil + if not result then + result = pkginfo else - return + result = result .. pkginfo end + else + return end - local ffmpeg = find_tool("ffmpeg", {check = "-help", version = true, command = "-version", parse = "%d+%.?%d+%.?%d+", force = true}) - if ffmpeg then - result.version = ffmpeg.version - end - return result end - end) - end + local ffmpeg = find_tool("ffmpeg", {check = "-help", version = true, command = "-version", parse = "%d+%.?%d+%.?%d+", force = true}) + if ffmpeg then + result.version = ffmpeg.version + end + return result + end + end) - on_load("linux", "macosx", "android", function (package) + on_load(function (package) local configdeps = {zlib = "zlib", bzlib = "bzip2", lzma = "xz", libx264 = "x264", libx265 = "x265", - iconv = "libiconv"} + iconv = "libiconv", + libdrm = "libdrm"} for name, dep in pairs(configdeps) do if package:config(name) then package:add("deps", dep) end end -- https://www.ffmpeg.org/platform.html#toc-Advanced-linking-configuration - if package:config("pic") ~= false and not package:is_plat("macosx") then + if package:config("pic") ~= false and not package:is_plat("windows", "macosx", "iphoneos") then package:add("shflags", "-Wl,-Bsymbolic") package:add("ldflags", "-Wl,-Bsymbolic") end if not package:config("gpl") then package:set("license", "LGPL-3.0") end + if package:is_plat("windows", "mingw") and not package:config("shared") then + package:add("syslinks", "Bcrypt", "Mfplat", "mfuuid", "Ole32", "Secur32", "Strmiids", "User32", "ws2_32") + end + if is_subhost("windows") and os.arch() == "x64" then + if package:is_plat("windows", "mingw") then + package:add("deps", "msys2", {configs = {msystem = "MINGW64", base_devel = true}}) + else + package:add("deps", "msys2", {configs = {msystem = "MINGW64", mingw64_gcc = true, base_devel = true}}) + end + end end) - on_install("windows|x64", "mingw|x86_64", function (package) - os.cp("bin", package:installdir()) - os.cp("include", package:installdir()) - os.cp("lib", package:installdir()) - package:addenv("PATH", "bin") - end) - - on_install("linux", "macosx", "android@linux,macosx", function (package) + on_install("windows", "mingw@windows,linux,cygwin,msys", "linux", "macosx", "android", "iphoneos", function (package) local configs = {"--enable-version3", "--disable-doc"} - if package:config("gpl") then - table.insert(configs, "--enable-gpl") - end - if package:is_plat("macosx") and macos.version():ge("10.8") then - table.insert(configs, "--enable-videotoolbox") - end - for name, enabled in pairs(package:configs()) do + configs.host = "" -- prevents xmake to add a --host=xx parameter (unsupported by ffmpeg configure script) + for name, enabled in table.orderpairs(package:configs()) do if not package:extraconf("configs", name, "builtin") then if enabled then table.insert(configs, "--enable-" .. name) @@ -140,7 +147,116 @@ package("ffmpeg") else table.insert(configs, "--disable-debug") end - if package:is_plat("android") then + + if package:is_plat("windows") then + table.insert(configs, "--target-os=win32") + table.insert(configs, "--enable-w32threads") + table.insert(configs, "--enable-d3d11va") + table.insert(configs, "--enable-dxva2") + table.insert(configs, "--enable-mediafoundation") + table.insert(configs, "--toolchain=msvc") + elseif package:is_plat("mingw") then + if package:is_arch("x86", "i386", "i686") then + table.insert(configs, "--target-os=mingw32") + elseif package:is_arch("x86_64") then + table.insert(configs, "--target-os=mingw64") + else + raise("unknown mingw arch " .. package:arch()) + end + elseif package:is_plat("linux") then + table.insert(configs, "--target-os=linux") + table.insert(configs, "--enable-pthreads") + elseif package:is_plat("macosx", "iphoneos") then + table.insert(configs, "--target-os=darwin") + if package:is_plat("macosx") then + table.insert(configs, "--enable-appkit") + table.insert(configs, "--enable-audiotoolbox") + else + -- ffmpeg does not support audiotoolbox on iOS: https://github.com/kewlbear/FFmpeg-iOS-build-script/issues/158 + table.insert(configs, "--disable-audiotoolbox") + end + if macos.version():ge("10.7") then + table.insert(configs, "--enable-avfoundation") + end + if macos.version():ge("10.8") then + table.insert(configs, "--enable-videotoolbox") + end + if macos.version():ge("10.11") then + table.insert(configs, "--enable-coreimage") + end + elseif package:is_plat("android") then + table.insert(configs, "--target-os=android") + table.insert(configs, "--enable-neon") + table.insert(configs, "--enable-asm") + table.insert(configs, "--enable-jni") + table.insert(configs, "--enable-mediacodec") + else + raise("unexpected platform") + end + + if package:is_cross() then + table.insert(configs, "--enable-cross-compile") + table.insert(configs, "--arch=" .. package:targetarch()) + end + + if package:is_plat("windows") then + if path.cygwin then -- xmake 2.8.9 + import("package.tools.autoconf") + local envs = autoconf.buildenvs(package, {packagedeps = "libiconv"}) + -- add gas-preprocessor to PATH + if package:is_arch("arm", "arm64") then + envs.PATH = path.join(os.programdir(), "scripts") .. path.envsep() .. envs.PATH + end + autoconf.install(package, configs, {envs = envs}) + else + import("core.base.option") + import("core.tool.toolchain") + local msvc = package:toolchain("msvc") or toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + assert(msvc:check(), "vs not found!") + local buildenvs = import("package.tools.autoconf").buildenvs(package) + -- keep msys2 envs in front to prevent conflict with possibly installed sh.exe + local envs = os.joinenvs(os.getenvs(), msvc:runenvs()) + -- fix PKG_CONFIG_PATH for checking deps, e.g. x264, x265 .. + -- @see https://github.com/xmake-io/xmake-repo/issues/3442 + local pkg_config_path = buildenvs.PKG_CONFIG_PATH + if pkg_config_path then + local paths = {} + for _, p in ipairs(path.splitenv(pkg_config_path)) do + p = p:gsub("\\", "/") + -- c:\, C:\ -> /c/ + p = p:gsub("^(%w):", function (drive) return "/" .. drive:lower() end) + table.insert(paths, p) + end + envs.PKG_CONFIG_PATH = table.concat(paths, ":") + end + envs.SHELL = "sh" + + -- add gas-preprocessor to PATH + if package:is_arch("arm", "arm64") then + envs.PATH = path.join(os.programdir(), "scripts") .. path.envsep() .. envs.PATH + end + + table.insert(configs, "--prefix=" .. package:installdir():gsub("\\", "/")) + os.vrunv("./configure", configs, {shell = true, envs = envs}) + + local njob = option.get("jobs") or tostring(os.default_njob()) + local argv = {"-j" .. njob} + if option.get("verbose") then + table.insert(argv, "V=1") + end + os.vrunv("make", argv, {envs = envs}) + os.vrunv("make", {"install"}, {envs = envs}) + end + if package:config("shared") then + -- move .lib from bin/ to lib/ + os.vmv(package:installdir("bin", "*.lib"), package:installdir("lib")) + else + -- rename files from libxx.a to xx.lib + for _, libfile in ipairs(os.files(package:installdir("lib", "*.a"))) do + os.vmv(libfile, libfile:gsub("^(.+[\\/])lib(.+)%.a$", "%1%2.lib")) + end + end + elseif package:is_plat("android") then import("core.base.option") import("core.tool.toolchain") local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) @@ -157,44 +273,65 @@ package("ffmpeg") cpu = "armv7-a" triple = "armv7a-linux-androideabi" cross_prefix = path.join(bin, "arm-linux-androideabi-") + elseif package:is_arch("x86") then + arch = "x86_android" + cpu = "x86" + triple = "i686-linux-android" + cross_prefix = path.join(bin, "i686-linux-android-") + elseif package:is_arch("x86_64") then + arch = "x86_64_android" + cpu = "x86_64" + triple = "x86_64-linux-android" + cross_prefix = path.join(bin, "x86_64-linux-android-") else raise("unknown arch(%s) for android!", package:arch()) end + local _translate_path + if is_host("windows") then + _translate_path = function (p) return p and p:gsub("\\", "/") or p end + else + _translate_path = function (p) return p end + end local sysroot = path.join(path.directory(bin), "sysroot") local cflags = table.join(table.wrap(package:config("cxflags")), table.wrap(package:config("cflags")), table.wrap(get_config("cxflags")), get_config("cflags")) local cxxflags = table.join(table.wrap(package:config("cxflags")), table.wrap(package:config("cxxflags")), table.wrap(get_config("cxflags")), get_config("cxxflags")) assert(os.isdir(sysroot), "we do not support old version ndk!") if package:is_arch("arm64-v8a") then table.insert(cflags, "-mfpu=neon") - table.insert(cflags, "-mfloat-abi=soft") + table.insert(cflags, "-mfloat-abi=hard") else table.insert(cflags, "-mfpu=neon") table.insert(cflags, "-mfloat-abi=soft") end - table.insert(configs, "--enable-neon") - table.insert(configs, "--enable-asm") - table.insert(configs, "--enable-jni") - table.insert(configs, "--target-os=android") - table.insert(configs, "--enable-cross-compile") table.insert(configs, "--disable-avdevice") table.insert(configs, "--arch=" .. arch) table.insert(configs, "--cpu=" .. cpu) - table.insert(configs, "--cc=" .. path.join(bin, triple .. ndk_sdkver .. "-clang")) - table.insert(configs, "--cxx=" .. path.join(bin, triple .. ndk_sdkver .. "-clang++")) + table.insert(configs, "--cc=" .. _translate_path(path.join(bin, triple .. ndk_sdkver .. "-clang"))) + table.insert(configs, "--cxx=" .. _translate_path(path.join(bin, triple .. ndk_sdkver .. "-clang++"))) + table.insert(configs, "--ar=" .. _translate_path(path.join(bin, "llvm-ar"))) + table.insert(configs, "--ranlib=" .. _translate_path(path.join(bin, "llvm-ranlib"))) + table.insert(configs, "--strip=" .. _translate_path(path.join(bin, "llvm-strip"))) table.insert(configs, "--extra-cflags=" .. table.concat(cflags, ' ')) table.insert(configs, "--extra-cxxflags=" .. table.concat(cxxflags, ' ')) - table.insert(configs, "--sysroot=" .. sysroot) - table.insert(configs, "--cross-prefix=" .. cross_prefix) - table.insert(configs, "--prefix=" .. package:installdir()) - os.vrunv("./configure", configs) - local argv = {"-j4"} - if option.get("verbose") then + table.insert(configs, "--sysroot=" .. _translate_path(sysroot)) + table.insert(configs, "--cross-prefix=" .. _translate_path(cross_prefix)) + table.insert(configs, "--prefix=" .. _translate_path(package:installdir())) + os.vrunv("./configure", configs, {shell = true}) + local njob = option.get("jobs") or tostring(os.default_njob()) + local argv = {"-j" .. njob} + if option.get("verbose") or is_subhost("windows") then -- we always need enable it on windows, otherwise it will fail. table.insert(argv, "V=1") end os.vrunv("make", argv) os.vrun("make install") else - import("package.tools.autoconf").install(package, configs) + local opt + if package:is_plat("macosx") and package:is_arch("arm.*") and package:config("shared") then + opt = {} + -- https://github.com/spack/spack/issues/40159 + opt.shflags = "-Wl,-ld_classic" + end + import("package.tools.autoconf").install(package, configs, opt) end package:addenv("PATH", "bin") end) diff --git a/packages/f/fizz/xmake.lua b/packages/f/fizz/xmake.lua new file mode 100644 index 000000000..25aaf684c --- /dev/null +++ b/packages/f/fizz/xmake.lua @@ -0,0 +1,29 @@ +package("fizz") + set_homepage("https://github.com/facebookincubator/fizz") + set_description("C++14 implementation of the TLS-1.3 standard ") + set_license("BSD") + + add_urls("https://github.com/facebookincubator/fizz/releases/download/v$(version).00/fizz-v$(version).00.zip", + "https://github.com/facebookincubator/fizz.git") + add_versions("2024.02.26", "fa389dca0c49e14e83e089f07f896bf616757b3c70723ddfac7be2e3fd1f312f") + add_versions("2024.03.04", "1a7da63780ae1bbcc00f9a317911e814a49f84e4d9009254328ea0a5e121817f") + add_versions("2024.03.11", "96693000954ed352eae4df3113ef6b1c8b2237100a83b8987dcf067ecfe8c2e8") + add_versions("2024.03.18", "f46799dda118ec5a35cf7533e00daf25e7b2d7c58f00b80ba6c0388b19190c6f") + add_versions("2024.03.25", "bcf9c551719bc86318a77e2b13769d52679642b98728e645900485d7a90c0f8b") + add_versions("2024.04.01", "caf2cf1ba8f6db66abbadf382fb3e0667888567c4ac0d8f74ec92e1fb27c3727") + + add_deps("cmake", "folly", "libsodium") + + on_install("linux", "macosx", function (package) + os.cd("fizz") + local configs = {"-DBUILD_TESTS=OFF", + "-DBUILD_EXAMPLES=OFF", + "-DCMAKE_CXX_STANDARD=17"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cxxincludes("fizz/server/AsyncFizzServer.h", {configs = {languages = "c++17"}})) + end) diff --git a/packages/f/flann/xmake.lua b/packages/f/flann/xmake.lua index 8887749f9..0c76ce268 100644 --- a/packages/f/flann/xmake.lua +++ b/packages/f/flann/xmake.lua @@ -7,6 +7,7 @@ package("flann") add_urls("https://github.com/flann-lib/flann/archive/refs/tags/$(version).tar.gz", "https://github.com/flann-lib/flann.git") add_versions("1.9.1", "b23b5f4e71139faa3bcb39e6bbcc76967fbaf308c4ee9d4f5bfbeceaa76cc5d3") + add_versions("1.9.2", "e26829bb0017f317d9cc45ab83ddcb8b16d75ada1ae07157006c1e7d601c8824") add_patches("1.9.1", path.join(os.scriptdir(), "patches", "1.9.1", "cuda10.patch"), "087492b422362f42c83b320296d9af7b22023cf20d81ea7bd99efabd1535f7d6") diff --git a/packages/f/flatbuffers/xmake.lua b/packages/f/flatbuffers/xmake.lua index bfaec8afb..fa57002ea 100644 --- a/packages/f/flatbuffers/xmake.lua +++ b/packages/f/flatbuffers/xmake.lua @@ -9,6 +9,7 @@ package("flatbuffers") add_versions("v1.12.0", "4b8b21adbfe8a74b90604161afcf87c125a26b86c99327e7a04525080606536c") add_versions("v2.0.0", "ffd68aebdfb300c9e82582ea38bf4aa9ce65c77344c94d5047f3be754cc756ea") add_versions("v23.1.21", "48597d6a6f8ca67a02ae8d8494b3bfc9136eb93da60a538d5bfc024f7c564f97") + add_versions("v23.5.26", "57bd580c0772fd1a726c34ab8bf05325293bc5f9c165060a898afa1feeeb95e1") add_deps("cmake") on_install("windows", "linux", "macosx", "mingw", "android", "iphoneos", "cross", function(package) diff --git a/packages/f/flecs/xmake.lua b/packages/f/flecs/xmake.lua index 504221be3..fe94240ff 100644 --- a/packages/f/flecs/xmake.lua +++ b/packages/f/flecs/xmake.lua @@ -5,6 +5,10 @@ package("flecs") add_urls("https://github.com/SanderMertens/flecs/archive/refs/tags/$(version).tar.gz", "https://github.com/SanderMertens/flecs.git") + add_versions("v3.2.11", "8ebc5f6f3ec7bbba30b0afe9d22f157437925772857ea1c6e4201eb5d31b4fe5") + add_versions("v3.2.10", "b799e85d47b3e5c2e631ebbd3b81cc6af4be574fccbe07099c58252182827a88") + add_versions("v3.2.9", "65d50d6058cd38308a0ad2a971afa9f64aef899ebf78d6a074d905922ec5fdf8") + add_versions("v3.2.8", "b40453a77b66e220408c50b119da54b153c248cf6f7025575e3fd1a8ff79f748") add_versions("v3.2.7", "45691b6d5f05f76d5f895b2f3b4efac9491be7eb2b21112f02381e2c5dfb853e") add_versions("v3.2.6", "ce3843eecfab359c8293366149bb0c0068ae8140583dd43d8337a8feccd7cb28") add_versions("v3.2.5", "d487aa39818978b5aaf94d96bdffe14ddee68c2fd969a765ce0b3561d6d574df") diff --git a/packages/f/fluidsynth/patches/find-intl.patch b/packages/f/fluidsynth/patches/find-intl.patch new file mode 100644 index 000000000..3bc98152a --- /dev/null +++ b/packages/f/fluidsynth/patches/find-intl.patch @@ -0,0 +1,409 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 986b594..77e6d2b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -356,6 +356,8 @@ endif ( WIN32 ) + # Check for threads and math + find_package ( Threads REQUIRED ) + ++unset ( HAS_LIBM CACHE ) ++unset ( MATH_LIBRARY CACHE ) + find_library ( HAS_LIBM NAMES "m" ) + if ( HAS_LIBM ) + set ( MATH_LIBRARY "m" ) +diff --git a/cmake_admin/FindFLAC.cmake b/cmake_admin/FindFLAC.cmake +deleted file mode 100644 +index 2de2f41..0000000 +--- a/cmake_admin/FindFLAC.cmake ++++ /dev/null +@@ -1,106 +0,0 @@ +-#[=======================================================================[.rst: +-FindFLAC +-------- +- +-Finds the FLAC library. +- +-Imported Targets +-^^^^^^^^^^^^^^^^ +- +-This module provides the following imported targets, if found: +- +-``FLAC::FLAC`` +- The FLAC C library. +-``FLAC::FLAC++`` +- The FLAC C++ library. +- +-Result Variables +-^^^^^^^^^^^^^^^^ +- +-This will define the following variables: +- +-``FLAC_FOUND`` +- True if both libraries were found. +-``FLAC_FLAC_FOUND`` +- True if the C library was found. +-``FLAC_FLAC++_FOUND`` +- True if the C++ library was found.. +- +-#]=======================================================================] +- +-# Use pkg-config if available +-find_package(PkgConfig QUIET) +-pkg_check_modules(PC_FLAC QUIET flac) +-pkg_check_modules(PC_FLAC++ QUIET flac++) +- +-# Find the headers and libraries +-find_path( +- FLAC_INCLUDE_DIR +- NAMES "FLAC/all.h" +- HINTS "PC_FLAC_INCLUDEDIR") +- +-find_path( +- FLAC++_INCLUDE_DIR +- NAMES "FLAC++/all.h" +- HINTS "PC_FLAC++_INCLUDEDIR") +- +-find_library( +- FLAC_LIBRARY +- NAMES "FLAC" +- HINTS "${PC_FLAC_LIBDIR}") +- +-find_library( +- FLAC++_LIBRARY +- NAMES "FLAC++" +- HINTS "${PC_FLAC++_LIBDIR}") +- +-# Handle transitive dependencies +-if(PC_FLAC_FOUND) +- get_target_properties_from_pkg_config("${FLAC_LIBRARY}" "PC_FLAC" "_flac") +-else() +- if(NOT TARGET "Ogg::ogg") +- find_package(Ogg QUIET) +- endif() +- set(_flac_link_libraries "Ogg::ogg" ${MATH_LIBRARY}) +-endif() +- +-if(PC_FLAC++_FOUND) +- get_target_properties_from_pkg_config("${FLAC++_LIBRARY}" "PC_FLAC++" +- "_flac++") +-else() +- set(_flac++_link_libraries "FLAC::FLAC") +-endif() +- +-# Forward the result to CMake +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args( +- FLAC REQUIRED_VARS "FLAC_LIBRARY" "FLAC_INCLUDE_DIR" "FLAC++_LIBRARY" +- "FLAC++_INCLUDE_DIR") +- +-# Create the target +-if(FLAC_FOUND AND NOT TARGET FLAC::FLAC) +- add_library(FLAC::FLAC UNKNOWN IMPORTED) +- set_target_properties( +- FLAC::FLAC +- PROPERTIES IMPORTED_LOCATION "${FLAC_LIBRARY}" +- INTERFACE_COMPILE_OPTIONS "${_flac_compile_options}" +- INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE_DIR}" +- INTERFACE_LINK_LIBRARIES "${_flac_link_libraries}" +- INTERFACE_LINK_DIRECTORIES "${_flac_link_directories}") +- set(FLAC_FLAC_FOUND TRUE) +-endif() +- +-if(FLAC_FOUND AND NOT TARGET FLAC::FLAC++) +- add_library(FLAC::FLAC++ UNKNOWN IMPORTED) +- set_target_properties( +- FLAC::FLAC++ +- PROPERTIES IMPORTED_LOCATION "${FLAC++_LIBRARY}" +- INTERFACE_COMPILE_OPTIONS "${_flac++_compile_options}" +- INTERFACE_INCLUDE_DIRECTORIES "${FLAC++_INCLUDE_DIR}" +- INTERFACE_LINK_LIBRARIES "${_flac++_link_libraries}" +- INTERFACE_LINK_DIRECTORIES "${_flac++_link_directories}") +- set(FLAC_FLAC++_FOUND TRUE) +-endif() +- +-mark_as_advanced(FLAC_LIBRARY FLAC_INCLUDE_DIR FLAC++_LIBRARY +- FLAC++_INCLUDE_DIR) +diff --git a/cmake_admin/FindGLib2.cmake b/cmake_admin/FindGLib2.cmake +index f6fa6f1..b7821bf 100644 +--- a/cmake_admin/FindGLib2.cmake ++++ b/cmake_admin/FindGLib2.cmake +@@ -64,6 +64,14 @@ find_library( + NAMES "gobject-2.0" + HINTS "${PC_GOBJECT2_LIBDIR}") + ++find_library( ++ Intl_LIBRARY ++ NAMES "intl") ++ ++find_library( ++ Pcre_LIBRARY ++ NAMES "pcre") ++ + # GLib stores its config in lib/glib-2.0/include + get_filename_component(_glib2_libdir "${GLib2_glib-2_LIBRARY}" PATH) + find_path( +@@ -102,12 +110,15 @@ find_package_handle_standard_args( + "GLib2_INCLUDE_DIRS" + VERSION_VAR "GLib2_VERSION") + ++get_filename_component(_intl_path "${Intl_LIBRARY}" DIRECTORY) ++ + # Create the targets + if(GLib2_glib-2_LIBRARY AND NOT TARGET GLib2::glib-2) + # Handle transitive dependencies + if(PC_GLIB2_FOUND) + get_target_properties_from_pkg_config("${GLib2_glib-2_LIBRARY}" "PC_GLIB2" + "_glib2") ++ list(APPEND _glib2_link_directories "${_intl_path}") + else() + find_package(Intl QUIET) + find_package(Iconv QUIET) +@@ -118,36 +129,9 @@ if(GLib2_glib-2_LIBRARY AND NOT TARGET GLib2::glib-2) + list(APPEND _glib2_link_libraries "Threads::Threads") + endif() + list(APPEND _glib2_link_libraries ${MATH_LIBRARY}) +- +- # Glib can link to either PCRE 1 or 2 +- find_library( +- _pcre2_8bit_library +- NAMES "pcre2-8" +- HINTS "${PC_GLIB2_LIBDIR}") +- if(_pcre2_8bit_library) +- include(CheckCSourceCompiles) +- set(_backup_includes ${CMAKE_REQUIRED_INCLUDES}) +- set(_backup_libraries ${CMAKE_REQUIRED_LIBRARIES}) +- set(_backup_libdir ${CMAKE_REQUIRED_LIBRARIES}) +- set(CMAKE_REQUIRED_INCLUDES "${GLib2_INCLUDE_DIRS}") +- set(CMAKE_REQUIRED_LIBRARIES +- "${GLib2_glib-2_LIBRARY}" "${_glib2_link_libraries}" +- "${_pcre2_8bit_library}") +- check_c_source_compiles( +- "#include +- int main(){ +- g_regex_error_quark(); +- }" +- GLIB2_USES_PCRE2) +- set(CMAKE_REQUIRED_INCLUDES ${_backup_includes}) +- set(CMAKE_REQUIRED_LIBRARIES ${_backup_libraries}) +- endif() +- if(GLIB2_USES_PCRE2) +- list(APPEND _glib2_link_libraries "${_pcre2_8bit_library}") +- else() +- list(APPEND _glib2_link_libraries "pcre") +- endif() + endif() ++ get_filename_component(_pcre_path "${Pcre_LIBRARY}" DIRECTORY) ++ list(APPEND _glib2_link_directories "${_pcre_path}") + + # pkg_check_modules consider these as LDFLAGS_OTHER rather instead of + # libraries +@@ -172,6 +156,7 @@ if(GLib2_gthread-2_LIBRARY AND NOT TARGET GLib2::gthread-2) + if(PC_GTHREAD2_FOUND) + get_target_properties_from_pkg_config("${GLib2_gthread-2_LIBRARY}" + "PC_GTHREAD2" "_gthread2") ++ list(APPEND _glib2_link_directories "${_intl_path}") + else() + set(_gthread2_link_libraries "Threads::Threads" "GLib2::glib-2") + endif() +@@ -191,6 +176,7 @@ if(GLib2_gmodule-2_LIBRARY AND NOT TARGET GLib2::gmodule-2) + if(PC_GMODULE2_FOUND) + get_target_properties_from_pkg_config("${GLib2_gmodule-2_LIBRARY}" + "PC_GMODULE2" "_gmodule2") ++ list(APPEND _glib2_link_directories "${_intl_path}") + else() + set(_gmodule2_link_libraries "GLib2::glib-2") + endif() +@@ -210,6 +196,7 @@ if(GLib2_gobject-2_LIBRARY AND NOT TARGET GLib2::gobject-2) + if(PC_GOBJECT2_FOUND) + get_target_properties_from_pkg_config("${GLib2_gobject-2_LIBRARY}" + "PC_OBJECT2" "_gobject2") ++ list(APPEND _glib2_link_directories "${_intl_path}") + else() + find_package(libffi QUIET) + set(_gobject2_link_libraries "libffi" "GLib2::glib-2") +diff --git a/cmake_admin/FindSndFile.cmake b/cmake_admin/FindSndFile.cmake +deleted file mode 100644 +index d77333b..0000000 +--- a/cmake_admin/FindSndFile.cmake ++++ /dev/null +@@ -1,180 +0,0 @@ +-#[=======================================================================[.rst: +-FindSndFile +-------- +- +-Finds the SndFile library. +- +-Imported Targets +-^^^^^^^^^^^^^^^^ +- +-This module provides the following imported targets, if found: +- +-``SndFile::sndfile`` +- The SndFile library +- +-Result Variables +-^^^^^^^^^^^^^^^^ +- +-This will define the following variables: +- +-``SndFile_FOUND`` +- True if the system has the SndFile library. +-``SndFile_VERSION`` +- The version of the SndFile library which was found. +-``SndFile_WITH_EXTERNAL_LIBS`` +- True if the library was built with Xiph codecs. +- +-For compatibility with upstream, the following variables are also set: +- +-``SndFile_WITH_MPEG`` +-``SndFile_VERSION_MAJOR`` +-``SndFile_VERSION_MINOR`` +-``SndFile_VERSION_PATCH`` +-``SndFile_LIBRARY`` +-``SndFile_LIBRARIES`` +-``SNDFILE_LIBRARY`` +-``SNDFILE_LIBRARIES`` +-``SNDFILE_INCLUDE_DIR`` +- +-#]=======================================================================] +- +-# Use pkg-config if available +-find_package(PkgConfig QUIET) +-pkg_check_modules(PC_SNDFILE QUIET sndfile) +- +-# Find the headers and libraries +-find_path( +- SndFile_INCLUDE_DIR +- NAMES "sndfile.h" +- HINTS "${PC_SNDFILE_INCLUDEDIR}") +- +-find_library( +- _sndfile_library +- NAMES "sndfile" +- HINTS "${PC_SNDFILE_LIBDIR}") +- +-# Get version from pkg-config or read the config header +-if(PC_SNDFILE_VERSION) +- set(SndFile_VERSION "${PC_SNDFILE_VERSION}") +- string(REPLACE "." ";" _sndfile_version_list "${SndFile_VERSION}") +- list(GET _sndfile_version_list 0 SndFile_VERSION_MAJOR) +- list(GET _sndfile_version_list 1 SndFile_VERSION_MINOR) +- list(GET _sndfile_version_list 2 SndFile_VERSION_PATCH) +-elseif(SndFile_INCLUDE_DIR) +- file(READ "${SndFile_INCLUDE_DIR}/sndfile.h" _sndfile_h) +- if("#define SNDFILE_1" MATCHES _snfile_h) +- set(SndFile_VERSION "1") +- set(SndFile_VERSION_MAJOR "1") +- endif() +-endif() +- +-# Check the features SndFile was built with +-if(PC_SNDFILE_FOUND) +- if("vorbis" IN_LIST PC_SNDFILE_STATIC_LIBRARIES) +- set(SndFile_WITH_EXTERNAL_LIBS TRUE) +- endif() +- if("mpg123" IN_LIST PC_SNDFILE_STATIC_LIBRARIES) +- set(SndFile_WITH_MPEG TRUE) +- endif() +-elseif(_sndfile_library) +- # sndfile may need any of these libraries +- find_package(Ogg 1.3 QUIET) +- find_package(Vorbis QUIET) +- find_package(FLAC QUIET) +- find_package(Opus QUIET) +- find_package(mp3lame QUIET) +- find_package(mpg123 QUIET) +- +- if(NOT CMAKE_CROSSCOMPILING) +- include(CheckSourceRuns) +- set(_backup_includes ${CMAKE_REQUIRED_INCLUDES}) +- set(_backup_libraries ${CMAKE_REQUIRED_LIBRARIES}) +- set(CMAKE_REQUIRED_INCLUDES "${SndFile_INCLUDE_DIR}") +- set(CMAKE_REQUIRED_LIBRARIES "${_sndfile_library}") +- +- set(_optional_libs "MPG123::libmpg123" "mp3lame::mp3lame" "FLAC::FLAC" +- "Opus::opus" "Vorbis::vorbisenc" "Ogg::ogg") +- foreach(_target ${_optional_libs}) +- if(TARGET "${_target}") +- list(APPEND CMAKE_REQUIRED_LIBRARIES "${_target}") +- endif() +- endforeach() +- +- check_source_runs( +- C +- "#include +-#include +-int main() { +- SF_FORMAT_INFO info = {SF_FORMAT_VORBIS}; +- sf_command(NULL, SFC_GET_FORMAT_INFO, &info, sizeof info); +- return info.name != NULL ? EXIT_SUCCESS : EXIT_FAILURE; +-}" +- SNDFILE_SUPPORTS_VORBIS) +- +- check_source_runs( +- C +- "#include +-#include +-int main() { +- SF_FORMAT_INFO info = {SF_FORMAT_MPEG_LAYER_III}; +- sf_command(NULL, SFC_GET_FORMAT_INFO, &info, sizeof info); +- return info.name != NULL ? EXIT_SUCCESS : EXIT_FAILURE; +-}" +- SNDFILE_SUPPORTS_MPEG) +- +- set(SndFile_WITH_EXTERNAL_LIBS ${SNDFILE_SUPPORTS_VORBIS}) +- set(SndFile_WITH_MPEG ${SNDFILE_SUPPORTS_MPEG}) +- set(CMAKE_REQUIRED_INCLUDES ${_backup_includes}) +- set(CMAKE_REQUIRED_LIBRARIES ${_backup_libraries}) +- else() +- message( +- STATUS +- "Cross-compiling without pkg-config - cannot check for external libraries." +- "If you have the upstream CMake config set CMAKE_FIND_PACKAGE_PREFER_CONFIG to true for accurate results." +- ) +- set(SndFile_WITH_EXTERNAL_LIBS FALSE) +- set(SndFile_WITH_MPEG FALSE) +- endif() +-endif() +- +-# Handle transitive dependencies +-if(PC_SNDFILE_FOUND) +- get_target_properties_from_pkg_config("${_sndfile_library}" "PC_SNDFILE" +- "_sndfile") +-else() +- if(SndFile_WITH_EXTERNAL_LIBS) +- list(APPEND _sndfile_link_libraries "FLAC::FLAC" "Opus::opus" +- "Vorbis::vorbisenc" "Ogg::ogg") +- endif() +- if(SndFile_WITH_MPEG) +- list(APPEND _sndfile_link_libraries "MPG123::libmpg123" "mp3lame::mp3lame") +- endif() +-endif() +- +-# Forward the result to CMake +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args( +- SndFile +- REQUIRED_VARS "_sndfile_library" "SndFile_INCLUDE_DIR" +- VERSION_VAR "SndFile_VERSION") +- +-if(SndFile_FOUND AND NOT TARGET SndFile::sndfile) +- add_library(SndFile::sndfile UNKNOWN IMPORTED) +- set_target_properties( +- SndFile::sndfile +- PROPERTIES IMPORTED_LOCATION "${_sndfile_library}" +- INTERFACE_COMPILE_OPTIONS "${_sndfile_compile_options}" +- INTERFACE_INCLUDE_DIRECTORIES "${SndFile_INCLUDE_DIR}" +- INTERFACE_LINK_LIBRARIES "${_sndfile_link_libraries}" +- INTERFACE_LINK_DIRECTORIES "${_sndfile_link_directories}") +- +- # Set additional variables for compatibility with upstream config +- set(SNDFILE_FOUND TRUE) +- set(SndFile_LIBRARY SndFile::sndfile) +- set(SndFile_LIBRARIES SndFile::sndfile) +- set(SNDFILE_LIBRARY SndFile::sndfile) +- set(SNDFILE_LIBRARIES SndFile::sndfile) +- set(SNDFILE_INCLUDE_DIR "${SndFile_INCLUDE_DIR}") +-endif() +- +-mark_as_advanced(_sndfile_library) diff --git a/packages/f/fluidsynth/xmake.lua b/packages/f/fluidsynth/xmake.lua new file mode 100644 index 000000000..cee955255 --- /dev/null +++ b/packages/f/fluidsynth/xmake.lua @@ -0,0 +1,92 @@ +package("fluidsynth") + + set_homepage("https://www.fluidsynth.org/") + set_description("FluidSynth is a real-time software synthesizer based on the SoundFont 2 specifications and has reached widespread distribution.") + set_license("LGPL-2.1") + + add_urls("https://github.com/FluidSynth/fluidsynth/archive/refs/tags/$(version).zip", + "https://github.com/FluidSynth/fluidsynth.git") + add_versions("v2.3.3", "0ab6f1aae1c7652b9249de2d98070313f3083046fddd673277556f1cca65568e") + + if is_plat("windows", "macosx") then + add_patches("v2.3.3", path.join(os.scriptdir(), "patches", "find-intl.patch"), "dafdb8f11957ed2f396832fe3b63933e8a32b96d8c836166b2fefacf3f918a9d") + end + + add_configs("aufile", {description = "Compile support for sound file output", default = true, type = "boolean"}) + add_configs("dbus", {description = "Compile DBUS support", default = not is_plat("windows"), type = "boolean"}) + add_configs("jack", {description = "Compile JACK support", default = false, type = "boolean"}) + add_configs("libsndfile", {description = "Compile libsndfile support", default = true, type = "boolean"}) + add_configs("opensles", {description = "compile OpenSLES support", default = false, type = "boolean"}) + add_configs("network", {description = "Enable network support (requires BSD or WIN sockets)", default = false, type = "boolean"}) + add_configs("sdl2", {description = "Compile SDL2 audio support ", default = false, type = "boolean"}) + if is_plat("linux") then + add_configs("pulseaudio", {description = "Compile PulseAudio support", default = false, type = "boolean"}) + end + add_configs("readline", {description = "Compile support for sound file output", default = false, type = "boolean"}) + add_configs("threads", {description = "Enable multi-threading support (such as parallel voice synthesis)", default = true, type = "boolean"}) + add_configs("openmp", {description = "Enable OpenMP support (parallelization of soundfont decoding, vectorization of voice mixing, etc.)", default = false, type = "boolean"}) + if is_plat("macosx") then + add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) + end + + add_deps("cmake") + add_deps("glib") + add_deps("libiconv") + if is_plat("windows") then + add_deps("libintl") + add_deps("pkgconf") + add_syslinks("ws2_32") + elseif is_plat("linux") then + add_deps("pkg-config") + else + add_deps("libintl") + add_deps("pkg-config") + end + + on_load(function (package) + local configdeps = { + dbus = "dbus", + libsndfile = "libsndfile", + openmp = "openmp", + readline = "readline", + sdl2 = "libsdl" + } + for config, info in pairs(configdeps) do + if package:config(config) then + package:add("deps", info) + end + end + if package:config("opensles") then + package:add("links", "OpenSLES") + end + end) + + on_install("windows", "linux", "macosx", function (package) + local configs = {} + local configopts = { + "aufile", "dbus", "jack", "libsndfile", "opensles", "network", "sdl2", "readline", "pulseaudio", "threads", "openmp" + } + for _, config in ipairs(configopts) do + table.insert(configs, "-Denable-" .. config .. "=" .. (package:config(config) and "ON" or "OFF")) + end + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + import("package.tools.cmake").install(package) + if package:is_plat("macosx") then + local headersdir = package:installdir("Library/Frameworks/FluidSynth.framework/Headers") + os.cp(path.join(headersdir, "**.h"), package:installdir("include"), {rootdir = headersdir}) + os.cp(path.join(package:installdir("Library/Frameworks/FluidSynth.framework"), "FluidSynth"), + path.join(package:installdir("lib"), "libFluidSynth.dylib")) + end + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + fluid_settings_t* settings = new_fluid_settings(); + fluid_synth_t* synth = new_fluid_synth(settings); + delete_fluid_synth(synth); + delete_fluid_settings(settings); + } + ]]}, {includes = "fluidsynth.h"})) + end) diff --git a/packages/f/fmi/xmake.lua b/packages/f/fmi/xmake.lua new file mode 100644 index 000000000..0b7debf49 --- /dev/null +++ b/packages/f/fmi/xmake.lua @@ -0,0 +1,18 @@ +package("fmi") + set_kind("library", {headeronly = true}) + set_homepage("https://fmi-standard.org/") + set_description("Specification of the Functional Mock-Up Interface (FMI)") + + add_urls("https://github.com/modelica/fmi-standard/archive/refs/tags/$(version).tar.gz", + "https://github.com/modelica/fmi-standard.git") + + add_versions("v3.0.1", "aba8c3b6d67484926fada2cf7433ad10c6b3b3fc4f84df7dc90230609ea257c1") + + on_install(function (package) + os.cp("headers/*.h", package:installdir("include")) + os.cp("schema", package:installdir("share")) + end) + + on_test(function (package) + assert(package:has_ctypes("fmi3Status", {includes = "fmi3FunctionTypes.h"})) + end) diff --git a/packages/f/fmt/xmake.lua b/packages/f/fmt/xmake.lua index f0a1771c1..c42a03339 100644 --- a/packages/f/fmt/xmake.lua +++ b/packages/f/fmt/xmake.lua @@ -5,6 +5,8 @@ package("fmt") set_urls("https://github.com/fmtlib/fmt/releases/download/$(version)/fmt-$(version).zip", "https://github.com/fmtlib/fmt.git") + add_versions("10.2.1", "312151a2d13c8327f5c9c586ac6cf7cddc1658e8f53edae0ec56509c8fa516c9") + add_versions("10.2.0", "8a942861a94f8461a280f823041cde8f620a6d8b0e0aacc98c15bb5a9dd92399") add_versions("10.1.1", "b84e58a310c9b50196cda48d5678d5fa0849bca19e5fdba6b684f0ee93ed9d1b") add_versions("10.1.0", "d725fa83a8b57a3cedf238828fa6b167f963041e8f9f7327649bddc68ae316f4") add_versions("10.0.0", "4943cb165f3f587f26da834d3056ee8733c397e024145ca7d2a8a96bb71ac281") diff --git a/packages/f/fmtlog/xmake.lua b/packages/f/fmtlog/xmake.lua index 91308297e..93d329362 100644 --- a/packages/f/fmtlog/xmake.lua +++ b/packages/f/fmtlog/xmake.lua @@ -5,6 +5,7 @@ package("fmtlog") add_urls("https://github.com/MengRao/fmtlog/archive/refs/tags/$(version).tar.gz", "https://github.com/MengRao/fmtlog.git") + add_versions("v2.2.1", "9bc2f1ea37eece0f4807689962b529d2d4fa07654baef184f051319b4eac9304") add_versions("v2.1.2", "d286184e04c3c3286417873dd2feac524c53babc6cd60f10179aa5b10416ead7") add_deps("cmake", "fmt") @@ -12,7 +13,7 @@ package("fmtlog") add_syslinks("pthread") end - on_install("linux", "macosx", "windows", function (package) + on_install("linux", "macosx", "windows|!arm64", function (package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) io.replace("CMakeLists.txt", "add_subdirectory(fmt)", "", {plain = true}) diff --git a/packages/f/folly/patches/2023.11.20/msvc.patch b/packages/f/folly/patches/2023.11.20/msvc.patch new file mode 100644 index 000000000..8c6d35fd9 --- /dev/null +++ b/packages/f/folly/patches/2023.11.20/msvc.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/FollyCompilerMSVC.cmake b/CMake/FollyCompilerMSVC.cmake +--- a/CMake/FollyCompilerMSVC.cmake ++++ b/CMake/FollyCompilerMSVC.cmake +@@ -298,6 +298,9 @@ function(apply_folly_compile_options_to_target THETARGET) + $<$:_HAS_AUTO_PTR_ETC=1> # We're building in C++ 17 or greater mode, but certain dependencies (Boost) still have dependencies on unary_function and binary_function, so we have to make sure not to remove them. + $<$:WIN32_LEAN_AND_MEAN> # Don't include most of Windows.h + $<$:BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE> # MSVC moves faster than boost, so add a quick way to disable the messages. ++ ++ NOMINMAX ++ GLOG_NO_ABBREVIATED_SEVERITIES + ) + + # Ignore a warning about an object file not defining any symbols, diff --git a/packages/f/folly/patches/2023.11.20/pkgconfig.patch b/packages/f/folly/patches/2023.11.20/pkgconfig.patch new file mode 100644 index 000000000..834ef056c --- /dev/null +++ b/packages/f/folly/patches/2023.11.20/pkgconfig.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -512,12 +512,12 @@ endif() + + file( + GENERATE +- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc ++ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly_$.pc + INPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen + ${target_arg} + ) + install( +- FILES ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc ++ FILES ${CMAKE_CURRENT_BINARY_DIR}/libfolly_${CMAKE_BUILD_TYPE}.pc + DESTINATION ${LIB_INSTALL_DIR}/pkgconfig + COMPONENT dev + ) diff --git a/packages/f/folly/xmake.lua b/packages/f/folly/xmake.lua index 8e2c4df94..78e4232f2 100644 --- a/packages/f/folly/xmake.lua +++ b/packages/f/folly/xmake.lua @@ -12,24 +12,33 @@ package("folly") add_versions("2022.02.14", "6a50d4cc954f0f77efc85af231ee6b7f676a0d743c12b7080fb03fd3da3ffbf2") add_versions("2022.04.25", "7d5cd59613780d7d2b9c946c810bfd6b0d11ed3a8a74c5ab00d4e9de5d1b2104") add_versions("2022.08.29", "3adac6d4b203c2917185fd190fc04d615051cb2a4f6b988ddf3c42034efc8d4d") + add_versions("2023.11.20", "7aabcfc5d85ca88fbd06bca1a7381654ec8b0c31fe919788b8d7c18ba50f38ff") + add_versions("2024.02.26", "ed7086aa7a3e66e9afd2aeb1ddb746d94dcc0c80b792635cb72cd3622e2de9e3") + add_versions("2024.03.04", "55fadd809f749b1834d20f1dff9aeb410f39b3e3025218d3b2e014948b58763d") + add_versions("2024.03.11", "771f638669bdb514f0c66caff404d1df0e65868b65555405eb22a7c9298d3a7a") + add_versions("2024.03.18", "037bd742b91e35e057d13bedcbdf55328e35805cf91f7bc1ca850a72ba974578") + add_versions("2024.03.25", "3c57b0d1f1266e935aef1ed54535561fd2eeedc1aa946fbc46871e839014f74c") + add_versions("2024.04.01", "f09e522c76a5f102c40c54726f6f255b0dc127c78f9c8c9ac117fc0f7ac284bb") add_patches("<=2022.08.29", path.join(os.scriptdir(), "patches", "2021.06.28", "reorder.patch"), "9a6bf283881580474040cfc7a8e89d461d68b89bae5583d89fff0a3198739980") add_patches("<=2022.08.29", path.join(os.scriptdir(), "patches", "2021.06.28", "regex.patch"), "6a77ade9f48dd9966d3f7154e66ca8a5c030ae2b6d335cbe3315784aefd8f495") + add_patches("<=2024.04.01", path.join(os.scriptdir(), "patches", "2023.11.20", "pkgconfig.patch"), "6838623d453418569853f62ad97c729e802a120c13d804aabba6d6455997e674") + add_patches("<=2024.04.01", path.join(os.scriptdir(), "patches", "2023.11.20", "msvc.patch"), "1ee01c75528bd42736541022af461e44af3031c01d62c9342006f0abc0f44f2d") if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end add_deps("cmake") - add_deps("boost", {configs = {context = true, filesystem = true, program_options = true, regex = true, system = true, thread = true}}) + add_deps("boost", {configs = {date_time = true, iostreams = true, context = true, filesystem = true, program_options = true, regex = true, system = true, thread = true}}) add_deps("libevent", {configs = {openssl = true}}) - add_deps("double-conversion", "gflags", "glog", "zlib", "fmt") + add_deps("double-conversion", "gflags", "glog <0.7.0", "zlib", "fmt") add_deps("bzip2", "lz4", "zstd", {optional = true}) if is_plat("linux") then add_syslinks("pthread") end - on_install("windows|x64", "linux", "macosx", function (package) + on_install("linux", "macosx", function (package) local configs = {"-DBUILD_TESTS=OFF", "-DCMAKE_DISABLE_FIND_PACKAGE_LibDwarf=ON", "-DCMAKE_DISABLE_FIND_PACKAGE_Libiberty=ON", @@ -37,7 +46,8 @@ package("folly") "-DCMAKE_DISABLE_FIND_PACKAGE_LibURCU=ON", "-DLIBAIO_FOUND=OFF", "-DLIBURCU_FOUND=OFF", - "-DBOOST_LINK_STATIC=ON"} + "-DBOOST_LINK_STATIC=ON", + "-DCMAKE_CXX_STANDARD=17"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) if package:is_plat("windows") then diff --git a/packages/f/fontconfig/xmake.lua b/packages/f/fontconfig/xmake.lua index 429df7ba0..5d3d91098 100644 --- a/packages/f/fontconfig/xmake.lua +++ b/packages/f/fontconfig/xmake.lua @@ -8,28 +8,41 @@ package("fontconfig") add_versions("2.13.93", "0f302a18ee52dde0793fe38b266bf269dfe6e0c0ae140e30d72c6cca5dc08db5") add_versions("2.13.94", "246d1640a7e54fba697b28e4445f4d9eb63dda1b511d19986249368ee7191882") add_versions("2.14.0", "b8f607d556e8257da2f3616b4d704be30fd73bd71e367355ca78963f9a7f0434") - - add_deps("meson", "pkg-config", "freetype >=2.9", "expat", "ninja >=1.8.2") - add_deps("python 3.x", {kind = "binary"}) - if is_plat("macosx") then - add_deps("gettext") - else - add_deps("autoconf", "automake", "libtool", "gperf", "bzip2") - add_deps("util-linux", {configs = {libuuid = true}}) - end + add_versions("2.14.2", "3ba2dd92158718acec5caaf1a716043b5aa055c27b081d914af3ccb40dce8a55") -- fix the build issue with --enable-static add_patches("2.13.1", "https://gitlab.freedesktop.org/fontconfig/fontconfig/commit/8208f99fa1676c42bfd8d74de3e9dac5366c150c.diff", "2abdff214b99f2d074170e6512b0149cc858ea26cd930690aa6b4ccea2c549ef") - on_install("linux", "macosx", function (package) + add_configs("nls", {description = "Enable Native Language Support (NLS)", default = false, type = "boolean"}) + + add_deps("meson", "ninja", "freetype", "expat", "gperf") + add_deps("python 3.x", {kind = "binary"}) + if is_plat("linux") then + add_deps("pkg-config") + end + + on_load("windows", "linux", "macosx", function (package) + if package:config("nls") and not package:is_plat("linux") then + package:add("deps", "libintl") + end + if package:is_plat("linux") and package:version():lt("2.13.91") then + package:add("deps", "util-linux", {configs = {libuuid = true}}) + package:add("deps", "autoconf", "automake", "libtool", "bzip2") + end + end) + + on_install("windows", "linux", "macosx", function (package) + if package:is_plat("windows") then + io.replace("meson.build", "c_args = []", "c_args = ['-DXML_STATIC']", {plain = true}) + end local configs = { "-Dtests=disabled", "-Dtools=disabled", "-Ddoc=disabled"} table.insert(configs, "-Ddebug=" .. (package:debug() and "true" or "false")) table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) - + table.insert(configs, "-Dnls=" .. (package:config("nls") and "enabled" or "disabled")) import("package.tools.meson").install(package, configs) end) diff --git a/packages/f/freeimage/patches/3.18.0/openexr.patch b/packages/f/freeimage/patches/3.18.0/openexr.patch new file mode 100644 index 000000000..f4fdc0ac9 --- /dev/null +++ b/packages/f/freeimage/patches/3.18.0/openexr.patch @@ -0,0 +1,12 @@ +diff --git a/Source/OpenEXR/IlmImf/ImfAttribute.cpp b/Source/OpenEXR/IlmImf/ImfAttribute.cpp +index cb4ac36..aaced91 100644 +--- a/Source/OpenEXR/IlmImf/ImfAttribute.cpp ++++ b/Source/OpenEXR/IlmImf/ImfAttribute.cpp +@@ -45,6 +45,7 @@ + #include "Iex.h" + #include + #include ++#include + + #include "ImfNamespace.h" + diff --git a/packages/f/freeimage/xmake.lua b/packages/f/freeimage/xmake.lua index 4f617ae64..aa2c4d756 100644 --- a/packages/f/freeimage/xmake.lua +++ b/packages/f/freeimage/xmake.lua @@ -9,6 +9,7 @@ package("freeimage") add_versions("3.18.0", "f41379682f9ada94ea7b34fe86bf9ee00935a3147be41b6569c9605a53e438fd") add_patches("3.18.0", path.join(os.scriptdir(), "patches", "3.18.0", "libjxr.patch"), "fddbb9fa736da383f54352dc0ab848d083d9279b66cc6ac53910236144ad75ab") + add_patches("3.18.0", path.join(os.scriptdir(), "patches", "3.18.0", "openexr.patch"), "051940ec58fd5ae85b65c67b83fd46eda807c9039f0f5207769ac871350af830") on_load("windows", function (package) if not package:config("shared") then @@ -16,7 +17,7 @@ package("freeimage") end end) - on_install("windows", "macosx", "linux", function (package) + on_install("windows|x64", "windows|x86", "macosx", "linux", function (package) if package:is_plat("windows") and package:is_arch("x86") then local vs = import("core.tool.toolchain").load("msvc"):config("vs") if tonumber(vs) < 2019 then diff --git a/packages/f/fribidi/xmake.lua b/packages/f/fribidi/xmake.lua index 15c951cfe..6866b3514 100644 --- a/packages/f/fribidi/xmake.lua +++ b/packages/f/fribidi/xmake.lua @@ -5,6 +5,7 @@ package("fribidi") set_license("LGPL-2.1") add_urls("https://github.com/fribidi/fribidi/releases/download/v$(version)/fribidi-$(version).tar.xz") + add_versions("1.0.14", "76ae204a7027652ac3981b9fa5817c083ba23114340284c58e756b259cd2259a") add_versions("1.0.10", "7f1c687c7831499bcacae5e8675945a39bacbad16ecaa945e9454a32df653c01") add_versions("1.0.11", "30f93e9c63ee627d1a2cedcf59ac34d45bf30240982f99e44c6e015466b4e73d") add_versions("1.0.12", "0cd233f97fc8c67bb3ac27ce8440def5d3ffacf516765b91c2cc654498293495") @@ -37,7 +38,7 @@ package("fribidi") import("package.tools.autoconf").install(package, configs) end) - on_install(function (package) + on_install("windows|x86", "windows|x64", "mingw", "msys", "wasm", "cross", function (package) local configs = {"-Ddocs=false", "-Dtests=false"} table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) import("package.tools.meson").install(package, configs) diff --git a/packages/f/frugally-deep/xmake.lua b/packages/f/frugally-deep/xmake.lua new file mode 100644 index 000000000..bad06f878 --- /dev/null +++ b/packages/f/frugally-deep/xmake.lua @@ -0,0 +1,37 @@ +package("frugally-deep") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/Dobiasd/frugally-deep") + set_description("Header-only library for using Keras (TensorFlow) models in C++.") + set_license("MIT") + + add_urls("https://github.com/Dobiasd/frugally-deep/archive/refs/tags/$(version).tar.gz", + "https://github.com/Dobiasd/frugally-deep.git") + + add_versions("v0.16.0", "5ffe8dddb43a645094b2ca1d48e4ee78e685fbef3c89f08cea8425a39dad9865") + add_versions("v0.15.31", "49bf5e30ad2d33e464433afbc8b6fe8536fc959474004a1ce2ac03d7c54bc8ba") + add_versions("v0.15.29", "032cd525d4a7b9b3ebe28fd5e3984ac3e569da496f65d52c81030aabd9d0c52e") + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + add_deps("cmake") + add_deps("functionalplus", "eigen") + add_deps("nlohmann_json", {configs = {cmake = true}}) + + on_install("windows", "macosx", "linux", "mingw", "cross", function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + local cxflags + if package:is_plat("mingw") then + cxflags = "-Wa,-mbig-obj" + end + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + const auto model = fdeep::load_model("fdeep_model.json"); + } + ]]}, {configs = {languages = "c++14", cxflags = cxflags}})) + end) diff --git a/packages/f/ftxui/xmake.lua b/packages/f/ftxui/xmake.lua index 8c59e8219..77e0831ec 100644 --- a/packages/f/ftxui/xmake.lua +++ b/packages/f/ftxui/xmake.lua @@ -13,13 +13,13 @@ package("ftxui") if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) - elseif is_plat("bsd") then + elseif is_plat("linux", "bsd") then add_syslinks("pthread") end add_links("ftxui-component", "ftxui-dom", "ftxui-screen") - on_install("linux", "windows", "macosx", "bsd", "mingw", function (package) + on_install("linux", "windows", "macosx", "bsd", "mingw", "cross", function (package) local configs = {"-DFTXUI_BUILD_DOCS=OFF", "-DFTXUI_BUILD_EXAMPLES=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) diff --git a/packages/f/function2/xmake.lua b/packages/f/function2/xmake.lua index de9feefc7..05bd277c5 100644 --- a/packages/f/function2/xmake.lua +++ b/packages/f/function2/xmake.lua @@ -7,6 +7,7 @@ package("function2") add_urls("https://github.com/Naios/function2/archive/refs/tags/$(version).tar.gz", "https://github.com/Naios/function2.git") + add_versions("4.2.4", "6081d0f7011ddb8555bd846caf1245d4bce62d83fee1403b9d247b66ed617a67") add_versions("4.1.0", "c3aaeaf93bf90c0f4505a18f1094b51fe28881ce202c3bf78ec4efb336c51981") add_versions("4.2.0", "fd1194b236e55f695c3a0c17f2440d6965b800c9309d0d5937e0185bcfe7ae6e") add_versions("4.2.1", "dfaf12f6cc4dadc4fc7051af7ac57be220c823aaccfd2fecebcb45a0a03a6eb0") diff --git a/packages/f/functionalplus/xmake.lua b/packages/f/functionalplus/xmake.lua index 06fe2b779..8295bc633 100644 --- a/packages/f/functionalplus/xmake.lua +++ b/packages/f/functionalplus/xmake.lua @@ -5,15 +5,15 @@ package("functionalplus") add_urls("https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/$(version).tar.gz", "https://github.com/Dobiasd/FunctionalPlus.git") - add_versions("v0.2.18-p0", "ffc63fc86f89a205accafa85c35790eda307adf5f1d6d51bb7ceb5c5e21e013b") + + add_versions("v0.2.24", "446c63ac3f2045e7587f694501882a3d7c7b962b70bcc08deacf5777bdaaff8c") + add_versions("v0.2.23", "5c2d28d2ba7d0cdeab9e31bbf2e7f8a9d6f2ff6111a54bfc11d1b05422096f19") + add_versions("v0.2.22", "79378668dff6ffa8abc1abde2c2fe37dc6fe1ac040c55d5ee7886924fa6a1376") add_deps("cmake") on_install(function (package) - local configs = {} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) + import("package.tools.cmake").install(package) end) on_test(function (package) diff --git a/packages/g/g3log/xmake.lua b/packages/g/g3log/xmake.lua index c5bbf9ee5..95b8847d7 100644 --- a/packages/g/g3log/xmake.lua +++ b/packages/g/g3log/xmake.lua @@ -6,6 +6,7 @@ package("g3log") add_urls("https://github.com/KjellKod/g3log/archive/refs/tags/$(version).tar.gz", "https://github.com/KjellKod/g3log.git") + add_versions("2.4", "a240673f6dda17a8d4d5768b6741534e6863e6c4d786c3678e4fe687eb115902") add_versions("2.3", "a27dc3ff0d962cc6e0b4e60890b4904e664b0df16393d27e14c878d7de09b505") add_configs("ios", {description = "iOS version of library.", default = false, type = "boolean", readonly = true}) diff --git a/packages/g/gamenetworkingsockets/port/xmake.lua b/packages/g/gamenetworkingsockets/port/xmake.lua index 2c7d3f890..a2deef1c1 100644 --- a/packages/g/gamenetworkingsockets/port/xmake.lua +++ b/packages/g/gamenetworkingsockets/port/xmake.lua @@ -1,15 +1,16 @@ -set_languages("gnu11") option("webrtc", {default = false, showmenu = true}) add_rules("mode.debug", "mode.release") add_requires("protobuf-cpp", "openssl") + if has_config("webrtc") then add_requires("abseil") target("webrtc-lite") add_rules("c++") set_kind("static") add_packages("protobuf-cpp") + if is_plat("windows") then add_defines("WEBRTC_WIN", "NOMINMAX", "WIN32_LEAN_AND_MEAN", "_WINSOCKAPI_") add_cxflags("/wd4715", "/wd4005", "/wd4996", "/wd4530") @@ -428,7 +429,8 @@ end target("gns") -- we need limit path length set_kind("$(kind)") - + add_rules("protobuf.cpp") + set_languages("gnu17", "gnu++17") add_vectorexts("sse2") add_packages("protobuf-cpp", "openssl") set_basename("gamenetworkingsockets") @@ -481,9 +483,10 @@ target("gns") -- we need limit path length "src/common/crypto_25519_openssl.cpp", "src/common/opensslwrapper.cpp") - add_files( "src/common/steamnetworkingsockets_messages_certs.proto", - "src/common/steamnetworkingsockets_messages.proto", - "src/common/steamnetworkingsockets_messages_udp.proto", {rules = "protobuf.cpp"}) + add_files("src/common/steamnetworkingsockets_messages_certs.proto", + "src/common/steamnetworkingsockets_messages.proto", + "src/common/steamnetworkingsockets_messages_udp.proto") + add_files( "src/common/crypto.cpp", "src/common/crypto_textencode.cpp", "src/common/keypair.cpp", diff --git a/packages/g/gamenetworkingsockets/xmake.lua b/packages/g/gamenetworkingsockets/xmake.lua index bdc488910..6baf7cd2a 100644 --- a/packages/g/gamenetworkingsockets/xmake.lua +++ b/packages/g/gamenetworkingsockets/xmake.lua @@ -31,7 +31,7 @@ package("gamenetworkingsockets") end end) - on_install("windows", "linux", function (package) + on_install("windows|x86", "windows|x64", "linux", function (package) -- We need copy source codes to the working directory with short path on windows -- -- Because the target name and source file path of this project are too long, diff --git a/packages/g/gcem/xmake.lua b/packages/g/gcem/xmake.lua index 22466f9b8..0010e7fc0 100644 --- a/packages/g/gcem/xmake.lua +++ b/packages/g/gcem/xmake.lua @@ -7,6 +7,8 @@ package("gcem") add_urls("https://github.com/kthohr/gcem/archive/refs/tags/$(version).tar.gz", "https://github.com/kthohr/gcem.git") + add_versions("v1.18.0", "8e71a9f5b62956da6c409dda44b483f98c4a98ae72184f3aa4659ae5b3462e61") + add_versions("v1.17.0", "74cc499e2db247c32f1ce82fc22022d22e0f0a110ecd19281269289a9e78a6f8") add_versions("v1.13.1", "69a1973f146a4a5e584193af062359f50bd5b948c4175d58ea2622e1c066b99b") add_versions("v1.16.0", "119c742b9371c0adc7d9cd710c3cbc575459a98fb63f6be4c636215dcf8404ce") diff --git a/packages/g/gdal/xmake.lua b/packages/g/gdal/xmake.lua index c452d9a56..586fe9641 100644 --- a/packages/g/gdal/xmake.lua +++ b/packages/g/gdal/xmake.lua @@ -4,29 +4,119 @@ package("gdal") set_license("MIT") add_urls("https://github.com/OSGeo/gdal/releases/download/v$(version)/gdal-$(version).tar.gz") + add_versions("3.9.0", "3b29b573b60d156cf160805290474b625c4197ca36a79fd14f83ec8f77f29ba0") + add_versions("3.8.5", "0c865c7931c7e9bb4832f50fb53aec8676cbbaccd6e55945011b737fb89a49c2") add_versions("3.5.1", "7c4406ca010dc8632703a0a326f39e9db25d9f1f6ebaaeca64a963e3fac123d1") + add_deps("cmake") add_configs("apps", {description = "Build GDAL applications.", default = false, type = "boolean"}) - add_deps("cmake", "proj", "openjpeg") + add_configs("curl", {description = "Use CURL.", default = false, type = "boolean"}) + add_configs("curl_static", {description = "Use static build of CURL.", default = false, type = "boolean"}) + add_configs("geos", {description = "Use GEOS.", default = false, type = "boolean"}) + add_configs("gif", {description = "Use GIF.", default = false, type = "boolean"}) + add_configs("iconv", {description = "Use Iconv.", default = false, type = "boolean"}) + add_configs("jpeg", {description = "Use JPEG.", default = false, type = "boolean"}) + add_configs("openjpeg", {description = "Use OpenJPEG.", default = true, type = "boolean"}) -- default true to keep compatibility + add_configs("openssl", {description = "Use OpenSSL.", default = false, type = "boolean"}) + add_configs("png", {description = "Use PNG.", default = false, type = "boolean"}) + add_configs("sqlite3", {description = "Use SQLite3.", default = false, type = "boolean"}) + add_configs("xercesc", {description = "Use Xerces-C.", default = false, type = "boolean"}) if is_plat("windows") then add_syslinks("wsock32", "ws2_32") end - + + on_load(function (package) + package:add("deps", "proj", {configs = {curl = package:config("curl")}}) + + local configdeps = { + curl = "libcurl", + curl_static = "libcurl", + geos = "geos", + gif = "giflib", + iconv = "libiconv", + jpeg = "libjpeg-turbo", + openjpeg = "openjpeg", + openssl = "openssl3", + png = "libpng", + sqlite3 = "sqlite3", + xercesc = "xerces-c", + } + + for name, dep in pairs(configdeps) do + if package:config(name) then + if name:match('^(.*)_static$') then + package:add("deps", dep, {configs = {shared = false}}) + else + package:add("deps", dep) + end + end + end + end) + on_install("windows|x86", "windows|x64", "macosx", "linux", function (package) - local configs = {"-DBUILD_TESTING=OFF", "-DGDAL_USE_EXTERNAL_LIBS=OFF", "-DGDAL_USE_OPENJPEG=ON", - "-DBUILD_JAVA_BINDINGS=OFF", "-DBUILD_CSHARP_BINDINGS=OFF", "-DBUILD_PYTHON_BINDINGS=OFF"} + local configs = { + "-DBUILD_TESTING=OFF", + "-DGDAL_USE_EXTERNAL_LIBS=OFF", + "-DBUILD_JAVA_BINDINGS=OFF", "-DBUILD_CSHARP_BINDINGS=OFF", "-DBUILD_PYTHON_BINDINGS=OFF" + } table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DBUILD_APPS=" .. (package:config("apps") and "ON" or "OFF")) - + + local packagedeps = {"proj"} + if package:config("curl") or package:config("curl_static") then + table.insert(packagedeps, "libcurl") + table.insert(configs, "-DGDAL_USE_CURL=ON") + + if package:config("curl_static") then + table.insert(configs, "-DCURL_USE_STATIC_LIBS=ON") + end + end + if package:config("geos") then + table.insert(packagedeps, "geos") + table.insert(configs, "-DGDAL_USE_GEOS=ON") + end + if package:config("gif") then + table.insert(packagedeps, "giflib") + table.insert(configs, "-DGDAL_USE_GIF=ON") + end + if package:config("iconv") then + table.insert(packagedeps, "libiconv") + table.insert(configs, "-DGDAL_USE_ICONV=ON") + end + if package:config("jpeg") then + table.insert(packagedeps, "libjpeg-turbo") + table.insert(configs, "-DGDAL_USE_JPEG=ON") + end + if package:config("openjpeg") then + table.insert(packagedeps, "openjpeg") + table.insert(configs, "-DGDAL_USE_OPENJPEG=ON") + end + if package:config("openssl") then + table.insert(packagedeps, "openssl3") + table.insert(configs, "-DGDAL_USE_OPENSSL=ON") + end + if package:config("png") then + table.insert(packagedeps, "libpng") + table.insert(configs, "-DGDAL_USE_PNG=ON") + end + if package:config("sqlite3") then + table.insert(packagedeps, "sqlite3") + table.insert(configs, "-DGDAL_USE_SQLITE3=ON") + end + if package:config("xercesc") then + table.insert(packagedeps, "xerces-c") + table.insert(configs, "-DGDAL_USE_XERCESC=ON") + end + --fix gdal compile on msvc debug mode local cxflags if package:debug() and package:is_plat("windows") then cxflags = "/FS" end import("package.tools.cmake").install(package, configs, - {cxflags = cxflags, packagedeps = {"openjpeg", "proj"}}) + {cxflags = cxflags, packagedeps = packagedeps}) if package:config("apps") then package:addenv("PATH", "bin") end diff --git a/packages/g/gdk-pixbuf/xmake.lua b/packages/g/gdk-pixbuf/xmake.lua index bd68e240e..fec7d8ae7 100644 --- a/packages/g/gdk-pixbuf/xmake.lua +++ b/packages/g/gdk-pixbuf/xmake.lua @@ -1,52 +1,56 @@ package("gdk-pixbuf") - set_homepage("https://gitlab.gnome.org/GNOME/gdk-pixbuf") + set_homepage("https://docs.gtk.org/gdk-pixbuf/") set_description("GdkPixbuf is a library that loads image data in various formats and stores it as linear buffers in memory. The buffers can then be scaled, composited, modified, saved, or rendered.") - set_license("LGPL-2.0") + set_license("LGPL-2.1") - add_urls("https://github.com/GNOME/gdk-pixbuf/archive/refs/tags/$(version).tar.gz", - "https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/archive/$(version)/gdk-pixbuf-$(version).tar.gz", + add_urls("https://download.gnome.org/sources/gdk-pixbuf/$(version).tar.xz", {alias = "home", version = function (version) + return format("%d.%d/gdk-pixbuf-%s", version:major(), version:minor(), version) + end, excludes = "*/tests/*"}) + add_urls("https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/archive/$(version)/gdk-pixbuf-$(version).tar.gz", "https://gitlab.gnome.org/GNOME/gdk-pixbuf.git") + add_versions("home:2.42.10", "ee9b6c75d13ba096907a2e3c6b27b61bcd17f5c7ebeab5a5b439d2f2e39fe44b") + add_versions("home:2.42.6", "c4a6b75b7ed8f58ca48da830b9fa00ed96d668d3ab4b1f723dcf902f78bde77f") + + add_patches("2.42.6", path.join(os.scriptdir(), "patches", "2.42.6", "macosx.patch"), "ad2705a5a9aa4b90fb4588bb567e95f5d82fccb6a5d463cd07462180e2e418eb") - add_versions("2.42.6", "c4f3a84a04bc7c5f4fbd97dce7976ab648c60628f72ad4c7b79edce2bbdb494d") add_includedirs("include", "include/gdk-pixbuf-2.0") add_deps("meson", "ninja") - add_deps("libpng", "libjpeg") - if is_plat("macosx") then + add_deps("libpng", "libjpeg-turbo", "libtiff", "glib", "pcre2") + if is_plat("windows") then + add_syslinks("iphlpapi", "dnsapi") + add_deps("pkgconf", "libintl") + elseif is_plat("macosx") then add_frameworks("Foundation", "CoreFoundation", "AppKit") add_extsources("brew::gdk-pixbuf") + add_deps("libiconv", {system = true}) add_syslinks("resolv") - add_patches("2.42.6", path.join(os.scriptdir(), "patches", "2.42.6", "macosx.patch"), "ad2705a5a9aa4b90fb4588bb567e95f5d82fccb6a5d463cd07462180e2e418eb") - elseif is_plat("linux") then + elseif is_plat("linux") then + add_deps("libiconv") add_extsources("pacman::gdk-pixbuf2") end - on_load(function (package) - if package:config("shared") then - -- fix gobject conflict error: assertion failed: (type == G_TYPE_CHAR) - package:add("deps", "glib", {configs = {shared = true}}) - else - package:add("deps", "glib") - end - end) + on_install("windows", "macosx", "linux", function (package) + io.gsub("meson.build", "subdir%('tests'%)", "") + io.gsub("meson.build", "subdir%('fuzzing'%)", "") + io.gsub("meson.build", "subdir%('docs'%)", "") - on_install("macosx", "linux", function (package) local configs = {"-Dman=false", + "-Ddocs=false", "-Dgtk_doc=false", - "-Dpng=true", - "-Dtiff=true", + "-Dpng=enabled", + "-Dtiff=enabled", + "-Djpeg=enabled", "-Dnative_windows_loaders=false", + "-Dbuiltin_loaders=all", "-Dgio_sniffing=false", "-Drelocatable=true", - "-Djpeg=true", + "-Dintrospection=disabled", + "-Dtests=false", "-Dinstalled_tests=false"} - table.insert(configs, "-Ddebug=" .. (package:debug() and "true" or "false")) table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) - io.gsub("meson.build", "subdir%('tests'%)", "") - io.gsub("meson.build", "subdir%('fuzzing'%)", "") - io.gsub("meson.build", "subdir%('docs'%)", "") - import("package.tools.meson").install(package, configs, {packagedeps = {"libpng", "libjpeg", "glib"}}) + import("package.tools.meson").install(package, configs, {packagedeps = {"libjpeg-turbo", "libpng", "libtiff", "glib", "pcre2", "libintl", "libiconv"}}) end) on_test(function (package) diff --git a/packages/g/genie/port/xmake.lua b/packages/g/genie/port/xmake.lua new file mode 100644 index 000000000..340bf9676 --- /dev/null +++ b/packages/g/genie/port/xmake.lua @@ -0,0 +1,30 @@ +add_rules("mode.release") +target("genie") + set_kind("binary") + on_load(function (target) + local lua_ver + for _, dir in ipairs(os.dirs("src/host/*")) do + if dir:find("lua-", 1, true) then + lua_ver = dir:match("lua%-(%d+%.%d+%.%d+)") + break + end + end + assert(lua_ver, "lua directory not found!") + local lua_src = "src/host/lua-" .. lua_ver .. "/src" + target:add("includedirs", lua_src) + target:add("files", lua_src .. "/*.c|lua.c|luac.c") + end) + add_files("src/host/*.c") + add_defines("LUA_COMPAT_MODULE") + if is_plat("windows", "mingw", "msys") then + add_syslinks("ole32") + elseif is_plat("macosx") then + add_defines("LUA_USE_MACOSX") + add_frameworks("CoreServices") + elseif is_plat("linux") then + add_defines("LUA_USE_POSIX", "LUA_USE_DLOPEN", "_FILE_OFFSET_BITS=64") + add_syslinks("dl", "m") + elseif is_plat("bsd") then + add_defines("LUA_USE_POSIX", "LUA_USE_DLOPEN") + add_syslinks("m") + end diff --git a/packages/g/genie/xmake.lua b/packages/g/genie/xmake.lua index 0d9e6289e..bf04e2493 100644 --- a/packages/g/genie/xmake.lua +++ b/packages/g/genie/xmake.lua @@ -3,22 +3,18 @@ package("genie") set_kind("binary") set_homepage("https://github.com/bkaradzic/GENie") set_description("GENie - Project generator tool") + set_license("BSD-3-Clause") - if is_host("windows") then - add_urls("https://raw.githubusercontent.com/bkaradzic/bx/aa5090bbd8c39e84d483f4850a7d9ca7ff9241ed/tools/bin/windows/genie.exe") - add_versions("1160.0", "a1226a0098f6ff4895a423df17737af90cc0af9effce7cc81fe904c9b2e02e8f") - else - add_urls("https://github.com/bkaradzic/GENie.git") - add_versions("1160.0", "0f5133b66d103efbcdf7c0d23f6cb6b353282e38") - end + add_urls("https://github.com/bkaradzic/GENie.git") + add_versions("1160", "f9bd455a8439dbcb807816c0be9e4aedf5991bc3") + add_versions("1165", "5461c5ab94d0365c40031fef8f459b9c21b4d37a") + add_versions("1170", "22cc907a4351db46c55f73e6aa901f1b2f0c52ad") - on_install("@windows", function (package) - os.cp(package:originfile(), package:installdir("bin")) - end) + add_configs("debug", {description = "Enable debug scripts.", default = false, type = "boolean", readonly = true}) - on_install("@macosx", "@linux", function (package) - import("package.tools.make").build(package, configs) - os.cp("bin/*/genie", package:installdir("bin")) + on_install("@windows", "@msys", "@macosx", "@linux", function (package) + os.cp(path.join(os.scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package) end) on_test(function (package) diff --git a/packages/g/geos/xmake.lua b/packages/g/geos/xmake.lua index 0f7372b02..824b896f4 100644 --- a/packages/g/geos/xmake.lua +++ b/packages/g/geos/xmake.lua @@ -1,11 +1,13 @@ package("geos") set_homepage("https://trac.osgeo.org/geos/") - set_description("GEOS (Geometry Engine - Open Source) is a C++ port of the ​JTS Topology Suite (JTS).") + set_description("GEOS (Geometry Engine - Open Source) is a C++ port of the JTS Topology Suite (JTS).") set_license("LGPL-2.1") - add_urls("http://download.osgeo.org/geos/geos-$(version).tar.bz2") - add_versions("3.9.1", "7e630507dcac9dc07565d249a26f06a15c9f5b0c52dd29129a0e3d381d7e382a") + add_urls("https://github.com/libgeos/geos/archive/refs/tags/$(version).tar.gz") + add_versions("3.12.1", "f6e2f3aaa417410d3fa4c78a9c5ef60d46097ef7ad0aee3bbbb77327350e1e01") + add_versions("3.11.3", "3c517fcccdd3d562122d59c93e0982ef9bc10e775a177ad88882fca1d7d28d08") + add_versions("3.9.1", "e9e20e83572645ac2af0af523b40a404627ce74b3ec99727754391cdf5b23645") add_deps("cmake") on_install("windows", "linux", "macosx", function (package) diff --git a/packages/g/gettext/xmake.lua b/packages/g/gettext/xmake.lua index cfe0744f1..db1577800 100644 --- a/packages/g/gettext/xmake.lua +++ b/packages/g/gettext/xmake.lua @@ -3,15 +3,15 @@ package("gettext") set_homepage("https://www.gnu.org/software/gettext/") set_description("GNU internationalization (i18n) and localization (l10n) library.") - set_urls("https://ftp.gnu.org/gnu/gettext/gettext-$(version).tar.xz", - "https://ftpmirror.gnu.org/gettext/gettext-$(version).tar.xz", + set_urls("https://ftpmirror.gnu.org/gettext/gettext-$(version).tar.xz", + "https://ftp.gnu.org/gnu/gettext/gettext-$(version).tar.xz", {version = function (version) return version:gsub('%-', '.') end}) add_versions("0.19.8-1", "105556dbc5c3fbbc2aa0edb46d22d055748b6f5c7cd7a8d99f8e7eb84e938be4") add_versions("0.21", "d20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192") add_versions("0.21.1", "50dbc8f39797950aa2c98e939947c527e5ac9ebd2c1b99dd7b06ba33a6767ae6") if is_plat("macosx") then - add_syslinks("iconv") + add_deps("libiconv", {system = true}) add_frameworks("CoreFoundation") else add_deps("libiconv") diff --git a/packages/g/gfortran/xmake.lua b/packages/g/gfortran/xmake.lua new file mode 100644 index 000000000..eb7ab768e --- /dev/null +++ b/packages/g/gfortran/xmake.lua @@ -0,0 +1,49 @@ +package("gfortran") + + set_homepage("https://gcc.gnu.org/fortran/") + set_description("The GNU Fortran compiler") + + on_fetch(function (package, opt) + import("lib.detect.find_library") + + if opt.system then + local fortran = package:find_tool("gfortran", opt) + if not fortran then return end + + if package:is_binary() then + return true + else + local installdir = path.directory(path.directory(fortran.program)) + local target + local out, version = os.iorunv(fortran.program, {"-v", "-E"}) + if version then + target = version:match("Target: (.-)\n") + version = version:match("version (%d+%.%d+%.%d+)") + vmajor = version:split("%.")[1] + + local paths = { + "/usr/lib", + "/usr/lib64", + "/usr/local/lib", + path.join(installdir, "lib"), + } + if target then + table.insert(paths, path.join("/usr/lib", target)) + table.insert(paths, path.join("/usr/lib/gcc", target, vmajor)) + table.insert(paths, path.join(installdir, "lib", target, vmajor)) + if package:is_plat("macosx") then + table.insert(paths, path.join("/opt/homebrew/Cellar/gcc", version, "/lib/gcc", vmajor)) + end + end + local linkinfo = find_library("gfortran", paths) + if linkinfo then + return { + version = version, + links = "gfortran", + linkdirs = {linkinfo.linkdir}, + } + end + end + end + end + end) diff --git a/packages/g/ghc_filesystem/xmake.lua b/packages/g/ghc_filesystem/xmake.lua index 22cb23f8b..b731b7806 100644 --- a/packages/g/ghc_filesystem/xmake.lua +++ b/packages/g/ghc_filesystem/xmake.lua @@ -7,6 +7,7 @@ package("ghc_filesystem") add_urls("https://github.com/gulrak/filesystem/archive/refs/tags/$(version).tar.gz", "https://github.com/gulrak/filesystem.git") + add_versions("v1.5.14", "e783f672e49de7c5a237a0cea905ed51012da55c04fbacab397161976efc8472") add_versions("v1.5.10", "9b96a024679807879fdfb30e46e8e461293666aeeee5fbf7f5af75aeacdfea29") add_versions("v1.5.12", "7d62c5746c724d28da216d9e11827ba4e573df15ef40720292827a4dfd33f2e9") diff --git a/packages/g/ghostscript/xmake.lua b/packages/g/ghostscript/xmake.lua index 9241696bd..0ac2e1a51 100644 --- a/packages/g/ghostscript/xmake.lua +++ b/packages/g/ghostscript/xmake.lua @@ -8,6 +8,8 @@ package("ghostscript") return format("gs%s/ghostscript-%s", version:gsub("%.", ""), version) end}) add_versions("9.55.0", "31e2064be67e15b478a8da007d96d6cd4d2bee253e5be220703a225f7f79a70b") + add_versions("10.0.0", "a57764d70caf85e2fc0b0f59b83b92e25775631714dcdb97cc6e0cea414bb5a3") + add_versions("10.02.0", "e54062f166708d84ca82de9f8304a04344466080f936118b88082bd55ed6dc97") add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) @@ -15,7 +17,7 @@ package("ghostscript") add_defines("__WIN32__", "_Windows") end - on_install("windows", function (package) + on_install("windows|x64", "windows|x86", function (package) local configs = {"-f", "psi/msvc.mak", "COMP=cl"} if package:is_arch("x64") then table.insert(configs, "WIN64=1") @@ -55,7 +57,6 @@ package("ghostscript") program = package:is_arch("x64") and "gswin64c" or "gswin32c" else program = "gsc" - assert(package:has_cfuncs("gs_rotate", {includes = "gscoord.h"})) end os.vrunv(program, {"--version"}) assert(package:has_cxxfuncs("gsapi_new_instance", {includes = "iapi.h"})) diff --git a/packages/g/gifdec/xmake.lua b/packages/g/gifdec/xmake.lua new file mode 100644 index 000000000..5be71d174 --- /dev/null +++ b/packages/g/gifdec/xmake.lua @@ -0,0 +1,24 @@ +package("gifdec") + set_homepage("https://github.com/lecram/gifdec") + set_description("small C GIF decoder") + + add_urls("https://github.com/lecram/gifdec.git") + add_versions("2021.12.04", "1dcbae19363597314f6623010cc80abad4e47f7c") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("gifdec") + set_kind("$(kind)") + add_files("gifdec.c") + add_headerfiles("gifdec.h)") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("gd_open_gif", {includes = "gifdec.h"})) + end) diff --git a/packages/g/giflib/patches/5.2.1/unistd.h.patch b/packages/g/giflib/patches/5.2.1/unistd.h.patch new file mode 100644 index 000000000..36cef4491 --- /dev/null +++ b/packages/g/giflib/patches/5.2.1/unistd.h.patch @@ -0,0 +1,14 @@ +diff --git a/gif_hash.h b/gif_hash.h +index 6a1b585..e6712e8 100644 +--- a/gif_hash.h ++++ b/gif_hash.h +@@ -9,7 +9,9 @@ SPDX-License-Identifier: MIT + #ifndef _GIF_HASH_H_ + #define _GIF_HASH_H_ + ++#ifndef _MSC_VER + #include ++#endif + #include + + #define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */ diff --git a/packages/g/giflib/port/xmake.lua b/packages/g/giflib/port/xmake.lua new file mode 100644 index 000000000..09b84eda4 --- /dev/null +++ b/packages/g/giflib/port/xmake.lua @@ -0,0 +1,51 @@ +set_project("giflib") + +option("utils", {showmenu = true, default = false}) + +add_rules("mode.debug", "mode.release") + +target("gif") + set_kind("$(kind)") + add_files( + "dgif_lib.c", + "egif_lib.c", + "gifalloc.c", + "gif_err.c", + "gif_font.c", + "gif_hash.c", + "openbsd-reallocarray.c" + ) + + add_headerfiles("gif_lib.h") + + if is_plat("windows") then + add_files("gif_font.c", {defines = "strtok_r=strtok_s"}) + if is_kind("shared") then + add_rules("utils.symbols.export_all") + end + end +target_end() + +if has_config("utils") then + if is_plat("windows") then + add_requires("cgetopt") + end + + target("utils") + set_kind("$(kind)") + add_files("getarg.c", "qprintf.c", "quantize.c") + add_deps("gif") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + + for _, tool in ipairs({"gif2rgb", "gifbuild", "gifclrmp", "giffix", "giftext", "giftool"}) do + target(tool) + set_kind("binary") + add_files(tool .. ".c") + add_deps("utils") + if is_plat("windows") then + add_packages("cgetopt") + end + end +end diff --git a/packages/g/giflib/xmake.lua b/packages/g/giflib/xmake.lua index 558fbe120..25772ef37 100644 --- a/packages/g/giflib/xmake.lua +++ b/packages/g/giflib/xmake.lua @@ -1,70 +1,38 @@ package("giflib") - set_homepage("https://sourceforge.net/projects/giflib/") set_description("A library for reading and writing gif images.") set_license("MIT") add_urls("https://github.com/xmake-mirror/giflib/releases/download/$(version)/giflib-$(version).tar.gz", "https://downloads.sourceforge.net/project/giflib/giflib-$(version).tar.gz") + + add_versions("5.2.2", "be7ffbd057cadebe2aa144542fd90c6838c6a083b5e8a9048b8ee3b66b29d5fb") add_versions("5.2.1", "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd") - add_configs("utils", {description = "Build utility binaries.", default = true, type = "boolean"}) + add_patches("5.2.1", "patches/5.2.1/unistd.h.patch", "0f1f7b9a295c9965529608f7e9d810b7f7a2642b3b18910402d5d7ce8b86fc13") - if is_plat("windows") then - add_deps("cgetopt") - end + add_configs("utils", {description = "Build utility binaries.", default = true, type = "boolean"}) - on_install("linux", "macosx", "windows", "mingw", "android", "iphoneos", "bsd", function (package) - local lib_sources = {"dgif_lib.c", "egif_lib.c", "gifalloc.c", "gif_err.c", "gif_font.c", "gif_hash.c", "openbsd-reallocarray.c"} - local kind = "static" - if package:config("shared") then - if package:is_plat("windows") then - cprint("${yellow}No support for dll on windows!${clear}") - else - kind = "shared" - end + on_load(function (package) + if package:config("utils") and package:is_plat("windows") then + package:add("deps", "cgetopt") end - if package:is_plat("windows") then - io.gsub("gif_hash.h", "\n#include \n", [[ - #ifndef _MSC_VER - #include - #endif - ]]) - io.gsub("gif_font.c", "\n#include \"gif_lib.h\"\n", "\n#include \"gif_lib.h\"\n#define strtok_r strtok_s\n") - end - local xmake_lua = string.format([[ - add_rules("mode.debug", "mode.release") - if is_plat("windows") then - add_requires("cgetopt") - end - target("gif") - set_kind("%s") - add_files("%s") - add_headerfiles("gif_lib.h") - ]], kind, table.concat(lib_sources, "\", \"")) - if package:config("utils") then - local util_table = {"gif2rgb", "gifbuild", "gifclrmp", "giffix", "giftext", "giftool"} - for _, util in ipairs(util_table) do - if package:is_plat("windows") then - -- fix unresolved external symbol snprintf before vs2013 - io.replace(util .. ".c", "snprintf", "_snprintf") - end - xmake_lua = xmake_lua .. string.format([[ - target("%s") - set_kind("binary") - if is_plat("windows") then - add_packages("cgetopt") - end - add_files("%s.c", "getarg.c", "qprintf.c", "quantize.c", "%s") - ]], util, util, table.concat(lib_sources, "\", \"")) + end) + + on_install(function (package) + local utils = package:config("utils") + if utils and package:is_plat("windows") then + -- fix unresolved external symbol snprintf before vs2013 + for _, file in ipairs({"gif2rgb.c", "gifbuild.c", "gifclrmp.c", "giffix.c", "giftext.c", "giftool.c"}) do + io.replace(file, "snprintf", "_snprintf", {plain = true}) end end - io.writefile("xmake.lua", xmake_lua) - local configs = {} - if package:is_plat("linux") and package:config("pic") ~= false then - configs.cxflags = "-fPIC" + + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, {utils = utils}) + if utils then + package:addenv("PATH", "bin") end - import("package.tools.xmake").install(package, configs) end) on_test(function (package) diff --git a/packages/g/ginkgo/xmake.lua b/packages/g/ginkgo/xmake.lua new file mode 100644 index 000000000..b8b9d145e --- /dev/null +++ b/packages/g/ginkgo/xmake.lua @@ -0,0 +1,45 @@ +package("ginkgo") + + set_homepage("https://ginkgo-project.github.io/") + set_description("Ginkgo is a high-performance linear algebra library for manycore systems, with a focus on solution of sparse linear systems.") + set_license("BSD-3-Clause") + + add_urls("https://github.com/ginkgo-project/ginkgo/archive/refs/tags/$(version).tar.gz", + "https://github.com/ginkgo-project/ginkgo.git") + add_versions("v1.7.0", "f4b362bcb046bc53fbe2e578662b939222d0c44b96449101829e73ecce02bcb3") + + add_configs("openmp", {description = "Compile OpenMP kernels for CPU.", default = false, type = "boolean"}) + add_configs("cuda", {description = "Compile kernels for NVIDIA GPUs.", default = false, type = "boolean"}) + add_configs("hip", {description = "Compile kernels for AMD or NVIDIA GPUs.", default = false, type = "boolean"}) + add_configs("sycl", {description = "Compile SYCL kernels for Intel GPUs or other SYCL enabled hardware.", default = false, type = "boolean"}) + + add_deps("cmake") + on_load("windows", "macosx", "linux", function (package) + if package:config("openmp") then + package:add("deps", "openmp") + end + if package:config("cuda") then + package:add("deps", "cuda") + end + -- TODO: add hip and sycl + end) + + on_install("windows|x64", "windows|arm64", "macosx", "linux", function (package) + local configs = {"-DGINKGO_BUILD_TESTS=OFF", "-DGINKGO_BUILD_EXAMPLES=OFF", "-DGINKGO_BUILD_BENCHMARKS=OFF", "-DGINKGO_BUILD_REFERENCE=ON", "-DGINKGO_BUILD_MPI=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DGINKGO_BUILD_CUDA=" .. (package:config("cuda") and "ON" or "OFF")) + table.insert(configs, "-DGINKGO_BUILD_HIP=" .. (package:config("hip") and "ON" or "OFF")) + table.insert(configs, "-DGINKGO_BUILD_SYCL=" .. (package:config("sycl") and "ON" or "OFF")) + table.insert(configs, "-DGINKGO_BUILD_OMP=" .. (package:config("openmp") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + const auto exec = gko::ReferenceExecutor::create(); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/g/gklib/port/xmake.lua b/packages/g/gklib/port/xmake.lua new file mode 100644 index 000000000..b2016fe3e --- /dev/null +++ b/packages/g/gklib/port/xmake.lua @@ -0,0 +1,53 @@ +option("openmp", {default = false}) +option("regex", {default = false}) +option("rand", {default = false}) + +add_rules("mode.debug", "mode.release") + +if has_config("openmp") then + add_requires("openmp") + add_packages("openmp") +end + +if has_config("regex") then + add_defines("USE_GKREGEX", {public = true}) +end + +if has_config("rand") then + add_defines("USE_GKRAND") +end + +includes("@builtin/check") + +configvar_check_cincludes("HAVE_EXECINFO_H", "execinfo.h") +configvar_check_cfuncs("HAVE_GETLINE", "getline") + +target("gklib") + set_kind("$(kind)") + add_files("*.c") + add_headerfiles("*.h") + + add_includedirs(".") + add_vectorexts("all") + + if is_plat("windows") then + add_files("win32/*.c") + add_headerfiles("(win32/adapt.h)") + add_defines("_CRT_SECURE_NO_DEPRECATE", "USE_GKREGEX", "__thread=__declspec(thread)", {public = true}) + if is_kind("shared") then + add_rules("utils.symbols.export_all") + end + elseif is_plat("mingw") then + add_defines("USE_GKREGEX") + elseif is_plat("linux") then + add_syslinks("m") + add_defines("_FILE_OFFSET_BITS=64") + elseif is_plat("bsd") then + add_syslinks("m") + end + + on_config(function (target) + if not target:check_csnippets({test = "extern __thread int x;"}) then + target:add("defines", "__thread") + end + end) diff --git a/packages/g/gklib/xmake.lua b/packages/g/gklib/xmake.lua new file mode 100644 index 000000000..78b9de993 --- /dev/null +++ b/packages/g/gklib/xmake.lua @@ -0,0 +1,51 @@ +package("gklib") + set_homepage("https://github.com/KarypisLab/GKlib") + set_description("A library of various helper routines and frameworks used by many of the lab's software") + set_license("Apache-2.0") + + add_urls("https://github.com/KarypisLab/GKlib.git") + add_versions("2023.03.26", "8bd6bad750b2b0d90800c632cf18e8ee93ad72d7") + + add_configs("regex", {description = "Enable GKREGEX support", default = false, type = "boolean"}) + add_configs("rand", {description = "Enable GKRAND support", default = false, type = "boolean"}) + add_configs("openmp", {description = "Enable openmp", default = false, type = "boolean"}) + + if is_plat("linux", "bsd") then + add_syslinks("m") + elseif is_plat("windows") then + add_defines("USE_GKREGEX", "__thread=__declspec(thread)") + elseif is_plat("mingw") then + add_defines("USE_GKREGEX") + end + + on_install("!iphoneos", function (package) + local configs = { + openmp = package:config("openmp"), + regex = package:config("regex"), + rand = package:config("rand") + } + + if configs.regex then + package:add("defines", "USE_GKREGEX") + end + + io.replace("gk_arch.h", "gk_ms_stdint.h", "stdint.h", {plain = true}) + io.replace("gk_arch.h", "gk_ms_inttypes.h", "inttypes.h", {plain = true}) + + io.replace("gk_arch.h", "LINUX", "__linux__", {plain = true}) + for _, file in ipairs({"timers.c", "gk_arch.h", "error.c", "string.c"}) do + io.replace(file, "WIN32", "_WIN32", {plain = true}) + end + + if configs.openmp then + for _, file in ipairs({"GKlib.h", "timers.c", "gk_proto.h"}) do + io.replace(file, "__OPENMP__", "_OPENMP", {plain = true}) + end + end + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("gk_strstr_replace", {includes = "GKlib.h"})) + end) diff --git a/packages/g/glad/xmake.lua b/packages/g/glad/xmake.lua index 693fdcd01..93def31ed 100644 --- a/packages/g/glad/xmake.lua +++ b/packages/g/glad/xmake.lua @@ -1,14 +1,16 @@ package("glad") - set_homepage("https://glad.dav1d.de/") set_description("Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.") set_license("MIT") add_urls("https://github.com/Dav1dde/glad/archive/$(version).tar.gz", "https://github.com/Dav1dde/glad.git") + add_versions("v0.1.34", "4be2900ff76ac71a2aab7a8be301eb4c0338491c7e205693435b09aad4969ecd") add_versions("v0.1.36", "8470ed1b0e9fbe88e10c34770505c8a1dc8ccb78cadcf673331aaf5224f963d2") + add_patches("0.1.36", "https://github.com/Dav1dde/glad/commit/59797224a66efc354da07d135fcf4b752b20d787.patch", "09cc8ca403fdf2f2d170c18174bae0a1a6cc7d045b25aecd9cb1dc3ecae0aa2c") + if is_plat("linux") then add_syslinks("dl") end diff --git a/packages/g/glaze/xmake.lua b/packages/g/glaze/xmake.lua index 85b60169f..3663a61df 100644 --- a/packages/g/glaze/xmake.lua +++ b/packages/g/glaze/xmake.lua @@ -6,23 +6,28 @@ package("glaze") add_urls("https://github.com/stephenberry/glaze/archive/refs/tags/$(version).tar.gz", "https://github.com/stephenberry/glaze.git") + add_versions("v2.7.0", "8e3ee2ba725137cd4f61bc9ceb74e2225dc22b970da1c5a43d2a6833115adbfc") + add_versions("v2.6.4", "79aff3370c6fe79be8e1774c4fab3e450a10444b91c2aa15aeebf5f54efedc5d") + add_versions("v2.5.3", "f4c5eb83c80f1caa0feaa831715e9982203908ea140242cb061aead161e2b09b") + add_versions("v2.4.4", "98ef6af4209e0b98d449d6d414b7e0d69b7a79f78d1c9efeb9dfeca011c0600c") + add_versions("v2.4.2", "2593617e874d6afc33158a68843c74d875e8e443b430aef826d69662459b280e") + add_versions("v2.3.1", "941bf3f8cea5b6a024895d37dceaaaa82071a9178af63e9935a1d9fd80caa451") + add_versions("v2.2.0", "1d6e36029a58bf8c4bdd035819e1ab02b87d8454dd80fa2f5d46c96a1e6d600c") add_versions("v1.3.5", "de5d59cb7f31193d45f67f25d8ced1499df50c0d926a1461432b87f2b2368817") - on_install(function (package) + on_install("linux", function (package) os.cp("include", package:installdir()) end) on_test(function (package) assert(package:check_cxxsnippets({test = [[ #include - struct obj_t - { + struct obj_t { double x{}; float y{}; }; template <> - struct glz::meta - { + struct glz::meta { using T = obj_t; static constexpr auto value = object("x", &T::x); }; diff --git a/packages/g/glbinding/xmake.lua b/packages/g/glbinding/xmake.lua new file mode 100644 index 000000000..b436174c6 --- /dev/null +++ b/packages/g/glbinding/xmake.lua @@ -0,0 +1,76 @@ +package("glbinding") + set_homepage("https://glbinding.org") + set_description("A C++ binding for the OpenGL API, generated using the gl.xml specification. ") + set_license("MIT") + + add_urls("https://github.com/cginternals/glbinding/archive/refs/tags/$(version).tar.gz", + "https://github.com/cginternals/glbinding.git") + + add_versions("v3.3.0", "a0aa5e67b538649979a71705313fc2b2c3aa49cf9af62a97f7ee9a665fd30564") + add_versions("v3.1.0", "6729b260787108462ec6d8954f32a3f11f959ada7eebf1a2a33173b68762849e") + add_versions("v3.0.2", "23a383f3ed31af742a4952b6c26faa9c346dd982ba9112c68293a578a6e542ad") + + add_versions("v2.1.4", "cb5971b086c0d217b2304d31368803fd2b8c12ee0d41c280d40d7c23588f8be2") + add_versions("v2.1.3", "21e219a5613c7de3668bea3f9577dc925790aaacfa597d9eb523fee2e6fda85c") + add_versions("v2.1.2", "e1303f017242c19993ba3d90581a7b1d9c108f0fb36db2be877d0554e1e9ed6f") + add_versions("v2.1.1", "cf5f32aa09c3427b0f5c9626fe83aa1473da037d55b6f14f8753b2d9159cc91d") + add_versions("v2.0.0", "fd09a469b9bd84e44cd0a33e76fb62413678a926601934b3eb0d8956ba11ec3a") + + if is_plat("linux") then + add_extsources("apt::libglbinding-dev", "pacman::glbinding") + elseif is_plat("macosx") then + add_extsources("brew::glbinding") + end + + add_deps("cmake", "khrplatform") + + on_load(function (package) + if package:version():major() < 3 then + if is_plat("linux") then + package:add("deps", "glx") + elseif is_plat("windows", "mingw") then + package:add("deps", "opengl") + end + end + end) + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DOPTION_BUILD_TESTS=OFF") + table.insert(configs, "-DOPTION_BUILD_OWN_KHR_HEADERS=ON") + + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + -- Breaking changes since v3.x.x + if package:version():major() >= 3 then + assert(package:check_cxxsnippets({test = [[ + #include + #include + using namespace gl; + + void test(int argc, char** argv) { + glbinding::initialize(nullptr); + + glBegin(GL_TRIANGLES); + glEnd(); + } + ]]}, {configs = {languages = "cxx11"}})) + else + assert(package:check_cxxsnippets({test = [[ + #include + #include + using namespace gl; + + void test(int argc, char** argv) { + glbinding::Binding::initialize(); + + glBegin(GL_TRIANGLES); + glEnd(); + } + ]]}, {configs = {languages = "cxx11"}})) + end + end) diff --git a/packages/g/glfw/xmake.lua b/packages/g/glfw/xmake.lua index cebd8eac4..839c2d7f8 100644 --- a/packages/g/glfw/xmake.lua +++ b/packages/g/glfw/xmake.lua @@ -4,7 +4,7 @@ package("glfw") set_description("GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan application development.") set_license("zlib") - add_urls("https://github.com/glfw/glfw/archive/$(version).tar.gz", + add_urls("https://github.com/glfw/glfw/archive/refs/tags/$(version).tar.gz", "https://github.com/glfw/glfw.git") add_versions("3.3.2", "98768e12e615fbe9f3386f5bbfeb91b5a3b45a8c4c77159cef06b1f6ff749537") add_versions("3.3.4", "cc8ac1d024a0de5fd6f68c4133af77e1918261396319c24fd697775a6bc93b63") @@ -12,8 +12,12 @@ package("glfw") add_versions("3.3.6", "ed07b90e334dcd39903e6288d90fa1ae0cf2d2119fec516cf743a0a404527c02") add_versions("3.3.7", "fd21a5f65bcc0fc3c76e0f8865776e852de09ef6fbc3620e09ce96d2b2807e04") add_versions("3.3.8", "f30f42e05f11e5fc62483e513b0488d5bceeab7d9c5da0ffe2252ad81816c713") + add_versions("3.3.9", "a7e7faef424fcb5f83d8faecf9d697a338da7f7a906fc1afbc0e1879ef31bd53") + add_versions("3.4", "c038d34200234d071fae9345bc455e4a8f2f544ab60150765d7704e08f3dac01") - add_configs("glfw_include", {description = "Choose submodules enabled in glfw", default = "none", type = "string", values = {"none", "vulkan", "glu", "glext", "es2", "es3"}}) + add_configs("glfw_include", {description = "Choose submodules enabled in glfw", default = "none", type = "string", values = {"none", "vulkan", "glu", "glext", "es2", "es3", "system"}}) + add_configs("x11", {description = "Build support for X11", default = is_plat("linux"), type = "boolean"}) + add_configs("wayland", {description = "Build support for Wayland", default = false, type = "boolean"}) if is_plat("linux") then add_extsources("apt::libglfw3-dev", "pacman::glfw-x11") @@ -28,14 +32,20 @@ package("glfw") elseif is_plat("mingw") then add_syslinks("gdi32") elseif is_plat("linux") then - -- TODO: add wayland support - add_deps("libx11", "libxrandr", "libxrender", "libxinerama", "libxfixes", "libxcursor", "libxi", "libxext") add_syslinks("dl", "pthread") - add_defines("_GLFW_X11") end on_load(function (package) - package:add("defines", "GLFW_INCLUDE_" .. package:config("glfw_include"):upper()) + local glfw_include = package:config("glfw_include") + if glfw_include ~= "system" then + package:add("defines", "GLFW_INCLUDE_" .. glfw_include:upper()) + end + if package:config("x11") then + package:add("deps", "libx11", "libxrandr", "libxrender", "libxinerama", "libxfixes", "libxcursor", "libxi", "libxext") + end + if package:config("wayland") then + package:add("deps", "wayland") + end end) on_install("macosx", "windows", "linux", "mingw", function (package) @@ -45,8 +55,10 @@ package("glfw") if package:is_plat("windows") then table.insert(configs, "-DUSE_MSVC_RUNTIME_LIBRARY_DLL=" .. (package:config("vs_runtime"):startswith("MT") and "OFF" or "ON")) end + table.insert(configs, "-DGLFW_BUILD_X11=" .. (package:config("x11") and "ON" or "OFF")) + table.insert(configs, "-DGLFW_BUILD_WAYLAND=" .. (package:config("wayland") and "ON" or "OFF")) if package:is_plat("linux") then - import("package.tools.cmake").install(package, configs, {packagedeps = {"libxrender", "libxfixes", "libxext", "libx11"}}) + import("package.tools.cmake").install(package, configs, {packagedeps = {"libxrender", "libxfixes", "libxext", "libx11", "wayland"}}) else import("package.tools.cmake").install(package, configs) end diff --git a/packages/g/glfw3webgpu/xmake.lua b/packages/g/glfw3webgpu/xmake.lua index bf18f8e84..64d03f1c0 100644 --- a/packages/g/glfw3webgpu/xmake.lua +++ b/packages/g/glfw3webgpu/xmake.lua @@ -6,6 +6,8 @@ package("glfw3webgpu") add_urls("https://github.com/eliemichel/glfw3webgpu/archive/refs/tags/$(version).tar.gz", "https://github.com/eliemichel/glfw3webgpu.git") + add_versions("v1.2.0", "28387b960aff573728bde2bf0fa876c33608cdadaca8d23f4a46cd31920ab633") + add_versions("v1.1.0", "307ba86a724adc84a875e8bd2374baad0fabc77797f20f9a1779eef8d9ffe95a") add_versions("v1.0.1", "b98c63f1905f0e4cf99229de8b7e5c2693fdf3b8d684b5a43d60f21f67d33e6b") add_deps("wgpu-native", "glfw") diff --git a/packages/g/glib/xmake.lua b/packages/g/glib/xmake.lua index 0356ea2a9..4eabfe1b4 100644 --- a/packages/g/glib/xmake.lua +++ b/packages/g/glib/xmake.lua @@ -1,63 +1,74 @@ package("glib") - set_homepage("https://developer.gnome.org/glib/") - set_description("Core application library for C.") + set_homepage("https://docs.gtk.org/glib/") + set_description("Low-level core library that forms the basis for projects such as GTK+ and GNOME.") + set_license("LGPL-2.1") - set_urls("https://github.com/GNOME/glib/archive/refs/tags/$(version).tar.gz", - "https://gitlab.gnome.org/GNOME/glib/-/archive/$(version)/glib-$(version).tar.gz", - "https://gitlab.gnome.org/GNOME/glib.git") - add_versions("2.71.0", "10cdfa2893b7ccf6a95b25644ec51e2c609274a5af3ad8e743d6dc35434fdf11") + add_urls("https://download.gnome.org/sources/glib/$(version).tar.xz", {alias = "home", version = function (version) + return format("%d.%d/glib-%s", version:major(), version:minor(), version) + end, excludes = {"*/COPYING"}}) + add_urls("https://gitlab.gnome.org/GNOME/glib/-/archive/$(version)/glib-$(version).tar.gz", {alias = "gitlab"}) + add_urls("https://gitlab.gnome.org/GNOME/glib.git") + add_versions("home:2.71.0", "926816526f6e4bba9af726970ff87be7dac0b70d5805050c6207b7bb17ea4fca") + add_versions("home:2.78.1", "915bc3d0f8507d650ead3832e2f8fb670fce59aac4d7754a7dab6f1e6fed78b2") add_patches("2.71.0", path.join(os.scriptdir(), "patches", "2.71.0", "macosx.patch"), "a0c928643e40f3a3dfdce52950486c7f5e6f6e9cfbd76b20c7c5b43de51d6399") - if is_plat("windows") then - add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) - end - - add_deps("meson", "ninja", "libffi", "pcre") + add_deps("meson", "ninja", "libffi", "zlib") if is_plat("linux") then add_deps("libiconv") - elseif is_plat("windows", "macosx") then + elseif is_plat("macosx") then + add_deps("libiconv", {system = true}) add_deps("libintl") + elseif is_plat("windows") then + add_deps("libintl", "pkgconf") end add_includedirs("include/glib-2.0", "lib/glib-2.0/include") - add_links("gio-2.0", "gobject-2.0", "gthread-2.0", "gmodule-2.0", "glib-2.0", "intl") - if is_plat("macosx") then - add_syslinks("iconv") - add_frameworks("Foundation", "CoreFoundation") + add_links("gio-2.0", "gobject-2.0", "gthread-2.0", "gmodule-2.0", "glib-2.0") + + if is_plat("windows") then + add_syslinks("user32", "shell32", "ole32", "ws2_32", "shlwapi", "iphlpapi", "dnsapi") + elseif is_plat("macosx") then + add_syslinks("resolv") + add_frameworks("AppKit", "Foundation", "CoreServices", "CoreFoundation") add_extsources("brew::glib") elseif is_plat("linux") then add_syslinks("pthread", "dl", "resolv") add_extsources("apt::libglib2.0-dev", "pacman::glib2") end - if on_fetch then - on_fetch("macosx", "linux", function (package, opt) - if opt.system and package.find_package then - local result - for _, name in ipairs({"gio-2.0", "gobject-2.0", "gthread-2.0", "gmodule-2.0", "glib-2.0"}) do - local pkginfo = package.find_package and package:find_package("pkgconfig::" .. name, opt) - if pkginfo then - if not result then - result = table.copy(pkginfo) - else - local includedirs = pkginfo.sysincludedirs or pkginfo.includedirs - result.links = table.wrap(result.links) - result.linkdirs = table.wrap(result.linkdirs) - result.includedirs = table.wrap(result.includedirs) - table.join2(result.includedirs, includedirs) - table.join2(result.linkdirs, pkginfo.linkdirs) - table.join2(result.links, pkginfo.links) - end + on_fetch("macosx", "linux", function (package, opt) + if opt.system and package.find_package then + local result + for _, name in ipairs({"gio-2.0", "gobject-2.0", "gthread-2.0", "gmodule-2.0", "glib-2.0"}) do + local pkginfo = package.find_package and package:find_package("pkgconfig::" .. name, opt) + if pkginfo then + if not result then + result = table.copy(pkginfo) + else + local includedirs = pkginfo.sysincludedirs or pkginfo.includedirs + result.links = table.wrap(result.links) + result.linkdirs = table.wrap(result.linkdirs) + result.includedirs = table.wrap(result.includedirs) + table.join2(result.includedirs, includedirs) + table.join2(result.linkdirs, pkginfo.linkdirs) + table.join2(result.links, pkginfo.links) end end - return result end - end) - end + return result + end + end) + + on_load("windows", "macosx", "linux", "cross", function (package) + if package:version():ge("2.74.0") then + package:add("deps", "pcre2") + else + package:add("deps", "pcre") + end + end) on_install("windows", "macosx", "linux", "cross", function (package) - import("package.tools.meson") local configs = {"-Dbsymbolic_functions=false", "-Ddtrace=false", "-Dman=false", @@ -69,7 +80,7 @@ package("glib") "-Dlibmount=disabled"} if package:is_plat("macosx") and package:version():le("2.61.0") then table.insert(configs, "-Diconv=native") - elseif package:is_plat("windows") then + elseif package:is_plat("windows") and package:version():le("2.74.0") then table.insert(configs, "-Diconv=external") end table.insert(configs, "-Dglib_debug=" .. (package:debug() and "enabled" or "disabled")) @@ -82,21 +93,7 @@ package("glib") if package:is_plat("windows") then io.gsub("meson.build", "dependency%('libffi',", "dependency('libffi', modules: ['libffi::ffi'],") end - local envs = meson.buildenvs(package) - if package:is_plat("windows") then - for _, dep in ipairs(package:orderdeps()) do - local fetchinfo = dep:fetch() - if fetchinfo then - for _, includedir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do - envs.INCLUDE = (envs.INCLUDE or "") .. path.envsep() .. includedir - end - for _, linkdir in ipairs(fetchinfo.linkdirs) do - envs.LIB = (envs.LIB or "") .. path.envsep() .. linkdir - end - end - end - end - meson.install(package, configs, {envs = envs}) + import("package.tools.meson").install(package, configs, {packagedeps = {"libintl", "libiconv", "libffi", "zlib"}}) package:addenv("PATH", "bin") end) diff --git a/packages/g/glm/xmake.lua b/packages/g/glm/xmake.lua index e4295c9fc..6fa5516f0 100644 --- a/packages/g/glm/xmake.lua +++ b/packages/g/glm/xmake.lua @@ -2,21 +2,64 @@ package("glm") set_homepage("https://glm.g-truc.net/") set_description("OpenGL Mathematics (GLM)") + set_license("MIT") - set_urls("https://github.com/g-truc/glm/archive/$(version).tar.gz", + add_urls("https://github.com/g-truc/glm/archive/refs/tags/$(version).tar.gz", {version = function(version) return version:gsub("%+", ".") end}) add_urls("https://github.com/g-truc/glm.git") + add_versions("1.0.1", "55a195bacf76cc48226292ada71b26abc980cde53180120a7b2a4ea8718e1507") + add_versions("1.0.0", "e51f6c89ff33b7cfb19daafb215f293d106cd900f8d681b9b1295312ccadbd23") add_versions("0.9.9+8", "7d508ab72cb5d43227a3711420f06ff99b0a0cb63ee2f93631b162bfe1fe9592") + add_configs("header_only", {description = "Use header only version.", default = true, type = "boolean"}) + add_configs("cxx_standard", {description = "Select c++ standard to build.", default = "14", type = "string", values = {"98", "11", "14", "17", "20"}}) + add_configs("modules", {description = "Build with C++20 modules support.", default = false, type = "boolean"}) + + on_load(function (package) + if package:config("modules") then + package:config_set("header_only", false) + package:config_set("cxx_standard", "20") + end + if not package:config("header_only") and not package:config("modules") then + package:add("deps", "cmake") + end + end) + on_install(function (package) - os.cp("glm", package:installdir("include")) - os.cp("cmake", package:installdir("lib")) + if not package:config("modules") then + if package:config("header_only") then + os.cp("glm", package:installdir("include")) + else + io.replace("CMakeLists.txt", "NOT GLM_DISABLE_AUTO_DETECTION", "FALSE") + local configs = {"-DGLM_BUILD_TESTS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DCMAKE_CXX_STANDARD=" .. package:config("cxx_standard")) + import("package.tools.cmake").install(package, configs) + end + else + io.writefile("xmake.lua", [[ + target("glm") + set_kind("$(kind)") + set_languages("c++20") + add_headerfiles("./(glm/**.hpp)") + add_headerfiles("./(glm/**.h)") + add_headerfiles("./(glm/**.inl)") + add_includedirs(".") + add_files("glm/**.cpp") + add_files("glm/**.cppm", {public = true}) + ]]) + import("package.tools.xmake").install(package) + end end) on_test(function (package) + local cxx_standard = "c++" .. package:config("cxx_standard") assert(package:check_cxxsnippets({test = [[ + #include + #include void test() { glm::mat4 proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); } - ]]}, {configs = {languages = "c++14"}, includes = {"glm/mat4x4.hpp", "glm/ext/matrix_clip_space.hpp"}})) + ]]}, {configs = {languages = cxx_standard}})) end) diff --git a/packages/g/glob/xmake.lua b/packages/g/glob/xmake.lua new file mode 100644 index 000000000..c383c9ae9 --- /dev/null +++ b/packages/g/glob/xmake.lua @@ -0,0 +1,48 @@ +package("glob") + set_homepage("https://github.com/p-ranav/glob") + set_description("Glob for C++17") + set_license("MIT") + + add_urls("https://github.com/p-ranav/glob.git") + + add_versions("2024.04.18", "d025092c0e1eb1a8b226d3a799fd32680d2fd13f") + + add_configs("header_only", {description = "Use header only version.", default = false, type = "boolean"}) + add_configs("ghc_filesystem", {description = "Use ghc::filesystem instead of std::filesystem", default = false, type = "boolean"}) + + on_load(function (package) + if package:config("ghc_filesystem") then + package:add("deps", "ghc_filesystem") + end + if package:config("header_only") then + package:set("kind", "library", {headeronly = true}) + end + end) + + on_install(function (package) + if package:config("ghc_filesystem") then + package:add("defines", "GLOB_USE_GHC_FILESYSTEM") + end + if package:config("header_only") then + os.cp("single_include/glob", package:installdir("include")) + else + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + target("glob") + set_kind("$(kind)") + set_languages("cxx17") + add_headerfiles("include/(glob/*.h)") + add_files("source/*.cpp") + add_includedirs("include", {public = true}) + ]]) + import("package.tools.xmake").install(package) + end + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + glob::glob("~/.b*"); + } + ]]}, {configs = {languages = "cxx17"}, includes = package:config("header_only") and "glob/glob.hpp" or "glob/glob.h"})) + end) diff --git a/packages/g/glog/xmake.lua b/packages/g/glog/xmake.lua index 3f3c4614b..7ba5a17ac 100644 --- a/packages/g/glog/xmake.lua +++ b/packages/g/glog/xmake.lua @@ -1,11 +1,12 @@ package("glog") - set_homepage("https://github.com/google/glog/") set_description("C++ implementation of the Google logging module") set_license("BSD-3-Clause") add_urls("https://github.com/google/glog/archive/refs/tags/$(version).tar.gz", "https://github.com/google/glog.git") + + add_versions("v0.7.0", "375106b5976231b92e66879c1a92ce062923b9ae573c42b56ba28b112ee4cc11") add_versions("v0.4.0", "f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c") add_versions("v0.5.0", "eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5") add_versions("v0.6.0", "8a83bf982f37bb70825df71a9709fa90ea9f4447fb3c099e1d720a439d88bad6") @@ -19,9 +20,11 @@ package("glog") if is_plat("linux") then add_syslinks("pthread") + elseif is_plat("windows") then + add_syslinks("dbghelp") end - on_load("windows", "linux", "macosx", "android", "iphoneos", "cross", function (package) + on_load(function (package) if package:is_plat("windows") then if package:version():le("0.4") and not package:config("shared") then package:add("defines", "GOOGLE_GLOG_DLL_DECL=") @@ -35,16 +38,32 @@ package("glog") end end) - on_install("windows", "linux", "macosx", "android", "iphoneos", "cross", function (package) + on_install(function (package) local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_INSTALL_LIBDIR=lib"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) for config, dep in pairs(configdeps) do table.insert(configs, "-DWITH_" .. config:upper() .. "=" .. (package:config(config) and "ON" or "OFF")) end + + -- fix cmake try run + if package:is_plat("mingw") then + table.insert(configs, "-DHAVE_SYMBOLIZE_EXITCODE=ON") + end + import("package.tools.cmake").install(package, configs) + + -- fix https://github.com/xmake-io/xmake-repo/discussions/4221 + if package:version() and package:version():ge("0.7.0") then + io.replace(path.join(package:installdir("include"), "glog/logging.h"), + "#define GLOG_LOGGING_H", "#define GLOG_LOGGING_H\n#define GLOG_USE_GLOG_EXPORT", {plain = true}) + end end) on_test(function (package) - assert(package:has_cxxfuncs("google::InitGoogleLogging(\"glog\")", {includes = "glog/logging.h"})) + local languages + if package:version():ge("0.7.0") then + languages = "c++14" + end + assert(package:has_cxxfuncs("google::InitGoogleLogging(\"glog\")", {includes = "glog/logging.h", configs = {languages = languages}})) end) diff --git a/packages/g/glpk/xmake.lua b/packages/g/glpk/xmake.lua new file mode 100644 index 000000000..73face3fb --- /dev/null +++ b/packages/g/glpk/xmake.lua @@ -0,0 +1,53 @@ +package("glpk") + set_homepage("https://www.gnu.org/software/glpk/") + set_description("The GLPK (GNU Linear Programming Kit) package is intended for solving large-scale linear programming (LP), mixed integer programming (MIP), and other related problems.") + set_license("GPL-3.0") + + set_urls("https://ftp.gnu.org/gnu/glpk/glpk-$(version).tar.gz") + + add_versions("5.0", "4a1013eebb50f728fc601bdd833b0b2870333c3b3e5a816eeba921d95bec6f15") + + if is_plat("linux") then + add_extsources("apt::libglpk-dev") + end + + on_install("macosx|x86_64", "linux", function (package) + local configs = {} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) + import("package.tools.autoconf").install(package, configs) + end) + + on_install("windows", function (package) + os.cd("w64") -- Makefiles are the same in w64 and w32 directory + os.cp("config_VC", "config.h") + local version = package:version() + local basename = string.format("glpk_%d_%d", version:major(), version:minor()) + -- glp_netgen_prob is not defined, but should be disabled + -- see: https://www.mail-archive.com/bug-glpk@gnu.org/msg01020.html + io.replace(basename .. ".def", "glp_netgen_prob\n", "", {plain = true}) + import("package.tools.nmake").build(package, {"/f", package:config("shared") and "makefile_VC_DLL" or "makefile_VC"}) + + if package:config("shared") then + os.cp(basename .. ".dll", package:installdir("bin")) + os.cp(basename .. ".lib", package:installdir("lib")) + else + os.cp("glpk.lib", package:installdir("lib")) + end + + os.cd("..") + os.cp("src/glpk.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + int main() { + glp_prob* prob = glp_create_prob(); + if (prob) { + glp_delete_prob(prob); + } + return 0; + } + ]]})) + end) diff --git a/packages/g/glshaderpp/xmake.lua b/packages/g/glshaderpp/xmake.lua new file mode 100644 index 000000000..8c3a3e8f8 --- /dev/null +++ b/packages/g/glshaderpp/xmake.lua @@ -0,0 +1,30 @@ +package("glshaderpp") + set_kind("library", {headeronly = true}) + set_homepage("https://gitlab-lepuy.iut.uca.fr/opengl/glshaderpp") + set_description("A lightweight header-only library to compile and link OpenGL GLSL shaders.") + set_license("LGPL-3.0-or-later") + + add_urls("https://gitlab-lepuy.iut.uca.fr/opengl/glshaderpp/-/archive/$(version)/glshaderpp-$(version).tar.bz2", + "https://gitlab-lepuy.iut.uca.fr/opengl/glshaderpp.git") + + add_versions("v1.0.0", "81b47b90e90d8be19d0421d67f4fc735d74d285a5f516b99ee7dc49d7933ecf6") + + add_deps("glew") + + on_install("linux", "macosx", "mingw", "windows", function (package) + os.cp("GLShaderPP/public/GLShaderPP", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include + #include + + void test() { + GLShaderPP::CShaderException e("If you read this, GLShaderPP is happy :)", + GLShaderPP::CShaderException::ExceptionType::LinkError); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/g/glslang/xmake.lua b/packages/g/glslang/xmake.lua index 41e4329c1..0bdf75b6a 100644 --- a/packages/g/glslang/xmake.lua +++ b/packages/g/glslang/xmake.lua @@ -14,12 +14,17 @@ package("glslang") add_versions("1.3.246+1", "14e5a04e70057972eef8a40df422e30a3b70e4b5") add_versions("1.3.250+1", "d1517d64cfca91f573af1bf7341dc3a5113349c0") add_versions("1.3.261+1", "76b52ebf77833908dc4c0dd6c70a9c357ac720bd") + add_versions("1.3.268+0", "36d08c0d940cf307a23928299ef52c7970d8cee6") + add_versions("1.3.275+0", "a91631b260cba3f22858d6c6827511e636c2458a") + add_versions("1.3.280+0", "ee2f5d09eaf8f4e8d0d598bd2172fce290d4ca60") + add_versions("1.3.283+0", "e8dd0b6903b34f1879520b444634c75ea2deedf5") add_patches("1.3.246+1", "https://github.com/KhronosGroup/glslang/commit/1e4955adbcd9b3f5eaf2129e918ca057baed6520.patch", "47893def550f1684304ef7c49da38f0a8fe35c190a3452d3bf58370b3ee7165d") add_configs("binaryonly", {description = "Only use binary program.", default = false, type = "boolean"}) add_configs("exceptions", {description = "Build with exception support.", default = false, type = "boolean"}) add_configs("rtti", {description = "Build with RTTI support.", default = false, type = "boolean"}) + add_configs("default_resource_limits", {description = "Build with default resource limits.", default = false, type = "boolean"}) if is_plat("wasm") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end @@ -30,6 +35,8 @@ package("glslang") add_syslinks("pthread") end + add_defines("ENABLE_HLSL") + on_load(function (package) if package:config("binaryonly") then package:set("kind", "binary") @@ -71,16 +78,29 @@ package("glslang") end table.insert(configs, "-DENABLE_EXCEPTIONS=" .. (package:config("exceptions") and "ON" or "OFF")) table.insert(configs, "-DENABLE_RTTI=" .. (package:config("rtti") and "ON" or "OFF")) + table.insert(configs, "-DALLOW_EXTERNAL_SPIRV_TOOLS=ON") import("package.tools.cmake").install(package, configs, {packagedeps = {"spirv-tools"}}) if not package:config("binaryonly") then package:add("links", "glslang", "MachineIndependent", "GenericCodeGen", "OGLCompiler", "OSDependent", "HLSL", "SPIRV", "SPVRemapper") end + if package:config("default_resource_limits") then + package:add("links", "glslang", "glslang-default-resource-limits") + end + + -- https://github.com/KhronosGroup/glslang/releases/tag/12.3.0 + local bindir = package:installdir("bin") + local glslangValidator = path.join(bindir, "glslangValidator" .. (is_host("windows") and ".exe" or "")) + if not os.isfile(glslangValidator) then + local glslang = path.join(bindir, "glslang" .. (is_host("windows") and ".exe" or "")) + os.trycp(glslang, glslangValidator) + end end) on_test(function (package) if not package:is_cross() then os.vrun("glslangValidator --version") end + if not package:config("binaryonly") then assert(package:has_cxxfuncs("ShInitialize", {configs = {languages = "c++11"}, includes = "glslang/Public/ShaderLang.h"})) end diff --git a/packages/g/gmp/xmake.lua b/packages/g/gmp/xmake.lua index ce076d7d7..d56334b3a 100644 --- a/packages/g/gmp/xmake.lua +++ b/packages/g/gmp/xmake.lua @@ -4,10 +4,12 @@ package("gmp") set_description("GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers.") set_license("LGPL-3.0") + add_urls("https://ftpmirror.gnu.org/gmp/gmp-$(version).tar.xz") + add_urls("https://ftp.gnu.org/gnu/gmp/gmp-$(version).tar.xz") add_urls("https://gmplib.org/download/gmp/gmp-$(version).tar.xz") add_versions("6.2.1", "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2") + add_versions("6.3.0", "a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898") - if is_plat("mingw") and is_subhost("msys") then add_extsources("pacman::gmp") elseif is_plat("linux") then @@ -16,6 +18,12 @@ package("gmp") add_extsources("brew::gmp") end + on_fetch(function (package, opt) + if opt.system then + return package:find_package("system::gmp", {includes = "gmp.h"}) + end + end) + add_deps("m4") on_install("macosx", "linux", function (package) @@ -28,7 +36,16 @@ package("gmp") if package:config("pic") ~= false then table.insert(configs, "--with-pic") end - import("package.tools.autoconf").install(package, configs) + if package:is_plat("macosx") and package:is_arch("arm64") and os.arch() == "x86_64" then + import("package.tools.autoconf") + table.insert(configs, "--build=x86_64-apple-darwin") + table.insert(configs, "--host=arm64-apple-darwin") + local envs = autoconf.buildenvs(package, {cflags = "--target=arm64-apple-darwin"}) + envs.CC = package:build_getenv("cc") .. " -arch arm64" -- for linker flags + autoconf.install(package, configs, {envs = envs}) + else + import("package.tools.autoconf").install(package, configs) + end end) on_test(function (package) diff --git a/packages/g/gmssl/xmake.lua b/packages/g/gmssl/xmake.lua new file mode 100644 index 000000000..92048fdf6 --- /dev/null +++ b/packages/g/gmssl/xmake.lua @@ -0,0 +1,44 @@ +package("gmssl") + set_homepage("https://github.com/guanzhi/GmSSL") + set_description("Password Toolkit supporting National secret chip SM2/SM3/SM4/SM9/SSL") + set_license("Apache-2.0") + + add_urls("https://github.com/guanzhi/GmSSL/archive/refs/tags/$(version).tar.gz", + "https://github.com/guanzhi/GmSSL.git") + + add_versions("v3.1.1", "23ed2ce74e408fc4c80289d2b499c7c5eec8373fefaf3827a53cb4c134dd5263") + add_versions("v3.1.0", "a3cdf5df87b07df33cb9e30c35de658fd0c06d5909d4428f4abd181d02567cde") + + if is_plat("mingw", "msys") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + if is_plat("windows", "mingw") then + add_syslinks("ws2_32", "advapi32") + elseif is_plat("linux") then + add_syslinks("dl") + elseif is_plat("macosx") then + add_frameworks("Security") + end + + add_deps("cmake") + + on_install(function (package) + if package:is_plat("windows") then + local cflags = table.wrap(package:config("cflags")) + table.insert(cflags, "/utf-8") + table.insert(cflags, "-DWIN32") + package:config_set("cflags", cflags) + package:add("defines", "WIN32") + io.replace("CMakeLists.txt", [[set(CMAKE_INSTALL_PREFIX "C:/Program Files/GmSSL")]], "", {plain = true}) + end + + local configs = {"-DBUILD_TESTING=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("base64_encode_init", {includes = "gmssl/base64.h"})) + end) diff --git a/packages/g/gnu-gsl/cmake/cmakelists.txt b/packages/g/gnu-gsl/cmake/cmakelists.txt new file mode 100644 index 000000000..60559c00c --- /dev/null +++ b/packages/g/gnu-gsl/cmake/cmakelists.txt @@ -0,0 +1,86 @@ +cmake_minimum_required(VERSION 3.8) +project(gsl C) +include(GNUInstallDirs) +option(INSTALL_HEADERS "Install public header files" ON) + +# Function to extract parameter from makefile. Space separated values are returned as lists +function(extract_from_makefile PATTERN RETURN FILEPATH) + file(READ ${FILEPATH} MAKEFILE_CONTENT) + string(REGEX MATCH "${PATTERN}" CONTENTS "${MAKEFILE_CONTENT}") + set(CONTENTS ${CMAKE_MATCH_1}) + # Split string into list + string(REGEX REPLACE "([\t ]+(\\\\\n)?)+" ";" CONTENTS "${CONTENTS}") + string(REGEX REPLACE "[\t ]*\\\\\n[\t ]*;" "" CONTENTS "${CONTENTS}") + if("${CONTENTS}" STREQUAL "") + message(AUTHOR_WARNING "No match for \"${PATTERN}\" found in file ${FILEPATH}") + endif() + # Return + set(${RETURN} ${CONTENTS} PARENT_SCOPE) +endfunction(extract_from_makefile) + +# Function to extract C sources from makefile +function(extract_sources SUBFOLDER ALLSOURCES) + extract_from_makefile("lib[a-zA-Z1-9_]*_la_SOURCES[ \t]*=[ \t]*(((\\\\\n)?[^\n])*)" SOURCEFILES "${SUBFOLDER}/Makefile.am") + # Add the folder in front of the file names + string(REGEX REPLACE "([^;]+)" "${SUBFOLDER}/\\1" SOURCEFILES "${SOURCEFILES}") + # Return + set(${ALLSOURCES} ${${ALLSOURCES}} ${SOURCEFILES} PARENT_SCOPE) +endfunction(extract_sources) + +set(SOURCES) +set(CBLAS_SOURCES) +extract_from_makefile("SUBDIRS = (((\\\\\n)?[^\n])*)" FOLDERS "./Makefile.am") +extract_sources("." SOURCES) +foreach(DIR IN LISTS FOLDERS) + if("${DIR}" STREQUAL "cblas") + extract_sources("${DIR}" CBLAS_SOURCES) + else() + extract_sources("${DIR}" SOURCES) + endif() +endforeach() + +file(READ gsl_types.h GSLTYPES_H) +string(REPLACE "#ifdef WIN32" "#ifdef _WIN32" GSLTYPES_H "${GSLTYPES_H}") +if(BUILD_SHARED_LIBS) + string(REPLACE "# ifdef GSL_DLL" "# if 1 /*GSL_DLL*/" GSLTYPES_H "${GSLTYPES_H}") +endif() +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gsl_types.h "${GSLTYPES_H}") + +file(GLOB_RECURSE PUBLIC_HEADERS gsl*.h) +list(APPEND PUBLIC_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/gsl_types.h) + +# The debug libraries have a "d" postfix so that CMake's FindGSL.cmake +# module can distinguish between Release and Debug libraries +set(CMAKE_DEBUG_POSTFIX "d") + +add_library(gslcblas ${CBLAS_SOURCES}) +set_target_properties(gslcblas PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + +add_library(gsl ${SOURCES}) +set_target_properties(gsl PROPERTIES DEFINE_SYMBOL DLL_EXPORT WINDOWS_EXPORT_ALL_SYMBOLS ON) +target_link_libraries(gsl PUBLIC gslcblas) + + +if(INSTALL_HEADERS) + set_target_properties(gsl PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") +endif() +target_include_directories(gslcblas PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(gsl PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +# For the build, we need to copy all headers to the gsl directory +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gsl) +file(COPY ${PUBLIC_HEADERS} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/gsl") + +set(TARGET_INSTALL_OPTIONS) +if(INSTALL_HEADERS) + set(TARGET_INSTALL_OPTIONS PUBLIC_HEADER DESTINATION include/gsl) +endif() + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gsl.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gsl.pc" @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gsl.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + +install(TARGETS gsl gslcblas + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ${TARGET_INSTALL_OPTIONS} +) diff --git a/packages/g/gnu-gsl/patches/add_fp_control.patch b/packages/g/gnu-gsl/patches/add_fp_control.patch new file mode 100644 index 000000000..dceeb3881 --- /dev/null +++ b/packages/g/gnu-gsl/patches/add_fp_control.patch @@ -0,0 +1,97 @@ +--- + ieee-utils/fp-win.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + ieee-utils/fp.c | 2 ++ + 2 files changed, 72 insertions(+) + create mode 100644 ieee-utils/fp-win.c + +diff --git a/ieee-utils/fp-win.c b/ieee-utils/fp-win.c +new file mode 100644 +index 0000000..e024eae +--- /dev/null ++++ b/ieee-utils/fp-win.c +@@ -0,0 +1,70 @@ ++/* fp-win.c ++ * ++ * Author: Brian Gladman ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or (at ++ * your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++ */ ++ ++#include ++ ++#include ++#include ++#include ++ ++const char *fp_env_string = "round-to-nearest,double-precision,mask-all"; ++ ++int ++gsl_ieee_set_mode (int precision, int rounding, int exception_mask) ++{ ++ unsigned int old, mode = _DN_SAVE, mask = _MCW_DN | _MCW_RC | _MCW_EM; ++ ++ switch(precision) ++ { ++ case GSL_IEEE_SINGLE_PRECISION: mode |= _PC_24; break; ++ case GSL_IEEE_EXTENDED_PRECISION: mode |= _PC_64; break; ++ case GSL_IEEE_DOUBLE_PRECISION: ++ default: mode |= _PC_53; ++ } ++#ifndef _M_AMD64 ++ mask |= _MCW_PC; ++#endif ++ ++ switch(rounding) ++ { ++ case GSL_IEEE_ROUND_DOWN: mode |= _RC_DOWN; break; ++ case GSL_IEEE_ROUND_UP: mode |= _RC_UP; break; ++ case GSL_IEEE_ROUND_TO_ZERO: mode |= _RC_CHOP; break; ++ case GSL_IEEE_ROUND_TO_NEAREST: ++ default: mode |= _RC_NEAR; ++ } ++ ++ if(exception_mask & GSL_IEEE_MASK_INVALID) ++ mode |= _EM_INVALID; ++ if(exception_mask & GSL_IEEE_MASK_DENORMALIZED) ++ mode |= _EM_DENORMAL; ++ if(exception_mask & GSL_IEEE_MASK_DIVISION_BY_ZERO) ++ mode |= _EM_ZERODIVIDE; ++ if(exception_mask & GSL_IEEE_MASK_OVERFLOW) ++ mode |= _EM_OVERFLOW; ++ if(exception_mask & GSL_IEEE_MASK_UNDERFLOW) ++ mode |= _EM_UNDERFLOW; ++ if(exception_mask & GSL_IEEE_TRAP_INEXACT) ++ mode &= ~_EM_INEXACT; ++ else ++ mode |= _EM_INEXACT; ++ ++ _controlfp_s( &old, mode, mask); ++ return GSL_SUCCESS; ++} +diff --git a/ieee-utils/fp.c b/ieee-utils/fp.c +index 445a14f..b6ae5af 100644 +--- a/ieee-utils/fp.c ++++ b/ieee-utils/fp.c +@@ -45,6 +45,8 @@ + #endif + #elif HAVE_DECL_FEENABLEEXCEPT || HAVE_DECL_FESETTRAPENABLE + #include "fp-gnuc99.c" ++#elif _MSC_VER ++#include "fp-win.c" + #else + #include "fp-unknown.c" + #endif +-- + diff --git a/packages/g/gnu-gsl/patches/configure.patch b/packages/g/gnu-gsl/patches/configure.patch new file mode 100644 index 000000000..404ae879b --- /dev/null +++ b/packages/g/gnu-gsl/patches/configure.patch @@ -0,0 +1,158 @@ +--- +diff --git a/config.h.in b/config.h +index adab7a58d..f6dc2278e 100644 +--- a/config.h.in ++++ b/config.h +@@ -11,19 +11,19 @@ + + /* Define to 1 if you have the declaration of `acosh', and to 0 if you don't. + */ +-#undef HAVE_DECL_ACOSH ++#define HAVE_DECL_ACOSH 1 + + /* Define to 1 if you have the declaration of `asinh', and to 0 if you don't. + */ +-#undef HAVE_DECL_ASINH ++#define HAVE_DECL_ASINH 1 + + /* Define to 1 if you have the declaration of `atanh', and to 0 if you don't. + */ +-#undef HAVE_DECL_ATANH ++#define HAVE_DECL_ATANH 1 + + /* Define to 1 if you have the declaration of `expm1', and to 0 if you don't. + */ +-#undef HAVE_DECL_EXPM1 ++#define HAVE_DECL_EXPM1 1 + + /* Define to 1 if you have the declaration of `feenableexcept', and to 0 if + you don't. */ +@@ -43,31 +43,31 @@ + + /* Define to 1 if you have the declaration of `frexp', and to 0 if you don't. + */ +-#undef HAVE_DECL_FREXP ++#define HAVE_DECL_FREXP 1 + + /* Define to 1 if you have the declaration of `hypot', and to 0 if you don't. + */ +-#undef HAVE_DECL_HYPOT ++#define HAVE_DECL_HYPOT 1 + + /* Define to 1 if you have the declaration of `isfinite', and to 0 if you + don't. */ +-#undef HAVE_DECL_ISFINITE ++#define HAVE_DECL_ISFINITE 1 + + /* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +-#undef HAVE_DECL_ISINF ++#define HAVE_DECL_ISINF 1 + + /* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. + */ +-#undef HAVE_DECL_ISNAN ++#define HAVE_DECL_ISNAN 1 + + /* Define to 1 if you have the declaration of `ldexp', and to 0 if you don't. + */ +-#undef HAVE_DECL_LDEXP ++#define HAVE_DECL_LDEXP 1 + + /* Define to 1 if you have the declaration of `log1p', and to 0 if you don't. + */ +-#undef HAVE_DECL_LOG1P ++#define HAVE_DECL_LOG1P 1 + + /* Define to 1 if you have the header file. */ + #undef HAVE_DLFCN_H +@@ -76,13 +76,13 @@ + #undef HAVE_DOPRNT + + /* Defined if you have ansi EXIT_SUCCESS and EXIT_FAILURE in stdlib.h */ +-#undef HAVE_EXIT_SUCCESS_AND_FAILURE ++#define HAVE_EXIT_SUCCESS_AND_FAILURE 1 + + /* Defined on architectures with excess floating-point precision */ + #undef HAVE_EXTENDED_PRECISION_REGISTERS + + /* Define if x86 processor has sse extensions. */ +-#undef HAVE_FPU_X86_SSE ++#define HAVE_FPU_X86_SSE 1 + + /* Define to 1 if you have the header file. */ + #undef HAVE_IEEEFP_H +@@ -97,43 +97,43 @@ + #undef HAVE_INLINE + + /* Define to 1 if you have the header file. */ +-#undef HAVE_INTTYPES_H ++#define HAVE_INTTYPES_H 1 + + /* Define to 1 if you have the `m' library (-lm). */ + #undef HAVE_LIBM + + /* Define to 1 if you have the `memcpy' function. */ +-#undef HAVE_MEMCPY ++#define HAVE_MEMCPY 1 + + /* Define to 1 if you have the `memmove' function. */ +-#undef HAVE_MEMMOVE ++#define HAVE_MEMMOVE 1 + + /* Define this if printf can handle %Lf for long double */ + #undef HAVE_PRINTF_LONGDOUBLE + + /* Define to 1 if you have the header file. */ +-#undef HAVE_STDINT_H ++#define HAVE_STDINT_H 1 + + /* Define to 1 if you have the header file. */ +-#undef HAVE_STDIO_H ++#define HAVE_STDIO_H 1 + + /* Define to 1 if you have the header file. */ +-#undef HAVE_STDLIB_H ++#define HAVE_STDLIB_H 1 + + /* Define to 1 if you have the `strdup' function. */ +-#undef HAVE_STRDUP ++#define HAVE_STRDUP 1 + + /* Define to 1 if you have the header file. */ + #undef HAVE_STRINGS_H + + /* Define to 1 if you have the header file. */ +-#undef HAVE_STRING_H ++#define HAVE_STRING_H 1 + + /* Define to 1 if you have the `strtol' function. */ +-#undef HAVE_STRTOL ++#define HAVE_STRTOL 1 + + /* Define to 1 if you have the `strtoul' function. */ +-#undef HAVE_STRTOUL ++#define HAVE_STRTOUL 1 + + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_STAT_H +@@ -145,7 +145,7 @@ + #undef HAVE_UNISTD_H + + /* Define to 1 if you have the `vprintf' function. */ +-#undef HAVE_VPRINTF ++#define HAVE_VPRINTF 1 + + /* Define if you need to hide the static definitions of inline functions */ + #undef HIDE_INLINE_STATIC +@@ -180,7 +180,7 @@ + /* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +-#undef STDC_HEADERS ++#define STDC_HEADERS 1 + + /* Version number of package */ + #undef VERSION +--- + diff --git a/packages/g/gnu-gsl/xmake.lua b/packages/g/gnu-gsl/xmake.lua index 366619634..b673ee96f 100644 --- a/packages/g/gnu-gsl/xmake.lua +++ b/packages/g/gnu-gsl/xmake.lua @@ -1,14 +1,21 @@ package("gnu-gsl") - set_homepage("https://www.gnu.org/software/gsl/") set_description("The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers.") set_license("GPL-3.0") - add_urls("https://ftp.gnu.org/gnu/gsl/gsl-$(version).tar.gz", - "https://ftpmirror.gnu.org/gsl/gsl-$(version).tar.gz") + add_urls("https://ftpmirror.gnu.org/gsl/gsl-$(version).tar.gz", + "https://ftp.gnu.org/gnu/gsl/gsl-$(version).tar.gz") + + add_versions("2.7.1", "dcb0fbd43048832b757ff9942691a8dd70026d5da0ff85601e52687f6deeb34b") add_versions("2.7", "efbbf3785da0e53038be7907500628b466152dbc3c173a87de1b5eba2e23602b") + if is_plat("windows") then + add_patches("2.7.x", path.join(os.scriptdir(), "patches", "configure.patch"), "50fe9e6a4e68750fa2e21febf05471423cc7a0a38e59cf41d5009cd79352b2e6") + add_patches("2.7.x", path.join(os.scriptdir(), "patches", "add_fp_control.patch"), "6c6782327126ea979c5aceab3ee022b5ddc7d9d01c244774294572e73427ec4b") + end + add_links("gsl", "gslcblas") + on_install("macosx", "linux", function (package) local configs = {"--disable-dependency-tracking"} table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) @@ -19,6 +26,15 @@ package("gnu-gsl") import("package.tools.autoconf").install(package, configs, {cppflags = cppflags, ldflags = ldflags}) end) + on_install("windows", function (package) + os.cp(path.join(os.scriptdir(), "cmake", "cmakelists.txt"), path.join(package:cachedir(), "source")) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE="..(package:config("pic") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + on_test(function (package) assert(package:has_cfuncs("gsl_isnan", {includes = "gsl/gsl_math.h"})) end) diff --git a/packages/g/gnu-sed/xmake.lua b/packages/g/gnu-sed/xmake.lua index a82e225d5..fdc620355 100644 --- a/packages/g/gnu-sed/xmake.lua +++ b/packages/g/gnu-sed/xmake.lua @@ -5,9 +5,10 @@ package("gnu-sed") set_description("GNU implementation of the famous stream editor.") set_license("GPL-3.0") - set_urls("https://ftp.gnu.org/gnu/sed/sed-$(version).tar.xz", - "https://ftpmirror.gnu.org/sed/sed-$(version).tar.xz") + set_urls("https://ftpmirror.gnu.org/sed/sed-$(version).tar.xz", + "https://ftp.gnu.org/gnu/sed/sed-$(version).tar.xz") add_versions("4.8", "f79b0cfea71b37a8eeec8490db6c5f7ae7719c35587f21edb0617f370eeff633") + add_versions("4.9", "6e226b732e1cd739464ad6862bd1a1aba42d7982922da7a53519631d24975181") on_install("macosx", "linux", function (package) local configs = {"--disable-dependency-tracking"} diff --git a/packages/g/go/xmake.lua b/packages/g/go/xmake.lua index e31d1a904..c6a1a6fde 100644 --- a/packages/g/go/xmake.lua +++ b/packages/g/go/xmake.lua @@ -7,25 +7,34 @@ package("go") if os.arch() == "x64" then set_urls("https://go.dev/dl/go$(version).windows-amd64.zip") add_versions("1.17.6", "5bf8f87aec7edfc08e6bc845f1c30dba6de32b863f89ae46553ff4bbcc1d4954") + add_versions("1.22.2", "8e581cf330f49d3266e936521a2d8263679ef7e2fc2cbbceb85659122d883596") else set_urls("https://go.dev/dl/go$(version).windows-386.zip") add_versions("1.17.6", "3809c4e40482ff047200c8b1e22a43a2c9c79b53ef540668d2b00f7228f093aa") + add_versions("1.22.2", "651753c06df037020ef4d162c5b273452e9ba976ed17ae39e66ef7ee89d8147e") end elseif is_host("linux") then if os.arch() == "x86_64" then set_urls("https://go.dev/dl/go$(version).linux-amd64.tar.gz") add_versions("1.17.6", "231654bbf2dab3d86c1619ce799e77b03d96f9b50770297c8f4dff8836fc8ca2") + add_versions("1.22.2", "5901c52b7a78002aeff14a21f93e0f064f74ce1360fce51c6ee68cd471216a17") elseif os.arch() == "i386" then set_urls("https://go.dev/dl/go$(version).linux-386.tar.gz") add_versions("1.17.6", "06c50fb0d44bb03dd4ea8795f9448379c5825d2765307b51f66905084c3ba541") + add_versions("1.22.2", "586d9eb7fe0489ab297ad80dd06414997df487c5cf536c490ffeaa8d8f1807a7") elseif os.arch() == "arm64" then set_urls("https://go.dev/dl/go$(version).linux-arm64.tar.gz") add_versions("1.17.6", "82c1a033cce9bc1b47073fd6285233133040f0378439f3c4659fe77cc534622a") + add_versions("1.22.2", "36e720b2d564980c162a48c7e97da2e407dfcc4239e1e58d98082dfa2486a0c1") end elseif is_host("macosx") then if os.arch() == "x86_64" then set_urls("https://go.dev/dl/go$(version).darwin-amd64.tar.gz") add_versions("1.17.6", "874bc6f95e07697380069a394a21e05576a18d60f4ba178646e1ebed8f8b1f89") + add_versions("1.22.2", "33e7f63077b1c5bce4f1ecadd4d990cf229667c40bfb00686990c950911b7ab7") + elseif os.arch() == "arm64" then + set_urls("https://go.dev/dl/go$(version).darwin-arm64.tar.gz") + add_versions("1.22.2", "660298be38648723e783ba0398e90431de1cb288c637880cdb124f39bd977f0d") end end diff --git a/packages/g/gperf/xmake.lua b/packages/g/gperf/xmake.lua index fd8694a4c..50d622668 100644 --- a/packages/g/gperf/xmake.lua +++ b/packages/g/gperf/xmake.lua @@ -4,15 +4,27 @@ package("gperf") set_homepage("https://www.gnu.org/software/gperf") set_description("Perfect hash function generator.") - set_urls("https://ftp.gnu.org/gnu/gperf/gperf-$(version).tar.gz", - "https://ftpmirror.gnu.org/gperf/gperf-$(version).tar.gz") + set_urls("https://ftpmirror.gnu.org/gnu/gperf/gperf-$(version).tar.gz", + "https://ftp.gnu.org/gnu/gperf/gperf-$(version).tar.gz") add_versions("3.1", "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2") - if is_plat("linux") then + if is_host("linux") then add_extsources("apt::gperf", "pacman::gperf") end - on_install("macosx", "linux", function (package) + on_install("@windows", function (package) + os.cp("src/config.h.in", "src/config.h") + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + target("gperf") + set_kind("binary") + add_files("lib/*.c", "lib/*.cc", "src/*.cc") + add_includedirs("lib", "src") + ]]) + import("package.tools.xmake").install(package) + end) + + on_install("@macosx", "@linux", function (package) import("package.tools.autoconf").install(package) end) diff --git a/packages/g/graphene/xmake.lua b/packages/g/graphene/xmake.lua index 3e6b004da..f1028e0c9 100644 --- a/packages/g/graphene/xmake.lua +++ b/packages/g/graphene/xmake.lua @@ -7,12 +7,29 @@ package("graphene") add_urls("https://github.com/ebassi/graphene/releases/download/$(version)/graphene-$(version).tar.xz") add_versions("1.10.6", "80ae57723e4608e6875626a88aaa6f56dd25df75024bd16e9d77e718c3560b25") + add_configs("gobject", {description = "Enable GObject types", default = true, type = "boolean"}) + add_deps("meson", "ninja") add_includedirs("include/graphene-1.0", "lib/graphene-1.0/include") + on_load(function (package) + if package:config("gobject") then + package:add("deps", "glib") + if package:is_plat("windows") then + package:add("deps", "pkgconf", "libintl") + elseif package:is_plat("macosx") then + package:add("deps", "libintl") + package:add("deps", "libiconv", {system = true}) + elseif package:is_plat("linux") then + package:add("deps", "libiconv") + end + end + end) + on_install("windows", "macosx", "linux", function (package) - local configs = {"-Dinstalled_tests=false", "-Dgobject_types=false", "-Dintrospection=disabled"} + local configs = {"-Dtests=false", "-Dinstalled_tests=false", "-Dintrospection=disabled"} table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) - import("package.tools.meson").install(package, configs) + table.insert(configs, "-Dgobject_types=" .. (package:config("gobject") and "true" or "false")) + import("package.tools.meson").install(package, configs, {packagedeps = {"libintl", "libiconv"}}) end) on_test(function (package) diff --git a/packages/g/grpc/xmake.lua b/packages/g/grpc/xmake.lua index f7694e864..c05a1b145 100644 --- a/packages/g/grpc/xmake.lua +++ b/packages/g/grpc/xmake.lua @@ -6,6 +6,7 @@ package("grpc") add_urls("https://github.com/grpc/grpc/archive/refs/tags/$(version).zip", "https://github.com/grpc/grpc.git") add_versions("v1.51.3", "17720fd0a690e904a468b4b3dae6fa5ec40b0d1f4d418e2ca092e2f92f06fce0") + add_versions("v1.62.1", "f672a3a3b370f2853869745110dabfb6c13af93e17ffad4676a0b95b5ec204af") add_patches("1.51.3", path.join(os.scriptdir(), "patches", "1.51.3", "disable-download-archive.patch"), "90fdd6e4a51cbc9756d1fcdd0f65e665d4b78cfd91fdbeb0228cc4e9c4ba1b73") add_patches("1.51.3", path.join(os.scriptdir(), "patches", "1.51.3", "static-linking-in-linux.patch"), "176474919883f93be0c5056098eccad408038663c6c7361f2e049cdf7247a19c") @@ -22,7 +23,7 @@ package("grpc") add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end - add_deps("c-ares", "re2", "abseil", "protobuf-cpp", "openssl", "zlib") + add_deps("c-ares", "re2", "protobuf-cpp", "openssl", "zlib", "abseil") if is_plat("linux") then add_syslinks("pthread", "dl", "m") @@ -39,6 +40,7 @@ package("grpc") on_install("linux", "macosx", "windows", function (package) local configs = { "-DCMAKE_CXX_STANDARD=17", -- abseil need c++17 + "-DCMAKE_CXX_STANDARD_REQUIRED=TRUE", "-DgRPC_BUILD_TESTS=OFF", "-DgRPC_ZLIB_PROVIDER=package", "-DgRPC_ABSL_PROVIDER=package", @@ -51,21 +53,13 @@ package("grpc") "-DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) + import("package.tools.cmake").install(package, configs, {packagedeps = {"abseil", "protobuf-cpp"}}) end) on_test(function (package) if package:is_binary() then assert(os.isfile(path.join(package:installdir(), "bin", "grpc_cpp_plugin"))) else - assert(package:check_cxxsnippets({test = [[ - #include - void test() { - grpc::CompletionQueue q; - std::string server_address("192.168.28.109:9010"); - auto channel = grpc::CreateChannel(server_address, grpc::InsecureChannelCredentials()); - std::cout << &channel << std::endl; - } - ]]}, {configs = {languages = "c++17"}, includes = "grpcpp/grpcpp.h"})) + assert(package:has_cxxincludes("grpcpp/grpcpp.h", {configs = {languages = "c++17"}})) end end) diff --git a/packages/g/gspell/xmake.lua b/packages/g/gspell/xmake.lua new file mode 100644 index 000000000..0269570bd --- /dev/null +++ b/packages/g/gspell/xmake.lua @@ -0,0 +1,12 @@ +package("gspell") + + set_homepage("https://gitlab.gnome.org/GNOME/gspell") + set_description("A spell-checking library for GTK applications") + set_license("LGPL-2.0-or-later") + + on_fetch("linux", function (package, opt) + if opt.system and package.find_package then + return package:find_package("pkgconfig::gspell") + end + end) + diff --git a/packages/g/gstreamer/xmake.lua b/packages/g/gstreamer/xmake.lua new file mode 100644 index 000000000..48e635359 --- /dev/null +++ b/packages/g/gstreamer/xmake.lua @@ -0,0 +1,63 @@ +package("gstreamer") + set_homepage("https://gstreamer.freedesktop.org") + set_description("GStreamer is a development framework for creating applications like media players, video editors, streaming media broadcasters and so on") + set_license("LGPL-2.0-or-later") + + add_urls("https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$(version).tar.xz", {alias = "home"}) + + add_versions("home:1.24.2", "9cafdd23bd180f1681c56cd3a6879a8497ccf24da6f422a6b6f356fa074a8481") + + add_configs("tools", {description = "Build tools.", default = false, type = "boolean"}) + add_configs("libunwind", {description = "Use libunwind to generate backtraces", default = false, type = "boolean"}) + + if is_plat("linux") then + add_extsources("pacman::gstreamer", "apt::libgstreamer1.0-dev") + elseif is_plat("macosx") then + add_extsources("brew::gstreamer") + elseif is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::gstreamer") + end + + add_deps("meson", "ninja") + if is_plat("windows") then + add_deps("pkgconf", "winflexbison") + else + add_deps("flex", "bison") + end + add_deps("glib") + + add_includedirs("include", "include/gstreamer-1.0") + + on_load(function (package) + if package:config("libunwind") then + package:add("deps", "libunwind") + end + if not package:config("shared") then + package:add("defines", "GST_STATIC_COMPILATION") + end + end) + + on_install("windows", "macosx", "linux", "cross", function (package) + local configs = { + "-Dexamples=disabled", + "-Dbenchmarks=disabled", + "-Dtests=disabled", + } + table.insert(configs, "-Dgst_debug=" .. (package:is_debug() and "true" or "false")) + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + table.insert(configs, "-Dlibunwind=" .. (package:config("libunwind") and "enabled" or "disabled")) + table.insert(configs, "-Dtools=" .. (package:config("tools") and "enabled" or "disabled")) + + local packagedeps = {} + if not package:dep("glib"):config("shared") then + table.insert(packagedeps, "libiconv") + end + if package:is_plat("windows", "macosx") then + table.insert(packagedeps, "libintl") + end + import("package.tools.meson").install(package, configs, {packagedeps = packagedeps}) + end) + + on_test(function (package) + assert(package:has_cfuncs("gst_init", {includes = "gst/gst.h"})) + end) diff --git a/packages/g/gtest/xmake.lua b/packages/g/gtest/xmake.lua index cf7d118b0..fe133a502 100644 --- a/packages/g/gtest/xmake.lua +++ b/packages/g/gtest/xmake.lua @@ -1,20 +1,22 @@ package("gtest") - set_homepage("https://github.com/google/googletest") set_description("Google Testing and Mocking Framework.") + set_license("BSD-3") - add_urls("https://github.com/google/googletest/archive/release-$(version).zip", {alias = "archive"}) + add_urls("https://github.com/google/googletest/archive/refs/tags/$(version).zip", {alias = "archive"}) add_urls("https://github.com/google/googletest.git", {alias = "github"}) - add_versions("github:1.8.1", "release-1.8.1") - add_versions("archive:1.8.1", "927827c183d01734cc5cfef85e0ff3f5a92ffe6188e0d18e909c5efebf28a0c7") - add_versions("github:1.10.0", "release-1.10.0") - add_versions("archive:1.10.0", "94c634d499558a76fa649edb13721dce6e98fb1e7018dfaeba3cd7a083945e91") - add_versions("github:1.11.0", "release-1.11.0") - add_versions("archive:1.11.0", "353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a") - add_versions("github:1.12.0", "release-1.12.0") - add_versions("archive:1.12.0", "ce7366fe57eb49928311189cb0e40e0a8bf3d3682fca89af30d884c25e983786") - add_versions("github:1.12.1", "release-1.12.1") - add_versions("archive:1.12.1", "24564e3b712d3eb30ac9a85d92f7d720f60cc0173730ac166f27dda7fed76cb2") + add_versions("github:v1.8.1", "release-1.8.1") + add_versions("archive:v1.8.1", "927827c183d01734cc5cfef85e0ff3f5a92ffe6188e0d18e909c5efebf28a0c7") + add_versions("github:v1.10.0", "release-1.10.0") + add_versions("archive:v1.10.0", "94c634d499558a76fa649edb13721dce6e98fb1e7018dfaeba3cd7a083945e91") + add_versions("github:v1.11.0", "release-1.11.0") + add_versions("archive:v1.11.0", "353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a") + add_versions("github:v1.12.0", "release-1.12.0") + add_versions("archive:v1.12.0", "ce7366fe57eb49928311189cb0e40e0a8bf3d3682fca89af30d884c25e983786") + add_versions("github:v1.12.1", "release-1.12.1") + add_versions("archive:v1.12.1", "24564e3b712d3eb30ac9a85d92f7d720f60cc0173730ac166f27dda7fed76cb2") + add_versions("v1.13.0", "ffa17fbc5953900994e2deec164bb8949879ea09b411e07f215bfbb1f87f4632") + add_versions("v1.14.0", "1f357c27ca988c3f7c6b4bf68a9395005ac6761f034046e9dde0896e3aba00e4") add_configs("main", {description = "Link to the gtest_main entry point.", default = false, type = "boolean"}) add_configs("gmock", {description = "Link to the googlemock library.", default = true, type = "boolean"}) @@ -27,14 +29,14 @@ package("gtest") io.writefile("xmake.lua", [[ target("gtest") set_kind("static") - set_languages("cxx11") + set_languages("cxx14") add_files("googletest/src/gtest-all.cc") add_includedirs("googletest/include", "googletest") add_headerfiles("googletest/include/(**.h)") target("gtest_main") set_kind("static") - set_languages("cxx11") + set_languages("cxx14") set_default(]] .. tostring(package:config("main")) .. [[) add_files("googletest/src/gtest_main.cc") add_includedirs("googletest/include", "googletest") @@ -42,7 +44,7 @@ package("gtest") target("gmock") set_kind("static") - set_languages("cxx11") + set_languages("cxx14") set_default(]] .. tostring(package:config("gmock")) .. [[) add_files("googlemock/src/gmock-all.cc") add_includedirs("googlemock/include", "googlemock", "googletest/include", "googletest") @@ -61,7 +63,7 @@ package("gtest") EXPECT_EQ(6, factorial(3)); EXPECT_EQ(3628800, factorial(10)); } - ]]}, {configs = {languages = "c++11"}, includes = "gtest/gtest.h"})) + ]]}, {configs = {languages = "c++14"}, includes = "gtest/gtest.h"})) if package:config("gmock") then assert(package:check_cxxsnippets({test = [[ @@ -93,6 +95,6 @@ package("gtest") EXPECT_TRUE(b_obj.b_foo()); } - ]]}, {configs = {languages = "c++11"}, includes = {"gtest/gtest.h", "gmock/gmock.h"}})) + ]]}, {configs = {languages = "c++14"}, includes = {"gtest/gtest.h", "gmock/gmock.h"}})) end end) diff --git a/packages/g/gtk+3/xmake.lua b/packages/g/gtk+3/xmake.lua index 675edbfcf..68d304912 100644 --- a/packages/g/gtk+3/xmake.lua +++ b/packages/g/gtk+3/xmake.lua @@ -4,11 +4,9 @@ package("gtk+3") set_description("Toolkit for creating graphical user interfaces") set_license("LGPL-2.0-or-later") - if on_fetch then - on_fetch("linux", function (package, opt) - if opt.system and package.find_package then - return package:find_package("pkgconfig::gtk+-3.0") - end - end) - end + on_fetch("linux", function (package, opt) + if opt.system and package.find_package then + return package:find_package("pkgconfig::gtk+-3.0") + end + end) diff --git a/packages/g/gtk4/xmake.lua b/packages/g/gtk4/xmake.lua index 2031c1b37..931cbc373 100644 --- a/packages/g/gtk4/xmake.lua +++ b/packages/g/gtk4/xmake.lua @@ -4,11 +4,79 @@ package("gtk4") set_description("Toolkit for creating graphical user interfaces") set_license("LGPL-2.0-or-later") - if on_fetch then - on_fetch("linux", function (package, opt) - if opt.system and package.find_package then - return package:find_package("pkgconfig::gtk4") - end - end) + add_urls("https://download.gnome.org/sources/gtk/$(version).tar.xz", {version = function (version) + return format("%d.%d/gtk-%s", version:major(), version:minor(), version) + end}) + add_versions("4.13.3", "4f04a43e7c287360473f34fc27b629f64875795f3bc7ec2781df449c5e72f312") + + add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) + add_configs("x11", {description = "Enable the X11 gdk backend.", default = is_plat("linux"), type = "boolean"}) + add_configs("wayland", {description = "Enable the wayland gdk backend.", default = false, type = "boolean"}) + + on_fetch("windows", "macosx", "linux", function (package, opt) + if opt.system then + return package:find_package("pkgconfig::gtk4") + end + end) + + if is_plat("linux") then + add_extsources("apt::libgtk-4-dev") end + add_deps("meson", "ninja") + add_deps("glib", "pango", "gdk-pixbuf", "libepoxy", "graphene", "fribidi", "pcre2") + add_deps("harfbuzz", "cairo", {configs = {glib = true}}) + if is_plat("linux") then + add_deps("libdrm") + add_deps("libiconv") + elseif is_plat("macosx") then + add_deps("libiconv", {system = true}) + add_deps("libintl") + elseif is_plat("windows") then + add_deps("libintl") + end + add_includedirs("include/gtk-4.0") + + on_load("windows|x64", "windows|x86", "macosx", "linux", function (package) + if package:config("x11") then + package:add("deps", "libx11", "libxrandr", "libxi", "libxcursor", "libxext", "libxdamage", "libxfixes", "libxinerama") + end + if package:config("wayland") then + package:add("deps", "wayland", "libxkbcommon") + end + end) + + on_install("windows|x64", "windows|x86", "macosx", "linux", function (package) + local mesondir = package:dep("meson"):installdir() + local gnomemod = path.join(mesondir, "mesonbuild", "modules", "gnome.py") + if package:is_plat("windows") then + -- workaround https://github.com/mesonbuild/meson/issues/6710 + io.replace(gnomemod, "absolute_paths=True,", "absolute_paths=False,#x", {plain = true}) + end + io.replace("meson.build", "xext_dep,", "[x11_dep, xext_dep],", {plain = true}) + io.replace("meson.build", "xi_dep)", "[x11_dep, xext_dep, xi_dep])", {plain = true}) + local configs = {"-Dintrospection=disabled", + "-Dbuild-tests=false", + "-Dbuild-testsuite=false", + "-Dbuild-examples=false", + "-Dbuild-demos=false", + "-Dmedia-gstreamer=disabled", + "-Dmedia-ffmpeg=disabled"} + table.insert(configs, "-Dx11-backend=" .. (package:config("x11") and "true" or "false")) + table.insert(configs, "-Dwayland-backend=" .. (package:config("wayland") and "true" or "false")) + import("package.tools.meson").install(package, configs, {packagedeps = {"libintl", "libiconv", "pcre2"}}) + if package:is_plat("windows") then + io.replace(gnomemod, "absolute_paths=False,#x", "absolute_paths=True,", {plain = true}) + end + package:addenv("PATH", "bin") + end) + + on_test(function (package) + assert(package:check_csnippets({test = [[ + int test(int argc, char *argv[]) { + GtkApplication *app = + gtk_application_new("xmake.app", G_APPLICATION_DEFAULT_FLAGS); + return g_application_run(G_APPLICATION(app), argc, argv); + } + ]]}, {includes = "gtk/gtk.h"})) + end) diff --git a/packages/g/gyp-next/xmake.lua b/packages/g/gyp-next/xmake.lua index 1557c1e33..531392889 100644 --- a/packages/g/gyp-next/xmake.lua +++ b/packages/g/gyp-next/xmake.lua @@ -7,6 +7,10 @@ package("gyp-next") add_urls("https://github.com/nodejs/gyp-next/archive/refs/tags/$(version).tar.gz", "https://github.com/nodejs/gyp-next.git") + add_versions("v0.18.1", "f9be5e64a992688b651d64c6f269a8a701b843e089c048fae0733e9eb01dd48e") + add_versions("v0.18.0", "2c0e002843da6a854d937a93d6fad5993954a457b3ffc2031d8af2dcff42caba") + add_versions("v0.16.2", "145d5719a88112ae2631a88556361da3b8780f4179a928c823ba3d18ab796464") + add_versions("v0.16.1", "892fecef9ca3fa1eff8bd18b7bcec54c6e8a2203788c048d26bccb53d9fcf737") add_versions("v0.11.0", "27fc51481d0e71d7fdc730b4c86dcee9825d11071875384d5fe4b263935501ef") add_deps("python 3.x", {kind = "binary"}) diff --git a/packages/g/gzip-hpp/xmake.lua b/packages/g/gzip-hpp/xmake.lua new file mode 100644 index 000000000..33022d851 --- /dev/null +++ b/packages/g/gzip-hpp/xmake.lua @@ -0,0 +1,37 @@ +package("gzip-hpp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/mapbox/gzip-hpp") + set_description("Gzip header-only C++ library") + set_license("MIT") + + add_urls("https://github.com/mapbox/gzip-hpp/archive/$(version).tar.gz", + "https://github.com/mapbox/gzip-hpp.git") + + add_versions("v0.1.0", "7ce3908cd13f186987820be97083fc5e62a7c6df0877af44b334a92e868eff06") + + add_deps("zlib") + + on_install(function (package) + io.replace("include/gzip/utils.hpp", "#include ", "#include \n#include ", {plain = true}) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include + #include + + void test() { + const std::string data("Hello World"); + for (int level = Z_BEST_SPEED; level <= Z_BEST_COMPRESSION; ++level) + { + std::string compressed_data = gzip::compress(data.data(), data.size()); + assert(gzip::is_compressed(compressed_data.data(), compressed_data.size())); + std::string new_data = gzip::decompress(compressed_data.data(), compressed_data.size()); + assert(data == new_data); + } + } + ]]}, {configs = {languages = "cxx11"}})) + end) \ No newline at end of file diff --git a/packages/h/h5cpp/xmake.lua b/packages/h/h5cpp/xmake.lua index 9756a421b..925d09254 100644 --- a/packages/h/h5cpp/xmake.lua +++ b/packages/h/h5cpp/xmake.lua @@ -5,9 +5,11 @@ package("h5cpp") add_urls("https://github.com/ess-dmsc/h5cpp/archive/refs/tags/$(version).tar.gz", "https://github.com/ess-dmsc/h5cpp.git") + + add_versions("v0.6.0", "72b459c92670628d730b3386fe6f4ac61218885afa904f234a181c2022a9f56f") add_versions("v0.5.1", "8fcab57ffbc2d799fe315875cd8fcf67e8b059cccc441ea45a001c03f6a9fd25") - add_patches("v0.5.1", path.join(os.scriptdir(), "patches", "fix-find-hdf5.patch"), "25f26ec6994d387571d7c068ba0405a34db45480a9c17fe3ea6402042e7de87c") + add_patches(">=0.5.1", path.join(os.scriptdir(), "patches", "fix-find-hdf5.patch"), "25f26ec6994d387571d7c068ba0405a34db45480a9c17fe3ea6402042e7de87c") add_deps("cmake") add_deps("zlib") diff --git a/packages/h/haclog/xmake.lua b/packages/h/haclog/xmake.lua new file mode 100644 index 000000000..6f47343b9 --- /dev/null +++ b/packages/h/haclog/xmake.lua @@ -0,0 +1,39 @@ +package("haclog") + set_homepage("https://github.com/MuggleWei/haclog") + set_description("Haclog(Happy Aync C log) is an extremely fast plain C logging library") + set_license("MIT") + + add_urls("https://github.com/MuggleWei/haclog/archive/refs/tags/$(version).tar.gz", + "https://github.com/MuggleWei/haclog.git") + + add_versions("v0.2.0", "5e055f69e490298a9515c38b3b024a97b41d4dfb5daaaf0ef94eb5c1da9db5ca") + add_versions("v0.1.6", "3afdb52d21b03a085291074612c39fab3ef056b6b32071693df4a2b60b9b6554") + add_versions("v0.0.5", "789340ba87ac076e4c5559e1e6e0bf4f1e17f2e55c4845d0f9fc8ead8e6d7f5f") + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + on_load(function (package) + if package:is_plat("cross") then + package:add("deps", "meson", "ninja") + else + package:add("deps", "cmake") + end + end) + + on_install("windows", "linux", "macosx", "android", "cross", function (package) + local configs = {} + if package:is_plat("cross") then + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + import("package.tools.meson").install(package, configs) + else + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end + end) + + on_test(function (package) + assert(package:has_cfuncs("haclog_console_handler_init", {includes = "haclog/haclog.h"})) + end) diff --git a/packages/h/harfbuzz/xmake.lua b/packages/h/harfbuzz/xmake.lua index c55624e88..45a3ad4b5 100644 --- a/packages/h/harfbuzz/xmake.lua +++ b/packages/h/harfbuzz/xmake.lua @@ -4,8 +4,10 @@ package("harfbuzz") set_description("HarfBuzz is a text shaping library.") set_license("MIT") - add_urls("https://github.com/harfbuzz/harfbuzz/archive/refs/tags/$(version).tar.gz", - "https://github.com/harfbuzz/harfbuzz.git") + add_urls("https://github.com/harfbuzz/harfbuzz/archive/refs/tags/$(version).tar.gz", {excludes = "README"}) + add_urls("https://github.com/harfbuzz/harfbuzz.git") + add_versions("8.5.0", "7ad8e4e23ce776efb6a322f653978b3eb763128fd56a90252775edb9fd327956") + add_versions("8.4.0", "9f1ca089813b05944ad1ce8c7e018213026d35dc9bab480a21eb876838396556") add_versions("2.8.1", "b3f17394c5bccee456172b2b30ddec0bb87e9c5df38b4559a973d14ccd04509d") add_versions("2.9.0", "bf5d5bad69ee44ff1dd08800c58cb433e9b3bf4dad5d7c6f1dec5d1cf0249d04") add_versions("3.0.0", "55f7e36671b8c5569b6438f80efed2fd663298f785ad2819e115b35b5587ef69") @@ -18,9 +20,11 @@ package("harfbuzz") add_versions("8.0.1", "d54ca67b6a0bf732b66a343566446d7f93df2bb850133f886c0082fb618a06b2") add_versions("8.1.0", "8d544f1b74797b7b4d88f586e3b9202528b3e8c17968d28b7cdde02041bff5a0") add_versions("8.1.1", "b16e6bc0fc7e6a218583f40c7d201771f2e3072f85ef6e9217b36c1dc6b2aa25") + add_versions("8.3.0", "6a093165442348d99f3307480ea87ed83bdabaf642cdd9548cff6b329e93bfac") add_configs("icu", {description = "Enable ICU library unicode functions.", default = false, type = "boolean"}) add_configs("freetype", {description = "Enable freetype interop helpers.", default = true, type = "boolean"}) + add_configs("glib", {description = "Enable glib unicode functions.", default = false, type = "boolean"}) if is_plat("android") then add_deps("cmake") @@ -46,6 +50,17 @@ package("harfbuzz") if package:config("freetype") then package:add("deps", "freetype") end + if package:config("glib") then + package:add("deps", "glib", "pcre2") + if package:is_plat("windows") then + package:add("deps", "libintl") + elseif package:is_plat("macosx") then + package:add("deps", "libintl") + package:add("deps", "libiconv", {system = true}) + elseif package:is_plat("linux") then + package:add("deps", "libiconv") + end + end end) on_install("android", function (package) @@ -58,30 +73,16 @@ package("harfbuzz") end) on_install(function (package) - import("package.tools.meson") - - local configs = {"-Dtests=disabled", "-Ddocs=disabled", "-Dbenchmark=disabled", "-Dcairo=disabled", "-Dglib=disabled", "-Dgobject=disabled"} + local configs = {"-Dtests=disabled", "-Ddocs=disabled", "-Dbenchmark=disabled", "-Dcairo=disabled"} if package:is_plat("macosx") then table.insert(configs, "-Dcoretext=enabled") end table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) table.insert(configs, "-Dicu=" .. (package:config("icu") and "enabled" or "disabled")) table.insert(configs, "-Dfreetype=" .. (package:config("freetype") and "enabled" or "disabled")) - local envs = meson.buildenvs(package) - if package:is_plat("windows") then - for _, dep in ipairs(package:orderdeps()) do - local fetchinfo = dep:fetch() - if fetchinfo then - for _, includedir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do - envs.INCLUDE = (envs.INCLUDE or "") .. path.envsep() .. includedir - end - for _, linkdir in ipairs(fetchinfo.linkdirs) do - envs.LIB = (envs.LIB or "") .. path.envsep() .. linkdir - end - end - end - end - meson.install(package, configs, {envs = envs}) + table.insert(configs, "-Dglib=" .. (package:config("glib") and "enabled" or "disabled")) + table.insert(configs, "-Dgobject=" .. (package:config("glib") and "enabled" or "disabled")) + import("package.tools.meson").install(package, configs, {packagedeps = {"libintl", "libiconv", "pcre2"}}) end) on_test(function (package) diff --git a/packages/h/hedley/xmake.lua b/packages/h/hedley/xmake.lua new file mode 100644 index 000000000..52f725db6 --- /dev/null +++ b/packages/h/hedley/xmake.lua @@ -0,0 +1,22 @@ +package("hedley") + set_kind("library", {headeronly = true}) + set_homepage("https://nemequ.github.io/hedley/") + set_description("A C/C++ header to help move #ifdefs out of your code") + set_license("CC0-1.0") + + add_urls("https://github.com/nemequ/hedley/archive/refs/tags/$(version).tar.gz", + "https://github.com/nemequ/hedley.git") + + add_versions("v15", "e91c71b58f59d08c7b8289be8f687866863d934dfaa528e4be30b178139ae863") + + on_install(function (package) + os.cp("hedley.h", package:installdir("include/hedley")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + HEDLEY_NO_RETURN + void test() {} + ]]})) + end) diff --git a/packages/h/hffix/xmake.lua b/packages/h/hffix/xmake.lua index c919f2c38..eaf688bd8 100644 --- a/packages/h/hffix/xmake.lua +++ b/packages/h/hffix/xmake.lua @@ -7,6 +7,8 @@ package("hffix") add_urls("https://github.com/jamesdbrock/hffix/archive/refs/tags/$(version).zip", "https://github.com/jamesdbrock/hffix.git") + add_versions("v1.4.1", "3938243ad50ce9523cacaabc1fef09db8f3e514b846497ab3246f390a72dabe0") + add_versions("v1.4.0", "b0dd5dfc5892b7336304274a4334d849d5b6778f0de2f7c2728957cdf2d9beed") add_versions("v1.1.0", "7646ddb8ca19da31a8835b64493100a0f2239c28980f590918e0b5bfab4d736d") on_install("linux", "macosx", "bsd", function (package) diff --git a/packages/h/hidapi/xmake.lua b/packages/h/hidapi/xmake.lua new file mode 100644 index 000000000..a527cc923 --- /dev/null +++ b/packages/h/hidapi/xmake.lua @@ -0,0 +1,35 @@ +package("hidapi") + set_homepage("https://libusb.info/hidapi/") + set_description("A Simple cross-platform library for communicating with HID devices") + set_license("BSD-3-Clause") + + add_urls("https://github.com/libusb/hidapi/archive/refs/tags/hidapi-$(version).tar.gz", + "https://github.com/libusb/hidapi.git") + + add_versions("0.14.0", "a5714234abe6e1f53647dd8cba7d69f65f71c558b7896ed218864ffcf405bcbd") + + add_deps("cmake") + + if is_plat("linux") then + add_deps("libusb") + elseif is_plat("macosx") then + add_frameworks("IOKit", "CoreFoundation", "AppKit") + elseif is_plat("bsd") then + add_deps("pkg-config") + end + + on_install("windows|x86", "windows|x64", "linux", "macosx", function (package) + local configs = { + "-DHIDAPI_WITH_TESTS=OFF", + "-DHIDAPI_BUILD_PP_DATA_DUMP=OFF", + "-DHIDAPI_BUILD_HIDTEST=OFF", + } + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DHIDAPI_ENABLE_ASAN=" .. (package:config("asan") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("hid_init", {includes = "hidapi/hidapi.h"})) + end) diff --git a/packages/h/highfive/xmake.lua b/packages/h/highfive/xmake.lua index 934a71d68..e7209bab0 100644 --- a/packages/h/highfive/xmake.lua +++ b/packages/h/highfive/xmake.lua @@ -6,6 +6,7 @@ package("highfive") add_urls("https://github.com/BlueBrain/HighFive/archive/refs/tags/$(version).tar.gz", "https://github.com/BlueBrain/HighFive.git") + add_versions("v2.9.0", "6301def8ceb9f4d7a595988612db288b448a3c0546f6c83417dab38c64994d7e") add_versions("v2.6.1", "b5002c1221cf1821e02fb2ab891b0160bac88b43f56655bd844a472106ca3397") add_versions("v2.3.1", "41728a1204bdfcdcef8cbc3ddffe5d744c5331434ce3dcef35614b831234fcd7") @@ -16,10 +17,18 @@ package("highfive") add_deps("hdf5") on_install("windows", "macosx", "linux", function (package) + if package:version():eq("2.9.0") then + io.replace("CMake/HighFiveTargetDeps.cmake", "find_package(HDF5 REQUIRED)", "find_package(HDF5 REQUIRED HINTS ${HDF5_ROOT})", {plain = true}) + end + local configs = {"-DHIGHFIVE_UNIT_TESTS=OFF", "-DHIGHFIVE_EXAMPLES=OFF", "-DHIGHFIVE_BUILD_DOCS=OFF", "-DHIGHFIVE_USE_BOOST=OFF"} + local hdf5 = package:dep("hdf5") + if hdf5 and not hdf5:is_system() then + table.insert(configs, "-DHDF5_ROOT=" .. hdf5:installdir()) + end import("package.tools.cmake").install(package, configs) end) diff --git a/packages/h/highs/xmake.lua b/packages/h/highs/xmake.lua new file mode 100644 index 000000000..f8668c016 --- /dev/null +++ b/packages/h/highs/xmake.lua @@ -0,0 +1,29 @@ +package("highs") + set_homepage("https://github.com/ERGO-Code/HiGHS") + set_description("Linear optimization software") + set_license("MIT") + + add_urls("https://github.com/ERGO-Code/HiGHS/archive/refs/tags/$(version).tar.gz", + "https://github.com/ERGO-Code/HiGHS.git") + + add_versions("v1.7.0", "d10175ad66e7f113ac5dc00c9d6650a620663a6884fbf2942d6eb7a3d854604f") + add_versions("v1.5.3", "ce1a7d2f008e60cc69ab06f8b16831bd0fcd5f6002d3bbebae9d7a3513a1d01d") + + if is_plat("linux", "bsd") then + add_syslinks("m", "pthread") + end + + add_includedirs("include", "include/highs") + + add_deps("cmake", "zlib >=1.2.3") + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "mingw", "msys", "iphoneos", "cross", "wasm", function (package) + local configs = {"-DBUILD_TESTING=OFF", "-DCI=OFF", "-DBUILD_EXAMPLES=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("Highs_addCol", {includes = "highs/interfaces/highs_c_api.h"})) + end) diff --git a/packages/h/highway/xmake.lua b/packages/h/highway/xmake.lua new file mode 100644 index 000000000..1a83bb507 --- /dev/null +++ b/packages/h/highway/xmake.lua @@ -0,0 +1,45 @@ +package("highway") + set_homepage("https://github.com/google/highway") + set_description("Performance-portable, length-agnostic SIMD with runtime dispatch") + set_license("Apache-2.0") + + add_urls("https://github.com/google/highway/archive/refs/tags/$(version).tar.gz", + "https://github.com/google/highway.git") + + add_versions("1.2.0", "7e0be78b8318e8bdbf6fa545d2ecb4c90f947df03f7aadc42c1967f019e63343") + add_versions("1.1.0", "354a8b4539b588e70b98ec70844273e3f2741302c4c377bcc4e81b3d1866f7c9") + + add_configs("contrib", {description = "Build SIMD-related utilities", default = false, type = "boolean"}) + + add_deps("cmake") + + on_install(function (package) + local configs = {"-DHWY_ENABLE_INSTALL=ON", "-DBUILD_TESTING=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DHWY_ENABLE_CONTRIB=" .. (package:config("contrib") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + os.tryrm(package:installdir("lib/*hwy_test*")) + os.tryrm(package:installdir("bin/*hwy_test*")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + namespace hn = hwy::HWY_NAMESPACE; + using T = float; + + void test(const T* HWY_RESTRICT mul_array, + const T* HWY_RESTRICT add_array, + const size_t size, T* HWY_RESTRICT x_array) { + const hn::ScalableTag d; + for (size_t i = 0; i < size; i += hn::Lanes(d)) { + const auto mul = hn::Load(d, mul_array + i); + const auto add = hn::Load(d, add_array + i); + auto x = hn::Load(d, x_array + i); + x = hn::MulAdd(mul, x, add); + hn::Store(x, d, x_array + i); + } + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/h/hiredis/xmake.lua b/packages/h/hiredis/xmake.lua index 2ead3e6e6..b694590cd 100644 --- a/packages/h/hiredis/xmake.lua +++ b/packages/h/hiredis/xmake.lua @@ -1,13 +1,13 @@ package("hiredis") - set_homepage("https://github.com/redis/hiredis") set_description("Minimalistic C client for Redis >= 1.2") set_license("BSD-3-Clause") add_urls("https://github.com/redis/hiredis/archive/refs/tags/$(version).tar.gz", "https://github.com/redis/hiredis.git") - add_versions('v1.0.2', 'e0ab696e2f07deb4252dda45b703d09854e53b9703c7d52182ce5a22616c3819') - add_versions('v1.1.0', 'fe6d21741ec7f3fc9df409d921f47dfc73a4d8ff64f4ac6f1d95f951bf7f53d6') + add_versions("v1.0.2", "e0ab696e2f07deb4252dda45b703d09854e53b9703c7d52182ce5a22616c3819") + add_versions("v1.1.0", "fe6d21741ec7f3fc9df409d921f47dfc73a4d8ff64f4ac6f1d95f951bf7f53d6") + add_versions("v1.2.0", "82ad632d31ee05da13b537c124f819eb88e18851d9cb0c30ae0552084811588c") if is_plat("windows", "mingw") then add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) @@ -25,7 +25,7 @@ package("hiredis") end) on_install(function (package) - if package:version():eq("v1.0.2") or package:version():eq("v1.1.0") then + if package:version() and package:version():lt("1.2.0") then io.replace("CMakeLists.txt", "TARGET_INCLUDE_DIRECTORIES(hiredis PUBLIC $", "TARGET_INCLUDE_DIRECTORIES(hiredis PUBLIC $", @@ -42,21 +42,24 @@ package("hiredis") "-DENABLE_SSL_TESTS=OFF", } + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DENABLE_SSL=" .. (package:config("openssl") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs, {buildir = "build"}) - -- hiredis cmake builds static and shared library at the same time. - -- Remove unneeded one after install. - if package:config("shared") then - -- maybe is import library, libhiredis.dll.a - if not package:is_plat("mingw") then - os.tryrm(path.join(package:installdir("lib"), "*.a")) + if package:version() and package:version():lt("1.2.0") then + -- hiredis cmake builds static and shared library at the same time. + -- Remove unneeded one after install. + if package:config("shared") then + -- maybe is import library, libhiredis.dll.a + if not package:is_plat("mingw") then + os.tryrm(path.join(package:installdir("lib"), "*.a")) + end + else + os.tryrm(path.join(package:installdir("lib"), "*.so")) + os.tryrm(path.join(package:installdir("lib"), "*.so.*")) + os.tryrm(path.join(package:installdir("lib"), "*.dylib")) end - else - os.tryrm(path.join(package:installdir("lib"), "*.so")) - os.tryrm(path.join(package:installdir("lib"), "*.so.*")) - os.tryrm(path.join(package:installdir("lib"), "*.dylib")) end end) diff --git a/packages/h/hlslpp/xmake.lua b/packages/h/hlslpp/xmake.lua index 38be1f1b5..21c396670 100644 --- a/packages/h/hlslpp/xmake.lua +++ b/packages/h/hlslpp/xmake.lua @@ -5,6 +5,8 @@ package("hlslpp") set_license("MIT") add_urls("https://github.com/redorav/hlslpp/archive/refs/tags/$(version).tar.gz") + add_versions("3.5", "9553e69181a5cff770fe68c2dc5afcda638b290c2e83dca635ed695e01aa16df") + add_versions("3.4", "14541f5350849f04785280add677d7ee4c9a224376e0644beb71318ef18f3531") add_versions("3.1", "6f933e43bf8150a41d76a188377e59007897dc87e96be30608e7f2007605d5c4") add_versions("3.2.3", "132149d25306cdc56a87c1d6a4a93d3200de4864b5d27d758d235ce4ace64498") diff --git a/packages/h/hopscotch-map/xmake.lua b/packages/h/hopscotch-map/xmake.lua index df0cf7c44..84bed9fc0 100644 --- a/packages/h/hopscotch-map/xmake.lua +++ b/packages/h/hopscotch-map/xmake.lua @@ -1,5 +1,4 @@ package("hopscotch-map") - set_kind("library", {headeronly = true}) set_homepage("https://github.com/Tessil/hopscotch-map") set_description("A C++ implementation of a fast hash map and hash set using hopscotch hashing") @@ -12,6 +11,7 @@ package("hopscotch-map") on_install(function (package) os.cp("include/tsl", package:installdir("include")) + os.cp("tsl-hopscotch-map.natvis", package:installdir("include", "tsl")) end) on_test(function (package) diff --git a/packages/h/hpx/xmake.lua b/packages/h/hpx/xmake.lua new file mode 100644 index 000000000..563465ae8 --- /dev/null +++ b/packages/h/hpx/xmake.lua @@ -0,0 +1,61 @@ +package("hpx") + set_homepage("https://hpx.stellar-group.org") + set_description("The C++ Standard Library for Parallelism and Concurrency") + set_license("BSL-1.0") + + add_urls("https://github.com/STEllAR-GROUP/hpx/archive/refs/tags/$(version).tar.gz", + "https://github.com/STEllAR-GROUP/hpx.git") + + add_versions("v1.10.0", "5720ed7d2460fa0b57bd8cb74fa4f70593fe8675463897678160340526ec3c19") + add_versions("v1.9.1", "1adae9d408388a723277290ddb33c699aa9ea72defadf3f12d4acc913a0ff22d") + + add_configs("malloc", {description = "Use a custom allocator", default = "system", values = {"system", "tcmalloc", "jemalloc", "mimalloc"}}) + add_configs("cuda", {description = "Enable support for CUDA", default = false}) + add_configs("mpi", {description = "Enable the MPI parcelport", default = false}) + add_configs("tcp", {description = "Enable the TCP parcelport", default = false}) + add_configs("lci", {description = "Enable the LCI parcelport", default = false}) + add_configs("apex", {description = "Enable APEX integration", default = false}) + add_configs("context", {description = "Enable Boost. Context for task context switching", default = false}) + add_configs("cpu_count", {description = "Set the maximum CPU count supported by HPX", default = "64"}) + + if is_plat("linux") then + add_syslinks("pthread") + end + + add_deps("cmake", "hwloc", "asio >=1.12.0") + + on_load("windows|x64", "linux|x86_64", "macosx|x86_64", function (package) + local malloc = package:config("malloc") + if malloc ~= "system" then + package:add("deps", malloc) + end + if package:config("context") then + package:add("deps", "boost >=1.71.0", {configs = {context = true}}) + else + package:add("deps", "boost >=1.71.0") + end + end) + + on_install("windows|x64", function (package) + local configs = {"-DHPX_WITH_EXAMPLES=OFF", "-DHPX_WITH_TESTS=OFF", "-DHPX_WITH_UNITY_BUILD=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DHPX_WITH_MALLOC=" .. package:config("malloc")) + table.insert(configs, "-DHPX_WITH_CUDA=" .. (package:config("cuda") and "ON" or "OFF")) + table.insert(configs, "-DHPX_WITH_PARCELPORT_MPI=" .. (package:config("mpi") and "ON" or "OFF")) + table.insert(configs, "-DHPX_WITH_PARCELPORT_TCP=" .. (package:config("tcp") and "ON" or "OFF")) + table.insert(configs, "-DHPX_WITH_PARCELPORT_LCI=" .. (package:config("lci") and "ON" or "OFF")) + table.insert(configs, "-DHPX_WITH_APEX=" .. (package:config("apex") and "ON" or "OFF")) + table.insert(configs, "-DHPX_WITH_GENERIC_CONTEXT_COROUTINES=" .. (package:config("context") and "ON" or "OFF")) + table.insert(configs, "-DHPX_WITH_MAX_CPU_COUNT=" .. package:config("cpu_count")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + hpx::cout << "Hello World!\n" << std::flush; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/h/hypre/xmake.lua b/packages/h/hypre/xmake.lua index 0ea56a333..f97047961 100644 --- a/packages/h/hypre/xmake.lua +++ b/packages/h/hypre/xmake.lua @@ -1,11 +1,12 @@ package("hypre") - set_homepage("https://computing.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods") set_description("Parallel solvers for sparse linear systems featuring multigrid methods.") set_license("Apache-2.0") add_urls("https://github.com/hypre-space/hypre/archive/refs/tags/$(version).tar.gz", "https://github.com/hypre-space/hypre.git") + add_versions("v2.31.0", "9a7916e2ac6615399de5010eb39c604417bb3ea3109ac90e199c5c63b0cb4334") + add_versions("v2.30.0", "8e2af97d9a25bf44801c6427779f823ebc6f306438066bba7fcbc2a5f9b78421") add_versions("v2.20.0", "5be77b28ddf945c92cde4b52a272d16fb5e9a7dc05e714fc5765948cba802c01") add_versions("v2.23.0", "8a9f9fb6f65531b77e4c319bf35bfc9d34bf529c36afe08837f56b635ac052e2") @@ -15,11 +16,12 @@ package("hypre") end add_deps("cmake") + on_load("windows", "macosx", "linux", function (package) package:add("deps", package:config("blas")) end) - on_install("windows", "linux", "macosx", function (package) + on_install("windows|x86", "windows|x64", "linux", "macosx", function (package) os.cd("src") local configs = {"-DHYPRE_WITH_MPI=OFF", "-DHYPRE_BUILD_EXAMPLES=OFF", "-DHYPRE_BUILD_TESTS=OFF", "-DHYPRE_USING_HYPRE_BLAS=OFF", "-DHYPRE_USING_HYPRE_LAPACK=OFF"} table.insert(configs, "-DHYPRE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) @@ -28,5 +30,5 @@ package("hypre") end) on_test(function (package) - assert(package:has_cfuncs("HYPRE_Init", {includes = "HYPRE_utilities.h"})) + assert(package:has_cfuncs(package:version():ge("v2.29.0") and "HYPRE_Initialize" or "HYPRE_Init", {includes = "HYPRE_utilities.h"})) end) diff --git a/packages/i/icu4c/xmake.lua b/packages/i/icu4c/xmake.lua index d6cc5eec0..47aa8fb8b 100644 --- a/packages/i/icu4c/xmake.lua +++ b/packages/i/icu4c/xmake.lua @@ -6,6 +6,7 @@ package("icu4c") add_urls("https://github.com/unicode-org/icu/releases/download/release-$(version)-src.tgz", {version = function (version) return (version:gsub("%.", "-")) .. "/icu4c-" .. (version:gsub("%.", "_")) end}) + add_versions("75.1", "cb968df3e4d2e87e8b11c49a5d01c787bd13b9545280fc6642f826527618caef") add_versions("73.2", "818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1") add_versions("73.1", "a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45") add_versions("72.1", "a2d2d38217092a7ed56635e34467f92f976b370e20182ad325edea6681a71d68") @@ -19,13 +20,12 @@ package("icu4c") add_patches("69.1", path.join(os.scriptdir(), "patches", "69.1", "replace-py-3.patch"), "ae27a55b0e79a8420024d6d349a7bae850e1dd403a8e1131e711c405ddb099b9") add_patches("70.1", path.join(os.scriptdir(), "patches", "70.1", "replace-py-3.patch"), "6469739da001721122b62af513370ed62901caf43af127de3f27ea2128830e35") if is_plat("mingw") then - add_patches("72.1", path.join(os.scriptdir(), "patches", "72.1", "mingw.patch"), "9ddbe7f691224ccf69f8c0218f788f0a39ab8f1375cc9aad2cc92664ffcf46a5") - add_patches("73.1", path.join(os.scriptdir(), "patches", "72.1", "mingw.patch"), "9ddbe7f691224ccf69f8c0218f788f0a39ab8f1375cc9aad2cc92664ffcf46a5") - add_patches("73.2", path.join(os.scriptdir(), "patches", "72.1", "mingw.patch"), "9ddbe7f691224ccf69f8c0218f788f0a39ab8f1375cc9aad2cc92664ffcf46a5") + add_patches(">=69.1", path.join(os.scriptdir(), "patches", "72.1", "mingw.patch"), "9ddbe7f691224ccf69f8c0218f788f0a39ab8f1375cc9aad2cc92664ffcf46a5") end + add_configs("tools", {description = "Build tools.", default = false, type = "boolean"}) if is_plat("windows") then - add_deps("python 3.x", {kind = "binary"}) + add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) end if is_plat("linux") then @@ -33,6 +33,10 @@ package("icu4c") end on_load(function (package) + if package:config("tools") and package:is_plat("windows") then + package:add("deps", "python 3.x", {kind = "binary"}) + end + local libsuffix = package:is_debug() and package:is_plat("mingw", "windows") and "d" or "" package:add("links", "icutu" .. libsuffix, "icuio" .. libsuffix) if package:is_plat("mingw", "windows") then @@ -44,26 +48,44 @@ package("icu4c") on_install("windows", function (package) import("package.tools.msbuild") + local projectfiles = os.files("source/**.vcxproj") - table.join2(projectfiles, path.join("source", "allinone", "allinone.sln"), os.files("source/**.props")) + local sln = path.join("source", "allinone", "allinone.sln") + table.join2(projectfiles, sln, os.files("source/**.props")) + if package:is_cross() then -- icu build requires native tools - local configs = {path.join("source", "allinone", "allinone.sln")} - table.insert(configs, "/p:Configuration=Release") - table.insert(configs, "/p:Platform=" .. package:arch()) + local configs = { + sln, + "/p:Configuration=Release", + "/target:pkgdata,genrb" + } + + local arch_prev = package:arch() + package:arch_set(os.arch()) msbuild.build(package, configs, {upgrade = projectfiles}) + package:arch_set(arch_prev) + end + + local configs = { + sln, + "/p:SkipUWP=True", + "/p:_IsNativeEnvironment=true" + } + + if not package:config("tools") then + table.insert(configs, "/target:common,i18n,uconv,io,stubdata") end - local configs = {path.join("source", "allinone", "allinone.sln"), "/p:SkipUWP=True", "/p:_IsNativeEnvironment=true"} msbuild.build(package, configs, {upgrade = projectfiles}) - local suffix = package:is_plat("arm.*") and "ARM" or "" + local suffix = package:is_arch("arm.*") and "ARM" or "" if package:is_arch(".*64") then suffix = suffix .. "64" end - os.cp("include", package:installdir()) - os.cp("bin" .. suffix .. "/*", package:installdir("bin")) - os.cp("lib" .. suffix .. "/*", package:installdir("lib")) + os.vcp("include", package:installdir()) + os.vcp("bin" .. suffix .. "/*", package:installdir("bin")) + os.vcp("lib" .. suffix .. "/*", package:installdir("lib")) package:addenv("PATH", "bin") end) @@ -87,11 +109,13 @@ package("icu4c") table.insert(configs, "--with-data-packaging=dll") end + local envs = {} + local cxxflags = "-std=gnu++17" if package:is_plat("linux") and package:config("pic") ~= false then - envs = autoconf.buildenvs(package, {cxflags = "-fPIC"}) + envs = autoconf.buildenvs(package, {cxflags = "-fPIC", cxxflags = cxxflags}) else - envs = autoconf.buildenvs(package) + envs = autoconf.buildenvs(package, {cxxflags = cxxflags}) end -- suppress ar errors when passing --toolchain=clang envs.ARFLAGS = nil diff --git a/packages/i/idna/xmake.lua b/packages/i/idna/xmake.lua new file mode 100644 index 000000000..c7b56271f --- /dev/null +++ b/packages/i/idna/xmake.lua @@ -0,0 +1,28 @@ +package("idna") + set_homepage("https://github.com/ada-url/idna") + set_description("C++ library implementing the to_ascii and to_unicode functions from the Unicode Technical Standard.") + set_license("Apache-2.0") + + add_urls("https://github.com/ada-url/idna.git") + add_versions("2024.02.28", "fff988508f659ef5c6494572ebea3d5db2466ed0") + + add_deps("cmake") + + on_install(function (package) + io.replace("CMakeLists.txt", "add_subdirectory(singleheader)", "", {plain = true}) + + local configs = {"-DBUILD_TESTING=OFF", "-DADA_IDNA_BENCHMARKS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + std::string_view input = u8"meßagefactory.ca"; + std::string idna_ascii = ada::idna::to_ascii(input); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/i/iguana/xmake.lua b/packages/i/iguana/xmake.lua new file mode 100644 index 000000000..355d9f20c --- /dev/null +++ b/packages/i/iguana/xmake.lua @@ -0,0 +1,38 @@ +package("iguana") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/qicosmos/iguana") + set_description("universal serialization engine") + set_license("Apache-2.0") + + add_urls("https://github.com/qicosmos/iguana/archive/refs/tags/$(version).tar.gz", + "https://github.com/qicosmos/iguana.git") + + add_versions("1.0.4", "b584cd26e65902a14a3a349ebc480beb7b4502fd5a5ffa3cb7c6102d857958b1") + add_versions("v1.0.3", "7dcb21a36bd64a63a9ea857f3563ac61e965c49ec60ad7b99a2bfb9192f3e4c3") + + add_deps("frozen") + + on_install(function (package) + os.vcp("iguana", package:installdir("include")) + end) + + on_test(function (package) + local languages = "c++17" + if package:is_plat("windows") and package:is_arch("arm.*") then + languages = "c++20" + end + + assert(package:check_cxxsnippets({test = [[ + #include + struct some_obj { + std::string_view name; + iguana::numeric_str age; + }; + REFLECTION(some_obj, name, age); + void test() { + some_obj obj; + std::string_view str = "{\"name\":\"tom\", \"age\":20}"; + iguana::from_json(obj, str); + } + ]]}, {configs = {languages = languages}})) + end) diff --git a/packages/i/imath/xmake.lua b/packages/i/imath/xmake.lua index b03db0a60..445db10c0 100644 --- a/packages/i/imath/xmake.lua +++ b/packages/i/imath/xmake.lua @@ -6,13 +6,17 @@ package("imath") add_urls("https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/$(version).tar.gz", "https://github.com/AcademySoftwareFoundation/Imath.git") + add_versions("v3.1.10", "f2943e86bfb694e216c60b9a169e5356f8a90f18fbd34d7b6e3450be14f60b10") add_versions("v3.1.0", "211c907ab26d10bd01e446da42f073ee7381e1913d8fa48084444bc4e1b4ef87") add_versions("v3.1.1", "a63fe91d8d0917acdc31b0c9344b1d7dbc74bf42de3e3ef5ec982386324b9ea4") add_versions("v3.1.2", "f21350efdcc763e23bffd4ded9bbf822e630c15ece6b0697e2fcb42737c08c2d") add_versions("v3.1.3", "0bf7ec51162c4d17a4c5b850fb3f6f7a195cff9fa71f4da7735f74d7b5124320") add_versions("v3.1.4", "fcca5fbb37d375a252bacd8a29935569bdc28b888f01ef1d9299ca0c9e87c17a") add_versions("v3.1.5", "1e9c7c94797cf7b7e61908aed1f80a331088cc7d8873318f70376e4aed5f25fb") + add_versions("v3.1.9", "f1d8aacd46afed958babfced3190d2d3c8209b66da451f556abd6da94c165cf3") + add_versions("v3.1.11", "9057849585e49b8b85abe7cc1e76e22963b01bfdc3b6d83eac90c499cd760063") + add_includedirs("include", "include/Imath") on_load(function (package) if not package.is_built or package:is_built() then package:add("deps", "cmake") diff --git a/packages/i/imgui-file-dialog/xmake.lua b/packages/i/imgui-file-dialog/xmake.lua index 761797d32..94827d7a0 100644 --- a/packages/i/imgui-file-dialog/xmake.lua +++ b/packages/i/imgui-file-dialog/xmake.lua @@ -6,6 +6,8 @@ package("imgui-file-dialog") add_urls("https://github.com/aiekick/ImGuiFileDialog/archive/refs/tags/$(version).tar.gz", "https://github.com/aiekick/ImGuiFileDialog.git") + add_versions("v0.6.7", "136e714965afaec2bac857bf46a653fdd74a0bf493e281682706c604113026b8") + add_versions("v0.6.6", "75420f6eaf74fb1fa22042713f573858d8549366e7741baaf91128eb065b4b47") add_versions("v0.6.5", "3fac0f2cfc92b3f2c806e6743236467d0f691e54b1747a3955b82ef28b13e2fa") if is_plat("mingw") then @@ -43,7 +45,7 @@ package("imgui-file-dialog") assert(package:check_cxxsnippets({test = [[ #include void test() { - ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose File", ".cpp,.h,.hpp", "."); + ImGuiFileDialog::Instance()->Close(); } ]]}, {configs = {languages = "c++11"}})) end) diff --git a/packages/i/imgui/port/xmake.lua b/packages/i/imgui/port/xmake.lua index 99e8e9c82..3a04f65d6 100644 --- a/packages/i/imgui/port/xmake.lua +++ b/packages/i/imgui/port/xmake.lua @@ -1,5 +1,6 @@ add_rules("mode.debug", "mode.release") -set_languages("cxx11") +add_rules("utils.install.cmake_importfiles") +set_languages("cxx14") option("dx9", {showmenu = true, default = false}) option("dx10", {showmenu = true, default = false}) @@ -45,11 +46,15 @@ if has_config("freetype") then end target("imgui") - set_kind("static") + set_kind("$(kind)") add_files("*.cpp", "misc/cpp/*.cpp") add_headerfiles("*.h", "(misc/cpp/*.h)") add_includedirs(".", "misc/cpp") + if is_kind("shared") and is_plat("windows", "mingw") then + add_defines("IMGUI_API=__declspec(dllexport)") + end + if has_config("dx9") then add_files("backends/imgui_impl_dx9.cpp") add_headerfiles("(backends/imgui_impl_dx9.h)") @@ -124,7 +129,7 @@ target("imgui") add_files("backends/imgui_impl_win32.cpp") add_headerfiles("(backends/imgui_impl_win32.h)") end - + if has_config("wgpu") then add_files("backends/imgui_impl_wgpu.cpp") add_headerfiles("(backends/imgui_impl_wgpu.h)") diff --git a/packages/i/imgui/xmake.lua b/packages/i/imgui/xmake.lua index c19eddae1..4b7838f7a 100644 --- a/packages/i/imgui/xmake.lua +++ b/packages/i/imgui/xmake.lua @@ -1,43 +1,65 @@ package("imgui") - set_homepage("https://github.com/ocornut/imgui") set_description("Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies") set_license("MIT") - add_urls("https://github.com/ocornut/imgui/archive/$(version).tar.gz", - "https://github.com/ocornut/imgui.git") - add_versions("v1.89.9-docking", "c6e0284ac58b3f205c95365478888f7b53b077e2") + add_urls("https://github.com/ocornut/imgui/archive/refs/tags/$(version).tar.gz") + add_urls("https://github.com/ocornut/imgui.git", {alias = "git"}) + + add_versions("v1.90.8", "f606b4fb406aa0f8dad36d4a9dd3d6f0fd39f5f0693e7468abc02d545fb505ae") + add_versions("v1.90.7", "872574217643d4ad7e9e6df420bb8d9e0d468fb90641c2bf50fd61745e05de99") + add_versions("v1.90.6", "70b4b05ac0938e82b4d5b8d59480d3e2ca63ca570dfb88c55023831f387237ad") + add_versions("v1.90.5", "e94b48dba7311c85ba8e3e6fe7c734d76a0eed21b2b42c5180fd5706d1562241") + add_versions("v1.90.4", "5d9dc738af74efa357f2a9fc39fe4a28d29ef1dfc725dd2977ccf3f3194e996e") + add_versions("v1.90.3", "40b302d01092c9393373b372fe07ea33ac69e9491893ebab3bf952b2c1f5fd23") + add_versions("v1.90.2", "452d1c11e5c4b4dfcca272915644a65f1c076498e8318b141ca75cd30470dd68") + add_versions("v1.90.1", "21dcc985bb2ae8fe48047c86135dbc438d6980a8f2e08babbda5be820592f282") + add_versions("v1.90", "170986e6a4b83d165bfc1d33c2c5a5bc2d67e5b97176287485c51a2299249296") add_versions("v1.89.9", "1acc27a778b71d859878121a3f7b287cd81c29d720893d2b2bf74455bf9d52d6") - add_versions("v1.89.8-docking", "f8704cd085c4347f835c21dc12a3951924143872") add_versions("v1.89.8", "6680ccc32430009a8204291b1268b2367d964bd6d1b08a4e0358a017eb8e8c9e") - add_versions("v1.89.7-docking", "dc3e531ff28450bff73fde0163b1d076b6bb5605") add_versions("v1.89.7", "115ee9e242af98a884302ac0f6ca3b2b26b1f10c660205f5e7ad9f1d1c96d269") - add_versions("v1.89.6-docking", "823a1385a269d923d35b82b2f470f3ae1fa8b5a3") add_versions("v1.89.6", "e95d1cba1481e66386acda3e7da19cd738da86c6c2a140a48fa55046e5f6e208") - add_versions("v1.89.5-docking", "0ea3b87bd63ecbf359585b7c235839146e84dedb") add_versions("v1.89.5", "eab371005c86dd029523a0c4ba757840787163740d45c1f4e5a110eb21820546") - add_versions("v1.89.4-docking", "9e30fb0ec1b44dc1b041db6bdd53b130b2a18509") add_versions("v1.89.4", "69f1e83adcab3fdd27b522f5075f407361b0d3875e3522b13d33bc2ae2c7d48c") - add_versions("v1.89.3-docking", "192196711a7d0d7c2d60454d42654cf090498a74") add_versions("v1.89.3", "3b665fadd5580b7ef494d5d8bb1c12b2ec53ee723034caf43332956381f5d631") - add_versions("v1.89-docking", "94e850fd6ff9eceb98fda3147e3ffd4781ad2dc7") - add_versions("v1.89", "4038b05bd44c889cf40be999656d3871a0559916708cb52a6ae2fa6fa35c5c60") - add_versions("v1.88-docking", "9cd9c2eff99877a3f10a7f9c2a3a5b9c15ea36c6") - add_versions("v1.88", "9f14c788aee15b777051e48f868c5d4d959bd679fc5050e3d2a29de80d8fd32e") - add_versions("v1.87-docking", "1ee252772ae9c0a971d06257bb5c89f628fa696a") - add_versions("v1.87", "b54ceb35bda38766e36b87c25edf7a1cd8fd2cb8c485b245aedca6fb85645a20") - add_versions("v1.86", "6ba6ae8425a19bc52c5e067702c48b70e4403cd339cba02073a462730a63e825") - add_versions("v1.85-docking", "dc8c3618e8f8e2dada23daa1aa237626af341fd8") - add_versions("v1.85", "7ed49d1f4573004fa725a70642aaddd3e06bb57fcfe1c1a49ac6574a3e895a77") + add_versions("v1.89", "4038b05bd44c889cf40be999656d3871a0559916708cb52a6ae2fa6fa35c5c60") + add_versions("v1.88", "9f14c788aee15b777051e48f868c5d4d959bd679fc5050e3d2a29de80d8fd32e") + add_versions("v1.87", "b54ceb35bda38766e36b87c25edf7a1cd8fd2cb8c485b245aedca6fb85645a20") + add_versions("v1.86", "6ba6ae8425a19bc52c5e067702c48b70e4403cd339cba02073a462730a63e825") + add_versions("v1.85", "7ed49d1f4573004fa725a70642aaddd3e06bb57fcfe1c1a49ac6574a3e895a77") add_versions("v1.84.2", "35cb5ca0fb42cb77604d4f908553f6ef3346ceec4fcd0189675bdfb764f62b9b") add_versions("v1.84.1", "292ab54cfc328c80d63a3315a242a4785d7c1cf7689fbb3d70da39b34db071ea") - add_versions("v1.83-docking", "80b5fb51edba2fd3dea76ec3e88153e2492243d1") - add_versions("v1.83", "ccf3e54b8d1fa30dd35682fc4f50f5d2fe340b8e29e08de71287d0452d8cc3ff") - add_versions("v1.82", "fefa2804bd55f3d25b134af08c0e1f86d4d059ac94cef3ee7bd21e2f194e5ce5") - add_versions("v1.81", "f7c619e03a06c0f25e8f47262dbc32d61fd033d2c91796812bf0f8c94fca78fb") - add_versions("v1.80", "d7e4e1c7233409018437a646680316040e6977b9a635c02da93d172baad94ce9") - add_versions("v1.79", "f1908501f6dc6db8a4d572c29259847f6f882684b10488d3a8d2da31744cd0a4") - add_versions("v1.75", "1023227fae4cf9c8032f56afcaea8902e9bfaad6d9094d6e48fb8f3903c7b866") + add_versions("v1.83", "ccf3e54b8d1fa30dd35682fc4f50f5d2fe340b8e29e08de71287d0452d8cc3ff") + add_versions("v1.82", "fefa2804bd55f3d25b134af08c0e1f86d4d059ac94cef3ee7bd21e2f194e5ce5") + add_versions("v1.81", "f7c619e03a06c0f25e8f47262dbc32d61fd033d2c91796812bf0f8c94fca78fb") + add_versions("v1.80", "d7e4e1c7233409018437a646680316040e6977b9a635c02da93d172baad94ce9") + add_versions("v1.79", "f1908501f6dc6db8a4d572c29259847f6f882684b10488d3a8d2da31744cd0a4") + add_versions("v1.78", "f70bbb17581ee2bd42fda526d9c3dc1a5165f3847ff047483d4d7980e166f9a3") + add_versions("v1.77", "c0dae830025d4a1a169df97409709f40d9dfa19f8fc96b550052224cbb238fa8") + add_versions("v1.76", "e482dda81330d38c87bd81597cacaa89f05e20ed2c4c4a93a64322e97565f6dc") + add_versions("v1.75", "1023227fae4cf9c8032f56afcaea8902e9bfaad6d9094d6e48fb8f3903c7b866") + + add_versions("git:v1.90.8-docking", "v1.90.8-docking") + add_versions("git:v1.90.7-docking", "v1.90.7-docking") + add_versions("git:v1.90.6-docking", "v1.90.6-docking") + add_versions("git:v1.90.5-docking", "v1.90.5-docking") + add_versions("git:v1.90.4-docking", "v1.90.4-docking") + add_versions("git:v1.90.3-docking", "v1.90.3-docking") + add_versions("git:v1.90.2-docking", "v1.90.2-docking") + add_versions("git:v1.90.1-docking", "v1.90.1-docking") + add_versions("git:v1.90-docking", "v1.90-docking") + add_versions("git:v1.89.9-docking", "v1.89.9-docking") + add_versions("git:v1.89.8-docking", "v1.89.8-docking") + add_versions("git:v1.89.7-docking", "v1.89.7-docking") + add_versions("git:v1.89.6-docking", "823a1385a269d923d35b82b2f470f3ae1fa8b5a3") + add_versions("git:v1.89.5-docking", "0ea3b87bd63ecbf359585b7c235839146e84dedb") + add_versions("git:v1.89.4-docking", "9e30fb0ec1b44dc1b041db6bdd53b130b2a18509") + add_versions("git:v1.89.3-docking", "192196711a7d0d7c2d60454d42654cf090498a74") + add_versions("git:v1.89-docking", "94e850fd6ff9eceb98fda3147e3ffd4781ad2dc7") + add_versions("git:v1.88-docking", "9cd9c2eff99877a3f10a7f9c2a3a5b9c15ea36c6") + add_versions("git:v1.87-docking", "1ee252772ae9c0a971d06257bb5c89f628fa696a") + add_versions("git:v1.85-docking", "dc8c3618e8f8e2dada23daa1aa237626af341fd8") + add_versions("git:v1.83-docking", "80b5fb51edba2fd3dea76ec3e88153e2492243d1") add_configs("dx9", {description = "Enable the dx9 backend", default = false, type = "boolean"}) add_configs("dx10", {description = "Enable the dx10 backend", default = false, type = "boolean"}) @@ -86,6 +108,9 @@ package("imgui") package:config_set("opengl3", true) end -- end: backwards compatibility + if package:config("shared") and is_plat("windows", "mingw") then + package:add("defines", "IMGUI_API=__declspec(dllimport)") + end if package:config("glfw") then package:add("deps", "glfw") end @@ -110,9 +135,6 @@ package("imgui") if package:config("freetype") then package:add("deps", "freetype") end - if package:version_str():find("-docking", 1, true) then - package:set("urls", {"https://github.com/ocornut/imgui.git"}) - end end) on_install("macosx", "linux", "windows", "mingw", "android", "iphoneos", function (package) @@ -140,8 +162,14 @@ package("imgui") end) on_test(function (package) - local user_config = package:config("user_config") - assert(user_config ~= nil or package:check_cxxsnippets({test = [[ + if package:config("user_config") ~= nil then return end + local includes = {"imgui.h"} + local defines + if package:config("sdl2_renderer") or package:config("sdl2_no_renderer") then + table.insert(includes, "SDL.h") + defines = "SDL_MAIN_HANDLED" + end + assert(package:check_cxxsnippets({test = [[ void test() { IMGUI_CHECKVERSION(); ImGui::CreateContext(); @@ -152,5 +180,5 @@ package("imgui") ImGui::Render(); ImGui::DestroyContext(); } - ]]}, {configs = {languages = "c++11"}, includes = {"imgui.h"}})) + ]]}, {configs = {languages = "c++14", defines = defines}, includes = includes})) end) diff --git a/packages/i/immer/xmake.lua b/packages/i/immer/xmake.lua index 4aa08e8d4..98daf4104 100644 --- a/packages/i/immer/xmake.lua +++ b/packages/i/immer/xmake.lua @@ -8,6 +8,7 @@ package("immer") add_urls("https://github.com/arximboldi/immer/archive/refs/tags/$(version).tar.gz", "https://github.com/arximboldi/immer.git") add_versions("v0.8.0", "4ed9e86a525f293e0ba053107b937d88b032674ec6e5db958816f2e412677fde") + add_versions("v0.8.1", "de8411c84830864604bb685dc8f2e3c0dbdc40b95b2f6726092f7dcc85e75209") add_deps("cmake") diff --git a/packages/i/implot/xmake.lua b/packages/i/implot/xmake.lua index ec857b9c2..45c0afe68 100644 --- a/packages/i/implot/xmake.lua +++ b/packages/i/implot/xmake.lua @@ -6,6 +6,7 @@ package("implot") add_urls("https://github.com/epezent/implot/archive/refs/tags/$(version).tar.gz", "https://github.com/epezent/implot.git") + add_versions("v0.16", "961df327d8a756304d1b0a67316eebdb1111d13d559f0d3415114ec0eb30abd1") add_versions("v0.15", "3df87e67a1e28db86828059363d78972a298cd403ba1f5780c1040e03dfa2672") add_deps("imgui") diff --git a/packages/i/indicators/xmake.lua b/packages/i/indicators/xmake.lua index 03b31b698..47965d132 100644 --- a/packages/i/indicators/xmake.lua +++ b/packages/i/indicators/xmake.lua @@ -6,6 +6,7 @@ package("indicators") add_urls("https://github.com/p-ranav/indicators/archive/refs/tags/v$(version).zip", "https://github.com/p-ranav/indicators.git") + add_versions("2.3", "c1deca4b72d655ba457882a5d1b75011f99253c6a2cc8d2f5bc7c49324b2e4ff") add_versions("2.2", "08dc0592a1fb5e3a050562961fbaacf4d03dadb76a0eb47f0670e63235d14dc5") on_install(function (package) diff --git a/packages/i/infoware/xmake.lua b/packages/i/infoware/xmake.lua new file mode 100644 index 000000000..e0e3e36da --- /dev/null +++ b/packages/i/infoware/xmake.lua @@ -0,0 +1,47 @@ +package("infoware") + set_homepage("https://github.com/ThePhD/infoware") + set_description("C++ Library for pulling system and hardware information, without hitting the command line.") + set_license("CC0-1.0") + + add_urls("https://github.com/ThePhD/infoware.git") + add_versions("2023.04.12", "d64a0c948593c0555115f60c79225c0b9ae09510") + + add_configs("x11", {description = "Use X11 for display detection", default = false, type = "boolean"}) + add_configs("d3d", {description = "Use D3D for GPU detection", default = false, type = "boolean"}) + add_configs("opencl", {description = "Use OpenCL for GPU detection", default = false, type = "boolean"}) + add_configs("opengl", {description = "Use OpenGL for GPU detection", default = false, type = "boolean"}) + + if is_plat("windows") then + add_syslinks("gdi32", "version", "ole32", "oleaut32", "wbemuuid", "ntdll") + end + + add_deps("cmake") + + on_load(function (package) + if package:config("x11") then + package:add("deps", "libx11") + end + if package:config("opencl") then + package:add("deps", "opencl") + end + end) + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "mingw|x86_64", "msys", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DINFOWARE_USE_X11=" .. (package:config("x11") and "ON" or "OFF")) + table.insert(configs, "-DINFOWARE_USE_D3D=" .. (package:config("d3d") and "ON" or "OFF")) + table.insert(configs, "-DINFOWARE_USE_OPENCL=" .. (package:config("opencl") and "ON" or "OFF")) + table.insert(configs, "-DINFOWARE_USE_OPENGL=" .. (package:config("opengl") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + auto quantities = iware::cpu::quantities(); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/i/inifile-cpp/xmake.lua b/packages/i/inifile-cpp/xmake.lua new file mode 100644 index 000000000..7725292f1 --- /dev/null +++ b/packages/i/inifile-cpp/xmake.lua @@ -0,0 +1,22 @@ +package("inifile-cpp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/Rookfighter/inifile-cpp") + set_description("A header-only and easy to use Ini file parser for C++.") + set_license("MIT") + + add_urls("https://github.com/Rookfighter/inifile-cpp.git") + add_versions("2022.06.25", "e7ba25eede111e76e176a341ea12a47e9948627c") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + ini::IniFile myIni; + myIni.load("some/ini/path"); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/i/inih/port/xmake.lua b/packages/i/inih/port/xmake.lua new file mode 100644 index 000000000..30082b5ff --- /dev/null +++ b/packages/i/inih/port/xmake.lua @@ -0,0 +1,53 @@ +add_rules("mode.debug", "mode.release") + +option("ini_parser", {description = "compile and (if selected) install INIReader", default = true, type = "boolean"}) +option("multi_line_entries", {description = "support for multi-line entries in the style of Python's ConfigParser", default = true, type = "boolean"}) +option("utf_8_bom", {description = "allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of INI files", default = true, type = "boolean"}) +option("inline_comments", {description = "allow inline comments with the comment prefix character", default = true, type = "boolean"}) +option("inline_comment_prefix", {description = "allow inline comments with the comment prefix character", default = ";", type = "string"}) +option("start_of_line_comment_prefix", {description = "character(s) to start a comment at the beginning of a line", default = ";#", type = "string"}) +option("allow_no_value", {description = "allow name with no value", default = false, type = "boolean"}) +option("stop_on_first_error", {description = "stop parsing after an error", default = false, type = "boolean"}) +option("report_line_numbers", {description = "report line number on ini_handler callback", default = false, type = "boolean"}) +option("call_handler_on_new_section", {description = "call the handler each time a new section is encountered", default = false, type = "boolean"}) +option("heap", {description = "allocate memory on the heap using malloc instead using a fixed-sized line buffer on the stack", default = false, type = "boolean"}) +option("max_line_length", {description = "maximum line length in bytes", default = "200", type = "string"}) +option("initial_malloc_size", {description = "initial malloc size in bytes (when using the heap)", default = "200", type = "string"}) +option("allow_realloc", {description = "allow initial malloc size to grow to max line length (when using the heap)", default = false, type = "boolean"}) + +target("inih") + set_kind("$(kind)") + set_languages("c++11") + + add_files("ini.c") + add_headerfiles("(ini.h)") + + if is_kind("shared") then + add_defines("INI_SHARED_LIB") + add_defines("INI_SHARED_LIB_BUILDING") + end + + if has_config("ini_parser") then + add_files("cpp/INIReader.cpp") + add_headerfiles("cpp/(INIReader.h)") + end + + if not has_config("utf_8_bom") then add_defines("INI_ALLOW_BOM=0") end + if not has_config("inline_comments") then add_defines("INI_ALLOW_INLINE_COMMENTS=0") end + if has_config("inline_comment_prefix") then add_defines([[INI_INLINE_COMMENT_PREFIXES="]] .. get_config("inline_comment_prefix") .. [["]]) end + if has_config("start_of_line_comment_prefix") then add_defines([[INI_START_COMMENT_PREFIXES="]] .. get_config("start_of_line_comment_prefix") .. [["]]) end + if has_config("allow_no_value") then add_defines("INI_ALLOW_NO_VALUE=1") end + if has_config("stop_on_first_error") then add_defines("INI_STOP_ON_FIRST_ERROR=1") end + if has_config("report_line_numbers") then add_defines("INI_HANDLER_LINENO=1") end + if has_config("call_handler_on_new_section") then add_defines("INI_CALL_HANDLER_ON_NEW_SECTION=1") end + if has_config("heap") then add_defines("INI_USE_STACK=0") end + if has_config("max_line_length") then add_defines("INI_MAX_LINE=" .. get_config("max_line_length")) end + if has_config("initial_malloc_size") then add_defines("INI_INITIAL_ALLOC=" .. get_config("initial_malloc_size")) end + if has_config("allow_realloc") then add_defines("INI_ALLOW_REALLOC=1") end + if is_plat("windows") then add_defines("_WIN32") end + + on_config(function (target) + if target:has_tool("gcc", "gxx") then + target:add("defines", "__GNUC__") + end + end) diff --git a/packages/i/inih/xmake.lua b/packages/i/inih/xmake.lua new file mode 100644 index 000000000..8468f77d6 --- /dev/null +++ b/packages/i/inih/xmake.lua @@ -0,0 +1,66 @@ +package("inih") + set_homepage("https://github.com/benhoyt/inih") + set_description("Simple .INI file parser in C, good for embedded systems") + + add_urls("https://github.com/benhoyt/inih/archive/refs/tags/$(version).tar.gz", {version = function (version) return "r" .. version end}) + add_urls("https://github.com/benhoyt/inih.git") + + add_versions("58", "e79216260d5dffe809bda840be48ab0eec7737b2bb9f02d2275c1b46344ea7b7") + + add_configs("ini_parser", {description = "compile and (if selected) install INIReader", default = true, type = "boolean"}) + add_configs("multi_line_entries", {description = "support for multi-line entries in the style of Python's ConfigParser", default = true, type = "boolean"}) + add_configs("utf_8_bom", {description = "allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of INI files", default = true, type = "boolean"}) + add_configs("inline_comments", {description = "allow inline comments with the comment prefix character", default = true, type = "boolean"}) + add_configs("inline_comment_prefix", {description = "allow inline comments with the comment prefix character", default = ";", type = "string"}) + add_configs("start_of_line_comment_prefix", {description = "character(s) to start a comment at the beginning of a line", default = ";#", type = "string"}) + add_configs("allow_no_value", {description = "allow name with no value", default = false, type = "boolean"}) + add_configs("stop_on_first_error", {description = "stop parsing after an error", default = false, type = "boolean"}) + add_configs("report_line_numbers", {description = "report line number on ini_handler callback", default = false, type = "boolean"}) + add_configs("call_handler_on_new_section", {description = "call the handler each time a new section is encountered", default = false, type = "boolean"}) + add_configs("heap", {description = "allocate memory on the heap using malloc instead using a fixed-sized line buffer on the stack", default = false, type = "boolean"}) + add_configs("max_line_length", {description = "maximum line length in bytes", default = "200", type = "string"}) + add_configs("initial_malloc_size", {description = "initial malloc size in bytes (when using the heap)", default = "200", type = "string"}) + add_configs("allow_realloc", {description = "allow initial malloc size to grow to max line length (when using the heap)", default = false, type = "boolean"}) + + on_install(function (package) + os.cp(path.join(os.scriptdir(), "port", "xmake.lua"), "xmake.lua") + local configs = {} + for name, config_value in table.orderpairs(package:configs()) do + if not package:extraconf("configs", name, "builtin") then + configs[name] = config_value + end + end + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "ini.h" + + typedef struct { } configuration; + + static int handler(void* user, const char* section, const char* name, const char* value) { return 1; } + + int test(int argc, char* argv[]) + { + configuration config; + if (ini_parse("test.ini", handler, &config) < 0) { + return 1; + } + return 0; + } + ]]}, {configs = {languages = "cxx11"}})) + + if package:config("ini_parser") then + assert(package:check_cxxsnippets({test = [[ + #include + #include "INIReader.h" + + int test() + { + INIReader reader("test.ini"); + return 0; + } + ]]}, {configs = {languages = "cxx11"}})) + end + end) diff --git a/packages/i/iniparser/xmake.lua b/packages/i/iniparser/xmake.lua new file mode 100644 index 000000000..15f3b7ff7 --- /dev/null +++ b/packages/i/iniparser/xmake.lua @@ -0,0 +1,25 @@ +package("iniparser") + set_homepage("http://ndevilla.free.fr/iniparser") + set_description("ini file parser") + set_license("MIT") + + add_urls("https://github.com/ndevilla/iniparser.git") + add_versions("2023.09.15", "5142f0feab8ab456cb6af607eba0516ae46e1eb2") + + on_install("linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", "cross", "wasm", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("iniparser") + set_kind("$(kind)") + add_files("src/*.c") + add_headerfiles("src/*.h", {prefixdir = "iniparser"}) + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("iniparser_dump_ini", {includes = "iniparser/iniparser.h"})) + end) diff --git a/packages/i/inipp/xmake.lua b/packages/i/inipp/xmake.lua new file mode 100644 index 000000000..9ad2801b4 --- /dev/null +++ b/packages/i/inipp/xmake.lua @@ -0,0 +1,21 @@ +package("inipp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/mcmtroffaes/inipp") + set_description("Simple C++ ini parser.") + set_license("MIT") + + add_urls("https://github.com/mcmtroffaes/inipp.git") + add_versions("2022.02.03", "c61e699682d3f1091209c2179f1d03f5fc593327") + + on_install(function (package) + os.cp("inipp/inipp.h", package:installdir("include/inipp")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + inipp::Ini ini; + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/i/injector/port/xmake.lua b/packages/i/injector/port/xmake.lua new file mode 100644 index 000000000..1f40f73fb --- /dev/null +++ b/packages/i/injector/port/xmake.lua @@ -0,0 +1,45 @@ +add_rules("mode.debug", "mode.release") + +if is_plat("mingw") then + add_syslinks("advapi32", "dbghelp", "psapi") +end + +target("injector") + set_kind("$(kind)") + set_languages("c") + + add_headerfiles("include/(*.h)") + add_includedirs("include", {public = true}) + + if is_arch("arm.*") then + add_defines("__arm__") + if is_arch("arm") then + add_defines("_M_ARMT") + elseif is_arch("arm64") then + add_defines("__arm64__", "__aarch64__", "_M_ARM64") + end + elseif is_arch("x86_64") then + add_defines("__x86_64__") + elseif is_arch("x86") then + add_defines("__i386__", "_M_IX86") + elseif is_arch("x64") then + add_defines("_M_AMD64") + end + + if is_plat("windows", "mingw") then + add_files("src/windows/*.c") + if is_plat("windows") then + add_defines("_WIN32") + end + elseif is_plat("macosx") then + add_headerfiles("src/macos/*.h") + add_files("src/macos/*.c") + elseif is_plat("linux") then + add_files("src/linux/*.c", "src/linux/*.S") + add_defines("__linux__") + end + on_config(function (target) + if target:has_tool("gcc", "gxx") then + target:add("defines", "__USE_GNU") + end + end) diff --git a/packages/i/injector/xmake.lua b/packages/i/injector/xmake.lua new file mode 100644 index 000000000..2aba0a82e --- /dev/null +++ b/packages/i/injector/xmake.lua @@ -0,0 +1,27 @@ +package("injector") + set_homepage("https://github.com/kubo/injector") + set_description("Library for injecting a shared library into a Linux or Windows process") + set_license("LGPL-2.1") + + add_urls("https://github.com/kubo/injector.git") + add_versions("2024.02.18", "c719b4f6b3bde75fd18d4d0c6b752a68dce593aa") + + if is_plat("mingw") then + add_syslinks("advapi32", "dbghelp", "psapi") + end + + on_install("windows", "linux", "macosx", "mingw", function (package) + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + local configs = {} + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + injector_t *injector; + injector_attach(&injector, 1234); + } + ]]})) + end) diff --git a/packages/i/iowow/xmake.lua b/packages/i/iowow/xmake.lua new file mode 100644 index 000000000..40d95daa6 --- /dev/null +++ b/packages/i/iowow/xmake.lua @@ -0,0 +1,29 @@ +package("iowow") + set_homepage("https://iowow.softmotions.com") + set_description("A C utility library and persistent key/value storage engine") + set_license("MIT") + + add_urls("https://github.com/Softmotions/iowow/archive/refs/tags/$(version).tar.gz", + "https://github.com/Softmotions/iowow.git") + + add_versions("v1.4.18", "ef4ee56dd77ce326fff25b6f41e7d78303322cca3f11cf5683ce9abfda34faf9") + add_versions("v1.4.17", "13a851026dbc1f31583fba96986e86e94a7554f9e7d38aa12a9ea5dbebdf328b") + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + add_deps("cmake") + + on_install("linux", "macosx", "bsd", "cross", function (package) + io.replace("src/utils/sort_r.h", "defined __FreeBSD__ ||", "", {plain = true}) + local configs = {"-DBUILD_EXAMPLES=OFF", "-DPACKAGE_TGZ=OFF", "-DPACKAGE_ZIP=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DASAN=" .. (package:config("asan") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("iwkv_init", {includes = "iowow/iwkv.h"})) + end) diff --git a/packages/i/itlib/xmake.lua b/packages/i/itlib/xmake.lua new file mode 100644 index 000000000..3ac9c6794 --- /dev/null +++ b/packages/i/itlib/xmake.lua @@ -0,0 +1,23 @@ +package("itlib") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/iboB/itlib") + set_description("A collection of std-like single-header C++ libraries") + set_license("MIT") + + add_urls("https://github.com/iboB/itlib/archive/refs/tags/$(version).tar.gz", + "https://github.com/iboB/itlib.git") + + add_versions("v1.10.3", "e533c44354d48b2251ca57f1502778033b38170d9d6aba6bb2bbad90f2bf9d27") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + itlib::static_vector ivec; + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/i/ittapi/xmake.lua b/packages/i/ittapi/xmake.lua new file mode 100644 index 000000000..1a5f3d88d --- /dev/null +++ b/packages/i/ittapi/xmake.lua @@ -0,0 +1,39 @@ +package("ittapi") + set_homepage("https://github.com/intel/ittapi") + set_description("Intel® Instrumentation and Tracing Technology (ITT) and Just-In-Time (JIT) API") + set_license("BSD-3-Clause") + + add_urls("https://github.com/intel/ittapi/archive/refs/tags/$(version).tar.gz", + "https://github.com/intel/ittapi.git") + + add_versions("v3.24.7", "2ff56c5c3f144b92e34af9bee451115f6076c9070ec92d361c3c07de8ff42649") + add_versions("v3.24.6", "4e6cb42b6bd9e699e3dfbaf678e572f4292127dfee3312744137ac567064a26f") + add_versions("v3.24.4", "f7341c563f228f4358b645fce526208c742fe13e61fc3ba2c777ba94d36e98f5") + + add_configs("force_32", {description = "Force a 32bit compile on 64bit", default = false, type = "boolean"}) + add_configs("ipt", {description = "ptmarks support", default = false, type = "boolean"}) + add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true}) + + if is_plat("linux") then + add_syslinks("dl") + end + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DFORCE_32=" .. (package:config("force_32") and "ON" or "OFF")) + table.insert(configs, "-DITT_API_IPT_SUPPORT=" .. (package:config("ipt") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + __itt_string_handle* nameHandle = __itt_string_handle_create(""); + } + ]]})) + end) diff --git a/packages/i/ixwebsocket/xmake.lua b/packages/i/ixwebsocket/xmake.lua new file mode 100644 index 000000000..872c3468a --- /dev/null +++ b/packages/i/ixwebsocket/xmake.lua @@ -0,0 +1,102 @@ +package("ixwebsocket") + set_homepage("https://github.com/machinezone/IXWebSocket") + set_description("websocket and http client and server library, with TLS support and very few dependencies") + set_license("BSD-3-Clause") + + add_urls("https://github.com/machinezone/IXWebSocket/archive/refs/tags/$(version).tar.gz", + "https://github.com/machinezone/IXWebSocket.git") + + add_versions("v11.4.5", "c5fc225edec32bf7d583e55347ef2c9c4940d005c13ef5e848354a85602f5fd6") + add_versions("v11.4.4", "9ef7fba86a91ce18693451466ddc54b1e0c4a7dc4466c3028d888d6d55dde539") + + local default_ssl = nil + if not is_plat("windows") then + if is_plat("android", "iphoneos", "wasm") then + default_ssl = "mbedtls" + else + default_ssl = "openssl" + end + end + add_configs("ssl", {description = "Enable SSL", default = default_ssl, type = "string", values = {"openssl", "mbedtls"}}) + add_configs("use_tls", {description = "Use TLS", default = false, type = "boolean"}) + + if is_plat("wasm") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("zlib") + if is_plat("windows") then + add_syslinks("ws2_32", "crypt32") + elseif is_plat("macosx") then + add_frameworks("Foundation", "Security") + elseif is_plat("linux", "bsd") then + add_syslinks("pthread") + end + add_deps("cmake") + + on_load(function (package) + if package:config("ssl") == "openssl" then + package:add("deps", "openssl") + elseif package:config("ssl") == "mbedtls" then + package:add("deps", "mbedtls") + end + if package:config("use_tls") then + if is_plat("windows") then + if not package:dep("openssl") then + package:add("deps", "mbedtls") + end + elseif not package:dep("mbedtls") then + package:add("deps", "openssl") + end + end + end) + + on_install(function (package) + local configs = {"-DCMAKE_CXX_STANDARD=11"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DUSE_TLS=" .. (package:config("use_tls") and "ON" or "OFF")) + if package:dep("openssl") then + table.insert(configs, "-DUSE_OPEN_SSL=1") + elseif package:dep("mbedtls") then + table.insert(configs, "-DUSE_MBED_TLS=1") + end + + local zlib = package:dep("zlib") + if zlib and not zlib:is_system() then + local fetchinfo = zlib:fetch({external = false}) + if fetchinfo then + local includedirs = fetchinfo.includedirs or fetchinfo.sysincludedirs + if includedirs and #includedirs > 0 then + table.insert(configs, "-DZLIB_INCLUDE_DIR=" .. table.concat(includedirs, " ")) + end + local libfiles = fetchinfo.libfiles + if libfiles then + table.insert(configs, "-DZLIB_LIBRARY=" .. table.concat(libfiles, " ")) + end + end + end + + if is_plat("wasm") then + io.replace("ixwebsocket/IXUserAgent.cpp", [[ss << " " << PLATFORM_NAME]], [[ss << " " << "unknown platform"]], {plain = true}) + end + + io.replace("ixwebsocket/IXSocketMbedTLS.cpp", [[/* errorMsg */]], [[errorMsg]], {plain = true}) + + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + ix::initNetSystem(); + ix::WebSocket webSocket; + std::string url("wss://echo.websocket.org"); + webSocket.setUrl(url); + webSocket.start(); + webSocket.send("Hello world"); + } + ]]}, {configs = {languages = "cxx11"}})) + end) diff --git a/packages/j/jnipp/xmake.lua b/packages/j/jnipp/xmake.lua new file mode 100644 index 000000000..b7688c8ef --- /dev/null +++ b/packages/j/jnipp/xmake.lua @@ -0,0 +1,46 @@ +package("jnipp") + set_homepage("https://github.com/mitchdowd/jnipp") + set_description("C++ wrapper for the Java Native Interface") + set_license("MIT") + + add_urls("https://github.com/mitchdowd/jnipp/archive/refs/tags/$(version).tar.gz", + "https://github.com/mitchdowd/jnipp.git") + + add_versions("v1.0.0", "e5ff425e1af81d6c0a80420f5b3a46986cdb5f2a1c34449e2fb262eb2edf885b") + + if is_plat("windows") then + add_syslinks("advapi32") + end + + add_deps("openjdk") + + on_install("windows|x64", "linux|x86_64", "macosx|x86_64", "macosx|arm64", "mingw|x86_64", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + add_requires("openjdk") + set_languages("c++14") + target("jnipp") + set_kind("$(kind)") + add_files("jnipp.cpp") + add_headerfiles("jnipp.h") + add_packages("openjdk") + if is_plat("windows") then + add_syslinks("advapi32") + if is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + jni::Vm vm; + jni::Class Integer = jni::Class("java/lang/Integer"); + jni::Object i = Integer.newInstance("1000"); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/j/joltphysics/port/xmake.lua b/packages/j/joltphysics/port/xmake.lua index 878b06385..c20225f70 100644 --- a/packages/j/joltphysics/port/xmake.lua +++ b/packages/j/joltphysics/port/xmake.lua @@ -28,6 +28,10 @@ end set_languages("c++17") +if is_kind("shared") then + add_defines("JPH_SHARED_LIBRARY") +end + target("Jolt") set_kind("$(kind)") add_includedirs(".") diff --git a/packages/j/joltphysics/xmake.lua b/packages/j/joltphysics/xmake.lua index 170fc5e14..a89e49af9 100644 --- a/packages/j/joltphysics/xmake.lua +++ b/packages/j/joltphysics/xmake.lua @@ -5,9 +5,15 @@ package("joltphysics") add_urls("https://github.com/jrouwe/JoltPhysics/archive/refs/tags/$(version).tar.gz", "https://github.com/jrouwe/JoltPhysics.git") + add_versions("v5.0.0", "5231953d1b1d5b9cb617facf86341a11337e1cd04456949af6911b917a1646cb") + add_versions("v4.0.2", "046baf71d05e47de7a530ce5d58a587a93ea7e9ea1ef8bf3ff80238fb95650ae") + add_versions("v4.0.1", "e0bb4fa07047ca9c38bd71262427ad2972a7f45f8dff74587f73457f3b60df82") + add_versions("v4.0.0", "f8449ec72ffaadf423eeb80e0814f3ba14227bcf7f06cb9f3cbcfb3499a57b33") add_versions("v3.0.1", "7ebb40bf2dddbcf0515984582aaa197ddd06e97581fd55b98cb64f91b243b8a6") add_versions("v3.0.0", "f8d756ae3471a32f2ee7e07475df2f7a34752f0fdd05e9a7ed2e7ce3dcdcd574") add_versions("v2.0.1", "96ae2e8691c4802e56bf2587da30f2cc86b8abe82a78bc2398065bd87dd718af") + -- patch for visibility attributes (fixes compilation in shared mode on GCC <13) + add_patches("v4.0.0", "https://github.com/jrouwe/JoltPhysics/commit/b084d8f9054d78cb50bc851cc4db505462c4c634.patch", "a8f5da0bc5d4a1011771016be2ad1cdb00d4c40dd0909ef6ae4a1d1c95e8e251") -- patch for missing standard include (fixes Fedora compilation) add_patches("v3.0.1", path.join(os.scriptdir(), "patches", "v3.0.1", "fix_fedora.patch"), "12be1294669852a9f15cb01a636fde72fb5f36b59cbcc1d4f931d76c454c3150") add_patches("v3.0.0", path.join(os.scriptdir(), "patches", "v3.0.1", "fix_fedora.patch"), "12be1294669852a9f15cb01a636fde72fb5f36b59cbcc1d4f931d76c454c3150") @@ -35,13 +41,14 @@ package("joltphysics") add_configs("inst_tzcnt", { description = "Enable the tzcnt CPU instruction (x86/x64 only)", default = false, type = "boolean" }) end - -- jolt physics doesn't support dynamic link - add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) - if is_plat("linux", "macosx", "iphoneos", "bsd", "wasm") then add_syslinks("pthread") end + if is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::jolt-physics") + end + on_load(function (package) local version = package:version() if not version or version:ge("3.0.0") then @@ -64,9 +71,12 @@ package("joltphysics") if package:config("double_precision") then package:add("defines", "JPH_DOUBLE_PRECISION") end + if package:config("shared") then + package:add("defines", "JPH_SHARED_LIBRARY") + end end) - on_install("windows", "mingw", "linux", "macosx", "iphoneos", "android", "wasm", function (package) + on_install("windows", "mingw", "linux", "macosx", "iphoneos", "android", "wasm", function (package) -- Jolt CMakeLists had no install target/support for custom msvc runtime until 3.0.0 local version = package:version() if not version or version:ge("3.0.0") then @@ -79,9 +89,11 @@ package("joltphysics") "-DTARGET_PERFORMANCE_TEST=OFF", "-DTARGET_SAMPLES=OFF", "-DTARGET_VIEWER=OFF", - "-DUSE_STATIC_MSVC_RUNTIME_LIBRARY=OFF" + "-DUSE_STATIC_MSVC_RUNTIME_LIBRARY=OFF", + "-DOVERRIDE_CXX_FLAGS=OFF" } table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DCROSS_PLATFORM_DETERMINISTIC=" .. (package:config("cross_platform_deterministic") and "ON" or "OFF")) table.insert(configs, "-DDOUBLE_PRECISION=" .. (package:config("double_precision") and "ON" or "OFF")) table.insert(configs, "-DGENERATE_DEBUG_SYMBOLS=" .. ((package:debug() or package:config("symbols")) and "ON" or "OFF")) diff --git a/packages/j/jsbsim/xmake.lua b/packages/j/jsbsim/xmake.lua new file mode 100644 index 000000000..55ff48e33 --- /dev/null +++ b/packages/j/jsbsim/xmake.lua @@ -0,0 +1,45 @@ +package("jsbsim") + set_homepage("https://github.com/JSBSim-Team/jsbsim") + set_description("An open source flight dynamics & control software library") + set_license("LGPL-2.1") + + add_urls("https://github.com/JSBSim-Team/jsbsim/archive/refs/tags/$(version).tar.gz", + "https://github.com/JSBSim-Team/jsbsim.git") + + add_versions("v1.2.0", "1ac7d594ba4de3582ec1bff972a298af8d65651dd5fc547240ea407b25396d80") + + if is_plat("windows", "mingw") then + add_syslinks("wsock32", "ws2_32") + end + + add_includedirs("include", "include/JSBSim") + add_links("Aeromatic++", "JSBSim") + + add_deps("cmake") + add_deps("expat") + + on_install("windows", "linux", "macosx", "mingw", function (package) + if package:is_plat("windows", "mingw") and (not package:config("shared")) then + package:add("defines", "JSBSIM_STATIC_LINK") + end + + local configs = { + "-DSYSTEM_EXPAT=OFF", + "-DBUILD_DOCS=OFF", + "-DENABLE_TESTING=OFF", + "-DBUILD_PYTHON_MODULE=OFF", + "-DCPACK_RPM_COMPONENT_INSTALL=OFF", + } + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs, {packagedeps = "expat"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + JSBSim::FGFDMExec FDMExec; + FDMExec.RunIC(); + } + ]]}, {configs = {languages = "c++14"}, includes = "JSBSim/FGFDMExec.h"})) + end) diff --git a/packages/j/json-c/xmake.lua b/packages/j/json-c/xmake.lua index 6035fe87d..661826e87 100644 --- a/packages/j/json-c/xmake.lua +++ b/packages/j/json-c/xmake.lua @@ -1,23 +1,23 @@ package("json-c") - set_homepage("https://github.com/json-c/json-c/wiki") set_description("JSON parser for C") + set_license("MIT") - set_urls("https://github.com/json-c/json-c/archive/json-c-$(version).zip") - - add_versions("0.13.1-20180305", "8a244527eb4f697362f713f7d6dca3f6f9b5335e18fe7b705130ae62e599e864") + set_urls("https://github.com/json-c/json-c/archive/refs/tags/json-c-$(version).zip") - if is_plat("windows") and winos.version():gt("winxp") then - add_deps("cmake") - on_install("windows", function (package) - import("package.tools.cmake").install(package) - os.cp("json_object_iterator.h", package:installdir("include/json-c")) - end) - end + add_versions("0.17-20230812", "471e9eb1dad4fd2e4fec571d8415993e66a89f23a5b052f1ba11b54db90252de") - on_install("linux", "macosx", "iphoneos", "android", function (package) - local configs = {"--disable-dependency-tracking", "--disable-silent-rules", "--enable-shared=no"} - import("package.tools.autoconf").install(package, configs) + add_deps("cmake") + on_install(function (package) + local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_APPS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) + if package:config("pic") ~= false then + table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") + table.insert(configs, "-DDISABLE_STATIC_FPIC=OFF") + end + import("package.tools.cmake").install(package, configs) end) on_test(function (package) diff --git a/packages/j/json-schema-validator/xmake.lua b/packages/j/json-schema-validator/xmake.lua index eb719df50..1e75aff71 100644 --- a/packages/j/json-schema-validator/xmake.lua +++ b/packages/j/json-schema-validator/xmake.lua @@ -5,6 +5,7 @@ package("json-schema-validator") add_urls("https://github.com/pboettch/json-schema-validator/archive/refs/tags/$(version).tar.gz", "https://github.com/pboettch/json-schema-validator.git") add_versions("2.1.0", "83f61d8112f485e0d3f1e72d51610ba3924b179926a8376aef3c038770faf202") + add_versions("2.3.0", "2c00b50023c7d557cdaa71c0777f5bcff996c4efd7a539e58beaa4219fa2a5e1") add_deps("cmake", "nlohmann_json") @@ -12,6 +13,10 @@ package("json-schema-validator") add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end + if is_host("windows") then + set_policy("platform.longpaths", true) + end + on_install("linux", "bsd", "windows", "macosx", "iphoneos", "mingw", "cross", function (package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) diff --git a/packages/j/jsoncpp/xmake.lua b/packages/j/jsoncpp/xmake.lua index cb02b119a..867d7faa2 100644 --- a/packages/j/jsoncpp/xmake.lua +++ b/packages/j/jsoncpp/xmake.lua @@ -45,5 +45,5 @@ package("jsoncpp") assert(age == 20); } ]] - }, {configs = {languages = "c++11"}, includes = "json/json.h"})) + }, {configs = {languages = "c++14"}, includes = "json/json.h"})) end) diff --git a/packages/j/jwt-cpp/xmake.lua b/packages/j/jwt-cpp/xmake.lua new file mode 100644 index 000000000..a64e48d2a --- /dev/null +++ b/packages/j/jwt-cpp/xmake.lua @@ -0,0 +1,41 @@ +package("jwt-cpp") + set_kind("library", {headeronly = true}) + set_homepage("https://thalhammer.github.io/jwt-cpp/") + set_description("A header only library for creating and validating json web tokens in c++") + set_license("MIT") + + add_urls("https://github.com/Thalhammer/jwt-cpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/Thalhammer/jwt-cpp.git") + + add_versions("v0.7.0", "b9eb270e3ba8221e4b2bc38723c9a1cb4fa6c241a42908b9a334daff31137406") + add_versions("v0.6.0", "0227bd6e0356b211341075c7997c837f0b388c01379bd256aa525566a5553f03") + + add_configs("picojson", {description = "Use picojson", default = true, type = "boolean"}) + + add_deps("openssl") + + on_load(function (package) + if package:config("picojson") then + package:add("deps", "picojson") + else + package:add("defines", "JWT_DISABLE_PICOJSON") + end + end) + + on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", "android", "cross", function (package) + if package:config("picojson") then + io.replace("include/jwt-cpp/jwt.h", "picojson/picojson.h", "picojson.h", {plain = true}) + io.replace("include/jwt-cpp/traits/kazuho-picojson/traits.h", "picojson/picojson.h", "picojson.h", {plain = true}) + end + os.cp("include/jwt-cpp", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + std::string token; + auto decoded = jwt::decode(token); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/k/kahip/xmake.lua b/packages/k/kahip/xmake.lua index 1e6997a47..e1ec61e46 100644 --- a/packages/k/kahip/xmake.lua +++ b/packages/k/kahip/xmake.lua @@ -6,6 +6,7 @@ package("kahip") add_urls("https://github.com/KaHIP/KaHIP/archive/refs/tags/$(version).tar.gz", "https://github.com/KaHIP/KaHIP.git") + add_versions("v3.16", "b0ef72a26968d37d9baa1304f7a113b61e925966a15e86578d44e26786e76c75") add_versions("v3.15", "20760099370ddf7ecb2f92bfdb727def48f6428001165be6ce504264b9a99a0b") add_deps("cmake", "openmp") diff --git a/packages/k/kangaru/xmake.lua b/packages/k/kangaru/xmake.lua new file mode 100644 index 000000000..69e236202 --- /dev/null +++ b/packages/k/kangaru/xmake.lua @@ -0,0 +1,34 @@ +package("kangaru") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/gracicot/kangaru") + set_description("🦘 A dependency injection container for C++11, C++14 and later") + set_license("MIT") + + add_urls("https://github.com/gracicot/kangaru/archive/refs/tags/$(version).tar.gz", + "https://github.com/gracicot/kangaru.git") + + add_versions("v4.3.2", "ed2dec53087fe4c5fbfc7f7ffcb0e963b3e0a7f27699338c4bc5a116193113b8") + add_versions("v4.3.1", "3896ea2a13cc1c220b4d83bf598e27e77004170b4a212af8f14264f8a6fb0e45") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + struct Camera {}; + struct Scene { + Camera& camera; + }; + struct CameraService : kgr::single_service {}; + struct SceneService : kgr::service> {}; + void test() { + kgr::container container; + Scene scene = container.service(); + Camera& camera = container.service(); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/k/kdbindings/xmake.lua b/packages/k/kdbindings/xmake.lua new file mode 100644 index 000000000..7d77cf8cb --- /dev/null +++ b/packages/k/kdbindings/xmake.lua @@ -0,0 +1,29 @@ +package("kdbindings") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/KDAB/KDBindings") + set_description("Reactive programming & data binding in C++") + set_license("MIT") + + add_urls("https://github.com/KDAB/KDBindings/archive/refs/tags/$(version).tar.gz", + "https://github.com/KDAB/KDBindings.git") + + add_versions("v1.0.5", "4d001419809a719f8c966e9bc73f457180325655deca0a11c07c47ee112447a3") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package, { + "-DKDBindings_TESTS=OFF", + "-DKDBindings_EXAMPLES=OFF" + }) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + KDBindings::Signal signal; + signal.connect([](int arg1, int arg2) {}); + signal.emit(0, 1); + } + ]]}, {configs = {languages = "c++17"}, includes = "kdbindings/signal.h"})) + end) diff --git a/packages/k/khrplatform/xmake.lua b/packages/k/khrplatform/xmake.lua new file mode 100644 index 000000000..2427037ea --- /dev/null +++ b/packages/k/khrplatform/xmake.lua @@ -0,0 +1,17 @@ +package("khrplatform") + set_kind("library", {headeronly = true}) + set_homepage("https://registry.khronos.org/EGL") + set_description("Khronos Shared Platform Header ()") + + add_urls("https://registry.khronos.org/EGL/api/KHR/khrplatform.h") + + add_versions("latest", "7b1e01aaa7ad8f6fc34b5c7bdf79ebf5189bb09e2c4d2e79fc5d350623d11e83") + + on_install(function (package) + os.mkdir(package:installdir("include") .. "/KHR") + os.cp("../khrplatform.h", package:installdir("include") .. "/KHR") + end) + + on_test(function (package) + assert(package:has_cincludes("KHR/khrplatform.h")) + end) diff --git a/packages/k/kiwisolver/xmake.lua b/packages/k/kiwisolver/xmake.lua index 1e5ae3027..c40e92756 100644 --- a/packages/k/kiwisolver/xmake.lua +++ b/packages/k/kiwisolver/xmake.lua @@ -1,5 +1,5 @@ package("kiwisolver") - + set_kind("library", {headeronly = true}) set_homepage("https://kiwisolver.readthedocs.io/en/latest/") set_description("Efficient C++ implementation of the Cassowary constraint solving algorithm") diff --git a/packages/k/kokkos-kernels/xmake.lua b/packages/k/kokkos-kernels/xmake.lua index 9b3d6ea84..8e1282ac6 100644 --- a/packages/k/kokkos-kernels/xmake.lua +++ b/packages/k/kokkos-kernels/xmake.lua @@ -1,11 +1,14 @@ package("kokkos-kernels") - set_homepage("https://github.com/kokkos/kokkos-kernels") set_description("Kokkos C++ Performance Portability Programming EcoSystem: Math Kernels") set_license("Apache-2.0") add_urls("https://github.com/kokkos/kokkos-kernels/archive/refs/tags/$(version).tar.gz", "https://github.com/kokkos/kokkos-kernels.git") + + add_versions("4.3.01", "749553a6ea715ba1e56fa0b13b42866bb9880dba7a94e343eadf40d08c68fab8") + add_versions("4.3.00", "03c3226ee97dbca4fa56fe69bc4eefa0673e23c37f2741943d9362424a63950e") + add_versions("4.2.01", "058052b3a40f5d4e447b7ded5c480f1b0d4aa78373b0bc7e43804d0447c34ca8") add_versions("4.0.01", "3f493fcb0244b26858ceb911be64092fbf7785616ad62c81abde0ea1ce86688a") if is_plat("windows") then @@ -14,7 +17,7 @@ package("kokkos-kernels") add_configs("cuda", {description = "Enable CUDA support.", default = false, type = "boolean"}) add_deps("cmake") - on_load("windows|x64", "macosx", "linux", function (package) + on_load("windows|x64", "macosx|x86_64", "linux", function (package) if package:config("cuda") then package:add("deps", "cuda") package:add("deps", "kokkos", {configs = {cuda = true}}) @@ -23,7 +26,7 @@ package("kokkos-kernels") end end) - on_install("windows|x64", "macosx", "linux", function (package) + on_install("windows|x64", "macosx|x86_64", "linux", function (package) if package:is_plat("windows") then local vs = import("core.tool.toolchain").load("msvc"):config("vs") if tonumber(vs) < 2022 then diff --git a/packages/k/kokkos/xmake.lua b/packages/k/kokkos/xmake.lua index c200ef916..235d72a55 100644 --- a/packages/k/kokkos/xmake.lua +++ b/packages/k/kokkos/xmake.lua @@ -1,11 +1,15 @@ package("kokkos") - set_homepage("https://kokkos.github.io/") set_description("Kokkos C++ Performance Portability Programming EcoSystem: The Programming Model") set_license("Apache-2.0") add_urls("https://github.com/kokkos/kokkos/archive/refs/tags/$(version).tar.gz", "https://github.com/kokkos/kokkos.git") + + add_versions("4.3.01", "5998b7c732664d6b5e219ccc445cd3077f0e3968b4be480c29cd194b4f45ec70") + add_versions("4.3.00", "53cf30d3b44dade51d48efefdaee7a6cf109a091b702a443a2eda63992e5fe0d") + add_versions("4.2.01", "cbabbabba021d00923fb357d2e1b905dda3838bd03c885a6752062fe03c67964") + add_versions("4.2.00", "ac08765848a0a6ac584a0a46cd12803f66dd2a2c2db99bb17c06ffc589bf5be8") add_versions("4.0.01", "bb942de8afdd519fd6d5d3974706bfc22b6585a62dd565c12e53bdb82cd154f0") if is_plat("windows") then @@ -23,7 +27,7 @@ package("kokkos") end end) - on_install("windows|x64", "macosx", "linux", function (package) + on_install("windows|x64", "macosx|x86_64", "linux", function (package) local configs = {"-DKokkos_ENABLE_SERIAL=ON"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) diff --git a/packages/k/kuba-zip/xmake.lua b/packages/k/kuba-zip/xmake.lua index 9adf1dbab..c0a96fbc8 100644 --- a/packages/k/kuba-zip/xmake.lua +++ b/packages/k/kuba-zip/xmake.lua @@ -1,25 +1,32 @@ package("kuba-zip") - set_homepage("https://github.com/kuba--/zip") set_description("A portable, simple zip library written in C") + set_license("Unlicense") add_urls("https://github.com/kuba--/zip/archive/refs/tags/$(version).tar.gz", "https://github.com/kuba--/zip.git") + + add_versions("v0.3.2", "0c33740aec7a3913bca07df360420c19cac5e794e0f602f14f798cb2e6f710e5") + add_versions("v0.3.1", "775b8a44b53e72a55c13839bf507219c2cf30b26f62e70f1a20bb727db54438f") add_versions("v0.2.2", "f278b1da5e5382c7a1a1db1502cfa1f6df6b1e05e36253d661344d30277f9895") add_versions("v0.2.5", "e052f6cbe6713f69f8caec61214fda4e5ae5150d1fcba02c9e79f1a05d939305") add_versions("v0.2.6", "6a00e10dc5242f614f76f1bd1d814726a41ee6e3856ef3caf7c73de0b63acf0b") add_deps("cmake") - on_load("windows", "mingw@windows", function (package) - if package:config("shared") then - package:add("defines", "ZIP_SHARED") - end - end) - on_install("windows", "macosx", "linux", "mingw@windows", function (package) + on_install("windows", "macosx", "linux", "mingw", function (package) + io.replace("CMakeLists.txt", "-Werror", "", {plain = true}) + local configs = {"-DCMAKE_DISABLE_TESTING=ON", "-DZIP_BUILD_DOCS=OFF"} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + if package:config("shared") then + table.insert(configs, "-DBUILD_SHARED_LIBS=ON") + if package:is_plat("windows", "mingw") then + package:add("defines", "ZIP_SHARED") + end + else + table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") + end import("package.tools.cmake").install(package, configs) end) diff --git a/packages/l/lame/xmake.lua b/packages/l/lame/xmake.lua index ae9664d04..525f3ce33 100644 --- a/packages/l/lame/xmake.lua +++ b/packages/l/lame/xmake.lua @@ -5,6 +5,7 @@ package("lame") add_urls("https://downloads.sourceforge.net/project/lame/lame/$(version)/lame-$(version).tar.gz") add_versions("3.100", "ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e") + add_configs("shared", {description = "Build static libraries", default = false, type = "boolean", readonly = true}) add_deps("nasm") @@ -23,6 +24,15 @@ package("lame") import("package.tools.autoconf").install(package, configs) end) + on_install("windows|x86", function (package) + os.cp("configMS.h", "config.h") + io.gsub("Makefile.MSVC", "nasmw", "nasm") + import("package.tools.nmake").build(package, {"-f", "Makefile.MSVC"}) + os.cp("output/*.lib", package:installdir("lib")) + os.cp("output/*.exe", package:installdir("bin")) + os.cp("include/*.h", package:installdir("include/lame")) + end) + on_test(function (package) assert(package:has_cfuncs("lame_encode_buffer", {includes = "lame/lame.h"})) end) diff --git a/packages/l/lemon/xmake.lua b/packages/l/lemon/xmake.lua index 67d3e5dea..200dea6cb 100644 --- a/packages/l/lemon/xmake.lua +++ b/packages/l/lemon/xmake.lua @@ -7,13 +7,13 @@ package("lemon") add_urls("http://lemon.cs.elte.hu/pub/sources/lemon-$(version).tar.gz") add_versions("1.3.1", "71b7c725f4c0b4a8ccb92eb87b208701586cf7a96156ebd821ca3ed855bad3c8") - if is_plat("windows") then + if is_plat("windows", "mingw") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end add_deps("cmake") - on_install("windows", "macosx", "linux", function (package) - local configs = {"-DLEMON_ENABLE_GLPK=OFF", "-DLEMON_ENABLE_ILOG=OFF", "-DLEMON_ENABLE_COIN=OFF", "-DLEMON_ENABLE_SOPLEX=OFF"} + on_install("windows", "macosx", "linux", "mingw", "cross", function (package) + local configs = {"-DLEMON_ENABLE_GLPK=OFF", "-DLEMON_ENABLE_ILOG=OFF", "-DLEMON_ENABLE_COIN=OFF", "-DLEMON_ENABLE_SOPLEX=OFF", "-DCMAKE_CXX_STANDARD=14"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) diff --git a/packages/l/leptonica/xmake.lua b/packages/l/leptonica/xmake.lua index e7c43694d..bd86f3421 100644 --- a/packages/l/leptonica/xmake.lua +++ b/packages/l/leptonica/xmake.lua @@ -1,30 +1,51 @@ package("leptonica") - set_homepage("http://www.leptonica.org/") set_description("Leptonica is a pedagogically-oriented open source site containing software that is broadly useful for image processing and image analysis applications.") set_license("BSD-2-Clause") - add_urls("https://github.com/DanBloomberg/leptonica/archive/$(version).tar.gz", + add_urls("https://github.com/DanBloomberg/leptonica/releases/download/$(version)/leptonica-$(version).tar.gz", "https://github.com/DanBloomberg/leptonica.git") - add_versions("1.80.0", "3952b974ec057d24267aae48c54bca68ead8275604bf084a73a4b953ff79196e") - add_versions("1.81.1", "e9dd2100194843a20bbb980ad8b94610558d47f623861bc80ac967f2d2ecb879") - add_versions("1.82.0", "40fa9ac1e815b91e0fa73f0737e60c9eec433a95fa123f95f2573dd3127dd669") + + add_versions("1.80.0", "ec9c46c2aefbb960fb6a6b7f800fe39de48343437b6ce08e30a8d9688ed14ba4") + add_versions("1.81.1", "0f4eb315e9bdddd797f4c55fdea4e1f45fca7e3b358a2fc693fd957ce2c43ca9") + add_versions("1.82.0", "155302ee914668c27b6fe3ca9ff2da63b245f6d62f3061c8f27563774b8ae2d6") + add_versions("1.84.1", "2b3e1254b1cca381e77c819b59ca99774ff43530209b9aeb511e1d46588a64f6") add_deps("cmake") add_deps("libwebp", {configs = {libwebpmux = true}}) - add_deps("zlib", "libtiff", "libpng", "libjpeg", "giflib") - on_load("windows", "macosx", "linux", function (package) - if package:config("shared") then - package:add("defines", "LIBLEPT_IMPORTS") + add_deps("zlib", "libtiff", "libpng", "libjpeg", "giflib", "openjpeg") + + on_load("windows", function (package) + import("core.tool.toolchain") + + local msvc = package:toolchain("msvc") or toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + local vs_sdkver = msvc:config("vs_sdkver") + if vs_sdkver then + local build_ver = string.match(vs_sdkver, "%d+%.%d+%.(%d+)%.?%d*") + assert(tonumber(build_ver) ~= 17763, "Unsupported Windows SDK 10.0.17763.0") end end) on_install("windows", "macosx", "linux", function (package) + if package:config("shared") then + package:add("defines", "LIBLEPT_IMPORTS") + end + + local packagedeps = {"libtiff"} + if package:is_plat("windows") and package:is_arch("x86") then + table.insert(packagedeps, "openjpeg") + elseif package:is_plat("macosx") then + io.replace("src/CMakeLists.txt", "${TIFF_LIBRARIES}", [[""]], {plain = true}) + end + io.replace("CMakeLists.txt", "NOT JP2K", "FALSE", {plain = true}) local configs = {"-DSW_BUILD=OFF", "-DCMAKE_FIND_FRAMEWORK=LAST", "-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) + import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps}) + + local leptonica_cmake = package:installdir("lib/cmake/leptonica/LeptonicaConfig.cmake") + io.replace(leptonica_cmake, "if ()", "if (1)", {plain = true}) end) on_test(function (package) diff --git a/packages/l/lerc/xmake.lua b/packages/l/lerc/xmake.lua new file mode 100644 index 000000000..56781f6c2 --- /dev/null +++ b/packages/l/lerc/xmake.lua @@ -0,0 +1,29 @@ +package("lerc") + set_homepage("https://github.com/esri/lerc") + set_description("Limited Error Raster Compression") + set_license("Apache-2.0") + + add_urls("https://github.com/Esri/lerc/archive/refs/tags/$(version).tar.gz", + "https://github.com/Esri/lerc.git") + + add_versions("v4.0.0", "91431c2b16d0e3de6cbaea188603359f87caed08259a645fd5a3805784ee30a0") + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + if package:config("shared") then + table.insert(configs, "-DBUILD_SHARED_LIBS=ON") + else + table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") + if package:is_plat("windows", "mingw") then + package:add("defines", "LERC_STATIC") + end + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("lerc_computeCompressedSize", {includes = "Lerc_c_api.h"})) + end) diff --git a/packages/l/libarchive/xmake.lua b/packages/l/libarchive/xmake.lua index a62a10088..862f90db6 100644 --- a/packages/l/libarchive/xmake.lua +++ b/packages/l/libarchive/xmake.lua @@ -7,13 +7,35 @@ package("libarchive") add_urls("https://libarchive.org/downloads/libarchive-$(version).tar.gz") add_versions("3.5.1", "9015d109ec00bb9ae1a384b172bf2fc1dff41e2c66e5a9eeddf933af9db37f5a") add_versions("3.5.2", "5f245bd5176bc5f67428eb0aa497e09979264a153a074d35416521a5b8e86189") + add_versions("3.6.2", "ba6d02f15ba04aba9c23fd5f236bb234eab9d5209e95d1c4df85c44d5f19b9b3") + add_versions("3.7.2", "df404eb7222cf30b4f8f93828677890a2986b66ff8bf39dac32a804e96ddf104") add_deps("cmake") - add_deps("zlib", "bzip2", "lz4", "zstd") + add_deps("zlib", "bzip2", "lz4", "zstd", "lzma") + + if is_plat("windows") then + add_syslinks("advapi32") + end + on_install("windows", "linux", "macosx", function (package) - local configs = {"-DENABLE_TEST=OFF", "-DENABLE_OPENSSL=OFF", "-DENABLE_PCREPOSIX=OFF", "-DENABLE_LibGCC=OFF", "-DENABLE_CNG=OFF", "-DENABLE_ICONV=OFF", "-DENABLE_ACL=OFF", "-DENABLE_EXPAT=OFF", "-DENABLE_LIBXML2=OFF", "-DENABLE_LIBB2=OFF"} + local configs = {"-DENABLE_TEST=OFF", + "-DENABLE_CAT=OFF", + "-DENABLE_TAR=OFF", + "-DENABLE_CPIO=OFF", + "-DENABLE_OPENSSL=OFF", + "-DENABLE_PCREPOSIX=OFF", + "-DENABLE_LibGCC=OFF", + "-DENABLE_CNG=OFF", + "-DENABLE_ICONV=OFF", + "-DENABLE_ACL=OFF", + "-DENABLE_EXPAT=OFF", + "-DENABLE_LIBXML2=OFF", + "-DENABLE_LIBB2=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if not package:config("shared") then + package:add("defines", "LIBARCHIVE_STATIC") + end import("package.tools.cmake").install(package, configs) end) diff --git a/packages/l/libass/port/config.h.in b/packages/l/libass/port/config.h.in index f09e8906f..b37538b52 100644 --- a/packages/l/libass/port/config.h.in +++ b/packages/l/libass/port/config.h.in @@ -1,12 +1,3 @@ -/* found CoreText framework */ -#undef CONFIG_CORETEXT - -/* found DirectWrite and GDI (Win32) */ -#undef CONFIG_DIRECTWRITE - -/* found libpng via pkg-config */ -#undef CONFIG_LIBPNG #define CONFIG_SOURCEVERSION "commit: ${GIT_TAG}${GIT_COMMIT_LONG}" ${define HAVE_STRDUP} ${define HAVE_STRNDUP} - diff --git a/packages/l/libassert/port/v1/xmake.lua b/packages/l/libassert/port/v1/xmake.lua new file mode 100644 index 000000000..ed6a0acc2 --- /dev/null +++ b/packages/l/libassert/port/v1/xmake.lua @@ -0,0 +1,29 @@ +add_requires("cpptrace <=0.4.0") + +if has_config("decompose") then + add_defines("ASSERT_DECOMPOSE_BINARY_LOGICAL") +end + +if has_config("lowercase") then + add_defines("ASSERT_LOWERCASE") +end + +if has_config("magic_enum") then + add_requires("magic_enum") + add_packages("magic_enum") + add_defines("ASSERT_USE_MAGIC_ENUM") +end + +add_rules("mode.debug", "mode.release") +set_languages("c++17") + +target("assert") + set_kind("$(kind)") + add_files("src/*.cpp") + add_includedirs("include") + add_headerfiles("include/*.hpp") + add_packages("cpptrace") + + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end diff --git a/packages/l/libassert/xmake.lua b/packages/l/libassert/xmake.lua index f4bebc38c..8bbddd207 100644 --- a/packages/l/libassert/xmake.lua +++ b/packages/l/libassert/xmake.lua @@ -6,68 +6,70 @@ package("libassert") add_urls("https://github.com/jeremy-rifkin/libassert/archive/refs/tags/$(version).tar.gz", "https://github.com/jeremy-rifkin/libassert.git") + add_versions("v2.0.2", "4a0b52e6523bdde0116231a67583131ea1a84bb574076fad939fc13fc7490443") + add_versions("v2.0.1", "405a44c14c5e40de5b81b01538ba12ef9d7c1f57e2c29f81b929e7e179847d4c") + add_versions("v2.0.0", "d4b2da2179a94637b34d18813a814531a1eceb0ddc6dd6db6098050dd638f4a1") + add_versions("v1.2.2", "68206b43bc4803357ba7d366574b4631bd327c46ab76ddef6ff9366784fa6b3c") add_versions("v1.2", "332f96181f4bdbd95ef5fcd6484782ba2d89b50fd5189bc2a33fd524962f6771") add_configs("decompose", {description = "Enables expression decomposition of && and || (this prevents short circuiting)", default = false, type = "boolean"}) add_configs("lowercase", {description = "Enables assert alias for ASSERT", default = false, type = "boolean"}) add_configs("magic_enum", {description = "Use the MagicEnum library to print better diagnostics for enum classes", default = true, type = "boolean"}) - add_deps("cpptrace") - on_load(function (package) if package:config("magic_enum") then package:add("deps", "magic_enum") end + + package:add("deps", "cpptrace " .. (package:version():lt("2.0.0") and "<=0.4.0" or "")) end) on_install("windows", "linux", "macosx", function (package) - local configs = {} - io.writefile("xmake.lua", [[ - add_requires("cpptrace") - if has_config("decompose") then - add_defines("ASSERT_DECOMPOSE_BINARY_LOGICAL") + if package:version():lt("2.0.0") then + if package:config("decompose") then + package:add("defines", "ASSERT_DECOMPOSE_BINARY_LOGICAL") end - if has_config("lowercase") then - add_defines("ASSERT_LOWERCASE") + if package:config("lowercase") then + package:add("defines", "ASSERT_LOWERCASE") end - if has_config("magic_enum") then - add_requires("magic_enum") - add_packages("magic_enum") - add_defines("ASSERT_USE_MAGIC_ENUM") + if package:config("magic_enum") then + package:add("defines", "ASSERT_USE_MAGIC_ENUM") + io.replace("include/assert.hpp", "../third_party/magic_enum.hpp", "magic_enum.hpp", {plain = true}) end - add_rules("mode.debug", "mode.release") - target("assert") - set_kind("$(kind)") - add_files("src/*.cpp") - add_includedirs("include") - add_headerfiles("include/*.hpp") - set_languages("c++17") - add_packages("cpptrace") - if is_plat("windows") and is_kind("shared") then - add_rules("utils.symbols.export_all", {export_classes = true}) - end - ]]) - if package:config("shared") then - configs.kind = "shared" - end - if package:config("decompose") then - package:add("defines", "ASSERT_DECOMPOSE_BINARY_LOGICAL") - end - if package:config("lowercase") then - package:add("defines", "ASSERT_LOWERCASE") - end - if package:config("magic_enum") then - package:add("defines", "ASSERT_USE_MAGIC_ENUM") - io.replace("include/assert.hpp", "../third_party/magic_enum.hpp", "magic_enum.hpp", {plain = true}) + + local configs = {} + configs.decompose = package:config("decompose") + configs.lowercase = package:config("lowercase") + configs.magic_enum = package:config("magic_enum") + os.cp(path.join(package:scriptdir(), "port", "v1", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, configs) + else + local configs = { + "-DLIBASSERT_USE_EXTERNAL_CPPTRACE=ON", + "-DLIBASSERT_USE_MAGIC_ENUM=ON", + "-DLIBASSERT_BUILD_TESTING=OFF", + "-DLIBASSERT_SANITIZER_BUILD=OFF", + } + io.replace("CMakeLists.txt", "/WX", "", {plain = true}) + if not package:config("shared") then + package:add("defines", "LIBASSERT_STATIC_DEFINE") + end + if package:config("magic_enum") then + package:add("defines", "LIBASSERT_USE_MAGIC_ENUM") + end + + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DLIBASSERT_USE_MAGIC_ENUM=" .. (package:config("magic_enum") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) end - import("package.tools.xmake").install(package, configs) end) on_test(function (package) - local opt = {configs = {languages = "c++17"}} + local includes = (package:version():lt("2.0.0") and "assert.hpp" or "libassert/assert.hpp") + local opt = {configs = {languages = "c++17"}, includes = includes} if package:config("lowercase") then assert(package:check_cxxsnippets({test = [[ - #include void test() { int x = 0; assert(x != 1, "", x); @@ -75,7 +77,6 @@ package("libassert") ]]}, opt)) else assert(package:check_cxxsnippets({test = [[ - #include void test() { int x = 0; ASSERT(x != 1, "", x); diff --git a/packages/l/libavif/xmake.lua b/packages/l/libavif/xmake.lua index 90e3b8c04..a381a56ef 100644 --- a/packages/l/libavif/xmake.lua +++ b/packages/l/libavif/xmake.lua @@ -6,6 +6,7 @@ package("libavif") add_urls("https://github.com/AOMediaCodec/libavif/archive/refs/tags/$(version).tar.gz", "https://github.com/AOMediaCodec/libavif.git") + add_versions("v1.0.4", "dc56708c83a4b934a8af2b78f67f866ba2fb568605c7cf94312acf51ee57d146") add_versions("v0.9.1", "8526f3fff34a05a51d7c703cdcf1d0d38c939b5b6dd4bb7d3a3405ddad88186c") add_configs("dav1d", {description = "Use the dav1d codec for decoding.", default = false, type = "boolean"}) diff --git a/packages/l/libbigwig/xmake.lua b/packages/l/libbigwig/xmake.lua new file mode 100644 index 000000000..97b35d060 --- /dev/null +++ b/packages/l/libbigwig/xmake.lua @@ -0,0 +1,43 @@ +package("libbigwig") + set_homepage("https://github.com/dpryan79/libBigWig") + set_description("A C library for handling bigWig files") + set_license("MIT") + + add_urls("https://github.com/dpryan79/libBigWig/archive/refs/tags/$(version).tar.gz", + "https://github.com/dpryan79/libBigWig.git") + + add_versions("0.4.7", "8e057797011d93fa00e756600898af4fe6ca2d48959236efc9f296abe94916d9") + + add_configs("curl", {description = "Enable CURL support", default = false, type = "boolean"}) + add_configs("zlib_ng", {description = "Link to zlib-ng instead of zlib", default = false, type = "boolean"}) + + if is_plat("linux") then + add_syslinks("m") + end + + add_deps("cmake") + + on_load(function (package) + if package:config("curl") then + package:add("deps", "libcurl") + end + package:add("deps", (package:config("zlib_ng") and "zlib-ng" or "zlib")) + end) + + on_install("linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", "cross", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DWITH_ZLIBNG=" .. (package:config("zlib_ng") and "ON" or "OFF")) + if package:config("curl") then + table.insert(configs, "-DWITH_CURL=ON") + else + table.insert(configs, "-DWITH_CURL=OFF") + package:add("defines", "NOCURL") + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("bwOpen", {includes = "libbigwig/bigWig.h", {configs = {languages = "c11"}}})) + end) diff --git a/packages/l/libbpf/xmake.lua b/packages/l/libbpf/xmake.lua index 2e4737c7a..1aa599cfc 100644 --- a/packages/l/libbpf/xmake.lua +++ b/packages/l/libbpf/xmake.lua @@ -3,7 +3,7 @@ package("libbpf") set_homepage("https://github.com/libbpf/libbpf") set_description("Automated upstream mirror for libbpf stand-alone build.") - set_urls("https://github.com/libbpf/libbpf/archive/$(version).tar.gz", + add_urls("https://github.com/libbpf/libbpf/archive/refs/tags/$(version).tar.gz", "https://github.com/libbpf/libbpf.git") add_versions("v0.3", "c168d84a75b541f753ceb49015d9eb886e3fb5cca87cdd9aabce7e10ad3a1efc") @@ -11,14 +11,6 @@ package("libbpf") add_includedirs("include", "include/uapi") - on_load("android", function (package) - import("core.tool.toolchain") - local ndk_sdkver = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}):config("ndk_sdkver") - if ndk_sdkver and tonumber(ndk_sdkver) < 23 then - package:add("deps", "memorymapping") - end - end) - on_install("linux", "android", function (package) io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") @@ -35,11 +27,6 @@ package("libbpf") end ]]) local configs = {} - if package:config("shared") then - configs.kind = "shared" - elseif package:config("pic") ~= false then - configs.cxflags = "-fPIC" - end import("package.tools.xmake").install(package, configs) end) diff --git a/packages/l/libccd/xmake.lua b/packages/l/libccd/xmake.lua index 6adc0925b..e2c8ae15a 100644 --- a/packages/l/libccd/xmake.lua +++ b/packages/l/libccd/xmake.lua @@ -10,19 +10,24 @@ package("libccd") add_configs("double_precision", {description = "Enable double precision floating-point arithmetic.", default = false, type = "boolean"}) - on_load("windows", "macosx", "linux", function (package) + on_load("windows", "macosx", "linux", "mingw", "cross", function (package) if not package.is_built or package:is_built() then package:add("deps", "cmake") end end) - on_install("windows", "macosx", "linux", function (package) + on_install("windows", "macosx", "linux", "mingw", "cross", function (package) io.replace("src/ccd/ccd_export.h", "def CCD_STATIC_DEFINE", package:config("shared") and " 0" or " 1", {plain = true}) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DCCD_HIDE_ALL_SYMBOLS=" .. (package:config("shared") and "OFF" or "ON")) table.insert(configs, "-DENABLE_DOUBLE_PRECISION=" .. (package:config("double_precision") and "ON" or "OFF")) + + io.replace("src/CMakeLists.txt", " find_library(LIBM_LIBRARY NAMES m)", "", {plain = true}) + io.replace("src/CMakeLists.txt", " if(NOT LIBM_LIBRARY)", "if(OFF)", {plain = true}) + io.replace("src/CMakeLists.txt", " target_link_libraries(ccd \"${LIBM_LIBRARY}\")", " target_link_libraries(ccd -lm)", {plain = true}) + import("package.tools.cmake").install(package, configs) end) diff --git a/packages/l/libco/xmake.lua b/packages/l/libco/xmake.lua new file mode 100644 index 000000000..555f9ea71 --- /dev/null +++ b/packages/l/libco/xmake.lua @@ -0,0 +1,36 @@ +package("libco") + set_homepage("https://github.com/Tencent/libco") + set_description("Libco is a c/c++ coroutine library.") + set_license("Apache-2.0") + + add_urls("https://github.com/Tencent/libco.git") + add_versions("v1.0", "dc6aafcc5e643d3b454a58acdc78e223634bbd1e") + + add_syslinks("pthread") + + on_install("linux", function (package) + local configs = {} + import("package.tools.make").make(package, configs) + if package:config("shared") then + os.trycp("**.so", package:installdir("lib")) + else + os.trycp("**.a", package:installdir("lib")) + end + + os.cp("**.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + int loop(void *) + { + return 0; + } + static void *routine_func(void *) + { + stCoEpoll_t * ev = co_get_epoll_ct(); + co_eventloop( ev, loop, 0 ); + return 0; + } + ]]}, {configs = {languages = "c++11"}, includes = {"co_routine.h","co_routine_inner.h"}})) + end) diff --git a/packages/l/libcpuid/xmake.lua b/packages/l/libcpuid/xmake.lua index 1abe2be55..acd8502a7 100644 --- a/packages/l/libcpuid/xmake.lua +++ b/packages/l/libcpuid/xmake.lua @@ -4,12 +4,14 @@ package("libcpuid") add_urls("https://github.com/anrieff/libcpuid/archive/refs/tags/$(version).tar.gz", "https://github.com/anrieff/libcpuid.git") + add_versions("v0.6.5", "4d106d66d211f2bfaf876eb62c84d4b54664e1c2b47eb6138161d3c608c0bc5e") + add_versions("v0.6.4", "1cbb1a79bfe6c37884a538b56504fa0975e78e492aee7c265a42f654c6056cb3") add_versions("v0.6.3", "da570fdeb450634d84208f203487b2e00633eac505feda5845f6921e811644fc") add_versions("v0.5.1", "36d62842ef43c749c0ba82237b10ede05b298d79a0e39ef5fd1115ba1ff8e126") add_deps("cmake") - on_install("windows", "macosx", "linux", "mingw", function (package) + on_install("windows|x86", "windows|x64", "macosx", "linux", "mingw", function (package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) diff --git a/packages/l/libcurl/patches/8.7.1/android_armv7.patch b/packages/l/libcurl/patches/8.7.1/android_armv7.patch new file mode 100644 index 000000000..312a5a3d0 --- /dev/null +++ b/packages/l/libcurl/patches/8.7.1/android_armv7.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 656aa7c74..4897369fa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1228,7 +1228,6 @@ check_symbol_exists(getifaddrs "${CURL_INCLUDES};stdlib.h" HAVE_GETIFADDRS) + check_symbol_exists(freeaddrinfo "${CURL_INCLUDES}" HAVE_FREEADDRINFO) + check_symbol_exists(pipe "${CURL_INCLUDES}" HAVE_PIPE) + check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE) +-check_symbol_exists(fseeko "${CURL_INCLUDES};stdio.h" HAVE_FSEEKO) + check_symbol_exists(_fseeki64 "${CURL_INCLUDES};stdio.h" HAVE__FSEEKI64) + check_symbol_exists(getpeername "${CURL_INCLUDES}" HAVE_GETPEERNAME) + check_symbol_exists(getsockname "${CURL_INCLUDES}" HAVE_GETSOCKNAME) +@@ -1238,10 +1237,6 @@ check_symbol_exists(setlocale "${CURL_INCLUDES}" HAVE_SETLOCALE) + check_symbol_exists(setmode "${CURL_INCLUDES}" HAVE_SETMODE) + check_symbol_exists(setrlimit "${CURL_INCLUDES}" HAVE_SETRLIMIT) + +-if(HAVE_FSEEKO) +- set(HAVE_DECL_FSEEKO 1) +-endif() +- + if(NOT MSVC OR (MSVC_VERSION GREATER_EQUAL 1900)) + # earlier MSVC compilers had faulty snprintf implementations + check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF) +@@ -1304,6 +1299,14 @@ if(HAVE_FILE_OFFSET_BITS) + endif() + check_type_size("off_t" SIZEOF_OFF_T) + ++# fseeko may not exist with _FILE_OFFSET_BITS=64 but can exist with _FILE_OFFSET_BITS unset or 32 (e.g. Android ARMv7 with NDK 26b and API level < 24) ++# so we need to test fseeko after testing for _FILE_OFFSEt_BITS ++check_symbol_exists(fseeko "${CURL_INCLUDES};stdio.h" HAVE_FSEEKO) ++ ++if(HAVE_FSEEKO) ++ set(HAVE_DECL_FSEEKO 1) ++endif() ++ + # include this header to get the type + set(CMAKE_REQUIRED_INCLUDES "${CURL_SOURCE_DIR}/include") + set(CMAKE_EXTRA_INCLUDE_FILES "curl/system.h") diff --git a/packages/l/libcurl/versions.lua b/packages/l/libcurl/versions.lua index 7a28a72a9..c65c927e3 100644 --- a/packages/l/libcurl/versions.lua +++ b/packages/l/libcurl/versions.lua @@ -1,4 +1,7 @@ function add_versions_list() + add_versions("8.7.1", "05bbd2b698e9cfbab477c33aa5e99b4975501835a41b7ca6ca71de03d8849e76") + add_versions("8.5.0", "ce4b6a6655431147624aaf582632a36fe1ade262d5fab385c60f78942dd8d87b") + add_versions("8.4.0", "e5250581a9c032b1b6ed3cf2f9c114c811fc41881069e9892d115cc73f9e88c6") add_versions("8.0.1", "9b6b1e96b748d04b968786b6bdf407aa5c75ab53a3d37c1c8c81cdb736555ccf") add_versions("7.87.0", "5d6e128761b7110946d1276aff6f0f266f2b726f5e619f7e0a057a474155f307") add_versions("7.86.0", "f5ca69db03eea17fa8705bdfb1a9f58d76a46c9010518109bb38f313137e0a28") @@ -57,6 +60,4 @@ function add_versions_list() add_versions("7.33.0", "0afde4cd949e2658eddc3cda675b19b165eea1af48ac5f3e1ec160792255d1b3") add_versions("7.32.0", "8e3db42548e01407cb2f1407660c0f528b89ec7afda6264442fc2b229b95223b") add_versions("7.31.0", "a73b118eececff5de25111f35d1d0aafe1e71afdbb83082a8e44d847267e3e08") - - add_patches("7.84.0", path.join(os.scriptdir(), "patches", "7.84.0", "sched.patch"), "e79f56f840cbc6996a153f19d9266bd46fe4154e6b494c8ee0478cb5b87662d3") end diff --git a/packages/l/libcurl/versions.txt b/packages/l/libcurl/versions.txt new file mode 100644 index 000000000..cefc16094 --- /dev/null +++ b/packages/l/libcurl/versions.txt @@ -0,0 +1,62 @@ +8.7.1 05bbd2b698e9cfbab477c33aa5e99b4975501835a41b7ca6ca71de03d8849e76 +8.6.0 b4785f2d8877fa92c0e45d7155cf8cc6750dbda961f4b1a45bcbec990cf2fa9b +8.5.0 ce4b6a6655431147624aaf582632a36fe1ade262d5fab385c60f78942dd8d87b +8.4.0 e5250581a9c032b1b6ed3cf2f9c114c811fc41881069e9892d115cc73f9e88c6 +8.0.1 9b6b1e96b748d04b968786b6bdf407aa5c75ab53a3d37c1c8c81cdb736555ccf +7.87.0 5d6e128761b7110946d1276aff6f0f266f2b726f5e619f7e0a057a474155f307 +7.86.0 f5ca69db03eea17fa8705bdfb1a9f58d76a46c9010518109bb38f313137e0a28 +7.85.0 21a7e83628ee96164ac2b36ff6bf99d467c7b0b621c1f7e317d8f0d96011539c +7.84.0 702fb26e73190a3bd77071aa146f507b9817cc4dfce218d2ab87f00cd3bc059d +7.82.0 46d9a0400a33408fd992770b04a44a7434b3036f2e8089ac28b57573d59d371f +7.81.0 1e7a38d7018ec060f1f16df839854f0889e94e122c4cfa5d3a37c2dc56f1e258 +7.80.0 dd0d150e49cd950aff35e16b628edf04927f0289df42883750cf952bb858189c +7.78.0 98530b317dc95ccb324bbe4f834f07bb642fbc393b794ddf3434f246a71ea44a +7.77.0 6c0c28868cb82593859fc43b9c8fdb769314c855c05cf1b56b023acf855df8ea +7.76.1 7a8e184d7d31312c4ebf6a8cb59cd757e61b2b2833a9ed4f9bf708066e7695e9 +7.75.0 50552d4501c178e4cc68baaecc487f466a3d6d19bbf4e50a01869effb316d026 +7.74.0 0f4d63e6681636539dc88fa8e929f934cd3a840c46e0bf28c73be11e521b77a5 +7.73.0 cf34fe0b07b800f1c01a499a6e8b2af548f6d0e044dca4a29d88a4bee146d131 +7.72.0 ad91970864102a59765e20ce16216efc9d6ad381471f7accceceab7d905703ef +7.71.1 9d52a4d80554f9b0d460ea2be5d7be99897a1a9f681ffafe739169afd6b4f224 +7.70.0 a50bfe62ad67a24f8b12dd7fd655ac43a0f0299f86ec45b11354f25fbb5829d0 +7.69.1 2ff5e5bd507adf6aa88ff4bbafd4c7af464867ffb688be93b9930717a56c4de8 +7.68.0 207f54917dd6a2dc733065ccf18d61bb5bebeaceb5df49cd9445483e8623eeb9 +7.67.0 dd5f6956821a548bf4b44f067a530ce9445cc8094fd3e7e3fc7854815858586c +7.66.0 6618234e0235c420a21f4cb4c2dd0badde76e6139668739085a70c4e2fe7a141 +7.65.3 0a855e83be482d7bc9ea00e05bdb1551a44966076762f9650959179c89fce509 +7.64.1 4cc7c738b35250d0680f29e93e0820c4cb40035f43514ea3ec8d60322d41a45d +7.64.0 d573ba1c2d1cf9d8533fadcce480d778417964e8d04ccddcc76e591d544cf2eb +7.63.0 9bab7ed4ecff77020a312d84cc5fb7eb02d58419d218f267477a724a17fd8dd8 +7.62.0 7802c54076500be500b171fde786258579d60547a3a35b8c5a23d8c88e8f9620 +7.61.1 a308377dbc9a16b2e994abd55455e5f9edca4e31666f8f8fcfe7a1a4aea419b9 +7.61.0 5f6f336921cf5b84de56afbd08dfb70adeef2303751ffb3e570c936c6d656c9c +7.60.0 897dfb2204bd99be328279f88f55b7c61592216b0542fcbe995c60aa92871e9b +7.59.0 b5920ffd6a8c95585fb95070e0ced38322790cb335c39d0dab852d12e157b5a0 +7.58.0 1cb081f97807c01e3ed747b6e1c9fee7a01cb10048f1cd0b5f56cfe0209de731 +7.57.0 c92fe31a348eae079121b73884065e600c533493eb50f1f6cee9c48a3f454826 +7.56.1 2594670367875e7d87b0f129b5e4690150780884d90244ba0fe3e74a778b5f90 +7.55.1 e5b1a92ed3b0c11f149886458fa063419500819f1610c020d62f25b8e4b16cfb +7.54.1 fdfc4df2d001ee0c44ec071186e770046249263c491fcae48df0e1a3ca8f25a0 +7.53.1 1c7207c06d75e9136a944a2e0528337ce76f15b9ec9ae4bb30d703b59bf530e8 +7.52.1 d16185a767cb2c1ba3d5b9096ec54e5ec198b213f45864a38b3bda4bbf87389b +7.51.0 7f8240048907e5030f67be0a6129bc4b333783b9cca1391026d700835a788dde +7.50.3 7b7347d976661d02c84a1f4d6daf40dee377efdc45b9e2c77dedb8acf140d8ec +7.49.1 eb63cec4bef692eab9db459033f409533e6d10e20942f4b060b32819e81885f1 +7.48.0 864e7819210b586d42c674a1fdd577ce75a78b3dda64c63565abe5aefd72c753 +7.47.1 ddc643ab9382e24bbe4747d43df189a0a6ce38fcb33df041b9cb0b3cd47ae98f +7.46.0 b7d726cdd8ed4b6db0fa1b474a3c59ebbbe4dcd4c61ac5e7ade0e0270d3195ad +7.45.0 65154e66b9f8a442b57c436904639507b4ac37ec13d6f8a48248f1b4012b98ea +7.44.0 1e2541bae6582bb697c0fbae49e1d3e6fad5d05d5aa80dbd6f072e0a44341814 +7.43.0 baa654a1122530483ccc1c58cc112fec3724a82c11c6a389f1e6a37dc8858df9 +7.42.1 e2905973391ec2dfd7743a8034ad10eeb58dab8b3a297e7892a41a7999cac887 +7.41.0 9f8b546bdc5c57d959151acae7ce6610fe929d82b8d0fc5b25a3a2296e5f8bea +7.40.0 899109eb3900fa6b8a2f995df7f449964292776a04763e94fae640700f883fba +7.39.0 b222566e7087cd9701b301dd6634b360ae118cc1cbc7697e534dc451102ea4e0 +7.38.0 035bd41e99aa1a4e64713f4cea5ccdf366ca8199e9be1b53d5a043d5165f9eba +7.37.1 c3ef3cd148f3778ddbefb344117d7829db60656efe1031f9e3065fc0faa25136 +7.36.0 1fbe82b89bcd6b7ccda8cb0ff076edc60e911595030e27689f4abd5ef7f3cfcd +7.35.0 d774d1701454f1b7d331c2075fc4f6dd972bddc2d171f43645ef3647c7fc0d83 +7.34.0 10beade56b48311499e444783df3413405b22f20a147ed4a1d8a8125f1cc829b +7.33.0 0afde4cd949e2658eddc3cda675b19b165eea1af48ac5f3e1ec160792255d1b3 +7.32.0 8e3db42548e01407cb2f1407660c0f528b89ec7afda6264442fc2b229b95223b +7.31.0 a73b118eececff5de25111f35d1d0aafe1e71afdbb83082a8e44d847267e3e08 \ No newline at end of file diff --git a/packages/l/libcurl/xmake.lua b/packages/l/libcurl/xmake.lua index f9f61aec9..3541df0d7 100644 --- a/packages/l/libcurl/xmake.lua +++ b/packages/l/libcurl/xmake.lua @@ -1,7 +1,6 @@ includes(path.join(os.scriptdir(), "versions.lua")) package("libcurl") - set_homepage("https://curl.haxx.se/") set_description("The multiprotocol file transfer library.") set_license("MIT") @@ -10,19 +9,17 @@ package("libcurl") "http://curl.mirror.anstey.ca/curl-$(version).tar.bz2") add_urls("https://github.com/curl/curl/releases/download/curl-$(version).tar.bz2", {version = function (version) return (version:gsub("%.", "_")) .. "/curl-" .. version end}) - add_versions_list() - - if is_plat("macosx", "iphoneos") then - add_frameworks("Security", "CoreFoundation", "SystemConfiguration") - elseif is_plat("linux") then - add_syslinks("pthread") - elseif is_plat("windows", "mingw") then - add_deps("cmake") - add_syslinks("advapi32", "crypt32", "wldap32", "winmm", "ws2_32", "user32") + if add_versionfiles then + add_versionfiles("versions.txt") + else + add_versions_list() end + add_patches("7.84.0", path.join(os.scriptdir(), "patches", "7.84.0", "sched.patch"), "e79f56f840cbc6996a153f19d9266bd46fe4154e6b494c8ee0478cb5b87662d3") + add_patches("8.7.1", path.join(os.scriptdir(), "patches", "8.7.1", "android_armv7.patch"), "b172fd25063fcf4bce987b47a3d95d9d79bcf80f45e7e45dbf4aba72c685fb24") + add_configs("cares", {description = "Enable c-ares support.", default = false, type = "boolean"}) - add_configs("openssl", {description = "Enable OpenSSL for SSL/TLS.", default = is_plat("linux", "cross"), type = "boolean"}) + add_configs("openssl", {description = "Enable OpenSSL for SSL/TLS.", default = false, type = "boolean"}) add_configs("mbedtls", {description = "Enable mbedTLS for SSL/TLS.", default = false, type = "boolean"}) add_configs("nghttp2", {description = "Use Nghttp2 library.", default = false, type = "boolean"}) add_configs("openldap", {description = "Use OpenLDAP library.", default = false, type = "boolean"}) @@ -33,20 +30,35 @@ package("libcurl") add_configs("libssh2", {description = "Use libSSH2 library.", default = false, type = "boolean"}) add_configs("libpsl", {description = "Use libpsl library.", default = false, type = "boolean"}) - if is_plat("mingw") and is_subhost("msys") then - add_extsources("pacman::curl") - elseif is_plat("linux") then - add_extsources("pacman::curl", "apt::libcurl4-gnutls-dev", "apt::libcurl4-nss-dev", "apt::libcurl4-openssl-dev") - elseif is_plat("macosx") then - add_extsources("brew::curl") - end - + -- we init all configurations in on_load, because package("curl") need it. on_load(function (package) + if package:is_plat("linux", "android", "cross") then + package:config_set("openssl", true) + end + + if package:is_plat("macosx", "iphoneos") then + package:add("frameworks", "Security", "CoreFoundation", "SystemConfiguration") + elseif package:is_plat("linux") then + package:add("syslinks", "pthread") + elseif package:is_plat("windows", "mingw") then + package:add("syslinks", "advapi32", "crypt32", "wldap32", "winmm", "ws2_32", "user32") + end + + if package:is_plat("mingw") and is_subhost("msys") then + package:add("extsources", "pacman::curl") + elseif package:is_plat("linux") then + package:add("extsources", "pacman::curl", "apt::libcurl4-gnutls-dev", "apt::libcurl4-nss-dev", "apt::libcurl4-openssl-dev") + elseif package:is_plat("macosx") then + package:add("extsources", "brew::curl") + end + if package:is_plat("windows", "mingw") then if not package:config("shared") then package:add("defines", "CURL_STATICLIB") end end + + package:add("deps", "cmake") local configdeps = {cares = "c-ares", openssl = "openssl", mbedtls = "mbedtls", @@ -61,7 +73,7 @@ package("libcurl") local has_deps = false for name, dep in pairs(configdeps) do if package:config(name) then - package:add("deps", dep) + package:add("deps", dep, {host = package:is_binary()}) has_deps = true end end @@ -70,12 +82,12 @@ package("libcurl") end end) - on_install("windows", "mingw", function (package) - local configs = {"-DBUILD_TESTING=OFF", "-DENABLE_MANUAL=OFF"} + on_install("windows", "mingw", "linux", "macosx", "iphoneos", "cross", "android", function (package) + local version = package:version() + + local configs = {"-DBUILD_TESTING=OFF", "-DENABLE_MANUAL=OFF", "-DENABLE_CURL_MANUAL=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - table.insert(configs, (package:version():ge("7.80") and "-DCURL_USE_SCHANNEL=ON" or "-DCMAKE_USE_SCHANNEL=ON")) - local version = package:version() if (package:is_plat("mingw") and version:ge("7.85")) then package:add("syslinks", "bcrypt") @@ -85,7 +97,6 @@ package("libcurl") openssl = (version:ge("7.81") and "CURL_USE_OPENSSL" or "CMAKE_USE_OPENSSL"), mbedtls = (version:ge("7.81") and "CURL_USE_MBEDTLS" or "CMAKE_USE_MBEDTLS"), nghttp2 = "USE_NGHTTP2", - openldap = "CURL_USE_OPENLDAP", libidn2 = "USE_LIBIDN2", zlib = "CURL_ZLIB", zstd = "CURL_ZSTD", @@ -95,51 +106,64 @@ package("libcurl") for name, opt in pairs(configopts) do table.insert(configs, "-D" .. opt .. "=" .. (package:config(name) and "ON" or "OFF")) end + if not package:config("openldap") then + table.insert(configs, "-DCURL_DISABLE_LDAP=ON") + end + if package:is_plat("windows", "mingw") then + table.insert(configs, (version:ge("7.80") and "-DCURL_USE_SCHANNEL=ON" or "-DCMAKE_USE_SCHANNEL=ON")) + end + if package:is_plat("macosx", "iphoneos") then + table.insert(configs, (version:ge("7.65") and "-DCURL_USE_SECTRANSP=ON" or "-DCMAKE_USE_DARWINSSL=ON")) + end if package:is_plat("windows") then table.insert(configs, "-DCURL_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) end if package:is_plat("mingw") and version:le("7.85.0") then io.replace("src/CMakeLists.txt", 'COMMAND ${CMAKE_COMMAND} -E echo "/* built-in manual is disabled, blank function */" > tool_hugehelp.c', "", {plain = true}) end - import("package.tools.cmake").install(package, configs) - end) - - on_install("macosx", "linux", "cross", function (package) - local configs = {"--disable-silent-rules", - "--disable-dependency-tracking", - "--without-hyper", - "--without-libgsasl", - "--without-librtmp", - "--without-quiche", - "--without-ngtcp2", - "--without-nghttp3"} - - local version = package:version() - if (package:is_plat("mingw") and version:ge("7.85")) then - package:add("syslinks", "Bcrypt") - end - - table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) - table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) - if package:debug() then - table.insert(configs, "--enable-debug") - end - if package:is_plat("macosx", "iphoneos") then - table.insert(configs, (package:version():ge("7.77") and "--with-secure-transport" or "--with-darwinssl")) - end - for _, name in ipairs({"openssl", "mbedtls", "zlib", "brotli", "zstd", "libssh2", "libidn2", "libpsl", "nghttp2"}) do - table.insert(configs, package:config(name) and "--with-" .. name or "--without-" .. name) + if package:is_plat("linux", "cross") then + io.replace("CMakeLists.txt", "list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto)", "list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto dl)", {plain = true}) + io.replace("CMakeLists.txt", "list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})", "list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} dl)", {plain = true}) end - table.insert(configs, package:config("cares") and "--enable-ares" or "--disable-ares") - table.insert(configs, package:config("openldap") and "--enable-ldap" or "--disable-ldap") - if package:is_plat("macosx") then - local cares = package:dep("c-ares") - if cares and not cares:config("shared") then - -- we need fix missing `-lresolv` when checking c-ares - io.replace("./configure", "PKGCONFIG --libs-only-l libcares", "PKGCONFIG --libs-only-l --static libcares", {plain = true}) + local function handledependency(conf, depname, includeconfig, libconfig) + if package:config(conf) then + local dep = package:dep(depname) + if dep and not dep:is_system() then + local fetchinfo = dep:fetch({external = false}) + if fetchinfo then + local includedirs = fetchinfo.includedirs or fetchinfo.sysincludedirs + if includedirs and #includedirs > 0 then + table.insert(configs, "-D" .. includeconfig .. "=" .. table.concat(includedirs, ";"):gsub("\\", "/")) + end + if type(libconfig) == "table" then + if fetchinfo.libfiles then + for _, libfile in ipairs(fetchinfo.libfiles) do + local libname = path.basename(libfile) + if libname:startswith("lib") then + libname = libname:sub(4) + end + for opt, suffix in pairs(libconfig) do + if libname:endswith(suffix) then + table.insert(configs, "-D" .. opt .. "=" .. libfile:gsub("\\", "/")) + end + end + end + end + else + if fetchinfo.libfiles then + table.insert(configs, "-D" .. libconfig .. "=" .. table.concat(fetchinfo.libfiles, ";"):gsub("\\", "/")) + end + end + end + end end end - import("package.tools.autoconf").install(package, configs) + handledependency("brotli", "brotli", "BROTLI_INCLUDE_DIR", {BROTLICOMMON_LIBRARY = "brotlicommon", BROTLIDEC_LIBRARY = "brotlidec"}) + handledependency("openssl", "openssl", "OPENSSL_INCLUDE_DIR", {OPENSSL_CRYPTO_LIBRARY = "crypto", OPENSSL_SSL_LIBRARY = "ssl"}) + handledependency("mbedtls", "mbedtls", "MBEDTLS_INCLUDE_DIRS", {MBEDTLS_LIBRARY = "mbedtls", MBEDX509_LIBRARY = "mbedx509", MBEDCRYPTO_LIBRARY = "mbedcrypto"}) + handledependency("zlib", "zlib", "ZLIB_INCLUDE_DIR", "ZLIB_LIBRARY") + handledependency("zstd", "zstd", "Zstd_INCLUDE_DIR", "Zstd_LIBRARY") + import("package.tools.cmake").install(package, configs, {buildir = "build"}) end) on_test(function (package) diff --git a/packages/l/libde265/xmake.lua b/packages/l/libde265/xmake.lua index f244b9d2a..b301bbf21 100644 --- a/packages/l/libde265/xmake.lua +++ b/packages/l/libde265/xmake.lua @@ -5,6 +5,7 @@ package("libde265") set_license("LGPL-3.0") add_urls("https://github.com/strukturag/libde265/releases/download/v$(version)/libde265-$(version).tar.gz") + add_versions("1.0.15", "00251986c29d34d3af7117ed05874950c875dd9292d016be29d3b3762666511d") add_versions("1.0.8", "24c791dd334fa521762320ff54f0febfd3c09fc978880a8c5fbc40a88f21d905") add_deps("cmake") diff --git a/packages/l/libdeflate/xmake.lua b/packages/l/libdeflate/xmake.lua index 1a2850e8f..7a203d3dd 100644 --- a/packages/l/libdeflate/xmake.lua +++ b/packages/l/libdeflate/xmake.lua @@ -6,11 +6,13 @@ package("libdeflate") add_urls("https://github.com/ebiggers/libdeflate/archive/refs/tags/$(version).tar.gz", "https://github.com/ebiggers/libdeflate.git") + add_versions("v1.20", "ed1454166ced78913ff3809870a4005b7170a6fd30767dc478a09b96847b9c2a") add_versions("v1.8", "50711ad4e9d3862f8dfb11b97eb53631a86ee3ce49c0e68ec2b6d059a9662f61") add_versions("v1.10", "5c1f75c285cd87202226f4de49985dcb75732f527eefba2b3ddd70a8865f2533") add_versions("v1.13", "0d81f197dc31dc4ef7b6198fde570f4e8653c77f4698fcb2163d820a9607c838") add_versions("v1.15", "58b95040df7383dc0413defb700d9893c194732474283cc4c8f144b00a68154b") add_versions("v1.17", "fa4615af671513fa2a53dc2e7a89ff502792e2bdfc046869ef35160fcc373763") + add_versions("v1.19", "27bf62d71cd64728ff43a9feb92f2ac2f2bf748986d856133cc1e51992428c25") add_deps("cmake") on_load("windows", function (package) diff --git a/packages/l/libdicom/xmake.lua b/packages/l/libdicom/xmake.lua new file mode 100644 index 000000000..a37f55c4c --- /dev/null +++ b/packages/l/libdicom/xmake.lua @@ -0,0 +1,29 @@ +package("libdicom") + set_homepage("https://libdicom.readthedocs.io") + set_description("C library for reading DICOM files") + set_license("MIT") + + add_urls("https://github.com/ImagingDataCommons/libdicom/archive/refs/tags/$(version).tar.gz", + "https://github.com/ImagingDataCommons/libdicom.git") + + add_versions("v1.1.0", "a0ab640e050f373bc5a3e1ec99bee7d5b488652340855223a73002181b094ae8") + + add_deps("meson", "ninja") + if is_plat("windows") then + add_deps("pkgconf") + end + add_deps("uthash") + + if is_plat("linux", "wasm") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + on_install("!android and (windows|!arm64 or !windows)", function (package) + local configs = {"-Dtests=false"} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + import("package.tools.meson").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("dcm_filehandle_create_from_file", {includes = "dicom/dicom.h"})) + end) diff --git a/packages/l/libdisasm/xmake.lua b/packages/l/libdisasm/xmake.lua new file mode 100644 index 000000000..d321c5066 --- /dev/null +++ b/packages/l/libdisasm/xmake.lua @@ -0,0 +1,27 @@ +package("libdisasm") + set_homepage("https://bastard.sourceforge.net/libdisasm.html") + set_description("The libdisasm library provides basic disassembly of Intel x86 instructions from a binary stream.") + set_license("MIT") + + add_urls("http://downloads.sourceforge.net/project/bastard/libdisasm/$(version)/libdisasm-$(version).tar.gz") + add_versions("0.23", "de3e578aa582af6e1d7729f39626892fb72dc6573658a221e0905f42a65433da") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + target("libdisasm") + set_kind("$(kind)") + add_files("libdisasm/*.c") + add_headerfiles("(libdisasm/*.h)") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + io.replace("libdisasm/x86_disasm.c", "buf_rva+offset", "(buf_rva+offset)", {plain = true}) + io.replace("libdisasm/x86_disasm.c", "buf_rva + offset", "(buf_rva+offset)", {plain = true}) + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("x86_init", {includes = "libdisasm/libdis.h"})) + end) diff --git a/packages/l/libdrm/xmake.lua b/packages/l/libdrm/xmake.lua new file mode 100644 index 000000000..47ba15afa --- /dev/null +++ b/packages/l/libdrm/xmake.lua @@ -0,0 +1,20 @@ +package("libdrm") + + set_homepage("https://gitlab.freedesktop.org/mesa/drm") + set_description("libdrm - userspace library for drm (direct rendering manager)") + + add_urls("https://dri.freedesktop.org/libdrm/libdrm-$(version).tar.xz") + add_versions("2.4.118", "a777bd85f2b5fc9c57f886c82058300578317cafdbc77d0a769d7e9a9567ab88") + + add_deps("meson", "ninja") + add_includedirs("include", "include/libdrm") + add_extsources("pkgconfig::libdrm", "pacman::libdrm", "apt::libdrm-dev") + on_install("linux", function (package) + local configs = {"-Dudev=true", "-Dvalgrind=disabled", "-Dman-pages=disabled", "-Dtests=false", "-Dcairo-tests=disabled", "-Dinstall-test-programs=false"} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + import("package.tools.meson").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("drmAvailable", {includes = "xf86drm.h"})) + end) diff --git a/packages/l/libdwarf/xmake.lua b/packages/l/libdwarf/xmake.lua new file mode 100644 index 000000000..cfae2a2b2 --- /dev/null +++ b/packages/l/libdwarf/xmake.lua @@ -0,0 +1,46 @@ +package("libdwarf") + set_homepage("https://www.prevanders.net/dwarf.html") + set_description("Libdwarf is a C library intended to simplify reading (and writing) applications using DWARF2, DWARF3, DWARF4 and DWARF5") + set_license("LGPL-2.1") + + add_urls("https://github.com/davea42/libdwarf-code/releases/download/v$(version)/libdwarf-$(version).tar.xz") + add_versions("0.9.2", "c1cd51467f9cb8459cd27d4071857abc56191cc5d4182d8bdd7744030f88f830") + add_versions("0.9.1", "877e81b189edbb075e3e086f6593457d8353d4df09b02e69f3c0c8aa19b51bf4") + add_versions("0.9.0", "d3cad80a337276a7581bb90ebcddbd743484a99a959157c066dd30f7535db59b") + add_versions("0.8.0", "771814a66b5aadacd8381b22d8a03b9e197bd35c202d27e19fb990e9b6d27b17") + + add_deps("cmake") + add_deps("zlib", "zstd") + if is_plat("windows", "mingw") then + add_links("dwarf") + end + + on_install("windows", "linux", "macosx", "mingw", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_NON_SHARED=" .. (package:config("shared") and "OFF" or "ON")) + + if is_plat("windows", "mingw") and not package:config("shared") then + package:add("defines", "LIBDWARF_STATIC=1") + end + + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_INSTALL_PREFIX='./'") + io.replace("src/lib/libdwarf/libdwarf_private.h", "typedef long long off_t;", "#include ", {plain = true}) + io.replace("src/lib/libdwarf/libdwarf_private.h", "typedef long off_t;", "#include ", {plain = true}) + end + + io.replace("CMakeLists.txt", "add_subdirectory(src/bin/dwarfdump)", "", {plain = true}) + import("package.tools.cmake").install(package, configs) + + if package:version():ge("0.9.1") then + local includedir = package:installdir("include", "libdwarf") + os.mkdir(includedir) + os.mv(package:installdir("include", "*.h"), includedir) + end + end) + + on_test(function (package) + assert(package:has_cfuncs("dwarf_debug_addr_by_index", {includes = "libdwarf/libdwarf.h"})) + end) diff --git a/packages/l/libelf/xmake.lua b/packages/l/libelf/xmake.lua index a29499f7d..4bd0282d1 100644 --- a/packages/l/libelf/xmake.lua +++ b/packages/l/libelf/xmake.lua @@ -25,15 +25,15 @@ package("libelf") io.replace("./configure", "#define off_t long", "") io.replace("lib/private.h", "HAVE_MEMMOVE", "1") io.replace("lib/private.h", "HAVE_MEMCPY", "1") + io.replace("lib/private.h", "STDC_HEADERS", "1") table.insert(cxflags, "-D__LIBELF64=1") - table.insert(cxflags, "-D__LIBELF64_LINUX=1") table.insert(cxflags, "-D__libelf_u64_t=uint64_t") table.insert(cxflags, "-D__libelf_i64_t=int64_t") package:add("defines", "__LIBELF64=1") - package:add("defines", "__LIBELF64_LINUX=1") package:add("defines", "__libelf_u64_t=uint64_t") package:add("defines", "__libelf_i64_t=int64_t") end + io.replace("./configure", "main(){return(0);}", "int main(){return(0);}", {plain = true}) import("package.tools.autoconf").install(package, configs, {cxflags = cxflags}) end) diff --git a/packages/l/libenvpp/xmake.lua b/packages/l/libenvpp/xmake.lua index 0294acc00..c066e4c08 100644 --- a/packages/l/libenvpp/xmake.lua +++ b/packages/l/libenvpp/xmake.lua @@ -6,6 +6,8 @@ package("libenvpp") add_urls("https://github.com/ph3at/libenvpp/archive/refs/tags/$(version).tar.gz", "https://github.com/ph3at/libenvpp.git") + add_versions("v1.4.1", "1bcd0a1eb4eef32a53cbb410ae38d708ea662e491cc5536cb9b15d54cc8b5707") + add_versions("v1.4.0", "3f9a4a4b62abc06522de76e3a999cc3cd6b60299dc26b28ccc2183aa614f10cd") add_versions("v1.1.0", "c373a6867ed915ffdacbbebfa017e03c0797dc4c2eb173659f607024e9cfbac9") add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true}) diff --git a/packages/l/libepoxy/xmake.lua b/packages/l/libepoxy/xmake.lua index 6d493cab2..2d165bbe8 100644 --- a/packages/l/libepoxy/xmake.lua +++ b/packages/l/libepoxy/xmake.lua @@ -8,8 +8,7 @@ package("libepoxy") return format("%d.%d/libepoxy-%s", version:major(), version:minor(), version) end}) add_versions("1.5.9", "d168a19a6edfdd9977fef1308ccf516079856a4275cf876de688fb7927e365e4") - - add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) + add_versions("1.5.10", "072cda4b59dd098bba8c2363a6247299db1fa89411dc221c8b81b8ee8192e623") if is_plat("linux") then add_extsources("apt::libepoxy-dev") @@ -18,7 +17,12 @@ package("libepoxy") add_deps("meson", "ninja") on_install("windows", "macosx", "linux", function (package) - import("package.tools.meson").install(package) + if package:is_plat("windows") and not package:config("shared") then + io.replace("include/epoxy/common.h", "__declspec(dllimport)", "", {plain = true}) + end + local configs = {"-Dtests=false"} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + import("package.tools.meson").install(package, configs) end) on_test(function (package) diff --git a/packages/l/libevdev/xmake.lua b/packages/l/libevdev/xmake.lua new file mode 100644 index 000000000..68587f95f --- /dev/null +++ b/packages/l/libevdev/xmake.lua @@ -0,0 +1,29 @@ +package("libevdev") + + set_homepage("https://www.freedesktop.org/wiki/Software/libevdev/") + set_description("libevdev is a wrapper library for evdev devices. it moves the common tasks when dealing with evdev devices into a library and provides a library interface to the callers, thus avoiding erroneous ioctls, etc. The eventual goal is that libevdev wraps all ioctls available to evdev devices, thus making direct access unnecessary.") + set_license("MIT") + + add_urls("https://gitlab.freedesktop.org/libevdev/libevdev/-/archive/libevdev-$(version)/libevdev-libevdev-$(version).tar.gz") + add_versions("1.13.1", "438a9060dca43a305f75a590624412d1f858a908d4807433c67c58770f676a47") + + add_includedirs("include/libevdev-1.0") + + add_deps("meson", "ninja", "pkg-config") + on_install("linux", function (package) + import("package.tools.meson").build(package, {"-Dtests=disabled", "-Ddocumentation=disabled"}, {buildir = "out"}) + import("package.tools.ninja").install(package, {}, {buildir = "out"}) + end) + + on_test(function (package) + assert(package:check_csnippets({test = [[ + #include + #include + #include + void test () { + struct libevdev *dev = NULL; + dev = libevdev_new(); + libevdev_free(dev); + } + ]]}, {configs = {languages = "c11"}})) + end) diff --git a/packages/l/libevent/xmake.lua b/packages/l/libevent/xmake.lua index 28acb5eca..9a9c7360e 100644 --- a/packages/l/libevent/xmake.lua +++ b/packages/l/libevent/xmake.lua @@ -19,7 +19,7 @@ package("libevent") on_load(function (package) if package:config("openssl") then - package:add("deps", "openssl") + package:add("deps", "openssl3") end if package:config("mbedtls") then package:add("deps", "mbedtls") diff --git a/packages/l/libfabric/xmake.lua b/packages/l/libfabric/xmake.lua index 7442f366a..9d2098b92 100644 --- a/packages/l/libfabric/xmake.lua +++ b/packages/l/libfabric/xmake.lua @@ -5,6 +5,8 @@ package("libfabric") set_license("BSD-2-Clause") add_urls("https://github.com/ofiwg/libfabric/releases/download/v$(version)/libfabric-$(version).tar.bz2") + add_versions("1.20.2", "75b89252a0b8b3eae8e60f7098af1598445a99a99e8fc1ff458e2fd5d4ef8cde") + add_versions("1.20.1", "fd88d65c3139865d42a6eded24e121aadabd6373239cef42b76f28630d6eed76") add_versions("1.13.0", "0c68264ae18de5c31857724c754023351614330bd61a50b40cef2b5e8f63ab28") add_versions("1.17.0", "579c0f5ef636c0c72f4d3d6bd4da91a5aed9ac3ac4ea387404c45dbbdee4745d") diff --git a/packages/l/libfacedetection/xmake.lua b/packages/l/libfacedetection/xmake.lua new file mode 100644 index 000000000..df2620621 --- /dev/null +++ b/packages/l/libfacedetection/xmake.lua @@ -0,0 +1,37 @@ +package("libfacedetection") + set_homepage("https://github.com/ShiqiYu/libfacedetection") + set_description("An open source library for face detection in images. The face detection speed can reach 1000FPS. ") + set_license("BSD-3-Clause") + + add_urls("https://github.com/ShiqiYu/libfacedetection/archive/refs/tags/$(version).tar.gz", + "https://github.com/ShiqiYu/libfacedetection.git") + + add_versions("v3.0", "66dc6b47b11db4bf4ef73e8b133327aa964dbd8b2ce9e0ef4d1e94ca08d40b6a") + + add_configs("neon", {description = "Use neon", default = is_arch("arm.*"), type = "boolean"}) + add_configs("avx512", {description = "Use avx512", default = false, type = "boolean"}) + add_configs("avx2", {description = "Use avx2", default = not is_arch("arm.*"), type = "boolean"}) + add_configs("openmp", {description = "Use openmp", default = false, type = "boolean"}) + + add_deps("cmake") + + on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_arch("arm.*") then + table.insert(configs, "-DENABLE_NEON=" .. (package:config("neon") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_AVX512=OFF") + table.insert(configs, "-DENABLE_AVX2=OFF") + else + table.insert(configs, "-DENABLE_NEON=OFF") + table.insert(configs, "-DENABLE_AVX512=" .. (package:config("avx512") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_AVX2=" .. (package:config("avx2") and "ON" or "OFF")) + end + table.insert(configs, "-DUSE_OPENMP=" .. (package:config("openmp") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cxxfuncs("facedetect_cnn", {includes = "facedetection/facedetectcnn.h", configs = {languages = "c++11"}})) + end) diff --git a/packages/l/libffi/port/xmake.lua b/packages/l/libffi/port/xmake.lua index f86dbc20c..038289cfc 100644 --- a/packages/l/libffi/port/xmake.lua +++ b/packages/l/libffi/port/xmake.lua @@ -53,9 +53,7 @@ else end set_configvar("TARGET", targetarch) -includes("check_cfuncs.lua") -includes("check_cincludes.lua") -includes("check_csnippets.lua") +includes("@builtin/check") set_configvar("STDC_HEADERS", 1) set_configvar("LT_OBJDIR", ".libs/") @@ -125,6 +123,9 @@ target("ffi") if is_plat("windows") and is_kind("shared") then add_defines("FFI_BUILDING_DLL") end + if is_kind("static") then + add_defines("FFI_STATIC_BUILD") + end set_configdir("include") add_configfiles("fficonfig.h.in") add_configfiles("include/ffi.h.in", {pattern = "@(.-)@"}) @@ -166,7 +167,13 @@ target("ffi") elseif is_arch("riscv") then add_files("src/riscv/ffi.c", "src/riscv/sysv.S") add_headerfiles("src/riscv/ffitarget.h") + elseif is_arch("wasm32") then + add_files("src/wasm32/ffi.c") + add_headerfiles("src/wasm32/ffitarget.h") end before_build(function (target) - io.replace("include/ffi.h", "!defined FFI_BUILDING", target:is_static() and "0" or "1", {plain = true}) + import("core.base.semver") + if semver.compare(target:version(), "v3.4.4") <= 0 then + io.replace("include/ffi.h", "!defined FFI_BUILDING", target:is_static() and "0" or "1", {plain = true}) + end end) diff --git a/packages/l/libffi/xmake.lua b/packages/l/libffi/xmake.lua index 894da0781..9647c6d88 100644 --- a/packages/l/libffi/xmake.lua +++ b/packages/l/libffi/xmake.lua @@ -1,5 +1,4 @@ package("libffi") - set_homepage("https://sourceware.org/libffi/") set_description("Portable Foreign Function Interface library.") set_license("MIT") @@ -10,6 +9,7 @@ package("libffi") add_versions("3.3", "72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056") add_versions("3.4.2", "540fb721619a6aba3bdeef7d940d8e9e0e6d2c193595bc243241b77ff9e93620") add_versions("3.4.4", "d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676") + add_versions("3.4.6", "b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e") if is_plat("linux") then add_extsources("apt::libffi-dev", "pacman::libffi") @@ -17,6 +17,12 @@ package("libffi") add_extsources("brew::libffi") end + on_load("windows", function (package) + if not package:config("shared") then + package:add("defines", "FFI_STATIC_BUILD") + end + end) + on_load("macosx", "linux", "bsd", "mingw", function (package) if package:gitref() then package:add("deps", "autoconf", "automake", "libtool") diff --git a/packages/l/libflac/xmake.lua b/packages/l/libflac/xmake.lua index 12871e37d..747c57fc4 100644 --- a/packages/l/libflac/xmake.lua +++ b/packages/l/libflac/xmake.lua @@ -9,10 +9,10 @@ package("libflac") add_versions("1.4.3", "0a4bb82a30609b606650d538a804a7b40205366ce8fc98871b0ecf3fbb0611ee") add_versions("1.4.2", "8e8e0406fb9e1d177bb4ba8cfed3ca3935d37144eac8f0219a03e8c1ed5cc18e") add_versions("1.3.3", "668cdeab898a7dd43cf84739f7e1f3ed6b35ece2ef9968a5c7079fe9adfe1689") - add_patches("1.4.3", path.join(os.scriptdir(), "patches", "1.4.2", "cmake.patch"), "0a99382d5d7bd33078572b6cc3af08ee7e5e3618c80754a5fdc400bd69f4e470") - add_patches("1.4.2", path.join(os.scriptdir(), "patches", "1.4.2", "cmake.patch"), "0a99382d5d7bd33078572b6cc3af08ee7e5e3618c80754a5fdc400bd69f4e470") - add_patches("1.3.3", path.join(os.scriptdir(), "patches", "1.3.3", "cmake.patch"), "49baa40ab70d63e74cfc3f0cc2f13824545a618ceaeffdd51d3333d90b37fd32") - + add_patches("1.4.3", "patches/1.4.2/cmake.patch", "0a99382d5d7bd33078572b6cc3af08ee7e5e3618c80754a5fdc400bd69f4e470") + add_patches("1.4.2", "patches/1.4.2/cmake.patch", "0a99382d5d7bd33078572b6cc3af08ee7e5e3618c80754a5fdc400bd69f4e470") + add_patches("1.3.3", "patches/1.3.3/cmake.patch", "49baa40ab70d63e74cfc3f0cc2f13824545a618ceaeffdd51d3333d90b37fd32") + if is_plat("mingw") and is_subhost("msys") then add_extsources("pacman::flac") elseif is_plat("linux") then diff --git a/packages/l/libfork/xmake.lua b/packages/l/libfork/xmake.lua new file mode 100644 index 000000000..7dd906624 --- /dev/null +++ b/packages/l/libfork/xmake.lua @@ -0,0 +1,43 @@ +package("libfork") + set_kind("library", {headeronly = true}) + set_homepage("https://conorwilliams.github.io/libfork/") + set_description("A bleeding-edge, lock-free, wait-free, continuation-stealing tasking library built on C++20's coroutines") + set_license("MPL-2.0") + + add_urls("https://github.com/ConorWilliams/libfork/archive/refs/tags/$(version).tar.gz", + "https://github.com/ConorWilliams/libfork.git") + + add_versions("v3.8.0", "53f23f0d27bb0753c0b03132f3c17bf8099617f037a2389a04e85fdd6f2736e8") + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + add_deps("cmake") + + if on_check then + on_check("windows", function (package) + import("core.tool.toolchain") + + local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + if msvc then + local vs = msvc:config("vs") + assert(vs and tonumber(vs) >= 2022, "package(libfork): need vs >= 2022") + end + end) + end + + on_install(function (package) + import("package.tools.cmake").install(package, { + "-DCMAKE_INSTALL_INCLUDEDIR=" .. package:installdir("include") + }) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + lf::sync_wait(lf::lazy_pool{}, [](auto) -> lf::task{ co_return 0; }); + } + ]]}, {configs = {languages = "c++20"}})) + end) diff --git a/packages/l/libfyaml/xmake.lua b/packages/l/libfyaml/xmake.lua new file mode 100644 index 000000000..362efe43d --- /dev/null +++ b/packages/l/libfyaml/xmake.lua @@ -0,0 +1,29 @@ +package("libfyaml") + set_homepage("https://github.com/pantoniou/libfyaml") + set_description("Fully feature complete YAML parser and emitter, supporting the latest YAML spec and passing the full YAML testsuite.") + set_license("MIT") + + add_urls("https://github.com/pantoniou/libfyaml/archive/refs/tags/$(version).tar.gz", + "https://github.com/pantoniou/libfyaml.git") + + add_versions("v0.9", "927306fc85c7566904751766d36178650766b34e59ce56882eaa5b60f791668c") + + add_deps("cmake") + + on_install("linux", "macosx", "android", "iphoneos", "cross", function (package) + if package:is_plat("android") then + import("core.tool.toolchain") + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndk_sdkver = ndk:config("ndk_sdkver") + assert(ndk_sdkver and tonumber(ndk_sdkver) > 21, "package(libfyaml): need ndk api level > 21 for android") + end + + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("fy_library_version", {includes = "libfyaml.h"})) + end) diff --git a/packages/l/libgd/xmake.lua b/packages/l/libgd/xmake.lua index ac8a0c0d1..69548bf47 100644 --- a/packages/l/libgd/xmake.lua +++ b/packages/l/libgd/xmake.lua @@ -4,7 +4,10 @@ package("libgd") set_description("GD is an open source code library for the dynamic creation of images by programmers.") add_urls("https://github.com/libgd/libgd/archive/refs/tags/gd-$(version).tar.gz") + add_urls("https://github.com/libgd/libgd.git", {alias = "github"}) + add_versions("2.3.2", "dcc22244d775f469bee21dce1ea42552adbb72ba0cc423f9fa6a64601b3a1893") + add_versions("github:2023.12.04", "58d25665be1c146e7284f253fa679e8256afa6cb") add_patches("2.3.2", path.join(os.scriptdir(), "patches", "2.3.2", "build.patch"), "87ae73df7ce126f8b31e1988aae3ecf0638eeb1c0a085689bd82045704c8171c") @@ -21,19 +24,19 @@ package("libgd") end add_deps("cmake", "zlib") - on_load("windows", "linux", "macosx", function (package) + on_load("windows", "linux", "macosx", "mingw", function (package) for conf, dep in pairs(configdeps) do if package:config(conf) then package:add("deps", dep) end end - if package:is_plat("windows") and not package:config("shared") then + if package:is_plat("windows", "mingw") and not package:config("shared") then package:add("defines", "BGDWIN32") package:add("defines", "NONDLL") end end) - on_install("windows", "linux", "macosx", function (package) + on_install("windows", "linux", "macosx", "mingw", function (package) local configs = {"-DBUILD_TEST=OFF", "-DBUILD_PROGRAMS=OFF", "-DBUILD_DOCS=OFF", "-DBUILD_EXAMPLES=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) diff --git a/packages/l/libgit2/xmake.lua b/packages/l/libgit2/xmake.lua index 244746ed6..54a070de3 100644 --- a/packages/l/libgit2/xmake.lua +++ b/packages/l/libgit2/xmake.lua @@ -6,6 +6,9 @@ package("libgit2") set_urls("https://github.com/libgit2/libgit2/archive/refs/tags/$(version).tar.gz", "https://github.com/libgit2/libgit2.git") + add_versions("v1.8.1", "8c1eaf0cf07cba0e9021920bfba9502140220786ed5d8a8ec6c7ad9174522f8e") + add_versions("v1.8.0", "9e1d6a880d59026b675456fbb1593c724c68d73c34c0d214d6eb848e9bbd8ae4") + add_versions("v1.7.1", "17d2b292f21be3892b704dddff29327b3564f96099a1c53b00edc23160c71327") add_versions("v1.3.0", "192eeff84596ff09efb6b01835a066f2df7cd7985e0991c79595688e6b36444e") add_deps("cmake") @@ -19,14 +22,15 @@ package("libgit2") add_deps("pcre") add_syslinks("pthread", "dl") elseif is_plat("windows") then - add_syslinks("ole32", "rpcrt4", "winhttp") + add_syslinks("ole32", "rpcrt4", "winhttp", "ws2_32", "user32", "crypt32", "advapi32") end - on_install("macosx", "linux", "windows", "android", "iphoneos", function (package) + on_install("macosx", "linux", "windows|x64", "windows|x86", "iphoneos", function (package) local configs = {"-DBUILD_TESTS=OFF", "-DBUILD_CLAR=OFF", "-DBUILD_EXAMPLES=OFF", "-DBUILD_FUZZERS=OFF", + "-DBUILD_CLI=OFF", "-DUSE_SSH=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) @@ -39,6 +43,9 @@ package("libgit2") table.insert(configs, "-DSTATIC_CRT=OFF") end io.replace("CMakeLists.txt", "/GL", "", {plain = true}) + if package:version():eq("1.7.1") then + io.replace("cmake/DefaultCFlags.cmake", "/GL", "", {plain = true}) + end end import("package.tools.cmake").install(package, configs) end) diff --git a/packages/l/libgpiod/port/xmake.lua b/packages/l/libgpiod/port/xmake.lua new file mode 100644 index 000000000..0df22355b --- /dev/null +++ b/packages/l/libgpiod/port/xmake.lua @@ -0,0 +1,62 @@ +option("enable_bindings_cxx", {default = true, showmenu = true, description = "Enable C++ bindings"}) +option("enable_tools", {default = true, showmenu = true, description = "Enable tools"}) + +target("gpiod") + set_kind("$(kind)") + set_languages("cxx11") + + add_headerfiles("include/(gpiod.h)") + add_headerfiles("lib/uapi/*.h") + add_files("lib/*.c") + + add_includedirs("include", {public = true}) + + before_build(function (target) + local configure = io.readfile("configure.ac") + local version = configure:match("AC_INIT%(%[libgpiod%], %[?([0-9%.]+)%]?%)") + target:add("defines", "GPIOD_VERSION_STR=\"" .. version .. "\"") + end) + +if has_config("enable_bindings_cxx") then + target("gpiodcxx") + set_kind("$(kind)") + set_languages("cxx17") + + add_headerfiles("include/(gpiod.h)") + add_headerfiles("lib/uapi/*.h") + add_files("lib/*.c") + + add_includedirs("include") + + add_headerfiles("bindings/cxx/(gpiod.hpp)") + add_headerfiles("bindings/cxx/(gpiodcxx/**.hpp)") + add_files("bindings/cxx/*.cpp") + + add_includedirs("bindings/cxx", {public = true}) + + before_build(function (target) + local configure = io.readfile("configure.ac") + local version = configure:match("AC_INIT%(%[libgpiod%], %[?([0-9%.]+)%]?%)") + target:add("defines", "GPIOD_VERSION_STR=\"" .. version .. "\"") + end) +end + +if has_config("enable_tools") then + for _, tool_file in ipairs(os.files("tools/*.c")) do + local name = path.basename(tool_file) + if name ~= "tools-common" then + target(name) + set_kind("binary") + set_languages("cxx11") + + add_files("tools/" .. name .. ".c") + add_headerfiles("tools/tools-common.h") + add_files("tools/tools-common.c") + + add_defines("program_invocation_short_name=\"" .. name .. "\"") + add_defines("program_invocation_name=\"" .. name .. "\"") + + add_deps("gpiod") + end + end +end \ No newline at end of file diff --git a/packages/l/libgpiod/xmake.lua b/packages/l/libgpiod/xmake.lua index d4f732800..8f0dc991b 100644 --- a/packages/l/libgpiod/xmake.lua +++ b/packages/l/libgpiod/xmake.lua @@ -7,18 +7,40 @@ package("libgpiod") add_versions("v2.0.1", "cf0d4db1d94cc99281de142063d0e28f42760c4d918d6b8854e1b27811517c34") add_versions("v2.0", "a0f835c4ca4a2a3ca021090b574235ba58bb9fd612d8a6051fb1350054e04fdd") add_versions("v1.6.4", "9f920260c46b155f65cba8796dcf159e4ba56950b85742af357d75a1af709e68") - - add_deps("autoconf-archive", "automake", "libtool", "pkg-config") + + add_configs("enable_bindings_cxx", {description = "Enable C++ bindings", default = true, type = "boolean"}) + add_configs("enable_tools", {description = "Enable tools", default = true, type = "boolean"}) on_install("linux", function (package) - local configs = {"--enable-tools=yes", "--enable-bindings-cxx"} - table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) - table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) - import("package.tools.autoconf").install(package, configs) + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + local configs = {} + if package:config("enable_bindings_cxx") then + configs.enable_bindings_cxx = true + end + if package:config("enable_tools") then + configs.enable_tools = true + end + import("package.tools.xmake").install(package) package:addenv("PATH", "bin") end) on_test(function (package) - os.runv("gpiodetect") - assert(package:has_cfuncs("gpiod_api_version", {includes = "gpiod.h"})) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + struct gpiod_chip *chip; + chip = gpiod_chip_open("/dev/null"); + } + ]]}, {configs = {languages = "c++11"}})) + if package:config("enable_bindings_cxx") then + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + gpiod::chip chip("/dev/null"); + } + ]]}, {configs = {languages = "c++17"}})) + end + if package:config("enable_tools") then + os.runv("gpiodetect") + end end) diff --git a/packages/l/libheif/xmake.lua b/packages/l/libheif/xmake.lua index d33e33383..761656ab9 100644 --- a/packages/l/libheif/xmake.lua +++ b/packages/l/libheif/xmake.lua @@ -5,6 +5,7 @@ package("libheif") set_license("LGPL-3.0") add_urls("https://github.com/strukturag/libheif/releases/download/v$(version)/libheif-$(version).tar.gz") + add_versions("1.17.6", "8390baf4913eda0a183e132cec62b875fb2ef507ced5ddddc98dfd2f17780aee") add_versions("1.12.0", "e1ac2abb354fdc8ccdca71363ebad7503ad731c84022cf460837f0839e171718") add_deps("cmake") @@ -25,9 +26,15 @@ package("libheif") end) on_install("windows", "macosx", "linux", function (package) - local configs = {"-DWITH_EXAMPLES=OFF", - "-DWITH_AOM=OFF", - "-DWITH_RAV1E=OFF"} + local configs = + { + "-DWITH_EXAMPLES=OFF", + -- TODO: package dep + "-DWITH_AOM=OFF", + "-DWITH_RAV1E=OFF", + "-DWITH_LIBSHARPYUV=OFF" + } + io.replace("CMakeLists.txt", "find_package(AOM)", "", {plain = true}) table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) for _, conf in ipairs(configdeps) do diff --git a/packages/l/libhv/xmake.lua b/packages/l/libhv/xmake.lua index 8b3b69ce0..530b428a9 100644 --- a/packages/l/libhv/xmake.lua +++ b/packages/l/libhv/xmake.lua @@ -1,5 +1,4 @@ package("libhv") - set_homepage("https://github.com/ithewei/libhv") set_description("Like libevent, libev, and libuv, libhv provides event-loop with non-blocking IO and timer, but simpler api and richer protocols.") @@ -14,6 +13,7 @@ package("libhv") add_versions("1.2.6", "dd5ed854f5cdc0bdd3a3310a9f0452ec194e2907006551aebbb603825a989ed1") add_versions("1.3.0", "e7a129dcabb541baeb8599e419380df6aa98afc6e04874ac88a6d2bdb5a973a5") add_versions("1.3.1", "66fb17738bc51bee424b6ddb1e3b648091fafa80c8da6d75626d12b4188e0bdc") + add_versions("1.3.2", "61d6d5fadf13d81c111df4514e0e61062fead21c2a8b6c4caf7706f9b002fae1") add_configs("protocol", {description = "compile protocol", default = false, type = "boolean"}) add_configs("http", {description = "compile http", default = true, type = "boolean"}) @@ -28,16 +28,16 @@ package("libhv") add_configs("nghttp2", {description = "with nghttp2 library", default = false, type = "boolean"}) add_configs("openssl", {description = "with openssl library", default = false, type = "boolean"}) add_configs("mbedtls", {description = "with mbedtls library", default = false, type = "boolean"}) - add_configs("GNUTLS", {description="with gnutls library",default=false,type="boolean"}) + add_configs("gnutls", {description = "with gnutls library", default = false, type = "boolean"}) if is_plat("linux") then add_syslinks("pthread") elseif is_plat("macosx", "iphoneos") then add_frameworks("CoreFoundation", "Security") elseif is_plat("windows") then - add_syslinks("advapi32") + add_syslinks("crypt32", "advapi32") elseif is_plat("mingw") then - add_syslinks("ws2_32") + add_syslinks("crypt32", "ws2_32", "secur32") add_syslinks("pthread") end @@ -51,17 +51,20 @@ package("libhv") elseif package:config("curl") then package:add("deps", "libcurl") elseif package:config("nghttp2") then - -- TODO + package:add("deps", "nghttp2") end - if package:is_plat("windows") and not package:config("shared") then + + if not package:config("shared") then package:add("defines", "HV_STATICLIB") end end) - on_install("windows", "linux", "macosx", "android", "iphoneos", "mingw", function(package) + on_install("windows", "linux", "macosx", "android", "iphoneos", "mingw@windows", function(package) local configs = {"-DBUILD_EXAMPLES=OFF", "-DBUILD_UNITTEST=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DBUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON")) + for _, name in ipairs({"with_protocol", "with_http", "with_http_server", @@ -75,7 +78,7 @@ package("libhv") "enable_uds", "enable_windump", "use_multimap", - "WITH_GNUTLS"}) do + "with_gnutls"}) do local config_name = name:gsub("with_", ""):gsub("use_", ""):gsub("enable_", "") table.insert(configs, "-D" .. name:upper() .. "=" .. (package:config(config_name) and "ON" or "OFF")) end @@ -97,5 +100,11 @@ package("libhv") on_test(function(package) assert(package:has_cfuncs("hloop_new", {includes = "hv/hloop.h"})) + assert(package:check_cxxsnippets({test = [[ + #include "hv/hv.h" + void test() { + const char* version = hv_compile_version(); + printf("%s\n", version); + } + ]]}, {configs = {languages = "c++11"}})) end) - diff --git a/packages/l/libiconv/xmake.lua b/packages/l/libiconv/xmake.lua index f6d95bb87..22a0ebe50 100644 --- a/packages/l/libiconv/xmake.lua +++ b/packages/l/libiconv/xmake.lua @@ -2,9 +2,10 @@ package("libiconv") set_homepage("https://www.gnu.org/software/libiconv") set_description("Character set conversion library.") + set_license("LGPL-2.0") - set_urls("https://ftp.gnu.org/gnu/libiconv/libiconv-$(version).tar.gz", - "https://ftpmirror.gnu.org/libiconv/libiconv-$(version).tar.gz") + set_urls("https://ftpmirror.gnu.org/gnu/libiconv/libiconv-$(version).tar.gz", + "https://ftp.gnu.org/gnu/libiconv/libiconv-$(version).tar.gz") add_versions("1.17", "8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313") add_versions("1.16", "e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04") add_versions("1.15", "ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178") @@ -21,10 +22,10 @@ package("libiconv") on_fetch("macosx", "linux", function (package, opt) if opt.system then - if package:is_plat("linux") then + if package:is_plat("linux") and package:has_tool("cc", "gcc", "gxx") then return {} -- on linux libiconv is already a part of glibc else - return package:find_package("system::iconv", {includes = "iconv.h"}) or package:find_package("system::intl", {includes = "iconv.h"}) + return package:find_package("system::iconv", {includes = "iconv.h"}) end end end) @@ -49,10 +50,7 @@ package("libiconv") end) on_install("macosx", "linux", "bsd", "cross", "android", "wasm", function (package) - local configs = {"--disable-dependency-tracking", "--enable-extra-encodings"} - if not package:is_plat("macosx") then - table.insert(configs, "--enable-relocatable") - end + local configs = {"--disable-dependency-tracking", "--enable-extra-encodings", "--enable-relocatable"} table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) if package:debug() then @@ -67,7 +65,7 @@ package("libiconv") end) on_test(function (package) - if package:is_plat("macosx", "linux", "bsd") then + if package:is_plat("linux", "bsd") or (package:is_plat("macosx") and not package:config("shared")) then os.vrun("iconv --version") end assert(package:check_csnippets({test = [[ diff --git a/packages/l/libidn2/xmake.lua b/packages/l/libidn2/xmake.lua index 9c44160ac..1cdf59ebb 100644 --- a/packages/l/libidn2/xmake.lua +++ b/packages/l/libidn2/xmake.lua @@ -4,8 +4,8 @@ package("libidn2") set_description("Libidn2 is an implementation of the IDNA2008 + TR46 specifications.") set_license("LGPL-3.0") - add_urls("https://ftp.gnu.org/gnu/libidn/libidn2-$(version).tar.gz", - "https://ftpmirror.gnu.org/libidn/libidn2-$(version).tar.gz") + add_urls("https://ftpmirror.gnu.org/gnu/libidn/libidn2-$(version).tar.gz", + "https://ftp.gnu.org/gnu/libidn/libidn2-$(version).tar.gz") add_versions("2.3.2", "76940cd4e778e8093579a9d195b25fff5e936e9dc6242068528b437a76764f91") add_deps("libunistring") diff --git a/packages/l/libigl/xmake.lua b/packages/l/libigl/xmake.lua index d989b42b1..e94de4871 100644 --- a/packages/l/libigl/xmake.lua +++ b/packages/l/libigl/xmake.lua @@ -15,6 +15,7 @@ package("libigl") add_configs("header_only", {description = "Use header only version.", default = true, type = "boolean"}) add_configs("cgal", {description = "Use CGAL library.", default = false, type = "boolean"}) add_configs("imgui", {description = "Use imgui with libigl.", default = false, type = "boolean"}) + add_configs("embree", {description = "Use embree library.", default = false, type = "boolean"}) if is_plat("windows") then add_syslinks("comdlg32") @@ -32,6 +33,10 @@ package("libigl") end if package:config("imgui") then package:add("deps", "imgui", {configs = {glfw_opengl3 = true}}) + package:add("deps", "glad") + end + if package:config("embree") then + package:add("deps", "embree") end end) @@ -71,4 +76,32 @@ package("libigl") igl::cotmatrix(V,F,L); } ]]}, {configs = {languages = "c++14"}, includes = {"igl/cotmatrix.h", "Eigen/Dense", "Eigen/Sparse"}})) + + if package:config("imgui") then + assert(package:check_cxxsnippets({test = [[ + void test() { + Eigen::MatrixXd V; + Eigen::MatrixXi F; + igl::opengl::glfw::Viewer viewer; + viewer.data().set_mesh(V, F); + viewer.launch(); + } + ]]}, {configs = {languages = "c++14"}, includes = {"igl/opengl/glfw/Viewer.h", "Eigen/Dense", "Eigen/Sparse"}})) + end + + if package:config("embree") then + assert(package:check_cxxsnippets({test = [[ + void test() { + Eigen::MatrixXf V; + Eigen::MatrixXi F; + igl::embree::EmbreeIntersector ei; + ei.init(V,F); + + igl::Hit hit{}; + Eigen::Vector3f look_from{1.0f, 1.0f, 1.0f}, dir{1.0f, 1.0f, 1.0f}; + bool is_hit = ei.intersectRay(look_from, dir, hit); + } + ]]}, {configs = {languages = "c++14"}, includes = {"igl/embree/EmbreeIntersector.h", "igl/Hit.h", "Eigen/Dense", "Eigen/Sparse"}})) + end + end) diff --git a/packages/l/libintl/port/xmake.lua b/packages/l/libintl/port/0.21/xmake.lua similarity index 98% rename from packages/l/libintl/port/xmake.lua rename to packages/l/libintl/port/0.21/xmake.lua index ac872e7f7..6c72cc037 100644 --- a/packages/l/libintl/port/xmake.lua +++ b/packages/l/libintl/port/0.21/xmake.lua @@ -229,7 +229,11 @@ void test() {environ.foo = 1;}]], {includes = is_plat("windows") and "stdlib.h" -- config.h variables configvar_check_ctypes("HAVE_STDINT_H_WITH_UINTMAX", "uintmax_t", {includes = "stdint.h"}) configvar_check_ctypes("HAVE_UINTMAX_T", "uintmax_t", {includes = "stdint.h"}) -configvar_check_links("HAVE_PTHREAD_API", "pthread") +if is_plat("android") then + configvar_check_cfuncs("HAVE_PTHREAD_API", "pthread_create", {includes = "pthread.h"}) +else + configvar_check_links("HAVE_PTHREAD_API", "pthread") +end configvar_check_csnippets("HAVE_ALLOCA", [[ #ifdef __GNUC__ # define alloca __builtin_alloca diff --git a/packages/l/libintl/port/0.22.3/xmake.lua b/packages/l/libintl/port/0.22.3/xmake.lua new file mode 100644 index 000000000..e0b5c4533 --- /dev/null +++ b/packages/l/libintl/port/0.22.3/xmake.lua @@ -0,0 +1,430 @@ +set_project("libintl") + +add_rules("mode.debug", "mode.release") + +set_configvar("PACKAGE", "gettext-runtime") +set_configvar("PACKAGE_NAME", "gettext-runtime") +set_configvar("PACKAGE_TARNAME", "gettext-runtime") +set_configvar("PACKAGE_BUGREPORT", "bug-gettext@gnu.org") +set_configvar("PACKAGE_URL", "") + +option("installprefix") + set_default("") + set_showmenu(true) +option_end() +set_configvar("INSTALLPREFIX", get_config("installprefix")) +if has_config("installprefix") then + add_defines("LOCALEDIR=\"" .. get_config("installprefix") .. "/locale\"") + add_defines("LOCALE_ALIAS_PATH=\"" .. get_config("installprefix") .. "/locale\"") +end + +option("vers") + set_default("") + set_showmenu(true) +option_end() +if has_config("vers") then + set_version(get_config("vers")) + set_configvar("VERSION", get_config("vers")) + set_configvar("PACKAGE_VERSION", get_config("vers")) + set_configvar("PACKAGE_STRING", "gettext-runtime " .. get_config("vers")) +end + +option("relocatable") + set_default(true) + set_showmenu(true) +option_end() +if has_config("relocatable") then + add_defines("ENABLE_RELOCATABLE=1") + set_configvar("ENABLE_RELOCATABLE", 1) +end + +includes("@builtin/check") + +-- general autoconf variables +option("GNULIB_STRERROR") + add_csnippets("strerror", [[#include +int test() { if (!*strerror(-2)) { return 1; } return 0; }]]) + set_configvar("GNULIB_STRERROR", 1) +option_end() +add_options("GNULIB_STRERROR") +option("HAVE_UID_T") + add_ctypes("uid_t") + add_cincludes("stdlib.h") +option_end() +if not has_config("HAVE_UID_T") then + set_configvar("uid_t", "int", {quote = false}) +end +option("HAVE_SSIZE_T") + add_ctypes("ssize_t") + add_cincludes("sys/types.h") +option_end() +if not has_config("HAVE_SSIZE_T") then + set_configvar("ssize_t", "int", {quote = false}) +end +option("HAVE_NLINK_T") + add_ctypes("nlink_t") + add_cincludes("sys/types.h") +option_end() +if not has_config("HAVE_NLINK_T") then + set_configvar("nlink_t", "int", {quote = false}) +end +set_configvar("LT_OBJDIR", ".libs/") +set_configvar("HAVE_INLINE", 1) +set_configvar("_ALL_SOURCE", 1) +set_configvar("_DARWIN_C_SOURCE", 1) +set_configvar("_GNU_SOURCE", 1) +set_configvar("_NETBSD_SOURCE", 1) +set_configvar("_OPENBSD_SOURCE", 1) +set_configvar("_POSIX_PTHREAD_SEMANTICS", 1) +set_configvar("__STDC_WANT_IEC_60559_ATTRIBS_EXT__", 1) +set_configvar("__STDC_WANT_IEC_60559_BFP_EXT__", 1) +set_configvar("__STDC_WANT_IEC_60559_DFP_EXT__", 1) +set_configvar("__STDC_WANT_IEC_60559_FUNCS_EXT__", 1) +set_configvar("__STDC_WANT_IEC_60559_TYPES_EXT__", 1) +set_configvar("__STDC_WANT_LIB_EXT2__", 1) +set_configvar("__STDC_WANT_MATH_SPEC_FUNCS__", 1) +set_configvar("_TANDEM_SOURCE", 1) +set_configvar("__EXTENSIONS__", 1) +set_configvar("ENABLE_EXTRA", 1) +set_configvar("_USE_STD_STAT", 1) +set_configvar("__USE_MINGW_ANSI_STDIO", 1) +set_configvar("STDC_HEADERS", 1) +set_configvar("C_ALLOCA", 1) +set_configvar("USE_UNLOCKED_IO", 1) +set_configvar("GNULIB_LOCK", 1) +set_configvar("GNULIB_MSVC_NOTHROW", 1) +set_configvar("GNULIB_CANONICALIZE_LGPL", 1) +set_configvar("GNULIB_TEST_CANONICALIZE_FILE_NAME", 1) +set_configvar("GNULIB_TEST_ENVIRON", 1) +set_configvar("GNULIB_TEST_FREXP", 1) +set_configvar("GNULIB_TEST_FREXPL", 1) +set_configvar("GNULIB_TEST_LSTAT", 1) +set_configvar("GNULIB_TEST_LOCALENAME", 1) +set_configvar("GNULIB_TEST_MALLOC_POSIX", 1) +set_configvar("GNULIB_TEST_RAISE", 1) +set_configvar("GNULIB_TEST_READ", 1) +set_configvar("GNULIB_TEST_READLINK", 1) +set_configvar("GNULIB_TEST_REALPATH", 1) +set_configvar("GNULIB_TEST_SIGPROCMASK", 1) +set_configvar("GNULIB_TEST_STAT", 1) +set_configvar("GNULIB_TEST_STRERROR", 1) +set_configvar("GNULIB_TEST_STRNLEN", 1) +set_configvar("GNULIB_TEST_WCWIDTH", 1) +set_configvar("GNULIB_UNISTR_U8_MBTOUCR", 1) +set_configvar("GNULIB_UNISTR_U8_UCTOMB", 1) +configvar_check_cincludes("ENABLE_NLS", "libintl.h", {default = 0}) +configvar_check_cincludes("HAVE_DLFCN_H", "dlfcn.h") +configvar_check_cincludes("HAVE_INTTYPES_H", "inttypes.h") +configvar_check_cincludes("HAVE_MACH_O_DYLD_H", "mach-o/dyld.h") +configvar_check_cincludes("HAVE_MEMORY_H", "memory.h") +configvar_check_cincludes("HAVE_STDBOOL_H", "stdbool.h") +configvar_check_cincludes("HAVE_STDINT_H", "stdint.h") +configvar_check_cincludes("HAVE_STDIO_H", "stdio.h") +configvar_check_cincludes("HAVE_STDDEF_H", "stddef.h") +configvar_check_cincludes("HAVE_STDLIB_H", "stdlib.h") +configvar_check_cincludes("HAVE_STRINGS_H", "strings.h") +configvar_check_cincludes("HAVE_STRING_H", "string.h") +configvar_check_cincludes("HAVE_SYS_STAT_H", "sys/stat.h") +configvar_check_cincludes("HAVE_SYS_TYPES_H", "sys/types.h") +configvar_check_cincludes("HAVE_SYS_MMAN_H", "sys/mman.h") +configvar_check_cincludes("HAVE_UNISTD_H", "unistd.h") +configvar_check_cincludes("HAVE_ALLOCA_H", "alloca.h") +configvar_check_cincludes("HAVE_SEARCH_H", "search.h") +configvar_check_cincludes("HAVE_SYS_BITYPES_H", "sys/bitypes.h") +configvar_check_cincludes("HAVE_WCHAR_H", "wchar.h") +configvar_check_cincludes("HAVE_WCTYPE_H", "wctype.h") +configvar_check_cincludes("HAVE_WINSOCK2_H", "winsock2.h") +configvar_check_cincludes("HAVE_CRTDEFS_H", "crtdefs.h") +configvar_check_cincludes("HAVE_BP_SYM_H", "bp-sym.h") +configvar_check_cincludes("HAVE_XLOCALE_H", "xlocale.h") +configvar_check_cfuncs("HAVE__NSGETEXECUTABLEPATH", "_NSGetExecutablePath") +configvar_check_cfuncs("HAVE_MSVC_INVALID_PARAMETER_HANDLER", "_set_invalid_parameter_handler") +configvar_check_cfuncs("HAVE_SETLOCALE", "setlocale", {includes = "locale.h"}) +configvar_check_cfuncs("HAVE_SYMLINK", "symlink", {includes = "unistd.h"}) +configvar_check_cfuncs("GNULIB_FSCANF", "fscanf", {includes = "stdio.h"}) +configvar_check_cfuncs("GNULIB_SCANF", "scanf", {includes = "stdio.h"}) +configvar_check_cfuncs("HAVE_CANONICALIZE_FILE_NAME", "canonicalize_file_name", {includes = "stdlib.h", defines = "_GNU_SOURCE"}) +configvar_check_cfuncs("HAVE_DECL_CLEARERR_UNLOCKED", "clearerr_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_FEOF_UNLOCKED", "feof_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_FERROR_UNLOCKED", "ferror_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_FFLUSH_UNLOCKED", "fflush_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_FGETS_UNLOCKED", "fgets_unlocked", {includes = "stdio.h", defines = "_GNU_SOURCE", default = 0}) +configvar_check_cfuncs("HAVE_DECL_FPUTC_UNLOCKED", "fputc_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_FREAD_UNLOCKED", "fread_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_FWRITE_UNLOCKED", "fwrite_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_GETCHAR_UNLOCKED", "getchar_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_GETC_UNLOCKED", "getc_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_PUTCHAR_UNLOCKED", "putchar_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_PUTC_UNLOCKED", "putc_unlocked", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_SETENV", "setenv", {includes = "stdlib.h", default = 0}) +configvar_check_cfuncs("HAVE_DECL_STRERROR_R", "strerror_r", {includes = "string.h", default = 0}) +configvar_check_cfuncs("HAVE_SETENV", "setenv", {includes = "stdlib.h"}) +configvar_check_cfuncs("HAVE_PUTENV", "putenv", {includes = "stdlib.h"}) +configvar_check_cfuncs("HAVE_GETCWD", "getcwd", {includes = "unistd.h"}) +configvar_check_cfuncs("HAVE_GETEXECNAME", "getexecname", {includes = "stdlib.h"}) +configvar_check_cfuncs("HAVE_GETPROGNAME", "getprogname", {includes = "stdlib.h"}) +configvar_check_cfuncs("HAVE_LSTAT", "lstat", {includes = "sys/stat.h"}) +configvar_check_cfuncs("HAVE_MALLOC_POSIX", "malloc", {includes = "stdlib.h"}) +configvar_check_cfuncs("HAVE_ATEXIT", "atexit", {includes = "stdlib.h"}) +configvar_check_cfuncs("HAVE_MBRTOWC", "mbrtowc", {includes = "wchar.h"}) +configvar_check_cfuncs("HAVE_WCRTOMB", "wcrtomb", {includes = "wchar.h"}) +configvar_check_cfuncs("HAVE_WCSLEN", "wcslen", {includes = "wchar.h"}) +configvar_check_cfuncs("HAVE_WCWIDTH", "wcwidth", {includes = "wchar.h"}) +configvar_check_cfuncs("HAVE_WCSNLEN", "wcsnlen", {includes = "wchar.h"}) +configvar_check_cfuncs("HAVE_MBSINIT", "mbsinit", {includes = "wchar.h"}) +configvar_check_cfuncs("HAVE_BTOWC", "btowc", {includes = "wchar.h"}) +configvar_check_cfuncs("HAVE_ISWBLANK", "iswblank", {includes = "wctype.h"}) +configvar_check_cfuncs("HAVE_ISWCNTRL", "iswcntrl", {includes = "wctype.h"}) +configvar_check_cfuncs("HAVE_RAISE", "raise", {includes = "signal.h"}) +configvar_check_cfuncs("HAVE_READLINK", "readlink", {includes = "unistd.h"}) +configvar_check_cfuncs("HAVE_READLINKAT", "readlinkat", {includes = "unistd.h"}) +configvar_check_cfuncs("HAVE_REALPATH", "realpath", {includes = "stdlib.h"}) +configvar_check_cfuncs("FUNC_REALPATH_WORKS", "realpath", {includes = "stdlib.h"}) +configvar_check_cfuncs("HAVE_STPCPY", "stpcpy", {includes = "string.h"}) +configvar_check_cfuncs("HAVE_STRDUP", "strdup", {includes = "string.h"}) +configvar_check_cfuncs("HAVE_STRTOUL", "strtoul", {includes = "string.h"}) +configvar_check_cfuncs("HAVE_MEMPCPY", "mempcpy", {includes = "string.h", defines = "_GNU_SOURCE"}) +configvar_check_cfuncs("HAVE_MMAP", "mmap", {includes = "sys/mman.h"}) +configvar_check_cfuncs("HAVE_MPROTECT", "mprotect", {includes = "sys/mman.h"}) +configvar_check_cfuncs("HAVE_MUNMAP", "munmap", {includes = "sys/mman.h"}) +configvar_check_ctypes("HAVE_LONG_LONG_INT", "long long int") +configvar_check_ctypes("HAVE_UNSIGNED_LONG_LONG_INT", "unsigned long long int") +configvar_check_ctypes("HAVE__BOOL", "_Bool") +configvar_check_ctypes("HAVE_WCHAR_T", "wchar_t", {includes = "wchar.h"}) +configvar_check_ctypes("HAVE_WINT_T", "wint_t", {includes = "wchar.h"}) +configvar_check_ctypes("HAVE_SIGSET_T", "sigset_t", {includes = "signal.h"}) +configvar_check_macros("HAVE_MSVC_INVALID_PARAMETER_HANDLER", "_MSC_VER") +configvar_check_csnippets("HAVE_VISIBILITY", [[ +extern __attribute__((__visibility__("hidden"))) int hiddenvar; +extern __attribute__((__visibility__("default"))) int exportedvar; +extern __attribute__((__visibility__("hidden"))) int hiddenfunc(void); +extern __attribute__((__visibility__("default"))) int exportedfunc(void);]], {default = 0}) +configvar_check_csnippets("HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC", [[#include +#include +struct stat st; +void test() { st.st_atim.tv_nsec; }]]) +configvar_check_csnippets("TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC", [[#include +#include +#if HAVE_SYS_TIME_H +# include +#endif +#include +struct timespec ts; +struct stat st; +void test() { st.st_atim = ts; }]]) +configvar_check_csnippets("PROGRAM_INVOCATION_NAME", [[#define _GNU_SOURCE +#include +extern char *program_invocation_name;]]) +configvar_check_csnippets("PROGRAM_INVOCATION_SHORT_NAME", [[#define _GNU_SOURCE +#include +extern char *program_invocation_short_name;]]) +configvar_check_csnippets("GNULIB_SIGPIPE", [[#include +#ifndef SIGPIPE +#error SIGPIPE not defined +#endif]]) +configvar_check_csnippets("HAVE_LANGINFO_CODESET", [[#include +int test() { char* cs = nl_langinfo(CODESET); return !cs; }]]) +configvar_check_csnippets("HAVE_ENVIRON_DECL=0", [[extern struct {int foo;} environ; +void test() {environ.foo = 1;}]], {includes = is_plat("windows") and "stdlib.h" or "unistd.h", default = 1}) + +-- config.h variables +if is_plat("windows", "mingw") then + set_configvar("USE_WINDOWS_THREADS", 1) +else +option("USE_ISOC_THREADS") + add_cfuncs("thrd_create") + add_cincludes("threads.h") +option_end() +if has_config("USE_ISOC_THREADS") then + set_configvar("USE_ISOC_AND_POSIX_THREADS", 1) +else + set_configvar("USE_POSIX_THREADS", 1) +end +end +configvar_check_ctypes("HAVE_STDINT_H_WITH_UINTMAX", "uintmax_t", {includes = "stdint.h"}) +configvar_check_ctypes("HAVE_UINTMAX_T", "uintmax_t", {includes = "stdint.h"}) +if is_plat("android") then + configvar_check_cfuncs("HAVE_PTHREAD_API", "pthread_create", {includes = "pthread.h"}) +else + configvar_check_links("HAVE_PTHREAD_API", "pthread") +end +configvar_check_ctypes("HAVE_PTHREAD_RWLOCK", "pthread_rwlock_t", {includes = "pthread.h"}) +configvar_check_cfuncs("HAVE_THRD_CREATE", "thrd_create", {includes = "threads.h"}) +configvar_check_csnippets("HAVE_ALLOCA", [[ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# include +#endif +void test() { char *p = (char *)alloca(1); } +]]) +configvar_check_csnippets("HAVE_C_STATIC_ASSERT", [[ +#include +void test() { + static_assert(sizeof(char) == 1, "sizeof does not work"); + static_assert(sizeof(char) == 1); +} +]]) +configvar_check_csnippets("FLEXIBLE_ARRAY_MEMBER=/**/", [[ +#include +#include +#include +struct m { struct m *next, **list; char name[]; }; +struct s { struct s *p; struct m *m; int n; double d[]; }; +int test() { + int m = getchar(); + size_t nbytes = offsetof(struct s, d) + m * sizeof(double); + nbytes += sizeof(struct s) - 1; + nbytes -= nbytes % sizeof(struct s); + struct s *p = malloc(nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *)NULL; +} +]], {default = 1, quote = false}) +configvar_check_csnippets("HAVE_WORKING_USELOCALE", [[ +#include +locale_t loc1; +void test() { + uselocale(NULL); + setlocale(LC_ALL, "en_US.UTF-8"); +} +]]) +if is_plat("windows") and is_kind("shared") then + set_configvar("WOE32DLL", 1) +end +set_configvar("SETLOCALE_NULL_ALL_MTSAFE", is_plat("windows", "linux") and 1 or 0) +set_configvar("SETLOCALE_NULL_ONE_MTSAFE", 1) +set_configvar("NEED_SETLOCALE_IMPROVED", is_plat("mingw") and 1 or 0) +set_configvar("NEED_SETLOCALE_MTSAFE", is_plat("windows", "linux") and 0 or 1) + +-- search.h variables +set_configvar("GUARD_PREFIX", "GL", {quote = false}) +set_configvar("PRAGMA_SYSTEM_HEADER", "", {quote = false}) +set_configvar("PRAGMA_COLUMNS", "", {quote = false}) +if is_plat("windows") then + set_configvar("INCLUDE_NEXT", "include", {quote = false}) + set_configvar("NEXT_SEARCH_H", "", {quote = false}) +else + set_configvar("INCLUDE_NEXT", "include_next", {quote = false}) + set_configvar("NEXT_SEARCH_H", "", {quote = false}) +end +set_configvar("GNULIB_MDA_LFIND", 1) +set_configvar("GNULIB_MDA_LSEARCH", 1) +configvar_check_ctypes("HAVE_TYPE_VISIT", "VISIT", {includes = "search.h", default = 0}) +option("HAVE_TSEARCH") + add_cfuncs("tsearch") + add_cincludes("search.h") +option_end() +option("HAVE_TWALK") + add_cfuncs("twalk") + add_cincludes("search.h") +option_end() +if has_config("HAVE_TSEARCH") and has_config("HAVE_TWALK") then + set_configvar("HAVE_TSEARCH", 1) + set_configvar("HAVE_TWALK", 1) + set_configvar("REPLACE_TSEARCH", 0) + set_configvar("REPLACE_TWALK", 0) + set_configvar("GNULIB_TSEARCH", 0) +else + set_configvar("tsearch", "_libintl_tsearch", {quote = false}) + set_configvar("tfind", "_libintl_tfind", {quote = false}) + set_configvar("tdelete", "_libintl_tdelete", {quote = false}) + set_configvar("twalk", "_libintl_twalk", {quote = false}) + set_configvar("rpl_tsearch", "_libintl_tsearch", {quote = false}) + set_configvar("rpl_tfind", "_libintl_tfind", {quote = false}) + set_configvar("rpl_tdelete", "_libintl_tdelete", {quote = false}) + set_configvar("rpl_twalk", "_libintl_twalk", {quote = false}) + set_configvar("HAVE_TSEARCH", 0) + set_configvar("HAVE_TWALK", 0) + set_configvar("REPLACE_TSEARCH", 1) + set_configvar("REPLACE_TWALK", 1) + set_configvar("GNULIB_TSEARCH", 1) +end + +-- libgnuintl.h variables +set_configvar("HAVE_NAMELESS_LOCALES", 0) +set_configvar("ENHANCE_LOCALE_FUNCS", 0) +configvar_check_cfuncs("HAVE_NEWLOCALE", "newlocale", {includes = (is_plat("macosx") and "xlocale.h" or "locale.h"), default = 0}) +configvar_check_cfuncs("HAVE_POSIX_PRINTF", "printf", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_WPRINTF", "wprintf", {includes = "wchar.h", default = 0}) +configvar_check_cfuncs("HAVE_SNPRINTF", "snprintf", {includes = "stdio.h", default = 0}) +configvar_check_cfuncs("HAVE_ASPRINTF", "asprintf", {includes = "stdio.h", default = 0}) + +target("intl") + set_kind("$(kind)") + add_defines("HAVE_CONFIG_H", "NO_XMALLOC", "IN_LIBRARY", "IN_LIBINTL") + if is_kind("shared") then + add_defines("BUILDING_LIBINTL", "BUILDING_DLL") + end + if is_plat("windows") then + add_syslinks("advapi32") + end + set_configvar("HAVE_ICONV", 0) + set_configvar("HAVE_ICONV_H", 0) + add_defines("DEPENDS_ON_LIBICONV=0") + set_configdir("gettext-runtime/intl") + add_configfiles("gettext-runtime/intl/(config.h.in)", {filename = "config.h"}) + add_configfiles("gettext-runtime/intl/(libgnuintl.in.h)", {filename = "libgnuintl.h", pattern = "@(.-)@"}) + add_configfiles("gettext-runtime/intl/(export.h)", {filename = "export.h", pattern = "@(.-)@"}) + add_configfiles("gettext-runtime/intl/(gnulib-lib/search.in.h)", {filename = "tsearch.h", pattern = "@(.-)@"}) + add_includedirs("gettext-runtime/intl", "gettext-runtime/intl/gnulib-lib") + add_files("gettext-runtime/intl/bindtextdom.c", + "gettext-runtime/intl/dcigettext.c", + "gettext-runtime/intl/dcngettext.c", + "gettext-runtime/intl/dcgettext.c", + "gettext-runtime/intl/dgettext.c", + "gettext-runtime/intl/dngettext.c", + "gettext-runtime/intl/explodename.c", + "gettext-runtime/intl/finddomain.c", + "gettext-runtime/intl/gettext.c", + "gettext-runtime/intl/hash-string.c", + "gettext-runtime/intl/intl-compat.c", + "gettext-runtime/intl/l10nflist.c", + "gettext-runtime/intl/langprefs.c", + "gettext-runtime/intl/loadmsgcat.c", + "gettext-runtime/intl/localealias.c", + "gettext-runtime/intl/log.c", + "gettext-runtime/intl/ngettext.c", + "gettext-runtime/intl/osdep.c", + "gettext-runtime/intl/plural.c", + "gettext-runtime/intl/plural-exp.c", + "gettext-runtime/intl/printf.c", + "gettext-runtime/intl/setlocale.c", + "gettext-runtime/intl/textdomain.c", + "gettext-runtime/intl/version.c", + "gettext-runtime/intl/gnulib-lib/localename.c", + "gettext-runtime/intl/gnulib-lib/localename-table.c", + "gettext-runtime/intl/gnulib-lib/localcharset.c", + "gettext-runtime/intl/gnulib-lib/relocatable.c", + "gettext-runtime/intl/gnulib-lib/setlocale-lock.c", + "gettext-runtime/intl/gnulib-lib/setlocale_null.c", + "gettext-runtime/intl/gnulib-lib/xsize.c", + "gettext-runtime/intl/gnulib-lib/tsearch.c", + "gettext-runtime/intl/gnulib-lib/glthread/lock.c", + "gettext-runtime/intl/gnulib-lib/glthread/threadlib.c") + if is_plat("windows") then + add_files("gettext-runtime/intl/gnulib-lib/windows-mutex.c", + "gettext-runtime/intl/gnulib-lib/windows-rwlock.c", + "gettext-runtime/intl/gnulib-lib/windows-recmutex.c", + "gettext-runtime/intl/gnulib-lib/windows-once.c") + end + before_build(function (target) + io.gsub("gettext-runtime/intl/gnulib-lib/tsearch.h", "(definitions of _GL_FUNCDECL_RPL etc.-)\n", "%1\n#include \n") + io.gsub("gettext-runtime/intl/gnulib-lib/tsearch.h", "(definition of _GL_ARG_NONNULL.-)\n", "%1\n#include \n") + io.gsub("gettext-runtime/intl/gnulib-lib/tsearch.h", "(definition of _GL_WARN_ON_USE.-)\n", "%1\n#include \n") + io.replace("gettext-runtime/intl/gnulib-lib/tsearch.c", "#include ", "#include ", {plain = true}) + os.cp("gettext-runtime/intl/libgnuintl.h", "gettext-runtime/intl/libintl.h") + local lines = io.readfile("gettext-runtime/intl/export.h") + io.replace("gettext-runtime/intl/libgnuintl.h", "#define _LIBINTL_H 1", "#define _LIBINTL_H 1\n" .. lines, {plain = true}) + io.replace("gettext-runtime/intl/libgnuintl.h", "extern", "extern LIBINTL_DLL_EXPORTED", {plain = true}) + end) + after_install(function (target) + io.replace("gettext-runtime/intl/libintl.h", "extern", (target:is_plat("windows") and target:kind() == "shared") and "extern __declspec(dllimport)" or "extern", {plain = true}) + os.cp("gettext-runtime/intl/libintl.h", path.join(target:installdir(), "include", "libintl.h")) + end) +target_end() diff --git a/packages/l/libintl/xmake.lua b/packages/l/libintl/xmake.lua index a5babc26d..c0aca9b33 100644 --- a/packages/l/libintl/xmake.lua +++ b/packages/l/libintl/xmake.lua @@ -3,18 +3,28 @@ package("libintl") set_homepage("https://www.gnu.org/software/gettext/") set_description("GNU gettext runtime") - add_urls("https://ftp.gnu.org/gnu/gettext/gettext-$(version).tar.xz") + add_urls("https://ftpmirror.gnu.org/gnu/gettext/gettext-$(version).tar.xz", + "https://ftp.gnu.org/gnu/gettext/gettext-$(version).tar.xz") add_versions("0.21", "d20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192") + add_versions("0.22.3", "b838228b3f8823a6c1eddf07297197c4db13f7e1b173b9ef93f3f945a63080b6") if is_plat("windows") then add_syslinks("advapi32") end + on_fetch(function (package, opt) + if opt.system then + return package:find_package("system::intl", {includes = "libintl.h"}) + end + end) + on_install("windows", "macosx", "android", function (package) -- on linux libintl is already a part of libc - os.cp(path.join(os.scriptdir(), "port", "xmake.lua"), "xmake.lua") - io.replace("gettext-runtime/config.h.in", "$", "", {plain = true}) - io.replace("gettext-runtime/config.h.in", "# ?undef (.-)\n", "${define %1}\n") + os.cp(path.join(os.scriptdir(), "port", package:version_str(), "xmake.lua"), "xmake.lua") + for _, conffile in ipairs({"gettext-runtime/config.h.in", "gettext-runtime/intl/config.h.in"}) do + io.replace(conffile, "$", "", {plain = true}) + io.replace(conffile, "# ?undef (.-)\n", "${define %1}\n") + end import("package.tools.xmake").install(package, { vers = package:version_str(), relocatable = true, diff --git a/packages/l/libjpeg-turbo/xmake.lua b/packages/l/libjpeg-turbo/xmake.lua index 168940d59..a89e3beda 100644 --- a/packages/l/libjpeg-turbo/xmake.lua +++ b/packages/l/libjpeg-turbo/xmake.lua @@ -12,22 +12,27 @@ package("libjpeg-turbo") add_versions("2.1.0", "d6b7790927d658108dfd3bee2f0c66a2924c51ee7f9dc930f62c452f4a638c52") add_versions("2.1.1", "20e9cd3e5f517950dfb7a300ad344543d88719c254407ffb5ad88d891bf701c4") add_versions("2.1.2", "e7fdc8a255c45bc8fbd9aa11c1a49c23092fcd7379296aeaeb14d3343a3d1bed") - add_versions("2.1.3", "dbda0c685942aa3ea908496592491e5ec8160d2cf1ec9d5fd5470e50768e7859") - add_versions("2.1.4", "a78b05c0d8427a90eb5b4eb08af25309770c8379592bb0b8a863373128e6143f") + add_versions("2.1.3", "dbda0c685942aa3ea908496592491e5ec8160d2cf1ec9d5fd5470e50768e7859") + add_versions("2.1.4", "a78b05c0d8427a90eb5b4eb08af25309770c8379592bb0b8a863373128e6143f") + add_versions("3.0.1", "5b9bbca2b2a87c6632c821799438d358e27004ab528abf798533c15d50b39f82") add_configs("jpeg", {description = "libjpeg API/ABI emulation target version.", default = "6", type = "string", values = {"6", "7", "8"}}) - if is_subhost("windows") and is_plat("android") then + if is_plat("android") then add_deps("make") end on_load(function (package) - if not package.is_built or package:is_built() then + if package:is_built() then package:add("deps", "cmake", "nasm") end end) on_install("windows", "linux", "macosx", "android", "mingw", function (package) + if package:is_plat("windows") and not package:config("shared") then + io.replace("release/libjpeg.pc.in", "-ljpeg", "-ljpeg-static", {plain = true}) + io.replace("release/libturbojpeg.pc.in", "-lturbojpeg", "-lturbojpeg-static", {plain = true}) + end local configs = {} local jpeg = package:config("jpeg") if jpeg == "7" then @@ -53,7 +58,6 @@ package("libjpeg-turbo") io.replace("CMakeLists.txt", 'message(STATUS "${BITS}-bit build (${CPU_TYPE})")', 'set(CPU_TYPE arm64)\nmessage(STATUS "${BITS}-bit build (${CPU_TYPE})")', {plain = true}) end - table.insert(configs, "-DCMAKE_INSTALL_LIBDIR:PATH=lib") import("package.tools.cmake").install(package, configs) end) diff --git a/packages/l/libjpeg/xmake.lua b/packages/l/libjpeg/xmake.lua index d588a87c2..2b5d83f68 100644 --- a/packages/l/libjpeg/xmake.lua +++ b/packages/l/libjpeg/xmake.lua @@ -11,6 +11,12 @@ package("libjpeg") add_configs("headeronly", {description = "Install headerfiles only.", default = false, type = "boolean"}) + if is_plat("linux") then + add_extsources("apt::libjpeg-dev") + elseif is_plat("macosx") then + add_extsources("brew::jpeg/libjpeg") + end + on_install(function (package) io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") diff --git a/packages/l/libkmod/patches/31/basename.patch b/packages/l/libkmod/patches/31/basename.patch new file mode 100644 index 000000000..d384ced90 --- /dev/null +++ b/packages/l/libkmod/patches/31/basename.patch @@ -0,0 +1,54 @@ +diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c +index e83621b..8aa555a 100644 +--- a/libkmod/libkmod-config.c ++++ b/libkmod/libkmod-config.c +@@ -794,7 +794,7 @@ static int conf_files_insert_sorted(struct kmod_ctx *ctx, + bool is_single = false; + + if (name == NULL) { +- name = basename(path); ++ name = gnu_basename(path); + is_single = true; + } + +diff --git a/shared/util.c b/shared/util.c +index e2bab83..0e16670 100644 +--- a/shared/util.c ++++ b/shared/util.c +@@ -172,9 +172,9 @@ char *modname_normalize(const char *modname, char buf[static PATH_MAX], size_t * + + char *path_to_modname(const char *path, char buf[static PATH_MAX], size_t *len) + { +- char *modname; ++ const char *modname; + +- modname = basename(path); ++ modname = gnu_basename(path); + if (modname == NULL || modname[0] == '\0') + return NULL; + +diff --git a/shared/util.h b/shared/util.h +index c4a3916..073dc5a 100644 +--- a/shared/util.h ++++ b/shared/util.h +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -76,6 +77,12 @@ do { \ + __p->__v = (val); \ + } while(0) + ++static _always_inline_ const char *gnu_basename(const char *s) ++{ ++ const char *p = strrchr(s, '/'); ++ return p ? p+1 : s; ++} ++ + static _always_inline_ unsigned int ALIGN_POWER2(unsigned int u) + { + return 1 << ((sizeof(u) * 8) - __builtin_clz(u - 1)); diff --git a/packages/l/libkmod/xmake.lua b/packages/l/libkmod/xmake.lua index 8f4458f90..4f79b63f0 100644 --- a/packages/l/libkmod/xmake.lua +++ b/packages/l/libkmod/xmake.lua @@ -5,18 +5,17 @@ package("libkmod") add_urls("https://github.com/kmod-project/kmod/archive/refs/tags/$(version).tar.gz", "https://github.com/kmod-project/kmod.git") + + add_versions("v31", "16c40aaa50fc953035b4811b29ce3182f220e95f3c9e5eacb4b07b1abf85f003") add_versions("v30", "1fa3974abd80b992d61324bcc04fa65ea96cfe2e9e1150f48394833030c4b583") + add_patches("31", path.join(os.scriptdir(), "patches", "31", "basename.patch"), "83d07e169882cc91f3af162912ae97cd4b62ff48876ca83b0317c40a388773ad") + on_install("linux", "android", function (package) os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") os.cp(path.join(package:scriptdir(), "port", "config.h"), "config.h") os.cp(path.join(package:scriptdir(), "port", "endian-darwin.h"), "endian-darwin.h") - - local configs = {} - if package:config("shared") then - configs.kind = "shared" - end - import("package.tools.xmake").install(package, configs) + import("package.tools.xmake").install(package) end) on_test(function (package) diff --git a/packages/l/libmetalink/port/config.h.in b/packages/l/libmetalink/port/config.h.in new file mode 100644 index 000000000..bdf2c71cd --- /dev/null +++ b/packages/l/libmetalink/port/config.h.in @@ -0,0 +1,4 @@ +${define HAVE_INTTYPES_H} +${define HAVE_MALLOC_H} +${define HAVE_ALLOCA_H} +${define HAVE_TIME64_H} \ No newline at end of file diff --git a/packages/l/libmetalink/port/unistd.h b/packages/l/libmetalink/port/unistd.h new file mode 100644 index 000000000..7cddfd65d --- /dev/null +++ b/packages/l/libmetalink/port/unistd.h @@ -0,0 +1,4 @@ +#ifdef _MSC_VER +#include +typedef SSIZE_T ssize_t; +#endif \ No newline at end of file diff --git a/packages/l/libmetalink/port/xmake.lua b/packages/l/libmetalink/port/xmake.lua new file mode 100644 index 000000000..feb8ef80f --- /dev/null +++ b/packages/l/libmetalink/port/xmake.lua @@ -0,0 +1,69 @@ +set_project("libmetalink") + +option("version", {showmenu = true, default = "0.1.3"}) + +set_version(get_config("version")) + +add_rules("mode.debug", "mode.release") + +add_requires("expat") +add_packages("expat") + +includes("@builtin/check") + +configvar_check_cfuncs("HAVE_MALLOC_H", "malloc", {includes = "malloc.h"}) + +configvar_check_cincludes("HAVE_INTTYPES_H", "inttypes.h") +configvar_check_cincludes("HAVE_ALLOCA_H", "alloca.h") +configvar_check_cincludes("HAVE_TIME64_H", "time64.h") + +target("metalink") + set_kind("$(kind)") + add_files("lib/metalink_*.c", "lib/libexpat_metalink_parser.c") + + add_includedirs("lib/includes") + add_headerfiles("lib/includes/(**.h)") + + add_defines("HAVE_CONFIG_H") + add_includedirs(os.projectdir()) + set_configdir(os.projectdir()) + add_configfiles("config.h.in") + add_configfiles("lib/includes/metalink/metalinkver.h.in", {prefixdir = "metalink", pattern = "@(.-)@"}) + add_headerfiles("(metalink/metalinkver.h)") + + if is_plat("windows") then + add_defines("strncasecmp=_strnicmp") + add_defines("tzname=_tzname") + if is_kind("shared") then + add_rules("utils.symbols.export_all") + end + end + + on_config(function (target) + import("core.base.semver") + + local version = get_config("version") + if version then + version = semver.new(version) + local major = version:major() + local minor = version:minor() + local patch = version:patch() + target:set("configvar", "MAJOR_VERSION", major) + target:set("configvar", "MINOR_VERSION", minor) + target:set("configvar", "PATCH_VERSION", patch) + target:set("configvar", "PACKAGE_VERSION", get_config("version")) + target:set("configvar", "NUMBER_VERSION", format("0x%02x%02x%02x", tonumber(major), tonumber(minor), tonumber(patch))) + end + + if target:has_cfuncs("timegm", {includes = "time.h"}) then + target:add("defines", "HAVE_TIMEGM") + else + target:add("files", path.join(os.projectdir(), "lib/timegm.c")) + end + + if target:has_cfuncs("strptime", {includes = "time.h"}) then + target:add("defines", "HAVE_STRPTIME") + else + target:add("files", path.join(os.projectdir(), "lib/strptime.c")) + end + end) diff --git a/packages/l/libmetalink/xmake.lua b/packages/l/libmetalink/xmake.lua new file mode 100644 index 000000000..78265bea8 --- /dev/null +++ b/packages/l/libmetalink/xmake.lua @@ -0,0 +1,23 @@ +package("libmetalink") + set_homepage("https://github.com/metalink-dev/libmetalink") + set_description("C library to read Metalink XML download description format") + set_license("MIT") + + add_urls("https://github.com/metalink-dev/libmetalink.git") + + add_versions("2015.07.07", "5bcdfc0572fccc2b7bde32693f0dddb6ca040549") + + add_deps("expat") + + on_install("windows", "linux", "macosx", "android", "mingw", "cross", function (package) + if package:is_plat("windows") then + os.cp(path.join(package:scriptdir(), "port", "unistd.h"), "unistd.h") + end + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + os.cp(path.join(package:scriptdir(), "port", "config.h.in"), "config.h.in") + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("metalink_get_version", {includes = "metalink/metalink.h"})) + end) diff --git a/packages/l/libmorton/xmake.lua b/packages/l/libmorton/xmake.lua new file mode 100644 index 000000000..827114b22 --- /dev/null +++ b/packages/l/libmorton/xmake.lua @@ -0,0 +1,25 @@ +package("libmorton") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/Forceflow/libmorton") + set_description("C++ header-only library with methods to efficiently encode/decode Morton codes in/from 2D/3D coordinates") + set_license("MIT") + + add_urls("https://github.com/Forceflow/libmorton/archive/refs/tags/$(version).tar.gz", + "https://github.com/Forceflow/libmorton.git") + + add_versions("v0.2.12", "48ec3e4ad1d9348052dcb64bff012ff95db226da3fec5522ae6e674fabbd686f") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package, {"-DBUILD_TESTING=OFF"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + libmorton::morton2D_32_encode(0, 0); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/l/libmspack/xmake.lua b/packages/l/libmspack/xmake.lua index 9cb9a2114..5f4b7a4dc 100644 --- a/packages/l/libmspack/xmake.lua +++ b/packages/l/libmspack/xmake.lua @@ -6,6 +6,7 @@ package("libmspack") add_urls("https://github.com/kyz/libmspack/archive/refs/tags/$(version).zip", "https://github.com/kyz/libmspack.git") + add_versions("v1.11", "88f8395ff4630d600a0973d7c8c011c21877b80439be5d6cc840afd02f54da20") add_versions("v0.10.1alpha", "d51e3b0d42afef91939fb282f7712e0b81c243ffe0aaacafc977d384408b4ab1") on_install("windows", "macosx", "linux", function (package) diff --git a/packages/l/libnet/xmake.lua b/packages/l/libnet/xmake.lua new file mode 100644 index 000000000..b4d37632b --- /dev/null +++ b/packages/l/libnet/xmake.lua @@ -0,0 +1,27 @@ +package("libnet") + set_homepage("https://codedocs.xyz/libnet/libnet/") + set_description("A portable framework for low-level network packet construction") + + add_urls("https://github.com/libnet/libnet/releases/download/$(version).tar.gz", {version = function (version) + return version .. "/libnet-" .. (version:gsub("v", "")) + end}) + add_urls("https://github.com/libnet/libnet.git") + + add_versions("v1.3", "ad1e2dd9b500c58ee462acd839d0a0ea9a2b9248a1287840bc601e774fb6b28f") + + on_load(function (package) + if package:gitref() then + package:add("deps", "automake", "autoconf", "libtool") + end + end) + + on_install("linux", "macosx", "bsd", function (package) + local configs = {} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("libnet_init", {includes = "libnet.h"})) + end) diff --git a/packages/l/libnpy/xmake.lua b/packages/l/libnpy/xmake.lua new file mode 100644 index 000000000..0bf192249 --- /dev/null +++ b/packages/l/libnpy/xmake.lua @@ -0,0 +1,27 @@ +package("libnpy") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/llohse/libnpy") + set_description("C++ library for reading and writing of numpy's .npy files") + set_license("MIT") + + add_urls("https://github.com/llohse/libnpy/archive/refs/tags/$(version).tar.gz", + "https://github.com/llohse/libnpy.git") + + add_versions("v1.0.1", "43452a4db1e8c1df606c64376ea1e32789124051d7640e7e4e8518ab4f0fba44") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include + void test() { + const std::string path {"data.npy"}; + npy::npy_data d = npy::read_npy(path); + std::vector data = d.data; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/l/libntl/xmake.lua b/packages/l/libntl/xmake.lua new file mode 100644 index 000000000..a00126500 --- /dev/null +++ b/packages/l/libntl/xmake.lua @@ -0,0 +1,61 @@ +package("libntl") + + set_homepage("https://libntl.org/") + set_description("NTL: A Library for doing Number Theory") + set_license("LGPL-2.1") + + add_urls("https://github.com/libntl/ntl/archive/refs/tags/$(version).tar.gz", + "https://github.com/libntl/ntl.git") + add_versions("v11.5.1", "ef578fa8b6c0c64edd1183c4c303b534468b58dd3eb8df8c9a5633f984888de5") + + add_deps("gmp") + + on_install("macosx|native", "linux|native", function (package) + local gmp = package:dep("gmp") + local gmp_prefix = ""; + if gmp and not gmp:is_system() then + gmp_prefix = gmp:installdir() + end + + local compiler = package:build_getenv("cxx") + if package:is_plat("macosx") then + local cc = package:build_getenv("ld") + if cc and cc:find("clang", 1, true) and cc:find("Xcode", 1, true) then + compiler = "xcrun --sdk macosx clang++" + end + end + compiler = compiler:gsub("gcc$", "g++") + compiler = compiler:gsub("clang$", "clang++") + + os.cd("src") + os.vrunv("./configure", { + "CXX=" .. compiler, + "CXXFLAGS=" .. table.concat(table.wrap(package:build_getenv("cxxflags")), " "), + "AR=" .. (package:build_getenv("ar") or "ar"), + "ARFLAGS=" .. table.concat(table.wrap(package:build_getenv("arflags") or "ruv"), " "), + "RANLIB=" .. (package:build_getenv("ranlib") or "ranlib"), + "LDFLAGS=" .. table.concat(table.wrap(package:build_getenv("ldflags")), " "), + "CPPFLAGS=" .. table.concat(table.wrap(package:build_getenv("cppflags")), " "), + "PREFIX=" .. package:installdir(), + "GMP_PREFIX=" .. gmp_prefix, + "SHARED=" .. (package:config("shared") and "on" or "off") + }, {shell = true}) + os.vrunv("make", {}) + os.vrunv("make", {"install"}) + if package:config("shared") then + os.rm(path.join(package:installdir(), "lib", "libntl.a")) + end + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include + void test() { + NTL::ZZ a{2}, b{3}, c; + c = (a + 1) * (b + 1); + std::cout << c << std::endl; + } + ]]}, {configs = {languages = "cxx11"}})) + end) diff --git a/packages/l/liboai/xmake.lua b/packages/l/liboai/xmake.lua index 6c1d183c4..89be46927 100644 --- a/packages/l/liboai/xmake.lua +++ b/packages/l/liboai/xmake.lua @@ -6,6 +6,8 @@ package("liboai") set_urls("https://github.com/D7EAD/liboai/archive/refs/tags/v$(version).tar.gz", "https://github.com/D7EAD/liboai.git") + add_versions("4.0.1", "abe127ae1cd3049f19976e31d8414e8130a73d7978552e863b767fe04b20697f") + add_versions("3.2.1", "9058bcc1485967061c9c33b2e7a109a254cdf71638b1448f21cfefd7ffd9c4fa") add_versions("3.1.0", "4b3564740f7dbf099c785d5720327a4e7acaca2535d329f487d877ce17524a73") add_deps("nlohmann_json") diff --git a/packages/l/libogg/xmake.lua b/packages/l/libogg/xmake.lua index 6751fac28..14506a273 100644 --- a/packages/l/libogg/xmake.lua +++ b/packages/l/libogg/xmake.lua @@ -6,7 +6,7 @@ package("libogg") set_urls("https://gitlab.xiph.org/xiph/ogg/-/archive/$(version)/ogg-$(version).tar.gz", "https://gitlab.xiph.org/xiph/ogg.git") add_versions("v1.3.4", "62cc64b9fd3cf57bde3a9033e94534ba34313d2bb9698029f623121a4e47bb9b") - add_patches("v1.3.4", path.join(os.scriptdir(), "patches", "1.3.4", "macos_fix.patch"), "e12c41ad71206777f399c1048914e5e5a2fe44e18d0d50ebe9bedbfbe0624c35") + add_patches("v1.3.4", "patches/1.3.4/macos_fix.patch", "e12c41ad71206777f399c1048914e5e5a2fe44e18d0d50ebe9bedbfbe0624c35") add_deps("cmake") if is_plat("cross") and is_subhost("windows") then diff --git a/packages/l/libomp/xmake.lua b/packages/l/libomp/xmake.lua index 942fac29e..58733d37a 100644 --- a/packages/l/libomp/xmake.lua +++ b/packages/l/libomp/xmake.lua @@ -12,7 +12,7 @@ package("libomp") on_fetch("macosx", "linux", function (package, opt) if opt.system then - return package:find_package("system::omp", {includes = "omp.h"}) + return package:find_package("system::omp", {includes = "omp.h"}) or package:find_package("system::omp5", {includes = "omp.h"}) end end) diff --git a/packages/l/libopus/xmake.lua b/packages/l/libopus/xmake.lua index 05eb6651c..68dc0ef94 100644 --- a/packages/l/libopus/xmake.lua +++ b/packages/l/libopus/xmake.lua @@ -3,12 +3,21 @@ package("libopus") set_homepage("https://opus-codec.org") set_description("Modern audio compression for the internet.") - set_urls("https://gitlab.xiph.org/xiph/opus/-/archive/v$(version)/opus-v$(version).tar.gz", - "https://gitlab.xiph.org/xiph/opus.git", - "https://github.com/xiph/opus.git") - - add_versions("1.4", "cf7c31577c384e1dc17a6f57e8460e520d135ab9e0b9068543dd657e25e7da1f") - add_versions("1.3.1", "a4ef56e2c8fce5dba63f6db1f671e3fa5b18299d953975b6636fee211ddc882a") + add_urls("https://downloads.xiph.org/releases/opus/opus-$(version).tar.gz", + {alias = "home"}) + add_urls("https://github.com/xiph/opus/archive/refs/tags/v$(version).tar.gz", + "https://github.com/xiph/opus.git", + {alias = "github"}) + + add_versions("home:1.5.1", "b84610959b8d417b611aa12a22565e0a3732097c6389d19098d844543e340f85") + add_versions("home:1.5", "d8230bbeb99e6d558645aaad25d79de8f4f28fdcc55f8af230050586d62c4f2c") + add_versions("home:1.4", "c9b32b4253be5ae63d1ff16eea06b94b5f0f2951b7a02aceef58e3a3ce49c51f") + add_versions("home:1.3.1", "65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d") + + add_versions("github:1.5.1", "7ce44ef3d335a3268f26be7d53bb3bed7205b34eaf80bf92a99e69d490afe9d9") + add_versions("github:1.5", "d7de528957dde0ba40e9dec9e25b679232bfaf19fb6a02ed8358845007d7075e") + add_versions("github:1.4", "659e6b223e42a51b0a898632b9a5f406ccd5c2e00aa526ddd1264789774b94e5") + add_versions("github:1.3.1", "4834a8944c33a7ecab5cad9454eeabe4680ca1842cb8f5a2437572dbf636de8f") add_patches("1.3.1", path.join(os.scriptdir(), "patches", "1.3.1", "cmake.patch"), "79fba5086d7747d0441f7f156b88e932b662e2d2ccd825279a5a396a2840d3a2") add_configs("avx", { description = "AVX supported", default = true, type = "boolean" }) diff --git a/packages/l/libpng/xmake.lua b/packages/l/libpng/xmake.lua index 2283ad255..2e2597ea0 100644 --- a/packages/l/libpng/xmake.lua +++ b/packages/l/libpng/xmake.lua @@ -4,11 +4,10 @@ package("libpng") set_license("libpng-2.0") add_urls("https://github.com/glennrp/libpng/archive/refs/tags/$(version).tar.gz") - add_urls("https://mirrors.ustc.edu.cn/debian/pool/main/libp/libpng1.6/libpng1.6_$(version).orig.tar.gz", { - version = function (version) return version:sub(2) end - }) add_urls("https://github.com/glennrp/libpng.git") + add_versions("v1.6.43", "fecc95b46cf05e8e3fc8a414750e0ba5aad00d89e9fdf175e94ff041caf1a03a") + add_versions("v1.6.42", "fe89de292e223829859d21990d9c4d6b7e30e295a268f6a53a022611aa98bd67") add_versions("v1.6.40", "62d25af25e636454b005c93cae51ddcd5383c40fa14aa3dae8f6576feb5692c2") add_versions("v1.6.37", "ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307") add_versions("v1.6.36", "5bef5a850a9255365a2dc344671b7e9ef810de491bd479c2506ac3c337e2d84f") @@ -29,7 +28,7 @@ package("libpng") add_extsources("brew::libpng") end - on_install("windows", "mingw", "android", "iphoneos", "cross", "bsd", "wasm", function (package) + on_install(function (package) io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") add_requires("zlib") @@ -63,11 +62,6 @@ package("libpng") end ]]) local configs = {} - if package:config("shared") then - configs.kind = "shared" - elseif not package:is_plat("windows", "mingw") and package:config("pic") ~= false then - configs.cxflags = "-fPIC" - end if package:is_plat("android") and package:is_arch("armeabi-v7a") then io.replace("arm/filter_neon.S", ".func", ".hidden", {plain = true}) io.replace("arm/filter_neon.S", ".endfunc", "", {plain = true}) @@ -76,29 +70,6 @@ package("libpng") import("package.tools.xmake").install(package, configs) end) - on_install("macosx", "linux", function (package) - local configs = {} - table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) - table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) - if package:config("pic") ~= false then - table.insert(configs, "--with-pic") - end - local cppflags = {} - local ldflags = {} - for _, dep in ipairs(package:orderdeps()) do - local fetchinfo = dep:fetch() - if fetchinfo then - for _, includedir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do - table.insert(cppflags, "-I" .. includedir) - end - for _, linkdir in ipairs(fetchinfo.linkdirs) do - table.insert(ldflags, "-L" .. linkdir) - end - end - end - import("package.tools.autoconf").install(package, configs, {cppflags = cppflags, ldflags = ldflags}) - end) - on_test(function (package) assert(package:has_cfuncs("png_create_read_struct", {includes = "png.h"})) end) diff --git a/packages/l/libpsl/xmake.lua b/packages/l/libpsl/xmake.lua index 903df0201..7a6727a03 100644 --- a/packages/l/libpsl/xmake.lua +++ b/packages/l/libpsl/xmake.lua @@ -1,16 +1,20 @@ package("libpsl") - set_homepage("https://github.com/rockdaboot/libpsl") set_description("C library to handle the Public Suffix List") set_license("MIT") - add_urls("https://github.com/rockdaboot/libpsl/releases/download/$(version)/libpsl-$(version).tar.gz") + add_urls("https://github.com/rockdaboot/libpsl/releases/download/$(version)/libpsl-$(version).tar.gz", + "https://github.com/rockdaboot/libpsl.git") + + add_versions("0.21.5", "1dcc9ceae8b128f3c0b3f654decd0e1e891afc6ff81098f227ef260449dae208") add_versions("0.21.1", "ac6ce1e1fbd4d0254c4ddb9d37f1fa99dec83619c1253328155206b896210d4c") - add_deps("meson", "ninja") if is_plat("windows", "mingw") then add_syslinks("ws2_32") end + + add_deps("meson", "ninja") + on_load("windows", function (package) if not package:config("shared") then package:add("defines", "PSL_STATIC") @@ -18,12 +22,19 @@ package("libpsl") end) on_install("windows", "macosx", "linux", "mingw", function (package) - io.replace("meson.build", "subdir('tests')", "", {plain = true}) - io.replace("meson.build", "subdir('fuzz')", "", {plain = true}) - if package:is_plat("windows") and not package:config("shared") then - io.replace("tools/meson.build", "'-DHAVE_CONFIG_H'", "'-DHAVE_CONFIG_H','-DPSL_STATIC'", {plain = true}) + local configs = {"-Druntime=no"} + if package:version():ge("0.21.5") then + table.insert(configs, "-Dbuiltin=false") + table.insert(configs, "-Dtests=false") + else + io.replace("meson.build", "subdir('tests')", "", {plain = true}) + io.replace("meson.build", "subdir('fuzz')", "", {plain = true}) + if package:is_plat("windows") and not package:config("shared") then + io.replace("tools/meson.build", "'-DHAVE_CONFIG_H'", "'-DHAVE_CONFIG_H','-DPSL_STATIC'", {plain = true}) + end + table.insert(configs, "-Dbuiltin=no") end - local configs = {"-Druntime=no", "-Dbuiltin=no"} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) import("package.tools.meson").install(package, configs) end) diff --git a/packages/l/libpthread-stubs/xmake.lua b/packages/l/libpthread-stubs/xmake.lua index 2bff6e303..c40662862 100644 --- a/packages/l/libpthread-stubs/xmake.lua +++ b/packages/l/libpthread-stubs/xmake.lua @@ -3,8 +3,10 @@ package("libpthread-stubs") set_homepage("https://www.x.org/") set_description("X.Org: pthread-stubs.pc") - set_urls("https://xcb.freedesktop.org/dist/libpthread-stubs-$(version).tar.bz2") - add_versions("0.4", "e4d05911a3165d3b18321cc067fdd2f023f06436e391c6a28dff618a78d2e733") + add_urls("https://xcb.freedesktop.org/dist/libpthread-stubs-$(version).tar.gz", + "https://www.x.org/archive/individual/lib/libpthread-stubs-$(version).tar.gz") + add_versions("0.4", "50d5686b79019ccea08bcbd7b02fe5a40634abcfd4146b6e75c6420cc170e9d9") + add_versions("0.5", "593196cc746173d1e25cb54a93a87fd749952df68699aab7e02c085530e87747") add_deps("pkg-config") diff --git a/packages/l/libqrencode/xmake.lua b/packages/l/libqrencode/xmake.lua new file mode 100644 index 000000000..6eec059ac --- /dev/null +++ b/packages/l/libqrencode/xmake.lua @@ -0,0 +1,21 @@ +package("libqrencode") + set_homepage("https://github.com/fukuchi/libqrencode") + set_description("A fast and compact QR Code encoding library") + set_license("LGPL-2.1") + + add_urls("https://github.com/fukuchi/libqrencode/archive/refs/tags/v$(version).zip") + add_versions("4.1.1", "5ebf5f71fefda8e58e713e821f956759b38b9178ce455df7444e17f5c99e1b19") + + add_deps("cmake") + add_deps("libpng") + + on_install(function (package) + local configs = {"-DWITH_TOOLS=OFF", "-DBUILD_TESTING=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("QRinput_append", {includes = "qrencode.h"})) + end) diff --git a/packages/l/libredwg/xmake.lua b/packages/l/libredwg/xmake.lua new file mode 100644 index 000000000..9e20e3a9d --- /dev/null +++ b/packages/l/libredwg/xmake.lua @@ -0,0 +1,19 @@ +package("libredwg") + set_homepage("https://github.com/LibreDWG/libredwg") + set_description("A library to allow reading data from a DWG file.") + + add_urls("https://github.com/LibreDWG/libredwg.git") + add_versions("0.13.3", "97c7225596c17430b82fd0161e7eff6beb5b1034") + + add_deps("cmake") + + on_install("windows", "linux", function (package) + local configs = {"-DBUILD_TESTING=OFF", "-DDISABLE_WERROR=ON"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("dwg_rgb_palette_index", {includes = "dwg.h"})) + end) diff --git a/packages/l/libremidi/xmake.lua b/packages/l/libremidi/xmake.lua index 36b42e57d..a09f3f2f2 100644 --- a/packages/l/libremidi/xmake.lua +++ b/packages/l/libremidi/xmake.lua @@ -6,6 +6,7 @@ package("libremidi") add_urls("https://github.com/jcelerier/libremidi/archive/refs/tags/$(version).tar.gz", "https://github.com/jcelerier/libremidi.git") + add_versions("v4.5.0", "2e884a4c826dd87157ee4fab8cd8c7b9dbbc1ddb804cb10ef0852094200724db") add_versions("v3.0", "133b40396ca72e35d94cb0950199c9d123352951e4705971a9cd7606f905328a") add_configs("header_only", {description = "Use header only version.", default = false, type = "boolean"}) @@ -27,7 +28,7 @@ package("libremidi") on_load(function (package) if package:config("header_only") then - package:set("library", {headeronly = true}) + package:set("kind", "library", {headeronly = true}) package:add("defines", "LIBREMIDI_HEADER_ONLY=1") if package:config("jack") then package:add("defines", "LIBREMIDI_JACK=1") @@ -66,14 +67,24 @@ package("libremidi") end) on_test(function (package) - -- TODO: v4 version will break api - assert(package:check_cxxsnippets({test = [[ - #include - void test() { - libremidi::midi_in midi; - for (int i = 0, N = midi.get_port_count(); i < N; i++) { - std::string name = midi.get_port_name(i); + local code + if package:version():lt("4.0.0") then + code = [[ + void test() { + libremidi::midi_in midi; + for (int i = 0, N = midi.get_port_count(); i < N; i++) { + std::string name = midi.get_port_name(i); + } } - } - ]]}, {configs = {languages = "c++20"}})) + ]] + else + code = [[ + void test() { + libremidi::observer obs; + for(const libremidi::input_port& port : obs.get_input_ports()) {} + } + ]] + end + + assert(package:check_cxxsnippets({test = code}, {configs = {languages = "c++20"}, includes = {"libremidi/libremidi.hpp"}})) end) diff --git a/packages/l/libressl/xmake.lua b/packages/l/libressl/xmake.lua index b04f0fb00..88d987594 100644 --- a/packages/l/libressl/xmake.lua +++ b/packages/l/libressl/xmake.lua @@ -6,6 +6,7 @@ package("libressl") add_urls("https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$(version).tar.gz") add_versions("3.4.2", "cb82ca7d547336917352fbd23db2fc483c6c44d35157b32780214ec74197b3ce") add_versions("3.7.3", "7948c856a90c825bd7268b6f85674a8dcd254bae42e221781b24e3f8dc335db3") + add_versions("3.8.2", "6d4b8d5bbb25a1f8336639e56ec5088052d43a95256697a85c4ce91323c25954") if is_plat("windows") then add_deps("cmake") diff --git a/packages/l/libsais/xmake.lua b/packages/l/libsais/xmake.lua index 2945f4587..6f7e3779a 100644 --- a/packages/l/libsais/xmake.lua +++ b/packages/l/libsais/xmake.lua @@ -5,6 +5,11 @@ package("libsais") add_urls("https://github.com/IlyaGrebnov/libsais/archive/refs/tags/$(version).tar.gz", "https://github.com/IlyaGrebnov/libsais.git") + add_versions("v2.8.2", "a17918936d6231cf6b019629d65ad7170f889bab5eb46c09b775dede7d890502") + add_versions("v2.8.1", "01852e93305fe197d8f2ffdc32a856e78d6796aa3f40708325084c55b450747a") + add_versions("v2.8.0", "71f608d1e2a28652e66076f42becc3bbd3e0c8a21ba11a4de226a51459e894a9") + add_versions("v2.7.5", "613c597b64fb096738d4084e0f2eb3b490aded7295cffc7fb23bdccc30097ebf") + add_versions("v2.7.3", "45d37dc12975c4d40db786f322cd6dcfd9f56a8f23741205fcd0fca6ec0bf246") add_versions("v2.7.1", "5f459ad90cd007c30aaefb7d122bba2a4307ea02915c56381be4b331cca92545") on_install(function (package) @@ -14,6 +19,8 @@ package("libsais") target("libsais") set_kind("$(kind)") add_files("src/*.c") + add_includedirs("include") + add_headerfiles("include/(*.h)") add_headerfiles("src/(*.h)") ]]) if package:config("shared") then diff --git a/packages/l/libsdl/patches/2.30.0/fix_mingw.patch b/packages/l/libsdl/patches/2.30.0/fix_mingw.patch new file mode 100644 index 000000000..9a7847fab --- /dev/null +++ b/packages/l/libsdl/patches/2.30.0/fix_mingw.patch @@ -0,0 +1,69 @@ +From 6a83588fdda0f70465ecd8b0231e753f434abeb1 Mon Sep 17 00:00:00 2001 +From: Sam Lantinga +Date: Fri, 9 Feb 2024 01:26:45 -0800 +Subject: [PATCH] Redefine XINPUT_CAPABILITIES_EX as an SDL typedef + +mingw-w64 has added this from Proton (which added this from SDL), so we need to re-define it as a local symbol to avoid conflicting with mingw-w64 headers. + +Fixes https://github.com/libsdl-org/SDL/issues/9031 + +(cherry picked from commit b7c61569f899982338bff0d5b9d35bd6d83485d3) +(cherry picked from commit 93d7b6e50c3f625a86c2443deffc334cf0eda832) +--- + src/core/windows/SDL_xinput.h | 6 +++--- + src/joystick/windows/SDL_xinputjoystick.c | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/core/windows/SDL_xinput.h b/src/core/windows/SDL_xinput.h +index 396afcde7dd01..efdb86282e10c 100644 +--- a/src/core/windows/SDL_xinput.h ++++ b/src/core/windows/SDL_xinput.h +@@ -212,7 +212,7 @@ typedef struct + #endif /* HAVE_XINPUT_H */ + + /* This struct is not defined in XInput headers. */ +-typedef struct _XINPUT_CAPABILITIES_EX ++typedef struct + { + XINPUT_CAPABILITIES Capabilities; + WORD VendorId; +@@ -220,7 +220,7 @@ typedef struct _XINPUT_CAPABILITIES_EX + WORD ProductVersion; + WORD unk1; + DWORD unk2; +-} XINPUT_CAPABILITIES_EX, *PXINPUT_CAPABILITIES_EX; ++} SDL_XINPUT_CAPABILITIES_EX; + + /* Forward decl's for XInput API's we load dynamically and use if available */ + typedef DWORD(WINAPI *XInputGetState_t)( +@@ -244,7 +244,7 @@ typedef DWORD(WINAPI *XInputGetCapabilitiesEx_t)( + DWORD dwReserved, /* [in] Must be 1 */ + DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ + DWORD dwFlags, /* [in] Input flags that identify the device type */ +- XINPUT_CAPABILITIES_EX *pCapabilitiesEx /* [out] Receives the capabilities */ ++ SDL_XINPUT_CAPABILITIES_EX *pCapabilitiesEx /* [out] Receives the capabilities */ + ); + + typedef DWORD(WINAPI *XInputGetBatteryInformation_t)( +diff --git a/src/joystick/windows/SDL_xinputjoystick.c b/src/joystick/windows/SDL_xinputjoystick.c +index 3a2e912ca381b..1ae7fb489957e 100644 +--- a/src/joystick/windows/SDL_xinputjoystick.c ++++ b/src/joystick/windows/SDL_xinputjoystick.c +@@ -117,7 +117,7 @@ static const char *GetXInputName(const Uint8 userid, BYTE SubType) + + static SDL_bool GetXInputDeviceInfo(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Uint16 *pVersion) + { +- XINPUT_CAPABILITIES_EX capabilities; ++ SDL_XINPUT_CAPABILITIES_EX capabilities; + + if (!XINPUTGETCAPABILITIESEX || XINPUTGETCAPABILITIESEX(1, userid, 0, &capabilities) != ERROR_SUCCESS) { + return SDL_FALSE; +@@ -143,7 +143,7 @@ static SDL_bool GetXInputDeviceInfo(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Ui + + int SDL_XINPUT_GetSteamVirtualGamepadSlot(Uint8 userid) + { +- XINPUT_CAPABILITIES_EX capabilities; ++ SDL_XINPUT_CAPABILITIES_EX capabilities; + + if (XINPUTGETCAPABILITIESEX && + XINPUTGETCAPABILITIESEX(1, userid, 0, &capabilities) == ERROR_SUCCESS && diff --git a/packages/l/libsdl/xmake.lua b/packages/l/libsdl/xmake.lua index 7062a4600..134235118 100644 --- a/packages/l/libsdl/xmake.lua +++ b/packages/l/libsdl/xmake.lua @@ -34,6 +34,12 @@ package("libsdl") add_versions("archive:2.28.1", "b34b6f5a4d38191491724698a62241f0264c8a56c7d550fd49d1daf49261ae46") add_versions("archive:2.28.2", "22383a6b242bac072f949d2b3854cf04c6856cae7a87eaa78c60dd733b71e41e") add_versions("archive:2.28.3", "2308d4e4cd5852b3b81934dcc94603454834c14bef49de1cb1230c37ea6dc15c") + add_versions("archive:2.28.4", "b53b9b42e731a33552d0a533316a88009b423c16a8a3a418df9ffe498c37da3d") + add_versions("archive:2.28.5", "97bd14ee0ec67494d2b93f1a4f7da2bf891103c57090d96fdcc2b019d885c76a") + add_versions("archive:2.30.0", "80b0c02b6018630cd40639ac9fc8e5c1d8eec14d8fe3e6dfa76343e3ba8b78d9") + add_versions("archive:2.30.1", "c15ded54e9f32f8a1f9ed3e3dc072837a320ed23c5d0e95b7c18ecbe05c1187b") + add_versions("archive:2.30.2", "09a822abf6e97f80d09cf9c46115faebb3476b0d56c1c035aec8ec3f88382ae7") + add_versions("archive:2.30.3", "c5d78a9e0346c6695f03df8ba25e5e111a1e23c8aefa8372a1c5a0dd79acaf10") add_versions("github:2.0.8", "release-2.0.8") add_versions("github:2.0.12", "release-2.0.12") add_versions("github:2.0.14", "release-2.0.14") @@ -53,15 +59,24 @@ package("libsdl") add_versions("github:2.28.1", "release-2.28.1") add_versions("github:2.28.2", "release-2.28.2") add_versions("github:2.28.3", "release-2.28.3") + add_versions("github:2.28.4", "release-2.28.4") + add_versions("github:2.28.5", "release-2.28.5") + add_versions("github:2.30.0", "release-2.30.0") + add_versions("github:2.30.1", "release-2.30.1") + add_versions("github:2.30.2", "release-2.30.2") + add_versions("github:2.30.3", "release-2.30.3") + + add_patches("2.30.0", path.join(os.scriptdir(), "patches", "2.30.0", "fix_mingw.patch"), "ab54eebc2e58d88653b257bc5b48a232c5fb0e6fad5d63661b6388215a7b0cd0") add_deps("cmake") add_includedirs("include", "include/SDL2") - add_configs("sdlmain", {description = "Use SDL_main entry point", default = true, type = "boolean"}) - - -- @note deprecated - add_configs("use_sdlmain", {description = "Use SDL_main entry point", default = true, type = "boolean"}) + if is_plat("android") then + add_configs("sdlmain", {description = "Use SDL_main entry point", default = false, type = "boolean", readonly = true}) + else + add_configs("sdlmain", {description = "Use SDL_main entry point", default = true, type = "boolean"}) + end if is_plat("linux") then add_configs("x11", {description = "Enables X11 support (requires it on the system)", default = true, type = "boolean"}) @@ -76,8 +91,15 @@ package("libsdl") end on_load(function (package) - if package:config("sdlmain") or package:config("use_sdlmain") then + if package:config("sdlmain") then package:add("components", "main") + if package:is_plat("mingw") then + -- MinGW requires linking mingw32 before SDL2main + local libsuffix = package:is_debug() and "d" or "" + package:add("linkorders", "mingw32", "SDL2main" .. libsuffix) + end + else + package:add("defines", "SDL_MAIN_HANDLED") end package:add("components", "lib") if package:is_plat("linux") and (package:config("x11") or package:config("with_x")) then @@ -91,7 +113,11 @@ package("libsdl") on_component("main", function (package, component) local libsuffix = package:is_debug() and "d" or "" component:add("links", "SDL2main" .. libsuffix) - component:add("defines", "SDL_MAIN_HANDLED") + if package:is_plat("windows") then + component:add("syslinks", "shell32") + elseif package:is_plat("mingw") then + component:add("syslinks", "mingw32") + end component:add("deps", "lib") end) @@ -212,6 +238,11 @@ package("libsdl") end) on_test(function (package) - assert(package:has_cfuncs("SDL_Init", - {includes = "SDL2/SDL.h", configs = {defines = "SDL_MAIN_HANDLED"}})) + assert(package:check_cxxsnippets({test = [[ + #include + int main(int argc, char** argv) { + SDL_Init(0); + return 0; + } + ]]}, {configs = {defines = "SDL_MAIN_HANDLED"}})); end) diff --git a/packages/l/libsdl_gfx/xmake.lua b/packages/l/libsdl_gfx/xmake.lua index dba76ecb1..ef76190b7 100644 --- a/packages/l/libsdl_gfx/xmake.lua +++ b/packages/l/libsdl_gfx/xmake.lua @@ -68,8 +68,8 @@ package("libsdl_gfx") end) on_test(function (package) - assert(package:has_cfuncs("aacircleRGBA", {includes = "SDL2/SDL2_gfxPrimitives.h", configs = {defines = "SDL_MAIN_HANDLED"}})) - assert(package:has_cfuncs("SDL_initFramerate", {includes = "SDL2/SDL2_framerate.h", configs = {defines = "SDL_MAIN_HANDLED"}})) - assert(package:has_cfuncs("rotozoomSurface", {includes = "SDL2/SDL2_rotozoom.h", configs = {defines = "SDL_MAIN_HANDLED"}})) - assert(package:has_cfuncs("SDL_imageFilterAdd", {includes = "SDL2/SDL2_imageFilter.h", configs = {defines = "SDL_MAIN_HANDLED"}})) + assert(package:has_cfuncs("aacircleRGBA", {includes = {"SDL2/SDL_main.h", "SDL2/SDL2_gfxPrimitives.h"}})) + assert(package:has_cfuncs("SDL_initFramerate", {includes = {"SDL2/SDL_main.h", "SDL2/SDL2_framerate.h"}})) + assert(package:has_cfuncs("rotozoomSurface", {includes = {"SDL2/SDL_main.h", "SDL2/SDL2_rotozoom.h"}})) + assert(package:has_cfuncs("SDL_imageFilterAdd", {includes = {"SDL2/SDL_main.h", "SDL2/SDL2_imageFilter.h"}})) end) diff --git a/packages/l/libsdl_image/xmake.lua b/packages/l/libsdl_image/xmake.lua index 8e306b6cc..7f9a4083f 100644 --- a/packages/l/libsdl_image/xmake.lua +++ b/packages/l/libsdl_image/xmake.lua @@ -16,6 +16,10 @@ package("libsdl_image") add_versions("2.6.0", "2252cdfd5be73cefaf727edc39c2ef3b7682e797acbd3126df117e925d46aaf6") add_versions("2.6.1", "cbfea63a46715c63a1db9e41617e550749a95ffd33ef9bd5ba6e58b2bdca6ed3") add_versions("2.6.2", "efe3c229853d0d40c35e5a34c3f532d5d9728f0abc623bc62c962bcef8754205") + add_versions("2.6.3", "b448a8ca5b7927d9bd1577d393f4d6c59581f87ee525652a27e699941db37b7c") + add_versions("2.8.0", "fed33c3fe9f8d38ab4460bdd100c4495be40f8afdac1d44bfcd2b0259b74a123") + add_versions("2.8.1", "0c5afef0ac4bc951a46c6790e576c9b3e7ed2c5ab1d2bbfa5e7e9300718f67d2") + add_versions("2.8.2", "2196ad6665b68fc453a659e172d67fbf18d548277aa07344dfd2deed9d9b84bd") if is_plat("macosx", "iphoneos") then add_frameworks("CoreFoundation", "CoreGraphics", "ImageIO", "CoreServices") @@ -61,5 +65,13 @@ package("libsdl_image") end) on_test(function (package) - assert(package:has_cfuncs("IMG_Init", {includes = "SDL2/SDL_image.h", configs = {defines = "SDL_MAIN_HANDLED"}})) + assert(package:check_cxxsnippets({test = [[ + #include + #include + int main(int argc, char** argv) { + IMG_Init(IMG_INIT_PNG); + IMG_Quit(); + return 0; + } + ]]}, {configs = {defines = "SDL_MAIN_HANDLED"}})); end) diff --git a/packages/l/libsdl_mixer/xmake.lua b/packages/l/libsdl_mixer/xmake.lua index 16f4d581d..97b6f15cb 100644 --- a/packages/l/libsdl_mixer/xmake.lua +++ b/packages/l/libsdl_mixer/xmake.lua @@ -9,6 +9,7 @@ package("libsdl_mixer") add_versions("2.6.0", "aca0ffc96a4bf2a56a16536a269de28e341ce38a46a25180bc1ef75e19b08a3a") add_versions("2.6.1", "788c748c1d3a87126511e60995b03526ed4e31e2ba053dffd9dcc8abde97b950") add_versions("2.6.2", "61549615a67e731805ca1df553e005be966a625c1d20fb085bf99edeef6e0469") + add_versions("2.8.0", "02df784cc68723419dd266530ee6964f810a6f02a27b03ecc85689c2e5e442ce") if is_plat("mingw") and is_subhost("msys") then add_extsources("pacman::SDL2_mixer") @@ -35,12 +36,18 @@ package("libsdl_mixer") end) on_install(function (package) - local configs = {"-DSDL2MIXER_SAMPLES=OFF", - "-DSDL2MIXER_FLAC=OFF", - "-DSDL2MIXER_OPUS=OFF", - "-DSDL2MIXER_MOD=OFF", - "-DSDL2MIXER_MIDI=OFF", - "-DSDL2MIXER_CMD=OFF"} + local configs = { + "-DSDL2MIXER_CMD=OFF", + "-DSDL2MIXER_FLAC=OFF", + "-DSDL2MIXER_GME=OFF", + "-DSDL2MIXER_MIDI=OFF", + "-DSDL2MIXER_MOD=OFF", + "-DSDL2MIXER_MP3=ON", -- was on by not being here + "-DSDL2MIXER_OPUS=OFF", + "-DSDL2MIXER_SAMPLES=OFF", + "-DSDL2MIXER_WAVE=ON", -- was on by not being here + "-DSDL2MIXER_WAVPACK=OFF", + } table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) local libsdl = package:dep("libsdl") @@ -51,7 +58,7 @@ package("libsdl_mixer") for _, dir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do if os.isfile(path.join(dir, "SDL_version.h")) then table.insert(configs, "-DSDL2_INCLUDE_DIR=" .. dir) - break + break end end for _, libfile in ipairs(fetchinfo.libfiles) do @@ -65,5 +72,13 @@ package("libsdl_mixer") end) on_test(function (package) - assert(package:has_cfuncs("Mix_Init", {includes = "SDL2/SDL_mixer.h", configs = {defines = "SDL_MAIN_HANDLED"}})) + assert(package:check_cxxsnippets({test = [[ + #include + #include + int main(int argc, char** argv) { + Mix_Init(MIX_INIT_OGG); + Mix_Quit(); + return 0; + } + ]]}, {configs = {defines = "SDL_MAIN_HANDLED"}})); end) diff --git a/packages/l/libsdl_net/xmake.lua b/packages/l/libsdl_net/xmake.lua index e4932f41f..e366e45df 100644 --- a/packages/l/libsdl_net/xmake.lua +++ b/packages/l/libsdl_net/xmake.lua @@ -62,6 +62,13 @@ package("libsdl_net") end) on_test(function (package) - assert(package:has_cfuncs("SDLNet_Init", - {includes = "SDL2/SDL_net.h", configs = {cxflags = "-sUSE_SDL=0", defines = "SDL_MAIN_HANDLED"}})) + assert(package:check_cxxsnippets({test = [[ + #include + #include + int main(int argc, char** argv) { + SDLNet_Init(); + SDLNet_Quit(); + return 0; + } + ]]}, {configs = {defines = "SDL_MAIN_HANDLED"}})); end) diff --git a/packages/l/libsdl_ttf/xmake.lua b/packages/l/libsdl_ttf/xmake.lua index 3dcae0cc0..aa26ec783 100644 --- a/packages/l/libsdl_ttf/xmake.lua +++ b/packages/l/libsdl_ttf/xmake.lua @@ -11,11 +11,13 @@ package("libsdl_ttf") add_extsources("brew::sdl2_ttf") end - add_urls("https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-$(version).tar.gz", - "https://github.com/libsdl-org/SDL_ttf/releases/download/release-$(version)/SDL2_ttf-$(version).tar.gz") - add_versions("2.20.0", "874680232b72839555a558b48d71666b562e280f379e673b6f0c7445ea3b9b8a") - add_versions("2.20.1", "78cdad51f3cc3ada6932b1bb6e914b33798ab970a1e817763f22ddbfd97d0c57") - add_versions("2.20.2", "9dc71ed93487521b107a2c4a9ca6bf43fb62f6bddd5c26b055e6b91418a22053") + add_urls("https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-$(version).zip", + "https://github.com/libsdl-org/SDL_ttf/releases/download/release-$(version)/SDL2_ttf-$(version).zip") + + add_versions("2.20.0", "04e94fc5ecac3475ab35c1d5cf52650df691867e7e4befcc861bf982a747111a") + add_versions("2.20.1", "18d81ab399c8e39adababe8918691830ba6e0d6448e5baa141ee0ddf87ede2dc") + add_versions("2.20.2", "aa6256bfcffd8381a75b3a2a2384ac12109b5b148e72722a19b0ede54c4051dc") + add_versions("2.22.0", "5766070145111cb047807fa3f91c2c6b81bc1008d63817e100417959b42a2484") add_patches(">=2.20.0 <=2.20.1", path.join(os.scriptdir(), "patches", "2.20.1", "cmakelists.patch"), "fe04ada62d9ed70029c0efb3c04bfec22fc7596bd6b73a567beb964e61ebd82c") @@ -39,6 +41,7 @@ package("libsdl_ttf") local configs = {"-DSDL2TTF_SAMPLES=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DSDL2TTF_VENDORED=OFF") local libsdl = package:dep("libsdl") if libsdl and not libsdl:is_system() then table.insert(configs, "-DSDL2_DIR=" .. libsdl:installdir()) @@ -92,6 +95,13 @@ package("libsdl_ttf") end) on_test(function (package) - assert(package:has_cfuncs("TTF_Init", - {includes = "SDL2/SDL_ttf.h", configs = {defines = "SDL_MAIN_HANDLED"}})) + assert(package:check_cxxsnippets({test = [[ + #include + #include + int main(int argc, char** argv) { + TTF_Init(); + TTF_Quit(); + return 0; + } + ]]}, {configs = {defines = "SDL_MAIN_HANDLED"}})); end) diff --git a/packages/l/libsigcplusplus/xmake.lua b/packages/l/libsigcplusplus/xmake.lua new file mode 100644 index 000000000..84c625d55 --- /dev/null +++ b/packages/l/libsigcplusplus/xmake.lua @@ -0,0 +1,51 @@ +package("libsigcplusplus") + set_homepage("https://libsigcplusplus.github.io/libsigcplusplus/") + set_description("libsigc++ implements a typesafe callback system for standard C++. It allows you to define signals and to connect those signals to any callback function, either global or a member function, regardless of whether it is static or virtual.") + set_license("LGPL-3.0") + + add_urls("https://github.com/libsigcplusplus/libsigcplusplus/archive/refs/tags/$(version).tar.gz", + "https://github.com/libsigcplusplus/libsigcplusplus.git") + + add_versions("3.6.0", "bbe81e4f6d8acb41a9795525a38c0782751dbc4af3d78a9339f4a282e8a16c38") + add_versions("3.4.0", "445d889079041b41b368ee3b923b7c71ae10a54da03bc746f2d0723e28ba2291") + + add_configs("deprecated_api", {description = "Build deprecated API and include it in the library", default = false, type = "boolean"}) + if is_plat("wasm") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("meson", "ninja") + add_includedirs("include/sigc++-3.0", "lib/sigc++-3.0/include") + + on_install("windows", "linux", "macosx", "mingw", "msys", "iphoneos", "cross", "wasm", function (package) + local configs = {"-Dvalidation=false", "-Dbuild-examples=false", "-Dbuild-tests=false"} + table.insert(configs, "-Dbuild-deprecated-api=" .. (package:config("deprecated_api") and "true" or "false")) + + local shflags = {} + if package:config("shared") then + table.insert(configs, "-Ddefault_library=shared") + + if package:is_plat("linux", "macosx") then + shflags = "-lstdc++" + end + else + table.insert(configs, "-Ddefault_library=static") + if package:is_plat("windows") then + package:add("defines", "SIGC_BUILD") + end + end + import("package.tools.meson").install(package, configs, {shflags = shflags}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void on_print(const std::string& str) {} + void test() { + sigc::signal signal_print; + signal_print.connect(sigc::ptr_fun(&on_print)); + signal_print.emit("hello world\n"); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/l/libsndfile/xmake.lua b/packages/l/libsndfile/xmake.lua index 6a9c11a95..815ffd975 100644 --- a/packages/l/libsndfile/xmake.lua +++ b/packages/l/libsndfile/xmake.lua @@ -4,10 +4,10 @@ package("libsndfile") set_description("A C library for reading and writing sound files containing sampled audio data.") set_license("LGPL-2.1") - add_urls("https://github.com/libsndfile/libsndfile/archive/$(version).tar.gz", + add_urls("https://github.com/libsndfile/libsndfile/archive/refs/tags/$(version).tar.gz", "https://github.com/libsndfile/libsndfile.git") - add_versions("v1.0.30", "5942b963d1db3ed8ab1ffb85708322aa9637df76d9fe84e1dfe49a97a90e8f47") - add_versions("1.0.31", "a8cfb1c09ea6e90eff4ca87322d4168cdbe5035cb48717b40bf77e751cc02163") + add_versions("1.2.2", "ffe12ef8add3eaca876f04087734e6e8e029350082f3251f565fa9da55b52121") + add_versions("1.0.31", "8cdee0acb06bb0a3c1a6ca524575643df8b1f3a55a0893b4dd9f829d08263785") add_deps("cmake", "libflac", "libopus", "libvorbis", "libogg") @@ -24,9 +24,9 @@ package("libsndfile") table.insert(configs, "-DBUILD_TESTING=OFF") table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_MPEG=OFF") - if package:is_plat("windows") then - + if package:is_plat("windows", "mingw") then -- libsndfile doesn't build well with a static libFLAC, this fixes it if not package:dep("libflac"):config("shared") then local cmake = io.open("CMakeLists.txt", "a") diff --git a/packages/l/libsndio/xmake.lua b/packages/l/libsndio/xmake.lua index 59de7dc40..7bddfcc7d 100644 --- a/packages/l/libsndio/xmake.lua +++ b/packages/l/libsndio/xmake.lua @@ -6,8 +6,6 @@ package("libsndio") add_versions("1.9.0", "f30826fc9c07e369d3924d5fcedf6a0a53c0df4ae1f5ab50fe9cf280540f699a") - add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) - if is_plat("linux") then add_deps("alsa-lib") end @@ -16,6 +14,13 @@ package("libsndio") import("package.tools.autoconf") local configs = {} local buildenvs = autoconf.buildenvs(package, {packagedeps = "alsa-lib"}) + if not package:config("shared") then + io.replace("libsndio/Makefile.in", + "${CC} ${LDFLAGS} ${SO_CFLAGS} ${SO_LDFLAGS} -o ${SO} ${OBJS} ${LDADD}", + "${AR} ${ARFLAGS} libsndio.a ${OBJS}", {plain = true}) + io.replace("libsndio/Makefile.in", "cp -R ${SO} ${SO_LINK} ${DESTDIR}${LIB_DIR}", + "cp libsndio.a ${DESTDIR}${LIB_DIR}", {plain = true}) + end autoconf.configure(package, configs, {envs = buildenvs}) os.vrunv("make", {}, {envs = buildenvs}) os.vrunv("make", {"install"}, {envs = buildenvs}) diff --git a/packages/l/libsodium/port/xmake.lua b/packages/l/libsodium/port/xmake.lua new file mode 100644 index 000000000..2e3004c04 --- /dev/null +++ b/packages/l/libsodium/port/xmake.lua @@ -0,0 +1,19 @@ +add_rules("mode.debug", "mode.release") + +if is_plat("windows") then + add_defines("inline=__inline", "NATIVE_LITTLE_ENDIAN", "_CRT_SECURE_NO_WARNINGS") +end + +target("sodium") + set_kind("$(kind)") + add_files("src/**.c") + add_includedirs("src/libsodium/include/sodium", "builds/msvc") + add_headerfiles("src/libsodium/include/(**.h)") + add_headerfiles("builds/msvc/version.h", {prefixdir = "sodium"}) + + if is_kind("static") then + add_defines("SODIUM_STATIC") + elseif is_kind("shared") and is_host("windows") then + add_files("builds/msvc/resource.rc") + add_defines("SODIUM_DLL_EXPORT") + end diff --git a/packages/l/libsodium/xmake.lua b/packages/l/libsodium/xmake.lua index e070a213a..e9c5e0770 100644 --- a/packages/l/libsodium/xmake.lua +++ b/packages/l/libsodium/xmake.lua @@ -1,58 +1,32 @@ package("libsodium") - set_homepage("https://libsodium.org") set_description("Sodium is a new, easy-to-use software library for encryption, decryption, signatures, password hashing and more.") + set_license("ISC") + + set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version).tar.gz", + "https://github.com/jedisct1/libsodium/releases/download/$(version)-RELEASE/libsodium-$(version).tar.gz", + "https://github.com/jedisct1/libsodium.git") + + add_versions("1.0.19", "018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea") + add_versions("1.0.18", "6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1") - if is_plat("windows") then - set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version)-msvc.zip", - "https://github.com/jedisct1/libsodium/releases/download/$(version)-RELEASE/libsodium-$(version)-msvc.zip") - add_versions("1.0.18", "c1d48d85c9361e350931ffe5067559cd7405a697c655d26955fb568d1084a5f4") - elseif is_plat("linux", "macosx") then + if is_plat("linux", "macosx") then add_deps("autoconf", "automake", "libtool", "pkg-config") - set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version).tar.gz", - "https://github.com/jedisct1/libsodium/releases/download/$(version)-RELEASE/libsodium-$(version).tar.gz") - add_versions("1.0.18", "6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1") - elseif is_plat("mingw") then - set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version)-mingw.tar.gz", - "https://github.com/jedisct1/libsodium/releases/download/$(version)-RELEASE/libsodium-$(version)-mingw.tar.gz") - add_versions("1.0.18", "e499c65b1c511cbc6700e436deb3771c3baa737981114c9e9f85f2ec90176861") end - on_load(function (package) + on_install(function (package) if not package:config("shared") then package:add("defines", "SODIUM_STATIC") end - end) - - on_install("windows", function (package) - os.cp("include", package:installdir()) - os.cp(path.join((package:is_arch("x64") and "x64" or "Win32"), (package:debug() and "Debug" or "Release"), "v142", (package:config("shared") and "dynamic" or "static"), "*"), package:installdir("lib")) - end) - - on_install("mingw", function (package) - - local root_dir = (package:is_arch("x86_64") and "libsodium-win64" or "libsodium-win32") - os.cp(path.join(root_dir, "include"), package:installdir()) - if package:config("shared") then - os.cp(path.join(root_dir, "lib", "libsodium.dll.a"), package:installdir("lib")) - os.cp(path.join(root_dir, "bin", "*"), package:installdir("lib")) + if package:is_plat("linux", "macosx") then + import("package.tools.autoconf").install(package) else - os.cp(path.join(root_dir, "lib", "libsodium.a"), package:installdir("lib")) + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package) end end) - on_install("linux", "macosx", function (package) - import("package.tools.autoconf").install(package) - end) - on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - int test(int args, char** argv) { - if (sodium_init() < 0) { - return -1; - } - return 0; - } - ]]}, {includes = "sodium.h"})) + assert(package:has_cfuncs("sodium_init", {includes = "sodium.h"})) end) diff --git a/packages/l/libspng/xmake.lua b/packages/l/libspng/xmake.lua index 007459b6c..6dba37f73 100644 --- a/packages/l/libspng/xmake.lua +++ b/packages/l/libspng/xmake.lua @@ -5,6 +5,7 @@ package("libspng") set_urls("https://github.com/randy408/libspng/archive/refs/tags/$(version).tar.gz", "https://github.com/randy408/libspng.git") + add_versions("v0.7.4", "47ec02be6c0a6323044600a9221b049f63e1953faf816903e7383d4dc4234487") add_versions("v0.7.1", "0726a4914ad7155028f3baa94027244d439cd2a2fbe8daf780c2150c4c951d8e") add_deps("zlib") diff --git a/packages/l/libstatgrab/xmake.lua b/packages/l/libstatgrab/xmake.lua new file mode 100644 index 000000000..4cb6115af --- /dev/null +++ b/packages/l/libstatgrab/xmake.lua @@ -0,0 +1,38 @@ +package("libstatgrab") + set_homepage("https://libstatgrab.org/") + set_description("A cross platform library for accessing system statistics") + set_license("GPL-2.1") + + add_urls("https://github.com/libstatgrab/libstatgrab.git") + add_urls("https://github.com/libstatgrab/libstatgrab/releases/download/$(version).tar.gz", {version = function (version) + return "LIBSTATGRAB_" .. version:gsub('%.', '_') .. "/libstatgrab-" .. version + end}) + + add_versions("0.92.1", "5688aa4a685547d7174a8a373ea9d8ee927e766e3cc302bdee34523c2c5d6c11") + + add_configs("thread_support", {description = "support for multi-threaded environments", default = true, type = "boolean"}) + + add_deps("automake", "autoconf", "libtool") + + if is_plat("macosx") then + add_frameworks("IOKit", "CoreFoundation") + end + + on_install("macosx", "linux", function (package) + local configs = {"--disable-statgrab", + "--disable-saidar", + "--disable-man", + "--disable-tests"} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) + if not package:config("thread_support") then + table.insert(configs, "--disable-thread-support") + else + package:add("syslinks", "pthread") + end + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("sg_init", {includes = "statgrab.h"})) + end) diff --git a/packages/l/libsvm/xmake.lua b/packages/l/libsvm/xmake.lua index 21255592c..c6a046d51 100644 --- a/packages/l/libsvm/xmake.lua +++ b/packages/l/libsvm/xmake.lua @@ -5,7 +5,8 @@ package("libsvm") add_urls("https://github.com/cjlin1/libsvm/archive/refs/tags/$(version).tar.gz", "https://github.com/cjlin1/libsvm.git") - add_versions("v325", "1f587ec0df6fd422dfe50f942f8836ac179b0723b768fe9d2fabdfd1601a0963") + add_versions("v332", "e1d7d316112d199ebd69c9695f79226d236b86e2c8d88e70cfe35fd383954ed8") + add_versions("v325", "1f587ec0df6fd422dfe50f942f8836ac179b0723b768fe9d2fabdfd1601a0963") on_install(function (package) io.writefile("xmake.lua", [[ diff --git a/packages/l/libsvtav1/xmake.lua b/packages/l/libsvtav1/xmake.lua new file mode 100644 index 000000000..d819e25c9 --- /dev/null +++ b/packages/l/libsvtav1/xmake.lua @@ -0,0 +1,53 @@ +package("libsvtav1") + set_homepage("https://gitlab.com/AOMediaCodec/SVT-AV1") + set_description("An AV1-compliant software encoder/decoder library") + set_license("BSD-3-Clause") + + add_urls("https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/$(version)/SVT-AV1-$(version).tar.gz", + "https://gitlab.com/AOMediaCodec/SVT-AV1.git") + + add_versions("v2.1.0", "72a076807544f3b269518ab11656f77358284da7782cece497781ab64ed4cb8a") + + add_configs("encoder", {description = "Enable encoder", default = true, type = "boolean"}) + add_configs("decoder", {description = "Enable decoder", default = true, type = "boolean"}) + add_configs("minimal_build", {description = "Enable minimal build", default = false, type = "boolean"}) + + if is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::svt-av1") + elseif is_plat("linux") then + add_extsources("pacman::svt-av1", "apt::libsvtav1-dev") + elseif is_plat("macosx") then + add_extsources("brew::svt-av1") + end + + if is_plat("linux", "bsd") then + add_syslinks("pthread", "dl", "m") + end + + add_deps("cmake", "nasm") + add_deps("cpuinfo") + + on_install("!cross and !windows@arm.*", function (package) + if package:is_plat("windows") and package:config("shared") then + package:add("defines", "EB_DLL") + end + + local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_APPS=OFF", "-DUSE_EXTERNAL_CPUINFO=ON"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DSVT_AV1_LTO=" .. (package:config("lto") and "ON" or "OFF")) + + table.insert(configs, "-DBUILD_ENC=" .. (package:config("encoder") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_DEC=" .. (package:config("decoder") and "ON" or "OFF")) + table.insert(configs, "-DMINIMAL_BUILD=" .. (package:config("minimal_build") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + if package:config("encoder") then + assert(package:has_cfuncs("svt_av1_enc_init_handle", {includes = {"stddef.h", "svt-av1/EbSvtAv1Enc.h"}})) + end + if package:config("decoder") then + assert(package:has_cfuncs("svt_av1_dec_init_handle", {includes = {"stddef.h", "svt-av1/EbSvtAv1Dec.h"}})) + end + end) diff --git a/packages/l/libtasn1/xmake.lua b/packages/l/libtasn1/xmake.lua index d8f21205f..d723f77bd 100644 --- a/packages/l/libtasn1/xmake.lua +++ b/packages/l/libtasn1/xmake.lua @@ -4,11 +4,14 @@ package("libtasn1") set_description("Libtasn1 is the ASN.1 library used by GnuTLS, p11-kit and some other packages.") set_license("LGPL-2.1") - add_urls("https://ftp.gnu.org/gnu/libtasn1/libtasn1-$(version).tar.gz") + add_urls("https://ftpmirror.gnu.org/gnu/libtasn1/libtasn1-$(version).tar.gz", + "https://ftp.gnu.org/gnu/libtasn1/libtasn1-$(version).tar.gz") add_versions("4.15.0", "dd77509fe8f5304deafbca654dc7f0ea57f5841f41ba530cff9a5bf71382739e") + add_versions("4.19.0", "1613f0ac1cf484d6ec0ce3b8c06d56263cc7242f1c23b30d82d23de345a63f7a") on_install("macosx", "linux", function (package) - local configs = {"--disable-doc", "--disable-dependency-tracking", "--with-pic"} + package:addenv("PATH", "bin") + local configs = {"--disable-doc", "--disable-dependency-tracking"} if package:config("shared") then table.insert(configs, "--enable-shared") table.insert(configs, "--disable-static") diff --git a/packages/l/libtiff/xmake.lua b/packages/l/libtiff/xmake.lua index d0c1007be..2e21a2555 100644 --- a/packages/l/libtiff/xmake.lua +++ b/packages/l/libtiff/xmake.lua @@ -9,6 +9,7 @@ package("libtiff") add_versions("v4.2.0", "f87463ac8984b43e8dd84a04c14816f5f217796d9f1f459756239c499857e75a") add_versions("v4.3.0", "5abe48cb2ea469fefb36d85718ddb1b9f28f95c87063e006696c83f23f5b8e41") add_versions("v4.4.0", "d118fc97748333ae6c53302ea06584148b72e128e924253d346b802d2a80a567") + add_versions("v4.6.0", "fdd1a2a35b20734a5232527a81d7365eb66e54732bfc44474a3124bcb85221c7") add_configs("tools", {description = "build TIFF tools", default = false, type = "boolean"}) add_configs("zlib", {description = "use zlib (required for Deflate compression)", default = false, type = "boolean"}) @@ -16,6 +17,11 @@ package("libtiff") add_configs("jpeg", {description = "use libjpeg (required for JPEG compression)", default = false, type = "boolean"}) add_configs("zstd", {description = "use libzstd (required for ZSTD compression)", default = false, type = "boolean"}) add_configs("webp", {description = "use libwebp (required for WEBP compression)", default = false, type = "boolean"}) + + if is_plat("macosx") then + add_extsources("brew::libtiff/libtiff-4") + end + local configdeps = {zlib = "zlib", libdeflate = "libdeflate", jpeg = "libjpeg-turbo", diff --git a/packages/l/libtins/xmake.lua b/packages/l/libtins/xmake.lua index fd245a948..1d5ae481b 100644 --- a/packages/l/libtins/xmake.lua +++ b/packages/l/libtins/xmake.lua @@ -6,6 +6,7 @@ package("libtins") set_urls("https://github.com/mfontanini/libtins/archive/refs/tags/$(version).tar.gz", "https://github.com/mfontanini/libtins.git") + add_versions("v4.5", "6ff5fe1ada10daef8538743dccb9c9b3e19d05d028ffdc24838e62ff3fc55841") add_versions("v4.4", "ff0121b4ec070407e29720c801b7e1a972042300d37560a62c57abadc9635634") add_deps("cmake", "boost") diff --git a/packages/l/libtommath/xmake.lua b/packages/l/libtommath/xmake.lua new file mode 100644 index 000000000..abc16e8c7 --- /dev/null +++ b/packages/l/libtommath/xmake.lua @@ -0,0 +1,35 @@ +package("libtommath") + set_homepage("https://www.libtom.net") + set_description("LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C.") + set_license("Unlicense") + + add_urls("https://github.com/libtom/libtommath/releases/download/v$(version)/ltm-$(version).tar.xz", + "https://github.com/libtom/libtommath/releases/download/v$(version)/ltm-$(version).tar.xz", + "https://github.com/libtom/libtommath.git") + + add_versions("1.3.0", "296272d93435991308eb73607600c034b558807a07e829e751142e65ccfa9d08") + + if is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::libtommath") + elseif is_plat("linux") then + add_extsources("pacman::libtommath", "apt::libtommath-dev") + elseif is_plat("macosx") then + add_extsources("brew::libtommath") + end + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DCOMPILE_LTO =" .. (package:config("lto") and "ON" or "OFF")) + if package:is_plat("windows") and package:config("shared") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("mp_init", {includes = "tommath.h"})) + end) diff --git a/packages/l/libtool/xmake.lua b/packages/l/libtool/xmake.lua index 653249918..c6009b614 100644 --- a/packages/l/libtool/xmake.lua +++ b/packages/l/libtool/xmake.lua @@ -1,5 +1,4 @@ package("libtool") - set_kind("binary") set_homepage("https://www.gnu.org/software/libtool/") set_description("A generic library support script.") @@ -7,18 +6,25 @@ package("libtool") add_urls("http://ftpmirror.gnu.org/libtool/libtool-$(version).tar.gz", "https://mirrors.ustc.edu.cn/gnu/libtool/libtool-$(version).tar.gz", "git://git.savannah.gnu.org/libtool.git") + add_versions("2.4.6", "e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3") add_versions("2.4.5", "509cb49c7de14ce7eaf88993cf09fd4071882699dfd874c2e95b31ab107d6987") add_versions("2.4.7", "04e96c2404ea70c590c546eba4202a4e12722c640016c12b9b2f1ce3d481e9a8") if is_host("linux") then add_extsources("apt::libtool", "pacman::libtool") + elseif is_host("macosx") then + add_extsources("brew::libtool") end add_deps("autoconf") on_install("@macosx", "@linux", "@bsd", function (package) import("package.tools.autoconf").install(package, {"--disable-dependency-tracking", "--enable-ltdl-install"}) + if package:is_plat("macosx") then + local bindir = package:installdir("bin") + os.ln(path.join(bindir, "libtoolize"), path.join(bindir, "glibtoolize")) + end end) on_test(function (package) diff --git a/packages/l/libtorch/patches/2.2.2/pocketfft.patch b/packages/l/libtorch/patches/2.2.2/pocketfft.patch new file mode 100644 index 000000000..6bae28fe3 --- /dev/null +++ b/packages/l/libtorch/patches/2.2.2/pocketfft.patch @@ -0,0 +1,12 @@ +diff --git a/third_party/pocketfft/pocketfft_hdronly.h b/third_party/pocketfft/pocketfft_hdronly.h +--- a/third_party/pocketfft/pocketfft_hdronly.h ++++ b/third_party/pocketfft/pocketfft_hdronly.h +@@ -149,7 +149,7 @@ template<> struct VLEN { static constexpr size_t val=2; }; + #endif + #endif + +-#if __cplusplus >= 201703L ++#if defined(__linux__) && __cplusplus >= 201703L + inline void *aligned_alloc(size_t align, size_t size) + { + // aligned_alloc() requires that the requested size is a multiple of "align" diff --git a/packages/l/libtorch/xmake.lua b/packages/l/libtorch/xmake.lua index 2a6e64296..c93a89076 100644 --- a/packages/l/libtorch/xmake.lua +++ b/packages/l/libtorch/xmake.lua @@ -12,19 +12,24 @@ package("libtorch") add_versions("v1.9.1", "dfbd030854359207cb3040b864614affeace11ce") add_versions("v1.11.0", "bc2c6edaf163b1a1330e37a6e34caf8c553e4755") add_versions("v1.12.1", "664058fa83f1d8eede5d66418abff6e20bd76ca8") + add_versions("v2.1.0", "7bcf7da3a268b435777fe87c7794c382f444e86d") + add_versions("v2.1.2", "a8e7c98cb95ff97bb30a728c6b2a1ce6bff946eb") + add_versions("v2.2.2", "39901f229520a5256505ec24782f716ee7ddc843") - add_patches("1.9.x", path.join(os.scriptdir(), "patches", "1.9.0", "gcc11.patch"), "4191bb3296f18f040c230d7c5364fb160871962d6278e4ae0f8bc481f27d8e4b") - add_patches("1.11.0", path.join(os.scriptdir(), "patches", "1.11.0", "gcc11.patch"), "1404b0bc6ce7433ecdc59d3412e3d9ed507bb5fd2cd59134a254d7d4a8d73012") + add_patches("1.9.x", "patches/1.9.0/gcc11.patch", "4191bb3296f18f040c230d7c5364fb160871962d6278e4ae0f8bc481f27d8e4b") + add_patches("1.11.0", "patches/1.11.0/gcc11.patch", "1404b0bc6ce7433ecdc59d3412e3d9ed507bb5fd2cd59134a254d7d4a8d73012") -- Fix compile on macOS. Refer to https://github.com/pytorch/pytorch/pull/80916 - add_patches("1.12.1", path.join(os.scriptdir(), "patches", "1.12.1", "clang.patch"), "cdc3e00b2fea847678b1bcc6b25a4dbd924578d8fb25d40543521a09aab2f7d4") - add_patches("1.12.1", path.join(os.scriptdir(), "patches", "1.12.1", "vs2022.patch"), "5a31b9772793c943ca752c92d6415293f7b3863813ca8c5eb9d92a6156afd21d") - - add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"}) - add_configs("python", {description = "Build python interface.", default = false, type = "boolean"}) - add_configs("openmp", {description = "Use OpenMP for parallel code.", default = true, type = "boolean"}) - add_configs("cuda", {description = "Enable CUDA support.", default = false, type = "boolean"}) - add_configs("ninja", {description = "Use ninja as build tool.", default = false, type = "boolean"}) - add_configs("blas", {description = "Set BLAS vendor.", default = "openblas", type = "string", values = {"mkl", "openblas", "eigen"}}) + add_patches("1.12.1", "patches/1.12.1/clang.patch", "cdc3e00b2fea847678b1bcc6b25a4dbd924578d8fb25d40543521a09aab2f7d4") + add_patches("1.12.1", "patches/1.12.1/vs2022.patch", "5a31b9772793c943ca752c92d6415293f7b3863813ca8c5eb9d92a6156afd21d") + add_patches("2.2.2", "patches/2.2.2/pocketfft.patch", "8b756d867fb60839dcaeb1ee0bdf4189ee95e7f5c6f3810f8cbc8f6a5fae60e9") + + add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"}) + add_configs("python", {description = "Build python interface.", default = false, type = "boolean"}) + add_configs("openmp", {description = "Use OpenMP for parallel code.", default = true, type = "boolean"}) + add_configs("cuda", {description = "Enable CUDA support.", default = false, type = "boolean"}) + -- https://github.com/pytorch/pytorch/issues/24186 only ninja is supported on windows + add_configs("ninja", {description = "Use ninja as build tool.", default = is_plat("windows"), type = "boolean"}) + add_configs("blas", {description = "Set BLAS vendor.", default = "openblas", type = "string", values = {"mkl", "openblas", "eigen"}}) add_configs("pybind11", {description = "Use pybind11 from xrepo.", default = false, type = "boolean"}) add_configs("protobuf-cpp", {description = "Use protobuf from xrepo.", default = false, type = "boolean"}) if not is_plat("macosx") then @@ -72,9 +77,10 @@ package("libtorch") on_install("windows|x64", "macosx", "linux", function (package) import("package.tools.cmake") + import("core.tool.toolchain") if package:is_plat("windows") then - local vs = import("core.tool.toolchain").load("msvc"):config("vs") + local vs = toolchain.load("msvc"):config("vs") if tonumber(vs) < 2019 then raise("Your compiler is too old to use this library.") end @@ -112,35 +118,37 @@ package("libtorch") end -- some patches to the third-party cmake files + io.replace("cmake/MiscCheck.cmake", "if(UNIX)", "if(TRUE)", {plain = true}) io.replace("third_party/fbgemm/CMakeLists.txt", "PRIVATE FBGEMM_STATIC", "PUBLIC FBGEMM_STATIC", {plain = true}) - -- Workaround to compile with GCC-12. - -- Refer to [this pytorch issue](https://github.com/pytorch/pytorch/issues/77939). - io.replace("third_party/fbgemm/CMakeLists.txt", - 'string(APPEND CMAKE_CXX_FLAGS " -Werror")', - 'string(APPEND CMAKE_CXX_FLAGS " -Werror")\n string(APPEND CMAKE_CXX_FLAGS " -Wno-uninitialized")', - {plain = true} - ) io.replace("third_party/protobuf/cmake/install.cmake", "install%(DIRECTORY.-%)", "") - if package:is_plat("windows") and package:config("vs_runtime"):startswith("MD") then - io.replace("third_party/fbgemm/CMakeLists.txt", "MT", "MD", {plain = true}) + if package:is_plat("windows") then + if package:config("vs_runtime"):startswith("MD") then + io.replace("third_party/fbgemm/CMakeLists.txt", "MT", "MD", {plain = true}) + io.replace("c10/macros/Macros.h", "extern \"C\" {\nC10_IMPORT", "extern \"C\" {\n__declspec(dllimport)", {plain = true}) + else + io.replace("CMakeLists.txt", "\"NOT BUILD_SHARED_LIBS\" OFF", "\"NOT BUILD_SHARED_LIBS\" ON", {plain = true}) + io.replace("c10/macros/Macros.h", "extern \"C\" {\nC10_IMPORT", "extern \"C\" {", {plain = true}) + end end -- prepare python - os.vrun("python -m pip install typing_extensions pyyaml") + local python_exe = package:is_plat("windows") and "python" or "python3" + os.vrun(python_exe .. " -m pip install typing_extensions pyyaml") local configs = {"-DUSE_MPI=OFF", - "-DCMAKE_INSTALL_LIBDIR=lib", + "-DUSE_NUMA=OFF", + "-DUSE_MAGMA=OFF", "-DBUILD_TEST=OFF", "-DATEN_NO_TEST=ON"} if package:config("python") then table.insert(configs, "-DBUILD_PYTHON=ON") - os.vrun("python -m pip install numpy") + os.vrun(python_exe .. " -m pip install numpy") else table.insert(configs, "-DBUILD_PYTHON=OFF") table.insert(configs, "-DUSE_NUMPY=OFF") end -- prepare for installation - local envs = cmake.buildenvs(package, {cmake_generator = "Ninja"}) + local envs = cmake.buildenvs(package) if not package:is_plat("macosx") then if package:config("blas") == "mkl" then table.insert(configs, "-DBLAS=MKL") @@ -163,8 +171,18 @@ package("libtorch") table.insert(configs, "-DUSE_DISTRIBUTED=" .. (package:config("distributed") and "ON" or "OFF")) table.insert(configs, "-DUSE_SYSTEM_PYBIND11=" .. (package:config("pybind11") and "ON" or "OFF")) table.insert(configs, "-DBUILD_CUSTOM_PROTOBUF=" .. (package:config("protobuf-cpp") and "OFF" or "ON")) + local pythonpath, err = os.iorun(python_exe .. " -c \"import sys; print(sys.executable)\"") + table.insert(configs, "-DPYTHON_EXECUTABLE=" .. pythonpath) if package:is_plat("windows") then table.insert(configs, "-DCAFFE2_USE_MSVC_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + table.insert(configs, "-DCPUINFO_RUNTIME_TYPE=" .. (package:config("vs_runtime"):startswith("MT") and "static" or "shared")) + local vs_sdkver = toolchain.load("msvc"):config("vs_sdkver") + if vs_sdkver then + local build_ver = string.match(vs_sdkver, "%d+%.%d+%.(%d+)%.?%d*") + assert(tonumber(build_ver) >= 18362, "libtorch requires Windows SDK to be at least 10.0.18362.0") + table.insert(configs, "-DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=" .. vs_sdkver) + table.insert(configs, "-DCMAKE_SYSTEM_VERSION=" .. vs_sdkver) + end end local opt = {envs = envs} @@ -211,5 +229,5 @@ package("libtorch") auto b = torch::tensor({1, 2, 3}); auto c = torch::dot(a, b); } - ]]}, {configs = {languages = "c++14"}, includes = "torch/torch.h"})) + ]]}, {configs = {languages = "c++17"}, includes = "torch/torch.h"})) end) diff --git a/packages/l/libunistring/xmake.lua b/packages/l/libunistring/xmake.lua index 22dcd4c76..34a1068b3 100644 --- a/packages/l/libunistring/xmake.lua +++ b/packages/l/libunistring/xmake.lua @@ -4,8 +4,10 @@ package("libunistring") set_description("This library provides functions for manipulating Unicode strings and for manipulating C strings according to the Unicode standard.") set_license("GPL-3.0") - add_urls("https://ftp.gnu.org/gnu/libunistring/libunistring-$(version).tar.gz") + add_urls("https://ftpmirror.gnu.org/gnu/libunistring/libunistring-$(version).tar.gz", + "https://ftp.gnu.org/gnu/libunistring/libunistring-$(version).tar.gz") add_versions("0.9.10", "a82e5b333339a88ea4608e4635479a1cfb2e01aafb925e1290b65710d43f610b") + add_versions("1.1", "a2252beeec830ac444b9f68d6b38ad883db19919db35b52222cf827c385bdb6a") add_deps("libiconv") diff --git a/packages/l/libunwind/patches/1.8.0/fix-arm64.patch b/packages/l/libunwind/patches/1.8.0/fix-arm64.patch new file mode 100644 index 000000000..6a4729b0d --- /dev/null +++ b/packages/l/libunwind/patches/1.8.0/fix-arm64.patch @@ -0,0 +1,145 @@ +diff --git a/src/aarch64/Gos-linux.c b/src/aarch64/Gos-linux.c +index 7cd8c87..b750180 100644 +--- a/src/aarch64/Gos-linux.c ++++ b/src/aarch64/Gos-linux.c +@@ -28,73 +28,70 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + #ifndef UNW_REMOTE_ONLY + +-HIDDEN int ++HIDDEN inline int + aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) + { ++#ifdef __linux__ + struct cursor *c = (struct cursor *) cursor; +- unw_context_t *uc = c->uc; ++ unw_tdep_context_t *uc = c->uc; + + if (c->sigcontext_format == AARCH64_SCF_NONE) + { + /* Since there are no signals involved here we restore EH and non scratch + registers only. */ ++ unsigned long regs[24]; ++ regs[0] = uc->uc_mcontext.regs[0]; ++ regs[1] = uc->uc_mcontext.regs[1]; ++ regs[2] = uc->uc_mcontext.regs[2]; ++ regs[3] = uc->uc_mcontext.regs[3]; ++ regs[4] = uc->uc_mcontext.regs[19]; ++ regs[5] = uc->uc_mcontext.regs[20]; ++ regs[6] = uc->uc_mcontext.regs[21]; ++ regs[7] = uc->uc_mcontext.regs[22]; ++ regs[8] = uc->uc_mcontext.regs[23]; ++ regs[9] = uc->uc_mcontext.regs[24]; ++ regs[10] = uc->uc_mcontext.regs[25]; ++ regs[11] = uc->uc_mcontext.regs[26]; ++ regs[12] = uc->uc_mcontext.regs[27]; ++ regs[13] = uc->uc_mcontext.regs[28]; ++ regs[14] = uc->uc_mcontext.regs[29]; /* FP */ ++ regs[15] = uc->uc_mcontext.regs[30]; /* LR */ ++ regs[16] = GET_FPCTX(uc)->vregs[8]; ++ regs[17] = GET_FPCTX(uc)->vregs[9]; ++ regs[18] = GET_FPCTX(uc)->vregs[10]; ++ regs[19] = GET_FPCTX(uc)->vregs[11]; ++ regs[20] = GET_FPCTX(uc)->vregs[12]; ++ regs[21] = GET_FPCTX(uc)->vregs[13]; ++ regs[22] = GET_FPCTX(uc)->vregs[14]; ++ regs[23] = GET_FPCTX(uc)->vregs[15]; ++ unsigned long sp = uc->uc_mcontext.sp; ++ ++ struct regs_overlay { ++ char x[sizeof(regs)]; ++ }; ++ + __asm__ __volatile__ ( +- "ldr x0, %[x0]\n\t" +- "ldr x1, %[x1]\n\t" +- "ldr x2, %[x2]\n\t" +- "ldr x3, %[x3]\n\t" +- "ldr x19, %[x19]\n\t" +- "ldr x20, %[x20]\n\t" +- "ldr x21, %[x21]\n\t" +- "ldr x22, %[x22]\n\t" +- "ldr x23, %[x23]\n\t" +- "ldr x24, %[x24]\n\t" +- "ldr x25, %[x25]\n\t" +- "ldr x26, %[x26]\n\t" +- "ldr x27, %[x27]\n\t" +- "ldr x28, %[x28]\n\t" +- "ldr x29, %[x29]\n\t" +- "ldr x30, %[x30]\n\t" +- "ldr d8, %[d8]\n\t" +- "ldr d9, %[d9]\n\t" +- "ldr d10, %[d10]\n\t" +- "ldr d11, %[d11]\n\t" +- "ldr d12, %[d12]\n\t" +- "ldr d13, %[d13]\n\t" +- "ldr d14, %[d14]\n\t" +- "ldr d15, %[d15]\n\t" +- "ldr x5, %[sp]\n\t" +- "mov sp, x5\n\t" +- "ret\n" ++ "mov x4, %0\n" ++ "mov x5, %1\n" ++ "ldp x0, x1, [x4]\n" ++ "ldp x2, x3, [x4,16]\n" ++ "ldp x19, x20, [x4,32]\n" ++ "ldp x21, x22, [x4,48]\n" ++ "ldp x23, x24, [x4,64]\n" ++ "ldp x25, x26, [x4,80]\n" ++ "ldp x27, x28, [x4,96]\n" ++ "ldp x29, x30, [x4,112]\n" ++ "ldp d8, d9, [x4,128]\n" ++ "ldp d10, d11, [x4,144]\n" ++ "ldp d12, d13, [x4,160]\n" ++ "ldp d14, d15, [x4,176]\n" ++ "mov sp, x5\n" ++ "ret \n" + : +- : [x0] "m"(uc->uc_mcontext.regs[0]), +- [x1] "m"(uc->uc_mcontext.regs[1]), +- [x2] "m"(uc->uc_mcontext.regs[2]), +- [x3] "m"(uc->uc_mcontext.regs[3]), +- [x19] "m"(uc->uc_mcontext.regs[19]), +- [x20] "m"(uc->uc_mcontext.regs[20]), +- [x21] "m"(uc->uc_mcontext.regs[21]), +- [x22] "m"(uc->uc_mcontext.regs[22]), +- [x23] "m"(uc->uc_mcontext.regs[23]), +- [x24] "m"(uc->uc_mcontext.regs[24]), +- [x25] "m"(uc->uc_mcontext.regs[25]), +- [x26] "m"(uc->uc_mcontext.regs[26]), +- [x27] "m"(uc->uc_mcontext.regs[27]), +- [x28] "m"(uc->uc_mcontext.regs[28]), +- [x29] "m"(uc->uc_mcontext.regs[29]), /* FP */ +- [x30] "m"(uc->uc_mcontext.regs[30]), /* LR */ +- [d8] "m"(GET_FPCTX(uc)->vregs[8]), +- [d9] "m"(GET_FPCTX(uc)->vregs[9]), +- [d10] "m"(GET_FPCTX(uc)->vregs[10]), +- [d11] "m"(GET_FPCTX(uc)->vregs[11]), +- [d12] "m"(GET_FPCTX(uc)->vregs[12]), +- [d13] "m"(GET_FPCTX(uc)->vregs[13]), +- [d14] "m"(GET_FPCTX(uc)->vregs[14]), +- [d15] "m"(GET_FPCTX(uc)->vregs[15]), +- [sp] "m"(uc->uc_mcontext.sp) +- : "x0", "x1", "x2", "x3", "x19", "x20", "x21", "x22", "x23", "x24", +- "x25", "x26", "x27", "x28", "x29", "x30" +- ); ++ : "r" (regs), ++ "r" (sp), ++ "m" (*(struct regs_overlay *)regs) ++ ); + } + else + { +@@ -143,7 +140,10 @@ aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) + ); + } + unreachable(); ++#else ++ printf ("%s: implement me\n", __FUNCTION__); ++#endif + return -UNW_EINVAL; + } + +-#endif /* !UNW_REMOTE_ONLY */ ++#endif /* !UNW_REMOTE_ONLY */ +\ No newline at end of file diff --git a/packages/l/libunwind/xmake.lua b/packages/l/libunwind/xmake.lua index 343a500ad..ab93e1aa8 100644 --- a/packages/l/libunwind/xmake.lua +++ b/packages/l/libunwind/xmake.lua @@ -1,7 +1,7 @@ package("libunwind") - set_homepage("https://www.nongnu.org/libunwind/") set_description("A portable and efficient C programming interface (API) to determine the call-chain of a program.") + set_license("MIT") add_urls("https://github.com/libunwind/libunwind/releases/download/$(version).tar.gz", {version = function (version) if version:eq("v1.5") then @@ -14,8 +14,14 @@ package("libunwind") return version:gsub("v", "") end}) add_urls("https://github.com/libunwind/libunwind.git") - add_versions("v1.5", "90337653d92d4a13de590781371c604f9031cdb50520366aa1e3a91e1efb1017") + + add_versions("v1.8.1", "ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157") + add_versions("v1.8.0", "b6b3df40a0970c8f2865fb39aa2af7b5d6f12ad6c5774e266ccca4d6b8b72268") + add_versions("v1.7.2", "a18a6a24307443a8ace7a8acc2ce79fbbe6826cd0edf98d6326d0225d6a5d6e6") add_versions("v1.6.2", "4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976") + add_versions("v1.5", "90337653d92d4a13de590781371c604f9031cdb50520366aa1e3a91e1efb1017") + + add_patches(">=1.8.0", path.join(os.scriptdir(), "patches", "1.8.0", "fix-arm64.patch"), "5f679af80859b6a50504ec830a4d328c3cf25bef9f2107baed866b438f3818d3") add_configs("minidebuginfo", {description = "Enables support for LZMA-compressed symbol tables", default = false, type = "boolean"}) add_configs("zlibdebuginfo", {description = "Enables support for ZLIB-compressed symbol tables", default = false, type = "boolean"}) @@ -33,7 +39,11 @@ package("libunwind") end end) - on_install("android", "linux", "bsd", "cross", function (package) + on_install("android|arm64@linux,macosx", "linux", "bsd", "cross", function (package) + if package:is_plat("bsd") then + io.replace("src/setjmp/siglongjmp.c", "&wp[JB_MASK]", "(unw_word_t)&wp[JB_MASK]", {plain = true}) + end + local configs = {"--enable-coredump=no", "--disable-tests"} table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) diff --git a/packages/l/liburing/xmake.lua b/packages/l/liburing/xmake.lua index aec4be12a..ae73918d4 100644 --- a/packages/l/liburing/xmake.lua +++ b/packages/l/liburing/xmake.lua @@ -5,6 +5,8 @@ package("liburing") add_urls("https://github.com/axboe/liburing/archive/refs/tags/liburing-$(version).tar.gz", "https://github.com/axboe/liburing.git") + add_versions("2.6", "682f06733e6db6402c1f904cbbe12b94942a49effc872c9e01db3d7b180917cc") + add_versions("2.5", "456f5f882165630f0dc7b75e8fd53bd01a955d5d4720729b4323097e6e9f2a98") add_versions("2.4", "2398ec82d967a6f903f3ae1fd4541c754472d3a85a584dc78c5da2fabc90706b") add_versions("2.3", "60b367dbdc6f2b0418a6e0cd203ee0049d9d629a36706fcf91dfb9428bae23c8") add_versions("2.2", "e092624af6aa244ade2d52181cc07751ac5caba2f3d63e9240790db9ed130bbc") @@ -18,7 +20,7 @@ package("liburing") if package:config("pic") ~= false then cflags = "-fPIC" end - import("package.tools.autoconf").install(package, {}, {makeconfigs = {CFLAGS = cflags}}) + import("package.tools.autoconf").install(package, {"--use-libc"}, {makeconfigs = {CFLAGS = cflags}}) end) on_test(function (package) diff --git a/packages/l/libusb/xmake.lua b/packages/l/libusb/xmake.lua index f64b74976..cd972868c 100644 --- a/packages/l/libusb/xmake.lua +++ b/packages/l/libusb/xmake.lua @@ -1,102 +1,50 @@ package("libusb") - set_homepage("https://libusb.info") - set_description("A cross-platform library to access USB devices.") + set_description("A cross-platform library to access USB devices ") + set_license("LGPL-2.1") - if is_plat("mingw") then - add_urls("https://github.com/libusb/libusb/releases/download/$(version).7z", {version = function (version) - return version .. "/libusb-" .. (version:gsub("v", "")) - end}) - add_versions("v1.0.24", "620CEC4DBE4868202949294157DA5ADB75C9FBB4F04266146FC833EEF85F90FB") - else - add_urls("https://github.com/libusb/libusb/releases/download/$(version).tar.bz2", {version = function (version) - return version .. "/libusb-" .. (version:gsub("v", "")) - end}) - add_urls("https://github.com/libusb/libusb.git") - add_versions("v1.0.24", "7efd2685f7b327326dcfb85cee426d9b871fd70e22caa15bb68d595ce2a2b12a") - end + add_urls("https://github.com/libusb/libusb/archive/refs/tags/$(version).tar.gz", + "https://github.com/libusb/libusb.git") - if is_plat("macosx", "linux") then - add_deps("autoconf", "automake", "libtool", "pkg-config") - if is_plat("linux") then - add_deps("eudev") - end - end + add_versions("v1.0.27", "e8f18a7a36ecbb11fb820bd71540350d8f61bcd9db0d2e8c18a6fb80b214a3de") + add_versions("v1.0.26", "a09bff99c74e03e582aa30759cada218ea8fa03580517e52d463c59c0b25e240") + + add_resources(">=1.0.26", "libusb-cmake", "https://github.com/libusb/libusb-cmake.git", "84fb1bba4dde4c266944e7c7aa641a8a15d18f31") if is_plat("macosx") then - add_frameworks("CoreFoundation", "IOKit") - elseif is_plat("linux", "bsd") then + add_frameworks("CoreFoundation", "IOKit", "Security") + add_extsources("brew::libusb") + elseif is_plat("bsd") then add_syslinks("pthread") + elseif is_plat("linux") then + add_deps("eudev") + add_syslinks("pthread") + add_extsources("apt::libusb-dev", "pacman::libusb") + elseif is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::libusb") end - on_fetch("linux", "macosx", function(package, opt) - if opt.system then - return find_package("pkgconfig::libusb-1.0") - end - end) + add_deps("cmake") add_includedirs("include", "include/libusb-1.0") - on_install("windows", function (package) - import("core.tool.toolchain") - local vsversion = toolchain.load("msvc"):config("vs") or "2019" - local solutionFiles = { - "libusb_" .. vsversion .. ".sln", - "libusb_2019.sln", - "libusb_2017.sln", - "libusb_2015.sln", - } - - local solutionFile - local oldir = os.cd("msvc") - for _, file in ipairs(solutionFiles) do - if os.isfile(file) then - solutionFile = file - break - end - end - assert(solutionFile, "solution file not found") + on_install("windows", "linux", "macosx", "bsd", "msys", "android", function (package) + local dir = package:resourcefile("libusb-cmake") + os.cp(path.join(dir, "CMakeLists.txt"), os.curdir()) + os.cp(path.join(dir, "config.h.in"), os.curdir()) + io.replace("CMakeLists.txt", + [[get_filename_component(LIBUSB_ROOT "libusb/libusb" ABSOLUTE)]], + [[get_filename_component(LIBUSB_ROOT "libusb" ABSOLUTE)]], {plain = true}) - local arch = package:is_arch("x86") and "Win32" or "x64" - local mode = package:debug() and "Debug" or "Release" - local configs = {solutionFile} - table.insert(configs, "/property:Configuration=" .. mode) - table.insert(configs, "/property:Platform=" .. arch) - import("package.tools.msbuild").build(package, configs) - os.cd(oldir) - os.vcp("libusb/*.h", package:installdir("include/libusb-1.0")) - if package:config("shared") then - os.vcp(path.join(arch, mode, "dll/libusb-1.0.dll"), package:installdir("lib")) - os.vcp(path.join(arch, mode, "dll/libusb-1.0.lib"), package:installdir("lib")) - else - os.vcp(path.join(arch, mode, "lib/libusb-1.0.lib"), package:installdir("lib")) - end - end) - - on_install("mingw", function (package) - os.cp("include/libusb-1.0/*.h",package:installdir("include/libusb-1.0")) - if package:is_arch("x64", "x86_64") then - os.cp("MinGW64/dll/*", package:installdir("bin")) - os.cp("MinGW64/static/*", package:installdir("lib")) - elseif package:is_arch("x86", "i386") then - os.cp("MinGW32/dll/*", package:installdir("bin")) - os.cp("MinGW32/static/*", package:installdir("lib")) - end - end) - - on_install("macosx", "linux", "bsd", function (package) local configs = {} - table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) - table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) - if package:config("pic") ~= false then - table.insert(configs, "--with-pic") - end - local cflags, ldflags + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + + local packagedeps = {} if package:is_plat("linux") then - cflags = "-I" .. package:dep("eudev"):installdir("include") - ldflags = "-L" .. package:dep("eudev"):installdir("lib") + table.insert(packagedeps, "eudev") end - import("package.tools.autoconf").install(package, configs, {cflags = cflags, ldflags = ldflags}) + import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps}) end) on_test(function (package) diff --git a/packages/l/libuuid/xmake.lua b/packages/l/libuuid/xmake.lua index 3b49f1198..905ab73ad 100644 --- a/packages/l/libuuid/xmake.lua +++ b/packages/l/libuuid/xmake.lua @@ -11,20 +11,36 @@ package("libuuid") on_install("linux", "macosx", "bsd", "android", "iphoneos", "wasm", "cross", function(package) io.writefile("xmake.lua", [[ - includes("check_cfuncs.lua") + includes("@builtin/check") add_rules("mode.debug", "mode.release") target("uuid") set_kind("$(kind)") add_files("*.c|test_*.c") add_headerfiles("*.h", {prefixdir = "uuid"}) add_rules("utils.install.pkgconfig_importfiles", {filename = "uuid.pc"}) - check_cfuncs("HAVE_USLEEP", "usleep", {includes = "unistd.h"}) + check_cincludes("HAVE_DLFCN_H", "dlfcn.h") + check_cincludes("HAVE_FCNTL_H", "fcntl.h") + check_cincludes("HAVE_INTTYPES_H", "inttypes.h") + check_cincludes("HAVE_LIMITS_H", "limits.h") + check_cincludes("HAVE_MEMORY_H", "memory.h") + check_cincludes("HAVE_NETINET_IN_H", "netinet/in.h") + check_cincludes("HAVE_STDINT_H", "stdint.h") + check_cincludes("HAVE_STDLIB_H", "stdlib.h") + check_cincludes("HAVE_STRING_H", "string.h") + check_cincludes("HAVE_STRINGS_H", "strings.h") + check_cincludes("HAVE_SYS_FILE_H", "sys/file.h") + check_cincludes("HAVE_SYS_IOCTL_H", "sys/ioctl.h") + check_cincludes("HAVE_SYS_SOCKET_H", "sys/socket.h") + check_cincludes("HAVE_SYS_STAT_H", "sys/stat.h") + check_cincludes("HAVE_SYS_TIME_H", "sys/time.h") + check_cincludes("HAVE_SYS_TYPES_H", "sys/types.h") check_cfuncs("HAVE_FTRUNCATE", "ftruncate", {includes = "unistd.h"}) check_cfuncs("HAVE_GETTIMEOFDAY", "gettimeofday", {includes = "sys/time.h"}) check_cfuncs("HAVE_MEMSET", "memset", {includes = "string.h"}) check_cfuncs("HAVE_SOCKET", "socket", {includes = "sys/socket.h"}) - check_cfuncs("HAVE_STRTOUL", "strtoul", {includes = "stdlib.h"}) check_cfuncs("HAVE_SRANDOM", "srandom", {includes = "stdlib.h"}) + check_cfuncs("HAVE_STRTOUL", "strtoul", {includes = "stdlib.h"}) + check_cfuncs("HAVE_USLEEP", "usleep", {includes = "unistd.h"}) ]]) local configs = {} if package:config("shared") then diff --git a/packages/l/libva/xmake.lua b/packages/l/libva/xmake.lua new file mode 100644 index 000000000..12d751886 --- /dev/null +++ b/packages/l/libva/xmake.lua @@ -0,0 +1,55 @@ +package("libva") + set_homepage("https://01.org/linuxmedia") + set_description("Libva is an implementation for VA-API (Video Acceleration API)") + + add_urls("https://github.com/intel/libva/archive/refs/tags/$(version).tar.gz", + "https://github.com/intel/libva.git") + + add_versions("2.21.0", "f7c3fffef3f04eb146e036dad2587d852bfb70e4926d014bf437244915ef7425") + + add_configs("win32", {description = "Build with win32", default = false, type = "boolean"}) + add_configs("drm", {description = "Build with drm", default = false, type = "boolean"}) + add_configs("x11", {description = "Build with x11", default = false, type = "boolean"}) + add_configs("wayland", {description = "Build with wayland", default = false, type = "boolean"}) + add_configs("glx", {description = "Build with glx", default = false, type = "boolean"}) + + add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) + + if is_plat("linux") then + add_syslinks("dl") + end + + add_deps("meson", "ninja") + + on_load(function (package) + if is_host("windows") or package:is_plat("mingw", "msys") then + package:config_set("win32", true) + elseif not (package:config("drm") or package:config("x11") or package:config("wayland")) then + wprint("Please enable at least one backend (DRM, X11, Wayland), defalut x11") + package:config_set("x11", true) + end + + if package:config("drm") or is_plat("linux") then + package:add("deps", "libdrm") + end + if package:config("x11") then + package:add("deps", "libx11", "libxext", "libxfixes") + end + if package:config("wayland") then + package:add("deps", "wayland") + end + end) + + on_install("windows", "linux", "mingw", "msys", function (package) + local configs = {} + table.insert(configs, "-Ddisable_drm=" .. (package:config("drm") and "false" or "true")) + table.insert(configs, "-Dwith_win32=" .. (package:config("win32") and "yes" or "no")) + table.insert(configs, "-Dwith_x11=" .. (package:config("x11") and "yes" or "no")) + table.insert(configs, "-Dwith_wayland=" .. (package:config("wayland") and "yes" or "no")) + table.insert(configs, "-Dwith_glx=" .. (package:config("glx") and "yes" or "no")) + import("package.tools.meson").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("vaDisplayIsValid", {includes = "va/va.h"})) + end) diff --git a/packages/l/libvips/xmake.lua b/packages/l/libvips/xmake.lua new file mode 100644 index 000000000..800e14aca --- /dev/null +++ b/packages/l/libvips/xmake.lua @@ -0,0 +1,139 @@ +package("libvips") + set_homepage("https://libvips.github.io/libvips/") + set_description("A fast image processing library with low memory needs.") + set_license("LGPL-2.1") + + add_urls("https://github.com/libvips/libvips/archive/refs/tags/$(version).tar.gz", + "https://github.com/libvips/libvips.git") + + add_versions("v8.15.2", "8c3ece7be367636fd676573a8ff22170c07e95e81fd94f2d1eb9966800522e1f") + add_versions("v8.15.1", "5701445a076465a3402a135d13c0660d909beb8efc4f00fbbe82392e243497f2") + + add_configs("c++", { description = "Build C++ API", default = true, type = "boolean" }) + add_configs("deprecated", { description = "Build deprecated components", default = false, type = "boolean" }) + add_configs("dynamic_modules", { description = "Build dynamic modules", default = false, type = "boolean" }) + add_configs("introspection", { description = "Build GObject introspection data", default = false, type = "boolean" }) + add_configs("vapi", { description = "Build VAPI", default = false, type = "boolean" }) + + add_configs("nsgif", { description = "Build with nsgif", default = false, type = "boolean" }) + add_configs("ppm", { description = "Build with ppm", default = false, type = "boolean" }) + add_configs("analyze", { description = "Build with analyze", default = false, type = "boolean" }) + add_configs("radiance", { description = "Build with radiance", default = false, type = "boolean" }) + + local deps = { + "cfitsio", + "fftw", + "fontconfig", + "libarchive", + "libheif", + "libimagequant", + "libjpeg", + "libjxl", + "lcms", + "imagemagick", + "matio", + "openexr", + "openjpeg", + "poppler", + "libpng", + "libspng", + "libtiff", + "libwebp", + "zlib", + } + + local unsupported_deps = { + "cgif", + "exif", + "nifti", + "openslide", + "highway", + "orc", + "pangocairo", + "pdfium", + "quantizr", + "rsvg", + } + + for _, dep in ipairs(deps) do + add_configs(dep, { description = "Build with " .. dep, default = false, type = "boolean"}) + end + + for _, dep in ipairs(unsupported_deps) do + add_configs(dep, { description = "Build with " .. dep, default = false, type = "boolean", readonly = true}) + end + + add_deps("meson", "ninja") + add_deps("glib", "expat") + if is_plat("windows") then + add_deps("pkgconf") + end + + if is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::libvips") + elseif is_plat("linux") then + add_extsources("apt::libvips", "pacman::libvips") + elseif is_plat("macosx") then + add_extsources("brew::vips") + end + + on_load(function (package) + for _, dep in ipairs(deps) do + if package:config(dep) then + package:add("deps", dep) + end + end + end) + + on_install("windows", "macosx", "linux", "cross", function (package) + io.replace("meson.build", "subdir('tools')", "", {plain = true}) + io.replace("meson.build", "subdir('test')", "", {plain = true}) + io.replace("meson.build", "subdir('fuzz')", "", {plain = true}) + + local configs = {"-Dexamples=false"} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + + local configs_map = { + ["c++"] = "cplusplus", + ["dynamic_modules"] = "modules", + ["libarchive"] = "archive", + ["libheif"] = "heif", + ["libimagequant"] = "imagequant", + ["libjpeg"] = "jpeg", + ["libjxl"] = "jpeg-xl", + ["imagemagick"] = "magick", + ["libpng"] = "png", + ["libspng"] = "spng", + ["libtiff"] = "tiff", + ["libwebp"] = "webp", + } + + table.join2(deps, unsupported_deps) + -- workaround meson option type + table.insert(deps, "dynamic_modules") + table.insert(deps, "introspection") + for name, enabled in table.orderpairs(package:configs()) do + if not package:extraconf("configs", name, "builtin") then + local enabled_string + if table.contains(deps, name) then + enabled_string = (enabled and "enabled" or "disabled") + else + enabled_string = (enabled and "true" or "false") + end + + if configs_map[name] then + name = configs_map[name] + end + table.insert(configs, "-D" .. name .. "=" .. enabled_string) + end + end + + import("package.tools.meson").install(package, configs, { + packagedeps = {"libintl", "libiconv"}, + prefix = path.unix(package:installdir()) -- after xmake v2.9.1 + }) + end) + + on_test(function (package) + assert(package:has_cfuncs("vips_image_new_from_file", {includes = "vips/vips.h"})) + end) diff --git a/packages/l/libwfkafka/xmake.lua b/packages/l/libwfkafka/xmake.lua index 4c74f7494..5378403c8 100644 --- a/packages/l/libwfkafka/xmake.lua +++ b/packages/l/libwfkafka/xmake.lua @@ -10,6 +10,10 @@ package("libwfkafka") add_versions("v0.10.7", "aa9806983f32174597549db4a129e2ee8a3d1f005923fcbb924906bc70c0e123") add_versions("v0.10.8", "bb5654e8011822d4251a7a433cbe4c5ecfd2c65c8f997a8196685742d24bcaf0") add_versions("v0.10.9", "10f695aeb5da87ae138e3bcd2fa10c18aac782b0da20f11b2fd0b7b091d06767") + add_versions("v0.11.1", "06968ed4e43f6676811b620d09eb5c32ac57252305e7e28def6efde8ef1ceb19") + add_versions("v0.11.2", "cc2d18ab2b292e2f0163ef67ef6976912e2a21c271396da0e2151ca8cd22abd3") + add_versions("v0.11.3", "af7adcdd8151f8e72247599a43c28aa849d61ed39e58058cfa80649d011575bc") + add_versions("v0.11.4", "844fd03db120141fa61600b26a4ef35716dc0e75d1e8c8018078eb385cf746a4") add_deps("openssl", "workflow", "lz4", "zstd", "snappy", "zlib") diff --git a/packages/l/libx11/xmake.lua b/packages/l/libx11/xmake.lua index 0cde3c21b..b0d40b34f 100644 --- a/packages/l/libx11/xmake.lua +++ b/packages/l/libx11/xmake.lua @@ -8,6 +8,7 @@ package("libx11") add_versions("1.7.0", "c48ec61785ec68fc6a9a6aca0a9578393414fe2562e3cc9cca30234345c7b6ac") add_versions("1.7.3", "029acf61e7e760a3150716b145a58ce5052ee953e8cccc8441d4f550c420debb") add_versions("1.8.1", "d52f0a7c02a45449f37b0831d99ff936d92eb4ce8b4c97dc17a63cea79ce5a76") + add_versions("1.8.7", "793ebebf569f12c864b77401798d38814b51790fce206e01a431e5feb982e20b") if is_plat("linux") then add_syslinks("dl") diff --git a/packages/l/libxau/xmake.lua b/packages/l/libxau/xmake.lua index 0860b3dc1..82e93b0f6 100644 --- a/packages/l/libxau/xmake.lua +++ b/packages/l/libxau/xmake.lua @@ -5,6 +5,7 @@ package("libxau") set_urls("https://www.x.org/archive/individual/lib/libXau-$(version).tar.gz") add_versions("1.0.10", "51a54da42475d4572a0b59979ec107c27dacf6c687c2b7b04e5cf989a7c7e60c") + add_versions("1.0.11", "3a321aaceb803577a4776a5efe78836eb095a9e44bbc7a465d29463e1a14f189") if is_plat("linux") then add_extsources("apt::libxau-dev", "pacman::libxau") diff --git a/packages/l/libxcb/xmake.lua b/packages/l/libxcb/xmake.lua index 7f4ad4082..2ecd5b42c 100644 --- a/packages/l/libxcb/xmake.lua +++ b/packages/l/libxcb/xmake.lua @@ -1,40 +1,42 @@ local components = { - composite = { apt_package = "apt::libxcb-composite0-dev", default_value = true }, - damage = { apt_package = "apt::libxcb-damage0-dev" , default_value = true}, - dpms = { apt_package = "apt::libxcb-dpms0-dev" , default_value = true}, - dri2 = { apt_package = "apt::libxcb-dri2-0-dev" , default_value = true}, - dri3 = { apt_package = "apt::libxcb-dri3-dev" , default_value = true}, - present = { apt_package = "apt::libxcb-present-dev" , default_value = true}, - glx = { apt_package = "apt::libxcb-glx0-dev" , default_value = true}, - randr = { apt_package = "apt::libxcb-randr0-dev" , default_value = true}, - record = { apt_package = "apt::libxcb-record0-dev" , default_value = true}, - render = { apt_package = "apt::libxcb-render0-dev" , default_value = true}, - resource = { apt_package = "apt::libxcb-xrm-dev" , default_value = true}, - screensaver = { apt_package = "apt::libxcb-screensaver-dev" , default_value = true}, - shape = { apt_package = "apt::libxcb-shape0-dev" , default_value = true}, - shm = { apt_package = "apt::libxcb-shm0-dev" , default_value = true}, - sync = { apt_package = "apt::libxcb-sync0-dev" , default_value = true}, - xevie = { apt_package = "apt::libxcb-xevie0-dev" , default_value = true}, - ["xfree86-dri"] = { apt_package = "apt::libxcb-xfreedri0-dev" , default_value = true}, - xfixes = { apt_package = "apt::libxcb-xfixes0-dev" , default_value = true}, - xinerama = { apt_package = "apt::libxcb-xinerama0-dev" , default_value = true}, - xinput = { apt_package = "apt::libxcb-xinput-dev" , default_value = true}, - xkb = { apt_package = "apt::libxcb-xkb-dev" , default_value = true}, - xprint = { apt_package = "apt::libxcb-xprint0-dev" , default_value = false}, - selinux = { default_value = false}, - xtest = { apt_package = "apt::libxcb-xtest0-dev" , default_value = true}, - xv = { apt_package = "apt::libxcb-xv0-dev" , default_value = true}, - xvmc = { apt_package = "apt::libxcb-xvmc0-dev" , default_value = true}, - ge = { default_value = true} + composite = {apt_package = "apt::libxcb-composite0-dev", default_value = true}, + damage = {apt_package = "apt::libxcb-damage0-dev" , default_value = true}, + dpms = {apt_package = "apt::libxcb-dpms0-dev" , default_value = true}, + dri2 = {apt_package = "apt::libxcb-dri2-0-dev" , default_value = true}, + dri3 = {apt_package = "apt::libxcb-dri3-dev" , default_value = true}, + present = {apt_package = "apt::libxcb-present-dev" , default_value = true}, + glx = {apt_package = "apt::libxcb-glx0-dev" , default_value = true}, + randr = {apt_package = "apt::libxcb-randr0-dev" , default_value = true}, + record = {apt_package = "apt::libxcb-record0-dev" , default_value = true}, + render = {apt_package = "apt::libxcb-render0-dev" , default_value = true}, + resource = {apt_package = "apt::libxcb-xrm-dev" , default_value = true}, + screensaver = {apt_package = "apt::libxcb-screensaver-dev" , default_value = true}, + shape = {apt_package = "apt::libxcb-shape0-dev" , default_value = true}, + shm = {apt_package = "apt::libxcb-shm0-dev" , default_value = true}, + sync = {apt_package = "apt::libxcb-sync0-dev" , default_value = true}, + xevie = {apt_package = "apt::libxcb-xevie0-dev" , default_value = true}, + ["xfree86-dri"] = {apt_package = "apt::libxcb-xfreedri0-dev" , default_value = true}, + xfixes = {apt_package = "apt::libxcb-xfixes0-dev" , default_value = true}, + xinerama = {apt_package = "apt::libxcb-xinerama0-dev" , default_value = true}, + xinput = {apt_package = "apt::libxcb-xinput-dev" , default_value = true}, + xkb = {apt_package = "apt::libxcb-xkb-dev" , default_value = true}, + xprint = {apt_package = "apt::libxcb-xprint0-dev" , default_value = false}, + selinux = {default_value = false}, + xtest = {apt_package = "apt::libxcb-xtest0-dev" , default_value = true}, + xv = {apt_package = "apt::libxcb-xv0-dev" , default_value = true}, + xvmc = {apt_package = "apt::libxcb-xvmc0-dev" , default_value = true}, + ge = {default_value = true} } package("libxcb") set_homepage("https://www.x.org/") set_description("X.Org: Interface to the X Window System protocol") - set_urls("https://xcb.freedesktop.org/dist/libxcb-$(version).tar.gz") + add_urls("https://xcb.freedesktop.org/dist/libxcb-$(version).tar.gz", + "https://www.x.org/archive/individual/lib/libxcb-$(version).tar.gz") add_versions("1.13.1", "f09a76971437780a602303170fd51b5f7474051722bc39d566a272d2c4bde1b5") add_versions("1.14", "2c7fcddd1da34d9b238c9caeda20d3bd7486456fc50b3cc6567185dbd5b0ad02") + add_versions("1.16", "bc0f75f84b28e6496a19a1d094d7e47def861a50cb7cce5b23b62eecdc2a4479") for name, opt in pairs(components) do add_configs(name, {description = format("Enable %s submodule (default is %s).", name, opt.default_value), default = opt.default_value}) @@ -63,7 +65,8 @@ package("libxcb") "--disable-dependency-tracking", "--disable-silent-rules", "--enable-devel-docs=no", - "--with-doxygen=no"} + "--with-doxygen=no", + "PYTHON=python3"} table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) if package:is_plat("linux") and package:config("pic") ~= false then table.insert(configs, "--with-pic") @@ -71,7 +74,11 @@ package("libxcb") for name, opt in pairs(components) do table.insert(configs, format("--enable-%s=%s", name, package:config(name) and "yes" or "no")) end - import("package.tools.autoconf").install(package, configs) + if package:is_plat("macosx") and package:is_cross() then + import("package.tools.autoconf").install(package, configs, {cflags = "-arch " .. package:arch(), shflags = "-arch " .. package:arch()}) + else + import("package.tools.autoconf").install(package, configs) + end end) on_test(function (package) diff --git a/packages/l/libxcomposite/xmake.lua b/packages/l/libxcomposite/xmake.lua new file mode 100644 index 000000000..2faea9716 --- /dev/null +++ b/packages/l/libxcomposite/xmake.lua @@ -0,0 +1,29 @@ +package("libxcomposite") + set_homepage("https://www.x.org/") + set_description("libXcomposite provides an X Window System client interface to the Composite extension to the X protocol.") + + set_urls("https://www.x.org/archive/individual/lib/libXcomposite-$(version).tar.gz") + + add_versions("0.4.6", "3599dfcd96cd48d45e6aeb08578aa27636fa903f480f880c863622c2b352d076") + + if is_plat("linux") then + add_extsources("apt::libxcomposite-dev") + end + + if is_plat("macosx", "linux") then + add_deps("pkg-config", "libx11", "libxext", "xorgproto", "libxfixes") + end + + on_install("macosx", "linux", function (package) + local configs = {"--sysconfdir=" .. package:installdir("etc"), + "--localstatedir=" .. package:installdir("var"), + "--disable-dependency-tracking", + "--disable-silent-rules"} + table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("XCompositeRedirectWindow", {includes = "X11/extensions/Xcomposite.h"})) + end) \ No newline at end of file diff --git a/packages/l/libxdmcp/xmake.lua b/packages/l/libxdmcp/xmake.lua index 7fcf502cc..8f8359a9e 100644 --- a/packages/l/libxdmcp/xmake.lua +++ b/packages/l/libxdmcp/xmake.lua @@ -3,8 +3,9 @@ package("libxdmcp") set_homepage("https://www.x.org/") set_description("X.Org: X Display Manager Control Protocol library") - set_urls("https://www.x.org/archive/individual/lib/libXdmcp-$(version).tar.bz2") - add_versions("1.1.3", "20523b44aaa513e17c009e873ad7bbc301507a3224c232610ce2e099011c6529") + set_urls("https://www.x.org/archive/individual/lib/libXdmcp-$(version).tar.gz") + add_versions("1.1.3", "2ef9653d32e09d1bf1b837d0e0311024979653fe755ad3aaada8db1aa6ea180c") + add_versions("1.1.4", "55041a8ff8992ab02777478c4b19c249c0f8399f05a752cb4a1a868a9a0ccb9a") if is_plat("linux") then add_extsources("apt::libxdmcp-dev", "pacman::libxmdcp") diff --git a/packages/l/libxext/xmake.lua b/packages/l/libxext/xmake.lua index cbb23bc62..e1e1acbab 100644 --- a/packages/l/libxext/xmake.lua +++ b/packages/l/libxext/xmake.lua @@ -5,6 +5,7 @@ package("libxext") set_urls("https://www.x.org/archive/individual/lib/libXext-$(version).tar.gz") add_versions("1.3.5", "1a3dcda154f803be0285b46c9338515804b874b5ccc7a2b769ab7fd76f1035bd") + add_versions("1.3.6", "1a0ac5cd792a55d5d465ced8dbf403ed016c8e6d14380c0ea3646c4415496e3d") if is_plat("linux") then add_extsources("apt::libxext-dev") diff --git a/packages/l/libxi/xmake.lua b/packages/l/libxi/xmake.lua index 1baa999c4..bb475db4e 100644 --- a/packages/l/libxi/xmake.lua +++ b/packages/l/libxi/xmake.lua @@ -3,9 +3,10 @@ package("libxi") set_homepage("https://www.x.org/") set_description("X.Org: Library for the X Input Extension") - set_urls("https://www.x.org/archive/individual/lib/libXi-$(version).tar.bz2") - add_versions("1.7.10", "36a30d8f6383a72e7ce060298b4b181fd298bc3a135c8e201b7ca847f5f81061") - add_versions("1.8", "2ed181446a61c7337576467870bc5336fc9e222a281122d96c4d39a3298bba00") + set_urls("https://www.x.org/archive/individual/lib/libXi-$(version).tar.gz") + add_versions("1.7.10", "b51e106c445a49409f3da877aa2f9129839001b24697d75a54e5c60507e9a5e3") + add_versions("1.8", "c80fd200a1190e4406bb4cc6958839d9651638cb47fa546a595d4bebcd3b9e2d") + add_versions("1.8.1", "3b5f47c223e4b63d7f7fe758886b8bf665b20a7edb6962c423892fd150e326ea") if is_plat("linux") then add_extsources("apt::libxi-dev") diff --git a/packages/l/libxlsxwriter/xmake.lua b/packages/l/libxlsxwriter/xmake.lua new file mode 100644 index 000000000..c8ff877bd --- /dev/null +++ b/packages/l/libxlsxwriter/xmake.lua @@ -0,0 +1,88 @@ +package("libxlsxwriter") + set_homepage("https://libxlsxwriter.github.io") + set_description("A C library for creating Excel XLSX files.") + set_license("BSD-2-Clause") + + add_urls("https://github.com/jmcnamara/libxlsxwriter/archive/refs/tags/RELEASE_$(version).tar.gz", + "https://github.com/jmcnamara/libxlsxwriter.git") + + add_versions("1.1.5", "12843587d591cf679e6ec63ecc629245befec2951736804a837696cdb5d61946") + + add_configs("tmpfile", {description = "Use the C standard library's tmpfile()", default = false, type = "boolean"}) + add_configs("md5", {description = "Build libxlsxwriter without third party MD5 lib", default = false, type = "boolean"}) + add_configs("openssl_md5", {description = "Build libxlsxwriter with the OpenSSL MD5 lib", default = false, type = "boolean"}) + add_configs("mem_file", {description = "Use fmemopen()/open_memstream() in place of temporary files", default = false, type = "boolean"}) + add_configs("64", {description = "Enable 64-bit filesystem support", default = true, type = "boolean"}) + add_configs("dtoa", {description = "Use the locale independent third party Milo Yip DTOA library", default = false, type = "boolean"}) + + add_deps("cmake") + add_deps("zlib") + + on_load(function (package) + if package:is_plat("android") then + import("core.tool.toolchain") + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndk_sdkver = ndk:config("ndk_sdkver") + assert(ndk_sdkver and tonumber(ndk_sdkver) > 21, "package(libxlsxwriter): need ndk api level > 21 for android") + end + if package:config("openssl_md5") then + package:add("deps", "openssl") + end + if not package:is_plat("linux", "bsd", "mingw") then + package:add("deps", "minizip") + end + end) + + on_install(function (package) + local configs = {"-DBUILD_TESTS=OFF", "-DBUILD_EXAMPLES=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DUSE_STATIC_MSVC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + if package:is_debug() then + io.replace("CMakeLists.txt", [[set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\"")]], "", {plain = true}) + else + io.replace("CMakeLists.txt", [[set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Ox /Zi /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\"")]], "", {plain = true}) + end + end + table.insert(configs, "-DUSE_STANDARD_TMPFILE=" .. (package:config("tmpfile") and "ON" or "OFF")) + table.insert(configs, "-DUSE_NO_MD5=" .. (package:config("md5") and "OFF" or "ON")) + table.insert(configs, "-DUSE_OPENSSL_MD5=" .. (package:config("openssl_md5") and "ON" or "OFF")) + table.insert(configs, "-DUSE_MEM_FILE=" .. (package:config("mem_file") and "ON" or "OFF")) + table.insert(configs, "-DIOAPI_NO_64=" .. (package:config("64") and "OFF" or "ON")) + table.insert(configs, "-DUSE_DTOA_LIBRARY=" .. (package:config("dtoa") and "ON" or "OFF")) + + io.replace("include/xlsxwriter/packager.h", "minizip/", "", {plain = true}) + io.replace("src/packager.c", "minizip/", "", {plain = true}) + + local packagedeps + if package:is_plat("wasm") then + table.insert(configs, "-DUSE_SYSTEM_MINIZIP=ON") + if package:version():le("1.1.5") then + io.replace("CMakeLists.txt", [[find_package(ZLIB REQUIRED "1.0")]], "", {plain = true}) + io.replace("CMakeLists.txt", [[find_package(MINIZIP REQUIRED "1.0")]], "", {plain = true}) + else + io.replace("CMakeLists.txt", [[find_package(ZLIB "1.0" REQUIRED)]], "", {plain = true}) + io.replace("CMakeLists.txt", [[find_package(MINIZIP "1.0" REQUIRED)]], "", {plain = true}) + end + packagedeps = {"minizip", "zlib"} + elseif package:is_plat("linux", "bsd", "mingw") then + table.insert(configs, "-DUSE_SYSTEM_MINIZIP=OFF") + io.replace("CMakeLists.txt", [["1.0"]], "", {plain = true}) + else + table.insert(configs, "-DUSE_SYSTEM_MINIZIP=ON") + if package:version():le("1.1.5") then + io.replace("CMakeLists.txt", [[find_package(ZLIB REQUIRED "1.0")]], "find_package(ZLIB REQUIRED)", {plain = true}) + io.replace("CMakeLists.txt", [[find_package(MINIZIP REQUIRED "1.0")]], "", {plain = true}) + else + io.replace("CMakeLists.txt", [[find_package(ZLIB "1.0" REQUIRED)]], "find_package(ZLIB REQUIRED)", {plain = true}) + io.replace("CMakeLists.txt", [[find_package(MINIZIP "1.0" REQUIRED)]], "", {plain = true}) + end + packagedeps = {"minizip"} + end + import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps}) + end) + + on_test(function (package) + assert(package:has_cfuncs("workbook_new", {includes = "xlsxwriter.h"})) + end) diff --git a/packages/l/libxmake/xmake.lua b/packages/l/libxmake/xmake.lua index 17eb3fd84..2a8ee5871 100644 --- a/packages/l/libxmake/xmake.lua +++ b/packages/l/libxmake/xmake.lua @@ -8,6 +8,9 @@ package("libxmake") "https://github.com/xmake-io/xmake.git", "https://gitlab.com/tboox/xmake.git") + add_versions("v2.9.2", "1f617b6a4568c7eb3e8ab0f3a67c16989245adc547e3a7d1fd861acb308fb5b2") + add_versions("v2.9.1", "a31dbef8c303aea1268068b4b1ac1aec142ac4124c7cb7d9c7eeb57c414f8d15") + add_versions("v2.8.9", "5f793c393346ef80e47f083ade4d3c2fdfc448658a7917fda35ccd7bd2b911b8") add_versions("v2.7.9", "9b42d8634833f4885b05b89429dd60044dca99232f6096320b8d857fb33d2aef") add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) diff --git a/packages/l/libxrandr/xmake.lua b/packages/l/libxrandr/xmake.lua index 208722dc8..71b06189b 100644 --- a/packages/l/libxrandr/xmake.lua +++ b/packages/l/libxrandr/xmake.lua @@ -3,8 +3,9 @@ package("libxrandr") set_homepage("https://www.x.org/") set_description("X.Org: X Resize, Rotate and Reflection extension library") - set_urls("https://www.x.org/archive/individual/lib/libXrandr-$(version).tar.bz2") - add_versions("1.5.2", "8aea0ebe403d62330bb741ed595b53741acf45033d3bda1792f1d4cc3daee023") + set_urls("https://www.x.org/archive/individual/lib/libXrandr-$(version).tar.gz") + add_versions("1.5.2", "3f10813ab355e7a09f17e147d61b0ce090d898a5ea5b5519acd0ef68675dcf8e") + add_versions("1.5.4", "c72c94dc3373512ceb67f578952c5d10915b38cc9ebb0fd176a49857b8048e22") if is_plat("linux") then add_extsources("apt::libxrandr-dev") diff --git a/packages/l/libyuv/xmake.lua b/packages/l/libyuv/xmake.lua new file mode 100644 index 000000000..8a0d76cfe --- /dev/null +++ b/packages/l/libyuv/xmake.lua @@ -0,0 +1,30 @@ +package("libyuv") + + set_homepage("https://chromium.googlesource.com/libyuv/libyuv/") + set_description("libyuv is an open source project that includes YUV scaling and conversion functionality.") + set_license("BSD-3-Clause") + + set_urls("https://chromium.googlesource.com/libyuv/libyuv.git") + add_versions("2023.10.27", "31e1d6f896615342d5d5b6bde8f7b50b3fd698dc") + + add_deps("cmake") + + on_install("windows", "linux", "macosx", "android", "cross", "bsd", "mingw", function (package) + local configs = {"-DTEST=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + + io.replace("CMakeLists.txt", "INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin )", "", {plain = true}) + import("package.tools.cmake").install(package, configs) + + if package:is_plat("macosx", "linux", "android") then + if package:config("shared") then + os.tryrm(package:installdir("lib", "*.a")) + else + os.tryrm(package:installdir("lib", "*.so")) + end + end + end) + + on_test(function (package) + assert(package:has_cfuncs("I420Rotate", {includes = "libyuv/rotate.h"})) + end) diff --git a/packages/l/libzip/xmake.lua b/packages/l/libzip/xmake.lua index 9e686dc4d..87f9006eb 100644 --- a/packages/l/libzip/xmake.lua +++ b/packages/l/libzip/xmake.lua @@ -9,6 +9,7 @@ package("libzip") return tostring(version):sub(2) end}) add_urls("https://github.com/nih-at/libzip.git") + add_versions("v1.10.1", "9669ae5dfe3ac5b3897536dc8466a874c8cf2c0e3b1fdd08d75b273884299363") add_versions("v1.8.0", "30ee55868c0a698d3c600492f2bea4eb62c53849bcf696d21af5eb65f3f3839e") add_versions("v1.9.2", "fd6a7f745de3d69cf5603edc9cb33d2890f0198e415255d0987a0cf10d824c6f") diff --git a/packages/l/lief/xmake.lua b/packages/l/lief/xmake.lua index 4c7d4c0df..1dddacfbf 100644 --- a/packages/l/lief/xmake.lua +++ b/packages/l/lief/xmake.lua @@ -8,6 +8,8 @@ package("lief") "https://github.com/lief-project/LIEF.git") add_versions("0.10.1", "6f30c98a559f137e08b25bcbb376c0259914b33c307b8b901e01ca952241d00a") add_versions("0.11.5", "6d6d57304a56850958e4ce54f3da2ea2b9eb856ccbab61c6cde9cba15d7c9da5") + add_versions("0.14.0", "400804e38cb5ce8d15fb52a4db6345f02da7b2e5cb773665712283001482b808") + add_versions("0.14.1", "92916dcb3178353d863aef4f409186889983c56e025b774741d5316a72ec3a7d") add_deps("cmake") @@ -20,6 +22,10 @@ package("lief") add_configs("oat", {description = "Enable Oat module.", default = false, type = "boolean"}) add_configs("art", {description = "Enable Art module.", default = false, type = "boolean"}) + if is_plat("windows") then + add_syslinks("advapi32") + end + on_install("macosx", "linux", "windows", function (package) local configs = {"-DLIEF_PYTHON_API=OFF", "-DLIEF_DOC=OFF", "-DLIEF_TESTS=OFF", "-DLIEF_EXAMPLES=OFF", "-DLIEF_INSTALL_PYTHON=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) @@ -42,6 +48,11 @@ package("lief") parse_entry = "macho_parse" end if parse_entry then - assert(package:has_cfuncs(parse_entry, {includes = "LIEF/LIEF.h"})) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + ]] .. parse_entry .. [[(""); + } + ]]}, {configs = {languages = "c"}})) end end) diff --git a/packages/l/lightgbm/xmake.lua b/packages/l/lightgbm/xmake.lua index 20b34a1fd..ba3a4b182 100644 --- a/packages/l/lightgbm/xmake.lua +++ b/packages/l/lightgbm/xmake.lua @@ -1,16 +1,18 @@ package("lightgbm") - set_homepage("https://github.com/microsoft/LightGBM") set_description("LightGBM is a gradient boosting framework that uses tree based learning algorithms.") set_license("MIT") add_urls("https://github.com/microsoft/LightGBM/releases/download/v$(version)/lightgbm-$(version).tar.gz") + add_versions("4.3.0", "006f5784a9bcee43e5a7e943dc4f02de1ba2ee7a7af1ee5f190d383f3b6c9ebe") + add_versions("4.2.0", "8a4d051df2ab2218998a16f7712e843ee9e96d8b09ffbfcc18533da127e0da02") add_versions("3.3.2", "5d25d16e77c844c297ece2044df57651139bc3c8ad8c4108916374267ac68b64") add_versions("3.2.1", "bd98e3b501b4c24dc127f4ad93e467f42923fe3eefa99e143b5b93158f024395") add_configs("gpu", {description = "Enable GPU-accelerated training.", default = false, type = "boolean"}) add_deps("cmake") + on_load("windows|x64", "linux", function (package) if package:config("gpu") then package:add("deps", "opencl") @@ -22,8 +24,11 @@ package("lightgbm") end) on_install("windows|x64", "linux", function (package) - os.cd("compile") - local configs = {"-DBoost_USE_STATIC_LIBS=ON"} + if package:version():lt("4.2.0") then + os.cd("compile") + end + + local configs = {"-DBoost_USE_STATIC_LIBS=ON", "-DBUILD_CLI=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_STATIC_LIB=" .. (package:config("shared") and "OFF" or "ON")) if package:is_plat("windows") then diff --git a/packages/l/lightningscanner/xmake.lua b/packages/l/lightningscanner/xmake.lua index e68618345..aa1aa3c25 100644 --- a/packages/l/lightningscanner/xmake.lua +++ b/packages/l/lightningscanner/xmake.lua @@ -1,18 +1,19 @@ package("lightningscanner") - set_homepage("https://localcc.github.io/LightningScanner/") set_description("A lightning-fast memory signature/pattern scanner, capable of scanning gigabytes of data per second.") set_license("MIT") add_urls("https://github.com/localcc/LightningScanner/archive/refs/tags/$(version).tar.gz", "https://github.com/localcc/LightningScanner.git") - add_versions("v1.0.0", "30052ca62fee13ca28d500802298822ac6d32252") + + add_versions("v1.0.2", "09d2f0d8b84e64542bce6096922efb8c7a6683038f2f11321931928a815055ac") + add_versions("v1.0.0", "747ec772a9068c9818c174ab46f9900e105d3550820c0afa7ba6f38341779c01") add_deps("cmake") - on_install("windows", "linux", "macosx", "bsd", function (package) + on_install("windows|x64", "windows|x86", "linux", "macosx|x86_64", "bsd", function (package) local configs = { "-DLIGHTNING_SCANNER_INSTALL=ON", "-DLIGHTNING_SCANNER_BUILD_BENCH=OFF", "-DLIGHTNING_SCANNER_BUILD_DOCS=OFF", "-DLIGHTNING_SCANNER_BUILD_TESTS=OFF" } - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) end) diff --git a/packages/l/linalg/xmake.lua b/packages/l/linalg/xmake.lua new file mode 100644 index 000000000..b0512c4df --- /dev/null +++ b/packages/l/linalg/xmake.lua @@ -0,0 +1,24 @@ +package("linalg") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/sgorsten/linalg") + set_description("linalg.h is a single header, public domain, short vector math library for C++.") + set_license("Unlicense license") + + add_urls("https://github.com/sgorsten/linalg/archive/refs/tags/$(version).tar.gz", + "https://github.com/sgorsten/linalg.git") + + add_versions("v2.2", "28640228988186EDAF7729177BFAB4C91170B303AD489407A4228CEB55A73EC2") + + on_install("windows", "linux", "macosx", function (package) + os.cp("linalg.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + using namespace linalg::aliases; + float4 test(float3 a, float3 b, float3 c) { + float3 n = cross(b-a, c-a); + return {n, -dot(n,a)}; + } + ]]}, {configs = {languages = "c++11"}, includes = "linalg.h"})) + end) diff --git a/packages/l/linmath.h/xmake.lua b/packages/l/linmath.h/xmake.lua new file mode 100644 index 000000000..62664c41c --- /dev/null +++ b/packages/l/linmath.h/xmake.lua @@ -0,0 +1,15 @@ +package("linmath.h") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/datenwolf/linmath.h") + set_description("a lean linear math library, aimed at graphics programming. Supports vec3, vec4, mat4x4 and quaternions") + + add_urls("https://github.com/datenwolf/linmath.h.git") + add_versions("2022.06.19", "3eef82841046507e16a0f6194a61cee2eadd34b3") + + on_install(function (package) + os.cp("linmath.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:has_cfuncs("mat4x4_mul", {includes = "linmath.h"})) + end) diff --git a/packages/l/linux-headers/xmake.lua b/packages/l/linux-headers/xmake.lua index c11cbb289..b6ccd65fe 100644 --- a/packages/l/linux-headers/xmake.lua +++ b/packages/l/linux-headers/xmake.lua @@ -10,12 +10,13 @@ package("linux-headers") {version = function (version) return "v" .. version:major() .. ".x/linux-" .. version end}) - add_versions("4.20.9", "b5de28fd594a01edacd06e53491ad0890293e5fbf98329346426cf6030ef1ea6") - add_versions("5.0.8", "11908044e8cce1e093141f8da594708d45d05d0381676ae9aa3d8aeaf7c85435") - add_versions("5.9.16", "b0d7abae88e5f91893627c645e680a95c818defd1b4fcaf3e2afb4b2b6b4ab86") + add_versions("4.20.9", "b5de28fd594a01edacd06e53491ad0890293e5fbf98329346426cf6030ef1ea6") + add_versions("5.0.8", "11908044e8cce1e093141f8da594708d45d05d0381676ae9aa3d8aeaf7c85435") + add_versions("5.9.16", "b0d7abae88e5f91893627c645e680a95c818defd1b4fcaf3e2afb4b2b6b4ab86") add_versions("5.10.46", "569122a39c6b325befb9ac1c07da0c53e6363b3baacd82081d131b06c1dc1415") - add_versions("5.16.9", "1660e7228ec299c187c19739d115ded97f6b1be05a24986c4c443e7c5e8b744f") - add_versions("5.15", "57b2cf6991910e3b67a1b3490022e8a0674b6965c74c12da1e99d138d1991ee8") + add_versions("5.16.9", "1660e7228ec299c187c19739d115ded97f6b1be05a24986c4c443e7c5e8b744f") + add_versions("5.15", "57b2cf6991910e3b67a1b3490022e8a0674b6965c74c12da1e99d138d1991ee8") + add_versions("6.7.6", "e489ec0e1370d089b446d565aded7a698093d2b7c4122a18f21edb6ef93d37d3") add_configs("driver_modules", {description = "Enable driver modules files.", default = false, type = "boolean"}) diff --git a/packages/l/linux-syscall-support/xmake.lua b/packages/l/linux-syscall-support/xmake.lua new file mode 100644 index 000000000..de863271a --- /dev/null +++ b/packages/l/linux-syscall-support/xmake.lua @@ -0,0 +1,15 @@ +package("linux-syscall-support") + set_homepage("https://chromium.googlesource.com/linux-syscall-support") + set_description("Linux Syscall Support provides a header file that can be included into your application whenever you need to make direct system calls.") + set_license("BSD-3-Clause") + + add_urls("https://chromium.googlesource.com/linux-syscall-support.git") + add_versions("v2022.10.12", "9719c1e1e676814c456b55f5f070eabad6709d31") + + on_install("linux", function (package) + os.cp("linux_syscall_support.h", package:installdir("include/lss")) + end) + + on_test(function (package) + assert(package:has_cfuncs("sys_open", {includes = "lss/linux_syscall_support.h"})) + end) diff --git a/packages/l/linux-tools/modules/bpftool.lua b/packages/l/linux-tools/modules/bpftool.lua index 32b85d316..8558d77b0 100644 --- a/packages/l/linux-tools/modules/bpftool.lua +++ b/packages/l/linux-tools/modules/bpftool.lua @@ -1,5 +1,5 @@ function load(package) - package:add("deps", "libcap", "libelf", "zlib", {host = true}) + package:add("deps", "libcap", "elfutils", "zlib", {host = true}) package:add("deps", "python 3.x", {kind = "binary"}) package:addenv("PATH", "sbin") end @@ -8,7 +8,7 @@ function install(package) local cflags = {} local ldflags = {} - for _, dep in ipairs(package:orderdeps()) do + for _, dep in ipairs(package:librarydeps()) do local fetchinfo = dep:fetch() if fetchinfo then for _, includedir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do @@ -30,6 +30,8 @@ function install(package) os.cd("tools/bpf/bpftool") io.replace("Makefile", "prefix ?= /usr/local", "prefix ?= " .. package:installdir(), {plain = true}) io.replace("Makefile", "bash_compdir ?= /usr/share", "bash_compdir ?= " .. package:installdir("share"), {plain = true}) + io.replace("Makefile", "-lelf -lz", "-lelf -lzstd -lz", {plain = true}) + io.replace("Makefile", "$(Q)$(LLVM_STRIP) -g $@", "echo skip", {plain = true}) import("package.tools.make").build(package, configs) os.vrunv("make", table.join("install", configs)) end diff --git a/packages/l/linux-tools/xmake.lua b/packages/l/linux-tools/xmake.lua index 6b901ceed..330eb941f 100644 --- a/packages/l/linux-tools/xmake.lua +++ b/packages/l/linux-tools/xmake.lua @@ -14,9 +14,13 @@ package("linux-tools") add_versions("5.0.8", "11908044e8cce1e093141f8da594708d45d05d0381676ae9aa3d8aeaf7c85435") add_versions("5.9.16", "b0d7abae88e5f91893627c645e680a95c818defd1b4fcaf3e2afb4b2b6b4ab86") add_versions("5.16.9", "1660e7228ec299c187c19739d115ded97f6b1be05a24986c4c443e7c5e8b744f") + add_versions("6.7.6", "e489ec0e1370d089b446d565aded7a698093d2b7c4122a18f21edb6ef93d37d3") add_configs("bpftool", { description = "Enable bpftool.", default = true, type = "boolean"}) + add_patches("6.7.6", "https://cdn.kernel.org/pub/linux/kernel/v6.x/patch-6.7.6.xz", + "a394326aa325f8a930a4ce33c69ba7b8b454aef1107a4d3c2a8ae12908615fc4", {reverse = true}) + local modules = {"bpftool"} on_load(function (package) diff --git a/packages/l/littlefs/xmake.lua b/packages/l/littlefs/xmake.lua index 3c7f680ef..5a543632d 100644 --- a/packages/l/littlefs/xmake.lua +++ b/packages/l/littlefs/xmake.lua @@ -4,6 +4,9 @@ package("littlefs") add_urls("https://github.com/littlefs-project/littlefs/archive/refs/tags/$(version).tar.gz", "https://github.com/littlefs-project/littlefs.git") + add_versions("v2.9.3", "9cf2e7db673ea27d967a54cdafe8f55a7ffe27c63a2070ff7424fadd559cad67") + add_versions("v2.9.2", "97675486790a09d335fa0955da105a0a08e1ff336208b77730d92a041b202015") + add_versions("v2.8.2", "9f46d00d6d6ad0a0d72840455ba748efcad84b8a236bd8b9d3a08e3af7953386") add_versions("v2.5.0", "07de0d788c2a849a137715b48cce9daeb3fdc7570873ac6faae4566432e140c8") on_install(function (package) diff --git a/packages/l/llvm-arm/xmake.lua b/packages/l/llvm-arm/xmake.lua new file mode 100644 index 000000000..25a5e7c8c --- /dev/null +++ b/packages/l/llvm-arm/xmake.lua @@ -0,0 +1,32 @@ +package("llvm-arm") + + set_kind("toolchain") + set_homepage("https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm") + set_description("A project dedicated to building LLVM toolchain for 32-bit Arm embedded targets.") + + if is_host("windows") then + set_urls("https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-$(version)/LLVMEmbeddedToolchainForArm-$(version)-Windows-x86_64.zip") + add_versions("17.0.1", "0ac5aa29d53227bf71c546f7426dde302ad71f064dcae498c5eec0d99ede6739") + elseif is_host("linux") then + if os.arch():find("arm64.*") then + set_urls("https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-$(version)/LLVMEmbeddedToolchainForArm-$(version)-Linux-AArch64.tar.xz") + add_versions("17.0.1", "becd922bec5d5e5683d824fa91ebabe5e0e286b97e209ebd3398f56f5b9ef4ed") + else + set_urls("https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-$(version)/LLVMEmbeddedToolchainForArm-$(version)-Linux-x86_64.tar.xz") + add_versions("17.0.1", "eb7bff945d3c19589ab596a9829de6f05f86b73f52f80da253232360c99ea68f") + end + + end + + on_install("@windows", "@linux", function (package) + os.vcp("*", package:installdir()) + end) + + on_test(function (package) + local clang = "clang" + if clang and is_host("windows") then + clang = clang .. ".exe" + end + os.vrunv(clang, {"--version"}) + end) + diff --git a/packages/l/llvm-mingw/xmake.lua b/packages/l/llvm-mingw/xmake.lua index 9cf21039c..ac77ecf96 100644 --- a/packages/l/llvm-mingw/xmake.lua +++ b/packages/l/llvm-mingw/xmake.lua @@ -10,32 +10,43 @@ package("llvm-mingw") add_versions("20201020", "4f07721a81a3ba0980fc089e839d1f1a5784bbc8cee1332c15cf1b6ba24525d6") add_versions("20211002", "e4faaea995c980f4b0808cc4ec17d5ea9fc2c83449f0cb3a8af07e52abe26679") add_versions("20220323", "34889c54195c3d677c3751fd53fa49d005e9750651f3ce994817a3c7670e7eb5") + add_versions("20240417", "37bb76226680075f053d7925821f6ceb8b03f7a93936ec83f9a3bef5734195be") elseif os.arch() == "arm64" then set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-aarch64.zip") add_versions("20201020", "57d6e0fff94774ccd958a3d0174686189d3ec1cb5981eb4ea37fc82a007cc674") add_versions("20211002", "1f618c4323a7e64df8a97d4fe8a933e6c8bdc131c91f90b89888927ebd179f83") add_versions("20220323", "f8d7d30a5eb50e9e9769d8c544644e6d25c822913e0944b21c94b75421942085") + add_versions("20240417", "d021a71647f1f8062087a262f6b2880276b63775bedd25f3a6ca290d39505427") elseif os.arch():find("arm.*") then set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-armv7.zip") add_versions("20201020", "c086562124fc79e157d2cb01eacd7bd3e937d488bacdac138ee45ed6a39d3b6c") add_versions("20211002", "a37c4cbd4b7c53f7c931d4ca84e1f9847315b528129310fefeafae48edd65407") add_versions("20220323", "1008e8eeef74194c4662bef5a2afa4691a31d894fdad8ebf2ddc27dbf6e98c86") + add_versions("20240417", "fa6171afd4f84199af9b4546f49c6eb5280843317431f0da67d2241087991f1c") else set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-x86_64.zip") add_versions("20201020", "8f619911b61554d0394537305157f63284fab949ad0abed137b84440689fa77e") add_versions("20211002", "cd0c506789eb2fd3179836e55a7dd13ceade810ec094aeec28fa5a531423e7f8") add_versions("20220323", "3014a95e4ec4d5c9d31f52fbd6ff43174a0d9c422c663de7f7be8c2fcc9d837a") + add_versions("20240417", "afa69ac40f08721658bbd6826b633f3b54579d7ae4cab1f624cc6e2efd05bf0e") end elseif is_host("linux") then -- Built on Ubuntu but hopefully run on other distributions if os.arch() == "x86_64" then - set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-ubuntu-18.04-x86_64.tar.xz") - add_versions("20211002", "30e9400783652091d9278ce21e5c170d01a5f44e4f1a25717b63cd9ad9fbe13b") - add_versions("20220323", "6d69ab28a3a9a2b7159178ff11cae8545fd44c9343573900fcf60434539695d8") + set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-ubuntu-18.04-x86_64.tar.xz", {alias = "<20230320"}) + set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-ubuntu-20.04-x86_64.tar.xz", {alias = ">20230320"}) + + add_versions("<20230320:20211002", "30e9400783652091d9278ce21e5c170d01a5f44e4f1a25717b63cd9ad9fbe13b") + add_versions("<20230320:20220323", "6d69ab28a3a9a2b7159178ff11cae8545fd44c9343573900fcf60434539695d8") + + add_versions(">20230320:20240417", "d28ce4168c83093adf854485446011a0327bad9fe418014de81beba233ce76f1") elseif os.arch() == "arm64" then - set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-ubuntu-18.04-aarch64.tar.xz") - add_versions("20211002", "9a26079af16713894e8a11c77e38896c4040b98daceca4408333bd1053c1a3d5") - add_versions("20220323", "89d4dc4515d7203b658f8257b19943a4055831a3738ed79bc179a1abcc83cde6") + set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-ubuntu-18.04-aarch64.tar.xz", {alias = "<20230320"}) + set_urls("https://github.com/mstorsjo/llvm-mingw/releases/download/$(version)/llvm-mingw-$(version)-ucrt-ubuntu-20.04-aarch64.tar.xz", {alias = ">20230320"}) + add_versions("<20230320:20211002", "9a26079af16713894e8a11c77e38896c4040b98daceca4408333bd1053c1a3d5") + add_versions("<20230320:20220323", "89d4dc4515d7203b658f8257b19943a4055831a3738ed79bc179a1abcc83cde6") + + add_versions(">20230320:20240417", "c6d449ccf0a4e66bd78b341d39474318f0027bf6c5471db8cc4c8783f6c188ca") end end diff --git a/packages/l/llvm/xmake.lua b/packages/l/llvm/xmake.lua index eb18f81d7..a2123be30 100644 --- a/packages/l/llvm/xmake.lua +++ b/packages/l/llvm/xmake.lua @@ -1,49 +1,7 @@ package("llvm") - set_kind("toolchain") set_homepage("https://llvm.org/") set_description("The LLVM Compiler Infrastructure") - - if is_plat("windows") then - if is_arch("x86") then - set_urls("https://github.com/xmake-mirror/llvm-windows/releases/download/$(version)/clang+llvm-$(version)-win32.zip") - add_versions("11.0.0", "268043ae0b656cf6272ccb9b8e3f21f51170b74ed8997ddc0b99587983b821ca") - add_versions("14.0.0", "63afc3c472cb279978c5a7efc25b8783a700aeb416df67886b7057eba52a8742") - add_versions("15.0.7", "8dbabb2194404220f8641b4b18b24b36eca0ae751380c23fc7743097e205b95f") - add_versions("16.0.6", "5e1f560f75e7a4c7a6509cf7d9a28b4543e7afcb4bcf4f747e9f208f0efa6818") - else - set_urls("https://github.com/xmake-mirror/llvm-windows/releases/download/$(version)/clang+llvm-$(version)-win64.zip") - add_versions("11.0.0", "db5b3a44f8f784ebc71f716b54eb63c0d8d21aead12449f36291ab00820271c7") - add_versions("14.0.0", "c1e1ddf11aa73c58073956d9217086550544328ed5e6ec64c1a709badb231711") - add_versions("15.0.7", "7d29ca82f8b73e9973209e90428ec9f3fbd3b01925bd26e34f59e959e9ea7eb3") - add_versions("16.0.6", "7adb1a630b6cc676a4b983aca9b01e67f770556c6e960e9ee9aa7752c8beb8a3") - end - elseif is_plat("macosx") then - if is_arch("x86_64") then - set_urls("https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/clang+llvm-$(version)-x86_64-apple-darwin.tar.xz") - add_versions("11.0.0", "b93886ab0025cbbdbb08b46e5e403a462b0ce034811c929e96ed66c2b07fe63a") - add_versions("14.0.0", "cf5af0f32d78dcf4413ef6966abbfd5b1445fe80bba57f2ff8a08f77e672b9b3") - elseif is_arch("arm64") then - set_urls("https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/clang+llvm-$(version)-arm64-apple-darwin21.0.tar.xz") - add_versions("15.0.0", "cfd5c3fa07d7fccea0687f5b4498329a6172b7a15bbc45b547d0ac86bd3452a5") - end - elseif is_plat("bsd") then - if is_arch("x86_64") then - set_urls("https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/clang+llvm-$(version)-amd64-unknown-freebsd13.tar.xz") - add_versions("14.0.0", "b68d73fd57be385e7f06046a87381f7520c8861f492c294e6301d2843d9a1f57") - elseif is_arch("i386") then - set_urls("https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/clang+llvm-$(version)-i386-unknown-freebsd13.tar.xz") - add_versions("14.0.0", "81f49eb466ce9149335ac8918a5f02fa724d562a94464ed13745db0165b4a220") - end - else - set_urls("https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/llvm-project-$(version).src.tar.xz") - add_versions("11.0.0", "b7b639fc675fa1c86dd6d0bc32267be9eb34451748d2efd03f674b773000e92b") - add_versions("14.0.0", "35ce9edbc8f774fe07c8f4acdf89ec8ac695c8016c165dd86b8d10e7cba07e23") - add_versions("15.0.7", "8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6") - add_versions("16.0.5", "37f540124b9cfd4680666e649f557077f9937c9178489cea285a672e714b2863") - add_versions("16.0.6", "ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e") - end - add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) add_configs("all", {description = "Enable all projects.", default = false, type = "boolean"}) @@ -65,11 +23,84 @@ package("llvm") add_configs("libcxxabi", {description = "Enable libcxxabi runtime.", default = true, type = "boolean"}) add_configs("openmp", {description = "Enable openmp runtime.", default = false, type = "boolean"}) + if on_source then + on_source(function (package) + local precompiled = false + if package:is_plat("windows") then + if package:is_arch("x86") then + package:set("urls", "https://github.com/xmake-mirror/llvm-windows/releases/download/$(version)/clang+llvm-$(version)-win32.zip") + package:add("versions", "11.0.0", "268043ae0b656cf6272ccb9b8e3f21f51170b74ed8997ddc0b99587983b821ca") + package:add("versions", "14.0.0", "63afc3c472cb279978c5a7efc25b8783a700aeb416df67886b7057eba52a8742") + package:add("versions", "15.0.7", "8dbabb2194404220f8641b4b18b24b36eca0ae751380c23fc7743097e205b95f") + package:add("versions", "16.0.6", "5e1f560f75e7a4c7a6509cf7d9a28b4543e7afcb4bcf4f747e9f208f0efa6818") + package:add("versions", "17.0.6", "ce78b510603cb3b347788d2f52978e971cf5f55559151ca13a73fd400ad80c41") + package:add("versions", "18.1.1", "9f59dd99d45f64a5c00b00d27da8fe8b5f162905026f5c9ef0ade6e73ae18df3") + precompiled = true + else + package:set("urls", "https://github.com/xmake-mirror/llvm-windows/releases/download/$(version)/clang+llvm-$(version)-win64.zip") + package:add("versions", "11.0.0", "db5b3a44f8f784ebc71f716b54eb63c0d8d21aead12449f36291ab00820271c7") + package:add("versions", "14.0.0", "c1e1ddf11aa73c58073956d9217086550544328ed5e6ec64c1a709badb231711") + package:add("versions", "15.0.7", "7d29ca82f8b73e9973209e90428ec9f3fbd3b01925bd26e34f59e959e9ea7eb3") + package:add("versions", "16.0.6", "7adb1a630b6cc676a4b983aca9b01e67f770556c6e960e9ee9aa7752c8beb8a3") + package:add("versions", "17.0.6", "c480a4c280234b91f7796a1b73b18134ae62fe7c88d2d0c33312d33cb2999187") + package:add("versions", "18.1.1", "28a9fbcd18f1e7e736ece6d663726bc15649f025343c3004dcbfc2d367b9924c") + precompiled = true + end + end + if not precompiled then + package:set("urls", "https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/llvm-project-$(version).src.tar.xz") + package:add("versions", "11.0.0", "b7b639fc675fa1c86dd6d0bc32267be9eb34451748d2efd03f674b773000e92b") + package:add("versions", "14.0.0", "35ce9edbc8f774fe07c8f4acdf89ec8ac695c8016c165dd86b8d10e7cba07e23") + package:add("versions", "15.0.7", "8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6") + package:add("versions", "16.0.5", "37f540124b9cfd4680666e649f557077f9937c9178489cea285a672e714b2863") + package:add("versions", "16.0.6", "ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e") + package:add("versions", "17.0.6", "58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813") + package:add("versions", "18.1.1", "8f34c6206be84b186b4b31f47e1b52758fa38348565953fad453d177ef34c0ad") + end + end) + else + -- After xmake v2.9.5, we'll remove it. + local precompiled = false + if is_plat("windows") then + if is_arch("x86") then + set_urls("https://github.com/xmake-mirror/llvm-windows/releases/download/$(version)/clang+llvm-$(version)-win32.zip") + add_versions("11.0.0", "268043ae0b656cf6272ccb9b8e3f21f51170b74ed8997ddc0b99587983b821ca") + add_versions("14.0.0", "63afc3c472cb279978c5a7efc25b8783a700aeb416df67886b7057eba52a8742") + add_versions("15.0.7", "8dbabb2194404220f8641b4b18b24b36eca0ae751380c23fc7743097e205b95f") + add_versions("16.0.6", "5e1f560f75e7a4c7a6509cf7d9a28b4543e7afcb4bcf4f747e9f208f0efa6818") + add_versions("17.0.6", "ce78b510603cb3b347788d2f52978e971cf5f55559151ca13a73fd400ad80c41") + add_versions("18.1.1", "9f59dd99d45f64a5c00b00d27da8fe8b5f162905026f5c9ef0ade6e73ae18df3") + precompiled = true + else + set_urls("https://github.com/xmake-mirror/llvm-windows/releases/download/$(version)/clang+llvm-$(version)-win64.zip") + add_versions("11.0.0", "db5b3a44f8f784ebc71f716b54eb63c0d8d21aead12449f36291ab00820271c7") + add_versions("14.0.0", "c1e1ddf11aa73c58073956d9217086550544328ed5e6ec64c1a709badb231711") + add_versions("15.0.7", "7d29ca82f8b73e9973209e90428ec9f3fbd3b01925bd26e34f59e959e9ea7eb3") + add_versions("16.0.6", "7adb1a630b6cc676a4b983aca9b01e67f770556c6e960e9ee9aa7752c8beb8a3") + add_versions("17.0.6", "c480a4c280234b91f7796a1b73b18134ae62fe7c88d2d0c33312d33cb2999187") + add_versions("18.1.1", "28a9fbcd18f1e7e736ece6d663726bc15649f025343c3004dcbfc2d367b9924c") + precompiled = true + end + end + if not precompiled then + set_urls("https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/llvm-project-$(version).src.tar.xz") + add_versions("11.0.0", "b7b639fc675fa1c86dd6d0bc32267be9eb34451748d2efd03f674b773000e92b") + add_versions("14.0.0", "35ce9edbc8f774fe07c8f4acdf89ec8ac695c8016c165dd86b8d10e7cba07e23") + add_versions("15.0.7", "8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6") + add_versions("16.0.5", "37f540124b9cfd4680666e649f557077f9937c9178489cea285a672e714b2863") + add_versions("16.0.6", "ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e") + add_versions("17.0.6", "58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813") + add_versions("18.1.1", "8f34c6206be84b186b4b31f47e1b52758fa38348565953fad453d177ef34c0ad") + end + end + on_load(function (package) - if package:is_plat("linux") then + if not package:is_plat("windows", "msys") then package:add("deps", "cmake") package:add("deps", "python 3.x", {kind = "binary", host = true}) package:add("deps", "zlib", "libffi", {host = true}) + end + if package:is_plat("linux") then package:add("deps", "binutils", {host = true}) -- needed for gold and strip end if package:is_plat("linux", "bsd") then @@ -91,11 +122,11 @@ package("llvm") on_fetch("fetch") - on_install("macosx", "windows", "msys", "bsd", function (package) + on_install("windows", "msys", function (package) os.cp("*", package:installdir()) end) - on_install("linux", function (package) + on_install("linux", "macosx|x86_64", "bsd", function (package) local projects = { "bolt", "clang", @@ -165,7 +196,10 @@ package("llvm") table.insert(configs, "-DLLVM_ENABLE_LIBCXX=OFF") table.insert(configs, "-DCLANG_DEFAULT_CXX_STDLIB=libstdc++") -- enable llvm gold plugin for LTO - table.insert(configs, "-DLLVM_BINUTILS_INCDIR=" .. package:dep("binutils"):installdir("include")) + local binutils = package:dep("binutils") + if binutils then + table.insert(configs, "-DLLVM_BINUTILS_INCDIR=" .. binutils:installdir("include")) + end end os.cd("llvm") import("package.tools.cmake").install(package, configs) diff --git a/packages/l/lmdb/port/xmake.lua b/packages/l/lmdb/port/xmake.lua new file mode 100644 index 000000000..65cc03b91 --- /dev/null +++ b/packages/l/lmdb/port/xmake.lua @@ -0,0 +1,29 @@ +option("robust_mutex", {default = false}) +option("tools", {default = false}) + +add_rules("mode.debug", "mode.release") + +target("lmdb") + set_kind("$(kind)") + add_files("mdb.c", "midl.c") + add_headerfiles("lmdb.h") + + add_defines("MDB_USE_ROBUST=" .. (has_config("robust_mutex") and "1" or "0")) + + if is_plat("windows") then + add_syslinks("Advapi32") + if is_kind("shared") then + add_rules("utils.symbols.export_all") + end + elseif is_plat("linux", "bsd") then + add_syslinks("pthread") + end + +if has_config("tools") and (not is_plat("windows")) then + for _, name in ipairs({"mdb_stat", "mdb_copy", "mdb_dump", "mdb_load"}) do + target(name) + set_kind("binary") + add_files(name .. ".c") + add_deps("lmdb") + end +end diff --git a/packages/l/lmdb/xmake.lua b/packages/l/lmdb/xmake.lua new file mode 100644 index 000000000..c30864cfd --- /dev/null +++ b/packages/l/lmdb/xmake.lua @@ -0,0 +1,40 @@ +package("lmdb") + set_homepage("http://www.openldap.org/software/repo.html") + set_description("Read-only mirror of official repo on openldap.org. Issues and pull requests here are ignored. Use OpenLDAP ITS for issues.") + + add_urls("https://github.com/LMDB/lmdb/archive/refs/tags/LMDB_$(version).tar.gz", + "https://github.com/LMDB/lmdb.git") + + add_versions("0.9.31", "dd70a8c67807b3b8532b3e987b0a4e998962ecc28643e1af5ec77696b081c9b0") + + add_configs("robust_mutex", {description = "Enable robust mutex", default = false, type = "boolean"}) + if is_plat("windows") then + add_configs("tools", {description = "Build tools", default = false, type = "boolean", readonly = true}) + else + add_configs("tools", {description = "Build tools", default = false, type = "boolean"}) + end + + if is_plat("windows") then + add_syslinks("Advapi32") + elseif is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + on_install(function (package) + local configs = { + robust_mutex = package:config("robust_mutex"), + tools = package:config("tools"), + } + package:add("defines", "MDB_USE_ROBUST=" .. (configs.robust_mutex and "1" or "0")) + if configs.tools then + package:addenv("PATH", "bin") + end + + os.cd("libraries/liblmdb") + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("mdb_version", {includes = "lmdb.h"})) + end) diff --git a/packages/l/log4cplus/xmake.lua b/packages/l/log4cplus/xmake.lua index 3699d2299..fb6a6d02e 100644 --- a/packages/l/log4cplus/xmake.lua +++ b/packages/l/log4cplus/xmake.lua @@ -5,6 +5,7 @@ package("log4cplus") set_license("BSD-2-Clause") add_urls("https://github.com/log4cplus/log4cplus/releases/download/REL_$(version).tar.gz", {version = function (version) return version:gsub("%.", "_") .. "/log4cplus-" .. version end}) + add_versions("2.1.1", "42dc435928917fd2f847046c4a0c6086b2af23664d198c7fc1b982c0bfe600c1") add_versions("2.0.6", "5fb26433b0f200ebfc2e6effb7e2e5131185862a2ea9a621a8e7f3f725a72b08") add_versions("2.0.7", "086451c7e7c582862cbd6c60d87bb6d9d63c4b65321dba85fa71766382f7ec6d") diff --git a/packages/l/ls-hpack/xmake.lua b/packages/l/ls-hpack/xmake.lua new file mode 100644 index 000000000..b9d804e5a --- /dev/null +++ b/packages/l/ls-hpack/xmake.lua @@ -0,0 +1,50 @@ +package("ls-hpack") + set_homepage("https://github.com/litespeedtech/ls-hpack") + set_description("LiteSpeed HPACK (RFC7541) Library") + set_license("MIT") + + add_urls("https://github.com/litespeedtech/ls-hpack/archive/refs/tags/$(version).tar.gz", + "https://github.com/litespeedtech/ls-hpack.git") + + add_versions("v2.3.3", "3d7d539bd659fefc7168fb514368065cb12a1a7a0946ded60e4e10f1637f1ea2") + + add_deps("xxhash") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + + set_symbols("none") + + add_requires("xxhash") + add_packages("xxhash") + + target("ls-hpack") + set_kind("$(kind)") + add_files("*.c") + add_headerfiles("*.h") + + add_defines("XXH_HEADER_NAME=") + + if is_plat("windows") then + add_includedirs("compat/windows") + add_headerfiles("compat/windows/(sys/*.h)") + + if is_kind("shared") then + add_rules("utils.symbols.export_all") + end + end + + on_config(function(target) + if not target:has_cincludes("sys/queue.h") then + target:add("includedirs", "compat/queue") + target:add("headerfiles", "compat/queue/(sys/*.h)") + end + end) + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("lshpack_enc_init", {includes = "lshpack.h"})) + end) diff --git a/packages/l/ls-qpack/patches/v2.5.3/fix-cmake-install.patch b/packages/l/ls-qpack/patches/v2.5.3/fix-cmake-install.patch new file mode 100644 index 000000000..b713ef740 --- /dev/null +++ b/packages/l/ls-qpack/patches/v2.5.3/fix-cmake-install.patch @@ -0,0 +1,26 @@ +From 79c136923681d7187feade455225543335525c3f Mon Sep 17 00:00:00 2001 +From: Biagio Festa <15035284+BiagioFesta@users.noreply.github.com> +Date: Fri, 26 May 2023 14:37:58 +0200 +Subject: [PATCH 1/1] CMakeLists.txt: install library target (#50) + +--- + CMakeLists.txt | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7f7cd40..61e2e6d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -101,3 +101,9 @@ endif() + if(LSQPACK_BIN) + add_subdirectory(bin) + endif() ++ ++install(TARGETS ls-qpack) ++install(FILES lsqpack.h lsxpack_header.h DESTINATION include) ++if(MSVC) ++ install(DIRECTORY wincompat/sys DESTINATION include) ++endif() +-- +2.42.0.windows.2 + diff --git a/packages/l/ls-qpack/xmake.lua b/packages/l/ls-qpack/xmake.lua new file mode 100644 index 000000000..c07b94dd3 --- /dev/null +++ b/packages/l/ls-qpack/xmake.lua @@ -0,0 +1,33 @@ +package("ls-qpack") + set_homepage("https://github.com/litespeedtech/ls-qpack") + set_description("QPACK compression library for use with HTTP/3") + set_license("MIT") + + add_urls("https://github.com/litespeedtech/ls-qpack/archive/refs/tags/$(version).tar.gz", + "https://github.com/litespeedtech/ls-qpack.git") + + add_versions("v2.5.4", "56b96190a1943d75ef8d384b13cd4592a72e3e2d84284f78d7f8adabbc717f3e") + add_versions("v2.5.3", "075a05efee27961eac5ac92a12a6e28a61bcd6c122a0276938ef993338577337") + + add_patches("v2.5.3", path.join(os.scriptdir(), "patches", "v2.5.3", "fix-cmake-install.patch"), "7d819b620b5e2bd34ef58a91bf20d882883c7525def9f9f80313b64cba5e5239") + + if not is_plat("windows") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("cmake") + add_deps("xxhash") + + on_install("windows", "linux", "macosx", "android", "iphoneos", function (package) + local configs = {"-DLSQPACK_TESTS=OFF", "-DLSQPACK_BIN=OFF", "-DLSQPACK_XXH=OFF",} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") and package:config("shared") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end + import("package.tools.cmake").install(package, configs, {packagedeps = "xxhash"}) + end) + + on_test(function (package) + assert(package:has_cfuncs("lsqpack_enc_init", {includes = "lsqpack.h"})) + end) diff --git a/packages/l/lsquic/xmake.lua b/packages/l/lsquic/xmake.lua new file mode 100644 index 000000000..9ee82315d --- /dev/null +++ b/packages/l/lsquic/xmake.lua @@ -0,0 +1,59 @@ +package("lsquic") + set_homepage("https://github.com/litespeedtech/lsquic") + set_description("LiteSpeed QUIC and HTTP/3 Library") + set_license("MIT") + + add_urls("https://github.com/litespeedtech/lsquic/archive/refs/tags/$(version).tar.gz", + "https://github.com/litespeedtech/lsquic.git") + + add_versions("v4.0.8", "f18ff2fa0addc1c51833304b3d3ff0979ecf5f53f54f96bcd3442a40cfcd440b") + + add_configs("fiu", {description = "Use Fault Injection in Userspace (FIU)", default = false, type = "boolean"}) + + add_deps("cmake") + add_deps("zlib", "boringssl", "ls-qpack", "ls-hpack") + + add_includedirs("include/lsquic") + + on_load("windows", function (package) + if not package:is_precompiled() then + package:add("deps", "strawberry-perl") + end + end) + + on_install("windows|!arm64", "linux", "macosx", function (package) + local opt = {} + opt.packagedeps = {"ls-qpack", "ls-hpack"} + if package:is_plat("windows") then + opt.cxflags = "-DWIN32" + -- https://github.com/litespeedtech/lsquic/issues/433 + package:add("defines", "WIN32", "WIN32_LEAN_AND_MEAN") + end + + io.replace("src/liblsquic/CMakeLists.txt", "ls-qpack/lsqpack.c", "", {plain = true}) + io.replace("src/liblsquic/CMakeLists.txt", "../lshpack/lshpack.c", "", {plain = true}) + io.replace("CMakeLists.txt", "-WX", "", {plain = true}) + + local boringssl = package:dep("boringssl") + io.replace("CMakeLists.txt", + "lib${LIB_NAME}${LIB_SUFFIX}", + "lib${LIB_NAME}" .. (boringssl:config("shared") and ".so" or ".a"), {plain = true}) + + local configs = { + "-DLSQUIC_BIN=OFF", + "-DLSQUIC_TESTS=OFF", + "-DBORINGSSL_DIR=" .. boringssl:installdir(), + "-DBORINGSSL_LIB=" .. boringssl:installdir("lib"), + } + + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DLSQUIC_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DLSQUIC_FIU=" .. (package:config("fiu") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs, opt) + + os.vcp(path.join(package:buildir(), "**.dll"), package:installdir("bin")) + end) + + on_test(function (package) + assert(package:has_cfuncs("lsquic_global_init", {includes = "lsquic.h"})) + end) diff --git a/packages/l/luajit/port/xmake.lua b/packages/l/luajit/port/xmake.lua index 6682c7657..6c049f7fe 100755 --- a/packages/l/luajit/port/xmake.lua +++ b/packages/l/luajit/port/xmake.lua @@ -206,7 +206,8 @@ target("luajit") "src/lib_package.c", "src/lib_debug.c", "src/lib_jit.c", - "src/lib_ffi.c", {rules = {"buildvm", override = true}}) + "src/lib_ffi.c", + "src/lib_buffer.c", {rules = {"buildvm", override = true}}) target("luajit_bin") set_kind("binary") diff --git a/packages/l/luau/xmake.lua b/packages/l/luau/xmake.lua index e815afd32..1c000e193 100644 --- a/packages/l/luau/xmake.lua +++ b/packages/l/luau/xmake.lua @@ -4,15 +4,19 @@ package("luau") set_description("A fast, small, safe, gradually typed embeddable scripting language derived from Lua.") set_license("MIT") - add_urls("https://github.com/Roblox/luau.git") - add_versions("0.538", "d3b566c258bee3bdccb655c034a11bfc48a586e3") + add_urls("https://github.com/Roblox/luau/archive/$(version).tar.gz", + "https://github.com/Roblox/luau.git") + + add_versions("0.624", "6d5ce40a7dc0e17da51cc143d2ee1ab32727583c315938f5a69d13ef93ae574d") + add_versions("0.623", "5a72f9e5b996c5ec44ee2c7bd9448d2b2e5061bdf7d057de7490f92fb3003f40") + add_versions("0.538", "8a1240e02a7daacf1e5cff249040a3298c013157fc496c66adce6dcb21cc30be") add_configs("extern_c", { description = "Use extern C for all APIs.", default = false, type = "boolean" }) add_configs("build_web", { description = "Build web module.", default = false, type = "boolean" }) add_deps("cmake") - on_install("linux", "windows", "mingw|x86_64", "macosx", function(package) + on_install("!bsd and !wasm", function(package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "RelWithDebInfo")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) @@ -20,21 +24,37 @@ package("luau") table.insert(configs, "-DLUAU_BUILD_WEB=" .. (package:config("build_web") and "ON" or "OFF")) table.insert(configs, "-DLUAU_EXTERN_C=" .. (package:config("extern_c") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs, { buildir = "build" }) - os.trycp("VM/include/*.h", package:installdir("include")) - os.trycp("Ast/include/*", package:installdir("include")) - os.trycp("Common/include/*", package:installdir("include")) - os.trycp("Compiler/include/*", package:installdir("include")) - -- need to link with Ast last - local libs = { "Luau.VM", "Luau.Compiler", "Luau.Ast" } - for _, link in ipairs(libs) do + + io.replace("CMakeLists.txt", ".lib", "", {plain = true}) + io.replace("Sources.cmake", ".lib", "", {plain = true}) + + local cmake_file = io.readfile("CMakeLists.txt") + + local links = {} + for library_name, library_type in string.gmatch(cmake_file, "add_library%(([%a|%.]+) ([STATIC|INTERFACE]+)") do + if string.startswith(library_name, "Luau.") then + if library_type == "STATIC" then + table.insert(links, library_name) + end + local include_dir = library_name:gsub("Luau%.", "") + include_dir = include_dir:gsub("%..*", "") + os.trycp(include_dir .. "/include/*", package:installdir("include")) + end + end + + -- we have to link in reverse order + for i = #links, 1, -1 do + local link = links[i] package:add("links", link) end - os.trycp("build/*.a", package:installdir("lib")) - os.trycp("build/*.so", package:installdir("lib")) - os.trycp("build/*.dylib", package:installdir("lib")) - os.trycp("build/*.lib", package:installdir("lib")) - os.trycp("build/*.dll", package:installdir("bin")) + + os.trycp("build/**.a", package:installdir("lib")) + os.trycp("build/**.so", package:installdir("lib")) + os.trycp("build/**.dylib", package:installdir("lib")) + os.trycp("build/**.lib", package:installdir("lib")) + os.trycp("build/**.dll", package:installdir("bin")) os.trycp("build/luau*", package:installdir("bin")) + package:addenv("PATH", "bin") end) @@ -49,8 +69,12 @@ package("luau") luaL_openlibs(L); lua_close(L); } - ]]}) - ) - end) - + ]]}, {configs = {languages = "cxx11"}})) + assert(package:check_cxxsnippets({ test = [[ + #include + void test() { + Luau::FValue v("test", 42, true); + } + ]]}, {configs = {languages = "cxx11"}})) + end) diff --git a/packages/l/lunasvg/xmake.lua b/packages/l/lunasvg/xmake.lua index 76bc78bd0..8b3c6cbaf 100644 --- a/packages/l/lunasvg/xmake.lua +++ b/packages/l/lunasvg/xmake.lua @@ -6,6 +6,7 @@ package("lunasvg") add_urls("https://github.com/sammycage/lunasvg/archive/refs/tags/$(version).tar.gz", "https://github.com/sammycage/lunasvg.git") + add_versions("v2.3.9", "088bc9fd1191a004552c65bdcc260989b83da441b0bdaa965e79d984feba88fa") add_versions("v2.3.5", "350ff56aa1acdedefe2ad8a4241a9fb8f9b232868adc7bd36dfb3dbdd57e2e93") add_deps("cmake") diff --git a/packages/l/lvgl/xmake.lua b/packages/l/lvgl/xmake.lua index 7f4f5fd6d..e8c5c5218 100644 --- a/packages/l/lvgl/xmake.lua +++ b/packages/l/lvgl/xmake.lua @@ -6,6 +6,8 @@ package("lvgl") add_urls("https://github.com/lvgl/lvgl/archive/refs/tags/$(version).tar.gz", "https://github.com/lvgl/lvgl.git") + add_versions("v9.1.0", "6930f1605d305fcd43f31d5f470ecf4a013c4ce0980e78ee4c33b96a589bf433") + add_versions("v9.0.0", "73ae6ef7b44b434b41f25755ce4f6f5d23c49c1c254c4b7774b5a9cf83a46b7f") add_versions("v8.0.2", "7136edd6c968b60f0554130c6903f16870fa26cda11a2290bc86d09d7138a6b4") add_versions("v8.2.0", "dd1cb1955ded3789c99e2dee7ac367393e87b5870cbce6b88930e378c3e91829") diff --git a/packages/l/lzav/xmake.lua b/packages/l/lzav/xmake.lua index 869b081a0..4d131bb68 100644 --- a/packages/l/lzav/xmake.lua +++ b/packages/l/lzav/xmake.lua @@ -7,6 +7,7 @@ package("lzav") add_urls("https://github.com/avaneev/lzav/archive/refs/tags/$(version).tar.gz", "https://github.com/avaneev/lzav.git") + add_versions("4.0", "bf125517492b0481b76a6b48cef849270dca406b0781f6f4595928046747ea99") add_versions("2.14", "98a715dc744d86224c941421beddaf3fcc0defd62ccfad7082eedf83be42dbbd") on_install(function (package) diff --git a/packages/m/m4/xmake.lua b/packages/m/m4/xmake.lua index 189028640..336344898 100644 --- a/packages/m/m4/xmake.lua +++ b/packages/m/m4/xmake.lua @@ -4,8 +4,8 @@ package("m4") set_homepage("https://www.gnu.org/software/m4") set_description("Macro processing language") - add_urls("https://ftp.gnu.org/gnu/m4/m4-$(version).tar.xz", - "https://ftpmirror.gnu.org/m4/m4-$(version).tar.xz", + add_urls("https://ftpmirror.gnu.org/m4/m4-$(version).tar.xz", + "https://ftp.gnu.org/gnu/m4/m4-$(version).tar.xz", "https://mirrors.ustc.edu.cn/gnu/m4/m4-$(version).tar.xz") add_versions("1.4.18", "f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07") add_versions("1.4.19", "63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96") diff --git a/packages/m/maddy/xmake.lua b/packages/m/maddy/xmake.lua index 518333e5b..4c2512fa4 100644 --- a/packages/m/maddy/xmake.lua +++ b/packages/m/maddy/xmake.lua @@ -7,6 +7,7 @@ package("maddy") add_urls("https://github.com/progsource/maddy/archive/refs/tags/$(version).tar.gz", "https://github.com/progsource/maddy.git") + add_versions("1.3.0", "561681f8c8d2b998c153cda734107a0bc1dea4bb0df69fd813922da63fa9f3e7") add_versions("1.2.1", "b6058bce7ca32506969633ee7a4042e75b07464489f1c44be00913543cd687ef") on_install(function (package) diff --git a/packages/m/magic_enum/xmake.lua b/packages/m/magic_enum/xmake.lua index 2f8431235..2c66fe711 100644 --- a/packages/m/magic_enum/xmake.lua +++ b/packages/m/magic_enum/xmake.lua @@ -12,6 +12,7 @@ package("magic_enum") add_versions("v0.8.1", "6b948d1680f02542d651fc82154a9e136b341ce55c5bf300736b157e23f9df11") add_versions("v0.8.2", "62bd7034bbbfc3d7806001767d5775ab42f3ff33bb38366e1ceb21102f0dff9a") add_versions("v0.9.0", "2fb2f602b4660f8af539ee00958132a397e138bda19aa1ceae546de3a143386b") + add_versions("v0.9.5", "44ad80db5a72f5047e01d90e18315751d9ac90c0ab42cbea7a6f9ec66a4cd679") add_deps("cmake") diff --git a/packages/m/magnum-integration/xmake.lua b/packages/m/magnum-integration/xmake.lua index 943c1a0f0..a85010b82 100644 --- a/packages/m/magnum-integration/xmake.lua +++ b/packages/m/magnum-integration/xmake.lua @@ -16,7 +16,7 @@ package("magnum-integration") add_deps("cmake", "magnum") on_load("windows", "linux", "macosx", function (package) local configdeps = {bullet = "bullet3", - eigen = "eigen3", + eigen = "eigen", glm = "glm", imgui = "imgui"} for config, dep in pairs(configdeps) do diff --git a/packages/m/magnum/patches/2020.06/msvc.patch b/packages/m/magnum/patches/2020.06/msvc.patch new file mode 100644 index 000000000..b2d88a1e7 --- /dev/null +++ b/packages/m/magnum/patches/2020.06/msvc.patch @@ -0,0 +1,70 @@ +diff --git a/src/Magnum/GL/Buffer.cpp b/src/Magnum/GL/Buffer.cpp +index 5fa02c2..038e001 100644 +--- a/src/Magnum/GL/Buffer.cpp ++++ b/src/Magnum/GL/Buffer.cpp +@@ -419,7 +419,7 @@ void Buffer::bindImplementationMulti(const Target target, const GLuint firstInde + } + } + +- glBindBuffersRange(GLenum(target), firstIndex, buffers.size(), ids, offsetsSizes, offsetsSizes + buffers.size()); ++ glBindBuffersRange(GLenum(target), firstIndex, buffers.size(), ids, offsetsSizes, offsetsSizes.data() + buffers.size()); + } + #endif + +diff --git a/src/Magnum/Implementation/ImageProperties.h b/src/Magnum/Implementation/ImageProperties.h +index d6326cf..6eedae0 100644 +--- a/src/Magnum/Implementation/ImageProperties.h ++++ b/src/Magnum/Implementation/ImageProperties.h +@@ -70,7 +70,7 @@ template Containers::S + + static_assert(sizeof(decltype(image.data().front())) == 1, + "pointer arithmetic expects image data type to have 1 byte"); +- return {data.suffix(properties.first[dimensions - 1]), data + properties.first.sum(), size, stride}; ++ return {data.suffix(properties.first[dimensions - 1]), data.data() + properties.first.sum(), size, stride}; + } + + }} +diff --git a/src/Magnum/MeshTools/Concatenate.cpp b/src/Magnum/MeshTools/Concatenate.cpp +index 38a7bc1..c20eeb9 100644 +--- a/src/Magnum/MeshTools/Concatenate.cpp ++++ b/src/Magnum/MeshTools/Concatenate.cpp +@@ -73,7 +73,7 @@ Trade::MeshData concatenate(Containers::Array&& indexData, const UnsignedI + attribute = Trade::MeshAttributeData{ + attribute.name(), attribute.format(), + Containers::StridedArrayView1D{vertexData, +- vertexData + attribute.offset(vertexData), ++ vertexData.data() + attribute.offset(vertexData), + vertexCount, attribute.stride()}, + attribute.arraySize()}; + } +@@ -130,7 +130,7 @@ Trade::MeshData concatenate(Containers::Array&& indexData, const UnsignedI + /* Otherwise, if we need an index buffer (meaning at least one of the + meshes is indexed), generate a trivial index buffer */ + } else if(!indices.empty()) { +- std::iota(indices + indexOffset, indices + indexOffset + mesh.vertexCount(), UnsignedInt(vertexOffset)); ++ std::iota(indices.data() + indexOffset, indices.data() + indexOffset + mesh.vertexCount(), UnsignedInt(vertexOffset)); + indexOffset += mesh.vertexCount(); + } + +diff --git a/src/Magnum/MeshTools/Interleave.cpp b/src/Magnum/MeshTools/Interleave.cpp +index b98c589..c16fd74 100644 +--- a/src/Magnum/MeshTools/Interleave.cpp ++++ b/src/Magnum/MeshTools/Interleave.cpp +@@ -224,7 +224,7 @@ Trade::MeshData interleavedLayout(Trade::MeshData&& data, const UnsignedInt vert + attribute = Trade::MeshAttributeData{ + attribute.name(), attribute.format(), + Containers::StridedArrayView1D{vertexData, +- vertexData + attribute.offset(vertexData), ++ vertexData.data() + attribute.offset(vertexData), + vertexCount, attribute.stride()}, + attribute.arraySize()}; + } +@@ -261,7 +261,7 @@ Trade::MeshData interleave(Trade::MeshData&& data, const Containers::ArrayView{data.indexData().size()}; + Utility::copy(data.indexData(), indexData); + indices = Trade::MeshIndexData{data.indexType(), +- Containers::ArrayView{indexData + data.indexOffset(), data.indices().size()[0]*data.indices().size()[1]}}; ++ Containers::ArrayView{indexData.data() + data.indexOffset(), data.indices().size()[0]*data.indices().size()[1]}}; + } + } + diff --git a/packages/m/magnum/xmake.lua b/packages/m/magnum/xmake.lua index 2c3eb8a66..26aec7835 100644 --- a/packages/m/magnum/xmake.lua +++ b/packages/m/magnum/xmake.lua @@ -8,8 +8,12 @@ package("magnum") "https://github.com/mosra/magnum.git") add_versions("v2020.06", "78c52bc403cec27b98d8d87186622ca57f8d70ffd64342fe4094c720b7d3b0e3") - add_configs("audio", {description = "Build audio module.", default = false, type = "boolean"}) - add_configs("vulkan", {description = "Build vulkan module.", default = false, type = "boolean"}) + add_patches("2020.06", "patches/2020.06/msvc.patch", "0739a29807c6aeb4681eaadb4c624c39f5d1ba746de3df7ab83801f41d1ad5bd") + + add_configs("audio", {description = "Build Audio library.", default = false, type = "boolean"}) + add_configs("meshtools", {description = "Build MeshTools library.", default = true, type = "boolean"}) + add_configs("opengl", {description = "Build GL library.", default = true, type = "boolean"}) + add_configs("vulkan", {description = "Build Vk library.", default = false, type = "boolean"}) add_configs("deprecated", {description = "Include deprecated APIs in the build.", default = true, type = "boolean"}) add_configs("plugin_static", {description = "Build plugins as static libraries.", default = false, type = "boolean"}) @@ -38,15 +42,14 @@ package("magnum") add_configs(utility, {description = "Build the " .. utility .. " executable.", default = false, type = "boolean"}) end - add_deps("cmake", "corrade", "opengl") - add_links("MagnumAnyAudioImporter", "MagnumAnyImageConverter", "MagnumAnyImageImporter", "MagnumAnySceneConverter", "MagnumAnySceneImporter", "MagnumMagnumFont", "MagnumMagnumFontConverter", "MagnumObjImporter", "MagnumTgaImageConverter", "MagnumTgaImporter", "MagnumWavAudioImporter") - add_links("MagnumCglContext", "MagnumEglContext", "MagnumGlxContext", "MagnumWglContext", "MagnumOpenGLTester", "MagnumVulkanTester") - add_links("MagnumAndroidApplication", "MagnumEmscriptenApplication", "MagnumGlfwApplication", "MagnumGlxApplication", "MagnumSdl2Application", "MagnumXEglApplication", "MagnumWindowlessCglApplication", "MagnumWindowlessEglApplication", "MagnumWindowlessGlxApplication", "MagnumWindowlessIosApplication", "MagnumWindowlessWglApplication", "MagnumWindowlessWindowsEglApplication") - add_links("MagnumAudio", "MagnumDebugTools", "MagnumGL", "MagnumMeshTools", "MagnumPrimitives", "MagnumSceneGraph", "MagnumShaders", "MagnumText", "MagnumTextureTools", "MagnumTrade", "MagnumVk", "Magnum") + add_deps("cmake", "corrade") on_load("windows", "linux", "macosx", function (package) if package:config("audio") then package:add("deps", "openal-soft", {configs = {shared = true}}) end + if package:config("opengl") then + package:add("deps", "opengl") + end if package:config("vulkan") then package:add("deps", "vulkansdk") end @@ -54,18 +57,30 @@ package("magnum") package:add("deps", "glfw") end if package:config("sdl2") then - package:add("deps", "libsdl") + package:add("deps", "libsdl", {configs = {sdlmain = false}}) end if package:config("glx") then package:add("deps", "libx11") end + local links = {"MagnumAnyAudioImporter", "MagnumAnyImageConverter", "MagnumAnyImageImporter", "MagnumAnySceneConverter", "MagnumAnySceneImporter", "MagnumMagnumFont", "MagnumMagnumFontConverter", "MagnumObjImporter", "MagnumTgaImageConverter", "MagnumTgaImporter", "MagnumWavAudioImporter"} + table.join2(links, {"MagnumCglContext", "MagnumEglContext", "MagnumGlxContext", "MagnumWglContext", "MagnumOpenGLTester", "MagnumVulkanTester"}) + table.join2(links, {"MagnumAndroidApplication", "MagnumEmscriptenApplication", "MagnumGlfwApplication", "MagnumGlxApplication", "MagnumSdl2Application", "MagnumXEglApplication", "MagnumWindowlessCglApplication", "MagnumWindowlessEglApplication", "MagnumWindowlessGlxApplication", "MagnumWindowlessIosApplication", "MagnumWindowlessWglApplication", "MagnumWindowlessWindowsEglApplication"}) + table.join2(links, {"MagnumAudio", "MagnumDebugTools", "MagnumGL", "MagnumMeshTools", "MagnumPrimitives", "MagnumSceneGraph", "MagnumShaders", "MagnumText", "MagnumTextureTools", "MagnumTrade", "MagnumVk", "Magnum"}) + local postfix = package:debug() and "-d" or "" + for _, link in ipairs(links) do + package:add("links", link .. postfix) + end end) on_install("windows", "linux", "macosx", function (package) + io.replace("modules/FindSDL2.cmake", "SDL2-2.0 SDL2", "SDL2-2.0 SDL2 SDL2-static", {plain = true}) + io.replace("modules/FindSDL2.cmake", "${_SDL2_LIBRARY_PATH_SUFFIX}", "lib ${_SDL2_LIBRARY_PATH_SUFFIX}", {plain = true}) local configs = {"-DBUILD_TESTS=OFF", "-DLIB_SUFFIX="} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON")) table.insert(configs, "-DWITH_AUDIO=" .. (package:config("audio") and "ON" or "OFF")) + table.insert(configs, "-DWITH_MESHTOOLS=" .. (package:config("meshtools") and "ON" or "OFF")) + table.insert(configs, "-DWITH_GL=" .. (package:config("opengl") and "ON" or "OFF")) table.insert(configs, "-DWITH_VK=" .. (package:config("vulkan") and "ON" or "OFF")) table.insert(configs, "-DBUILD_DEPRECATED=" .. (package:config("deprecated") and "ON" or "OFF")) table.insert(configs, "-DBUILD_PLUGIN_STATIC=" .. (package:config("plugin_static") and "ON" or "OFF")) diff --git a/packages/m/mailio/xmake.lua b/packages/m/mailio/xmake.lua new file mode 100644 index 000000000..c7665c5da --- /dev/null +++ b/packages/m/mailio/xmake.lua @@ -0,0 +1,54 @@ +package("mailio") + set_homepage("https://github.com/karastojko/mailio") + set_description("mailio is a cross platform C++ library for MIME format and SMTP, POP3 and IMAP protocols. It is based on standard C++ 17 and Boost library.") + set_license("BSD") + + add_urls("https://github.com/karastojko/mailio/archive/refs/tags/$(version).tar.gz", + "https://github.com/karastojko/mailio.git") + + add_versions("0.23.0", "9fc3f1f803a85170c2081cbbef2e301473a400683fc1dffefa2d6707598206a5") + + if is_plat("linux") then + add_syslinks("m") + elseif is_plat("bsd") then + add_syslinks("m", "pthread") + end + + add_deps("cmake") + add_deps("boost", {configs = {regex = true, date_time = true, system = true}}) + add_deps("openssl") + + on_install("windows", "linux", "macosx", "bsd", "mingw", "cross", function (package) + local configs = { + "-DMAILIO_BUILD_EXAMPLES=OFF", + "-DMAILIO_BUILD_TESTS=OFF", + "-DMAILIO_DYN_LINK_TESTS=OFF", + } + + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:version():le("0.23.0") then + table.insert(configs, "-DMAILIO_BUILD_SHARED_LIBRARY=" .. (package:config("shared") and "ON" or "OFF")) + io.replace("CMakeLists.txt", " unit_test_framework", "", {plain = true}) + end + if package:is_plat("windows") then + table.insert(configs, "-DBoost_USE_STATIC_RUNTIME=" .. (package:dep("boost"):config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + io.replace("CMakeLists.txt", "if (MSVC)", + "if (MSVC)\n target_link_libraries(${PROJECT_NAME} crypt32)", {plain = true}) + elseif package:is_plat("mingw") then + io.replace("CMakeLists.txt", "if(MINGW)", + "if (MINGW)\n target_link_libraries(${PROJECT_NAME} crypt32)", {plain = true}) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + using namespace mailio; + void test() { + message msg; + msg.header_codec(message::header_codec_t::QUOTED_PRINTABLE); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/m/make/xmake.lua b/packages/m/make/xmake.lua index 07a8f5ca5..2ac2e3f5f 100644 --- a/packages/m/make/xmake.lua +++ b/packages/m/make/xmake.lua @@ -4,11 +4,13 @@ package("make") set_homepage("https://www.gnu.org/software/make/") set_description("GNU make tool.") - add_urls("https://ftp.gnu.org/gnu/make/make-$(version).tar.gz", + add_urls("https://ftpmirror.gnu.org/gnu/make/make-$(version).tar.gz", + "https://ftp.gnu.org/gnu/make/make-$(version).tar.gz", "https://mirrors.ustc.edu.cn/gnu/make/make-$(version).tar.gz", "http://mirror.easyname.at/gnu/make/make-$(version).tar.gz") add_versions("4.2.1", "e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7") add_versions("4.3", "e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19") + add_versions("4.4.1", "dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3") if is_host("linux") then add_extsources("pacman::make", "apt::make") @@ -16,9 +18,11 @@ package("make") add_extsources("brew::make") end - on_install("@windows", function(package) + on_install("@windows", function (package) import("core.tool.toolchain") - local runenvs = toolchain.load("msvc"):runenvs() + local msvc = package:toolchain("msvc") or + toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + local runenvs = msvc:runenvs() os.vrunv("build_w32.bat", {}, {envs = runenvs}) os.cp("WinRel/gnumake.exe", path.join(package:installdir("bin"), "make.exe")) end) diff --git a/packages/m/makeself/xmake.lua b/packages/m/makeself/xmake.lua new file mode 100644 index 000000000..c8368289a --- /dev/null +++ b/packages/m/makeself/xmake.lua @@ -0,0 +1,18 @@ +package("makeself") + set_kind("binary") + set_homepage("https://makeself.io") + set_description("A self-extracting archiving tool for Unix systems, in 100% shell script.") + + add_urls("https://github.com/megastep/makeself/archive/refs/tags/$(version).tar.gz", {version = function (version) + return "release-" .. version + end}) + + add_versions("2.5.0", "705d0376db9109a8ef1d4f3876c9997ee6bed454a23619e1dbc03d25033e46ea") + + on_install("macosx", "linux", "msys", "bsd", function (package) + os.cp("*.sh", package:installdir("bin")) + end) + + on_test(function (package) + os.runv("makeself.sh", {"--version"}, {shell = true}) + end) diff --git a/packages/m/mapbox_earcut/xmake.lua b/packages/m/mapbox_earcut/xmake.lua index 4e1405a3c..edd8c76a4 100644 --- a/packages/m/mapbox_earcut/xmake.lua +++ b/packages/m/mapbox_earcut/xmake.lua @@ -7,6 +7,7 @@ package("mapbox_earcut") add_urls("https://github.com/mapbox/earcut.hpp/archive/refs/tags/v$(version).zip", "https://github.com/mapbox/earcut.hpp.git") + add_versions("2.2.4", "998ae183e3c27f6f5cfed589164c3fb495ab9f805fc8d54e7151a42dab6c89bc") add_versions("2.2.3", "010d2fe35938744960dcc0b25076eb541b07bb314a92afbcab14f7f887ceb98d") add_patches("2.2.3", path.join(os.scriptdir(), "patches", "2.2.3", "mingw.patch"), "ac6ceb3d494d5a553936f6845c2df41d567614e33e389f47fe1520d6070a30e0") diff --git a/packages/m/mariadb-connector-c/xmake.lua b/packages/m/mariadb-connector-c/xmake.lua index 828c3b6ef..278c86fa6 100644 --- a/packages/m/mariadb-connector-c/xmake.lua +++ b/packages/m/mariadb-connector-c/xmake.lua @@ -5,8 +5,9 @@ package("mariadb-connector-c") add_urls("https://github.com/mariadb-corporation/mariadb-connector-c/archive/refs/tags/v$(version).tar.gz") - add_versions("3.1.13", "361136e9c365259397190109d50f8b6a65c628177792273b4acdb6978942b5e7") + add_versions("3.3.9", "062b9ec5c26cbb236a78f0ba26981272053f59bdfc113040bab904a9da36d31f") add_versions("3.3.4", "ea6a23850d6a2f6f2e0d9e9fdb7d94fe905a4317f73842272cf121ed25903e1f") + add_versions("3.1.13", "361136e9c365259397190109d50f8b6a65c628177792273b4acdb6978942b5e7") add_deps("cmake") @@ -53,6 +54,7 @@ package("mariadb-connector-c") end) on_install("bsd", "linux", "windows", function(package) + io.replace("CMakeLists.txt", "-Werror", "", {plain = true}) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) for name, enabled in pairs(package:configs()) do @@ -65,6 +67,16 @@ package("mariadb-connector-c") end end import("package.tools.cmake").install(package, configs) + + if package:is_plat("windows") then + for _, lib in ipairs(os.files(path.join(package:installdir("lib"), "mariadb", "*.lib"))) do + os.trycp(lib, path.join(package:installdir("lib"), path.filename(lib))) + end + else + for _, lib in ipairs(os.files(path.join(package:installdir("lib"), "mariadb", "*.a"))) do + os.trycp(lib, path.join(package:installdir("lib"), path.filename(lib))) + end + end if package:config("shared") then os.trycp(path.join(package:installdir("lib"), "mariadb", "*.dll"), package:installdir("bin")) os.trycp(path.join(package:installdir("lib"), "mariadb", "*.so"), package:installdir("bin")) diff --git a/packages/m/matio/xmake.lua b/packages/m/matio/xmake.lua new file mode 100644 index 000000000..72a683aea --- /dev/null +++ b/packages/m/matio/xmake.lua @@ -0,0 +1,52 @@ +package("matio") + set_homepage("https://matio.sourceforge.io") + set_description("MATLAB MAT File I/O Library") + set_license("BSD-2-Clause") + + add_urls("https://github.com/tbeu/matio/archive/refs/tags/$(version).tar.gz", + "https://github.com/tbeu/matio.git", {submodules = false}) + + add_versions("v1.5.27", "2efe7c4a206885287c0f56128f3a36aa6e453077d03e4c2c42cdce9d332b67eb") + add_versions("v1.5.26", "4aa5ac827ee49a3111f88f8d9b8ae034b8757384477e8f29cb64582c7d54e156") + + add_configs("zlib", {description = "Build with zlib support", default = false, type = "boolean"}) + add_configs("hdf5", {description = "Build with hdf5 support", default = false, type = "boolean"}) + add_configs("extended_sparse", {description = "Enable extended sparse matrix data types not supported in MATLAB", default = false, type = "boolean"}) + add_configs("mat73", {description = "Enable support for version 7.3 MAT files", default = false, type = "boolean"}) + add_configs("default_file_version", {description = "Select what MAT file format version is used by default", default = "5", type = "string", values = {"4", "5", "7.5"}}) + + add_deps("cmake") + + on_load(function (package) + if package:config("zlib") then + package:add("deps", "zlib >=1.2.3") + end + if package:config("hdf5") then + package:add("deps", "hdf5 >=1.8.x") + end + end) + + on_install("windows", "linux", "macosx", "bsd", "android", "iphoneos", "cross", "wasm", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DMATIO_SHARED=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DMATIO_PIC=" .. (package:config("pic") and "ON" or "OFF")) + table.insert(configs, "-DMATIO_WITH_ZLIB=" .. (package:config("zlib") and "ON" or "OFF")) + table.insert(configs, "-DMATIO_WITH_HDF5=" .. (package:config("hdf5") and "ON" or "OFF")) + table.insert(configs, "-DMATIO_EXTENDED_SPARSE=" .. (package:config("extended_sparse") and "ON" or "OFF")) + table.insert(configs, "-DMATIO_MAT73=" .. (package:config("mat73") and "ON" or "OFF")) + table.insert(configs, "-DMATIO_DEFAULT_FILE_VERSION=" .. package:config("default_file_version")) + io.replace("CMakeLists.txt", "include(cmake/tools.cmake)", "", {plain = true}) + io.replace("CMakeLists.txt", "include(cmake/test.cmake)", "", {plain = true}) + + local packagedeps = {} + if package:config("hdf5") then + table.insert(packagedeps, "hdf5") + end + + import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps}) + end) + + on_test(function (package) + assert(package:has_cfuncs("Mat_Open", {includes = "matio.h"})) + end) diff --git a/packages/m/matplotplusplus/xmake.lua b/packages/m/matplotplusplus/xmake.lua index 460bf3a75..f4370667b 100644 --- a/packages/m/matplotplusplus/xmake.lua +++ b/packages/m/matplotplusplus/xmake.lua @@ -1,13 +1,14 @@ package("matplotplusplus") - set_homepage("https://alandefreitas.github.io/matplotplusplus/") set_description("A C++ Graphics Library for Data Visualization") set_license("MIT") add_urls("https://github.com/alandefreitas/matplotplusplus/archive/refs/tags/$(version).tar.gz", "https://github.com/alandefreitas/matplotplusplus.git") - add_versions("v1.1.0", "5c3a1bdfee12f5c11fd194361040fe4760f57e334523ac125ec22b2cb03f27bb") + + add_versions("v1.2.1", "9dd7cc92b2425148f50329f5a3bf95f9774ac807657838972d35334b5ff7cb87") add_versions("v1.2.0", "42e24edf717741fcc721242aaa1fdb44e510fbdce4032cdb101c2258761b2554") + add_versions("v1.1.0", "5c3a1bdfee12f5c11fd194361040fe4760f57e334523ac125ec22b2cb03f27bb") local configdeps = {jpeg = "libjpeg-turbo", tiff = "libtiff", @@ -25,9 +26,11 @@ package("matplotplusplus") add_deps("cmake") add_deps("nodesoup") + if is_plat("windows") then add_syslinks("user32", "shell32", "gdi32") end + on_load("windows", "macosx", "linux", function (package) for config, dep in pairs(configdeps) do if package:config(config) then @@ -43,7 +46,15 @@ package("matplotplusplus") raise("Your compiler is too old to use this library.") end end - local configs = {"-DBUILD_EXAMPLES=OFF", "-DBUILD_TESTS=OFF", "-DBUILD_INSTALLER=ON", "-DBUILD_PACKAGE=OFF", "-DWITH_SYSTEM_NODESOUP=ON"} + + local configs = { + "-DBUILD_EXAMPLES=OFF", + "-DMATPLOTPP_BUILD_EXAMPLES=OFF", + "-DBUILD_TESTS=OFF", + "-DBUILD_INSTALLER=ON", + "-DBUILD_PACKAGE=OFF", + "-DWITH_SYSTEM_NODESOUP=ON" + } for config, dep in pairs(configdeps) do if not package:config(config) then table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_" .. config:upper() .. "=ON") diff --git a/packages/m/mbedtls/patches/3.5.1/aesni-mingw-i386.patch b/packages/m/mbedtls/patches/3.5.1/aesni-mingw-i386.patch new file mode 100644 index 000000000..1085f4df3 --- /dev/null +++ b/packages/m/mbedtls/patches/3.5.1/aesni-mingw-i386.patch @@ -0,0 +1,68 @@ +diff --git a/library/aesni.c b/library/aesni.c +index 59bcd3d92..b92c73c29 100644 +--- a/library/aesni.c ++++ b/library/aesni.c +@@ -21,14 +21,27 @@ + #if defined(MBEDTLS_AESNI_HAVE_CODE) + + #if MBEDTLS_AESNI_HAVE_CODE == 2 +-#if !defined(_WIN32) ++#if defined(__GNUC__) + #include +-#else ++#elif defined(_MSC_VER) + #include ++#else ++#error "`__cpuid` required by MBEDTLS_AESNI_C is not supported by the compiler" + #endif + #include + #endif + ++#if defined(MBEDTLS_ARCH_IS_X86) ++#if defined(MBEDTLS_COMPILER_IS_GCC) ++#pragma GCC push_options ++#pragma GCC target ("pclmul,sse2,aes") ++#define MBEDTLS_POP_TARGET_PRAGMA ++#elif defined(__clang__) ++#pragma clang attribute push (__attribute__((target("pclmul,sse2,aes"))), apply_to=function) ++#define MBEDTLS_POP_TARGET_PRAGMA ++#endif ++#endif ++ + #if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY) + /* + * AES-NI support detection routine +@@ -40,7 +53,7 @@ int mbedtls_aesni_has_support(unsigned int what) + + if (!done) { + #if MBEDTLS_AESNI_HAVE_CODE == 2 +- static unsigned info[4] = { 0, 0, 0, 0 }; ++ static int info[4] = { 0, 0, 0, 0 }; + #if defined(_MSC_VER) + __cpuid(info, 1); + #else +@@ -175,7 +188,7 @@ void mbedtls_aesni_gcm_mult(unsigned char c[16], + const unsigned char a[16], + const unsigned char b[16]) + { +- __m128i aa, bb, cc, dd; ++ __m128i aa = { 0 }, bb = { 0 }, cc, dd; + + /* The inputs are in big-endian order, so byte-reverse them */ + for (size_t i = 0; i < 16; i++) { +@@ -384,6 +397,15 @@ static void aesni_setkey_enc_256(unsigned char *rk_bytes, + } + #endif /* !MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH */ + ++#if defined(MBEDTLS_POP_TARGET_PRAGMA) ++#if defined(__clang__) ++#pragma clang attribute pop ++#elif defined(__GNUC__) ++#pragma GCC pop_options ++#endif ++#undef MBEDTLS_POP_TARGET_PRAGMA ++#endif ++ + #else /* MBEDTLS_AESNI_HAVE_CODE == 1 */ + + #if defined(__has_feature) diff --git a/packages/m/mbedtls/xmake.lua b/packages/m/mbedtls/xmake.lua index 8503474c9..93bbb190e 100644 --- a/packages/m/mbedtls/xmake.lua +++ b/packages/m/mbedtls/xmake.lua @@ -1,34 +1,65 @@ package("mbedtls") set_homepage("https://tls.mbed.org") - set_description("An SSL library") + set_description("An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API") set_license("Apache-2.0") + add_urls("https://github.com/Mbed-TLS/mbedtls/releases/download/$(version).tar.bz2", {version = function (version) + return string.format("%s/mbedtls-%s", version, tostring(version):sub(2)) + end}) add_urls("https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/$(version).zip", {version = function (version) return version:ge("v2.23.0") and version or ("mbedtls-" .. tostring(version):sub(2)) end}) add_urls("https://github.com/Mbed-TLS/mbedtls.git") + add_versions("v3.6.0", "3ecf94fcfdaacafb757786a01b7538a61750ebd85c4b024f56ff8ba1490fcd38") + add_versions("v3.5.1", "959a492721ba036afc21f04d1836d874f93ac124cf47cf62c9bcd3a753e49bdb") add_versions("v3.4.0", "9969088c86eb89f6f0a131e699c46ff57058288410f2087bd0d308f65e9fccb5") add_versions("v2.28.3", "0c0abbd6e33566c5c3c15af4fc19466c8edb62fa483d4ce98f1ba3f656656d2d") add_versions("v2.25.0", "6bf01ef178925f7db3c9027344a50855b116f2defe4a24cbdc0220111a371597") add_versions("v2.13.0", "6e747350bc13e8ff51799daa50f74230c6cd8e15977da55dd59f57b23dcf70a6") add_versions("v2.7.6", "e527d828ab82650102ca8031302e5d4bc68ea887b2d84e43d3da2a80a9e5a2c8") + add_patches("3.5.1", path.join(os.scriptdir(), "patches", "3.5.1", "aesni-mingw-i386.patch"), "4b5c5de69930049242cc1d6a84185881a936a27773ecaf975290ac591f38a41d") + add_deps("cmake") add_links("mbedtls", "mbedx509", "mbedcrypto") - if is_plat("windows") then - add_syslinks("advapi32") + if is_plat("windows", "mingw") then + add_syslinks("ws2_32", "advapi32", "bcrypt") end - on_install(function (package) + on_install("windows|x86", "windows|x64", "linux", "macosx", "bsd", "mingw", "android", "iphoneos", "cross", "wasm", function (package) local configs = {"-DENABLE_TESTING=OFF", "-DENABLE_PROGRAMS=OFF", "-DMBEDTLS_FATAL_WARNINGS=OFF"} - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) + if package:config("shared") then + table.insert(configs, "-DUSE_SHARED_MBEDTLS_LIBRARY=ON") + table.insert(configs, "-DUSE_STATIC_MBEDTLS_LIBRARY=OFF") + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + io.replace("library/constant_time_impl.h", "extern volatile", "__declspec(dllimport) volatile", {plain = true}) + io.replace("include/mbedtls/x509_crt.h", "extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_suiteb;", "__declspec(dllimport) const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_suiteb;", {plain = true}) + io.replace("include/mbedtls/x509_crt.h", "extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_default;", "__declspec(dllimport) const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_default;", {plain = true}) + io.replace("library/psa_util_internal.h", "extern const mbedtls_error_pair_t psa_to_ssl_errors[7];", "__declspec(dllimport) const mbedtls_error_pair_t psa_to_ssl_errors[7];", {plain = true}) + end + else + table.insert(configs, "-DUSE_SHARED_MBEDTLS_LIBRARY=OFF") + table.insert(configs, "-DUSE_STATIC_MBEDTLS_LIBRARY=ON") + end + local cxflags + if package:is_plat("mingw") and package:is_arch("i386") then + cxflags = {"-maes", "-msse2", "-mpclmul"} + end + import("package.tools.cmake").install(package, configs, {cxflags = cxflags}) end) on_test(function (package) assert(package:has_cfuncs("mbedtls_ssl_init", {includes = "mbedtls/ssl.h"})) - end) + assert(package:check_cxxsnippets({test = [[ + void test() { + mbedtls_aes_context ctx; + unsigned char key[32]; + mbedtls_aes_setkey_enc(&ctx, key, 256); + } + ]]}, {includes = "mbedtls/aes.h"})) + end) diff --git a/packages/m/mcfgthread/patches/1.8.alpha-1/meson.patch b/packages/m/mcfgthread/patches/1.8.alpha-1/meson.patch new file mode 100644 index 000000000..5eb062cfc --- /dev/null +++ b/packages/m/mcfgthread/patches/1.8.alpha-1/meson.patch @@ -0,0 +1,118 @@ +diff --git a/meson.build b/meson.build +index 024f1fb..b2fccd7 100644 +--- a/meson.build ++++ b/meson.build +@@ -277,18 +277,25 @@ mcfgthread_version_o = import('windows').compile_resources( + args: [ '-I.', '-c65001' ], + depend_files: [ 'mcfgthread/version.h.in', 'mcfgthread/version.manifest' ]) + +-lib_mcfgthread_dll = shared_library('mcfgthread', +- c_pch: 'mcfgthread/xprecompiled.h', +- c_args: [ '-ffreestanding', '-fasynchronous-unwind-tables', '-DDLL_EXPORT' ], +- link_args: [ '-nostdlib', '-Wl,--entry,__MCF_dll_startup@@Z', +- '-Wl,--enable-auto-image-base', '-Wl,--subsystem,windows:6.1', +- '-Wl,--exclude-all-symbols', '-Wl,--kill-at' ], +- sources: [ mcfgthread_src, mcfgthread_version_o ], +- dependencies: [ dep_kernel32, dep_ntdll ], +- soversion: ver.get('abi_major'), +- version: '.'.join([ ver.get('abi_major'), ver.get('abi_minor'), '0' ]), +- install: true) ++if get_option('default_library') == 'shared' ++ lib_mcfgthread_dll = shared_library('mcfgthread', ++ c_pch: 'mcfgthread/xprecompiled.h', ++ c_args: [ '-ffreestanding', '-fasynchronous-unwind-tables', '-DDLL_EXPORT' ], ++ link_args: [ '-nostdlib', '-Wl,--entry,__MCF_dll_startup@@Z', ++ '-Wl,--enable-auto-image-base', '-Wl,--subsystem,windows:6.1', ++ '-Wl,--exclude-all-symbols', '-Wl,--kill-at' ], ++ sources: [ mcfgthread_src, mcfgthread_version_o ], ++ dependencies: [ dep_kernel32, dep_ntdll ], ++ soversion: ver.get('abi_major'), ++ version: '.'.join([ ver.get('abi_major'), ver.get('abi_minor'), '0' ]), ++ install: true) + ++ import('pkgconfig').generate(lib_mcfgthread_dll, ++ name: 'mcfgthread', ++ url: 'https://github.com/lhmouse/mcfgthread', ++ description: 'Cornerstone library for C++11 threading on mingw-w64', ++ libraries: '-lntdll') ++elif get_option('default_library') == 'static' + lib_mcfgthread_a = static_library('mcfgthread', + c_pch: 'mcfgthread/xprecompiled.h', + c_args: [ '-ffreestanding', '-fasynchronous-unwind-tables' ], +@@ -296,35 +303,38 @@ lib_mcfgthread_a = static_library('mcfgthread', + sources: [ mcfgthread_src ], + install: true) + +-import('pkgconfig').generate(lib_mcfgthread_dll, +- name: 'mcfgthread', +- url: 'https://github.com/lhmouse/mcfgthread', +- description: 'Cornerstone library for C++11 threading on mingw-w64', +- libraries: '-lntdll') ++ import('pkgconfig').generate(lib_mcfgthread_a, ++ name: 'mcfgthread', ++ url: 'https://github.com/lhmouse/mcfgthread', ++ description: 'Cornerstone library for C++11 threading on mingw-w64', ++ libraries: '-lntdll') ++endif + + #=========================================================== + # Rules for tests + #=========================================================== +-foreach src: test_src +- test(src, executable(src.replace('.c', '').underscorify(), src, +- link_with: lib_mcfgthread_a)) +-endforeach ++if get_option('build-test') ++ foreach src: test_src ++ test(src, executable(src.replace('.c', '').underscorify(), src, ++ link_with: lib_mcfgthread_a)) ++ endforeach + +-# Specialized: -ladvapi32 -lntdll +-test('test/memory.c', executable('test_memory_c', +- 'test/memory.c', +- dependencies: [ dep_advapi32, dep_ntdll ], +- link_with: lib_mcfgthread_a)) ++ # Specialized: -ladvapi32 -lntdll ++ test('test/memory.c', executable('test_memory_c', ++ 'test/memory.c', ++ dependencies: [ dep_advapi32, dep_ntdll ], ++ link_with: lib_mcfgthread_a)) + +-# Specialized: -std=c89 -Wpedantic +-test('test/gthr_c89_pedantic.c', executable('test_gthr_c89_pedantic_c', +- 'test/gthr_c89_pedantic.c', +- c_args: [ '-std=c89', '-Werror=declaration-after-statement', +- '-Wpedantic', '-Wno-variadic-macros', '-Wno-long-long' ], +- link_with: lib_mcfgthread_a)) ++ # Specialized: -std=c89 -Wpedantic ++ test('test/gthr_c89_pedantic.c', executable('test_gthr_c89_pedantic_c', ++ 'test/gthr_c89_pedantic.c', ++ c_args: [ '-std=c89', '-Werror=declaration-after-statement', ++ '-Wpedantic', '-Wno-variadic-macros', '-Wno-long-long' ], ++ link_with: lib_mcfgthread_a)) + +-# Specialized: -std=c99 -Wpedantic +-test('test/c11_c99_pedantic.c', executable('test_c11_c99_pedantic_c', +- 'test/c11_c99_pedantic.c', +- c_args: [ '-std=c99', '-Wpedantic' ], +- link_with: lib_mcfgthread_a)) ++ # Specialized: -std=c99 -Wpedantic ++ test('test/c11_c99_pedantic.c', executable('test_c11_c99_pedantic_c', ++ 'test/c11_c99_pedantic.c', ++ c_args: [ '-std=c99', '-Wpedantic' ], ++ link_with: lib_mcfgthread_a)) ++endif +\ No newline at end of file +diff --git a/meson.options b/meson.options +index d0342f8..b45d572 100644 +--- a/meson.options ++++ b/meson.options +@@ -15,3 +15,7 @@ + option('enable-debug-checks', + type: 'boolean', value: false, + description: 'enable run-time assertions') ++ ++option('build-test', ++ type: 'boolean', value: false, ++ description: 'Build unit test') diff --git a/packages/m/mcfgthread/xmake.lua b/packages/m/mcfgthread/xmake.lua new file mode 100644 index 000000000..be93aa92b --- /dev/null +++ b/packages/m/mcfgthread/xmake.lua @@ -0,0 +1,28 @@ +package("mcfgthread") + set_homepage("https://gcc-mcf.lhmouse.com/") + set_description("Cornerstone of the MOST efficient std::thread on Windows for mingw-w64") + set_license("GPL-3.0") + + add_urls("https://github.com/lhmouse/mcfgthread/archive/refs/tags/$(version).tar.gz", {version = function (version) return version:gsub("-alpha", ".alpha-1") end}) + add_urls("https://github.com/lhmouse/mcfgthread.git") + + add_versions("1.8-alpha", "4f2b7939f1806b4fb3739d1add63397638e0872c09a1f35c402597aafbc70f32") + + add_patches("1.8-alpha", path.join(os.scriptdir(), "patches", "1.8.alpha-1", "meson.patch"), "db0faa7499218357021f3a5d737653bb42a3bf9840b27aae946cc1fe9bf99a50") + + add_configs("debug_checks", {description = "enable run-time assertions", default = false, type = "boolean"}) + + add_syslinks("ntdll") + + add_deps("meson", "ninja") + + on_install("mingw", "msys", function (package) + local configs = {} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + table.insert(configs, "-Denable-debug-checks=" .. (package:config("debug_checks") and "true" or "false")) + import("package.tools.meson").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("_MCF_utc_now", {includes = "mcfgthread/clock.h"})) + end) diff --git a/packages/m/mcut/patches/1.2.0/install.patch b/packages/m/mcut/patches/1.2.0/install.patch new file mode 100644 index 000000000..d94cad19e --- /dev/null +++ b/packages/m/mcut/patches/1.2.0/install.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 464854d..6801276 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -297,25 +297,10 @@ endif() + + # TODO: package documentation files + +-if(MCUT_BUILD_AS_SHARED_LIB) +- # +- # dynamic libs +- # +- +- install(TARGETS ${mpn_shared_lib_name} +- LIBRARY +- DESTINATION lib/shared +- COMPONENT dynamic_libraries) +-else() +- # +- # static libs +- # +- +- install(TARGETS ${mpn_static_lib_name} +- ARCHIVE +- DESTINATION lib/static +- COMPONENT static_libraries) +-endif() ++install(TARGETS ${target_name} ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + + # + # headers diff --git a/packages/m/mcut/xmake.lua b/packages/m/mcut/xmake.lua index 2d4dbac07..b93109cc5 100644 --- a/packages/m/mcut/xmake.lua +++ b/packages/m/mcut/xmake.lua @@ -1,27 +1,41 @@ package("mcut") - set_homepage("https://cutdigital.github.io/mcut.site/") set_description("Fast & robust mesh boolean library in C++") set_license("GPL-3.0") - add_urls("https://github.com/cutdigital/mcut/archive/refs/tags/$(version).tar.gz") - add_urls("https://github.com/cutdigital/mcut.git") + add_urls("https://github.com/cutdigital/mcut/archive/refs/tags/$(version).tar.gz", + "https://github.com/cutdigital/mcut.git") + + add_versions("v1.3.0", "5f33a8196f2ea4cb700b7ceb493c0674ab7f98fec415cbf04d546366bcc566a2") + add_versions("v1.2.0", "dd339f222468a09f9b54f81ad7f21ef9b5b0b306953615d55684ba581d757297") add_versions("v1.1.0", "a31efbb4c963a40574ee0bad946d02dc77df873f68d35524363bd71d2ae858bd") + add_patches("1.3.0", path.join(os.scriptdir(), "patches", "1.2.0", "install.patch"), "f5eecb8fa8281c11ab8a10314b83bfba437009255fb46382d210010f584dabec") + add_patches("1.2.0", path.join(os.scriptdir(), "patches", "1.2.0", "install.patch"), "f5eecb8fa8281c11ab8a10314b83bfba437009255fb46382d210010f584dabec") add_patches("1.1.0", path.join(os.scriptdir(), "patches", "1.1.0", "install.patch"), "438f5b76d8ad58253420844248c5da09404cc7ad4a7a19c174e90aacf714d0f0") + if is_plat("linux") then + add_syslinks("pthread") + end + add_deps("cmake") - on_load("windows", function (package) - if package:config("shared") then + + on_install("windows|x86", "windows|x64", "macosx", "linux", "mingw", function (package) + -- patch gcc 13 + io.replace("include/mcut/internal/hmesh.h", "#include ", "#include \n#include \n", {plain = true}) + + local cxflags = {} + if package:is_plat("mingw") then + io.replace("include/mcut/internal/tpool.h", "_Acquires_lock_(return)", "", {plain = true}) + cxflags = "-Wa,-mbig-obj" + elseif package:is_plat("windows") and package:config("shared") then package:add("defines", "MCUT_SHARED_LIB") end - end) - on_install("windows|x86", "windows|x64", "macosx", "linux", "mingw", function (package) local configs = {"-DMCUT_BUILD_TESTS=OFF", "-DMCUT_BUILD_TUTORIALS=OFF"} - table.insert(configs, "-DCMAKE_BUILD_TYPES=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DCMAKE_BUILD_TYPES=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DMCUT_BUILD_AS_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) + import("package.tools.cmake").install(package, configs, {cxflags = cxflags}) end) on_test(function (package) diff --git a/packages/m/md4c/xmake.lua b/packages/m/md4c/xmake.lua new file mode 100644 index 000000000..34b8fac33 --- /dev/null +++ b/packages/m/md4c/xmake.lua @@ -0,0 +1,26 @@ +package("md4c") + set_homepage("https://github.com/mity/md4c") + set_description("C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.") + set_license("MIT") + + add_urls("https://github.com/mity/md4c.git") + add_versions("2024.02.25", "481fbfbdf72daab2912380d62bb5f2187d438408") + + add_deps("cmake") + + add_links("md4c-html", "md4c") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + package:addenv("PATH", "bin") + end) + + on_test(function (package) + assert(package:has_cfuncs("md_html", {includes = "md4c-html.h"})) + if not package:is_cross() then + os.exec("md2html --version") + end + end) diff --git a/packages/m/md4qt/xmake.lua b/packages/m/md4qt/xmake.lua new file mode 100644 index 000000000..141e8730c --- /dev/null +++ b/packages/m/md4qt/xmake.lua @@ -0,0 +1,51 @@ +package("md4qt") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/igormironchik/md4qt") + set_description("Markdown parser for Qt6 or ICU") + set_license("MIT") + + add_urls("https://github.com/igormironchik/md4qt/archive/refs/tags/$(version).tar.gz", + "https://github.com/igormironchik/md4qt.git") + + add_versions("2.8.1", "02a046c1586da820be0c5dd36f635ca50060f893fe638b542546f4a7a07d3164") + add_versions("2.8.0", "82ef6acc84ea3a7891e4547f7d79af4caaef0f4d6f152bdab2a5c6ed5a48d11b") + add_versions("2.4.2", "76f3228dd9afa2661fe9326b51e5ec8dc29e364f99fb0f94704792610d543fa2") + add_versions("2.1.0", "cfbf515adecd798a3f1a4f2e007021b4b31742dd0b36805c273b3b8316fd820d") + + add_configs("qt6", {description = "Use Qt6", default = true, type = "boolean"}) + add_configs("icu", {description = "Use icu", default = false, type = "boolean"}) + + add_deps("cmake") + add_deps("qt6core") + + on_load(function (package) + if package:config("icu") then + package:add("deps", "icu4c", "uriparser") + end + end) + + on_install("windows|x64", "linux|x86_64", "macosx|x86_64", "mingw|x86_64", function (package) + import("package.tools.cmake").install(package, { + "-DBUILD_MD4QT_BENCHMARK=OFF", + "-DBUILD_MD4QT_QT_TESTS=OFF", + "-DBUILD_MD4QT_STL_TESTS=OFF", + "-DBUILD_MD2HTML_APP=OFF", + }) + end) + + on_test(function (package) + local cxflags + if package:is_plat("windows") then + cxflags = {"/Zc:__cplusplus", "/permissive-"} + else + cxflags = "-fPIC" + end + assert(package:check_cxxsnippets({test = [[ + #define MD4QT_QT_SUPPORT + #include + void test() { + MD::Parser< MD::QStringTrait > p; + auto doc = p.parse( QStringLiteral( "your_markdown.md" ) ); + } + ]]}, {configs = {languages = "c++17", cxflags = cxflags}})) + end) diff --git a/packages/m/mdns/xmake.lua b/packages/m/mdns/xmake.lua index 872d0e6ac..6b038ca08 100644 --- a/packages/m/mdns/xmake.lua +++ b/packages/m/mdns/xmake.lua @@ -5,6 +5,7 @@ package("mdns") add_urls("https://github.com/mjansson/mdns/archive/refs/tags/$(version).tar.gz", "https://github.com/mjansson/mdns.git") + add_versions("1.4.3", "be1fd8e35599cb7de179decbd0633c121d11a2dcb9cc193ff5c590bd0d480483") add_versions("1.4.2", "c69cfdebe28a489c85f33744f7811c40572a9769a81cd57ecc09ef95802347f2") add_deps("cmake") diff --git a/packages/m/mecab/xmake.lua b/packages/m/mecab/xmake.lua new file mode 100644 index 000000000..b24d0eddf --- /dev/null +++ b/packages/m/mecab/xmake.lua @@ -0,0 +1,32 @@ +package("mecab") + set_description("Yet another part-of-speech and morphological analyzer.") + set_homepage("https://taku910.github.io/mecab/") + set_license("GPL-2.0") + + add_urls("https://github.com/taku910/mecab/archive/05481e751dd5aa536a2bace46715ce54568b972a.zip") + add_versions("0.996", "d5d3ec4954e969ea93f4f1d778d7dc3ae98848056ee1c8cb99fced8578fd73f3") + + if is_plat("linux") then + add_extsources("pacman::mecab-git", "apt::mecab") + end + + on_install("macosx|x86_64", "linux", function (package) + os.cd("mecab") + local configs = {} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) + import("package.tools.autoconf").install(package, {"--with-charset=utf-8"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include + static void test() { + std::unique_ptr tagger{ MeCab::createTagger("") }; + assert(tagger != nullptr); + } + ]]}, {configs = {languages = "c++17"}})) + end) + diff --git a/packages/m/memorymapping/xmake.lua b/packages/m/memorymapping/xmake.lua index 20e2da657..88cf60670 100644 --- a/packages/m/memorymapping/xmake.lua +++ b/packages/m/memorymapping/xmake.lua @@ -7,7 +7,7 @@ package("memorymapping") add_versions("2014.12.21", "79ce0ddd0de4b11e4944625eb866290368f867c0") - on_install("android", "macosx", "iphoneos", function (package) + on_install("macosx", "iphoneos", function (package) io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") target("fmemopen") @@ -16,11 +16,6 @@ package("memorymapping") add_headerfiles("src/*.h") ]]) local configs = {} - if package:config("shared") then - configs.kind = "shared" - elseif package:config("pic") ~= false then - configs.cxflags = "-fPIC" - end import("package.tools.xmake").install(package, configs) end) diff --git a/packages/m/memplumber/port/xmake.lua b/packages/m/memplumber/port/xmake.lua new file mode 100644 index 000000000..1c929bb9b --- /dev/null +++ b/packages/m/memplumber/port/xmake.lua @@ -0,0 +1,24 @@ +add_rules("mode.debug", "mode.release") + +option("collect_static_var_data", {description = "Collect data also on static variable memory allocation", default = false, type = "boolean"}) + +if is_plat("linux", "macosx") then + add_requires("libbacktrace") +end + +target("memplumber") + set_kind("$(kind)") + set_languages("cxx11") + + add_files("memplumber.cpp") + add_headerfiles("(memplumber.h)", "memplumber-internals.h") + + if is_plat("linux", "macosx") then + add_packages("libbacktrace") + elseif is_plat("windows", "mingw") then + add_defines("_WIN32") + end + + if has_config("collect_static_var_data") then + add_defines("COLLECT_STATIC_VAR_DATA") + end \ No newline at end of file diff --git a/packages/m/memplumber/xmake.lua b/packages/m/memplumber/xmake.lua new file mode 100644 index 000000000..726cc834c --- /dev/null +++ b/packages/m/memplumber/xmake.lua @@ -0,0 +1,37 @@ +package("memplumber") + set_homepage("https://github.com/seladb/MemPlumber") + set_description("MemPlumber is a library that helps developers with debugging of memory allocations and detection of memory leaks in C++ applications") + set_license("MIT") + + add_urls("https://github.com/seladb/MemPlumber.git") + add_versions("2022.01.27", "ff04d339b034c40f72e09653c6a0340c0bb05d3b") + + if is_plat("linux", "macosx") then + add_deps("libbacktrace") + end + + add_configs("collect_static_var_data", {description = "Collect data also on static variable memory allocation", default = false, type = "boolean"}) + + on_install("windows", "linux", "macosx", "mingw", function (package) + io.replace("memplumber.cpp", "unsigned long", "uintptr_t") + os.cp(path.join(os.scriptdir(), "port", "xmake.lua"), "xmake.lua") + local configs = {} + configs.collect_static_var_data = package:config("collect_static_var_data") + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + MemPlumber::start(); + int* num = new int(100); + + size_t memLeakCount; + uint64_t memLeakSize; + MemPlumber::memLeakCheck(memLeakCount, memLeakSize, true); + + MemPlumber::stopAndFreeAllMemory(); + } + ]]}, {configs = {languages = "cxx11"}})) + end) diff --git a/packages/m/meshoptimizer/xmake.lua b/packages/m/meshoptimizer/xmake.lua index ebe059fab..f08d486f8 100644 --- a/packages/m/meshoptimizer/xmake.lua +++ b/packages/m/meshoptimizer/xmake.lua @@ -7,6 +7,7 @@ package("meshoptimizer") add_urls("https://github.com/zeux/meshoptimizer/archive/refs/tags/$(version).tar.gz", "https://github.com/zeux/meshoptimizer.git") add_versions("v0.18", "f5bc07d7322e6292fe0afce03462b5c394d111386236f926fdc44d2aff3b854b") + add_versions("v0.20", "cf1077a83958bed3d8da28a841ca53a6a42d871e49023edce64e37002a0f5a48") add_deps("cmake") on_load("windows", function (package) diff --git a/packages/m/meson/xmake.lua b/packages/m/meson/xmake.lua index 948d408e3..7998c12d8 100644 --- a/packages/m/meson/xmake.lua +++ b/packages/m/meson/xmake.lua @@ -6,6 +6,10 @@ package("meson") add_urls("https://github.com/mesonbuild/meson/releases/download/$(version)/meson-$(version).tar.gz", "https://github.com/mesonbuild/meson.git") + add_versions("1.4.0", "8fd6630c25c27f1489a8a0392b311a60481a3c161aa699b330e25935b750138d") + add_versions("1.3.2", "492eb450c8b073024276f916f5adbb3c4bb7e90e9e6ec124efda064f3d9b5baa") + add_versions("1.3.1", "6020568bdede1643d4fb41e28215be38eff5d52da28ac7d125457c59e0032ad7") + add_versions("1.3.0", "4ba253ef60e454e23234696119cbafa082a0aead0bd3bbf6991295054795f5dc") add_versions("1.1.1", "d04b541f97ca439fb82fab7d0d480988be4bd4e62563a5ca35fadb5400727b1c") add_versions("1.1.0", "d9616c44cd6c53689ff8f05fc6958a693f2e17c3472a8daf83cee55dabff829f") add_versions("1.0.0", "aa50a4ba4557c25e7d48446abfde857957dcdf58385fffbe670ba0e8efacce05") diff --git a/packages/m/metis/port/xmake.lua b/packages/m/metis/port/xmake.lua new file mode 100644 index 000000000..618e5ed19 --- /dev/null +++ b/packages/m/metis/port/xmake.lua @@ -0,0 +1,59 @@ +option("tools", {default = false}) + +add_rules("mode.debug", "mode.release") + +add_requires("gklib") +add_packages("gklib") + +add_includedirs("include") + +target("metis") + set_kind("$(kind)") + add_files("libmetis/*.c") + add_headerfiles("include/metis.h") + + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + +if has_config("tools") then + target("tool_lib") + set_kind("static") + add_files( + "programs/io.c", + "programs/stat.c", + "programs/smbfactor.c" + ) + + on_install(function(target) end) + + target("gpmetis") + set_kind("binary") + add_files("programs/gpmetis.c", "programs/cmdline_gpmetis.c") + add_deps("tool_lib") + + target("ndmetis") + set_kind("binary") + add_files("programs/ndmetis.c", "programs/cmdline_ndmetis.c") + add_deps("tool_lib") + + target("mpmetis") + set_kind("binary") + add_files("programs/mpmetis.c", "programs/cmdline_mpmetis.c") + add_deps("tool_lib") + + target("m2gmetis") + set_kind("binary") + add_files("programs/m2gmetis.c", "programs/cmdline_m2gmetis.c") + add_deps("tool_lib") + + target("graphchk") + set_kind("binary") + add_files("programs/graphchk.c") + add_deps("tool_lib") + + target("cmpfillin") + set_kind("binary") + add_files("programs/cmpfillin.c") + add_deps("tool_lib") +end diff --git a/packages/m/metis/xmake.lua b/packages/m/metis/xmake.lua index e03f2510e..c878d0091 100644 --- a/packages/m/metis/xmake.lua +++ b/packages/m/metis/xmake.lua @@ -1,28 +1,29 @@ package("metis") - set_homepage("http://glaros.dtc.umn.edu/gkhome/metis/metis/overview") set_description("Serial Graph Partitioning and Fill-reducing Matrix Ordering") + set_license("Apache-2.0") + + add_urls("https://github.com/KarypisLab/METIS/archive/refs/tags/$(version).tar.gz", + "https://github.com/KarypisLab/METIS.git") - add_urls("https://github.com/xq114/METIS/archive/v$(version).tar.gz") - add_versions("5.1.1", "945d381d3b50ca70ac93f0daf32c80e6f16f11514879d5ff1438aa82c20a0ba5") + add_versions("v5.2.1", "1a4665b2cd07edc2f734e30d7460afb19c1217c2547c2ac7bf6e1848d50aff7a") - add_deps("cmake") add_configs("long_index", {description = "Use 64-bit uint as index.", default = false, type = "boolean"}) add_configs("double", {description = "Use double precision floats.", default = true, type = "boolean"}) + add_configs("tools", {description = "Build tools", default = false, type = "boolean"}) + + add_deps("gklib") + + on_install("!iphoneos", function (package) + local idx_width = package:config("long_index") and 64 or 32 + io.gsub(path.join("include", "metis.h"), "//#define IDXTYPEWIDTH %d+", "#define IDXTYPEWIDTH " .. idx_width) + local real_width = package:config("double") and 64 or 32 + io.gsub(path.join("include", "metis.h"), "//#define REALTYPEWIDTH %d+", "#define REALTYPEWIDTH " .. real_width) - on_install("windows", "macosx", "linux", function (package) - if package:config("long_index") then - io.gsub(path.join("include", "metis.h"), "define IDXTYPEWIDTH %d+", "define IDXTYPEWIDTH 64") - end - if package:config("double") then - io.gsub(path.join("include", "metis.h"), "define REALTYPEWIDTH %d+", "define REALTYPEWIDTH 64") - end - local configs = {} - table.insert(configs, "-DSHARED=" .. (package:config("shared") and "ON" or "OFF")) - table.insert(configs, "-DDEBUG=" .. (package:debug() and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, {tools = package:config("tools")}) end) on_test(function (package) - assert(package:has_cxxfuncs("METIS_SetDefaultOptions", {includes = "metis.h"})) + assert(package:has_cfuncs("METIS_SetDefaultOptions", {includes = "metis.h"})) end) diff --git a/packages/m/microprofile/xmake.lua b/packages/m/microprofile/xmake.lua new file mode 100644 index 000000000..30cd3d643 --- /dev/null +++ b/packages/m/microprofile/xmake.lua @@ -0,0 +1,44 @@ +package("microprofile") + set_homepage("https://github.com/jonasmr/microprofile") + set_description("microprofile is an embeddable profiler") + set_license("Unlicense") + + add_urls("https://github.com/jonasmr/microprofile/archive/refs/tags/$(version).tar.gz", + "https://github.com/jonasmr/microprofile.git") + + add_versions("v4.0", "59cd3ee7afd3ce5cfeb7599db62ccc0611818985a8e649353bec157122902a5c") + + if is_plat("windows") then + add_syslinks("ws2_32", "advapi32", "shell32") + add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true}) + elseif is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + add_deps("stb") + + on_install("windows", "linux", "macosx", "bsd", "android", "iphoneos", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + set_languages("c++11") + add_requires("stb") + target("microprofile") + set_kind("$(kind)") + add_files("microprofile.cpp") + add_headerfiles("microprofile.h", "microprofile_html.h") + if is_plat("windows") then + add_syslinks("ws2_32", "advapi32", "shell32") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + elseif is_plat("linux", "bsd") then + add_syslinks("pthread") + end + add_packages("stb") + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("MicroProfileFlip", {includes = "microprofile.h"})) + end) diff --git a/packages/m/microsoft-detours/xmake.lua b/packages/m/microsoft-detours/xmake.lua index 71c83a084..ccbd263b7 100644 --- a/packages/m/microsoft-detours/xmake.lua +++ b/packages/m/microsoft-detours/xmake.lua @@ -1,5 +1,4 @@ package("microsoft-detours") - set_homepage("https://github.com/microsoft/Detours") set_description("Detours is a software package for monitoring and instrumenting API calls on Windows. It is distributed in source code form.") set_license("MIT") @@ -7,27 +6,22 @@ package("microsoft-detours") set_urls("https://github.com/microsoft/Detours.git") add_versions("2023.6.8", "734ac64899c44933151c1335f6ef54a590219221") - on_install("windows", function (package) - local configs = {} + on_install("windows", "mingw", function (package) io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") target("microsoft-detours") set_kind("$(kind)") add_files("src/*.cpp|uimports.cpp") add_headerfiles("src/*.h") - add_defines("WIN32_LEAN_AND_MEAN", "_WIN32_WINNT=0x501") + add_defines("WIN32_LEAN_AND_MEAN") if is_mode("debug") then add_defines("DETOUR_DEBUG=1") end ]]) - package:add("defines", "WIN32_LEAN_AND_MEAN", "_WIN32_WINNT=0x501") - if package:config("shared") then - configs.kind = "shared" - end if package:is_debug() then package:add("defines", "DETOUR_DEBUG=1") end - import("package.tools.xmake").install(package, configs) + import("package.tools.xmake").install(package) end) on_test(function (package) diff --git a/packages/m/microsoft-gsl/xmake.lua b/packages/m/microsoft-gsl/xmake.lua index 7266d47e9..7ec3cdd39 100644 --- a/packages/m/microsoft-gsl/xmake.lua +++ b/packages/m/microsoft-gsl/xmake.lua @@ -1,5 +1,5 @@ package("microsoft-gsl") - + set_kind("library", {headeronly = true}) set_homepage("https://github.com/microsoft/GSL") set_description("Guidelines Support Library") set_license("MIT") diff --git a/packages/m/microsoft-proxy/xmake.lua b/packages/m/microsoft-proxy/xmake.lua index 7f45cf3f6..a73d98135 100644 --- a/packages/m/microsoft-proxy/xmake.lua +++ b/packages/m/microsoft-proxy/xmake.lua @@ -8,6 +8,9 @@ package("microsoft-proxy") add_urls("https://github.com/microsoft/proxy/archive/refs/tags/$(version).tar.gz", "https://github.com/microsoft/proxy.git") + add_versions("2.4.0", "7eed973655938d681a90dcc0c200e6cc1330ea8611a9c1a9e1b30439514443cb") + add_versions("2.3.0", "ff6f17c5360895776d29ce2b1235de7b42912468b52729810506431e352a78d0") + add_versions("2.2.1", "096f0b2d793dffc54d41def2bca0ced594b6b8efe35ac5ae27db35802e742b96") add_versions("1.1.1", "6852b135f0bb6de4dc723f76724794cff4e3d0d5706d09d0b2a4f749f309055d") on_install(function (package) diff --git a/packages/m/mimalloc/xmake.lua b/packages/m/mimalloc/xmake.lua index 993e4c1a9..1abb1f0c1 100644 --- a/packages/m/mimalloc/xmake.lua +++ b/packages/m/mimalloc/xmake.lua @@ -35,12 +35,16 @@ package("mimalloc") end on_install("macosx", "windows", "linux", "android", "mingw", function (package) - local configs = {"-DMI_OVERRIDE=OFF"} + local configs = { + "-DMI_OVERRIDE=OFF", + "-DMI_BUILD_TESTS=OFF", + "-DMI_BUILD_OBJECT=OFF", + } + + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DMI_BUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON")) table.insert(configs, "-DMI_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DMI_SECURE=" .. (package:config("secure") and "ON" or "OFF")) - table.insert(configs, "-DMI_BUILD_TESTS=OFF") - table.insert(configs, "-DMI_BUILD_OBJECT=OFF") --x64:mimalloc-redirect.lib/dll x86:mimalloc-redirect32.lib/dll if package:version():le("2.0.1") and package:config("shared") and package:is_plat("windows") and package:is_arch("x86") then io.replace("CMakeLists.txt", "-redirect.", "-redirect32.", {plain = true}) @@ -54,20 +58,29 @@ package("mimalloc") package:configs().cxflags = "-DMI_USE_RTLGENRANDOM" end end - import("package.tools.cmake").build(package, configs, {buildir = "build", cxflags = cxflags}) - if package:is_plat("windows") then - os.trycp("build/**.dll", package:installdir("bin")) - os.trycp("build/**.lib", package:installdir("lib")) - elseif package:is_plat("mingw") then - os.trycp("build/**.dll", package:installdir("bin")) - os.trycp("build/**.a", package:installdir("lib")) + if package:version():ge("2.1.2") then + table.insert(configs, "-DMI_INSTALL_TOPLEVEL=ON") + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") + end + import("package.tools.cmake").install(package, configs, {cxflags = cxflags}) else - os.trycp("build/*.so", package:installdir("bin")) - os.trycp("build/*.so", package:installdir("lib")) - os.trycp("build/*.a", package:installdir("lib")) + import("package.tools.cmake").build(package, configs, {buildir = "build", cxflags = cxflags}) + + if package:is_plat("windows") then + os.trycp("build/**.dll", package:installdir("bin")) + os.trycp("build/**.lib", package:installdir("lib")) + elseif package:is_plat("mingw") then + os.trycp("build/**.dll", package:installdir("bin")) + os.trycp("build/**.a", package:installdir("lib")) + else + os.trycp("build/*.so", package:installdir("bin")) + os.trycp("build/*.so", package:installdir("lib")) + os.trycp("build/*.a", package:installdir("lib")) + end + os.cp("include", package:installdir()) end - os.cp("include", package:installdir()) end) on_test(function (package) diff --git a/packages/m/mingw-w64/xmake.lua b/packages/m/mingw-w64/xmake.lua index 174fd524f..771ad1345 100644 --- a/packages/m/mingw-w64/xmake.lua +++ b/packages/m/mingw-w64/xmake.lua @@ -5,11 +5,15 @@ package("mingw-w64") set_description("The mingw-w64 project is a complete runtime environment for gcc to support binaries native to Windows 64-bit and 32-bit operating systems.") if is_arch("x86") then - add_urls("https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/$(version)/threads-posix/sjlj/i686-$(version)-release-posix-sjlj-rt_v6-rev0.7z") - add_versions("8.1.0", "f5b97d1a8c15f527c0f0397d0f128ff0af6acc9fab1ecd79ad403661c0a425ac") + add_urls("https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/$(version)/threads-posix/sjlj/i686-$(version)-release-posix-sjlj-rt_v6-rev0.7z", {alias = "sourceforge"}) + add_urls("https://github.com/niXman/mingw-builds-binaries/releases/download/$(version)-rt_v9-rev1/i686-$(version)-release-posix-sjlj-rt_v9-rev1.7z", {alias = "github"}) + add_versions("sourceforge:8.1.0", "f5b97d1a8c15f527c0f0397d0f128ff0af6acc9fab1ecd79ad403661c0a425ac") + add_versions("github:11.2.0", "578fe0ffce6110cbff56b4028d10d6e5fdb61e3aa2d02dc71bd4230c56096ef5") else - add_urls("https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/$(version)/threads-posix/seh/x86_64-$(version)-release-posix-seh-rt_v6-rev0.7z") - add_versions("8.1.0", "853970527b5de4a55ec8ca4d3fd732c00ae1c69974cc930c82604396d43e79f8") + add_urls("https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/$(version)/threads-posix/seh/x86_64-$(version)-release-posix-seh-rt_v6-rev0.7z", {alias = "sourceforge"}) + add_urls("https://github.com/niXman/mingw-builds-binaries/releases/download/$(version)-rt_v9-rev1/x86_64-$(version)-release-posix-seh-rt_v9-rev1.7z", {alias = "github"}) + add_versions("sourceforge:8.1.0", "853970527b5de4a55ec8ca4d3fd732c00ae1c69974cc930c82604396d43e79f8") + add_versions("github:11.2.0", "2c943b1a9231ce09f227b0c8fc6cabc61da3581f4ef2f7682f9393f5a1d70ae8") end add_configs("python2", {description = "Export builtin python2.", default = false, type = "boolean"}) diff --git a/packages/m/miniaudio/xmake.lua b/packages/m/miniaudio/xmake.lua index 21e1b83d5..5a7b1fa64 100644 --- a/packages/m/miniaudio/xmake.lua +++ b/packages/m/miniaudio/xmake.lua @@ -5,10 +5,18 @@ package("miniaudio") set_urls("https://github.com/mackron/miniaudio/archive/refs/tags/$(version).tar.gz", "https://github.com/mackron/miniaudio.git") + add_versions("0.11.21", "6afb5c231613d2fab4f1c668b7243ff9a7d6d78a7f5a2692c133f026fe508506") add_versions("0.11.15", "24a6d38fe69cd42d91f6c1ad211bb559f6c89768c4671fa05b8027f5601d5457") add_versions("0.11.16", "13320464820491c61bd178b95818fecb7cd0e68f9677d61e1345df6be8d4d77e") add_versions("0.11.17", "4b139065f7068588b73d507d24e865060e942eb731f988ee5a8f1828155b9480") + add_versions("0.11.18", "85ca916266d809b39902e180a6d16f82caea9c2ea1cea6d374413641b7ba48c3") + if is_plat("iphoneos") then + add_frameworks("AudioToolbox", "AVFoundation", "CoreFoundation", "Foundation") + elseif is_plat("macosx") then + add_defines("MA_NO_RUNTIME_LINKING") + add_frameworks("AudioToolbox", "CoreAudio", "AudioUnit", "AVFoundation", "CoreFoundation", "Foundation") + end on_install(function (package) os.cp("miniaudio.h", package:installdir("include")) diff --git a/packages/m/minizip-ng/xmake.lua b/packages/m/minizip-ng/xmake.lua index 41bd06062..08d2672ff 100644 --- a/packages/m/minizip-ng/xmake.lua +++ b/packages/m/minizip-ng/xmake.lua @@ -6,6 +6,9 @@ package("minizip-ng") add_urls("https://github.com/zlib-ng/minizip-ng/archive/refs/tags/$(version).tar.gz", "https://github.com/zlib-ng/minizip-ng.git") + add_versions("4.0.6", "e96ed3866706a67dbed05bf035e26ef6b60f408e1381bf0fe9af17fe2c0abebc") + add_versions("4.0.5", "9bb636474b8a4269280d32aca7de4501f5c24cc642c9b4225b4ed7b327f4ee73") + add_versions("4.0.4", "955800fe39f9d830fcb84e60746952f6a48e41093ec7a233c63ad611b5fcfe9f") add_versions("3.0.3", "5f1dd0d38adbe9785cb9c4e6e47738c109d73a0afa86e58c4025ce3e2cc504ed") add_versions("3.0.5", "1a248c378fdf4ef6c517024bb65577603d5146cffaebe81900bec9c0a5035d4d") @@ -15,6 +18,7 @@ package("minizip-ng") add_configs("zstd", {description = "Enable zstd comppressression library.", default = false, type = "boolean"}) add_deps("cmake") + if is_plat("macosx") then add_frameworks("CoreFoundation", "Security") add_syslinks("iconv") @@ -25,6 +29,13 @@ package("minizip-ng") end on_load(function (package) + if package:version():ge("4.0") then + if package:is_plat("macosx") then + package:add("deps", "openssl") + elseif package:is_plat("windows", "mingw") then + package:add("syslinks", "Bcrypt") + end + end for name, enabled in pairs(package:configs()) do if not package:extraconf("configs", name, "builtin") then if enabled then @@ -47,5 +58,9 @@ package("minizip-ng") end) on_test(function (package) - assert(package:has_cfuncs("zipOpen", {includes = {"mz.h", "mz_compat.h"}})) + if package:version():ge("4.0") then + assert(package:has_cfuncs("zipOpen", {includes = {"minizip/mz.h", "minizip/mz_compat.h"}})) + else + assert(package:has_cfuncs("zipOpen", {includes = {"mz.h", "mz_compat.h"}})) + end end) diff --git a/packages/m/minizip/xmake.lua b/packages/m/minizip/xmake.lua index 14357ee34..974b46b42 100644 --- a/packages/m/minizip/xmake.lua +++ b/packages/m/minizip/xmake.lua @@ -12,6 +12,8 @@ package("minizip") add_deps("zlib") + add_includedirs("include", "include/minizip") + on_install(function (package) os.cd(path.join("contrib", "minizip")) io.writefile("xmake.lua", [[ @@ -22,7 +24,7 @@ package("minizip") target("minizip") set_kind("$(kind)") add_files("zip.c", "unzip.c", "mztools.c", "ioapi.c") - add_headerfiles("crypt.h", "zip.h", "unzip.h", "ioapi.h", "mztools.h") + add_headerfiles("crypt.h", "zip.h", "unzip.h", "ioapi.h", "mztools.h", {prefixdir = "minizip"}) add_packages("zlib") if is_plat("windows") then add_files("iowin32.c") diff --git a/packages/m/mint/xmake.lua b/packages/m/mint/xmake.lua index c8855e6ca..79669164a 100644 --- a/packages/m/mint/xmake.lua +++ b/packages/m/mint/xmake.lua @@ -7,7 +7,9 @@ package("mint") add_urls("https://github.com/Chuyu-Team/MINT/archive/refs/tags/$(version).tar.gz", "https://github.com/Chuyu-Team/MINT.git") - add_versions("2023.0","cb5a87c0af09243444a71bd04b267e0656d815cecd9512062ecd5680f6610b94") + add_versions("2024.1", "3d77d9df1c724c98b6251f8c5c25cdf131143a80a226614a668d779db05d25e5") + add_versions("2024.0", "620cad4f1c071ba841d5b5d64a8b674bfe2f98a8db74ac81d93c8d8bff712ef2") + add_versions("2023.0", "cb5a87c0af09243444a71bd04b267e0656d815cecd9512062ecd5680f6610b94") add_configs("namespace", {description = "use separate namespace", default = false, type = "boolean"}) @@ -20,7 +22,11 @@ package("mint") end) on_install("windows", function (package) - os.cp("MINT.h", package:installdir("include")) + if package:version():ge("2024.0") then + os.cp("Mint/**", package:installdir("include")) + else + os.cp("MINT.h", package:installdir("include")) + end end) on_test(function (package) diff --git a/packages/m/mio/xmake.lua b/packages/m/mio/xmake.lua index ed8c35295..d40e1c0ce 100644 --- a/packages/m/mio/xmake.lua +++ b/packages/m/mio/xmake.lua @@ -7,9 +7,10 @@ package("mio") add_urls("https://github.com/mandreyel/mio.git") add_versions("2021.9.21", "3f86a95c0784d73ce6815237ec33ed25f233b643") + add_versions("2023.3.3", "8b6b7d878c89e81614d05edca7936de41ccdd2da") add_deps("cmake") - on_install("linux", "macosx", "bsd", "iphoneos", "android", function (package) + on_install("windows", "linux", "macosx", "bsd", "iphoneos", "android", function (package) import("package.tools.cmake").install(package, {"-Dmio.tests=OFF"}) end) @@ -22,7 +23,7 @@ package("mio") #include static void test() { - mio::mmap_source mmap(0, 0, mio::map_entire_file); + mio::mmap_source mmap(mio::invalid_handle, 0, mio::map_entire_file); } ]] }, {configs = {languages = "c++11"}})) diff --git a/packages/m/mjson/xmake.lua b/packages/m/mjson/xmake.lua index e5bb4ec15..3403956d0 100644 --- a/packages/m/mjson/xmake.lua +++ b/packages/m/mjson/xmake.lua @@ -6,6 +6,7 @@ package("mjson") add_urls("https://github.com/cesanta/mjson/archive/refs/tags/$(version).zip", "https://github.com/cesanta/mjson.git") + add_versions("1.2.7", "ab3dfb813c8944f4a8ef6b17b0c2255136937d9fb24ef000e75aedd1fd17248d") add_versions("1.2.6", "d801348c38c883802a540eec0b3ea14318837084cbdd32bd83041d03a8850fe6") add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) diff --git a/packages/m/mkl/xmake.lua b/packages/m/mkl/xmake.lua index 8693e256d..ebaa5f428 100644 --- a/packages/m/mkl/xmake.lua +++ b/packages/m/mkl/xmake.lua @@ -15,6 +15,10 @@ package("mkl") add_resources("2021.3.0+524", "headers", "https://anaconda.org/intel/mkl-include/2021.3.0/download/win-64/mkl-include-2021.3.0-intel_524.tar.bz2", "8ca8f77d0c57a434541d62a9c61781aa37225f5e669de01b8cc98488b3f9e82f") add_versions("2022.1.0+192", "fd9a529c0caa27ee3068e8d845f07e536970b0cbf713118d1f3daa32fb2b9e8c") add_resources("2022.1.0+192", "headers", "https://anaconda.org/intel/mkl-include/2022.1.0/download/win-64/mkl-include-2022.1.0-intel_192.tar.bz2", "b6452e8c4891fcfab452bc23c6adc9c61ab6635fa494bb2b29725473c1013abc") + add_versions("2023.2.0+49496", "21a9fe03ba80009934a50b9d75f16757b9e49415e44245ced3b896fd471351ca") + add_resources("2023.2.0+49496", "headers", "https://anaconda.org/intel/mkl-include/2023.2.0/download/win-64/mkl-include-2023.2.0-intel_49496.tar.bz2", "daa93c899e6c7627232fa60e67a2b6079cd29752e8ba1251ae895a57e51defa7") + add_versions("2024.1.0+692", "6431647057cd8757a464a3f6ab2099139e059d04446f04443afd2570febe42bf") + add_resources("2024.1.0+692", "headers","https://anaconda.org/intel/mkl-include/2024.1.0/download/win-64/mkl-include-2024.1.0-intel_692.tar.bz2","28229844aa6c19870531452e5805ab876da4a5df896a9e753e6b481da2d389cb") elseif is_arch("x86") then add_urls("https://anaconda.org/intel/mkl-static/$(version).tar.bz2", {version = function (version) local mv = version:split("%+") @@ -26,6 +30,10 @@ package("mkl") add_resources("2021.3.0+524", "headers", "https://anaconda.org/intel/mkl-include/2021.3.0/download/win-32/mkl-include-2021.3.0-intel_524.tar.bz2", "9ff8e58dc98da8ec2fe3b15eac2abfef4eb3335d90feeb498f84126371ccea8c") add_versions("2022.0.3+171", "b34d5e5d0dd779b117666c9fc89d008431f6239ad60fc08a52a6b874fdf24517") add_resources("2022.0.3+171", "headers", "https://anaconda.org/intel/mkl-include/2022.0.3/download/win-32/mkl-include-2022.0.3-intel_171.tar.bz2", "f696cd98b2f33b2c21bf7b70f57e894a763dad1831c721a348614cfeb17a4541") + add_versions("2023.2.0+49496", "4795b6a00b1b7ae5c608de67ba2c79ad152223d0eaf4aba46db848bbae268718") + add_resources("2023.2.0+49496", "headers", "https://anaconda.org/intel/mkl-include/2023.2.0/download/win-32/mkl-include-2023.2.0-intel_49496.tar.bz2", "0ed907ecc2eaae0ed8c280814392b5b80cc19df78838d9688273a12bd72c7bf8") + add_versions("2024.1.0+692", "7a8622f23a27fa487f08653645b6dc3f46b10f5b60ea2b90377812571730d0d9") + add_resources("2024.1.0+692", "headers","https://anaconda.org/intel/mkl-include/2024.1.0/download/win-32/mkl-include-2024.1.0-intel_692.tar.bz2","8994e1c5b5599934e83eb964a136be98dc5a6355f3f5b35cab44cdc0e8b970dd") end elseif is_plat("macosx") and is_arch("x86_64") then add_urls("https://anaconda.org/intel/mkl-static/$(version).tar.bz2", {version = function (version) @@ -38,6 +46,8 @@ package("mkl") add_resources("2021.3.0+517", "headers", "https://anaconda.org/intel/mkl-include/2021.3.0/download/osx-64/mkl-include-2021.3.0-intel_517.tar.bz2", "db9896e667b31908b398d515108433d8df95e6429ebfb9d493a463f25886019c") add_versions("2022.1.0+208", "06e5dcd7b8f11f9736d4e4d7d5a9972333ee8822cf2263ecccf4cb0e3cc95530") add_resources("2022.1.0+208", "headers", "https://anaconda.org/intel/mkl-include/2022.1.0/download/osx-64/mkl-include-2022.1.0-intel_208.tar.bz2", "569ea516148726b2698f17982aba2d9ec1bfb321f0180be938eddbc696addbc5") + add_versions("2023.2.0+49499", "2e2f6bd275e439f82f081e28e774dec663718b199a696da635934536a51faa73") + add_resources("2023.2.0+49499", "headers", "https://anaconda.org/intel/mkl-include/2023.2.0/download/osx-64/mkl-include-2023.2.0-intel_49499.tar.bz2", "c3940a33498df821821c28dc292f7d7a739b11892856fd9fbbc3de5cf0990b00") elseif is_plat("linux") then if is_arch("x86_64") then add_urls("https://anaconda.org/intel/mkl-static/$(version).tar.bz2", {version = function (version) @@ -50,7 +60,11 @@ package("mkl") add_resources("2021.3.0+520", "headers", "https://anaconda.org/intel/mkl-include/2021.3.0/download/linux-64/mkl-include-2021.3.0-intel_520.tar.bz2", "b0df7fb4c2071fdec87b567913715a2e47dca05e8c3ac4e5bcf072d7804085af") add_versions("2022.1.0+223", "9dfb2940447cc8cf7ca3e647e2b62be714e89cbca162998cbf4e05deb69b6bd2") add_resources("2022.1.0+223", "headers", "https://anaconda.org/intel/mkl-include/2022.1.0/download/linux-64/mkl-include-2022.1.0-intel_223.tar.bz2", "704e658a9b25a200f8035f3d0a8f2e094736496a2169f87609f1cfed2e2eb0a9") - elseif is_arch("x86") then + add_versions("2023.2.0+49495", "5c91829865f36f7f5845f5b38e509bb05bee1a38ccfd2caa0eabc0c28aaa4082") + add_resources("2023.2.0+49495", "headers", "https://anaconda.org/intel/mkl-include/2023.2.0/download/linux-64/mkl-include-2023.2.0-intel_49495.tar.bz2", "0dfb6ca3c17d99641f20877579c78155cf95aa0b22363bcc91b1d57df4646318") + add_versions("2024.1.0+691", "be8833b094253d51abe49de418f7db2260f4c8f32514969a4a2eabaadc5d55c2") + add_resources("2024.1.0+691", "headers", "https://anaconda.org/intel/mkl-include/2024.1.0/download/linux-64/mkl-include-2024.1.0-intel_691.tar.bz2", "e36b2e74f5c28ff91565abe47a09dc246c9cf725e0d05b5fb08813b4073ea68b") + elseif is_arch("i386") then add_urls("https://anaconda.org/intel/mkl-static/$(version).tar.bz2", {version = function (version) local mv = version:split("%+") return format("%s/download/linux-32/mkl-static-%s-intel_%s", mv[1], mv[1], mv[2]) @@ -61,6 +75,10 @@ package("mkl") add_resources("2021.3.0+520", "headers", "https://anaconda.org/intel/mkl-include/2021.3.0/download/linux-32/mkl-include-2021.3.0-intel_520.tar.bz2", "dce1f2a08499f34ed4883b807546754c1547a9cc2424b7b75b9233641cf044c1") add_versions("2022.0.2+136", "157c09248cb5e5cbcb28ef8db53d529ab2f049e9269b2a2bc90601c0c420080e") add_resources("2022.0.2+136", "headers", "https://anaconda.org/intel/mkl-include/2022.0.2/download/linux-32/mkl-include-2022.0.2-intel_136.tar.bz2", "16882aeddbd33a2dc9210e61c59db6ad0d7d9efdd40ad1544b369b0830683371") + add_versions("2023.2.0+49495", "9cdcb26ebbbe1510611f01f75780c0e69522d5df73395370a73c81413beaa56a") + add_resources("2023.2.0+49495", "headers", "https://anaconda.org/intel/mkl-include/2023.2.0/download/linux-32/mkl-include-2023.2.0-intel_49495.tar.bz2", "b4433c6839bb7f48951b2dcf409dec7306aee3649c539ee0513d8bfb1a1ea283") + add_versions("2024.1.0+691", "8bd52f73844edc59fe925fa9edef66a7158e502df7c06ddc532d1b370df4fb7d") + add_resources("2024.1.0+691", "headers", "https://anaconda.org/intel/mkl-include/2024.1.0/download/linux-32/mkl-include-2024.1.0-intel_691.tar.bz2", "88529f8bea2498e88b2cf8dc7aa3735f46f348cf5047006dfc6455f8e2bbdd30") end end @@ -72,7 +90,8 @@ package("mkl") if is_plat("linux") then add_syslinks("pthread", "dl") end - on_load("windows", "macosx", "linux", function (package) + + on_load(function (package) -- Refer to [oneAPI Math Kernel Library Link Line Advisor](https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html) -- to get the link option for MKL library. local suffix = (package:config("interface") == 32 and "lp64" or "ilp64") @@ -118,7 +137,7 @@ package("mkl") end end) - on_install("windows", "macosx", "linux", function (package) + on_install("windows|!arm64", "macosx|!arm64", "linux|x86_64", "linux|i386", function (package) local headerdir = package:resourcedir("headers") if package:is_plat("windows") then os.trymv(path.join("Library", "lib"), package:installdir()) diff --git a/packages/m/mlpack/xmake.lua b/packages/m/mlpack/xmake.lua new file mode 100644 index 000000000..a693f9cdb --- /dev/null +++ b/packages/m/mlpack/xmake.lua @@ -0,0 +1,48 @@ +package("mlpack") + set_kind("library", {headeronly = true}) + set_homepage("https://www.mlpack.org/") + set_description("mlpack: a fast, header-only C++ machine learning library") + set_license("BSD-3-Clause") + + add_urls("https://github.com/mlpack/mlpack/archive/refs/tags/$(version).tar.gz", + "https://github.com/mlpack/mlpack.git") + + add_versions("4.3.0", "08cd54f711fde66fc3b6c9db89dc26776f9abf1a6256c77cfa3556e2a56f1a3d") + + if is_plat("linux") then + add_syslinks("m", "pthread") + end + + add_configs("openmp", {description = "Enable OpenMP", default = true, type = "boolean"}) + + add_deps("armadillo", "cereal", "ensmallen", "stb") + + on_load(function(package) + if package:config("openmp") then + if is_plat("windows") then + package:add("deps", "openmp", {configs = { feature = "llvm" }}) + else + package:add("deps", "openmp") + end + end + end) + + on_install("windows|x64", "windows|x86", "macosx", "linux", function (package) + os.cp("src/mlpack/methods", package:installdir("include/mlpack")) + os.cp("src/mlpack/core", package:installdir("include/mlpack")) + os.cp("src/mlpack/*.hpp", package:installdir("include/mlpack")) + os.cp("src/mlpack.hpp", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + using namespace mlpack; + void test() { + arma::mat data; + arma::rowvec responses; + LinearRegression lr(data, responses); + arma::vec parameters = lr.Parameters(); + } + ]]}, {configs = {languages = "cxx17"}})) + end) diff --git a/packages/m/mman_win32/xmake.lua b/packages/m/mman_win32/xmake.lua new file mode 100644 index 000000000..d561c0aa0 --- /dev/null +++ b/packages/m/mman_win32/xmake.lua @@ -0,0 +1,19 @@ +package("mman_win32") + set_homepage("https://github.com/alitrack/mman-win32") + set_description("mman library for Windows. mirror of https://code.google.com/p/mman-win32/") + + add_urls("https://github.com/alitrack/mman-win32.git") + add_versions("2019.10.11", "2d1c576e62b99e85d99407e1a88794c6e44c3310") + + add_deps("cmake") + + on_install("windows", "mingw", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("mmap", {includes = "sys/mman.h"})) + end) diff --git a/packages/m/moltenvk/xmake.lua b/packages/m/moltenvk/xmake.lua index 2500d302d..b884ab759 100644 --- a/packages/m/moltenvk/xmake.lua +++ b/packages/m/moltenvk/xmake.lua @@ -1,14 +1,33 @@ package("moltenvk") - set_homepage("https://github.com/KhronosGroup/MoltenVK") set_description("MoltenVK is a Vulkan Portability implementation.") set_license("Apache-2.0") - add_urls("https://github.com/KhronosGroup/MoltenVK/archive/v$(version).tar.gz") - add_versions("1.1.0", "0538fa1c23ddae495c7f82ccd0db90790a90b7017a258ca7575fbae8021f3058") - add_versions("1.1.4", "f9bba6d3bf3648e7685c247cb6d126d62508af614bc549cedd5859a7da64967e") - add_versions("1.1.5", "2cdcb8dbf2acdcd8cbe70b109dadc05a901038c84970afbe4863e5e23f33deae") - add_versions("1.2.0", "6e7af2dad0530b2b404480dbe437ca4670c6615cc2ec6cf6a20ed04d9d75e0bd") + add_urls("https://github.com/KhronosGroup/MoltenVK/archive/refs/tags/$(version).tar.gz", + "https://github.com/KhronosGroup/MoltenVK.git") + + add_versions("v1.2.9", "f415a09385030c6510a936155ce211f617c31506db5fbc563e804345f1ecf56e") + add_versions("v1.2.8", "85beaf8abfcc54d9da0ff0257ae311abd9e7aa96e53da37e1c37d6bc04ac83cd") + add_versions("v1.2.7", "3166edcfdca886b4be1a24a3c140f11f9a9e8e49878ea999e3580dfbf9fe4bec") + add_versions("v1.2.0", "6e7af2dad0530b2b404480dbe437ca4670c6615cc2ec6cf6a20ed04d9d75e0bd") + add_versions("v1.1.5", "2cdcb8dbf2acdcd8cbe70b109dadc05a901038c84970afbe4863e5e23f33deae") + add_versions("v1.1.4", "f9bba6d3bf3648e7685c247cb6d126d62508af614bc549cedd5859a7da64967e") + add_versions("v1.1.0", "0538fa1c23ddae495c7f82ccd0db90790a90b7017a258ca7575fbae8021f3058") + + if is_plat("macosx") then + add_extsources("brew::molten-vk") + end + + add_links("MoltenVKShaderConverter", "MoltenVK") + + if is_plat("macosx", "iphoneos") then + add_frameworks("Metal", "Foundation", "QuartzCore", "CoreGraphics", "IOSurface") + if is_plat("macosx") then + add_frameworks("IOKit", "AppKit") + else + add_frameworks("UIKit") + end + end on_fetch("macosx", function (package, opt) if opt.system then @@ -20,19 +39,25 @@ package("moltenvk") end end) - on_install("macosx", function (package) - local configs = {"--macos"} + on_install("macosx", "iphoneos", function (package) + local plat = package:is_plat("iphoneos") and "iOS" or "macOS" + local configs = {"--" .. plat:lower()} if package:debug() then table.insert(configs, "--debug") end os.vrunv("./fetchDependencies", configs) local conf = package:debug() and "Debug" or "Release" - os.vrun("xcodebuild build -quiet -project MoltenVKPackaging.xcodeproj -scheme \"MoltenVK Package (macOS only)\" -configuration \"" .. conf) + os.vrun("xcodebuild build -quiet -project MoltenVKPackaging.xcodeproj -scheme \"MoltenVK Package (" ..plat .. " only)\" -configuration \"" .. conf) os.mv("Package/" .. conf .. "/MoltenVK/include", package:installdir()) - os.mv("Package/" .. conf .. "/MoltenVK/dylib/macOS/*", package:installdir("lib")) - os.mv("Package/" .. conf .. "/MoltenVK/MoltenVK.xcframework/macos-*/*.a", package:installdir("lib")) + os.mv("Package/" .. conf .. "/MoltenVK/dylib/" ..plat .. "/*", package:installdir("lib")) + os.mv("Package/" .. conf .. "/MoltenVK/MoltenVK.xcframework/" .. plat:lower() .. "-*/*.a", package:installdir("lib")) + if package:config("shared") then + os.mv("Package/" .. conf .. "/MoltenVK/dynamic/dylib/" .. plat .. "/*.dylib", package:installdir("lib")) + else + os.mv("Package/" .. conf .. "/MoltenVK/static/MoltenVK.xcframework/" .. plat:lower() .. "-*/*.a", package:installdir("lib")) + end os.mv("Package/" .. conf .. "/MoltenVKShaderConverter/Tools/*", package:installdir("bin")) - os.mv("Package/" .. conf .. "/MoltenVKShaderConverter/MoltenVKShaderConverter.xcframework/macos-*/*.a", package:installdir("lib")) + os.mv("Package/" .. conf .. "/MoltenVKShaderConverter/MoltenVKShaderConverter.xcframework/" .. plat:lower() .. "-*/*.a", package:installdir("lib")) os.mv("Package/" .. conf .. "/MoltenVKShaderConverter/include/*.h", package:installdir("include")) package:addenv("PATH", "bin") end) diff --git a/packages/m/mongoose/xmake.lua b/packages/m/mongoose/xmake.lua index b16f95c10..b108c73bb 100644 --- a/packages/m/mongoose/xmake.lua +++ b/packages/m/mongoose/xmake.lua @@ -8,6 +8,8 @@ package("mongoose") add_urls("https://github.com/cesanta/mongoose/archive/refs/tags/$(version).tar.gz", "https://github.com/cesanta/mongoose.git") + add_versions("7.14", "7c4aecf92f7f27f1cbb2cbda3c185c385f2b7af84f6bd7c0ce31b84742b15691") + add_versions("7.13", "5c9dc8d1d1762ef483b6d2fbf5234e421ca944b722225bb533d2d0507b118a0f") add_versions("7.11", "cb2a746505827d3225abdb1c8d508950aa3d769abb0cda59065b1628608efb2e") add_configs("ssl", {description = "Enable SSL", default = nil, type = "string", values = {"openssl", "mbedtls"}}) diff --git a/packages/m/morton-nd/xmake.lua b/packages/m/morton-nd/xmake.lua new file mode 100644 index 000000000..b1c9c10da --- /dev/null +++ b/packages/m/morton-nd/xmake.lua @@ -0,0 +1,26 @@ +package("morton-nd") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/morton-nd/morton-nd") + set_description("A header-only compile-time Morton encoding / decoding library for N dimensions.") + set_license("MIT") + + add_urls("https://github.com/morton-nd/morton-nd/archive/refs/tags/$(version).tar.gz", + "https://github.com/morton-nd/morton-nd.git") + + add_versions("v4.0.0", "29337c7f7afb6361dd483ca4fe2111aad9d590f3b9d3fe519856a5bdf450e059") + + add_deps("cmake") + + on_install(function (package) + io.replace("include/morton-nd/mortonND_BMI2.h", "#include ", "#include \n#include ", {plain = true}) + io.replace("include/morton-nd/mortonND_LUT.h", "#include ", "#include \n#include ", {plain = true}) + import("package.tools.cmake").install(package, {"-DBUILD_TESTING=OFF"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + constexpr auto MortonND_4D_Enc = mortonnd::MortonNDLutEncoder<4, 16, 8>(); + } + ]]}, {configs = {languages = "c++14"}, includes = "morton-nd/mortonND_LUT.h"})) + end) diff --git a/packages/m/mosquitto/xmake.lua b/packages/m/mosquitto/xmake.lua index 7eecfc7d5..27c7cc26a 100644 --- a/packages/m/mosquitto/xmake.lua +++ b/packages/m/mosquitto/xmake.lua @@ -7,6 +7,7 @@ package("mosquitto") "https://github.com/eclipse/mosquitto.git") add_versions("v2.0.15", "547f98acd2e4668c8f3b86ef61e71c755366d180565b6e7537813876467d04d9") + add_versions("v2.0.18", "25499231664bc5338f9f05eb1815f4d5878f0c6c97e03afb3463a7b139a7e775") if is_plat("windows") then add_patches("v2.0.15", path.join(os.scriptdir(), "patches", "cmake.patch"),"b241fb965f3d00bad1fddf060fe9b99cba83df32c373a4eaee2289e05abd26b6") @@ -59,9 +60,15 @@ package("mosquitto") package:add("deps", value) end end + if package:version():eq("2.0.18") and package:is_plat("windows") and package:is_arch("arm.*") then + raise("mosquitto 2.0.18 not support windows arm") + end end) on_install("windows", "linux", "macosx", function (package) + if package:version():eq("2.0.18") and package:is_plat("windows") then + io.replace("CMakeLists.txt", 'add_definitions("-D_CRT_SECURE_NO_WARNINGS")', 'add_definitions("-D_CRT_SECURE_NO_WARNINGS")\nadd_definitions("-DWIN32")', {plain = true}) + end local configs ={"-DDOCUMENTATION=OFF", "-DWITH_CLIENTS=OFF", "-DWITH_APPS=OFF", "-DWITH_PLUGINS=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DWITH_STATIC_LIBRARIES=" .. (package:config("shared") and "OFF" or "ON")) @@ -88,4 +95,4 @@ package("mosquitto") mosquitto_lib_init(); } ]]})) - end) \ No newline at end of file + end) diff --git a/packages/m/mpc/xmake.lua b/packages/m/mpc/xmake.lua index 4c3578685..7882553e1 100644 --- a/packages/m/mpc/xmake.lua +++ b/packages/m/mpc/xmake.lua @@ -4,12 +4,14 @@ package("mpc") set_description("GNU MPC is a C library for the arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result.") set_license("LGPL-3.0") - add_urls("https://ftp.gnu.org/gnu/mpc/mpc-$(version).tar.gz") + add_urls("https://ftpmirror.gnu.org/gnu/mpc/mpc-$(version).tar.gz", + "https://ftp.gnu.org/gnu/mpc/mpc-$(version).tar.gz") add_versions("1.2.1", "17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459") + add_versions("1.3.1", "ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8") add_deps("gmp", "mpfr") on_install("macosx", "linux", function (package) - local configs = {"--disable-dependency-tracking", "--with-pic"} + local configs = {"--disable-dependency-tracking"} table.insert(configs, "--with-gmp=" .. package:dep("gmp"):installdir()) table.insert(configs, "--with-mpfr=" .. package:dep("mpfr"):installdir()) if package:config("shared") then diff --git a/packages/m/msdfgen/xmake.lua b/packages/m/msdfgen/xmake.lua index 02b66a0ec..e21619a36 100644 --- a/packages/m/msdfgen/xmake.lua +++ b/packages/m/msdfgen/xmake.lua @@ -5,23 +5,21 @@ package("msdfgen") add_urls("https://github.com/Chlumsky/msdfgen/archive/refs/tags/$(version).tar.gz", "https://github.com/Chlumsky/msdfgen.git") + + add_versions("v1.11", "fad74e33274f591e72511bc0546189e7aec439f2a512ef1b2fde243554d457cb") add_versions("v1.10", "2754d1687bfb80968d9c682e0c4c04c8fcf72df1421d076baf44ea0d87aa3662") - add_patches("v1.10", "https://github.com/Chlumsky/msdfgen/commit/839e0e86cb846e3ea0c0a3d5da97321fe81f91e4.patch", "f69096f65edb588dcb50529ac750fd5fb24b716e053cb9c33749e52219fd7df4") + + add_patches("v1.10", "https://github.com/Chlumsky/msdfgen/commit/839e0e86cb846e3ea0c0a3d5da97321fe81f91e4.patch", "8b8ab53b66b4b8c27d78c2e617795e9818c5ba72a7a7cb7a75bc416fe4bfb26c") add_configs("extensions", {description = "Build extensions library (requires freetype, libpng and tinyxml2)", default = false, type = "boolean"}) add_configs("openmpp", {description = "Build with OpenMP support for multi-threaded code", default = false, type = "boolean"}) add_configs("skia", {description = "Build with the Skia library", default = false, type = "boolean"}) add_configs("standalone", {description = "Build standalone executable", default = false, type = "boolean"}) - -- shared compilation is not supported on mingw/msys2 because of the "export all symbol" CMake feature - if is_plat("mingw") and is_subhost("msys") then - add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) - end - add_deps("cmake") on_load(function (package) - if package:is_plat("windows", "mingw") and package:config("shared") then + if package:is_plat("windows") and package:config("shared") then package:add("defines", "MSDFGEN_PUBLIC=__declspec(dllimport)") else package:add("defines", "MSDFGEN_PUBLIC=") @@ -49,12 +47,10 @@ package("msdfgen") table.insert(configs, "-DMSDFGEN_USE_SKIA=" .. (package:config("skia") and "ON" or "OFF")) if package:is_plat("windows") then - io.replace("CMakeLists.txt", [[set(MSDFGEN_MSVC_RUNTIME "MultiThreaded$<$:Debug>")]], [[set(MSDFGEN_MSVC_RUNTIME, "${CMAKE_MSVC_RUNTIME_LIBRARY}")]], {plain = true}) + io.replace("CMakeLists.txt", [[set(MSDFGEN_MSVC_RUNTIME "MultiThreaded$<$:Debug>DLL")]], "", {plain = true}) + io.replace("CMakeLists.txt", [[set(MSDFGEN_MSVC_RUNTIME "MultiThreaded$<$:Debug>")]], "", {plain = true}) elseif package:is_plat("mingw") then - if package:config("shared") then - table.insert(configs, "-DCMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS=ON") - end - io.replace("CMakeLists.txt", [[if(BUILD_SHARED_LIBS AND WIN32)]], [[if(BUILD_SHARED_LIBS AND (WIN32 OR MINGW))]], {plain = true}) + io.replace("CMakeLists.txt", [[target_compile_definitions(msdfgen-core PRIVATE "MSDFGEN_PUBLIC=__declspec(dllexport)")]], "target_compile_definitions(msdfgen-core PRIVATE MSDFGEN_PUBLIC=)", {plain = true}) end import("package.tools.cmake").install(package, configs) @@ -90,7 +86,7 @@ package("msdfgen") } ]]}, {configs = { languages = "c++11" }, includes = {"msdfgen/msdfgen.h", "msdfgen/msdfgen-ext.h"}})) - if package:config("standalone") then + if package:config("standalone") and (not package:is_cross()) then os.vrun("msdfgen -help") end end diff --git a/packages/m/msgpack-c/xmake.lua b/packages/m/msgpack-c/xmake.lua index 5d9ac2caf..7e8c72406 100644 --- a/packages/m/msgpack-c/xmake.lua +++ b/packages/m/msgpack-c/xmake.lua @@ -5,6 +5,7 @@ package("msgpack-c") set_license("BSL-1.0") add_urls("https://github.com/msgpack/msgpack-c/releases/download/c-$(version)/msgpack-c-$(version).tar.gz") + add_versions("6.0.1", "a349cd9af28add2334c7009e331335af4a5b97d8558b2e9804d05f3b33d97925") add_versions("4.0.0", "420fe35e7572f2a168d17e660ef981a589c9cbe77faa25eb34a520e1fcc032c8") add_deps("cmake") diff --git a/packages/m/msgpack-cxx/xmake.lua b/packages/m/msgpack-cxx/xmake.lua index efe8ba492..bbd7cd727 100644 --- a/packages/m/msgpack-cxx/xmake.lua +++ b/packages/m/msgpack-cxx/xmake.lua @@ -5,6 +5,8 @@ package("msgpack-cxx") set_license("BSL-1.0") add_urls("https://github.com/msgpack/msgpack-c/releases/download/cpp-$(version)/msgpack-cxx-$(version).tar.gz") + add_versions("6.1.1", "5fd555742e37bbd58d166199e669f01f743c7b3c6177191dd7b31fb0c37fa191") + add_versions("6.1.0", "23ede7e93c8efee343ad8c6514c28f3708207e5106af3b3e4969b3a9ed7039e7") add_versions("4.1.1", "8115c5edcf20bc1408c798a6bdaec16c1e52b1c34859d4982a0fb03300438f0b") add_configs("std", {description = "Choose C++ standard version.", default = "cxx17", type = "string", values = {"cxx98", "cxx11", "cxx14", "cxx17", "cxx20"}}) diff --git a/packages/m/msys2-base/xmake.lua b/packages/m/msys2-base/xmake.lua new file mode 100644 index 000000000..fdef2d7cf --- /dev/null +++ b/packages/m/msys2-base/xmake.lua @@ -0,0 +1,44 @@ +package("msys2-base") + set_kind("toolchain") + set_homepage("https://www.msys2.org/") + set_description("Software Distribution and Building Platform for Windows") + + add_urls("https://github.com/msys2/msys2-installer/releases/download/$(version).tar.xz", {version = function (version) + return version:gsub("%.", "-") .. "/msys2-base-x86_64-" .. version:gsub("%.", "") + end}) + add_versions("2024.01.13", "04456a44a956d3c0b5f9b6c754918bf3a8c3d87c858be7a0c94c9171ab13c58c") + + set_policy("package.precompiled", false) + + on_install("@windows|x64", function (package) + -- reduce time required to install packages by disabling pacman's disk space checking + io.gsub("etc/pacman.conf", "^CheckSpace", "#CheckSpace") + + -- disable key refresh + io.replace("etc/post-install/07-pacman-key.post", "--refresh-keys", "--version", {plain = true}) + + -- install files + os.cp("*", package:installdir()) + package:addenv("PATH", "usr/bin") + + -- starting MSYS2 for the first time + local bash = path.join(package:installdir("usr/bin"), "bash.exe") + os.vrunv(bash, {"-leo", "pipefail", "-c", "uname -a"}) + + -- updating packages + try { function () os.vrunv(bash, {"-leo", "pipefail", "-c", "pacman --noconfirm -Syuu --overwrite *"}) end} + + -- killing remaining tasks + os.vrunv("taskkill", {"/F", "/FI", "MODULES eq msys-2.0.dll"}) + + -- final system upgrade + os.vrunv(bash, {"-leo", "pipefail", "-c", "pacman --noconfirm -Syuu --overwrite *"}) + end) + + on_test(function (package) + os.vrun("sh --version") + os.vrun("perl --version") + os.vrun("ls -l") + os.vrun("grep --version") + os.vrun("uname -a") + end) diff --git a/packages/m/msys2/xmake.lua b/packages/m/msys2/xmake.lua new file mode 100644 index 000000000..3f7d4d2da --- /dev/null +++ b/packages/m/msys2/xmake.lua @@ -0,0 +1,75 @@ +package("msys2") + set_kind("toolchain") + set_homepage("https://www.msys2.org/") + set_description("Software Distribution and Building Platform for Windows") + + add_deps("msys2-base") + + add_configs("msystem", {description = "Set msys2 system.", type = "string", values = {"MSYS", "MINGW32", "MINGW64", "UCRT64", "CLANG32", "CLANG64", "CLANGARM64"}}) + add_configs("pathtype", {description = "Set path type.", default = "inherit", type = "string", values = {"inherit"}}) + + add_configs("make", {description = "Install gnumake.", default = false, type = "boolean"}) + add_configs("gcc", {description = "Install gcc.", default = false, type = "boolean"}) + add_configs("diffutils", {description = "Install diffutils.", default = false, type = "boolean"}) + add_configs("base_devel", {description = "Install base-devel.", default = false, type = "boolean"}) + add_configs("mingw64_gcc", {description = "Install mingw64 gcc.", default = false, type = "boolean"}) + add_configs("mingw64_toolchain", {description = "Install mingw64 toolchain.", default = false, type = "boolean"}) + add_configs("mingw32_gcc", {description = "Install mingw32 gcc.", default = false, type = "boolean"}) + add_configs("mingw32_toolchain", {description = "Install mingw32 toolchain.", default = false, type = "boolean"}) + + set_policy("package.precompiled", false) + + on_install("@windows|x64", function (package) + local msys2_base = package:dep("msys2-base") + local bash = path.join(msys2_base:installdir("usr/bin"), "bash.exe") + local msystem = package:config("msystem") + if msystem then + package:addenv("MSYSTEM", msystem) + if msystem == "MINGW64" then + package:addenv("PATH", msys2_base:installdir("mingw64/bin")) + elseif msystem == "MINGW32" then + package:addenv("PATH", msys2_base:installdir("mingw32/bin")) + end + end + local pathtype = package:config("pathtype") + if pathtype then + package:addenv("MSYS2_PATH_TYPE", pathtype) + end + package:addenv("CHERE_INVOKING", "1") + + -- install additional packages + local packages = { + "gcc", "make", "diffutils", + base_devel = "base-devel", + mingw32_gcc = "mingw-w64-i686-gcc", + mingw32_toolchain = "mingw-w64-i686-toolchain", + mingw64_gcc = "mingw-w64-x86_64-gcc", + mingw64_toolchain = "mingw-w64-x86_64-toolchain"} + for k, v in pairs(packages) do + local configname = type(k) == "number" and v or k + local packagename = v + if package:config(configname) then + os.vrunv(bash, {"-leo", "pipefail", "-c", "pacman --noconfirm -S --needed --overwrite * " .. packagename}) + end + end + end) + + on_test(function (package) + os.vrun("sh --version") + os.vrun("perl --version") + os.vrun("ls -l") + os.vrun("grep --version") + os.vrun("uname -a") + local msystem = package:config("msystem") + if msystem then + if msystem == "MINGW64" then + if package:config("mingw64_gcc") or package:config("mingw64_toolchain") then + os.vrun("x86_64-w64-mingw32-gcc --version") + end + elseif msystem == "MINGW32" then + if package:config("mingw32_gcc") or package:config("mingw32_toolchain") then + os.vrun("i686-w64-mingw32-gcc --version") + end + end + end + end) diff --git a/packages/m/muduo/xmake.lua b/packages/m/muduo/xmake.lua new file mode 100644 index 000000000..fab3350e3 --- /dev/null +++ b/packages/m/muduo/xmake.lua @@ -0,0 +1,29 @@ +package("muduo") + set_homepage("https://github.com/chenshuo/muduo") + set_description("Event-driven network library for multi-threaded Linux server in C++11") + + add_urls("https://github.com/chenshuo/muduo.git") + add_versions("2022.11.01", "f29ca0ebc2f3b0ab61c1be08482a5524334c3d6f") + + add_deps("cmake") + add_deps("boost") + + on_install("linux", function (package) + package:add("links", "muduo_net", "muduo_base") + io.replace("CMakeLists.txt", "-Wold-style-cast", "", {plain = true}) + local configs ={"-DMUDUO_BUILD_EXAMPLES=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + if package:is_arch("i386") then + table.insert(configs, "-DCMAKE_BUILD_BITS=32") + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "muduo/net/EventLoop.h" + void test() { + muduo::net::EventLoop loop; + } + ]]})) + end) diff --git a/packages/m/mujs/xmake.lua b/packages/m/mujs/xmake.lua new file mode 100644 index 000000000..c759a28a9 --- /dev/null +++ b/packages/m/mujs/xmake.lua @@ -0,0 +1,33 @@ +package("mujs") + set_homepage("http://mujs.com/") + set_description("An embeddable Javascript interpreter in C.") + + add_urls("https://mujs.com/downloads/mujs-$(version).tar.gz") + add_urls("https://github.com/ccxvii/mujs/archive/refs/tags/$(version).tar.gz", + "https://github.com/ccxvii/mujs.git") + + add_versions("1.3.4", "c015475880f6a382e706169c94371a7dd6cc22078832f6e0865af8289c2ef42b") + + if is_plat("linux", "bsd") then + add_syslinks("m") + end + + add_includedirs("include", "include/mujs") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("mujs") + set_kind("$(kind)") + add_files("js*.c", "utf*.c", "regexp.c") + add_headerfiles("*.h", {prefixdir = "mujs"}) + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("js_newstate", {includes = "mujs/mujs.h"})) + end) diff --git a/packages/m/mvfst/xmake.lua b/packages/m/mvfst/xmake.lua new file mode 100644 index 000000000..d872a68f6 --- /dev/null +++ b/packages/m/mvfst/xmake.lua @@ -0,0 +1,27 @@ +package("mvfst") + set_homepage("https://github.com/facebook/mvfst") + set_description("An implementation of the QUIC transport protocol.") + set_license("MIT") + + add_urls("https://github.com/facebook/mvfst/archive/refs/tags/v$(version).00.tar.gz", + "https://github.com/facebook/mvfst.git") + add_versions("2024.03.04", "06922633d6ee2f01e77f66812c87517ebbf06bbb56552a61ba1f7a3b757dc15a") + add_versions("2024.03.11", "4ba28efd162f83c7a330fab811f128490a787ef91d6366c6df9fc1f70e9b423d") + add_versions("2024.03.18", "7f42ad4b8da5646a24ba5e96101da914f77fe581abd686568d1dcd6492df0240") + add_versions("2024.03.25", "293046511fb9395bdb09860f4c4202bcb848fed4cdd419d436506a07eeac66cd") + add_versions("2024.04.01", "e39c4d7dd87520fcce6a3d5d398b5d03bd3e680186b9b0db23f02b502c6bcb1e") + + add_deps("cmake", "folly", "fizz") + + on_install("linux", function (package) + local configs = {"-DBUILD_TESTS=OFF", + "-DBUILD_EXAMPLES=OFF", + "-DCMAKE_CXX_STANDARD=17"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cxxincludes("quic/QuicConstants.h", {configs = {languages = "c++17"}})) + end) diff --git a/packages/m/mxml/xmake.lua b/packages/m/mxml/xmake.lua index b24ad526f..c6eb0c788 100644 --- a/packages/m/mxml/xmake.lua +++ b/packages/m/mxml/xmake.lua @@ -4,7 +4,11 @@ package("mxml") set_description("Mini-XML is a tiny XML library that you can use to read and write XML and XML-like data files in your application without requiring large non-standard libraries.") set_license("Apache-2.0") - add_urls("https://github.com/michaelrsweet/mxml/releases/download/v3.3/mxml-3.3.zip") + add_urls("https://github.com/michaelrsweet/mxml/releases/download/v$(version)/mxml-$(version).zip") + add_urls("https://github.com/michaelrsweet/mxml.git") + add_versions("4.0.3", "a6201ad26ff3d14a84bc0027646ee89aeee858f0c9e69c166bb9705ba1eb55e7") + add_versions("4.0.2", "7506c88640ae4bcf9b2f50edc6eb32c47b367df9da3dfa24654456b3b45be3a9") + add_versions("3.3.1", "ca6b05725184866b9e5874329e98be22cbbdc1e733789e08b55b088be207484a") add_versions("3.3", "fca59b0d7fae2b9165c223cdce68e45dbf41e21e5e53190d8b214218b8353380") if is_plat("macosx", "linux") then @@ -14,8 +18,7 @@ package("mxml") io.gsub("config.h.in", "#undef (.-)\n", "${define %1}\n") io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") - includes("check_cfuncs.lua") - includes("check_ctypes.lua") + includes("@builtin/check") if is_plat("macosx", "linux") then set_configvar("HAVE_PTHREAD_H", 1) end diff --git a/packages/m/mysql/xmake.lua b/packages/m/mysql/xmake.lua index 6fec333df..0f6a6cbd3 100644 --- a/packages/m/mysql/xmake.lua +++ b/packages/m/mysql/xmake.lua @@ -31,8 +31,8 @@ package("mysql") on_load("windows", "mingw", "linux", "macosx", function(package) if package:version():ge("8.0.0") then package:add("deps", "boost") - package:add("deps", "openssl 1.1.1-t") - package:add("deps", "zlib v1.2.13") + package:add("deps", "openssl") + package:add("deps", "zlib") package:add("deps", "zstd") package:add("deps", "lz4") else @@ -49,7 +49,7 @@ package("mysql") os.cp("lib/libmysql.dll", package:installdir("bin")) end) - on_install("windows", "linux", "macosx", function (package) + on_install("windows|x86", "windows|x64", "linux", "macosx", function (package) if package:version():ge("8.0.0") then io.gsub("CMakeLists.txt", "ADD_SUBDIRECTORY%(storage/ndb%)", "") local configs = {"-DCOMPILATION_COMMENT=XMake", diff --git a/packages/n/nameof/xmake.lua b/packages/n/nameof/xmake.lua index 243a373d6..16d009ddb 100644 --- a/packages/n/nameof/xmake.lua +++ b/packages/n/nameof/xmake.lua @@ -8,6 +8,7 @@ package("nameof") add_urls("https://github.com/Neargye/nameof/archive/refs/tags/v$(version).tar.gz", "https://github.com/Neargye/nameof.git") + add_versions("0.10.4", "b67ed2155a32760067eee0d33c727b9badfd8c12393ebbe3b7ab219b4faa0149") add_versions("0.10.3", "f31dd02841adfbb98949454005a308174645957d2b8d4dc06a7c15e1039e46e6") on_install(function (package) diff --git a/packages/n/nanoflann/xmake.lua b/packages/n/nanoflann/xmake.lua index 6a704ba85..740ad4d35 100644 --- a/packages/n/nanoflann/xmake.lua +++ b/packages/n/nanoflann/xmake.lua @@ -7,6 +7,7 @@ package("nanoflann") add_urls("https://github.com/jlblancoc/nanoflann/archive/refs/tags/$(version).tar.gz", "https://github.com/jlblancoc/nanoflann.git") + add_versions("v1.5.5", "fd28045eabaf0e7f12236092f80905a1750e0e6b580bb40eadd64dc4f75d641d") add_versions("v1.3.2", "e100b5fc8d72e9426a80312d852a62c05ddefd23f17cbb22ccd8b458b11d0bea") add_versions("v1.4.2", "97fce650eb644a359a767af526cab9ba31842e53790a7279887e1ae2fffe7319") add_versions("v1.5.0", "89aecfef1a956ccba7e40f24561846d064f309bc547cc184af7f4426e42f8e65") diff --git a/packages/n/nanovg/xmake.lua b/packages/n/nanovg/xmake.lua index d7fb390d5..29c952d99 100644 --- a/packages/n/nanovg/xmake.lua +++ b/packages/n/nanovg/xmake.lua @@ -5,17 +5,17 @@ package("nanovg") set_license("zlib") add_urls("https://github.com/memononen/nanovg.git") - + add_versions("2023.8.27", "f93799c078fa11ed61c078c65a53914c8782c00b") add_versions("2021.11.2", "e75cf72b4ad0b850a66e589d14d7b3156065dd2a") - on_install("windows", "macosx", "linux", function (package) + on_install("windows", "macosx", "linux", "mingw", function (package) io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") target("nanovg") set_kind("$(kind)") add_files("src/*.c") add_headerfiles("src/(*.h)") - if is_plat("windows") and is_kind("shared") then + if is_plat("windows", "mingw") and is_kind("shared") then add_rules("utils.symbols.export_all") end ]]) diff --git a/packages/n/nasm/xmake.lua b/packages/n/nasm/xmake.lua index 52c052c4a..f02a0b1e6 100644 --- a/packages/n/nasm/xmake.lua +++ b/packages/n/nasm/xmake.lua @@ -7,16 +7,22 @@ package("nasm") if is_host("windows") then if os.arch() == "x64" then + add_urls("https://www.nasm.us/pub/nasm/releasebuilds/$(version)/win64/nasm-$(version)-win64.zip") add_urls("https://github.com/xmake-mirror/nasm/releases/download/nasm-$(version)/nasm-$(version)-win64.zip") add_versions("2.15.05", "f5c93c146f52b4f1664fa3ce6579f961a910e869ab0dae431bd871bdd2584ef2") + add_versions("2.16.01", "029eed31faf0d2c5f95783294432cbea6c15bf633430f254bb3c1f195c67ca3a") else + add_urls("https://www.nasm.us/pub/nasm/releasebuilds/$(version)/win32/nasm-$(version)-win32.zip") add_urls("https://github.com/xmake-mirror/nasm/releases/download/nasm-$(version)/nasm-$(version)-win32.zip") add_versions("2.15.05", "258c7d1076e435511cf2fdf94e2281eadbdb9e3003fd57f356f446e2bce3119e") + add_versions("2.16.01", "e289fa70c88594b092c916344bb8bfcd6896b604bfab284ab57b1372997c820c") end else + add_urls("https://www.nasm.us/pub/nasm/releasebuilds/$(version)/nasm-$(version).tar.xz") add_urls("https://github.com/xmake-mirror/nasm/releases/download/nasm-$(version)/nasm-$(version).tar.xz") add_versions("2.13.03", "812ecfb0dcbc5bd409aaa8f61c7de94c5b8752a7b00c632883d15b2ed6452573") add_versions("2.15.05", "3caf6729c1073bf96629b57cee31eeb54f4f8129b01902c73428836550b30a3f") + add_versions("2.16.01", "c77745f4802375efeee2ec5c0ad6b7f037ea9c87c92b149a9637ff099f162558") end on_install("@windows", "@mingw", "@msys", function (package) diff --git a/packages/n/nativefiledialog-extended/xmake.lua b/packages/n/nativefiledialog-extended/xmake.lua index 65e8682b0..ed855446a 100644 --- a/packages/n/nativefiledialog-extended/xmake.lua +++ b/packages/n/nativefiledialog-extended/xmake.lua @@ -5,6 +5,7 @@ package("nativefiledialog-extended") add_urls("https://github.com/btzy/nativefiledialog-extended/archive/refs/tags/$(version).zip", "https://github.com/btzy/nativefiledialog-extended.git") + add_versions("v1.1.1", "7003001d36235db2c2062cd992e61c59c77a5ad3ca5e5ed8175e56502513886e") add_versions("v1.1.0", "5827d17b6bddc8881406013f419c534e8459b38f34c2f266d9c1da8a7a7464bc") add_versions("v1.0.2", "1d2c4c50fb1e3ad8caa5ad9c3df54725c3a49a6d4a21d773a20b93ebeb5780f1") diff --git a/packages/n/ndk/xmake.lua b/packages/n/ndk/xmake.lua index 434c79474..9185944d1 100644 --- a/packages/n/ndk/xmake.lua +++ b/packages/n/ndk/xmake.lua @@ -1,28 +1,32 @@ package("ndk") - set_kind("toolchain") set_homepage("https://developer.android.com/ndk") set_description("Android NDK toolchain.") - local versions = {["21"] = "r21e", ["22"] = "r22"} if is_host("windows") then - set_urls("https://dl.google.com/android/repository/android-ndk-$(version)-windows-x86_64.zip", {version = function (version) + local versions = {["21"] = "r21e-windows-x86_64", ["22"] = "r22-windows-x86_64", ["26"] = "r26b-windows"} + set_urls("https://dl.google.com/android/repository/android-ndk-$(version).zip", {version = function (version) return versions[tostring(version:major())] end}) add_versions("21.0", "f71307c5c572e2c163d602b3704b8bc024bec0c43ba2800de36bd10f3a21492b") add_versions("22.0", "5a0eafa83c8bba3c76e8427aa3d83d169215f62963a277b1914a3651aa47f751") + add_versions("26.0", "a478d43d4a45d0d345cda6be50d79642b92fb175868d9dc0dfc86181d80f691e") elseif is_host("linux") then - set_urls("https://dl.google.com/android/repository/android-ndk-$(version)-linux-x86_64.zip", {version = function (version) + local versions = {["21"] = "r21e-linux-x86_64", ["22"] = "r22-linux-x86_64", ["26"] = "r26b-linux"} + set_urls("https://dl.google.com/android/repository/android-ndk-$(version).zip", {version = function (version) return versions[tostring(version:major())] end}) add_versions("21.0", "ad7ce5467e18d40050dc51b8e7affc3e635c85bd8c59be62de32352328ed467e") add_versions("22.0", "d37fc69cd81e5660234a686e20adef39bc0244086e4d66525a40af771c020718") + add_versions("26.0", "ad73c0370f0b0a87d1671ed2fd5a9ac9acfd1eb5c43a7fbfbd330f85d19dd632") elseif is_host("macosx") then - set_urls("https://dl.google.com/android/repository/android-ndk-$(version)-darwin-x86_64.zip", {version = function (version) + local versions = {["21"] = "r21e-darwin-x86_64", ["22"] = "r22-darwin-x86_64", ["26"] = "r26b-darwin"} + set_urls("https://dl.google.com/android/repository/android-ndk-$(version).zip", {version = function (version) return versions[tostring(version:major())] end}) add_versions("21.0", "437278103a3db12632c05b1be5c41bbb8522791a67e415cc54411a65366f499d") add_versions("22.0", "14fce4dea7fb3facbc0e3d20270007bffec3ba383aec02e8b0e0dad8d8782892") + add_versions("26.0", "4b0ea6148a9a2337e62a0c0c7ac59ff1edc38d69b81d9c58251897d23f7fa321") end on_fetch(function (package, opt) diff --git a/packages/s/scope_guard/xmake.lua b/packages/n/neargye-scope_guard/xmake.lua similarity index 95% rename from packages/s/scope_guard/xmake.lua rename to packages/n/neargye-scope_guard/xmake.lua index 36fd4d458..cf7f559d3 100644 --- a/packages/s/scope_guard/xmake.lua +++ b/packages/n/neargye-scope_guard/xmake.lua @@ -1,4 +1,4 @@ -package("scope_guard") +package("neargye-scope_guard") set_kind("library", {headeronly = true}) set_homepage("https://github.com/Neargye/scope_guard") set_description("Scope Guard & Defer C++") diff --git a/packages/n/nettle/xmake.lua b/packages/n/nettle/xmake.lua index 093450144..25d5c26bf 100644 --- a/packages/n/nettle/xmake.lua +++ b/packages/n/nettle/xmake.lua @@ -4,8 +4,15 @@ package("nettle") set_description("Nettle is a cryptographic library that is designed to fit easily in more or less any context.") set_license("LGPL-3.0") - add_urls("https://ftp.gnu.org/gnu/nettle/nettle-$(version).tar.gz") + add_urls("https://ftpmirror.gnu.org/gnu/nettle/nettle-$(version).tar.gz", + "https://ftp.gnu.org/gnu/nettle/nettle-$(version).tar.gz") add_versions("3.6", "d24c0d0f2abffbc8f4f34dcf114b0f131ec3774895f3555922fe2f40f3d5e3f1") + add_versions("3.9.1", "ccfeff981b0ca71bbd6fbcb054f407c60ffb644389a5be80d6716d5b550c6ce3") + + add_deps("m4") + if is_plat("linux") then + add_extsources("apt::nettle-dev") + end on_install("macosx", "linux", function (package) local configs = {"--disable-openssl", "--disable-documentation", "--enable-pic"} diff --git a/packages/n/nghttp2/xmake.lua b/packages/n/nghttp2/xmake.lua index 002a6b3f8..386d7dc65 100644 --- a/packages/n/nghttp2/xmake.lua +++ b/packages/n/nghttp2/xmake.lua @@ -1,13 +1,23 @@ package("nghttp2") - set_homepage("http://nghttp2.org/") set_description("nghttp2 is an implementation of HTTP/2 and its header compression algorithm HPACK in C.") set_license("MIT") add_urls("https://github.com/nghttp2/nghttp2/releases/download/v$(version)/nghttp2-$(version).tar.gz") + add_versions("1.62.1", "d0b0b9d00500ee4aa3bfcac00145d3b1ef372fd301c35bff96cf019c739db1b4") + add_versions("1.62.0", "482e41a46381d10adbdfdd44c1942ed5fd1a419e0ab6f4a5ff5b61468fe6f00d") + add_versions("1.61.0", "aa7594c846e56a22fbf3d6e260e472268808d3b49d5e0ed339f589e9cc9d484c") + add_versions("1.60.0", "ca2333c13d1af451af68de3bd13462de7e9a0868f0273dea3da5bc53ad70b379") + add_versions("1.59.0", "90fd27685120404544e96a60ed40398a3457102840c38e7215dc6dec8684470f") + add_versions("1.58.0", "9ebdfbfbca164ef72bdf5fd2a94a4e6dfb54ec39d2ef249aeb750a91ae361dfb") add_versions("1.46.0", "4b6d11c85f2638531d1327fe1ed28c1e386144e8841176c04153ed32a4878208") + if is_plat("linux") then + add_syslinks("pthread") + end + add_deps("cmake") + on_load("windows", function (package) package:add("defines", "ssize_t=int") if not package:config("shared") then @@ -17,12 +27,20 @@ package("nghttp2") on_install("windows", "macosx", "linux", function (package) io.replace("CMakeLists.txt", "add_subdirectory(doc)", "", {plain = true}) - local configs = {"-DENABLE_LIB_ONLY=ON"} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + io.replace("CMakeLists.txt", "add_subdirectory(tests)", "", {plain = true}) + io.replace("CMakeLists.txt", "add_subdirectory(examples)", "", {plain = true}) + + local configs = {"-DENABLE_LIB_ONLY=ON", "-DENABLE_APP=OFF", "-DENABLE_DOC=OFF", "-DBUILD_TESTING=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DENABLE_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DENABLE_STATIC_LIB=" .. (package:config("shared") and "OFF" or "ON")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) if package:is_plat("windows") then table.insert(configs, "-DENABLE_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + if package:config("shared") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end end import("package.tools.cmake").install(package, configs) end) diff --git a/packages/n/nghttp3/patches/vendor.patch b/packages/n/nghttp3/patches/vendor.patch new file mode 100644 index 000000000..4ee136840 --- /dev/null +++ b/packages/n/nghttp3/patches/vendor.patch @@ -0,0 +1,26 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 2f7e31c..3e3d7fb 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -60,12 +60,12 @@ set(nghttp3_SOURCES + nghttp3_opl.c + nghttp3_objalloc.c + nghttp3_unreachable.c +- sfparse/sfparse.c + ) + + # Public shared library + if(ENABLE_SHARED_LIB) + add_library(nghttp3 SHARED ${nghttp3_SOURCES}) ++ target_link_libraries(nghttp3 sfparse) + set_target_properties(nghttp3 PROPERTIES + COMPILE_FLAGS "${WARNCFLAGS}" + VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} +@@ -81,6 +81,7 @@ endif() + if(ENABLE_STATIC_LIB) + # Public static library + add_library(nghttp3_static STATIC ${nghttp3_SOURCES}) ++ target_link_libraries(nghttp3_static sfparse) + set_target_properties(nghttp3_static PROPERTIES + COMPILE_FLAGS "${WARNCFLAGS}" + VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} diff --git a/packages/n/nghttp3/xmake.lua b/packages/n/nghttp3/xmake.lua index f7d58075c..17c68523f 100644 --- a/packages/n/nghttp3/xmake.lua +++ b/packages/n/nghttp3/xmake.lua @@ -3,10 +3,14 @@ package("nghttp3") set_description("HTTP/3 library written in C") set_license("MIT") - add_urls("https://github.com/ngtcp2/nghttp3.git") - add_versions("2022.02.08", "98402fb68fffc0ab1b211a5f07c1425dfd42d217") + add_urls("https://github.com/ngtcp2/nghttp3/archive/refs/tags/$(version).tar.gz", + "https://github.com/ngtcp2/nghttp3.git") - add_deps("cmake") + add_versions("v1.3.0", "a83c6a4f589ae777a5f967652969d99b3399a85971340b8de9bed79119a11f88") + + add_patches("v1.3.0", "patches/vendor.patch", "51ab785328270b8df854283a8c20403c09813b0586eb84702a9c20241ff14980") + + add_deps("cmake", "sfparse") on_load("windows", function (package) if not package:config("shared") then @@ -15,14 +19,14 @@ package("nghttp3") end) on_install("windows", "macosx", "linux", function (package) - local configs = {"-DENABLE_LIB_ONLY=ON"} + local configs = {"-DENABLE_LIB_ONLY=ON", "-DBUILD_TESTING=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DENABLE_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DENABLE_STATIC_LIB=" .. (package:config("shared") and "OFF" or "ON")) if package:is_plat("windows") then table.insert(configs, "-DENABLE_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) end - import("package.tools.cmake").install(package, configs) + import("package.tools.cmake").install(package, configs, {packagedeps = "sfparse"}) end) on_test(function (package) diff --git a/packages/n/ngtcp2/xmake.lua b/packages/n/ngtcp2/xmake.lua index 2001037bb..a60d11ac6 100644 --- a/packages/n/ngtcp2/xmake.lua +++ b/packages/n/ngtcp2/xmake.lua @@ -4,12 +4,17 @@ package("ngtcp2") set_license("MIT") add_urls("https://github.com/ngtcp2/ngtcp2/releases/download/v$(version)/ngtcp2-$(version).tar.gz") + add_versions("1.5.0", "fbd9c40848c235736377ba3fd0b8677a05d39e7c39406769588a6595dda5636f") + add_versions("1.4.0", "163e26e6e7531b8bbcd7ec53d2c6b4ff3cb7d3654fde37b091e3174d37a8acd7") + add_versions("1.3.0", "7d4244ac15a83a0f908ff810ba90a3fcd8352fb0020a6f9176e26507c9d3c3e4") + add_versions("1.2.0", "303ae7d23721b3631ae52dbe3e05cced9ac59aa49d3eb21f8cdb1548a0522be8") + add_versions("1.1.0", "051d23ce0128453687c240e6fa249e65134350b2b1cb1b5eadf49817849ec74d") add_versions("0.1.0", "9a5266544d083c332746450344ebd6c8d6bf3c75c492a54c79abc56f2c47415d") add_deps("cmake") on_install("macosx", "linux", "windows", "android", "mingw", function (package) - local configs = {} + local configs = {"-DENABLE_OPENSSL=OFF", "-DBUILD_TESTING=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DENABLE_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DENABLE_STATIC_LIB=" .. (package:config("shared") and "OFF" or "ON")) diff --git a/packages/n/nifti/xmake.lua b/packages/n/nifti/xmake.lua new file mode 100644 index 000000000..540de83cc --- /dev/null +++ b/packages/n/nifti/xmake.lua @@ -0,0 +1,52 @@ +package("nifti") + set_homepage("https://github.com/NIFTI-Imaging/nifti_clib") + set_description("C libraries for NIFTI support") + + add_urls("https://github.com/NIFTI-Imaging/nifti_clib.git") + add_versions("2024.01.25", "f24bec503f1a5d501c0413c1bb8aa3d6e04aebda") + + add_configs("nifti2", {description = "Build nifti2.", default = false, type = "boolean"}) + add_configs("cifti", {description = "Build cifti.", default = false, type = "boolean"}) + add_configs("fslio", {description = "Build fslio.", default = false, type = "boolean"}) + add_configs("tools", {description = "Build tools.", default = false, type = "boolean"}) + + add_deps("cmake") + add_deps("zlib") + + on_load(function (package) + if package:config("cifti") then + package:add("deps", "expat") + end + end) + + on_install("!cross and !wasm", function (package) + local configs = { + "-DBUILD_TESTING=OFF", + "-DNIFTI_INSTALL_NO_DOCS=ON", + "-DNIFTI_INSTALL_LIBRARY_DIR=" .. path.unix(package:installdir("lib")) + } + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:config("shared") and package:is_plat("windows") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + io.replace("nifticdf/nifticdf.h", "extern char const * const inam[];", "__declspec(dllimport) char const * const inam[];", {plain = true}) + end + + table.insert(configs, "-DUSE_NIFTI2_CODE=" .. (package:config("nifti2") and "ON" or "OFF")) + table.insert(configs, "-DUSE_CIFTI_CODE=" .. (package:config("cifti") and "ON" or "OFF")) + table.insert(configs, "-DUSE_FSL_CODE=" .. (package:config("fslio") and "ON" or "OFF")) + table.insert(configs, "-DNIFTI_BUILD_APPLICATIONS=" .. (package:config("tools") and "ON" or "OFF")) + + local cxflags + if package:config("cifti") then + cxflags = "-DXML_STATIC" + end + import("package.tools.cmake").install(package, configs, {cxflags = cxflags, packagedeps = "zlib"}) + if package:config("tools") then + package:addenv("PATH", "bin") + end + end) + + on_test(function (package) + assert(package:has_cfuncs("nifti_stat2cdf", {includes = "nifti/nifticdf.h"})) + end) diff --git a/packages/n/nim/xmake.lua b/packages/n/nim/xmake.lua new file mode 100644 index 000000000..1cbcd9c42 --- /dev/null +++ b/packages/n/nim/xmake.lua @@ -0,0 +1,40 @@ +package("nim") + set_kind("toolchain") + set_homepage("https://nim-lang.org/") + set_description("Nim is a statically typed compiled systems programming language") + + local precompiled = false + if is_host("windows") then + if os.arch() == "x86" then + add_urls("https://nim-lang.org/download/nim-$(version)_x32.zip") + add_versions("2.0.2", "d076d35fdab29baf83c66f1135a1fd607eb61d4c14037706f7be3ba58fb83d87") + precompiled = true + elseif os.arch() == "x64" then + add_urls("https://nim-lang.org/download/nim-$(version)_x64.zip") + add_versions("2.0.2", "948dbf8e3fdd1b5242e3d662fd25c50e9b2586e097be8a85c22d7db2bde70bad") + precompiled = true + end + end + if not precompiled then + add_urls("https://github.com/nim-lang/Nim/archive/refs/tags/v$(version).tar.gz") + add_versions("2.0.2", "2ca2f559d05e29f130cb4f319ebb93a98e7c0e2187716b17b2cb4e747f5ff798") + end + + on_install("@windows", "@msys", function (package) + os.cp("*", package:installdir()) + end) + + on_install("@windows|arm64", function (package) + os.vrunv("./build_all.bat", {}, {shell = true}) + os.cp("bin", package:installdir()) + end) + + on_install("@macosx", "@linux", function (package) + os.vrunv("./build_all.sh", {}, {shell = true}) + os.cp("bin", package:installdir()) + end) + + on_test(function (package) + os.vrun("nim --version") + os.vrun("nimble --version") + end) diff --git a/packages/n/nlohmann_json/xmake.lua b/packages/n/nlohmann_json/xmake.lua index 0f263d1f2..6a8d91e97 100644 --- a/packages/n/nlohmann_json/xmake.lua +++ b/packages/n/nlohmann_json/xmake.lua @@ -6,6 +6,7 @@ package("nlohmann_json") add_urls("https://github.com/nlohmann/json/archive/$(version).tar.gz", "https://github.com/nlohmann/json.git") + add_versions("v3.11.3", "0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406") add_versions("v3.11.2", "d69f9deb6a75e2580465c6c4c5111b89c4dc2fa94e3a85fcd2ffcd9a143d9273") add_versions("v3.10.5", "5daca6ca216495edf89d167f808d1d03c4a4d929cef7da5e10f135ae1540c7e4") add_versions("v3.10.0", "eb8b07806efa5f95b349766ccc7a8ec2348f3b2ee9975ad879259a371aea8084") @@ -47,5 +48,5 @@ package("nlohmann_json") json data; data["name"] = "world"; } - ]]}, {configs = {languages = "c++11"}, includes = {"nlohmann/json.hpp"}})) + ]]}, {configs = {languages = "c++14"}, includes = {"nlohmann/json.hpp"}})) end) diff --git a/packages/n/nmd/xmake.lua b/packages/n/nmd/xmake.lua new file mode 100644 index 000000000..4ffdc9bf4 --- /dev/null +++ b/packages/n/nmd/xmake.lua @@ -0,0 +1,24 @@ +package("nmd") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/Nomade040/nmd") + set_description("An x86 assembler and disassembler along with a C89 header file (nmd_assembly.h), and a C89 2D graphics library (nmd_graphics.h).") + set_license("Unlicense") + + add_urls("https://github.com/Nomade040/nmd.git") + add_versions("2021.03.28", "33ac3b62c7d1eb28ae6b71d4dd78aa133ef96488") + + add_includedirs("include", "include/nmd") + + on_install(function (package) + os.cp("nmd_assembly.h", package:installdir("include/nmd")) + os.cp("nmd_graphics.h", package:installdir("include/nmd")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + nmd_x86_instruction instruction; + } + ]]}, {configs = {languages = "c89"}})) + end) diff --git a/packages/n/nng/xmake.lua b/packages/n/nng/xmake.lua index ab5422369..64648c600 100644 --- a/packages/n/nng/xmake.lua +++ b/packages/n/nng/xmake.lua @@ -4,6 +4,7 @@ package("nng") set_description("NNG, like its predecessors nanomsg (and to some extent ZeroMQ), is a lightweight, broker-less library, offering a simple API to solve common recurring messaging problems.") add_urls("https://github.com/nanomsg/nng/archive/v$(version).zip") + add_versions("1.7.3", "72b39c63ba6467f6ee70c218c291240ff5b189569c3b84e8e0647f5d4d3888ea") add_versions("1.5.2", "652ff3a2dbaeae194942205c369e9259e2b5cb5985d679d744cbfb95d1c807a3") add_versions("1.4.0", "43674bb15d0f3810cf3602d2662cc91b6576b914492710244125e32b29f546b8") add_versions("1.3.2", "2616110016c89ed3cbd458022ba41f4f545ab17f807546d2fdd0789b55d64471") diff --git a/packages/n/noisy/xmake.lua b/packages/n/noisy/xmake.lua new file mode 100644 index 000000000..b04b7f347 --- /dev/null +++ b/packages/n/noisy/xmake.lua @@ -0,0 +1,22 @@ +package("noisy") + set_kind("library", {headeronly = true}) + set_homepage("https://vzalzal.com/posts/noisy-the-class-you-wrote-a-hundred-times/") + set_description("A C++ type to trace calls to special member functions.") + set_license("MIT") + + add_urls("https://github.com/VincentZalzal/noisy.git") + add_versions("2024.04.22", "99810230e226a294fb2bf97e4a1bc8d734368a48") + + on_install(function (package) + os.cp("noisy.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + vz::Noisy make_noisy() { return {}; } + void test() { + vz::Noisy x = vz::Noisy(make_noisy()); + } + ]]}, {configs = {languages = "cxx11"}})) + end) diff --git a/packages/n/nowide_standalone/xmake.lua b/packages/n/nowide_standalone/xmake.lua index 3873bb789..33a80d32a 100644 --- a/packages/n/nowide_standalone/xmake.lua +++ b/packages/n/nowide_standalone/xmake.lua @@ -5,6 +5,7 @@ package("nowide_standalone") add_urls("https://github.com/boostorg/nowide/releases/download/v$(version)/nowide_standalone_v$(version).tar.gz", "https://github.com/boostorg/nowide/tree/standalone") + add_versions("11.3.0", "153ac93173c8de9c08e7701e471fa750f84c27e51fe329570c5aa06016591f8c") add_versions("11.2.0", "1869d176a8af389e4f7416f42bdd15d6a5db3c6e4ae77269ecb071a232304e1d") add_deps("cmake") diff --git a/packages/n/nsis/xmake.lua b/packages/n/nsis/xmake.lua new file mode 100644 index 000000000..a593a9eef --- /dev/null +++ b/packages/n/nsis/xmake.lua @@ -0,0 +1,34 @@ +package("nsis") + set_kind("binary") + set_homepage("https://nsis.sourceforge.io/") + set_description("NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers.") + + add_urls("https://sourceforge.net/projects/nsis/files/NSIS%203/$(version)/nsis-$(version).zip") + add_urls("https://github.com/xmake-mirror/nsis/releases/download/$(version).zip", {version = function (version) + return "v" .. (version:gsub("%.", "")) .. "/nsis-" .. version + end}) + + add_versions("3.09", "f5dc52eef1f3884230520199bac6f36b82d643d86b003ce51bd24b05c6ba7c91") + + add_resources("3.09", "uac", "https://github.com/xmake-mirror/nsis/releases/download/v309/UAC.zip", "20e3192af5598568887c16d88de59a52c2ce4a26e42c5fb8bee8105dcbbd1760") + add_resources("3.09", "strlen_8192", "https://github.com/xmake-mirror/nsis/releases/download/v309/nsis-3.09-strlen_8192.zip", "9e3b8e77c97a46747201f95f89eba26714dd9c6dc06830c3934b3f5fbdb1beca") + + on_fetch(function (package, opt) + if opt.system then + -- we need return false to disable fallback fetch, it will stuck when call `nsis --version` + return package:find_tool("makensis", table.join({check = "/CMDHELP"}, opt)) or false + end + end) + + on_install("@windows|x64", "@windows|x86", function (package) + os.cp("*", package:installdir()) + os.cp(path.join(package:resourcedir("strlen_8192"), "*"), package:installdir()) + os.cp(path.join(package:resourcedir("uac"), "UAC.nsh"), path.join(package:installdir(), "Include")) + os.cp(path.join(package:resourcedir("uac"), "Plugins", "x86-ansi", "*.dll"), path.join(package:installdir(), "Plugins", "x86-ansi")) + os.cp(path.join(package:resourcedir("uac"), "Plugins", "x86-unicode", "*.dll"), path.join(package:installdir(), "Plugins", "x86-unicode")) + package:addenv("PATH", "Plugins/x86-unicode") + end) + + on_test(function (package) + os.runv("makensis", {"/CMDHELP"}) + end) diff --git a/packages/n/nuklear/xmake.lua b/packages/n/nuklear/xmake.lua index a332a8588..c750db7e4 100644 --- a/packages/n/nuklear/xmake.lua +++ b/packages/n/nuklear/xmake.lua @@ -8,6 +8,7 @@ package("nuklear") add_urls("https://github.com/Immediate-Mode-UI/Nuklear/archive/refs/tags/$(version).tar.gz", "https://github.com/Immediate-Mode-UI/Nuklear.git") + add_versions("4.12.0", "4cb80084d20d20561548a2941b6d1eb7c30e6f0b9405e0d5df84bae3c1d7bbaf") add_versions("4.10.5", "6c80cbd0612447421fa02ad92f4207da2cd019a14d94885dfccac1aadc57926a") on_load("mingw", function (package) diff --git a/packages/n/numactl/xmake.lua b/packages/n/numactl/xmake.lua index 7562291e2..92883c472 100644 --- a/packages/n/numactl/xmake.lua +++ b/packages/n/numactl/xmake.lua @@ -5,6 +5,7 @@ package("numactl") set_license("LGPL-2.1") add_urls("https://github.com/numactl/numactl/releases/download/v$(version)/numactl-$(version).tar.gz") + add_versions("2.0.18", "b4fc0956317680579992d7815bc43d0538960dc73aa1dd8ca7e3806e30bc1274") add_versions("2.0.14", "826bd148c1b6231e1284e42a4db510207747484b112aee25ed6b1078756bcff6") on_install("linux", function (package) diff --git a/packages/o/oatpp-websocket/xmake.lua b/packages/o/oatpp-websocket/xmake.lua new file mode 100644 index 000000000..8b202eda9 --- /dev/null +++ b/packages/o/oatpp-websocket/xmake.lua @@ -0,0 +1,48 @@ +package("oatpp-websocket") + set_homepage("https://oatpp.io/") + set_description("It provides WebSocket functionality for oatpp applications.") + set_license("Apache-2.0") + + add_urls("https://github.com/oatpp/oatpp-websocket/archive/$(version).tar.gz", + "https://github.com/oatpp/oatpp-websocket.git") + add_versions("1.0.0", "2e4ed596d1e8c15f0b9c6d5ba994b8fde623a6dfd256a17c8f99d86427115981") + add_versions("1.2.5", "b930034aaed40715ccc9b9df094292ea6e2a44f31bf830d1e15db5255ece9184") + add_versions("1.3.0", "8215765238c595e296c9ea961670064ff9c44e3e0f9accda59d81b10cc29873b") + + if is_plat("windows") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("cmake") + add_deps("oatpp") + + on_load(function (package) + package:add("includedirs", path.join("include", "oatpp-" .. package:version_str(), "oatpp-websocket")) + package:add("linkdirs", path.join("lib", "oatpp-" .. package:version_str())) + end) + + on_install("linux", "macosx", "windows|x64", function (package) + local configs = {"-DOATPP_BUILD_TESTS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DOATPP_MSVC_LINK_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "oatpp-websocket/SHA1.hpp" + void test() { + oatpp::String message = "oat++ web framework"; + oatpp::String messageEncoded = "43e1bad62b6b4a1e88c9de60435335b5b7518f4a"; + { + oatpp::websocket::SHA1 sha; + sha.update(message); + oatpp::String encoded = sha.finalBinary(); + OATPP_ASSERT(encoded == messageEncoded); + } + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/o/objfw/xmake.lua b/packages/o/objfw/xmake.lua index 69d7bbd37..1e1ce34de 100644 --- a/packages/o/objfw/xmake.lua +++ b/packages/o/objfw/xmake.lua @@ -2,8 +2,24 @@ package("objfw") set_homepage("https://objfw.nil.im") set_description("Portable framework for the Objective-C language.") - add_urls("https://github.com/ObjFW/ObjFW.git") - add_versions("2023.03.18", "86cec7d17dd323407f30fc5947e0e92cc307e869") + add_urls("https://objfw.nil.im/downloads/objfw-$(version).tar.gz") + add_versions("1.0.0", "a6aa3bf590c6a7ae21cf13dbaa94a72926e67af5c7d5aef4a2b172543d1f26a3") + add_versions("1.0.1", "953fd8a7819fdbfa3b3092b06ac7f43a74bac736c120a40f2e3724f218d215f1") + add_versions("1.0.2", "b680be08bfade376d17958f3ceadaf223ac5d08df71a4bd787a42640a86db7cb") + add_versions("1.0.3", "1c81d7d03578b2d9084fc5d8722d4eaa4bdc2f3f09ce41231e7ceab8212fae17") + add_versions("1.0.4", "c62c61fc3f1b2d5c1d78369c602a6e82b32ade5c8ec0e9c410646d1554bf1e26") + add_versions("1.0.5", "798bda0590970fea10d5c8064e98088bb9960b3bc0475d92db443b0df9f205c4") + add_versions("1.0.6", "34eb6ee5be84d86a3de657ab17c9ee79fcfc8b3dc0d21f72917aa92378948d73") + add_versions("1.0.7", "9046f63abf198e7f86f888be6838cdbd367b97c696d96497cfbf4b509c1ad129") + add_versions("1.0.8", "935e08e296d6e409e9f7d972a04cfde82c96064d17576f36ce738d04db571c56") + add_versions("1.0.9", "2706af1dd584099495c68465843c4d49e613fecc57a39b565a7262ec5fae9474") + add_versions("1.0.10", "8963b9d2bc7bb7e1b7b5890eca2ee2e193a6036512ad72cc9244d40da3a19c67") + add_versions("1.0.11", "21a85cd75a508fecf77a61c12932c2b4e33c06c51f8d618743cb162a87b9af14") + add_versions("1.0.12", "d5f9d5dcb95c52f7b243b1b818a34be99cecaaa5afd6de1c5b2502214f5df7f7") + add_versions("1.1.0", "79f6a6fdc90ad6474206c8f649d66415b09a3f07b9c6ddbaf64129291fd12d94") + add_versions("1.1.1", "0492a08f964180b7453c05bd9f0080e70b61171a9b5194a6d1b891370c24cfc0") + add_versions("1.1.2", "5d9f9a70d583298e780ae11fc75a7ae2beeef904b301e1bc4f4ffa8d7ee31d9f") + if is_host("linux", "macosx") then add_deps("autoconf", "automake", "libtool") @@ -14,7 +30,7 @@ package("objfw") add_frameworks("CoreFoundation") end - add_configs("tls", { description = "Enable TLS support.", default = false, values = { true, false, "openssl", "gnutls", "securetransport" } }) + add_configs("tls", { description = "Enable TLS support.", default = (is_plat("macosx") and "securetransport" or "openssl"), values = { true, false, "openssl", "gnutls", "securetransport" } }) add_configs("rpath", { description = "Enable rpath.", default = true, type = "boolean" }) add_configs("runtime", { description = "Use the included runtime, not recommended for macOS!", default = not is_plat("macosx"), type = "boolean" }) add_configs("seluid24", { description = "Use 24 bit instead of 16 bit for selector UIDs.", default = false, type = "boolean" }) @@ -48,8 +64,10 @@ package("objfw") elseif tls then if tls == "openssl" then package:add("deps", "openssl") - else - raise("no package %s for objfw!", tls) + elseif tls == "securetransport" then + package:add("frameworks", "Security") + elseif tls == "gnutls" then + package:add("deps", "gnutls") end end end) @@ -60,14 +78,11 @@ package("objfw") if type(tls) == "boolean" then tls = tls and "yes" or "no" end - table.insert(configs, "--enable-tls=" .. tls) - if package:is_debug() then - table.insert(configs, "--enable-debug") - end + table.insert(configs, "--with-tls=" .. tls) table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) for name, enabled in pairs(package:configs()) do - if not package:extraconf("configs", name, "builtin") then + if not package:extraconf("configs", name, "builtin") and name ~= "arc" then name = name:gsub("_", "-") if enabled then table.insert(configs, "--enable-" .. name) @@ -76,6 +91,30 @@ package("objfw") end end end + + -- SecureTransport must be handled by system so we don't worry about providing CFLAGS and LDFLAGS + local ssl = package:dep("openssl") or package:dep("gnutls") + local is_gnu = ssl and ssl:name() == "gnutls" + if ssl then + import("lib.detect.find_library") + import("lib.detect.find_path") + + local libssl = find_library(is_gnu and "gnutls" or "ssl", { ssl:installdir("lib"), "/usr/lib/", "/usr/lib64/", "/usr/local/lib" }) + if not libssl then + libssl = find_library(is_gnu and "gnutls" or "ssl") + end + + local ssl_incdir = find_path(is_gnu and "gnutls/gnutls.h" or "openssl/ssl.h", { ssl:installdir("include"), "/usr/include/", "/usr/local/include" }) + + if libssl then + print("Using SSL "..ssl:name().." from "..libssl.linkdir..", include dir: "..ssl_incdir) + table.insert(configs, "CPPFLAGS=-I"..ssl_incdir) + table.insert(configs, "LDFLAGS=-L"..libssl.linkdir) + else + print("No SSL library found, using system default") + end + end + import("package.tools.autoconf").install(package, configs) local mflags = {} @@ -88,17 +127,23 @@ package("objfw") table.join2(mflags, mflags_str:split("%s+")) table.join2(mxxflags, mxxflags_str:split("%s+")) table.join2(ldflags, ldflags_str:split("%s+")) + package:add("mflags", mflags) package:add("mxxflags", mxxflags) package:add("ldflags", ldflags) + + if package:config("runtime") then + package:add("links", {"objfw", "objfwrt", (package:config("tls") and "objfwtls" or nil)}) + else + package:add("links", {"objfw", (package:config("tls") and "objfwtls" or nil)}) + end end) on_test(function (package) assert(package:check_msnippets({test = [[ - #include void test() { OFString* string = @"hello"; - printf("%s\n", [string UTF8String]); + [OFStdOut writeLine: string]; } ]]}, {includes = {"ObjFW/ObjFW.h"}})) end) diff --git a/packages/o/ocilib/port/xmake.lua b/packages/o/ocilib/port/xmake.lua new file mode 100644 index 000000000..a57dbb77b --- /dev/null +++ b/packages/o/ocilib/port/xmake.lua @@ -0,0 +1,27 @@ +add_rules("mode.debug", "mode.release", "mode.releasedbg", "mode.minsizerel") + +option("unicode", {showmenu = true, default = true}) + +target("ocilib") + set_kind("$(kind)") + add_files("src/*.c") + add_includedirs("src") + add_includedirs("include", {public = true}) + add_headerfiles("include/(**.h)", "include/(**.hpp)") + + if is_kind("static") then + add_defines("OCI_LIB_LOCAL_COMPILE", {public = true}) + end + + if is_plat("windows") and is_kind("shared") then + add_files("proj/dll/main.rc") + add_defines("OCI_EXPORT") + end + + if has_config("unicode") then + add_defines("OCI_CHARSET_WIDE") + else + add_defines("OCI_CHARSET_ANSI") + end + + add_defines("OCI_IMPORT_RUNTIME") diff --git a/packages/o/ocilib/xmake.lua b/packages/o/ocilib/xmake.lua new file mode 100644 index 000000000..1c950591c --- /dev/null +++ b/packages/o/ocilib/xmake.lua @@ -0,0 +1,35 @@ +package("ocilib") + set_homepage("http://www.ocilib.net") + set_description("OCILIB (C and C++ Drivers for Oracle) - Open source C and C++ library for accessing Oracle databases") + set_license("Apache-2.0") + + add_urls("https://github.com/vrogier/ocilib/archive/refs/tags/$(version).tar.gz", + "https://github.com/vrogier/ocilib.git") + + add_versions("v4.7.6", "43f5093cac645518ad5bc8d6f48f5b77e12372ef84dc87ddb3a54c40e425bd26") + + add_configs("unicode", {description = "Enable Unicode", default = true, type = "boolean"}) + + on_install(function (package) + local configs = { + unicode = package:config("unicode") + } + if not package:config("shared") then + package:add("defines", "OCI_LIB_LOCAL_COMPILE") + end + io.replace("include/ocilibcpp/detail/core/SmartHandle.hpp", + ".Set", + ".template Set", {plain = true}) + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("OCI_Initialize", {includes = "ocilib.h"})) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + ocilib::Environment::Initialize(); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/o/octomap/patches/1.10.0/cmake.patch b/packages/o/octomap/patches/1.10.0/cmake.patch new file mode 100644 index 000000000..e87a48c61 --- /dev/null +++ b/packages/o/octomap/patches/1.10.0/cmake.patch @@ -0,0 +1,131 @@ +diff --git a/dynamicEDT3D/src/CMakeLists.txt b/dynamicEDT3D/src/CMakeLists.txt +index 0b9357c..bbef680 100644 +--- a/dynamicEDT3D/src/CMakeLists.txt ++++ b/dynamicEDT3D/src/CMakeLists.txt +@@ -2,35 +2,29 @@ SET( dynamicEDT3D_SRCS + dynamicEDT3D.cpp + ) + +-add_library(dynamicedt3d SHARED ${dynamicEDT3D_SRCS}) ++add_library(dynamicedt3d ${dynamicEDT3D_SRCS}) + set_target_properties(dynamicedt3d PROPERTIES + VERSION ${DYNAMICEDT3D_VERSION} + SOVERSION ${DYNAMICEDT3D_SOVERSION} + ) + target_link_libraries(dynamicedt3d ${OCTOMAP_LIBRARIES}) + +-add_library(dynamicedt3d-static STATIC ${dynamicEDT3D_SRCS}) +-target_link_libraries(dynamicedt3d-static ${OCTOMAP_LIBRARIES}) +- +-SET_TARGET_PROPERTIES(dynamicedt3d-static PROPERTIES OUTPUT_NAME "dynamicedt3d") +- + if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D") + file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D") + endif() + +-export(TARGETS dynamicedt3d dynamicedt3d-static ++export(TARGETS dynamicedt3d + FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DTargets.cmake") + + # directly depend on the octomap library target when building the + # complete distribution, so it it recompiled as needed + if (CMAKE_PROJECT_NAME STREQUAL "octomap-distribution") +- ADD_DEPENDENCIES(dynamicedt3d-static octomap-static) + ADD_DEPENDENCIES(dynamicedt3d octomap) + endif() + +-ADD_SUBDIRECTORY(examples) + +-install(TARGETS dynamicedt3d dynamicedt3d-static ++ ++install(TARGETS dynamicedt3d + EXPORT dynamicEDT3DTargets + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ${INSTALL_TARGETS_DEFAULT_ARGS} +diff --git a/octomap/CMakeLists.txt b/octomap/CMakeLists.txt +index 87a78e9..edae7f1 100644 +--- a/octomap/CMakeLists.txt ++++ b/octomap/CMakeLists.txt +@@ -161,7 +161,7 @@ install_pkg_config_file(octomap + VERSION ${OCTOMAP_VERSION}) + + # Documentation +-FIND_PACKAGE(Doxygen) ++ + IF(DOXYGEN_FOUND) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/octomap.dox.in ${CMAKE_CURRENT_BINARY_DIR}/octomap.dox @ONLY) + ADD_CUSTOM_TARGET(docs ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/octomap.dox +diff --git a/octomap/src/CMakeLists.txt b/octomap/src/CMakeLists.txt +index 45b384f..837fee8 100644 +--- a/octomap/src/CMakeLists.txt ++++ b/octomap/src/CMakeLists.txt +@@ -11,14 +11,11 @@ SET (octomap_SRCS + ) + + # dynamic and static libs, see CMake FAQ: +-ADD_LIBRARY( octomap SHARED ${octomap_SRCS}) ++ADD_LIBRARY( octomap ${octomap_SRCS}) + set_target_properties( octomap PROPERTIES + VERSION ${OCTOMAP_VERSION} + SOVERSION ${OCTOMAP_SOVERSION} + ) +-ADD_LIBRARY( octomap-static STATIC ${octomap_SRCS}) +-SET_TARGET_PROPERTIES(octomap-static PROPERTIES OUTPUT_NAME "octomap") +-add_dependencies(octomap-static octomath-static) + + TARGET_LINK_LIBRARIES(octomap octomath) + +@@ -26,10 +23,10 @@ if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + endif() + +-export(TARGETS octomap octomap-static ++export(TARGETS octomap + APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") + +-ADD_SUBDIRECTORY( testing ) ++ + + ADD_EXECUTABLE(graph2tree graph2tree.cpp) + TARGET_LINK_LIBRARIES(graph2tree octomap) +@@ -67,7 +64,7 @@ TARGET_LINK_LIBRARIES(intersection_example octomap) + ADD_EXECUTABLE(octree2pointcloud octree2pointcloud.cpp) + TARGET_LINK_LIBRARIES(octree2pointcloud octomap) + +-install(TARGETS octomap octomap-static ++install(TARGETS octomap + EXPORT octomap-targets + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ${INSTALL_TARGETS_DEFAULT_ARGS} +diff --git a/octomap/src/math/CMakeLists.txt b/octomap/src/math/CMakeLists.txt +index 3b47ec4..9a26c46 100644 +--- a/octomap/src/math/CMakeLists.txt ++++ b/octomap/src/math/CMakeLists.txt +@@ -5,24 +5,21 @@ SET (octomath_SRCS + ) + + +-ADD_LIBRARY( octomath SHARED ${octomath_SRCS}) ++ADD_LIBRARY( octomath ${octomath_SRCS}) + + SET_TARGET_PROPERTIES( octomath PROPERTIES + VERSION ${OCTOMAP_VERSION} + SOVERSION ${OCTOMAP_SOVERSION} + ) + +-ADD_LIBRARY( octomath-static STATIC ${octomath_SRCS}) +-SET_TARGET_PROPERTIES(octomath-static PROPERTIES OUTPUT_NAME "octomath") +- + if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") + endif() + +-export(TARGETS octomath octomath-static ++export(TARGETS octomath + APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") + +-install(TARGETS octomath octomath-static ++install(TARGETS octomath + EXPORT octomap-targets + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ${INSTALL_TARGETS_DEFAULT_ARGS} diff --git a/packages/o/octomap/xmake.lua b/packages/o/octomap/xmake.lua index ac2a5b315..720f535b2 100644 --- a/packages/o/octomap/xmake.lua +++ b/packages/o/octomap/xmake.lua @@ -1,27 +1,44 @@ package("octomap") - set_homepage("https://octomap.github.io/") set_description("An Efficient Probabilistic 3D Mapping Framework Based on Octrees") set_license("BSD-3-Clause") add_urls("https://github.com/OctoMap/octomap/archive/refs/tags/$(version).tar.gz", "https://github.com/OctoMap/octomap.git") + + add_versions("v1.10.0", "8da2576ec6a0993e8900db7f91083be8682d8397a7be0752c85d1b7dd1b8e992") add_versions("v1.9.7", "3e9ac020686ceb4e17e161bffc5a0dafd9cccab33adeb9adee59a61c418ea1c1") add_versions("v1.9.8", "417af6da4e855e9a83b93458aa98b01a2c88f880088baad2b59d323ce162586e") + add_patches("1.10.0", path.join(os.scriptdir(), "patches", "1.10.0", "cmake.patch"), "5ad89543331054698ee9ca409e4b6745c7f5a386adb957398686a2dc14092477") add_patches("1.9.x", path.join(os.scriptdir(), "patches", "1.9.7", "build.patch"), "396b7b28c754f876c8552da93abf463f31bd65e327f454e75b8a5c10bb62ded4") + add_configs("octovis", {description = "Build octovis", default = false, type = "boolean", readonly = true}) + add_configs("dynamicedt3d", {description = "Build dynamicEDT3D", default = false, type = "boolean"}) + if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end add_deps("cmake") + on_install("windows", "macosx", "linux", function (package) local configs = {} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_OCTOVIS_SUBPROJECT=" .. (package:config("octovis") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_DYNAMICETD3D_SUBPROJECT=" .. (package:config("dynamicedt3d") and "ON" or "OFF")) + + if package:is_plat("windows") and package:version():eq("1.10.0") then + io.replace("octomap/src/compare_octrees.cpp", + "#ifdef _MSC_VER // fix missing isnan for VC++", + "#if defined(_MSVC_LANG) && _MSVC_LANG < 201103L", {plain = true}) + end import("package.tools.cmake").install(package, configs) - package:addenv("PATH", "bin") + + if is_host("windows") then + package:addenv("PATH", "bin") + end end) on_test(function (package) diff --git a/packages/o/onednn/xmake.lua b/packages/o/onednn/xmake.lua index 5c5e83655..0550d361f 100644 --- a/packages/o/onednn/xmake.lua +++ b/packages/o/onednn/xmake.lua @@ -6,6 +6,11 @@ package("onednn") add_urls("https://github.com/oneapi-src/oneDNN/archive/refs/tags/$(version).tar.gz", "https://github.com/oneapi-src/oneDNN.git") + add_versions("v3.4.3", "b795dc07d0d83aaec531081e77d5fb2e503a143f4330eabe4f035d4117c191ae") + add_versions("v3.4.2", "5131ac559a13daa6e2784d20ab24e4607e55aa6da973518086326a647d389425") + add_versions("v3.4.1", "906559a25581b292352420721112e1656d21029b66e8597816f9e741fbcdeadb") + add_versions("v3.4", "1044dc3655d18de921c98dfc61ad7f65799ba5e897063d4a56d291394e12dcf5") + add_versions("v3.3.4", "e291fa4702f4bcfa6c8c23cb5b6599f0fefa8f23bc08edb9e15ddc5254ab7843") add_versions("v2.5.4", "a463ab05129e3e307333ff49d637568fa6ae1fb81742f40918b618e8ef714987") add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"}) @@ -13,7 +18,7 @@ package("onednn") add_configs("gpu_runtime", {description = "Defines the offload runtime for GPU engines.", default = "none", type = "string", values = {"none", "ocl", "dpcpp"}}) add_deps("cmake") - on_load("windows|x64", "macosx", "linux|x86_64", function (package) + on_load("windows|x64", "macosx|x86_64", "linux|x86_64", function (package) local cpu_runtime = package:config("cpu_runtime") if cpu_runtime == "omp" then package:add("deps", "openmp") @@ -26,7 +31,7 @@ package("onednn") end end) - on_install("windows|x64", "macosx", "linux|x86_64", function (package) + on_install("windows|x64", "macosx|x86_64", "linux|x86_64", function (package) local configs = {"-DDNNL_BUILD_TESTS=OFF", "-DDNNL_BUILD_EXAMPLES=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DDNNL_LIBRARY_TYPE=" .. (package:config("shared") and "SHARED" or "STATIC")) diff --git a/packages/o/oniguruma/xmake.lua b/packages/o/oniguruma/xmake.lua new file mode 100644 index 000000000..b9647b961 --- /dev/null +++ b/packages/o/oniguruma/xmake.lua @@ -0,0 +1,35 @@ +package("oniguruma") + set_homepage("https://github.com/kkos/oniguruma") + set_description("regular expression library") + set_license("BSD") + + add_urls("https://github.com/kkos/oniguruma/archive/refs/tags/$(version).tar.gz", + "https://github.com/kkos/oniguruma.git") + + add_versions("v6.9.9", "001aa1202e78448f4c0bf1a48c76e556876b36f16d92ce3207eccfd61d99f2a0") + + add_configs("posix", {description = "Include POSIX API", default = false, type = "boolean"}) + add_configs("compatible_posix", {description = "Include Binary compatible POSIX API", default = false, type = "boolean"}) + add_configs("statistics", {description = "Include statistics API", default = false, type = "boolean"}) + + add_deps("cmake") + + on_install(function (package) + local configs = {"-DINSTALL_DOCUMENTATION=OFF", "-DBUILD_TEST=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DMSVC_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + if not package:config("shared") then + package:add("defines", "ONIG_STATIC") + end + end + table.insert(configs, "-DENABLE_POSIX_API=" .. (package:config("posix") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_BINARY_COMPATIBLE_POSIX_API=" .. (package:config("compatible_posix") and "ON" or "OFF")) + table.insert(configs, "-DENABLE_STATISTICS=" .. (package:config("statistics") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("onig_new", {includes = "oniguruma.h"})) + end) diff --git a/packages/o/onnx/patches/1.16.0/cmake-abseil.patch b/packages/o/onnx/patches/1.16.0/cmake-abseil.patch new file mode 100644 index 000000000..8122dad3e --- /dev/null +++ b/packages/o/onnx/patches/1.16.0/cmake-abseil.patch @@ -0,0 +1,29 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6d7ca846..ccf65e10 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -509,13 +509,13 @@ if(ONNX_USE_LITE_PROTO) + if(TARGET protobuf::libprotobuf-lite) + target_link_libraries(onnx_proto PUBLIC protobuf::libprotobuf-lite PRIVATE ${protobuf_ABSL_USED_TARGETS}) + else() +- target_link_libraries(onnx_proto PUBLIC ${PROTOBUF_LITE_LIBRARIES}) ++ target_link_libraries(onnx_proto PUBLIC ${PROTOBUF_LITE_LIBRARIES} ${protobuf_ABSL_USED_TARGETS}) + endif() + else() + if(TARGET protobuf::libprotobuf) + target_link_libraries(onnx_proto PUBLIC protobuf::libprotobuf PRIVATE ${protobuf_ABSL_USED_TARGETS}) + else() +- target_link_libraries(onnx_proto PUBLIC ${PROTOBUF_LIBRARIES}) ++ target_link_libraries(onnx_proto PUBLIC ${PROTOBUF_LIBRARIES} ${protobuf_ABSL_USED_TARGETS}) + endif() + endif() + add_onnx_global_defines(onnx_proto) +@@ -532,7 +532,7 @@ target_include_directories(onnx PUBLIC + $ + $ + $) +-target_link_libraries(onnx PUBLIC onnx_proto) ++target_link_libraries(onnx PUBLIC onnx_proto ${protobuf_ABSL_USED_TARGETS}) + add_onnx_global_defines(onnx) + + if(BUILD_ONNX_PYTHON) diff --git a/packages/o/onnx/xmake.lua b/packages/o/onnx/xmake.lua index 2fbb1b3c2..ebdb62e7b 100644 --- a/packages/o/onnx/xmake.lua +++ b/packages/o/onnx/xmake.lua @@ -5,9 +5,18 @@ package("onnx") add_urls("https://github.com/onnx/onnx/archive/refs/tags/$(version).tar.gz", "https://github.com/onnx/onnx.git") + + add_versions("v1.16.1", "0e6aa2c0a59bb2d90858ad0040ea1807117cc2f05b97702170f18e6cd6b66fb3") + add_versions("v1.16.0", "0ce153e26ce2c00afca01c331a447d86fbf21b166b640551fe04258b4acfc6a4") + add_versions("v1.15.0", "c757132e018dd0dd171499ef74fca88b74c5430a20781ec53da19eb7f937ef68") add_versions("v1.11.0", "a20f2d9df805b16ac75ab4da0a230d3d1c304127d719e5c66a4e6df514e7f6c0") add_versions("v1.12.0", "052ad3d5dad358a33606e0fc89483f8150bb0655c99b12a43aa58b5b7f0cc507") + add_patches(">=1.16.0", "patches/1.16.0/cmake-abseil.patch", "d8cad2b231ce01aa3263692f88293be3eaa2b380e021eb5288f4c7ea930c19cb") + + add_configs("exceptions", {description = "Enable exception handling", default = true, type = "boolean"}) + add_configs("registration", {description = "Enable static registration for onnx operator schemas.", default = true, type = "boolean"}) + add_deps("cmake") add_deps("protobuf-cpp") add_deps("python", {kind = "binary"}) @@ -25,7 +34,12 @@ package("onnx") local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - table.insert(configs, "-DCMAKE_CXX_STANDARD=" .. (package:is_plat("windows") and "17" or "11")) + if package:version():lt("1.16.0") then + table.insert(configs, "-DCMAKE_CXX_STANDARD=" .. (package:is_plat("windows") and "17" or "11")) + end + table.insert(configs, "-DONNX_USE_PROTOBUF_SHARED_LIBS=" .. (package:dep("protobuf-cpp"):config("shared") and "ON" or "OFF")) + table.insert(configs, "-DONNX_DISABLE_EXCEPTIONS=" .. (package:config("exceptions") and "OFF" or "ON")) + table.insert(configs, "-DONNX_DISABLE_STATIC_REGISTRATION=" .. (package:config("registration") and "OFF" or "ON")) if package:is_plat("windows") then local vs_runtime = package:config("vs_runtime") if vs_runtime then @@ -40,7 +54,7 @@ package("onnx") on_test(function (package) local languages = "c++11" - if package:is_plat("windows") then + if package:is_plat("windows") or package:version():ge("1.16.0") then languages = "c++17" end assert(package:has_cxxtypes("onnx::ModelProto", {includes = "onnx/proto_utils.h", configs = {languages = languages}})) diff --git a/packages/o/onnxruntime/xmake.lua b/packages/o/onnxruntime/xmake.lua index 4921c423c..b7858c474 100644 --- a/packages/o/onnxruntime/xmake.lua +++ b/packages/o/onnxruntime/xmake.lua @@ -3,58 +3,104 @@ package("onnxruntime") set_description("ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator") set_license("MIT") - add_configs("gpu", {description = "Enable GPU supports on windows|x64", default = false, type = "boolean"}) + add_configs("gpu", {description = "Enable GPU support on windows|x64 and linux|x86_64", default = false, type = "boolean"}) + add_configs("cuda_version", {description = "Specify which CUDA version to use for GPU support", default = "11", type = "string"}) if is_plat("windows") then if is_arch("x64") then set_urls("https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-win-x64-$(version).zip") add_versions("1.11.1", "1f127b9d41f445a2d03356c86c125cb79dc3e66d391872c9babe6b444a51a93d") + add_versions("1.16.1", "05a972384c73c05bce51ffd3e15b1e78325ea9fa652573113159b5cac547ecce") + add_versions("1.17.0", "b0436634108c001e2284cb685646047a7b088715b64c05e39ee8a1a8930776a9") + add_versions("1.17.1", "4802af9598db02153d7da39432a48823ff69b2fb4b59155461937f20782aa91c") elseif is_arch("x86") then set_urls("https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-win-x86-$(version).zip") add_versions("1.11.1", "734ee4b76a17c466d5a5e628c27c38eccaf512e0228237cfc3d7a0a408986d1c") + add_versions("1.16.1", "60b476cde62d424fc9bf87ec3bf275cf40af76bdb25022581f3ecaf4af5992a1") + add_versions("1.17.0", "3f3214f99165d3282cc5647c5a18451aaaaf326599c7e98913ce6c50e50c6463") + add_versions("1.17.1", "9404130825474bd36b2538ed925d6b5f2cf1fb6a443f3e125054ae3470019291") + elseif is_arch("arm64") then + set_urls("https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-win-arm64-$(version).zip") + add_versions("1.17.1", "47782cebcab0fd7a1f0a3f0676b088c1bc0f4fbf21666f6fe57570dc362fa5a8") end elseif is_plat("linux") then if is_arch("x86_64") then set_urls("https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-linux-x64-$(version).tgz") add_versions("1.11.1", "ddc03b5ae325c675ff76a6f18786ce7d310be6eb6f320087f7a0e9228115f24d") + add_versions("1.16.1", "53a0f03f71587ed602e99e82773132fc634b74c2d227316fbfd4bf67181e72ed") + add_versions("1.17.0", "efc344d54d1969446ff5d3e55b54e205c6579c06333ecf1d34a04215eefae7c6") + add_versions("1.17.1", "89b153af88746665909c758a06797175ae366280cbf25502c41eb5955f9a555e") elseif is_arch("arm64") then set_urls("https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-linux-aarch64-$(version).tgz") add_versions("1.11.1", "bb9ca658a6a0acc7b9e4288647277a9ce9d86b063a2403a51d5c0d2e4df43603") + add_versions("1.16.1", "f10851b62eb44f9e811134737e7c6edd15733d2c1549cb6ce403808e9c047385") + add_versions("1.17.0", "ee5069252f549ef94759b6b60bdf10b2dc2cd71d064a7045dd66a052f956a68b") + add_versions("1.17.1", "70b6f536bb7ab5961d128e9dbd192368ac1513bffb74fe92f97aac342fbd0ac1") end elseif is_plat("macosx") then if is_arch("x86_64") then add_urls("https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-osx-x86_64-$(version).tgz") add_versions("1.11.1", "872e4413d73382db14e892112a0ee319746420f7f3a38121038a2845a97e7b5b") + add_versions("1.16.1", "0b8ae24401a8f75e1c4f75257d4eaeb1b6d44055e027df4aa4a84e67e0f9b9e3") + add_versions("1.17.0", "b87b2febef24e5645e13859d176e76473124325a0b1526baf7f68b4aa1eb1b49") + add_versions("1.17.1", "86c6b6896434084ff5086eebc4e9ea90be1ed4d46743f92864f46ee43e7b5059") elseif is_arch("arm64") then add_urls("https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-osx-arm64-$(version).tgz") add_versions("1.11.1", "dc70af1424f173d57477ecf902d4bf4a2d3a110167089037e3866ac2bf3182e3") + add_versions("1.16.1", "56ca6b8de3a220ea606c2067ba65d11dfa6e4f722e01ac7dc75f7152b81445e0") + add_versions("1.17.0", "f72a2bcca40e2650756c6b96c69ef031236aaab1b98673e744da4eef0c4bddbd") + add_versions("1.17.1", "89566f424624a7ad9a7d9d5e413c44b9639a994d7171cf409901d125b16e2bb3") end end - on_load(function (package) + on_load(function (package) if package:config("gpu") then package:add("deps", "cuda", {configs = {utils = {"cudart", "nvrtc"}}}) local versions = package:get("versions") if package:is_plat("windows") and package:is_arch("x64") then versions["1.11.1"] = "a9a10e76fbb4351d4103a4d46dc37690075901ef3bb7304dfa138820c42c547b" - package:set("urls", "https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-win-x64-gpu-$(version).zip") + versions["1.16.1"] = "b841f8e8d9a0556bfc5228ff1488395fa041fafe8d16a62e25a254d000d51888" + if package:config("cuda_version") == "12" then + versions["1.17.0"] = "63823f29039e593da435a6af6757949262ac592e575bfe08675a11d4963b47cf" + versions["1.17.1"] = "5c6e1433d63e699d97d66d66427830caf5e69ea077569bc1e2ab5e1450d8fac1" + package:set("urls", "https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-win-x64-cuda12-$(version).zip") + else + versions["1.17.0"] = "3c90a38769e2f7bdb088c00410de4895b07b7d53a7c80955f18989775c2a25e7" + versions["1.17.1"] = "b7a66f50ad146c2ccb43471d2d3b5ad78084c2d4ddbd3ea82d65f86c867408b2" + package:set("urls", "https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-win-x64-gpu-$(version).zip") + end + elseif package:is_plat("linux") and package:is_arch("x86_64") then + versions["1.11.1"] = "31c392b5804a57bbcf2550a29a76af8641bfbd8a0f68b7e354d876689fe667f2" + versions["1.16.1"] = "474d5d74b588d54aa3e167f38acc9b1b8d20c292d0db92299bdc33a81eb4492d" + if package:config("cuda_version") == "12" then + versions["1.17.0"] = "0f0b9a6e7ba703c095aae19220d14f7c48c6170ed24ebf6bc97fbde01312985f" + versions["1.17.1"] = "3a7b114545a90d65ed01d42faabc08f735c1bb58d9065d423c6e4a89222b4efc" + package:set("urls", "https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-linux-x64-cuda12-$(version).tgz") + else + versions["1.17.0"] = "27cfa22af7301868b55220f8733361889286b30be0569a8f46abb63e90342180" + versions["1.17.1"] = "613c53745ea4960ed368f6b3ab673558bb8561c84a8fa781b4ea7fb4a4340be4" + package:set("urls", "https://github.com/microsoft/onnxruntime/releases/download/v$(version)/onnxruntime-linux-x64-gpu-$(version).tgz") + end end package:set("versions", versions) end end) on_install("windows", "linux|arm64", "linux|x86_64", "macosx", function (package) + if package:is_plat("windows") then + os.mv("lib/*.dll", package:installdir("bin")) + end os.cp("*", package:installdir()) end) on_test(function (package) assert(package:check_cxxsnippets({test = [[ #include - + #include void test() { std::array data = {0.0f, 0.0f}; - std::array shape{2}; + std::array shape{2}; Ort::Env env; diff --git a/packages/o/openblas/xmake.lua b/packages/o/openblas/xmake.lua index 715ba8d76..f21d165f6 100644 --- a/packages/o/openblas/xmake.lua +++ b/packages/o/openblas/xmake.lua @@ -6,7 +6,7 @@ package("openblas") if is_plat("windows") then if is_arch("x64", "x86_64") then - add_urls("https://github.com/xianyi/OpenBLAS/releases/download/v$(version)/OpenBLAS-$(version)-x64.zip") + add_urls("https://github.com/OpenMathLib/OpenBLAS/releases/download/v$(version)/OpenBLAS-$(version)-x64.zip") add_versions("0.3.12", "f1d231594365d5c7f2c625f9d8bd4eeea4f7b748675a95301d3cb2c0aa118e26") add_versions("0.3.13", "85cacd71dec9bc1e1168a8463fd0aa29a31f449b4583ed3a1c689a56df8eae29") add_versions("0.3.15", "afc029572a84820596fe81f1faeb909ada5bab27d091285fdd80bc2a8231f4a6") @@ -15,20 +15,24 @@ package("openblas") add_versions("0.3.19", "d85b09d80bbb40442d608fa60353ccec5f112cebeccd805c0e139057e26d1795") add_versions("0.3.20", "cacfb8563e2a98260e35a09c92fd3b7383a9cd1367444edfa1b46cb0225ee9c3") add_versions("0.3.21", "ecf1853ce92696fb8531c941c50e983ea8fa673c118a87298a075c045d52a3ca") - add_versions("0.3.23", "9255020dcd6e10e037550b04aa7b85b2a2c610c2a479be79b26105eb81fe253b") + add_versions("0.3.23", "e3a82e60db8d6197228790567e7cf74f2c421a65b29f848977a07b5457debdaa") + add_versions("0.3.24", "6335128ee7117ea2dd2f5f96f76dafc17256c85992637189a2d5f6da0c608163") + add_versions("0.3.26", "859c510a962a30ef1b01aa93cde26fdb5fb1050f94ad5ab2802eba3731935e06") elseif is_arch("x86") then - add_urls("https://github.com/xianyi/OpenBLAS/releases/download/v$(version)/OpenBLAS-$(version)-x86.zip") + add_urls("https://github.com/OpenMathLib/OpenBLAS/releases/download/v$(version)/OpenBLAS-$(version)-x86.zip") add_versions("0.3.15", "bcde933737b477813eaac290de5cb8756d3b42199e8ef5f44b23ae5f06fe0834") add_versions("0.3.17", "8258a9a22075280fb02b65447ea77d9439a0097711e220fc4ae8f92927f32273") add_versions("0.3.18", "c24ecd6e5f561de3861bf714b35e0957a27ee0e03ab4d2867d08377892daf66e") add_versions("0.3.19", "478cbaeb9364b4681a7c982626e637a5a936514a45e12b6f0caddbcb9483b795") add_versions("0.3.20", "0ee249246af7ce2fd66f86cb9350f5f5a7b97496b9b997bfd0680048dd194158") add_versions("0.3.21", "936416a0fec5506af9cf040c9de5c7edbd0ff18b53431799d1a43e47f9eba64e") + add_versions("0.3.24", "92f8e0c73e1eec3c428b210fbd69b91e966f8cf1f998f3b60a52f024b2bf9d27") + add_versions("0.3.26", "9c3d48c3c21cd2341d642a63ee8a655205587befdab46462df7e0104d6771f67") end add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) else - add_urls("https://github.com/xianyi/OpenBLAS/releases/download/v$(version)/OpenBLAS-$(version).tar.gz") + add_urls("https://github.com/OpenMathLib/OpenBLAS/releases/download/v$(version)/OpenBLAS-$(version).tar.gz") add_versions("0.3.12", "65a7d3a4010a4e3bd5c0baa41a234797cd3a1735449a4a5902129152601dc57b") add_versions("0.3.13", "79197543b17cc314b7e43f7a33148c308b0807cd6381ee77f77e15acf3e6459e") add_versions("0.3.15", "30a99dec977594b387a17f49904523e6bc8dd88bd247266e83485803759e4bbe") @@ -38,6 +42,8 @@ package("openblas") add_versions("0.3.20", "8495c9affc536253648e942908e88e097f2ec7753ede55aca52e5dead3029e3c") add_versions("0.3.21", "f36ba3d7a60e7c8bcc54cd9aaa9b1223dd42eaf02c811791c37e8ca707c241ca") add_versions("0.3.23", "5d9491d07168a5d00116cdc068a40022c3455bf9293c7cb86a65b1054d7e5114") + add_versions("0.3.24", "ceadc5065da97bd92404cac7254da66cc6eb192679cf1002098688978d4d5132") + add_versions("0.3.26", "4e6e4f5cb14c209262e33e6816d70221a2fe49eb69eaf0a06f065598ac602c68") add_configs("fortran", {description = "Compile with fortran enabled.", default = is_plat("linux"), type = "boolean"}) add_configs("openmp", {description = "Compile with OpenMP enabled.", default = not is_plat("macosx"), type = "boolean"}) @@ -51,7 +57,7 @@ package("openblas") end on_load("macosx", "linux", "mingw@windows,msys", function (package) if package:config("fortran") then - package:add("syslinks", "gfortran") + package:add("deps", "gfortran") end if package:config("openmp") then package:add("deps", "openmp") @@ -69,6 +75,15 @@ package("openblas") import("lib.detect.find_tool") import("package.tools.make") local configs = {} + if package:is_plat("linux") then + table.insert(configs, "CC=" .. package:build_getenv("cc")) + end + if package:is_plat("macosx") and package:is_arch("arm64") then + table.insert(configs, "TARGET=VORTEX") + table.insert(configs, "BINARY=64") + table.insert(configs, "CFLAGS=-arch arm64") + table.insert(configs, "LDFLAGS=-arch arm64") + end if package:debug() then table.insert(configs, "DEBUG=1") end if package:config("openmp") then table.insert(configs, "USE_OPENMP=1") end if not package:config("shared") then @@ -80,8 +95,6 @@ package("openblas") local fortran = find_tool("gfortran") if fortran then table.insert(configs, "FC=" .. fortran.program) - else - raise("gfortran not found!") end else table.insert(configs, "NO_FORTRAN=1") @@ -90,15 +103,13 @@ package("openblas") if package:is_arch("i386", "x86") then table.insert(configs, "BINARY=32") end - if package:config("shared") then - package:addenv("PATH", "bin") - end else + local cflags + local ldflags if package:config("openmp") then local openmp = package:dep("openmp"):fetch() if openmp then - local ldflags - local cflags = openmp.cflags + cflags = openmp.cflags local libomp = package:dep("libomp") if libomp then local fetchinfo = libomp:fetch() @@ -115,14 +126,22 @@ package("openblas") end end end - if cflags then - io.replace("Makefile.system", "-fopenmp", cflags, {plain = true}) - end - if ldflags then - table.insert(configs, "LDFLAGS=" .. ldflags) + end + end + if package:config("fortran") then + local gfortran = package:dep("gfortran"):fetch() + if gfortran then + for _, linkdir in ipairs(gfortran.linkdirs) do + ldflags = (ldflags or "") .. " -Wl,-L" .. linkdir end end end + if cflags then + io.replace("Makefile.system", "-fopenmp", cflags, {plain = true}) + end + if ldflags then + table.insert(configs, "LDFLAGS=" .. ldflags) + end end make.build(package, configs) make.make(package, table.join("install", "PREFIX=" .. package:installdir():gsub("\\", "/"), configs)) diff --git a/packages/o/opencl-headers/xmake.lua b/packages/o/opencl-headers/xmake.lua index 9d2f21aad..4ed404ab7 100644 --- a/packages/o/opencl-headers/xmake.lua +++ b/packages/o/opencl-headers/xmake.lua @@ -7,6 +7,8 @@ package("opencl-headers") add_urls("https://github.com/KhronosGroup/OpenCL-Headers/archive/refs/tags/$(version).tar.gz", "https://github.com/KhronosGroup/OpenCL-Headers.git") + add_versions("v2024.05.08", "3c3dd236d35f4960028f4f58ce8d963fb63f3d50251d1e9854b76f1caab9a309") + add_versions("v2023.12.14", "407d5e109a70ec1b6cd3380ce357c21e3d3651a91caae6d0d8e1719c69a1791d") add_versions("v2021.06.30", "6640d590c30d90f89351f5e3043ae6363feeb19ac5e64bc35f8cfa1a6cd5498e") add_deps("cmake") diff --git a/packages/o/opencl/xmake.lua b/packages/o/opencl/xmake.lua index 0f7af79ad..bb6683a58 100644 --- a/packages/o/opencl/xmake.lua +++ b/packages/o/opencl/xmake.lua @@ -89,7 +89,23 @@ package("opencl") end) on_install("linux", "macosx", "android", function (package) + package:add("links", "OpenCL") + package:add("links", "OpenCLUtils") + package:add("links", "OpenCLUtilsCpp") + package:add("links", "OpenCLExt") + local configs = {"-DOPENCL_SDK_BUILD_SAMPLES=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) import("package.tools.cmake").install(package, configs) end) + + on_test(function (package) + assert(package:check_csnippets({test = [[ + #include + #include + void test () { + cl_uint num_platforms; + clGetPlatformIDs(0, NULL, &num_platforms); + } + ]]}, {configs = {languages = "c11"}})) + end) \ No newline at end of file diff --git a/packages/o/opencore-amr/xmake.lua b/packages/o/opencore-amr/xmake.lua new file mode 100644 index 000000000..fa66b3afa --- /dev/null +++ b/packages/o/opencore-amr/xmake.lua @@ -0,0 +1,22 @@ +package("opencore-amr") + set_homepage("https://opencore-amr.sourceforge.io") + set_description("Library of OpenCORE Framework implementation of Adaptive Multi Rate Narrowband and Wideband (AMR-NB and AMR-WB) speech codec.") + + add_urls("https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-$(version).tar.gz") + + add_versions("0.1.6", "483eb4061088e2b34b358e47540b5d495a96cd468e361050fae615b1809dc4a1") + + on_install("linux", "macosx", "android", "iphoneos", "bsd", "cross", "mingw", function (package) + local configs = {} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + if package:is_debug() then + table.insert(configs, "--enable-debug") + end + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("Decoder_Interface_init", {includes = "opencore-amrnb/interf_dec.h"})) + assert(package:has_cfuncs("Encoder_Interface_init", {includes = "opencore-amrnb/interf_enc.h"})) + assert(package:has_cfuncs("D_IF_init", {includes = "opencore-amrwb/dec_if.h"})) + end) diff --git a/packages/o/opencv/xmake.lua b/packages/o/opencv/xmake.lua index a95ae03dd..d537b523c 100644 --- a/packages/o/opencv/xmake.lua +++ b/packages/o/opencv/xmake.lua @@ -6,6 +6,7 @@ package("opencv") add_urls("https://github.com/opencv/opencv/archive/$(version).tar.gz", "https://github.com/opencv/opencv.git") + add_versions("4.9.0", "ddf76f9dffd322c7c3cb1f721d0887f62d747b82059342213138dc190f28bc6c") add_versions("4.8.0", "cbf47ecc336d2bff36b0dcd7d6c179a9bb59e805136af6b9670ca944aef889bd") add_versions("4.6.0", "1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277") add_versions("4.5.5", "a1cfdcf6619387ca9e232687504da996aaa9f7b5689986b8331ec02cb61d28ad") @@ -16,6 +17,7 @@ package("opencv") add_versions("4.2.0", "9ccb2192d7e8c03c58fee07051364d94ed7599363f3b0dce1c5e6cc11c1bb0ec") add_versions("3.4.9", "b7ea364de7273cfb3b771a0d9c111b8b8dfb42ff2bcd2d84681902fb8f49892a") + add_resources("4.9.0", "opencv_contrib", "https://github.com/opencv/opencv_contrib/archive/4.9.0.tar.gz", "8952c45a73b75676c522dd574229f563e43c271ae1d5bbbd26f8e2b6bc1a4dae") add_resources("4.8.0", "opencv_contrib", "https://github.com/opencv/opencv_contrib/archive/4.8.0.tar.gz", "b4aef0f25a22edcd7305df830fa926ca304ea9db65de6ccd02f6cfa5f3357dbb") add_resources("4.6.0", "opencv_contrib", "https://github.com/opencv/opencv_contrib/archive/4.6.0.tar.gz", "1777d5fd2b59029cf537e5fd6f8aa68d707075822f90bde683fcde086f85f7a7") add_resources("4.5.5", "opencv_contrib", "https://github.com/opencv/opencv_contrib/archive/4.5.5.tar.gz", "a97c2eaecf7a23c6dbd119a609c6d7fae903e5f9ff5f1fe678933e01c67a6c11") @@ -41,6 +43,7 @@ package("opencv") if is_plat("macosx") then add_frameworks("Foundation", "CoreFoundation", "CoreGraphics", "AppKit", "OpenCL", "Accelerate") + add_extsources("brew::opencv") elseif is_plat("linux") then add_extsources("pacman::opencv", "apt::libopencv-dev") add_syslinks("pthread", "dl") @@ -48,6 +51,28 @@ package("opencv") add_syslinks("gdi32", "user32", "glu32", "opengl32", "advapi32", "comdlg32", "ws2_32") end + on_fetch("macosx", function (package, opt) + if opt.system then + local result = package:find_package("brew::opencv", opt) + if result then + local includedirs = table.wrap(result.sysincludedirs or result.includedirs) + for _, includedir in ipairs(includedirs) do + local dir = path.join(includedir, "opencv4") + if os.isdir(dir) then + table.insert(includedirs, dir) + end + end + if result.sysincludedirs then + result.sysincludedirs = includedirs + end + if result.includedirs then + result.includedirs = includedirs + end + end + return result + end + end) + on_load("linux", "macosx", "windows", "mingw@windows,msys", function (package) if package:is_plat("windows") then local arch = "x64" @@ -77,6 +102,11 @@ package("opencv") if package:config("cuda") then package:add("deps", "cuda", {system = true, configs = {utils = {"cudnn", "cufft", "cublas"}}}) end + if package:config("ffmpeg") then + if not package:is_plat("windows") or not package:is_arch("i386", "x86", "arm64") then + package:add("deps", "ffmpeg") + end + end if package:is_plat("linux") then if package:config("gtk") then package:add("deps", "gtk+3", {optional = true}) @@ -130,6 +160,8 @@ package("opencv") end elseif package:is_plat("mingw") then table.insert(configs, "-DCMAKE_SYSTEM_PROCESSOR=" .. (package:is_arch("x86_64") and "AMD64" or "i686")) + elseif package:is_plat("macosx") then + table.insert(configs, "-DCMAKE_SYSTEM_PROCESSOR=" .. (package:is_arch("x86_64") and "AMD64" or "ARM64")) end local resourcedir = package:resourcedir("opencv_contrib") if resourcedir then @@ -137,6 +169,12 @@ package("opencv") local modulesdir = assert(find_path("modules", path.join(resourcedir, "*")), "modules not found!") table.insert(configs, "-DOPENCV_EXTRA_MODULES_PATH=" .. path.absolute(path.join(modulesdir, "modules"))) end + -- fix https://github.com/opencv/opencv/issues/22418 + if package:config("ffmpeg") and package:version() and package:version():le("4.6") then + io.replace("modules/videoio/src/ffmpeg_codecs.hpp", + "#include ", + "#include \n#include ", {plain = true}) + end import("package.tools.cmake").install(package, configs, {buildir = "bd"}) for _, link in ipairs({"opencv_phase_unwrapping", "opencv_surface_matching", "opencv_saliency", "opencv_wechat_qrcode", "opencv_mcc", "opencv_face", "opencv_img_hash", "opencv_videostab", "opencv_structured_light", "opencv_intensity_transform", "opencv_ccalib", "opencv_line_descriptor", "opencv_stereo", "opencv_dnn_objdetect", "opencv_dnn_superres", "opencv_fuzzy", "opencv_hfs", "opencv_rapid", "opencv_bgsegm", "opencv_bioinspired", "opencv_rgbd", "opencv_dpm", "opencv_aruco", "opencv_reg", "opencv_tracking", "opencv_datasets", "opencv_xfeatures2d", "opencv_shape", "opencv_barcode", "opencv_superres", "opencv_viz", "opencv_plot", "opencv_quality", "opencv_text", "opencv_cudaoptflow", "opencv_optflow", "opencv_ximgproc", "opencv_xobjdetect", "opencv_xphoto", "opencv_stitching", "opencv_ml", "opencv_photo", "opencv_cudaobjdetect", "opencv_cudalegacy", "opencv_cudabgsegm", "opencv_cudafeatures2d", "opencv_cudastereo", "opencv_cudaimgproc", "opencv_cudafilters", "opencv_cudaarithm", "opencv_cudawarping", "opencv_cudacodec", "opencv_cudev", "opencv_gapi", "opencv_objdetect", "opencv_highgui", "opencv_videoio", "opencv_video", "opencv_calib3d", "opencv_dnn", "opencv_features2d", "opencv_flann", "opencv_imgcodecs", "opencv_imgproc", "opencv_core"}) do local reallink = link diff --git a/packages/o/openexr/xmake.lua b/packages/o/openexr/xmake.lua index 7f0994be1..fbfd6df8f 100644 --- a/packages/o/openexr/xmake.lua +++ b/packages/o/openexr/xmake.lua @@ -2,23 +2,26 @@ package("openexr") set_homepage("https://www.openexr.com/") set_description("OpenEXR provides the specification and reference implementation of the EXR file format, the professional-grade image storage format of the motion picture industry.") + set_license("BSD-3-Clause") - add_urls("https://github.com/AcademySoftwareFoundation/openexr/archive/v$(version).tar.gz", + add_urls("https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/$(version).tar.gz", "https://github.com/AcademySoftwareFoundation/openexr.git") - add_versions("2.5.3", "6a6525e6e3907715c6a55887716d7e42d09b54d2457323fcee35a0376960bebf") - add_versions("2.5.5", "59e98361cb31456a9634378d0f653a2b9554b8900f233450f2396ff495ea76b3") - add_versions("2.5.7", "36ecb2290cba6fc92b2ec9357f8dc0e364b4f9a90d727bf9a57c84760695272d") - add_versions("3.1.0", "8c2ff765368a28e8210af741ddf91506cef40f1ed0f1a08b6b73bb3a7faf8d93") - add_versions("3.1.1", "045254e201c0f87d1d1a4b2b5815c4ae54845af2e6ec0ab88e979b5fdb30a86e") - add_versions("3.1.3", "6f70a624d1321319d8269a911c4032f24950cde52e76f46e9ecbebfcb762f28c") - add_versions("3.1.4", "cb019c3c69ada47fe340f7fa6c8b863ca0515804dc60bdb25c942c1da886930b") - add_versions("3.1.5", "93925805c1fc4f8162b35f0ae109c4a75344e6decae5a240afdfce25f8a433ec") + add_versions("v3.2.4", "81e6518f2c4656fdeaf18a018f135e96a96e7f66dbe1c1f05860dd94772176cc") + add_versions("v3.2.3", "f3f6c4165694d5c09e478a791eae69847cadb1333a2948ca222aa09f145eba63") + add_versions("v2.5.3", "6a6525e6e3907715c6a55887716d7e42d09b54d2457323fcee35a0376960bebf") + add_versions("v2.5.5", "59e98361cb31456a9634378d0f653a2b9554b8900f233450f2396ff495ea76b3") + add_versions("v2.5.7", "36ecb2290cba6fc92b2ec9357f8dc0e364b4f9a90d727bf9a57c84760695272d") + add_versions("v3.1.0", "8c2ff765368a28e8210af741ddf91506cef40f1ed0f1a08b6b73bb3a7faf8d93") + add_versions("v3.1.1", "045254e201c0f87d1d1a4b2b5815c4ae54845af2e6ec0ab88e979b5fdb30a86e") + add_versions("v3.1.3", "6f70a624d1321319d8269a911c4032f24950cde52e76f46e9ecbebfcb762f28c") + add_versions("v3.1.4", "cb019c3c69ada47fe340f7fa6c8b863ca0515804dc60bdb25c942c1da886930b") + add_versions("v3.1.5", "93925805c1fc4f8162b35f0ae109c4a75344e6decae5a240afdfce25f8a433ec") + add_versions("v3.2.1", "61e175aa2203399fb3c8c2288752fbea3c2637680d50b6e306ea5f8ffdd46a9b") add_deps("cmake") add_deps("zlib") - -- deprecated - add_configs("build_both", {description = "Build both static library and shared library.", default = false, type = "boolean"}) + add_configs("build_both", {description = "Build both static library and shared library. (deprecated)", default = false, type = "boolean"}) on_load("windows", "macosx", "linux", "mingw@windows", "mingw@msys", function (package) local ver = package:version() diff --git a/packages/o/opengl-headers/xmake.lua b/packages/o/opengl-headers/xmake.lua new file mode 100644 index 000000000..b294cc668 --- /dev/null +++ b/packages/o/opengl-headers/xmake.lua @@ -0,0 +1,23 @@ +package("opengl-headers") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/KhronosGroup/OpenGL-Registry/") + set_description("OpenGL, OpenGL ES, and OpenGL ES-SC API and Extension Registry") + set_license("MIT") + + add_urls("https://github.com/KhronosGroup/OpenGL-Registry.git") + + add_versions("2024.01.04", "ca491a0576d5c026f06ebe29bfac7cbbcf1e8332") + + add_deps("egl-headers") + + on_install(function (package) + os.vcp("api/*", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_csnippets({test = [[ + void test() { + int version = GL_VERSION; + } + ]]}, {includes = "GLES3/gl3.h"})) + end) diff --git a/packages/o/openh264/xmake.lua b/packages/o/openh264/xmake.lua index c30e281d4..880758649 100644 --- a/packages/o/openh264/xmake.lua +++ b/packages/o/openh264/xmake.lua @@ -1,28 +1,58 @@ package("openh264") - set_homepage("http://www.openh264.org/") set_description("OpenH264 is a codec library which supports H.264 encoding and decoding.") set_license("BSD-2-Clause") - add_urls("https://github.com/cisco/openh264/archive/refs/tags/$(version).tar.gz") + set_urls("https://github.com/cisco/openh264/archive/refs/tags/$(version).tar.gz", + "https://github.com/cisco/openh264.git") + + add_versions("v2.4.1", "8ffbe944e74043d0d3fb53d4a2a14c94de71f58dbea6a06d0dc92369542958ea") add_versions("v2.1.1", "af173e90fce65f80722fa894e1af0d6b07572292e76de7b65273df4c0a8be678") - add_deps("meson", "ninja", "nasm") if is_plat("linux") then add_syslinks("pthread", "rt") end + + add_deps("meson", "ninja", "nasm") + + on_load("windows", function (package) + if package:is_plat("windows") and package:is_arch("arm.*") and (not package:is_precompiled()) then + package:add("deps", "strawberry-perl") + end + end) + on_install("windows", "linux", function (package) - import("package.tools.meson").build(package, {"-Dtests=disabled"}, {buildir = "out"}) - import("package.tools.ninja").install(package, {}, {buildir = "out"}) - if package:config("shared") then - os.tryrm(path.join(package:installdir("lib"), "libopenh264.a")) + if package:version():ge("2.4.1") then + import("package.tools.meson") + + local opt = {} + opt.envs = meson.buildenvs(package) + -- add gas-preprocessor to PATH + if package:is_plat("windows") and package:is_arch("arm.*") then + opt.envs.PATH = path.join(os.programdir(), "scripts") .. path.envsep() .. opt.envs.PATH + end + + if package:is_plat("linux") and package:has_tool("cc", "clang", "clangxx") then + opt.ldflags = "-lstdc++" + opt.shflags = "-lstdc++" + end + + local configs = {"-Dtests=disabled"} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + meson.install(package, configs, opt) else - os.tryrm(path.join(package:installdir("lib"), "libopenh264.so*")) - os.tryrm(path.join(package:installdir("lib"), "openh264.lib")) - os.tryrm(path.join(package:installdir("bin"), "openh264-*.dll")) - end - if package:is_plat("windows") then - os.trymv(path.join(package:installdir("lib"), "libopenh264.a"), path.join(package:installdir("lib"), "openh264.lib")) + import("package.tools.meson").build(package, {"-Dtests=disabled"}, {buildir = "out"}) + import("package.tools.ninja").install(package, {}, {buildir = "out"}) + if package:config("shared") then + os.tryrm(path.join(package:installdir("lib"), "libopenh264.a")) + else + os.tryrm(path.join(package:installdir("lib"), "libopenh264.so*")) + os.tryrm(path.join(package:installdir("lib"), "openh264.lib")) + os.tryrm(path.join(package:installdir("bin"), "openh264-*.dll")) + end + if package:is_plat("windows") then + os.trymv(path.join(package:installdir("lib"), "libopenh264.a"), path.join(package:installdir("lib"), "openh264.lib")) + end end end) diff --git a/packages/o/openjdk/xmake.lua b/packages/o/openjdk/xmake.lua new file mode 100644 index 000000000..7fcf7e413 --- /dev/null +++ b/packages/o/openjdk/xmake.lua @@ -0,0 +1,84 @@ +package("openjdk") + set_homepage("https://jdk.java.net") + set_description("Java Development Kit builds, from Oracle") + set_license("GPL-2.0") + + if is_host("windows", "mingw") then + add_urls("https://download.oracle.com/java/$(version)/latest/jdk-$(version)_windows-x64_bin.zip") + add_versions("17", "c98d85c8417703b0f72ddc5757ed66f3478ea7107b0e6d2a98cadbc73a45d77b") + add_versions("21", "776afe55020560f175d8099710d8ac07c4d40772c694385c3dd765117cbd0ac3") + elseif is_host("linux") then + if is_arch("x86_64") then + add_urls("https://download.oracle.com/java/$(version)/latest/jdk-$(version)_linux-x64_bin.tar.gz") + add_versions("17", "e4fb2df9a32a876afb0a6e17f54c594c2780e18badfa2e8fc99bc2656b0a57b1") + add_versions("21", "9f1f4a7f25ef6a73255657c40a6d7714f2d269cf15fb2ff1dc9c0c8b56623a6f") + elseif is_arch("arm64") then + add_urls("https://download.oracle.com/java/$(version)/latest/jdk-$(version)_linux-aarch64_bin.tar.gz") + add_versions("17", "745e7a387e059ddc2481ccd209d691ca926fc0f35d523051822f24b296d17df7") + add_versions("21", "14504bcdea0d8bc3fe9f065924e9e2dc631317b023a722565c8239075f39062d") + end + elseif is_host("macosx") then + if is_arch("x86_64") then + add_urls("https://download.oracle.com/java/$(version)/latest/jdk-$(version)_macos-x64_bin.tar.gz") + add_versions("17", "7b68b833f392aa543ba538f94c60fd477581fef96a9c1ae059fa4158e9ce75ff") + add_versions("21", "197a923b1f7ea2b224fafdfb9c3ef5fc8eb197d9817d7631d96da02b619f5975") + elseif is_arch("arm64") then + add_urls("https://download.oracle.com/java/$(version)/latest/jdk-$(version)_macos-aarch64_bin.tar.gz") + add_versions("17", "d5bec93922815e9337040678ddf3f40e50b63c2b588cf63574fa1f2010206042") + add_versions("21", "4b94951f03efe44cb6656e43f1098db3ce254a00412f9d22dff18a8328a7efdd") + end + end + + add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true}) + + if is_plat("linux") then + add_deps("alsa-lib", {configs = {shared = true, versioned = false}}) + add_deps("freetype", "libxtst", "libxi", "libxrender") + add_extsources("pacman::jdk-openjdk", "apt::default-jdk") + elseif is_plat("macosx") then + add_extsources("brew::openjdk") + end + + on_fetch("windows", "mingw", function (package, opt) + if opt.system then + local sdkdir = os.getenv("JAVA_HOME") + if os.isdir(sdkdir) then + local result = {} + result.includedirs = {path.join(sdkdir, "include"), path.join(sdkdir, "include", "win32")} + result.linkdirs = path.join(sdkdir, "lib") + result.links = {"jvm", "jawt"} + package:addenv("PATH", path.join(sdkdir, "bin"), path.join(sdkdir, "bin", "server")) + return result + end + end + end) + + on_install("windows|x64", "linux|x86_64", "macosx|x86_64", "macosx|arm64", "mingw|x86_64", function (package) + local plat + if package:is_plat("windows", "mingw") then + plat = "win32" + package:addenv("PATH", "bin/server") + else + package:add("linkdirs", "lib", "lib/server") + if package:is_plat("linux") then + plat = "linux" + elseif package:is_plat("macosx") then + plat = "darwin" + os.cd("Contents/Home") + end + end + + os.cp("bin", package:installdir()) + os.cp("include", package:installdir()) + os.cp("lib", package:installdir()) + os.cp("jmods", package:installdir("lib")) + os.cp("conf", package:installdir()) + + package:add("includedirs", "include", path.join("include", plat)) + package:addenv("PATH", "bin") + end) + + on_test(function (package) + os.vrun("java -version") + assert(package:has_cfuncs("JNI_CreateJavaVM", {includes = "jni.h"})) + end) diff --git a/packages/o/openmp/xmake.lua b/packages/o/openmp/xmake.lua index 45185d7af..65b54f4a6 100644 --- a/packages/o/openmp/xmake.lua +++ b/packages/o/openmp/xmake.lua @@ -4,11 +4,11 @@ package("openmp") set_description("The OpenMP API specification for parallel programming") add_configs("runtime", {description = "Set OpenMP runtime for gcc/clang like compilers.", default = "default", type = "string", values = {"default", "custom"}}) - add_configs("experimental", {description = "Enable experimental OpenMP feature for msvc.", default = false, type = boolean}) + add_configs("feature", {description = "Set OpenMP feature for msvc.", default = "default", type = "string", values = {"default", "experimental", "llvm"}}) on_load(function (package) if package.has_tool then - for _, toolkind in ipairs({"cc", "cxx"}) do + for _, toolkind in ipairs({"cc", "cxx", "fc"}) do if package:config("runtime") == "default" then if package:has_tool(toolkind, "clang", "clangxx") then package:add("deps", "libomp") @@ -26,19 +26,32 @@ package("openmp") end local result = {} if package.has_tool then - for _, toolkind in ipairs({"cc", "cxx"}) do - local flagname = toolkind == "cxx" and "cxxflags" or "cflags" - if package:has_tool(toolkind, "cl") then - result[flagname] = (package:config("experimental") and "/openmp:experimental" or "/openmp") + for _, toolkind in ipairs({"cc", "cxx", "fc"}) do + if toolkind == "cxx" then + flagname = "cxxflags" + elseif toolkind == "fc" then + flagname = "fcflags" + else + flagname = "cflags" + end + if package:has_tool(toolkind, "cl", "clang_cl") then + if package:config("feature") == "default" then + result[flagname] = "/openmp" + else + result[flagname] = "/openmp:" .. package:config("feature") + end + if package:has_tool(toolkind, "clang_cl") then + result.links = "libomp" + end elseif package:has_tool(toolkind, "clang", "clangxx") then if package:is_plat("macosx") then result[flagname] = "-Xpreprocessor -fopenmp" else result[flagname] = "-fopenmp" end - elseif package:has_tool(toolkind, "gcc", "gxx") then + elseif package:has_tool(toolkind, "gcc", "gxx", "gfortran") then result[flagname] = "-fopenmp" - elseif package:has_tool(toolkind, "icc", "icpc") then + elseif package:has_tool(toolkind, "icc", "icpc", "ifort") then result[flagname] = "-qopenmp" elseif package:has_tool(toolkind, "icl") then result[flagname] = "-Qopenmp" @@ -47,25 +60,30 @@ package("openmp") if package:has_tool(toolkind, "clang", "clangxx") then if not package:is_plat("macosx") then result.ldflags = "-fopenmp" + result.shflags = "-fopenmp" end - elseif package:has_tool(toolkind, "gcc", "gxx") then + elseif package:has_tool(toolkind, "gcc", "gxx", "gfortran") then result.ldflags = "-fopenmp" + result.shflags = "-fopenmp" elseif package:has_tool(toolkind, "icc", "icpc") then result.ldflags = "-qopenmp" + result.shflags = "-qopenmp" elseif package:has_tool(toolkind, "icl") then result.ldflags = "-Qopenmp" + result.shflags = "-Qopenmp" end end if package:config("runtime") == "custom" then if package:has_tool(toolkind, "cl") then result.ldflags = "/nodefaultlib:vcomp" + result.shflags = "/nodefaultlib:vcomp" end end end else raise("This package(openmp) requires xmake version 2.6.1 or newer.") end - return (result.cflags or result.cxxflags) and result + return (result.cflags or result.cxxflags or result.fcflags) and result end) on_install("linux", "macosx", "windows", "mingw@msys", function (package) diff --git a/packages/o/openpgl/xmake.lua b/packages/o/openpgl/xmake.lua index 7a5e12ae5..26e8deec6 100644 --- a/packages/o/openpgl/xmake.lua +++ b/packages/o/openpgl/xmake.lua @@ -7,6 +7,7 @@ package("openpgl") add_urls("https://github.com/OpenPathGuidingLibrary/openpgl/archive/refs/tags/v$(version).tar.gz", "https://github.com/OpenPathGuidingLibrary/openpgl.git") + add_versions("0.6.0", "4192a4096ee3e3d31878cd013f8de23418c8037c576537551f946c4811931c5e") add_versions("0.5.0", "1ec806d434d45e43e098f82ee9be0cb74928343898c57490b34ff80584e9805a") add_configs("avx512", {description = "Enable AVX512", default = false, type = "boolean"}) diff --git a/packages/o/openssl/fetch.lua b/packages/o/openssl/fetch.lua index d0d00a226..faea77a43 100644 --- a/packages/o/openssl/fetch.lua +++ b/packages/o/openssl/fetch.lua @@ -3,13 +3,16 @@ import("lib.detect.find_library") -- http://www.slproweb.com/products/Win32OpenSSL.html function _find_package_on_windows(package, opt) - local bits = package:is_plat("x86") and "32" or "64" + local bits = package:is_arch("x86") and "32" or "64" local paths = {"$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL %(" .. bits .. "-bit%)_is1;Inno Setup: App Path)", - "$(env PROGRAMFILES)/OpenSSL", "$(env PROGRAMFILES)/OpenSSL-Win" .. bits, - "C:/OpenSSL", "C:/OpenSSL-Win" .. bits} + if os.arch() == package:arch() then + table.insert(paths, "$(env PROGRAMFILES)/OpenSSL") + table.insert(paths, "C:/OpenSSL") + end + local result = {links = {}, linkdirs = {}, includedirs = {}} for _, name in ipairs({"libssl", "libcrypto"}) do local linkinfo = find_library(name, paths, {suffixes = "lib"}) diff --git a/packages/o/openssl/xmake.lua b/packages/o/openssl/xmake.lua index 10ff32a4b..56a965bc5 100644 --- a/packages/o/openssl/xmake.lua +++ b/packages/o/openssl/xmake.lua @@ -1,11 +1,12 @@ package("openssl") - set_homepage("https://www.openssl.org/") set_description("A robust, commercial-grade, and full-featured toolkit for TLS and SSL.") + set_license("Apache-2.0") add_urls("https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_$(version).zip", {version = function (version) return version:gsub("^(%d+)%.(%d+)%.(%d+)-?(%a*)$", "%1_%2_%3%4") end, excludes = "*/fuzz/*"}) + add_versions("1.1.1-w", "c543d84c06e909bfa862d5256f6d9dad502352a580b1193ae262874e4be4d7f7") add_versions("1.1.1-t", "9422774f3ce0f9cb4db5d862efbf43b4fcc096b37b4ac7157e7c5172113a8a22") add_patches("1.1.1-t", path.join(os.scriptdir(), "patches", "1.1.1t.diff"), "8009edde46e5577213212ec68f8a40451ceb514fddd892240b1465213b7d2d11") add_versions("1.1.1-s", "aa76dc0488bc67f5c964d085e37a0f5f452e45c68967816a336fa00f537f5cc5") @@ -27,11 +28,16 @@ package("openssl") on_fetch("fetch") on_load(function (package) - if package:is_plat("windows") and (not package.is_built or package:is_built()) then - package:add("deps", "nasm") - -- the perl executable found in GitForWindows will fail to build OpenSSL - -- see https://github.com/openssl/openssl/blob/master/NOTES-PERL.md#perl-on-windows - package:add("deps", "strawberry-perl", { system = false }) + if not package:is_precompiled() then + if package:is_plat("android") and is_subhost("windows") and os.arch() == "x64" then + -- when building for android on windows, use msys2 perl instead of strawberry-perl to avoid configure issue + package:add("deps", "msys2", {configs = {msystem = "MINGW64", base_devel = true}, private = true}) + elseif is_subhost("windows") and not package:is_precompiled() then + package:add("deps", "nasm", { private = true }) + -- the perl executable found in GitForWindows will fail to build OpenSSL + -- see https://github.com/openssl/openssl/blob/master/NOTES-PERL.md#perl-on-windows + package:add("deps", "strawberry-perl", { system = false, private = true }) + end end -- @note we must use package:is_plat() instead of is_plat in description for supporting add_deps("openssl", {host = true}) in python @@ -67,7 +73,10 @@ package("openssl") table.insert(configs, "--prefix=" .. package:installdir()) table.insert(configs, "--openssldir=" .. package:installdir()) os.vrunv("perl", configs) - import("package.tools.nmake").install(package) + + local runenvs = import("package.tools.nmake").buildenvs(package) + local nmake = import("lib.detect.find_tool")("nmake", {envs = runenvs}) + os.vrunv(nmake.program, {"install_sw"}, {envs = runenvs}) end) on_install("mingw", function (package) @@ -99,57 +108,60 @@ package("openssl") import("package.tools.make").make(package, {"install_sw"}) end) - on_install("linux", "macosx", "bsd", function (package) + on_install("linux", "macosx", "bsd", "cross", "android", function (package) -- https://wiki.openssl.org/index.php/Compilation_and_Installation#PREFIX_and_OPENSSLDIR - local buildenvs = import("package.tools.autoconf").buildenvs(package) - local configs = {"--openssldir=" .. package:installdir(), - "--prefix=" .. package:installdir()} + local configs = {} + if package:is_cross() then + local target_plat, target_arch + if package:is_plat("macosx") then + target_plat = "darwin64" + target_arch = package:is_arch("arm64") and "arm64-cc" or "x86_64-cc" + else + target_plat = "linux" + if package:is_arch("x86_64") then + target_arch = "x86_64" + elseif package:is_arch("i386", "x86") then + target_arch = "x86" + elseif package:is_arch("arm64", "arm64-v8a") then + target_arch = "aarch64" + elseif package:is_arch("arm.*") then + target_arch = "armv4" + elseif package:is_arch(".*64") then + target_arch = "generic64" + else + target_arch = "generic32" + end + end + table.insert(configs, target_plat .. "-" .. target_arch) + if package:is_plat("cross", "android") then + table.insert(configs, "-DOPENSSL_NO_HEARTBEATS") + table.insert(configs, "no-threads") + end + end + table.insert(configs, "--openssldir=" .. package:installdir():gsub("\\", "/")) + table.insert(configs, "--prefix=" .. package:installdir():gsub("\\", "/")) table.insert(configs, package:config("shared") and "shared" or "no-shared") if package:debug() then table.insert(configs, "--debug") end - os.vrunv("./config", configs, {envs = buildenvs}) + local buildenvs = import("package.tools.autoconf").buildenvs(package) + if package:is_cross() then + if is_host("windows") and package:is_plat("android") then + buildenvs.CFLAGS = buildenvs.CFLAGS:gsub("\\", "/") + buildenvs.CXXFLAGS = buildenvs.CXXFLAGS:gsub("\\", "/") + buildenvs.CPPFLAGS = buildenvs.CPPFLAGS:gsub("\\", "/") + buildenvs.ASFLAGS = buildenvs.ASFLAGS:gsub("\\", "/") + end + os.vrunv("perl", table.join("./Configure", configs), {envs = buildenvs}) + else + os.vrunv("./config", configs, {shell = true, envs = buildenvs}) + end import("package.tools.make").build(package) import("package.tools.make").make(package, {"install_sw"}) if package:config("shared") then os.tryrm(path.join(package:installdir("lib"), "*.a")) end end) - - on_install("cross", "android", function (package) - - local target_arch = "generic32" - if package:is_arch("x86_64") then - target_arch = "x86_64" - elseif package:is_arch("i386", "x86") then - target_arch = "x86" - elseif package:is_arch("arm64", "arm64-v8a") then - target_arch = "aarch64" - elseif package:is_arch("arm.*") then - target_arch = "armv4" - elseif package:is_arch(".*64") then - target_arch = "generic64" - end - - local target_plat = "linux" - if package:is_plat("macosx") then - target_plat = "darwin64" - target_arch = "x86_64-cc" - end - - local target = target_plat .. "-" .. target_arch - local configs = {target, - "-DOPENSSL_NO_HEARTBEATS", - "no-shared", - "no-threads", - "--openssldir=" .. package:installdir(), - "--prefix=" .. package:installdir()} - local buildenvs = import("package.tools.autoconf").buildenvs(package) - os.vrunv("./Configure", configs, {envs = buildenvs}) - import("package.tools.make").build(package) - import("package.tools.make").make(package, {"install_sw"}) - end) - on_test(function (package) assert(package:has_cfuncs("SSL_new", {includes = "openssl/ssl.h"})) end) diff --git a/packages/o/openssl3/fetch.lua b/packages/o/openssl3/fetch.lua index 7a1885bbd..6b0a61ef7 100644 --- a/packages/o/openssl3/fetch.lua +++ b/packages/o/openssl3/fetch.lua @@ -47,7 +47,10 @@ function _find_package_on_windows(package, opt) if openssl then local version = try {function () return os.iorunv(openssl, {"version"}) end} if version then - result.version = semver.match(version) + version = semver.match(version) + if version then + result.version = version:rawstr() + end end end return result diff --git a/packages/o/openssl3/xmake.lua b/packages/o/openssl3/xmake.lua index 590305396..2c2804973 100644 --- a/packages/o/openssl3/xmake.lua +++ b/packages/o/openssl3/xmake.lua @@ -1,9 +1,10 @@ package("openssl3") - set_homepage("https://www.openssl.org/") set_description("A robust, commercial-grade, and full-featured toolkit for TLS and SSL.") + set_license("Apache-2.0") add_urls("https://github.com/openssl/openssl/archive/refs/tags/openssl-$(version).zip") + add_versions("3.0.7", "fcb37203c6bf7376cfd3aeb0be057937b7611e998b6c0d664abde928c8af3eb7") add_versions("3.0.6", "9b45be41df0d6e9cf9e340a64525177662f22808ac69aee6bfb29c511284dae4") add_versions("3.0.5", "4313c91fb0412e6a600493eb7c59bd555c4ff2ea7caa247a98c8456ad6f9fc74") @@ -20,7 +21,7 @@ package("openssl3") package:add("deps", "nasm") -- the perl executable found in GitForWindows will fail to build OpenSSL -- see https://github.com/openssl/openssl/blob/master/NOTES-PERL.md#perl-on-windows - package:add("deps", "strawberry-perl", { system = false }) + package:add("deps", "strawberry-perl", {system = false}) end -- @note we must use package:is_plat() instead of is_plat in description for supporting add_deps("openssl", {host = true}) in python @@ -43,7 +44,7 @@ package("openssl3") end) on_install("windows", function (package) - local configs = {"Configure"} + local configs = {"Configure", "no-tests"} local target if package:is_arch("x86", "i386") then target = "VC-WIN32" @@ -59,7 +60,10 @@ package("openssl3") table.insert(configs, "--prefix=" .. package:installdir()) table.insert(configs, "--openssldir=" .. package:installdir()) os.vrunv("perl", configs) - import("package.tools.nmake").install(package) + + local runenvs = import("package.tools.nmake").buildenvs(package) + local nmake = import("lib.detect.find_tool")("nmake", {envs = runenvs}) + os.vrunv(nmake.program, {"install_sw"}, {envs = runenvs}) end) on_install("mingw", function (package) diff --git a/packages/o/openvdb/patches/10.1.0/blosc-dep.patch b/packages/o/openvdb/patches/10.1.0/blosc-dep.patch new file mode 100644 index 000000000..dc7dc8b74 --- /dev/null +++ b/packages/o/openvdb/patches/10.1.0/blosc-dep.patch @@ -0,0 +1,31 @@ +diff --git a/cmake/FindBlosc.cmake b/cmake/FindBlosc.cmake +index 5ccf524..65f68c9 100644 +--- a/cmake/FindBlosc.cmake ++++ b/cmake/FindBlosc.cmake +@@ -191,12 +191,12 @@ list(APPEND _BLOSC_LIBRARYDIR_SEARCH_DIRS + # Library suffix handling + + set(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) +-set(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES}) ++# set(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES}) + + if(MSVC) + if(BLOSC_USE_STATIC_LIBS) + set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib") +- set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES};lib") ++ # set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES};lib") + endif() + else() + if(BLOSC_USE_STATIC_LIBS) +@@ -249,9 +249,9 @@ endforeach() + # Reset library suffix + + set(CMAKE_FIND_LIBRARY_SUFFIXES ${_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) +-set(CMAKE_FIND_LIBRARY_PREFIXES ${_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES}) ++# set(CMAKE_FIND_LIBRARY_PREFIXES ${_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES}) + unset(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES) +-unset(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES) ++# unset(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES) + + if(Blosc_LIBRARY_DEBUG AND Blosc_LIBRARY_RELEASE) + # if the generator is multi-config or if CMAKE_BUILD_TYPE is set for diff --git a/packages/o/openvdb/xmake.lua b/packages/o/openvdb/xmake.lua index 5af73da2f..793d3e1d7 100644 --- a/packages/o/openvdb/xmake.lua +++ b/packages/o/openvdb/xmake.lua @@ -2,8 +2,9 @@ package("openvdb") set_homepage("https://www.openvdb.org/") set_description("OpenVDB - Sparse volume data structure and tools") + set_license("MPL-2.0") - add_urls("https://github.com/AcademySoftwareFoundation/openvdb/archive/$(version).tar.gz", + add_urls("https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/$(version).tar.gz", "https://github.com/AcademySoftwareFoundation/openvdb.git") add_versions("v7.1.0", "0c3588c1ca6e647610738654ec2c6aaf41a203fd797f609fbeab1c9f7c3dc116") add_versions("v8.0.1", "a6845da7c604d2c72e4141c898930ac8a2375521e535f696c2cd92bebbe43c4f") @@ -12,9 +13,13 @@ package("openvdb") add_versions("v9.0.0", "ad3816e8f1931d1d6fdbddcec5a1acd30695d049dd10aa965096b2fb9972b468") add_versions("v9.1.0", "914ee417b4607c75c95b53bc73a0599de4157c7d6a32e849e80f24e40fb64181") add_versions("v10.0.1", "887a3391fbd96b20c77914f4fb3ab4b33d26e5fc479aa036d395def5523c622f") + add_versions("v10.1.0", "2746236e29659a0d35ab90d832f7c7987dd2537587a1a2f9237d9c98afcd5817") + add_versions("v11.0.0", "6314ff1db057ea90050763e7b7d7ed86d8224fcd42a82cdbb9c515e001b96c74") + + add_patches(">=10.1.0", "patches/10.1.0/blosc-dep.patch", "a1a5adf4ae2c75c3a3a390b25654dd7785b88d15e459a1620fc0b42b20f81ba0") add_deps("cmake") - add_deps("boost", {system = false, configs = {regex = true, system = true, iostreams = true}}) + add_deps("boost >1.73", {configs = {regex = true, system = true, iostreams = true}}) add_configs("with_houdini", {description = "Location of Houdini installation. Set to enable built with Houdini.", default = "", type = "string"}) add_configs("with_maya", {description = "Location of Maya installation. Set to enable built with Maya.", default = "", type = "string"}) @@ -62,8 +67,17 @@ package("openvdb") on_install("macosx", "linux", "windows|x64", "windows|x86", function (package) io.replace("cmake/FindBlosc.cmake", "${BUILD_TYPE} ${_BLOSC_LIB_NAME}", "${BUILD_TYPE} blosc libblosc", {plain = true}) + io.replace("cmake/FindBlosc.cmake", "lz4 snappy zlib zstd", "lz4", {plain = true}) io.replace("cmake/FindTBB.cmake", "Tbb_${COMPONENT}_LIB_TYPE STREQUAL STATIC", "TRUE", {plain = true}) - local configs = {"-DOPENVDB_BUILD_DOCS=OFF", "-DUSE_PKGCONFIG=OFF", "-DBoost_USE_STATIC_LIBS=ON", "-DUSE_CCACHE=OFF"} + + local configs = { + "-DOPENVDB_BUILD_DOCS=OFF", + "-DUSE_PKGCONFIG=OFF", + "-DBoost_USE_STATIC_LIBS=ON", + "-DUSE_CCACHE=OFF", + "-DBLOSC_USE_EXTERNAL_SOURCES=ON" + } + if package:config("shared") then table.insert(configs, "-DOPENVDB_CORE_SHARED=ON") table.insert(configs, "-DOPENVDB_CORE_STATIC=OFF") @@ -80,6 +94,7 @@ package("openvdb") end table.insert(configs, "-DOPENVDB_BUILD_VDB_LOD=" .. (package:config("lod") and "ON" or "OFF")) table.insert(configs, "-DOPENVDB_BUILD_VDB_PRINT=" .. (package:config("print") and "ON" or "OFF")) + table.insert(configs, "-DOPENVDB_BUILD_BINARIES=" .. (package:config("print") and "ON" or "OFF")) table.insert(configs, "-DOPENVDB_BUILD_VDB_RENDER=" .. (package:config("render") and "ON" or "OFF")) table.insert(configs, "-DOPENVDB_BUILD_VDB_VIEW=" .. (package:config("view") and "ON" or "OFF")) if package:version():ge("10.0") then diff --git a/packages/o/openvr/xmake.lua b/packages/o/openvr/xmake.lua index 7348d2abd..2016835d1 100644 --- a/packages/o/openvr/xmake.lua +++ b/packages/o/openvr/xmake.lua @@ -6,6 +6,7 @@ package("openvr") add_urls("https://github.com/ValveSoftware/openvr/archive/refs/tags/$(version).tar.gz", "https://github.com/ValveSoftware/openvr.git") + add_versions("v2.5.1", "54f654fce001682d8ac608f544a6c41e03a672b005c1deca3579fa36480a537c") add_versions("v1.26.7", "e7391f1129db777b2754f5b017cfa356d7811a7bcaf57f09805b47c2e630a725") add_deps("cmake") diff --git a/packages/o/ordered_map/xmake.lua b/packages/o/ordered_map/xmake.lua index e06399885..05936f16a 100644 --- a/packages/o/ordered_map/xmake.lua +++ b/packages/o/ordered_map/xmake.lua @@ -32,5 +32,5 @@ package("ordered_map") std::cout << "{" << key_value.first << ", " << key_value.second << "}" << std::endl; } } - ]]}, {configs = {languages = "c++11"}, includes = { "tsl/ordered_map.h"} })) + ]]}, {configs = {languages = "c++14"}, includes = { "tsl/ordered_map.h"} })) end) diff --git a/packages/o/ormpp/xmake.lua b/packages/o/ormpp/xmake.lua new file mode 100644 index 000000000..2841cd47d --- /dev/null +++ b/packages/o/ormpp/xmake.lua @@ -0,0 +1,59 @@ +package("ormpp") + + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/qicosmos/ormpp") + set_description("modern C++ ORM, C++17, support mysql, postgresql,sqlite") + set_license("Apache-2.0") + + set_urls("https://github.com/qicosmos/ormpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/qicosmos/ormpp.git") + + add_versions("v0.1.2", "990e88eb176d996cdbbbdfa3e1522b48d135d809f14094771f8d6f02e94573c4") + add_versions("v0.1.1", "a3c93599950a4c5822ebd0750ac7964c59c9b3f84f638525f01578bac6d898c2") + + add_configs("mysql", {description = "Using mysql", default = false, type = "boolean"}) + add_configs("postgresql", {description = "Using postgresql", default = false, type = "boolean"}) + add_configs("sqlite3", {description = "Using sqlite3", default = false, type = "boolean"}) + + on_load(function(package) + local configs = { + mysql = "ORMPP_ENABLE_MYSQL", + postgresql = "ORMPP_ENABLE_PG", + sqlite3 = "ORMPP_ENABLE_SQLITE3" + } + + for config, define in pairs(configs) do + if package:config(config) then + package:add("deps", config) + package:add("defines", define) + end + end + end) + + add_deps("frozen", "iguana") + + on_install(function (package) + if package:version():ge("0.1.2") then + os.vcp("ormpp/*", package:installdir("include")) + else + os.vcp("include/*", package:installdir("include")) + end + end) + + on_test(function (package) + local languages = "c++17" + if package:is_plat("windows") and package:is_arch("arm.*") then + languages = "c++20" + end + + assert(package:check_cxxsnippets({test = [[ + using namespace ormpp; + struct student { + std::string name; + int age; + int id; + }; + REGISTER_AUTO_KEY(student, id) + REFLECTION_WITH_NAME(student, "t_student", id, name, age) + ]]}, {configs = {languages = languages}, includes = {"dbng.hpp"} })) + end) diff --git a/packages/o/ozz-animation/xmake.lua b/packages/o/ozz-animation/xmake.lua new file mode 100644 index 000000000..10d87e482 --- /dev/null +++ b/packages/o/ozz-animation/xmake.lua @@ -0,0 +1,56 @@ +package("ozz-animation") + set_homepage("http://guillaumeblanc.github.io/ozz-animation/") + set_description("Open source c++ skeletal animation library and toolset") + set_license("MIT") + + add_urls("https://github.com/guillaumeblanc/ozz-animation/archive/refs/tags/$(version).tar.gz", + "https://github.com/guillaumeblanc/ozz-animation.git") + + add_versions("0.15.0", "2a995b921e4244c419f1c3a4dc4aa0805c0dc40fa32244a24cf64125e87161ae") + add_versions("0.14.3", "1ab7d2fbf4c5a79aafac43cbd41ac9cff1e7f750248bee5141da5ee2d893cefe") + add_versions("0.14.2", "52938e5a699b2c444dfeb2375facfbb7b1e3d405b424e361ad1a27391a53b89a") + + add_configs("fbx", {description = "Build Fbx pipeline (Requires Fbx SDK)", default = false, type = "boolean"}) + add_configs("gltf", {description = "Build glTF importer", default = false, type = "boolean"}) + add_configs("data", {description = "Build data on code change", default = false, type = "boolean"}) + add_configs("simd_ref", {description = "Force SIMD math reference implementation", default = false, type = "boolean"}) + add_configs("postfix", {description = "Use per config postfix name", default = false, type = "boolean"}) + + add_deps("cmake") + + add_links("ozz_animation", "ozz_animation_offline", "ozz_geometry", "ozz_options", "ozz_base") + + on_install(function (package) + if package:is_plat("windows") and package:is_arch("arm.*") then + io.replace("build-utils/cmake/compiler_settings.cmake", "add_compile_options(/WX)", "", {plain = true}) + end + + local configs = + { + "-Dozz_build_tools=OFF", + "-Dozz_build_samples=OFF", + "-Dozz_build_tests=OFF", + "-Dozz_build_howtos=OFF", + "-Dozz_run_tests_headless=OFF", + } + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-Dozz_build_msvc_rt_dll=" .. (package:has_runtime("MD", "MDd") and "ON" or "OFF")) + end + for name, enabled in pairs(package:configs()) do + if not package:extraconf("configs", name, "builtin") then + table.insert(configs, "-Dozz_build_" .. name .. "=" .. (enabled and "ON" or "OFF")) + end + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + auto x = ozz::animation::Animation(); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/p/pahomqttc/xmake.lua b/packages/p/pahomqttc/xmake.lua new file mode 100644 index 000000000..d5e740fbd --- /dev/null +++ b/packages/p/pahomqttc/xmake.lua @@ -0,0 +1,25 @@ +package("pahomqttc") + set_homepage("https://github.com/eclipse/paho.mqtt.c") + set_description("Eclipse Paho MQTT C Client Library") + set_license("MIT") + + add_urls("https://github.com/eclipse/paho.mqtt.c/archive/refs/tags/$(version).zip", + "https://github.com/eclipse/paho.mqtt.c.git") + + add_versions("v1.3.13", "5ba7c7ab7ebb1499938fa2e358e6c1f9a926b270f2bf082acf89d59b4771a132") + + add_deps("cmake") + + on_install("windows", "linux", "macosx", function (package) + local configs = {"-DPAHO_BUILD_SAMPLES=FALSE", + "-DPAHO_WITH_SSL=FALSE", + "-DPAHO_BUILD_DOCUMENTATION=FALSE"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("MQTTClient_connect", {includes = "MQTTClient.h"})) + end) +package_end() \ No newline at end of file diff --git a/packages/p/pahomqttcpp/xmake.lua b/packages/p/pahomqttcpp/xmake.lua new file mode 100644 index 000000000..801a76120 --- /dev/null +++ b/packages/p/pahomqttcpp/xmake.lua @@ -0,0 +1,46 @@ +package("pahomqttcpp") + set_homepage("https://github.com/eclipse/paho.mqtt.cpp") + set_description("Eclipse Paho MQTT C++ Client Library") + set_license("EPL v1.0") + + add_urls("https://github.com/eclipse/paho.mqtt.cpp/archive/refs/tags/$(version).zip", + "https://github.com/eclipse/paho.mqtt.cpp.git") + + add_versions("v1.3.2", "e01f43cf0ba35efa666503c7adb2786d4a6f7fe6eb44ce5311ac4785a0ce8a98") + add_versions("v1.2.0", "90c4d8ae4f56bb706120fddcc5937cd0a0360b6f39d5cd5574a5846c0f923473") + + add_deps("cmake") + add_deps("pahomqttc") + + on_install("windows", "linux", "macosx", function (package) + + local configs = {"-DPAHO_WITH_SSL=FALSE"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + + if package:is_plat("windows") then + local pahomqttc = package:dep("pahomqttc"):fetch() + + local includedirs = pahomqttc.includedirs or pahomqttc.sysincludedirs + if includedirs and #includedirs > 0 then + table.insert(configs, "-DPAHO_MQTT_C_INCLUDE_DIRS=" .. table.concat(includedirs, " ")) + end + + local libfiles = pahomqttc.libfiles + if libfiles then + table.insert(configs, "-DPAHO_MQTT_C_LIBRARIES=" .. table.concat(libfiles, " ")) + end + end + + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + mqtt::client cli{"localhost", "some_id"}; + cli.connect(); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/p/pango/xmake.lua b/packages/p/pango/xmake.lua index 9586467e1..c40400e24 100644 --- a/packages/p/pango/xmake.lua +++ b/packages/p/pango/xmake.lua @@ -4,27 +4,32 @@ package("pango") set_description("Framework for layout and rendering of i18n text") set_license("LGPL-2.0") - set_urls("https://gitlab.gnome.org/GNOME/pango/-/archive/$(version)/pango-$(version).tar.gz") + add_urls("https://gitlab.gnome.org/GNOME/pango/-/archive/$(version)/pango-$(version).tar.gz") add_urls("https://gitlab.gnome.org/GNOME/pango.git") - + add_versions("1.51.1", "ea92cd570cdba62ca52cc0a7c9ea3cd311b6da3f0328a5aa8a4a81b0a74944a5") add_versions("1.50.3", "4a8b0cf33d5f9ecaa9cd99dd72703d5c4c53bc58df64dd9538493bb4356ab691") add_deps("meson", "ninja") - add_deps("fontconfig", "freetype", "harfbuzz", "fribidi", "cairo", "glib") - if is_plat("macosx") then + add_deps("fontconfig", "freetype", "fribidi", "glib", "pcre2") + add_deps("harfbuzz", "cairo", {configs = {glib = true}}) + if is_plat("windows") then + add_deps("libintl") + elseif is_plat("macosx") then + add_deps("libintl") + add_deps("libiconv", {system = true}) add_extsources("brew::pango") add_frameworks("CoreFoundation") elseif is_plat("linux") then + add_deps("libiconv") add_deps("xorgproto") add_extsources("apt::libpango-1.0-0", "pacman::pango") end add_includedirs("include", "include/pango-1.0") - on_install("macosx", "linux", function (package) + on_install("windows|x64", "windows|x86", "macosx", "linux", function (package) import("package.tools.meson") local configs = {"-Dintrospection=disabled", "-Dgtk_doc=false", "-Dfontconfig=enabled"} - - table.insert(configs, "-Ddebug=" .. (package:debug() and "true" or "false")) + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) io.gsub("meson.build", "subdir%('tests'%)", "") io.gsub("meson.build", "subdir%('fuzzing'%)", "") @@ -37,7 +42,15 @@ package("pango") io.replace("meson.build", "dependency('gi-docgen'", "dependency(''", {plain = true}) io.replace("meson.build", "fallback: ['gi-docgen', 'dummy_dep']", "fallback: ['dummy_dep']", {plain = true}) - meson.install(package, configs, {packagedeps = {"fontconfig", "freetype", "harfbuzz", "fribidi", "cairo", "glib"}}) + -- fix unexpected -Werror=unused-but-set-variable errors, see https://gitlab.gnome.org/GNOME/pango/-/issues/693 + io.replace("meson.build", "'-Werror=unused-but-set-variable',", "", {plain = true}) + -- fix unexpected -Werror=array-bounds errors, see https://gitlab.gnome.org/GNOME/pango/-/issues/740 + io.replace("meson.build", "'-Werror=array-bounds',", "", {plain = true}) + + local envs = meson.buildenvs(package, {packagedeps = {"fontconfig", "freetype", "harfbuzz", "fribidi", "cairo", "glib", "pcre2", "libintl", "libiconv"}}) + -- workaround for https://github.com/xmake-io/xmake/issues/4412 + envs.LDFLAGS = string.gsub(envs.LDFLAGS, "%-libpath:", "/libpath:") + meson.install(package, configs, {envs = envs}) end) on_test(function (package) diff --git a/packages/p/parallel-hashmap/xmake.lua b/packages/p/parallel-hashmap/xmake.lua index 27b300276..8a046c546 100644 --- a/packages/p/parallel-hashmap/xmake.lua +++ b/packages/p/parallel-hashmap/xmake.lua @@ -7,6 +7,8 @@ package("parallel-hashmap") add_urls("https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/$(version).tar.gz", "https://github.com/greg7mdp/parallel-hashmap.git") + add_versions("v1.3.12","0cc203144321924cfbfcc401f42d8204c0dd24e2760c7a1c091baa16d9777c08") + add_versions("1.37", "2ac652be0552fcb53a1163c08c1f28f29f0756594fcc587eebb4d8b363153709") add_versions("1.35", "308ab6f92e4c6f49304562e352890cf7140de85ce723c097e74fbdec88e0e1ce") add_versions("1.34", "da4939f5948229abe58acc833b111862411d45669310239b8a163bb73d0197aa") add_versions("1.33", "f6e4d0508c4d935fa25dcbaec63fbe0d7503435797e275ec109e8a3f1462a4cd") diff --git a/packages/p/partio/xmake.lua b/packages/p/partio/xmake.lua index 87e9055f7..87dba0e95 100644 --- a/packages/p/partio/xmake.lua +++ b/packages/p/partio/xmake.lua @@ -6,8 +6,10 @@ package("partio") add_urls("https://github.com/wdas/partio/archive/refs/tags/$(version).tar.gz", "https://github.com/wdas/partio.git") + add_versions("v1.17.3", "08a571ca75cf133f373415dfd50b7d0e33a0dd1811dfb63409f0ae46652033c1") add_versions("v1.14.0", "f98874b781e92ab9b5d0575cabc437d27274cd91cb581f80960918efa491f902") add_versions("v1.14.6", "53a5754d6b2fc3e184953d985c233118ef0ab87169f34e3aec4a7e6d20cd9bd4") + add_versions("v1.17.1", "5d00fbfc55817acb310bcaf61212a78b2c602e08b839060dfee69570b4b82464") if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) @@ -30,7 +32,7 @@ package("partio") io.gsub("CMakeLists.txt", "find%_package%(GLUT REQUIRED%)", "find_package(GLUT)") io.gsub("CMakeLists.txt", "find%_package%(OpenGL REQUIRED%)", "find_package(OpenGL)") io.gsub("CMakeLists.txt", "find%_package%(Python(.-) REQUIRED%)", "find_package(Python%1)") - local configs = {"-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON"} + local configs = {"-DPARTIO_GTEST_ENABLED=OFF", "-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DPARTIO_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=" .. (package:config("python") and "OFF" or "ON")) diff --git a/packages/p/patch/xmake.lua b/packages/p/patch/xmake.lua index 4082f98ab..f5c82bbfa 100644 --- a/packages/p/patch/xmake.lua +++ b/packages/p/patch/xmake.lua @@ -9,7 +9,8 @@ package("patch") add_urls("https://github.com/xmake-mirror/patch/releases/download/v2.5.9/patch-$(version)-bin.zip") add_versions("2.5.9-7", "fabd6517e7bd88e067db9bf630d69bb3a38a08e044fa73d13a704ab5f8dd110b") else - add_urls("https://ftp.gnu.org/gnu/patch/patch-$(version).tar.bz2", + add_urls("https://ftpmirror.gnu.org/gnu/patch/patch-$(version).tar.bz2", + "https://ftp.gnu.org/gnu/patch/patch-$(version).tar.bz2", "https://github.com/xmake-mirror/patch/releases/download/v$(version)/patch-$(version).tar.bz2") add_versions("2.7.6", "3d1d001210d76c9f754c12824aa69f25de7cb27bb6765df63455b77601a0dcc9") end diff --git a/packages/p/paul_thread_pool/xmake.lua b/packages/p/paul_thread_pool/xmake.lua new file mode 100644 index 000000000..1b69246e6 --- /dev/null +++ b/packages/p/paul_thread_pool/xmake.lua @@ -0,0 +1,24 @@ +package("paul_thread_pool") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/DeveloperPaul123/thread-pool") + set_description("A modern, fast, lightweight thread pool library based on C++20") + set_license("MIT") + + add_urls("https://github.com/DeveloperPaul123/thread-pool/archive/refs/tags/$(version).zip") + add_versions("0.6.2", "a2b722560449da53faf4753288a5fb2074d88b1fa9bba257c85425b3e48ecb2c") + + on_install("windows", "linux", "macosx", "mingw", function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + + void test() + { + dp::thread_pool pool; + } + ]]}, {configs = {languages = "c++20"}})) + end) diff --git a/packages/p/pca9685/xmake.lua b/packages/p/pca9685/xmake.lua new file mode 100644 index 000000000..d38a7f079 --- /dev/null +++ b/packages/p/pca9685/xmake.lua @@ -0,0 +1,30 @@ +package("pca9685") + set_homepage("https://github.com/chaoticmachinery/pca9685") + set_description("PCA9685 C++ Library. Works with SunFounder") + set_license("LGPL-2.1") + + set_urls("https://github.com/chaoticmachinery/pca9685.git") + + add_versions("2017.12.07", "6f9794d888f77b863884c3eac933b75a07101347") + + on_install("linux", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + target("pca9685") + set_kind("$(kind)") + set_languages("c++11") + add_files("PCA9685.cpp") + add_headerfiles("PCA9685.h") + ]]) + local configs = {} + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "PCA9685.h" + void test() { + PCA9685 pwm; + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/p/pciutils/xmake.lua b/packages/p/pciutils/xmake.lua index 4e248e4e9..c5e379e64 100644 --- a/packages/p/pciutils/xmake.lua +++ b/packages/p/pciutils/xmake.lua @@ -6,6 +6,7 @@ package("pciutils") add_urls("https://mj.ucw.cz/download/linux/pci/pciutils-$(version).tar.gz") add_versions("3.7.0", "08c27e01030d1fcc700d02bc2ea66c638f58a3d150e45e58852aa82ad4160d84") + add_versions("3.10.0", "7deabe38ae5fa88a96a8c4947975cf31c591506db546e9665a10dddbf350ead0") if is_plat("macosx") then add_frameworks("IOKit") diff --git a/packages/p/pcl/xmake.lua b/packages/p/pcl/xmake.lua index 50be9859b..a9e6a1d62 100644 --- a/packages/p/pcl/xmake.lua +++ b/packages/p/pcl/xmake.lua @@ -8,6 +8,7 @@ package("pcl") "https://github.com/PointCloudLibrary/pcl.git") add_versions("1.12.0", "21dfa9a268de9675c1f94d54d9402e4e02120a0aa4215d064436c52b7d5bd48f") add_versions("1.12.1", "dc0ac26f094eafa7b26c3653838494cc0a012bd1bdc1f1b0dc79b16c2de0125a") + add_versions("1.14.0", "de297b929eafcb93747f12f98a196efddf3d55e4edf1b6729018b436d5be594d") add_configs("vtk", {description = "Build with vtk.", default = false, type = "boolean"}) add_configs("cuda", {description = "Build with cuda.", default = false, type = "boolean"}) @@ -33,7 +34,7 @@ package("pcl") io.replace("cmake/pcl_options.cmake", "set(CMAKE_FIND_LIBRARY_SUFFIXES", "#set(CMAKE_FIND_LIBRARY_SUFFIXES", {plain = true}) end - local configs = {"-DWITH_OPENGL=OFF", "-DWITH_PCAP=OFF", "-DWITH_QT=OFF", "-DBoost_USE_STATIC_LIBS=ON", "-DPCL_ALLOW_BOTH_SHARED_AND_STATIC_DEPENDENCIES=ON"} + local configs = {"-DWITH_OPENGL=OFF", "-DWITH_PCAP=OFF", "-DWITH_QT=OFF", "-DWITH_LIBUSB=OFF", "-DBoost_USE_STATIC_LIBS=ON", "-DPCL_ALLOW_BOTH_SHARED_AND_STATIC_DEPENDENCIES=ON"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DPCL_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DWITH_VTK=" .. (package:config("vtk") and "ON" or "OFF")) diff --git a/packages/p/pcre2/xmake.lua b/packages/p/pcre2/xmake.lua index 55c613d20..8081a3c2e 100644 --- a/packages/p/pcre2/xmake.lua +++ b/packages/p/pcre2/xmake.lua @@ -4,6 +4,7 @@ package("pcre2") set_description("A Perl Compatible Regular Expressions Library") set_urls("https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$(version)/pcre2-$(version).tar.gz") + add_versions("10.42", "c33b418e3b936ee3153de2c61cc638e7e4fe3156022a5c77d0711bcbb9d64f1f") add_versions("10.40", "ded42661cab30ada2e72ebff9e725e745b4b16ce831993635136f2ef86177724") add_versions("10.39", "0781bd2536ef5279b1943471fdcdbd9961a2845e1d2c9ad849b9bd98ba1a9bd4") @@ -20,11 +21,8 @@ package("pcre2") if package:is_plat("windows") and package:debug() then suffix = "d" end - if package:version():ge("10.39") and package:is_plat("windows") and not package:config("shared") then - package:add("links", "pcre2-" .. bitwidth .. "-static" .. suffix) - else - package:add("links", "pcre2-" .. bitwidth .. suffix) - end + package:add("links", "pcre2-posix" .. suffix) + package:add("links", "pcre2-" .. bitwidth .. suffix) package:add("defines", "PCRE2_CODE_UNIT_WIDTH=" .. bitwidth) if not package:config("shared") then package:add("defines", "PCRE2_STATIC") @@ -35,9 +33,12 @@ package("pcre2") if package:version():lt("10.21") then io.replace("CMakeLists.txt", [[SET(CMAKE_C_FLAGS -I${PROJECT_SOURCE_DIR}/src)]], [[SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${PROJECT_SOURCE_DIR}/src")]], {plain = true}) end + io.replace("CMakeLists.txt", "OUTPUT_NAME pcre2%-(%w-)%-static", "OUTPUT_NAME pcre2-%1") local configs = {"-DPCRE2_BUILD_TESTS=OFF", "-DPCRE2_BUILD_PCRE2GREP=OFF"} + table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DPCRE2_SUPPORT_JIT=" .. (package:config("jit") and "ON" or "OFF")) + table.insert(configs, "-DPCRE2_STATIC_PIC=" .. (package:config("pic") and "ON" or "OFF")) local bitwidth = package:config("bitwidth") or "8" if bitwidth ~= "8" then table.insert(configs, "-DPCRE2_BUILD_PCRE2_8=OFF") diff --git a/packages/p/pdcursesmod/xmake.lua b/packages/p/pdcursesmod/xmake.lua index b2a55e352..a8f7e3e85 100644 --- a/packages/p/pdcursesmod/xmake.lua +++ b/packages/p/pdcursesmod/xmake.lua @@ -1,78 +1,79 @@ -package("pdcursesmod") - set_homepage("https://projectpluto.com/win32a.htm") - set_description("PDCurses Modified - a curses library modified and extended from the 'official' pdcurses") - - add_urls("https://github.com/Bill-Gray/PDCursesMod/archive/refs/tags/$(version).tar.gz", - "https://github.com/Bill-Gray/PDCursesMod.git") - add_versions("v4.3.4", "abbd099a51612200d1bfe236d764e0f0748ee71c3a6bc2c4069447d907d55b82") - - if not is_plat("windows") then - add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) - end - - add_configs("port", {description = "Set the target port.", default = "sdl2", values = {"sdl2", "wincon"}}) - add_configs("utf8", {description = "Treat all narrow characters as UTF-8.", default = true, type = "boolean"}) - - if is_plat("windows", "mingw") then - add_syslinks("user32", "advapi32", "winmm") - end - - on_load(function (package) - if package:config("port") == "sdl2" then - package:add("deps", "libsdl") - if package:config("utf8") then - package:add("deps", "libsdl_ttf") - end - end - if package:config("utf8") then - package:add("defines", "PDC_WIDE", "PDC_FORCE_UTF8") - end - if package:config("shared") then - package:add("defines", "PDC_DLL_BUILD") - end - end) - - on_install("linux", "macosx", "mingw", "windows", function (package) - io.writefile("xmake.lua", [[ - add_rules("mode.debug", "mode.release") - option("port", {description = "Set the target port."}) - option("utf8", {description = "Treat all narrow characters as UTF-8."}) - add_defines("PDC_WIDE", "PDC_FORCE_UTF8") - if is_config("port", "sdl2") then - add_requires("libsdl") - if has_config("utf8") then - add_requires("libsdl_ttf") - end - end - target("pdcursesmod") - set_kind("$(kind)") - add_files("pdcurses/*.c", "$(port)/*.c") - add_includedirs(".", "$(port)") - add_headerfiles("*.h", "$(port)/*.h") - if is_kind("shared") then - add_defines("PDC_DLL_BUILD") - end - add_packages("libsdl", "libsdl_ttf") - if is_plat("windows", "mingw") then - add_syslinks("user32", "advapi32", "winmm") - end - ]]) - local configs = {} - if package:config("shared") then - configs.kind = "shared" - end - configs.port = package:config("port") - configs.utf8 = package:config("utf8") - import("package.tools.xmake").install(package, configs) - end) - - on_test(function (package) - assert(package:check_csnippets([[ - void test(void) { - initscr(); - printw("Hello, world!"); - refresh(); - endwin(); - } - ]], {includes = "curses.h"})) - end) +package("pdcursesmod") + set_homepage("https://projectpluto.com/win32a.htm") + set_description("PDCurses Modified - a curses library modified and extended from the 'official' pdcurses") + + add_urls("https://github.com/Bill-Gray/PDCursesMod/archive/refs/tags/$(version).tar.gz", + "https://github.com/Bill-Gray/PDCursesMod.git") + add_versions("v4.4.0", "a53bf776623decb9e4b2c2ffe43e52d83fe4455ffd20229b4ba36c92918f67dd") + add_versions("v4.3.4", "abbd099a51612200d1bfe236d764e0f0748ee71c3a6bc2c4069447d907d55b82") + + if not is_plat("windows") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_configs("port", {description = "Set the target port.", default = "sdl2", values = {"sdl2", "wincon"}}) + add_configs("utf8", {description = "Treat all narrow characters as UTF-8.", default = true, type = "boolean"}) + + if is_plat("windows", "mingw") then + add_syslinks("user32", "advapi32", "winmm") + end + + on_load(function (package) + if package:config("port") == "sdl2" then + package:add("deps", "libsdl") + if package:config("utf8") then + package:add("deps", "libsdl_ttf") + end + end + if package:config("utf8") then + package:add("defines", "PDC_WIDE", "PDC_FORCE_UTF8") + end + if package:config("shared") then + package:add("defines", "PDC_DLL_BUILD") + end + end) + + on_install("linux", "macosx", "mingw", "windows", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + option("port", {description = "Set the target port."}) + option("utf8", {description = "Treat all narrow characters as UTF-8."}) + add_defines("PDC_WIDE", "PDC_FORCE_UTF8") + if is_config("port", "sdl2") then + add_requires("libsdl") + if has_config("utf8") then + add_requires("libsdl_ttf") + end + end + target("pdcursesmod") + set_kind("$(kind)") + add_files("pdcurses/*.c", "$(port)/*.c") + add_includedirs(".", "$(port)") + add_headerfiles("*.h", "$(port)/*.h") + if is_kind("shared") then + add_defines("PDC_DLL_BUILD") + end + add_packages("libsdl", "libsdl_ttf") + if is_plat("windows", "mingw") then + add_syslinks("user32", "advapi32", "winmm") + end + ]]) + local configs = {} + if package:config("shared") then + configs.kind = "shared" + end + configs.port = package:config("port") + configs.utf8 = package:config("utf8") + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_csnippets([[ + void test(void) { + initscr(); + printw("Hello, world!"); + refresh(); + endwin(); + } + ]], {includes = "curses.h"})) + end) diff --git a/packages/p/pdfhummus/xmake.lua b/packages/p/pdfhummus/xmake.lua index bb767dfb9..cde77230a 100644 --- a/packages/p/pdfhummus/xmake.lua +++ b/packages/p/pdfhummus/xmake.lua @@ -6,6 +6,9 @@ package("pdfhummus") add_urls("https://github.com/galkahana/PDF-Writer/archive/refs/tags/$(version).tar.gz", "https://github.com/galkahana/PDF-Writer/archive/refs/tags/v$(version).tar.gz", "https://github.com/galkahana/PDF-Writer.git") + add_versions("v4.6.3", "3b5d9ba4b49d0380678e8172f27cdb8eda196ea448e7f1cdd79620066d082ab9") + add_versions("v4.6.2", "0a36815ccc9d207028567f90039785c824b211169ba5da68de84d0c15455ab62") + add_versions("v4.6.1", "6e95fcb26ec679fa12ce6638d35a591e80960b35956a142d9a80b9a8c80ca824") add_versions("v4.5.10", "c185707d0ec87da390a1c458a191327b82404184f9ef57d4680831f894b01d84") add_versions("v4.5.9", "a875e3466227e99191a665240503842865967fe5c0a450190a5a967a29be0d14") add_versions("v4.5.8", "b19b4853774551d34187087aaafa89fcba69215acbb4747dbdf0025a3f780b89") diff --git a/packages/p/pegtl/xmake.lua b/packages/p/pegtl/xmake.lua index 9805157f2..44394627f 100644 --- a/packages/p/pegtl/xmake.lua +++ b/packages/p/pegtl/xmake.lua @@ -7,6 +7,7 @@ package("pegtl") add_urls("https://github.com/taocpp/PEGTL/archive/refs/tags/$(version).tar.gz", "https://github.com/taocpp/PEGTL.git") + add_versions("3.2.7", "d6cd113d8bd14e98bcbe7b7f8fc1e1e33448dc359e8cd4cca30e034ec2f0642d") add_versions("3.2.2", "c6616275e78c618c016b79054eed0a0bdf4c1934f830d3ab33d3c3dac7320b03") add_versions("3.2.5", "4ecefe4151b14684a944dde57e68c98e00224e5fea055c263e1bfbed24a99827") diff --git a/packages/p/picobench/xmake.lua b/packages/p/picobench/xmake.lua new file mode 100644 index 000000000..75f1cca14 --- /dev/null +++ b/packages/p/picobench/xmake.lua @@ -0,0 +1,30 @@ +package("picobench") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/iboB/picobench") + set_description("A micro microbenchmarking library for C++11 in a single header file") + set_license("MIT") + + add_urls("https://github.com/iboB/picobench/archive/refs/tags/v$(version).tar.gz") + add_versions("2.07", "c7f8e279cd5138a66a9a417caf1012ed7b15ba2652aec96ef8dd5e6e3e07d7a0") + add_versions("2.06", "2f5d9b53260322b422a1834bbbe4947109039ee518353a8cc8dd57bbd1999b57") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include "picobench/picobench.hpp" + static void rand_vector(picobench::state& s) + { + std::vector v; + for (auto _ : s) + { + v.push_back(rand()); + } + } + PICOBENCH(rand_vector); // Register the above function with picobench + ]]})) + end) diff --git a/packages/p/pigpio/xmake.lua b/packages/p/pigpio/xmake.lua new file mode 100644 index 000000000..39f3e8a2a --- /dev/null +++ b/packages/p/pigpio/xmake.lua @@ -0,0 +1,28 @@ +package("pigpio") + set_homepage("https://github.com/joan2937/pigpio") + set_description("pigpio is a C library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO).") + + add_urls("https://github.com/joan2937/pigpio/archive/refs/tags/$(version).tar.gz", + "https://github.com/joan2937/pigpio.git") + + add_versions("v79", "c5337c0b7ae888caf0262a6f476af0e2ab67065f7650148a0b21900b8d1eaed7") + + add_syslinks("pthread") + + add_deps("cmake") + + on_install("linux", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + gpioSetMode(0, PI_INPUT); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/p/pixman/xmake.lua b/packages/p/pixman/xmake.lua index de26cc5bd..1d35df61c 100644 --- a/packages/p/pixman/xmake.lua +++ b/packages/p/pixman/xmake.lua @@ -3,17 +3,19 @@ package("pixman") set_homepage("https://cairographics.org/") set_description("Low-level library for pixel manipulation.") - add_urls("https://cairographics.org/releases/pixman-$(version).tar.gz", {alias = "cairographics"}) + add_urls("https://cairographics.org/releases/pixman-$(version).tar.gz", {alias = "home"}) + add_urls("https://www.x.org/archive/individual/lib/pixman-$(version).tar.gz", {alias = "home"}) add_urls("https://gitlab.freedesktop.org/pixman/pixman/-/archive/pixman-$(version)/pixman-pixman-$(version).tar.gz", {alias = "git_release"}) add_urls("https://github.com/freedesktop/pixman/archive/refs/tags/pixman-$(version).tar.gz", {alias = "git_release"}) add_urls("https://gitlab.freedesktop.org/pixman/pixman.git") add_urls("https://github.com/freedesktop/pixman.git") add_versions("git_release:0.40.0", "3a68a28318a78fffc61603c8385bb0010c3fb23d17cd1285d36a7148c87a3b91") - add_versions("cairographics:0.40.0", "6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc") + add_versions("home:0.40.0", "6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc") add_versions("git_release:0.42.0", "45c6462f6d6441923d4c17d06fa50ce066f0ceff0fc84af8d342df63c1079151") - add_versions("cairographics:0.42.0", "07f74c8d95e4a43eb2b08578b37f40b7937e6c5b48597b3a0bb2c13a53f46c13") + add_versions("home:0.42.0", "07f74c8d95e4a43eb2b08578b37f40b7937e6c5b48597b3a0bb2c13a53f46c13") add_versions("git_release:0.42.2", "4191a5084bae000a61e3513b06027b6f8f559d17d61769ed9de27dfb0cec8699") - add_versions("cairographics:0.42.2", "ea1480efada2fd948bc75366f7c349e1c96d3297d09a3fe62626e38e234a625e") + add_versions("home:0.42.2", "ea1480efada2fd948bc75366f7c349e1c96d3297d09a3fe62626e38e234a625e") + add_versions("home:0.43.2", "ea79297e5418fb528d0466e8b5b91d1be88857fa3706f49777b2925a72ae9924") if is_plat("wasm") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) diff --git a/packages/p/pkgconf/xmake.lua b/packages/p/pkgconf/xmake.lua index 72615fdcf..a60dc0f67 100644 --- a/packages/p/pkgconf/xmake.lua +++ b/packages/p/pkgconf/xmake.lua @@ -3,18 +3,21 @@ package("pkgconf") set_homepage("http://pkgconf.org") set_description("A program which helps to configure compiler and linker flags for development frameworks.") - add_urls("https://distfiles.ariadne.space/pkgconf/pkgconf-$(version).tar.xz", {alias = "tarball"}) + add_urls("https://distfiles.dereferenced.org/pkgconf/pkgconf-$(version).tar.xz", + "https://distfiles.ariadne.space/pkgconf/pkgconf-$(version).tar.xz", {alias = "tarball"}) add_urls("https://github.com/pkgconf/pkgconf.git", {alias = "git"}) add_versions("tarball:1.7.4", "d73f32c248a4591139a6b17777c80d4deab6b414ec2b3d21d0a24be348c476ab") add_versions("tarball:1.8.0", "ef9c7e61822b7cb8356e6e9e1dca58d9556f3200d78acab35e4347e9d4c2bbaf") add_versions("tarball:1.9.3", "5fb355b487d54fb6d341e4f18d4e2f7e813a6622cf03a9e87affa6a40565699d") add_versions("tarball:1.9.4", "daccf1bbe5a30d149b556c7d2ffffeafd76d7b514e249271abdd501533c1d8ae") add_versions("tarball:1.9.5", "1ac1656debb27497563036f7bffc281490f83f9b8457c0d60bcfb638fb6b6171") + add_versions("tarball:2.0.3", "cabdf3c474529854f7ccce8573c5ac68ad34a7e621037535cbc3981f6b23836c") add_versions("git:1.7.4", "pkgconf-1.7.4") add_versions("git:1.8.0", "pkgconf-1.8.0") add_versions("git:1.9.3", "pkgconf-1.9.3") add_versions("git:1.9.4", "pkgconf-1.9.4") add_versions("git:1.9.5", "pkgconf-1.9.5") + add_versions("git:2.0.3", "pkgconf-2.0.3") on_load(function (package) if not package:is_precompiled() and is_host("windows") then diff --git a/packages/p/platformfolders/patches/4.2.0/cmake-install.patch b/packages/p/platformfolders/patches/4.2.0/cmake-install.patch new file mode 100644 index 000000000..18ed3ac7b --- /dev/null +++ b/packages/p/platformfolders/patches/4.2.0/cmake-install.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5ae2017..30e2045 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -83,6 +83,7 @@ if(PLATFORMFOLDERS_ENABLE_INSTALL) + EXPORT "platform_foldersConfig" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + # Tells it where to put the header files + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sago" + ) diff --git a/packages/p/platformfolders/xmake.lua b/packages/p/platformfolders/xmake.lua new file mode 100644 index 000000000..d206db613 --- /dev/null +++ b/packages/p/platformfolders/xmake.lua @@ -0,0 +1,35 @@ +package("platformfolders") + set_homepage("https://github.com/sago007/PlatformFolders") + set_description([[A C++ library to look for special directories like "My Documents" and "%APPDATA%" so that you do not need to write Linux, Windows or Mac OS X specific code]]) + set_license("MIT") + + add_urls("https://github.com/sago007/PlatformFolders/archive/refs/tags/$(version).tar.gz", + "https://github.com/sago007/PlatformFolders.git") + + add_versions("4.2.0", "31bb0f64a27315aec8994f226332aaafe9888d00bb69a2ff2dff9912e2f4ccf4") + + add_patches("4.2.0", "patches/4.2.0/cmake-install.patch", "a38850ff7e9b91034f226685af7633ff692de3aea4798cb3dddecc6b055a7601") + + if is_plat("windows", "mingw") then + add_syslinks("ole32", "shell32", "uuid") + end + + add_deps("cmake") + + on_install(function (package) + local configs = {"-DPLATFORMFOLDERS_BUILD_TESTING=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") and package:config("shared") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + sago::getConfigHome(); + } + ]]}, {configs = {languages = "c++11"}, includes = "sago/platform_folders.h"})) + end) diff --git a/packages/p/plf_colony/xmake.lua b/packages/p/plf_colony/xmake.lua index 7afdaa887..df2831566 100644 --- a/packages/p/plf_colony/xmake.lua +++ b/packages/p/plf_colony/xmake.lua @@ -5,7 +5,7 @@ package("plf_colony") set_license("zlib") add_urls("https://github.com/mattreecebentley/plf_colony.git") - add_versions("2023.08.25", "394c787ecf5a541b66d08b90f22cebc954f0599c") + add_versions("v7.41", "abb0aa6525a3dae56aacf50899517f47e7036016") on_install(function (package) os.cp("plf_colony.h", package:installdir("include")) diff --git a/packages/p/plf_hive/xmake.lua b/packages/p/plf_hive/xmake.lua new file mode 100644 index 000000000..5dbba3c26 --- /dev/null +++ b/packages/p/plf_hive/xmake.lua @@ -0,0 +1,16 @@ +package("plf_hive") + set_kind("library", {headeronly = true}) + set_homepage("https://plflib.org/colony.htm") + set_description("plf::hive is a fork of plf::colony to match the current C++ standards proposal.") + set_license("zlib") + + add_urls("https://github.com/mattreecebentley/plf_hive.git") + add_versions("2024.04.21", "7689475b1fa2a95228cf0f44db9c209d7e430748") + + on_install(function (package) + os.cp("plf_hive.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:has_cxxtypes("plf::hive", {configs = {languages = "c++20"}, includes = "plf_hive.h"})) + end) diff --git a/packages/p/plf_indiesort/xmake.lua b/packages/p/plf_indiesort/xmake.lua new file mode 100644 index 000000000..37f5dd9e5 --- /dev/null +++ b/packages/p/plf_indiesort/xmake.lua @@ -0,0 +1,23 @@ +package("plf_indiesort") + set_kind("library", {headeronly = true}) + set_homepage("https://plflib.org/indiesort.htm") + set_description("A sort wrapper enabling both use of random-access sorting on non-random access containers, and increased performance for the sorting of large types.") + set_license("zlib") + + add_urls("https://github.com/mattreecebentley/plf_indiesort.git") + add_versions("v1.41", "fce3d54ed1a43e9e7008703f79c4f4d2e5259176") + + on_install(function (package) + os.cp("plf_indiesort.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + std::vector vec; + plf::indiesort(vec); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/p/plf_list/xmake.lua b/packages/p/plf_list/xmake.lua new file mode 100644 index 000000000..705990e80 --- /dev/null +++ b/packages/p/plf_list/xmake.lua @@ -0,0 +1,21 @@ +package("plf_list") + set_kind("library", {headeronly = true}) + set_homepage("https://plflib.org/list.htm") + set_description("A data container replicating std::list functionality but with (on average) 333% faster insertion, 81% faster erasure and 16% faster iteration.") + set_license("zlib") + + add_urls("https://github.com/mattreecebentley/plf_list.git") + add_versions("2.73", "b5bbcec628b149c57c56887e6ba0a55caf61fc95") + + on_install(function (package) + os.cp("plf_list.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + plf::list i_list; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/p/plf_nanotimer/xmake.lua b/packages/p/plf_nanotimer/xmake.lua new file mode 100644 index 000000000..deb6e2aa9 --- /dev/null +++ b/packages/p/plf_nanotimer/xmake.lua @@ -0,0 +1,16 @@ +package("plf_nanotimer") + set_kind("library", {headeronly = true}) + set_homepage("https://plflib.org/nanotimer.htm") + set_description("A cross-platform lowest-overhead microsecond-precision timer for simple benchmarking on Linux/BSD/Windows/Mac.") + set_license("zlib") + + add_urls("https://github.com/mattreecebentley/plf_nanotimer.git") + add_versions("v1.07", "55e0fcb135ec8db874a0656f94d1f1780d7c75a7") + + on_install("!wasm", function (package) + os.cp("plf_nanotimer.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:has_cxxtypes("plf::nanotimer", {configs = {languages = "c++17"}, includes = "plf_nanotimer.h"})) + end) diff --git a/packages/p/plf_queue/xmake.lua b/packages/p/plf_queue/xmake.lua new file mode 100644 index 000000000..1946bd716 --- /dev/null +++ b/packages/p/plf_queue/xmake.lua @@ -0,0 +1,21 @@ +package("plf_queue") + set_kind("library", {headeronly = true}) + set_homepage("https://plflib.org/queue.htm") + set_description("A data container replicating std::queue functionality but with better performance than standard library containers in a queue context.") + set_license("zlib") + + add_urls("https://github.com/mattreecebentley/plf_queue.git") + add_versions("v2.0.3", "9d3eeb0822c815388b9df06065010fa48c0a042c") + + on_install(function (package) + os.cp("plf_queue.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + plf::queue i_queue; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/p/plf_rand/xmake.lua b/packages/p/plf_rand/xmake.lua new file mode 100644 index 000000000..6156ce5f3 --- /dev/null +++ b/packages/p/plf_rand/xmake.lua @@ -0,0 +1,21 @@ +package("plf_rand") + set_kind("library", {headeronly = true}) + set_homepage("https://plflib.org/rand.htm") + set_description("A replacement for rand()/srand() that's ~700% faster with (typically) better statistical distribution. An adaptation of PCG with fallback to xorshift for C++98/03.") + set_license("zlib") + + add_urls("https://github.com/mattreecebentley/plf_rand.git") + add_versions("v1.05", "764684817b0208b9f18b4b3d18f4f8d8f33fa1f0") + + on_install(function (package) + os.cp("plf_rand.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + plf::rand(); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/p/plf_reorderase/xmake.lua b/packages/p/plf_reorderase/xmake.lua new file mode 100644 index 000000000..c08c87e9d --- /dev/null +++ b/packages/p/plf_reorderase/xmake.lua @@ -0,0 +1,23 @@ +package("plf_reorderase") + set_kind("library", {headeronly = true}) + set_homepage("https://plflib.org/reorderase.htm") + set_description("A faster method for singular erasures, ranged erasures, and erase_if-style erasures for vector/deque/static_vector when element order is not important.") + set_license("zlib") + + add_urls("https://github.com/mattreecebentley/plf_reorderase.git") + add_versions("v1.11", "34728e5dca312e3263addd5394235a33def4a3f4") + + on_install(function (package) + os.cp("plf_reorderase.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + std::vector vec{1}; + plf::reorderase_all(vec, 1); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/p/plf_stack/xmake.lua b/packages/p/plf_stack/xmake.lua new file mode 100644 index 000000000..ea527cc8e --- /dev/null +++ b/packages/p/plf_stack/xmake.lua @@ -0,0 +1,21 @@ +package("plf_stack") + set_kind("library", {headeronly = true}) + set_homepage("https://plflib.org/stack.htm") + set_description("A data container replicating std::stack functionality but with better performance than standard library containers in a stack context.") + set_license("zlib") + + add_urls("https://github.com/mattreecebentley/plf_stack.git") + add_versions("v2.03", "ec248e8eb98667ffc9cc1415f7750a774a2fc359") + + on_install(function (package) + os.cp("plf_stack.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + plf::stack i_stack; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/p/plog/xmake.lua b/packages/p/plog/xmake.lua index 4396d49e6..74fa520ba 100644 --- a/packages/p/plog/xmake.lua +++ b/packages/p/plog/xmake.lua @@ -6,6 +6,7 @@ package("plog") add_urls("https://github.com/SergiusTheBest/plog/archive/refs/tags/$(version).tar.gz", "https://github.com/SergiusTheBest/plog.git") + add_versions("1.1.10", "55a090fc2b46ab44d0dde562a91fe5fc15445a3caedfaedda89fe3925da4705a") add_versions("1.1.9", "058315b9ec9611b659337d4333519ab4783fad3f2f23b1cc7bb84d977ea38055") on_install(function (package) diff --git a/packages/p/pocketpy/xmake.lua b/packages/p/pocketpy/xmake.lua index dd34f0464..4f601aa17 100644 --- a/packages/p/pocketpy/xmake.lua +++ b/packages/p/pocketpy/xmake.lua @@ -4,24 +4,33 @@ package("pocketpy") set_description("C++17 header-only Python interpreter for game engines.") set_license("MIT") - add_urls("https://github.com/blueloveTH/pocketpy/releases/download/$(version)/pocketpy.h") + add_urls("https://github.com/pocketpy/pocketpy/releases/download/$(version)/pocketpy.h") + add_versions("v1.4.5", "144f63ed8a21fd2a65e252df53939f7af453d544eb35570603af319ce1af5a46") add_versions("v0.9.0", "0da63afb3ea4ebb8b686bfe33b4c7556c0a927cd98ccf3c7a3fb4aa216fbf30b") on_install("windows|x64", "linux", "macosx", "android", function (package) os.cp("../pocketpy.h", package:installdir("include")) end) - on_test(function (package) + on_test("linux", "macosx", "android", function (package) assert(package:check_cxxsnippets({test = [[ void test() { - VM* vm = pkpy_new_vm(true); - pkpy_vm_exec(vm, "print('Hello world!')"); - pkpy_vm_exec(vm, "a = [1, 2, 3]"); - char* result = pkpy_vm_eval(vm, "sum(a)"); - printf("%s", result); - pkpy_delete(result); - pkpy_delete(vm); + VM* vm = new VM(); + vm->exec("print('Hello world!')"); + vm->exec("a = [1, 2, 3]"); + delete vm; } ]]}, {configs = {languages = "c++17"}, includes = {"pocketpy.h"}})) end) + + on_test("windows|x64", function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + VM* vm = new VM(); + vm->exec("print('Hello world!')"); + vm->exec("a = [1, 2, 3]"); + delete vm; + } + ]]}, {configs = {languages = "c++17", cxflags = "/utf-8"}, includes = {"pocketpy.h"}})) + end) diff --git a/packages/p/poco/xmake.lua b/packages/p/poco/xmake.lua index ac8be5d1d..0ffa62759 100644 --- a/packages/p/poco/xmake.lua +++ b/packages/p/poco/xmake.lua @@ -1,17 +1,20 @@ package("poco") - set_homepage("https://pocoproject.org/") set_description("The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.") set_license("BSL-1.0") add_urls("https://github.com/pocoproject/poco/archive/refs/tags/poco-$(version)-release.tar.gz", "https://github.com/pocoproject/poco.git") + add_versions("1.11.0", "8a7bfd0883ee95e223058edce8364c7d61026ac1882e29643822ce9b753f3602") add_versions("1.11.1", "2412a5819a239ff2ee58f81033bcc39c40460d7a8b330013a687c8c0bd2b4ac0") add_versions("1.11.6", "ef0ac1bd1fe4d84b38cde12fbaa7a441d41bfbd567434b9a57ef8b79a8367e74") + add_versions("1.11.8", "a59727335a9bf428dc1289cd8ce84f9c1749c1472a0cd3ae86bec85be23d7cbe") add_versions("1.12.1", "debc6d5d5eb946bb14e47cffc33db4fffb4f11765f34f8db04e71e866d1af8f9") add_versions("1.12.2", "30442ccb097a0074133f699213a59d6f8c77db5b2c98a7c1ad9c5eeb3a2b06f3") add_versions("1.12.4", "71ef96c35fced367d6da74da294510ad2c912563f12cd716ab02b6ed10a733ef") + add_versions("1.12.5", "92b18eb0fcd2263069f03e7cc80f9feb43fb7ca23b8c822a48e42066b2cd17a6") + add_versions("1.13.3", "9f074d230daf30f550c5bde5528037bdab6aa83b2a06c81a25e89dd3bcb7e419") if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) diff --git a/packages/p/polyscope/patches/v2.1.0/deps.patch b/packages/p/polyscope/patches/v2.1.0/deps.patch new file mode 100644 index 000000000..fda184a05 --- /dev/null +++ b/packages/p/polyscope/patches/v2.1.0/deps.patch @@ -0,0 +1,141 @@ +diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt +index 3b61d1e..714d247 100644 +--- a/deps/CMakeLists.txt ++++ b/deps/CMakeLists.txt +@@ -1,23 +1,21 @@ + if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}") + + ## Glad +- add_subdirectory(glad) + + ## GLFW + set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) + set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) + set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) + set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) +- add_subdirectory(glfw) ++ find_package(glfw3 REQUIRED) + endif() + + if("${POLYSCOPE_BACKEND_OPENGL_MOCK}") + endif() + + ## Imgui +-add_subdirectory(imgui) + + ## Argparse + + ## Other dependencies +-add_subdirectory(stb) ++add_library(stb OBJECT stb_impl.cpp) +diff --git a/deps/MarchingCubeCpp/include/MarchingCube/MC.h b/deps/MarchingCubeCpp/include/MarchingCube/MC.h +index 62e6c37..e2d204b 100644 +--- a/deps/MarchingCubeCpp/include/MarchingCube/MC.h ++++ b/deps/MarchingCubeCpp/include/MarchingCube/MC.h +@@ -5,8 +5,10 @@ + #include + + // Added by nsharp: use glm instead of internal vector class ++#define GLM_ENABLE_EXPERIMENTAL + #include + #include ++#undef GLM_ENABLE_EXPERIMENTAL + + namespace MC + { +diff --git a/examples/demo-app/demo_app.cpp b/examples/demo-app/demo_app.cpp +index 8af2b5a..a8be07c 100644 +--- a/examples/demo-app/demo_app.cpp ++++ b/examples/demo-app/demo_app.cpp +@@ -24,7 +24,7 @@ + + #include "args/args.hxx" + #include "happly.h" +-#include "json/json.hpp" ++#include "nlohmann/json.hpp" + + #include "simple_dot_mesh_parser.h" + #include "surface_mesh_io.h" +diff --git a/include/polyscope/internal.h b/include/polyscope/internal.h +index d339e77..c875248 100644 +--- a/include/polyscope/internal.h ++++ b/include/polyscope/internal.h +@@ -2,6 +2,7 @@ + + #pragma once + ++#include + #include + + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 77e6dbd..3b2d98c 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -48,7 +48,7 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}") + + # Link settings + list(APPEND BACKEND_LIBS +- glfw ${GLFW_LIBRARIES} ++ ${GLFW_LIBRARIES} + ) + + if(APPLE) +@@ -330,15 +330,9 @@ add_definitions(-DNOMINMAX) + + # Include settings + target_include_directories(polyscope PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include") +-target_include_directories(polyscope PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../deps/glm") +-#target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/args") # not used, polyscope generates no apps directly +-target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/happly") +-target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/MarchingCubeCpp") +-target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/json/include") +-target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/stb") + target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/MarchingCubeCpp/include") +-target_include_directories(polyscope PRIVATE "${BACKEND_INCLUDE_DIRS}") + + # Link settings + target_link_libraries(polyscope PUBLIC imgui) + target_link_libraries(polyscope PRIVATE "${BACKEND_LIBS}" stb) ++install(TARGETS polyscope LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) +diff --git a/src/polyscope.cpp b/src/polyscope.cpp +index 914d587..f4ccf92 100644 +--- a/src/polyscope.cpp ++++ b/src/polyscope.cpp +@@ -16,7 +16,7 @@ + + #include "stb_image.h" + +-#include "json/json.hpp" ++#include "nlohmann/json.hpp" + using json = nlohmann::json; + + #include "backends/imgui_impl_opengl3.h" +diff --git a/src/transformation_gizmo.cpp b/src/transformation_gizmo.cpp +index 25c25f8..36fedfd 100644 +--- a/src/transformation_gizmo.cpp ++++ b/src/transformation_gizmo.cpp +@@ -4,8 +4,10 @@ + + #include "polyscope/polyscope.h" + ++#define GLM_ENABLE_EXPERIMENTAL + #include + #include ++#undef GLM_ENABLE_EXPERIMENTAL + + #include + +diff --git a/src/view.cpp b/src/view.cpp +index 5d3c60b..dd03ef0 100644 +--- a/src/view.cpp ++++ b/src/view.cpp +@@ -7,7 +7,7 @@ + + #include "imgui.h" + +-#include "json/json.hpp" ++#include "nlohmann/json.hpp" + using json = nlohmann::json; + + namespace polyscope { diff --git a/packages/p/polyscope/patches/v2.2.1/deps.patch b/packages/p/polyscope/patches/v2.2.1/deps.patch new file mode 100644 index 000000000..77790ecb5 --- /dev/null +++ b/packages/p/polyscope/patches/v2.2.1/deps.patch @@ -0,0 +1,68 @@ +diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt +index d7bded0..99443ff 100644 +--- a/deps/CMakeLists.txt ++++ b/deps/CMakeLists.txt +@@ -2,7 +2,6 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}") + + ## Glad + if(NOT TARGET glad) +- add_subdirectory(glad) + endif() + + ## GLFW +@@ -11,25 +10,20 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}") + set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) + set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) + set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) +- add_subdirectory(glfw) ++ find_package(glfw3 REQUIRED) + endif() + endif() + + ## glm + if(NOT TARGET glm::glm) +- add_subdirectory(glm) +- target_compile_definitions(glm INTERFACE GLM_ENABLE_EXPERIMENTAL) +- set_target_properties(glm PROPERTIES LINKER_LANGUAGE CXX) + endif() + + ## Imgui + if(NOT TARGET imgui) +- add_subdirectory(imgui) + endif() + + ## Json + if(NOT TARGET nlohmann_json::nlohmann_json) +- add_subdirectory(json) + endif() + + ## MarchingCube +@@ -39,5 +33,5 @@ endif() + + ## stb + if(NOT TARGET stb) +- add_subdirectory(stb) ++ add_library(stb OBJECT stb_impl.cpp) + endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9d03d96..205e566 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -49,7 +49,7 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}") + + # Link settings + list(APPEND BACKEND_LIBS +- glfw ++ ${GLFW_LIBRARIES} + ) + + if(APPLE) +@@ -371,5 +371,6 @@ add_definitions(-DNOMINMAX) + target_include_directories(polyscope PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include") + + # Link settings +-target_link_libraries(polyscope PUBLIC imgui glm::glm) +-target_link_libraries(polyscope PRIVATE "${BACKEND_LIBS}" stb nlohmann_json::nlohmann_json MarchingCube::MarchingCube) ++target_compile_definitions(polyscope PUBLIC GLM_ENABLE_EXPERIMENTAL) ++target_link_libraries(polyscope PUBLIC imgui) ++target_link_libraries(polyscope PRIVATE "${BACKEND_LIBS}" stb MarchingCube::MarchingCube) diff --git a/packages/p/polyscope/xmake.lua b/packages/p/polyscope/xmake.lua index 1c736559b..58b958f73 100644 --- a/packages/p/polyscope/xmake.lua +++ b/packages/p/polyscope/xmake.lua @@ -6,25 +6,40 @@ package("polyscope") add_urls("https://github.com/nmwsharp/polyscope/archive/refs/tags/$(version).tar.gz", "https://github.com/nmwsharp/polyscope.git") + add_versions("v2.2.1", "1952d20722cb37c5531e88d5b7f5db88c2827c55fd7ada481c2ac425f3bc4d25") + add_versions("v2.1.0", "bdad2daab33a44b3b6424cec82b43cecb842b529769fd0df3bf7d8e616cea34c") add_versions("v1.3.0", "c0d3594b1c818c6e7efe2c2589d71f5e254db383d36a92555aa909a2114f12d4") - add_patches("1.3.0", path.join(os.scriptdir(), "patches", "v1.3.0", "deps.patch"), "2d183713be791deddcfb48e4546793f584071eb1aa7a045e03c7ceed841470c8") - add_patches("1.3.0", path.join(os.scriptdir(), "patches", "v1.3.0", "imgui.patch"), "e7865d6de85103098cdc25ab8a0e94dd26fb5f718609f20093b91891cc8f21e1") + add_patches("2.2.1", "patches/v2.2.1/deps.patch", "7183fac6dcb6ebc9441c02e4c5f51721ab2a64fe524488611e6085e5b72bb6ae") + add_patches("2.1.0", "patches/v2.1.0/deps.patch", "01bc0b31193e65b8cc079d9f232f73fb995b3cfd276840add58a01dfcf477cc8") + add_patches("1.3.0", "patches/v1.3.0/deps.patch", "2d183713be791deddcfb48e4546793f584071eb1aa7a045e03c7ceed841470c8") + add_patches("1.3.0", "patches/v1.3.0/imgui.patch", "e7865d6de85103098cdc25ab8a0e94dd26fb5f718609f20093b91891cc8f21e1") if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end add_deps("cmake") - add_deps("imgui <=1.86", {configs = {glfw_opengl3 = true}}) - add_deps("glad", "glfw", "glm", "happly", "nlohmann_json", "stb") + add_deps("glad", "glfw", "glm", "nlohmann_json", "stb") + on_load("windows", "macosx", "linux", function (package) + if package:version():ge("2.2.0") then + package:add("deps", "imgui", {configs = {glfw = true, opengl3 = true}}) + else + package:add("deps", "happly") + package:add("deps", "imgui <=1.86", {configs = {glfw = true, opengl3 = true}}) + end + package:add("defines", "GLM_ENABLE_EXPERIMENTAL") + end) + on_install("windows", "macosx", "linux", function (package) - os.mv("deps/stb/stb_impl.cpp", "deps/stb_impl.cpp") - local configs = {"-DPOLYSCOPE_BACKEND_OPENGL_MOCK=OFF"} + os.cp("deps/stb/stb_impl.cpp", "deps/stb_impl.cpp") + local configs = {"-DPOLYSCOPE_BACKEND_OPENGL_MOCK=OFF", "-DPOLYSCOPE_BACKEND_OPENGL3_EGL=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs, {packagedeps = {"imgui", "glad", "glfw", "glm", "happly", "nlohmann_json", "stb"}}) - os.cp("include/polyscope", package:installdir("include")) + if package:version():lt("2.2.0") then + os.cp("include/polyscope", package:installdir("include")) + end end) on_test(function (package) diff --git a/packages/p/popt/xmake.lua b/packages/p/popt/xmake.lua new file mode 100644 index 000000000..eebd9e553 --- /dev/null +++ b/packages/p/popt/xmake.lua @@ -0,0 +1,25 @@ +package("popt") + set_homepage("http://ftp.rpm.org/popt/") + set_description("C library for parsing command line parameters") + set_license("MIT") + + add_urls("http://ftp.rpm.org/popt/releases/popt-1.x/popt-$(version).tar.gz", + "https://ftp.osuosl.org/pub/rpm/popt/releases/popt-1.x/popt-$(version).tar.gz") + + add_versions("1.19", "c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9") + + if is_plat("macosx") then + add_deps("libintl") + add_deps("libiconv", {system = true}) + end + + on_install("linux", "macosx", function (package) + local configs = {} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + table.insert(configs, package:is_debug() and "--enable-debug" or "--disable-debug") + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("poptGetContext", {includes = "popt.h"})) + end) diff --git a/packages/p/proj/xmake.lua b/packages/p/proj/xmake.lua index 0d6ead306..e88a5909e 100644 --- a/packages/p/proj/xmake.lua +++ b/packages/p/proj/xmake.lua @@ -5,6 +5,7 @@ package("proj") set_license("MIT") add_urls("https://download.osgeo.org/proj/proj-$(version).tar.gz") + add_versions("9.4.0", "3643b19b1622fe6b2e3113bdb623969f5117984b39f173b4e3fb19a8833bd216") add_versions("9.0.1", "737eaacbe7906d0d6ff43f0d9ebedc5c734cccc9e6b8d7beefdec3ab22d9a6a3") add_versions("8.2.1", "76ed3d0c3a348a6693dfae535e5658bbfd47f71cb7ff7eb96d9f12f7e068b1cf") diff --git a/packages/p/prometheus-cpp/xmake.lua b/packages/p/prometheus-cpp/xmake.lua index 38636ebeb..793189b33 100644 --- a/packages/p/prometheus-cpp/xmake.lua +++ b/packages/p/prometheus-cpp/xmake.lua @@ -5,6 +5,8 @@ package("prometheus-cpp") add_urls("https://github.com/jupp0r/prometheus-cpp/archive/refs/tags/$(version).tar.gz", "https://github.com/jupp0r/prometheus-cpp.git") + add_versions("v1.2.4", "48dbad454d314b836cc667ec4def93ec4a6e4255fc8387c20cacb3b8b6faee30") + add_versions("v1.2.1", "190734c4d8d0644c2af327ff8b5ef86cd7ea9074a48d777112394f558dd014f7") add_versions("v1.0.0", "07018db604ea3e61f5078583e87c80932ea10c300d979061490ee1b7dc8e3a41") add_configs("pull", {description = "Enable Pull.", default = true, type = "boolean"}) diff --git a/packages/p/promise-cpp/patches/2.1.3/cmake.patch b/packages/p/promise-cpp/patches/2.1.3/cmake.patch deleted file mode 100644 index 7d552edc6..000000000 --- a/packages/p/promise-cpp/patches/2.1.3/cmake.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fd43e91..5ddef71 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -39,26 +39,6 @@ else() - add_library(promise STATIC ${my_sources} ${my_headers}) - endif() - -- --add_executable(test0 ${my_headers} example/test0.cpp) --target_link_libraries(test0 PRIVATE promise) -- --add_executable(simple_timer ${my_headers} example/simple_timer.cpp) --target_link_libraries(simple_timer PRIVATE promise) -- --add_executable(simple_benchmark_test ${my_headers} example/simple_benchmark_test.cpp) --target_link_libraries(simple_benchmark_test PRIVATE promise) -- --find_package(Threads) --if(Threads_FOUND) -- add_executable(multithread_test ${my_headers} example/multithread_test.cpp) -- target_link_libraries(multithread_test PRIVATE promise Threads::Threads) --endif() -- --add_executable(chain_defer_test ${my_headers} example/chain_defer_test.cpp) --target_link_libraries(chain_defer_test PRIVATE promise) -- -- - find_package(Boost) - if(NOT Boost_FOUND) - message(WARNING "Boost not found, so asio projects will not be compiled") -@@ -70,40 +50,4 @@ else() - endif (UNIX) - - include_directories(. ./add_ons/asio) -- -- add_executable(asio_benchmark_test ${my_headers} example/asio_benchmark_test.cpp) -- target_compile_definitions(asio_benchmark_test PRIVATE BOOST_ALL_NO_LIB) -- target_link_libraries(asio_benchmark_test PRIVATE promise) -- -- add_executable(asio_timer ${my_headers} example/asio_timer.cpp) -- target_compile_definitions(asio_timer PRIVATE BOOST_ALL_NO_LIB) -- target_link_libraries(asio_timer PRIVATE promise) -- -- add_executable(asio_http_client ${my_headers} example/asio_http_client.cpp) -- target_compile_definitions(asio_http_client PRIVATE BOOST_ALL_NO_LIB) -- target_link_libraries(asio_http_client PRIVATE promise) -- -- add_executable(asio_http_server ${my_headers} example/asio_http_server.cpp) -- target_compile_definitions(asio_http_server PRIVATE BOOST_ALL_NO_LIB) -- target_link_libraries(asio_http_server PRIVATE promise) --endif() -- -- --find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets) --find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets) --if(NOT QT_DIR) -- message(WARNING "QT not found, so project qt_timer will not be compiled") --else() -- if(PROMISE_BUILD_SHARED OR BUILD_SHARED_LIBS) -- add_library(promise_qt SHARED ./add_ons/qt/promise_qt.cpp ${my_headers}) -- else() -- add_library(promise_qt STATIC ./add_ons/qt/promise_qt.cpp ${my_headers}) -- endif() -- target_link_libraries(promise_qt PRIVATE promise Qt${QT_VERSION_MAJOR}::Widgets) -- -- add_subdirectory(./example/qt_timer) --endif() -- --if(MSVC) -- add_subdirectory(./example/mfc_timer) - endif() diff --git a/packages/p/promise-cpp/port/xmake.lua b/packages/p/promise-cpp/port/xmake.lua new file mode 100644 index 000000000..c230f0d81 --- /dev/null +++ b/packages/p/promise-cpp/port/xmake.lua @@ -0,0 +1,19 @@ +option("boost_asio", {showmenu = true, default = false}) + +add_rules("mode.debug", "mode.release") +set_languages("c++11") + +if has_config("boost_asio") then + add_requires("boost") + add_packages("boost") +end + +target("promise-cpp") + set_kind("$(kind)") + add_files("src/*.cpp") + add_includedirs(".", "include") + add_headerfiles("include/(**.hpp)", "(add_ons/**.hpp)") + + if is_plat("windows") and is_kind("shared") then + add_defines("PROMISE_BUILD_SHARED") + end diff --git a/packages/p/promise-cpp/xmake.lua b/packages/p/promise-cpp/xmake.lua index 055e655f6..94c062490 100644 --- a/packages/p/promise-cpp/xmake.lua +++ b/packages/p/promise-cpp/xmake.lua @@ -5,41 +5,21 @@ package("promise-cpp") add_urls("https://github.com/xhawk18/promise-cpp/archive/refs/tags/$(version).tar.gz", "https://github.com/xhawk18/promise-cpp.git") - add_versions("2.1.3", "831f5c7fb36a1f0adda408898038b428d4afe96e7028947be0f755c6851eec26") - add_patches("2.1.3", path.join(os.scriptdir(), "patches", "2.1.3", "cmake.patch"), "3ea274743d852c685e8a9fb4f609f768c2e5461061b87473092ee98c68e1ab88") + add_versions("2.1.5", "9608686d0d136323396a84c2f6046060a966ed10bf4bb7895ef87340c118b66a") + add_versions("2.1.3", "831f5c7fb36a1f0adda408898038b428d4afe96e7028947be0f755c6851eec26") add_configs("boost_asio", { description = "Enable boost asio.", default = false, type = "boolean"}) - add_deps("cmake") - add_includedirs("include", "include/promise-cpp") - on_load(function (package) if package:config("boost_asio") then package:add("deps", "boost") end end) - on_install("linux", "macosx", "windows", function (package) - local configs = {} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) - table.insert(configs, "-DPROMISE_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs, {buildir = "build"}) - os.cp("include", package:installdir()) - os.cp("add_ons", package:installdir("include")) - if package:is_plat("linux") then - if package:config("shared") then - os.cp("build/*.so", package:installdir("lib")) - else - os.cp("build/*.a", package:installdir("lib")) - end - elseif package:is_plat("macosx") then - if package:config("shared") then - os.cp("build/*.dylib", package:installdir("lib")) - else - os.cp("build/*.a", package:installdir("lib")) - end - end + on_install(function (package) + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, {boost_asio = package:config("boost_asio")}) end) on_test(function (package) @@ -86,4 +66,3 @@ package("promise-cpp") assert(package:has_cxxtypes("promise::Promise", {configs = {languages = "c++14"}, includes = "promise-cpp/promise.hpp"})) end end) - diff --git a/packages/p/protobuf-c/xmake.lua b/packages/p/protobuf-c/xmake.lua index 94e37c3eb..e55dcf568 100644 --- a/packages/p/protobuf-c/xmake.lua +++ b/packages/p/protobuf-c/xmake.lua @@ -4,6 +4,7 @@ package("protobuf-c") set_description("Google's data interchange format for c") add_urls("https://github.com/protobuf-c/protobuf-c/releases/download/v$(version)/protobuf-c-$(version).tar.gz") + add_versions("1.5.0", "7b404c63361ed35b3667aec75cc37b54298d56dd2bcf369de3373212cc06fd98") add_versions("1.3.1", "51472d3a191d6d7b425e32b612e477c06f73fe23e07f6a6a839b11808e9d2267") -- fix "error: no type named 'Reflection' in 'google::protobuf::Message'" @@ -11,9 +12,9 @@ package("protobuf-c") -- and https://github.com/protobuf-c/protobuf-c/issues/356 add_patches("1.3.1", path.join(os.scriptdir(), "patches", "1.3.1", "342.patch"), "ab78f9eeff2840cacf5b6b143d284e50e43166ec2cbfa78cd47fd8db1e387c6d") - add_deps("protobuf-cpp") + add_deps("protobuf-cpp 3.19.4") if is_plat("windows") then - add_deps("cmake") + add_deps("cmake", "abseil", "utf8_range") end add_links("protobuf-c") @@ -25,28 +26,28 @@ package("protobuf-c") package:addenv("PATH", "bin") end) - on_install("windows", function (package) - -- fix run `protoc-c.exe` failed - io.replace("protoc-c/main.cc", "invocation_basename == legacy_name", "1") - os.cd("build-cmake") - local cflags - local shflags - local configs = {} - if package:config("shared") then - table.insert(configs, "-DBUILD_SHARED_LIBS=ON") - cflags = {"-DPROTOBUF_C_USE_SHARED_LIB", "-DPROTOBUF_C_EXPORT"} - shflags = "/export:protobuf_c_empty_string" - else - table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") - end - if package:config("vs_runtime"):startswith("MT") then - table.insert(configs, "-DMSVC_STATIC_BUILD=ON") - else - table.insert(configs, "-DMSVC_STATIC_BUILD=OFF") - end - import("package.tools.cmake").install(package, configs, {cflags = cflags, shflags = shflags}) - os.cp("build_*/Release/protoc-gen-c.exe", path.join(package:installdir("bin"), "protoc-c.exe")) - end) + -- on_install("windows", function (package) + -- -- fix run `protoc-c.exe` failed + -- io.replace("protoc-c/main.cc", "invocation_basename == legacy_name", "1") + -- os.cd("build-cmake") + -- local cflags + -- local shflags + -- local configs = {} + -- if package:config("shared") then + -- table.insert(configs, "-DBUILD_SHARED_LIBS=ON") + -- cflags = {"-DPROTOBUF_C_USE_SHARED_LIB", "-DPROTOBUF_C_EXPORT"} + -- shflags = "/export:protobuf_c_empty_string" + -- else + -- table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") + -- end + -- if package:config("vs_runtime"):startswith("MT") then + -- table.insert(configs, "-DMSVC_STATIC_BUILD=ON") + -- else + -- table.insert(configs, "-DMSVC_STATIC_BUILD=OFF") + -- end + -- import("package.tools.cmake").install(package, configs, {cflags = cflags, shflags = shflags}) + -- os.cp("build_*/Release/protoc-gen-c.exe", path.join(package:installdir("bin"), "protoc-c.exe")) + -- end) on_install("linux", "macosx", function (package) local configs = {} diff --git a/packages/p/protobuf-cpp/xmake.lua b/packages/p/protobuf-cpp/xmake.lua index 583e558c7..a22cf2c78 100644 --- a/packages/p/protobuf-cpp/xmake.lua +++ b/packages/p/protobuf-cpp/xmake.lua @@ -3,7 +3,16 @@ package("protobuf-cpp") set_homepage("https://developers.google.com/protocol-buffers/") set_description("Google's data interchange format for cpp") - add_urls("https://github.com/protocolbuffers/protobuf/releases/download/v$(version)/protobuf-cpp-$(version).zip") + add_urls("https://github.com/protocolbuffers/protobuf/releases/download/v$(version)", {version = function (version) + if version:le("3.19.4") then + return version .. "/protobuf-cpp-" .. version .. ".zip" + else + return version .. "/protobuf-" .. version .. ".zip" + end + end}) + + add_versions("27.0", "3e1148db090ff21226c1888ef39fa7bc7790042be21ff4289fd21ce1735f3455") + add_versions("26.1", "e15c272392df84ae95797759c685a9225fe5e88838bab3e0650c29239bdfccdd") add_versions("3.8.0", "91ea92a8c37825bd502d96af9054064694899c5c7ecea21b8d11b1b5e7e993b5") add_versions("3.12.0", "da826a3c48a9cae879928202d6fe06afb15aaee129e9035d6510cc776ddfa925") add_versions("3.12.3", "74da289e0d0c24b2cb097f30fdc09fa30754175fd5ebb34fae4032c6d95d4ce3") @@ -22,9 +31,9 @@ package("protobuf-cpp") add_deps("cmake") if is_plat("windows") then - add_links("libprotobuf") + add_links("libprotobuf", "libprotoc", "utf8_range", "utf8_validity") else - add_links("protobuf") + add_links("protobuf", "protoc", "utf8_range", "utf8_validity") end if is_plat("linux") then @@ -36,14 +45,32 @@ package("protobuf-cpp") if package:config("zlib") then package:add("deps", "zlib") end + if package:version():ge("22.0") then + package:add("deps", "abseil") + end end) on_install("windows", "linux", "macosx", function (package) - os.cd("cmake") + if package:version():le("3.19.4") then + os.cd("cmake") + end io.replace("CMakeLists.txt", "set(protobuf_DEBUG_POSTFIX \"d\"", "set(protobuf_DEBUG_POSTFIX \"\"", {plain = true}) + if package:version():ge("26.1") then + io.replace("cmake/abseil-cpp.cmake", "BUILD_SHARED_LIBS AND MSVC", "FALSE", {plain = true}) + end + local configs = {"-Dprotobuf_BUILD_TESTS=OFF", "-Dprotobuf_BUILD_PROTOC_BINARIES=ON"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + + local packagedeps = {} + if package:version():ge("22.0") then + table.insert(packagedeps, "abseil") + table.insert(configs, "-Dprotobuf_ABSL_PROVIDER=package") + end + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") table.insert(configs, "-Dprotobuf_MSVC_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) if package:config("shared") then package:add("defines", "PROTOBUF_USE_DLLS") @@ -52,7 +79,7 @@ package("protobuf-cpp") if package:config("zlib") then table.insert(configs, "-Dprotobuf_WITH_ZLIB=ON") end - import("package.tools.cmake").install(package, configs, {buildir = "build"}) + import("package.tools.cmake").install(package, configs, {buildir = "build", packagedeps = packagedeps}) os.trycp("build/Release/protoc.exe", package:installdir("bin")) end) @@ -71,5 +98,4 @@ package("protobuf-cpp") } ]]) os.vrun("protoc test.proto --cpp_out=.") - assert(package:check_cxxsnippets({test = io.readfile("test.pb.cc")}, {configs = {includedirs = {".", package:installdir("include")}, languages = "c++11"}})) end) diff --git a/packages/p/proxygen/xmake.lua b/packages/p/proxygen/xmake.lua new file mode 100644 index 000000000..0abcd037a --- /dev/null +++ b/packages/p/proxygen/xmake.lua @@ -0,0 +1,27 @@ +package("proxygen") + set_homepage("https://github.com/facebook/proxygen") + set_description("A collection of C++ HTTP libraries including an easy to use HTTP server.") + set_license("BSD") + + add_urls("https://github.com/facebook/proxygen/archive/refs/tags/v$(version).00.tar.gz", + "https://github.com/facebook/proxygen.git") + add_versions("2024.03.04", "c3586cd8a3978dd88ea73b7dc217b0ce9f3bae51f5a2e554135daaf772215e8d") + add_versions("2024.03.11", "39d357650d1fdfb3b34c17eb21ccd8e709fb6c2a391ddfc37bb0c5476a111210") + add_versions("2024.03.18", "7731c5eea71f1ab3182a1a54329abae983ac63794f86768762a0136587dfd979") + add_versions("2024.03.25", "b11c8da4dbcbbdde8d9504f2edd3eb537bdf959eccc07a8333d1936965437abc") + add_versions("2024.04.01", "75b040c235fee853e8db90075620f56ee4aa69345eea9ab4f80aa35501fe2eff") + + add_deps("cmake", "folly", "fizz", "wangle", "mvfst", "gperf", "python") + + on_install("linux", function (package) + local configs = {"-DBUILD_TESTS=OFF", + "-DBUILD_EXAMPLES=OFF", + "-DCMAKE_CXX_STANDARD=17"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cxxincludes("proxygen/httpserver/ScopedHTTPServer.h", {configs = {languages = "c++17"}})) + end) diff --git a/packages/p/prvhash/xmake.lua b/packages/p/prvhash/xmake.lua index 658a86c8e..658386d3c 100644 --- a/packages/p/prvhash/xmake.lua +++ b/packages/p/prvhash/xmake.lua @@ -7,6 +7,7 @@ package("prvhash") add_urls("https://github.com/avaneev/prvhash/archive/refs/tags/$(version).tar.gz", "https://github.com/avaneev/prvhash.git") + add_versions("4.3.2", "e647b34e2f20134947bd3ba2b8841de251ea9da001865d9e44fdb05bd63ac741") add_versions("4.0", "b4d8ce80ee73e504faccd235d4071398c95b06421095eeb2502ef46a810f8375") on_install(function (package) diff --git a/packages/p/pseudo-double-c/xmake.lua b/packages/p/pseudo-double-c/xmake.lua new file mode 100644 index 000000000..5b3b9b3b4 --- /dev/null +++ b/packages/p/pseudo-double-c/xmake.lua @@ -0,0 +1,49 @@ +package("pseudo-double-c") + set_homepage("https://github.com/royward/pseudo-double") + set_description("A relatively fast C and C++ 64 bit floating point library written using only integer operations for cross platform consistency. Tested with gcc/clang/Visual Studio, on x86-64/ARMv8 (64 bit)") + set_license("BSD-3-Clause") + + add_urls("https://github.com/royward/pseudo-double.git") + + add_versions("2024.01.17", "275b244eee40b987a209927d7942d4bf83d91c95") + + add_configs("pseudo_double_exp_bits", {description = "This sets the number of bits in the exponent, defaulting to 16 if not set.", default = "16", type = "string", values = {"8", "16", "32"}}) + add_configs("pd_error_check", {description = "This enables error checking in the library, defaulting to true if not set.", default = true, type = "boolean"}) + + on_install("windows|x64", "linux|x86_64", "macosx", "bsd", "android|arm64*", "wasm", function (package) + local configs = {} + io.replace("pseudo_double.h", "#include ", "#include \n#include ", {plain = true}) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("pseudo-double-c") + set_kind("$(kind)") + set_languages("c99") + + if is_plat("windows") then + add_defines("_MSC_VER") + end + + add_files("pseudo_double.c") + add_headerfiles("(pseudo_double.h)") + + on_config(function (target) + if target:has_tool("gcc", "gxx") then + target:add("defines", "__GNUC__") + elseif target:has_tool("cc", "cxx", "clang", "clangxx") then + target:add("defines", "__clang__") + end + end) + ]]) + package:add("defines", "PSEUDO_DOUBLE_EXP_BITS=" .. package:config("pseudo_double_exp_bits")) + package:add("defines", "PD_ERROR_CHECK=" .. (package:config("pd_error_check") and "1" or "0")) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + pseudo_double a_1 = int64fixed10_to_pd(3, -1); + } + ]]})) + end) diff --git a/packages/p/pseudo-double-cpp/port/xmake.lua b/packages/p/pseudo-double-cpp/port/xmake.lua new file mode 100644 index 000000000..1b122904f --- /dev/null +++ b/packages/p/pseudo-double-cpp/port/xmake.lua @@ -0,0 +1,18 @@ +add_rules("mode.debug", "mode.release") + +option("pseudo_double_exp_bits", {default = "16", showmenu = true, description = "This sets the number of bits in the exponent, defaulting to 16 if not set."}) +option("pd_error_check", {default = true, showmenu = true, description = "This enables error checking in the library, defaulting to true if not set."}) + +add_requires("pseudo-double-c", {configs = {kind = get_config("kind"), pseudo_double_exp_bits = get_config("pseudo_double_exp_bits"), pd_error_check = get_config("pd_error_check")}}) + +target("pseudo-double-cpp") + set_kind("$(kind)") + set_languages("c++11") + add_packages("pseudo-double-c") + + if is_plat("windows") then + add_defines("_MSC_VER") + end + + add_files("pseudo_double.cpp") + add_headerfiles("(PseudoDouble.h)") \ No newline at end of file diff --git a/packages/p/pseudo-double-cpp/xmake.lua b/packages/p/pseudo-double-cpp/xmake.lua new file mode 100644 index 000000000..43b5569f3 --- /dev/null +++ b/packages/p/pseudo-double-cpp/xmake.lua @@ -0,0 +1,33 @@ +package("pseudo-double-cpp") + set_homepage("https://github.com/royward/pseudo-double") + set_description("A relatively fast C and C++ 64 bit floating point library written using only integer operations for cross platform consistency. Tested with gcc/clang/Visual Studio, on x86-64/ARMv8 (64 bit)") + set_license("BSD-3-Clause") + + add_urls("https://github.com/royward/pseudo-double.git") + + add_versions("2024.01.17", "275b244eee40b987a209927d7942d4bf83d91c95") + + add_configs("pseudo_double_exp_bits", {description = "This sets the number of bits in the exponent, defaulting to 16 if not set.", default = "16", type = "string", values = {"8", "16", "32"}}) + add_configs("pd_error_check", {description = "This enables error checking in the library, defaulting to true if not set.", default = true, type = "boolean"}) + + on_load(function (package) + package:add("deps", "pseudo-double-c", {configs = {shared = package:config("shared"), pseudo_double_exp_bits = package:config("pseudo_double_exp_bits"), pd_error_check = package:config("pd_error_check")}}) + end) + + on_install("windows|x64", "linux|x86_64", "bsd", "android|arm64*", function (package) + io.replace("PseudoDouble.h", "#include ", "#include \n#include ", {plain = true}) + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + local configs = {} + configs.pseudo_double_exp_bits = package:config("pseudo_double_exp_bits") + configs.pd_error_check = package:config("pd_error_check") + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + PseudoDouble a_2 = PD_create_fixed10(3,-1); + } + ]]})) + end) diff --git a/packages/p/pthreads4w/xmake.lua b/packages/p/pthreads4w/xmake.lua index f6af9c1e9..1dfa3c71f 100644 --- a/packages/p/pthreads4w/xmake.lua +++ b/packages/p/pthreads4w/xmake.lua @@ -15,7 +15,7 @@ package("pthreads4w") add_deps("autoconf", "automake") end - on_install("windows", function (package) + on_install("windows|x64", "windows|x86", function (package) local target = "VC" if not package:config("shared") then target = target .. "-static" diff --git a/packages/p/pugixml/xmake.lua b/packages/p/pugixml/xmake.lua index efbb8ed99..c1ad3c26d 100644 --- a/packages/p/pugixml/xmake.lua +++ b/packages/p/pugixml/xmake.lua @@ -1,17 +1,18 @@ package("pugixml") - set_homepage("https://pugixml.org/") set_description("Light-weight, simple and fast XML parser for C++ with XPath support") set_license("MIT") add_urls("https://github.com/zeux/pugixml/archive/$(version).tar.gz", "https://github.com/zeux/pugixml.git") + add_versions("v1.11.4", "017139251c122dbff400a507cddc4cb74120a431a50c6c524f30edcc5b331ade") add_versions("v1.13", "5c5ad5d7caeb791420408042a7d88c2c6180781bf218feca259fd9d840a888e1") + add_versions("v1.14", "610f98375424b5614754a6f34a491adbddaaec074e9044577d965160ec103d2e") add_deps("cmake") - on_install("windows", "linux", "macosx", function (package) + on_install(function (package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) diff --git a/packages/p/pulsar/xmake.lua b/packages/p/pulsar/xmake.lua index 51692a64b..1367b8b42 100644 --- a/packages/p/pulsar/xmake.lua +++ b/packages/p/pulsar/xmake.lua @@ -1,21 +1,26 @@ package("pulsar") set_homepage("https://github.com/apache/pulsar-client-cpp") set_description("Pulsar C++ client library") + set_license("Apache-2.0") add_urls("https://github.com/apache/pulsar-client-cpp/archive/refs/tags/v$(version).tar.gz") + add_versions("3.5.1", "279debf04b566321ff4fe2c5bd5bef8547a20b2bdbc6943cb027224ce6b45ec4") + add_versions("3.5.0", "21d71a36666264418e3c5d3bc745628228b258daf659e6389bb9c9584409a27e") add_versions("3.1.2", "802792e8dd48f21dea0cb9cee7afe20f2598d333d2e484a362504763d1e3d49a") - add_deps("boost 1.81.0", "protobuf-cpp", "libcurl", "openssl", "zlib", "zstd", "snappy") + add_deps("boost 1.81.0", "protobuf-cpp", "libcurl", "openssl", "zlib", "zstd", "snappy", "abseil", "utf8_range") on_install("linux", function (package) - local configs = {"-DBUILD_TESTS=OFF"} + io.replace("CMakeLists.txt", "-Werror", "") + local configs = {"-DBUILD_TESTS=OFF", "-DCMAKE_CXX_STANDARD=17"} if package:config("shared") then configs = table.join(configs, {"-DBUILD_STATIC_LIB=OFF", "-DBUILD_DYNAMIC_LIB=ON"}) else configs = table.join(configs, {"-DBUILD_STATIC_LIB=ON", "-DBUILD_DYNAMIC_LIB=OFF"}) end - import("package.tools.cmake").install(package, configs, {packagedeps = {"zstd", "snappy"}}) + io.replace("CMakeLists.txt", "add_subdirectory(examples)", "", {plain = true}) + import("package.tools.cmake").install(package, configs, {packagedeps = {"zstd", "snappy", "abseil", "utf8_range"}}) end) on_test(function (package) @@ -30,5 +35,5 @@ package("pulsar") std::cout << "invalid argument" << std::endl; } } - ]]}, {configs = {languages = "cxx11"}})) + ]]}, {configs = {languages = "cxx17"}})) end) diff --git a/packages/p/pybind11/xmake.lua b/packages/p/pybind11/xmake.lua index de2ef31cc..50648e4c5 100644 --- a/packages/p/pybind11/xmake.lua +++ b/packages/p/pybind11/xmake.lua @@ -14,6 +14,7 @@ package("pybind11") add_versions("v2.9.1", "ef9e63be55b3b29b4447ead511a7a898fdf36847f21cec27a13df0db051ed96b") add_versions("v2.9.2", "d1646e6f70d8a3acb2ddd85ce1ed543b5dd579c68b8fb8e9638282af20edead8") add_versions("v2.10.0", "225df6e6dea7cea7c5754d4ed954e9ca7c43947b849b3795f87cb56437f1bd19") + add_versions("v2.12.0", "411f77380c43798506b39ec594fc7f2b532a13c4db674fcf2b1ca344efaefb68") add_deps("cmake", "python 3.x") on_install("windows", "macosx", "linux", function (package) diff --git a/packages/p/pyincpp/xmake.lua b/packages/p/pyincpp/xmake.lua new file mode 100644 index 000000000..321554f8a --- /dev/null +++ b/packages/p/pyincpp/xmake.lua @@ -0,0 +1,68 @@ +package("pyincpp") + set_homepage("https://github.com/chen-qingyu/pyincpp") + set_description("A C++ type library that is as easy to use as Python built-in types.") + set_kind("library", {headeronly = true}) + + add_urls("https://github.com/chen-qingyu/pyincpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/chen-qingyu/pyincpp.git") + + add_versions("v2.4.0", "ae48bc62e9ed8f89e31235ee79385e59b0be6fd6720e8ebe0aa3d10ec7c9fee2") + add_versions("v2.3.0", "e10640c03a6ae9365a299f57a68a5f2a873146b07f92fd33bc4f673e21d68072") + add_versions("v1.6.1", "6a49657cb1f36f4fa400706a631c300771972015b4181f8cc352aa3de7e1a2a3") + add_versions("v1.6.0", "1e8e4bfde447c439974180e206087b309f50ac0e24aeddf39d21d73fd7067368") + add_versions("v1.4.1", "f3de3b5044a5c640811e87782264acbaf14697cd8c35bb21ddcd4de5664a60d0") + add_versions("v1.3.3", "2689349de9faa35d8bbefddcc7d29d49308a2badd58961cc2b1a8f80c96d0823") + add_versions("v1.3.2", "687148704f278c292962cffe1f440e5a4cc33f2a82f5e5a17b23aab88a282951") + + -- Some old platforms don't support the C++20 standard well. + if on_check then + on_check(function (package) + if package:version():ge("2.0.0") then + assert(package:check_cxxsnippets({test = [[ + #include + template + void test_concept(InputIt) {} + + #include + #include + struct TestCmp { + std::string str_; + auto operator<=>(const TestCmp&) const = default; + }; + std::set s = {TestCmp(), TestCmp()}; + ]]}, {configs = {languages = "c++20"}}), "Require supports C++20 standard.") + end + end) + end + + on_install(function (package) + if package:version():ge("2.0.0") then + os.cp("sources/*.hpp", package:installdir("include/")) + else + os.cp("sources/*.hpp", package:installdir("include/pyincpp/")) + end + end) + + on_test(function (package) + if package:version():ge("2.0.0") then + assert(package:check_cxxsnippets({test = [[ + #include + using namespace pyincpp; + void test() { + Dict> dict = {{"first", {"123", "456"}}, {"second", {"789"}}, {"third", {"12345678987654321", "5"}}}; + assert(dict.keys() == Set({"first", "second", "third"})); + assert(dict["third"][-1].factorial() == 120); + } + ]]}, {configs = {languages = "c++20"}, includes = "pyincpp.hpp"})) + else + assert(package:check_cxxsnippets({test = [[ + #include + using namespace pyincpp; + void test() { + Map> map = {{"first", {"123", "456"}}, {"second", {"789"}}, {"third", {"12345678987654321", "5"}}}; + assert(map.keys() == Set({"first", "second", "third"})); + assert(map["third"][-1].factorial() == 120); + } + ]]}, {configs = {languages = "c++17"}, includes = "pyincpp/pyincpp.hpp"})) + end + end) diff --git a/packages/p/pystring/xmake.lua b/packages/p/pystring/xmake.lua index f6c083ce9..50d1cad51 100644 --- a/packages/p/pystring/xmake.lua +++ b/packages/p/pystring/xmake.lua @@ -5,6 +5,7 @@ package("pystring") add_urls("https://github.com/imageworks/pystring.git") add_versions("2020.02.04", "281419de2f91f9e0f2df6acddfea3b06a43436be") + add_versions("2023.07.23", "76a2024e132bcc83bec1ecfebeacd5d20d490bfe") add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) diff --git a/packages/p/python/xmake.lua b/packages/p/python/xmake.lua index 3fa78d295..73234eaec 100644 --- a/packages/p/python/xmake.lua +++ b/packages/p/python/xmake.lua @@ -1,7 +1,7 @@ package("python") - set_homepage("https://www.python.org/") set_description("The python programming language.") + set_license("PSF") if is_host("windows") then if is_arch("x86", "i386") or os.arch() == "x86" then @@ -16,6 +16,8 @@ package("python") add_versions("3.10.6", "c1a07f7685b5499f58cfad2bb32b394b853ba12b8062e0f7530f2352b0942096") add_versions("3.10.11", "7fac6ed9a58623f31610024d2c4d6abb33fac0cf741ec1a5285d056b5933012e") add_versions("3.11.3", "992648876ecca6cfbe122dc2d9c358c9029d9fdb83ee6edd6e54926bf0360da6") + add_versions("3.11.8", "f5e399d12b00a4f73dc3078b7b4fe900e1de6821aa3e31d1c27c6ef4e33e95d9") + add_versions("3.12.3", "49bbcd200cda1f56452feeaf0954045e85b27a93b929034cc03ab198c4d9662e") else add_urls("https://github.com/xmake-mirror/python-windows/releases/download/$(version)/python-$(version).win64.zip") add_versions("2.7.18", "6680835ed5b818e2c041c7033bea47ace17f6f3b73b0d6efb6ded8598a266754") @@ -28,6 +30,8 @@ package("python") add_versions("3.10.6", "8cbc234939a679687da44c3bbc6d6ce375ea4b84c4fa8dbc1bf5befc43254b58") add_versions("3.10.11", "96663f508643c1efec639733118d4a8382c5c895b82ad1362caead17b643260e") add_versions("3.11.3", "708c4e666989b3b00057eaea553a42b23f692c4496337a91d17aced931280dc4") + add_versions("3.11.8", "2be5fdc87a96659b75f2acd9f4c4a7709fcfccb7a81cd0bd11e9c0e08380e55c") + add_versions("3.12.3", "00a80ccce8738de45ebe73c6084b1ea92ad131ec79cbe5c033a925c761cb5fdc") end else add_urls("https://www.python.org/ftp/python/$(version)/Python-$(version).tgz") @@ -41,6 +45,8 @@ package("python") add_versions("3.10.6", "848cb06a5caa85da5c45bd7a9221bb821e33fc2bdcba088c127c58fad44e6343") add_versions("3.10.11", "f3db31b668efa983508bd67b5712898aa4247899a346f2eb745734699ccd3859") add_versions("3.11.3", "1a79f3df32265d9e6625f1a0b31c28eb1594df911403d11f3320ee1da1b3e048") + add_versions("3.11.8", "d3019a613b9e8761d260d9ebe3bd4df63976de30464e5c0189566e1ae3f61889") + add_versions("3.12.3", "a6b9459f45a6ebbbc1af44f5762623fa355a0c87208ed417628b379d762dddb0") end add_configs("headeronly", {description = "Use header only version.", default = false, type = "boolean"}) @@ -111,16 +117,13 @@ package("python") os.cp("libs/*", package:installdir("lib")) os.cp("*", package:installdir()) local python = path.join(package:installdir("bin"), "python.exe") - if package:version():eq("3.9.10") then - -- https://github.com/xmake-io/xmake-repo/issues/1013 - os.vrunv(python, {"-m", "pip", "install", "--upgrade", "--force-reinstall", "pip==21.3.1"}) - else - os.vrunv(python, {"-m", "pip", "install", "--upgrade", "--force-reinstall", "pip"}) - end + os.vrunv(python, {"-m", "pip", "install", "--upgrade", "--force-reinstall", "pip"}) + os.vrunv(python, {"-m", "pip", "install", "--upgrade", "setuptools"}) os.vrunv(python, {"-m", "pip", "install", "wheel"}) end) on_install("@macosx", "@bsd", "@linux", function (package) + local version = package:version() -- init configs local configs = {"--enable-ipv6", "--with-ensurepip", "--enable-optimizations"} @@ -130,24 +133,30 @@ package("python") table.insert(configs, "--datarootdir=" .. package:installdir("share")) table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) - -- add openssl libs path for detecting - local openssl_dir + -- add openssl libs path local openssl = package:dep("openssl"):fetch() if openssl then + local openssl_dir for _, linkdir in ipairs(openssl.linkdirs) do if path.filename(linkdir) == "lib" then openssl_dir = path.directory(linkdir) - if openssl_dir then - break + else + -- try to find if linkdir is root (brew has linkdir as root and includedirs inside) + for _, includedir in ipairs(openssl.sysincludedirs or openssl.includedirs) do + if includedir:startswith(linkdir) then + openssl_dir = linkdir + break + end end end - end - end - if openssl_dir then - if package:version():ge("3.0") then - table.insert(configs, "--with-openssl=" .. openssl_dir) - else - io.gsub("setup.py", "/usr/local/ssl", openssl_dir) + if openssl_dir then + if version:ge("3.0") then + table.insert(configs, "--with-openssl=" .. openssl_dir) + else + io.gsub("setup.py", "/usr/local/ssl", openssl_dir) + end + break + end end end @@ -176,26 +185,6 @@ package("python") xcode_sdkver = xcode_sdkver or get_config("xcode_sdkver") target_minver = target_minver or get_config("target_minver") - -- TODO will be deprecated after xmake v2.5.1 - xcode_sdkver = xcode_sdkver or get_config("xcode_sdkver_macosx") - if not xcode_dir or not xcode_sdkver then - -- maybe on cross platform, we need find xcode envs manually - local xcode = import("detect.sdks.find_xcode")(nil, {force = true, plat = package:plat(), arch = package:arch()}) - if xcode then - xcode_dir = xcode.sdkdir - xcode_sdkver = xcode.sdkver - end - end - - -- TODO will be deprecated after xmake v2.5.1 - target_minver = target_minver or get_config("target_minver_macosx") - if not target_minver then - local macos_ver = macos.version() - if macos_ver then - target_minver = macos_ver:major() .. "." .. macos_ver:minor() - end - end - if xcode_dir and xcode_sdkver then -- help Python's build system (setuptools/pip) to build things on SDK-based systems -- the setup.py looks at "-isysroot" to get the sysroot (and not at --sysroot) @@ -242,26 +231,31 @@ package("python") table.insert(configs, "LDFLAGS=" .. table.concat(ldflags, " ")) end + local pyver = ("python%d.%d"):format(version:major(), version:minor()) + -- https://github.com/python/cpython/issues/109796 + if version:ge("3.12.0") then + os.mkdir(package:installdir("lib", pyver)) + end + -- unset these so that installing pip and setuptools puts them where we want -- and not into some other Python the user has installed. import("package.tools.autoconf").configure(package, configs, {envs = {PYTHONHOME = "", PYTHONPATH = ""}}) os.vrunv("make", {"-j4", "PYTHONAPPSDIR=" .. package:installdir()}) os.vrunv("make", {"install", "-j4", "PYTHONAPPSDIR=" .. package:installdir()}) - if package:version():ge("3.0") then + if version:ge("3.0") then os.cp(path.join(package:installdir("bin"), "python3"), path.join(package:installdir("bin"), "python")) os.cp(path.join(package:installdir("bin"), "python3-config"), path.join(package:installdir("bin"), "python-config")) end -- install wheel local python = path.join(package:installdir("bin"), "python") - local version = package:version() - local pyver = ("python%d.%d"):format(version:major(), version:minor()) local envs = { PATH = package:installdir("bin"), PYTHONPATH = package:installdir("lib", pyver, "site-packages"), LD_LIBRARY_PATH = package:installdir("lib") } os.vrunv(python, {"-m", "pip", "install", "--upgrade", "--force-reinstall", "pip"}, {envs = envs}) + os.vrunv(python, {"-m", "pip", "install", "--upgrade", "setuptools"}, {envs = envs}) os.vrunv(python, {"-m", "pip", "install", "wheel"}, {envs = envs}) end) diff --git a/packages/q/qmsetup/xmake.lua b/packages/q/qmsetup/xmake.lua new file mode 100644 index 000000000..df1d72140 --- /dev/null +++ b/packages/q/qmsetup/xmake.lua @@ -0,0 +1,21 @@ +package("qmsetup") + set_homepage("https://github.com/stdware/qmsetup") + set_description("CMake Modules and Basic Libraries for C/C++ projects.") + set_license("MIT") + + add_urls("https://github.com/stdware/qmsetup.git") + add_versions("2024.04.23", "0b95afa778b99d9e9de772006555309b74ed32f4") + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + package:addenv("PATH", "bin") + end) + + on_test(function (package) + assert(package:has_cxxincludes("qmsetup/qmsetup_global.h")) + end) diff --git a/packages/q/qt6base/xmake.lua b/packages/q/qt6base/xmake.lua index aaa024060..184daeefd 100644 --- a/packages/q/qt6base/xmake.lua +++ b/packages/q/qt6base/xmake.lua @@ -3,7 +3,10 @@ package("qt6base") set_base("qtbase") add_versions("6.3.0", "dummy") + add_versions("6.5.0", "dummy") add_versions("6.5.1", "dummy") + add_versions("6.5.2", "dummy") + add_versions("6.5.3", "dummy") add_versions("6.6.0", "dummy") on_install("windows|x64", "linux|x86_64", "macosx|x86_64", "mingw|x86_64", function (package) diff --git a/packages/q/qt6lib/xmake.lua b/packages/q/qt6lib/xmake.lua index 120ed5b6b..18ba888d3 100644 --- a/packages/q/qt6lib/xmake.lua +++ b/packages/q/qt6lib/xmake.lua @@ -8,7 +8,10 @@ package("qt6lib") add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) add_versions("6.3.0", "dummy") + add_versions("6.5.0", "dummy") add_versions("6.5.1", "dummy") + add_versions("6.5.2", "dummy") + add_versions("6.5.3", "dummy") add_versions("6.6.0", "dummy") on_load(function (package) diff --git a/packages/q/qt6qml/xmake.lua b/packages/q/qt6qml/xmake.lua new file mode 100644 index 000000000..d4fe754a6 --- /dev/null +++ b/packages/q/qt6qml/xmake.lua @@ -0,0 +1,35 @@ +package("qt6qml") + set_base("qt6lib") + set_kind("library") + + on_load(function (package) + package:add("deps", "qt6core", "qt6gui", {debug = package:is_debug(), version = package:version_str()}) + package:data_set("libname", "Qml") + + package:base():script("load")(package) + end) + + on_test(function (package) + local cxflags + if package:is_plat("windows") then + cxflags = {"/Zc:__cplusplus", "/permissive-"} + else + cxflags = "-fPIC" + end + assert(package:check_cxxsnippets({test = [[ + int test(int argc, char** argv) { + #if QT_VERSION >= 0x50601 + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + #endif + + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); + } + ]]}, {configs = {languages = "c++17", cxflags = cxflags}, includes = {"QGuiApplication", "QQmlApplicationEngine"}})) + end) \ No newline at end of file diff --git a/packages/q/qt6quick/xmake.lua b/packages/q/qt6quick/xmake.lua new file mode 100644 index 000000000..d9f33a69e --- /dev/null +++ b/packages/q/qt6quick/xmake.lua @@ -0,0 +1,29 @@ +package("qt6quick") + set_base("qt6lib") + set_kind("library") + + on_load(function (package) + package:add("deps", "qt6core", "qt6gui", "qt6qml", {debug = package:is_debug(), version = package:version_str()}) + package:data_set("libname", "Quick") + + package:base():script("load")(package) + end) + + on_test(function (package) + local cxflags + if package:is_plat("windows") then + cxflags = {"/Zc:__cplusplus", "/permissive-"} + else + cxflags = "-fPIC" + end + assert(package:check_cxxsnippets({test = [[ + int test(int argc, char** argv) + { + QGuiApplication app(argc, argv); + QQuickView view; + view.setSource(QUrl::fromLocalFile("MyItem.qml")); + view.show(); + return app.exec(); + } + ]]}, {configs = {languages = "c++17", cxflags = cxflags}, includes = {"QGuiApplication", "QQuickView"}})) + end) \ No newline at end of file diff --git a/packages/q/qtawesome/xmake.lua b/packages/q/qtawesome/xmake.lua new file mode 100644 index 000000000..bd08c4448 --- /dev/null +++ b/packages/q/qtawesome/xmake.lua @@ -0,0 +1,52 @@ +package("qtawesome") + set_homepage("https://github.com/gamecreature/QtAwesome") + set_description("QtAwesome - Font Awesome for Qt Applications") + set_license("MIT") + + add_urls("https://github.com/gamecreature/QtAwesome/archive/refs/tags/font-awesome-$(version).tar.gz", + "https://github.com/gamecreature/QtAwesome.git") + + add_versions("6.4.2", "4a1d68ce77c67e35ce6ab9b54c6e093fe3e783123513312d954e093bc950f250") + + add_configs("pro", {description = "Use pro version", default = false, type = "boolean", readonly = true}) + + add_deps("cmake") + add_deps("qt6core", "qt6widgets") + + on_install("windows|x64", "linux|x86_64", "macosx|x86_64", "mingw|x86_64",function (package) + io.writefile("xmake.lua", [[ + option("pro", {showmenu = true, default = false}) + add_rules("mode.debug", "mode.release") + add_requires("qt6core", "qt6widgets") + target("qtawesome") + add_rules("qt.$(kind)") + add_files("QtAwesome/*.cpp", "QtAwesome/*.h") + if has_config("pro") then + add_files("QtAwesome/QtAwesomePro.qrc") + else + add_files("QtAwesome/QtAwesomeFree.qrc") + end + add_headerfiles("(QtAwesome/*.h)") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + add_packages("qt6core", "qt6widgets") + ]]) + import("package.tools.xmake").install(package, {pro = package:config("pro")}) + end) + + on_test(function (package) + local cxflags + if package:is_plat("windows") then + cxflags = {"/Zc:__cplusplus", "/permissive-"} + else + cxflags = "-fPIC" + end + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + fa::QtAwesome* awesome = new fa::QtAwesome(nullptr); + awesome->initFontAwesome(); + } + ]]}, {configs = {languages = "c++17", cxflags = cxflags}})) + end) diff --git a/packages/q/qtbase/xmake.lua b/packages/q/qtbase/xmake.lua index c70d7d52e..7e63910f2 100644 --- a/packages/q/qtbase/xmake.lua +++ b/packages/q/qtbase/xmake.lua @@ -5,7 +5,7 @@ package("qtbase") set_license("LGPL-3") add_configs("shared", {description = "Download shared binaries.", default = true, type = "boolean", readonly = true}) - add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) + add_configs("runtimes", {description = "Set compiler runtimes.", default = "MD", readonly = true}) add_deps("aqt") @@ -147,7 +147,7 @@ package("qtbase") -- special case for cross-compilation since we need binaries we can run on the host if package:is_cross() then local runhost - if is_host("windows") or package:is_plat("mingw") then + if is_host("windows") then runhost = "windows" elseif is_host("linux") then runhost = "linux" @@ -157,8 +157,40 @@ package("qtbase") raise("unhandled host " .. os.host()) end + local hostarch + if is_host("windows") then + local winarch + if os.arch():find("64", 1, true) then + winarch = "64" + else + winarch = "32" + end + + local compiler_version + local vs = toolchain.load("msvc"):config("vs") + if tonumber(vs) >= 2019 or version:ge("6.0") then + compiler_version = "msvc2019" + elseif vs == "2017" or vs == "2015" then + compiler_version = "msvc" .. vs + else + raise("unhandled msvc version " .. vs) + end + + if os.arch() == "x64" then + compiler_version = compiler_version .. "_64" + elseif os.arch() == "arm64" then + compiler_version = compiler_version .. "_arm64" + end + hostarch = "win" .. winarch .. "_" .. compiler_version + elseif is_host("linux") then + hostarch = "gcc_64" + elseif is_host("macosx") then + hostarch = "clang_64" + end + -- download qtbase to bin_host folder - os.vrunv("aqt", {"install-qt", "-O", path.join(installdir, "bin_host"), runhost, "desktop", versionstr, "--archives", "qtbase"}) + os.vrunv("aqt", {"install-qt", "-O", path.join(installdir, "bin_host"), + runhost, "desktop", versionstr, hostarch}) -- add symbolic links for useful tools local tool_folders = {} @@ -183,7 +215,7 @@ package("qtbase") end for folder, tools in pairs(tool_folders) do - for _, file in pairs(os.files(path.join(installdir, "bin_host", versionstr, "*", folder, "*"))) do + for _, file in ipairs(os.files(path.join(installdir, "bin_host", versionstr, "*", folder, "*"))) do local filename = path.filename(file) if tools[filename] then local targetpath = path.join(installdir, folder, filename) diff --git a/packages/q/qtpromise/xmake.lua b/packages/q/qtpromise/xmake.lua new file mode 100644 index 000000000..a6738a028 --- /dev/null +++ b/packages/q/qtpromise/xmake.lua @@ -0,0 +1,37 @@ +package("qtpromise") + set_kind("library", {headeronly = true}) + set_homepage("https://qtpromise.netlify.com") + set_description("Promises/A+ implementation for Qt/C++") + set_license("MIT") + + add_urls("https://github.com/simonbrunel/qtpromise/archive/refs/tags/$(version).tar.gz", + "https://github.com/simonbrunel/qtpromise.git") + + add_versions("v0.7.0", "dda94ad274f667c6f78f1aa0fcd4fc76190d290703c6c3183c2a8413177abc3f") + + add_deps("qt6core") + + on_install("windows|x64", "linux|x86_64", "macosx|x86_64", "mingw|x86_64", function (package) + io.replace("include/QtPromise", "../src/qtpromise/", "", {plain = true}) + os.cp("include", package:installdir()) + os.cp("src/qtpromise/*.h", package:installdir("include")) + os.cp("src/qtpromise/*.inl", package:installdir("include")) + end) + + on_test(function (package) + local cxflags + if package:is_plat("windows") then + cxflags = {"/Zc:__cplusplus", "/permissive-"} + else + cxflags = "-fPIC" + end + assert(package:check_cxxsnippets({test = [[ + #include + QtPromise::QPromise test() { + return {[&]( + const QtPromise::QPromiseResolve& resolve, + const QtPromise::QPromiseReject& reject){}}; + } + ]]}, {configs = {languages = "c++17", cxflags = cxflags}})) + end) + diff --git a/packages/q/quantlib/xmake.lua b/packages/q/quantlib/xmake.lua new file mode 100644 index 000000000..59cd69119 --- /dev/null +++ b/packages/q/quantlib/xmake.lua @@ -0,0 +1,34 @@ +package("quantlib") + set_homepage("http://quantlib.org") + set_description("The QuantLib C++ library") + + add_urls("https://github.com/lballabio/QuantLib/releases/download/v$(version)/QuantLib-$(version).tar.gz", + "https://github.com/lballabio/QuantLib.git") + + add_versions("1.34", "eb87aa8ced76550361771e167eba26aace018074ec370f7af49a01aa56b2fe50") + add_versions("1.33", "4810d789261eb36423c7d277266a6ee3b28a3c05af1ee0d45544ca2e0e8312bd") + + if is_plat("windows") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + add_deps("cmake") + add_deps("boost") + + on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", "cross", function (package) + local configs = {"-DQL_BUILD_BENCHMARK=OFF", "-DQL_BUILD_EXAMPLES=OFF", "-DQL_BUILD_TEST_SUITE=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + using namespace QuantLib; + void test() { + Calendar calendar = TARGET(); + Date todaysDate(19, March, 2014); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/q/quickjs/patches/2024.01.13/msvc.patch b/packages/q/quickjs/patches/2024.01.13/msvc.patch new file mode 100644 index 000000000..8926d1525 --- /dev/null +++ b/packages/q/quickjs/patches/2024.01.13/msvc.patch @@ -0,0 +1,52 @@ +From 5382b796b5b92901d492ec3f63c3447fe3beb1ad Mon Sep 17 00:00:00 2001 +From: SpringFestival <2765864063@qq.com> +Date: Sat, 23 Mar 2024 16:28:15 +0800 +Subject: [PATCH] fix header to fit msvc + +--- + quickjs.h | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/quickjs.h b/quickjs.h +index 7199936..1da1999 100644 +--- a/quickjs.h ++++ b/quickjs.h +@@ -215,9 +215,18 @@ typedef struct JSValue { + #define JS_VALUE_GET_FLOAT64(v) ((v).u.float64) + #define JS_VALUE_GET_PTR(v) ((v).u.ptr) + ++#ifndef __MINGW__COMPILE__ ++ ++#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ val }, tag } ++#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ p }, tag } ++ ++#else ++ + #define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag } + #define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag } + ++#endif ++ + #define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64) + + #define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 } +@@ -670,7 +679,7 @@ static inline JSValue JS_DupValue(JSContext *ctx, JSValueConst v) + JSRefCountHeader *p = (JSRefCountHeader *)JS_VALUE_GET_PTR(v); + p->ref_count++; + } +- return (JSValue)v; ++ return v; + } + + static inline JSValue JS_DupValueRT(JSRuntime *rt, JSValueConst v) +@@ -679,7 +688,7 @@ static inline JSValue JS_DupValueRT(JSRuntime *rt, JSValueConst v) + JSRefCountHeader *p = (JSRefCountHeader *)JS_VALUE_GET_PTR(v); + p->ref_count++; + } +- return (JSValue)v; ++ return v; + } + + int JS_ToBool(JSContext *ctx, JSValueConst val); /* return -1 for JS_EXCEPTION */ +-- +2.40.0.windows.1 diff --git a/packages/q/quickjs/xmake.lua b/packages/q/quickjs/xmake.lua index 87cdbe1f9..2c784accb 100644 --- a/packages/q/quickjs/xmake.lua +++ b/packages/q/quickjs/xmake.lua @@ -1,14 +1,15 @@ package("quickjs") - set_homepage("https://bellard.org/quickjs/") set_description("QuickJS is a small and embeddable Javascript engine") + add_urls("https://github.com/bellard/quickjs.git") + add_versions("2021.03.27", "b5e62895c619d4ffc75c9d822c8d85f1ece77e5b") + add_versions("2023.12.09", "daa35bc1e5d43192098af9b51caeb4f18f73f9f9") + add_versions("2024.01.13", "d6c7d169de6fb2c90cd2bd2226ba9dafdef883ce") + if is_plat("windows") then - add_urls("https://github.com/xmake-mirror/quickjs.git") - add_versions("2021.03.27", "c83f82dce8988334be6c6a7b9b029eb963e7e310") - else - add_urls("https://github.com/bellard/quickjs.git") - add_versions("2021.03.27", "b5e62895c619d4ffc75c9d822c8d85f1ece77e5b") + add_patches("2024.01.13", "patches/2024.01.13/msvc.patch", "4e3b6a346a2b55455cba832d543876daba9f7fce6011ba9f858b2de31f0fd0e8") + add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) end if is_plat("linux", "macosx", "iphoneos", "cross") then @@ -16,7 +17,15 @@ package("quickjs") elseif is_plat("android") then add_syslinks("dl", "m") end - + + on_load("windows", function (package) + if package:is_arch("x64") then + package:add("deps", "mingw-w64") + else + package:add("deps", "llvm-mingw") + end + end) + on_install("linux", "macosx", "iphoneos", "android", "mingw", "cross", function (package) io.writefile("xmake.lua", ([[ add_rules("mode.debug", "mode.release") @@ -29,14 +38,11 @@ package("quickjs") set_languages("c99") add_defines("CONFIG_VERSION=\"%s\"", "_GNU_SOURCE") add_defines("CONFIG_BIGNUM") - if is_plat("windows", "mingw") then + if is_plat("mingw") then add_defines("__USE_MINGW_ANSI_STDIO") end ]]):format(package:version_str())) local configs = {} - if package:config("shared") then - configs.kind = "shared" - end if package:is_plat("cross") then io.replace("quickjs.c", "#define CONFIG_PRINTF_RNDN", "") end @@ -44,13 +50,57 @@ package("quickjs") end) on_install("windows", function (package) - local configs = {} + io.writefile("xmake.lua", ([[ + add_rules("mode.debug", "mode.release") + target("quickjs") + set_kind("$(kind)") + add_files("quickjs*.c", "cutils.c", "lib*.c") + add_headerfiles("quickjs-libc.h") + add_headerfiles("quickjs.h") + add_installfiles("*.js", {prefixdir = "share"}) + set_languages("c99") + add_defines("CONFIG_VERSION=\"%s\"", "_GNU_SOURCE") + add_defines("CONFIG_BIGNUM","__USE_MINGW_ANSI_STDIO", "__MINGW__COMPILE__") + set_prefixname("") + if is_kind("shared") then + add_shflags("-Wl,--output-def,quickjs.def") + add_shflags("-static-libgcc", "-static-libstdc++") + add_shflags("-Wl,-Bstatic -lpthread -Wl,-Bdynamic") + else + set_extension(".lib") + add_syslinks("pthread") + end + ]]):format(package:version_str())) + + local arch_prev = package:arch() + local plat_prev = package:plat() + package:plat_set("mingw") + package:arch_set(os.arch()) + + import("package.tools.xmake").install(package) + + package:plat_set(plat_prev) + package:arch_set(arch_prev) + if package:config("shared") then - configs.kind = "shared" + import("utils.platform.gnu2mslib") + + gnu2mslib("quickjs.lib", "quickjs.def", {plat = package:plat(), arch = package:arch()}) + os.vcp("quickjs.lib", package:installdir("lib")) + os.rm(package:installdir("lib", "quickjs.dll.a")) + else + local mingw = import("detect.sdks.find_mingw")() + local bindir = mingw.bindir + if mingw and bindir then + os.vcp(path.join(bindir, "libgcc_s_seh-1.dll"), package:installdir("bin")) + os.vcp(path.join(bindir, "libwinpthread-1.dll"), package:installdir("bin")) + os.vcp(path.join(bindir, "libstdc++-6.dll"), package:installdir("bin")) + end + + -- TODO: export .def and generate .lib end - import("package.tools.xmake").install(package, configs) end) on_test(function (package) assert(package:has_cfuncs("JS_NewRuntime", {includes = "quickjs.h"})) - end) \ No newline at end of file + end) diff --git a/packages/q/quill/xmake.lua b/packages/q/quill/xmake.lua index 1bb8c85e9..4377ce8fa 100644 --- a/packages/q/quill/xmake.lua +++ b/packages/q/quill/xmake.lua @@ -1,21 +1,24 @@ package("quill") - set_homepage("https://github.com/odygrd/quill") set_description("Asynchronous Low Latency C++ Logging Library") + set_license("MIT") - set_urls("https://github.com/odygrd/quill/archive/refs/tags/v$(version).tar.gz", + set_urls("https://github.com/odygrd/quill/archive/refs/tags/$(version).tar.gz", "https://github.com/odygrd/quill.git") - add_versions("2.8.0", "0461a6c314e3d882f3b9ada487ef1bf558925272509ee41a9fd25f7776db6075") - add_versions("2.9.0", "dec64c0fbb4bfbafe28fdeeeefac10206285bf2be4a42ec5dfb7987ca4ccb372") - add_versions("2.9.1", "921e053118136f63cebb2ca1d7e42456fd0bf9626facb755884709092753c054") - add_versions("3.3.1", "f929d54a115b45c32dd2acd1a9810336d35c31fde9f5581c51ad2b80f980d0d1") + add_versions("v4.3.0", "c97bf3bfac6dfb7ed77fa08d945a490e302ba07e405539fda61985b39750cb29") + add_versions("v3.8.0", "d3e1b349c5d6904c9644e5b79ec65f21692e8094a3d75241a7fe071076eef4dd") + add_versions("v3.6.0", "ba9dc3df262f2e65c57904580cc8407eba9a462001340c17bab7ae1dccddb4bd") + add_versions("v3.3.1", "f929d54a115b45c32dd2acd1a9810336d35c31fde9f5581c51ad2b80f980d0d1") + add_versions("v2.9.0", "dec64c0fbb4bfbafe28fdeeeefac10206285bf2be4a42ec5dfb7987ca4ccb372") + add_versions("v2.9.1", "921e053118136f63cebb2ca1d7e42456fd0bf9626facb755884709092753c054") + add_versions("v2.8.0", "0461a6c314e3d882f3b9ada487ef1bf558925272509ee41a9fd25f7776db6075") if is_plat("macosx") then add_extsources("brew::quill") end - add_configs("fmt_external", {description = "Use external fmt library instead of bundled.", default = false, type = "boolean"}) + add_configs("fmt_external", {description = "Use external fmt library instead of bundled.(deprecated after v4)", default = false, type = "boolean"}) add_configs("noexcept", {description = "Build without exceptions with -fno-exceptions flag", default = false, type = "boolean"}) if is_plat("mingw") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) @@ -28,30 +31,34 @@ package("quill") end on_load(function (package) - if package:config("fmt_external") then - package:add("deps", "fmt") - package:add("defines", "QUILL_FMT_EXTERNAL") + if package:version() and package:version():ge("4.0.0") then + package:set("kind", "library", {headeronly = true}) + else + if package:config("fmt_external") then + package:add("deps", "fmt") + package:add("defines", "QUILL_FMT_EXTERNAL") + end end end) on_install("windows", "linux", "macosx", "mingw", function (package) local configs = {"-DQUILL_ENABLE_INSTALL=ON"} - if package:config("shared") and package:is_plat("windows") then - table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") - end - if package:config("fmt_external") then - table.insert(configs, "-DQUILL_FMT_EXTERNAL=ON") - end - if package:config("noexcept") then - table.insert(configs, "-DQUILL_NO_EXCEPTIONS=ON") + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DQUILL_NO_EXCEPTIONS=" .. (package:config("noexcept") and "ON" or "OFF")) + if package:version() and package:version():lt("4.0.0") then + if package:config("shared") and package:is_plat("windows") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end + if package:config("fmt_external") then + table.insert(configs, "-DQUILL_FMT_EXTERNAL=ON") + end + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) end - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) end) on_test(function (package) - assert(package:check_cxxsnippets({test = [[ + local code = [[ #include void test() { @@ -65,5 +72,23 @@ package("quill") logger->init_backtrace(2, quill::LogLevel::Critical); } - ]]}, {configs = {languages = "c++17"}})) + ]] + if package:version() and package:version():ge("4.0.0") then + code = [[ + #include "quill/Backend.h" + #include "quill/Frontend.h" + #include "quill/LogMacros.h" + #include "quill/Logger.h" + #include "quill/sinks/ConsoleSink.h" + + void test() + { + quill::Backend::start(); + auto console_sink = quill::Frontend::create_or_get_sink("sink_id_1"); + quill::Logger* logger = quill::Frontend::create_or_get_logger("root", std::move(console_sink)); + LOG_INFO(logger, "This is a log info example {}", 123); + } + ]] + end + assert(package:check_cxxsnippets({test = code}, {configs = {languages = "c++17"}})) end) diff --git a/packages/q/quirc/xmake.lua b/packages/q/quirc/xmake.lua new file mode 100644 index 000000000..13078f4f9 --- /dev/null +++ b/packages/q/quirc/xmake.lua @@ -0,0 +1,27 @@ +package("quirc") + set_homepage("https://github.com/dlbeer/quirc") + set_description("QR decoder library") + set_license("ISC") + + add_urls("https://github.com/dlbeer/quirc/archive/refs/tags/$(version).tar.gz", + "https://github.com/dlbeer/quirc.git") + + add_versions("v1.2", "73c12ea33d337ec38fb81218c7674f57dba7ec0570bddd5c7f7a977c0deb64c5") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("quirc") + set_kind("$(kind)") + add_files("lib/*.c") + add_headerfiles("lib/quirc.h") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("quirc_new", {includes = "quirc.h"})) + end) diff --git a/packages/q/qwindowkit/xmake.lua b/packages/q/qwindowkit/xmake.lua new file mode 100644 index 000000000..d66fadfce --- /dev/null +++ b/packages/q/qwindowkit/xmake.lua @@ -0,0 +1,41 @@ +package("qwindowkit") + set_homepage("https://github.com/stdware/qwindowkit") + set_description("Cross-platform frameless window framework for Qt. Support Windows, macOS, Linux.") + set_license("Apache-2.0") + + add_urls("https://github.com/stdware/qwindowkit/archive/refs/tags/$(version).tar.gz", + "https://github.com/stdware/qwindowkit.git") + + add_versions("1.1", "a0102ee4c4fdd08ce35c29a5b9a27384005028b2ab6094f61e467c35917b8c5e") + + add_deps("cmake") + add_deps("qmsetup") + add_deps("qt6gui") + if is_plat("linux") then + add_deps("fontconfig", "libxkbcommon") + end + + add_includedirs("include/QWindowKit") + + on_install("windows|x64", "linux|x86_64", "macosx|x86_64", function (package) + local configs = {} + table.insert(configs, "-Dqmsetup_DIR=" .. package:dep("qmsetup"):installdir("lib")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + local cxflags + if package:is_plat("windows") then + cxflags = {"/Zc:__cplusplus", "/permissive-"} + else + cxflags = "-fPIC" + end + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + QWK::WidgetWindowAgent(nullptr); + } + ]]}, {configs = {languages = "c++17", cxflags = cxflags}})) + end) diff --git a/packages/r/rapidcsv/xmake.lua b/packages/r/rapidcsv/xmake.lua index 881dca741..e340f354d 100644 --- a/packages/r/rapidcsv/xmake.lua +++ b/packages/r/rapidcsv/xmake.lua @@ -4,6 +4,8 @@ package("rapidcsv") set_description("C++ header-only library for CSV parsing (by d99kris)") add_urls("https://github.com/d99kris/rapidcsv/archive/refs/tags/v$(version).zip") + add_versions("8.82", "e07c9355846b62b960ddebf79fef306ac21ee297f19880f237b7da8eb007a056") + add_versions("8.80", "5bdbecc3542a881c058624d63c27574fa171fafe32be857e925fccaa1ae75f46") add_versions("8.50", "c7822b590f48f7d8c9b560a6e2d7e29d7ec2f7b3642eb75ddff40a803949b502") on_install(function (package) @@ -17,4 +19,4 @@ package("rapidcsv") doc.GetColumn("Example").size(); } ]]},{includes = "rapidcsv.h", configs = {languages = "cxx11"}})) - end) \ No newline at end of file + end) diff --git a/packages/r/rapidfuzz/xmake.lua b/packages/r/rapidfuzz/xmake.lua new file mode 100644 index 000000000..a13623bc2 --- /dev/null +++ b/packages/r/rapidfuzz/xmake.lua @@ -0,0 +1,31 @@ +package("rapidfuzz") + set_kind("library", {headeronly = true}) + set_homepage("https://rapidfuzz.github.io/rapidfuzz-cpp") + set_description("Rapid fuzzy string matching in C++ using the Levenshtein Distance") + set_license("MIT") + + add_urls("https://github.com/rapidfuzz/rapidfuzz-cpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/rapidfuzz/rapidfuzz-cpp.git") + + add_versions("v3.0.4", "18d1c41575ceddd6308587da8befc98c85d3b5bc2179d418daffed6d46b8cb0a") + add_versions("v3.0.2", "4fddce5c0368e78bd604c6b820e6be248d669754715e39b4a8a281bda4c06de1") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + using rapidfuzz::fuzz::ratio; + double score1 = rapidfuzz::fuzz::ratio("this is a test", "this is a test!"); + double score2 = rapidfuzz::fuzz::partial_ratio("this is a test", "this is a test!"); + double score3 = rapidfuzz::fuzz::ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear"); + double score4 = rapidfuzz::fuzz::token_sort_ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear"); + double score5 = rapidfuzz::fuzz::token_sort_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear"); + double score6 = rapidfuzz::fuzz::token_set_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear"); + } + ]]},{includes = "rapidfuzz/fuzz.hpp", configs = {languages = "c++17"}})) + end) diff --git a/packages/r/rapidjson/xmake.lua b/packages/r/rapidjson/xmake.lua index ea72302f2..8c2fb2d44 100644 --- a/packages/r/rapidjson/xmake.lua +++ b/packages/r/rapidjson/xmake.lua @@ -2,10 +2,11 @@ package("rapidjson") set_homepage("https://github.com/Tencent/rapidjson") set_description("RapidJSON is a JSON parser and generator for C++.") + set_license("MIT") set_urls("https://github.com/Tencent/rapidjson/archive/$(version).zip", "https://github.com/Tencent/rapidjson.git") - + add_versions("2023.12.6", "6089180ecb704cb2b136777798fa1be303618975") add_versions("2022.7.20", "27c3a8dc0e2c9218fe94986d249a12b5ed838f1d") add_versions("v1.1.0", "8e00c38829d6785a2dfb951bb87c6974fa07dfe488aa5b25deec4b8bc0f6a3ab") -- This commit is used in arrow 7.0.0 https://github.com/apache/arrow/blob/release-7.0.0/cpp/thirdparty/versions.txt#L80 diff --git a/packages/r/rapidxml/xmake.lua b/packages/r/rapidxml/xmake.lua new file mode 100644 index 000000000..925f5ec02 --- /dev/null +++ b/packages/r/rapidxml/xmake.lua @@ -0,0 +1,22 @@ +package("rapidxml") + set_kind("library", {headeronly = true}) + set_homepage("https://sourceforge.net/projects/rapidxml") + set_description("An attempt to create the fastest XML parser possible") + set_license("MIT") + + set_urls("https://sourceforge.net/projects/rapidxml/files/rapidxml/rapidxml%20$(version)/rapidxml-$(version).zip") + + add_versions("1.13", "c3f0b886374981bb20fabcf323d755db4be6dba42064599481da64a85f5b3571") + + on_install(function (package) + os.vcp("**.hpp", package:installdir("include", "rapidxml")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + static void test() { + rapidxml::xml_document<> doc; + doc.parse<0>(""); + } + ]]}, { includes = "rapidxml/rapidxml.hpp" })) + end) diff --git a/packages/r/raygui/xmake.lua b/packages/r/raygui/xmake.lua index d1ce5c5dc..62f1abd90 100644 --- a/packages/r/raygui/xmake.lua +++ b/packages/r/raygui/xmake.lua @@ -8,8 +8,9 @@ package("raygui") "https://github.com/raysan5/raygui.git") add_versions("3.0", "a510eb6efb524dfc8a1a7072bab3d4182a550f9fe86d315ff13a59cfc707f877") add_versions("3.2", "23fb86a0c5fd8216e31c396c5f42de5f11c71f940078fb7d65aa1c39f3895c79") + add_versions("4.0", "299c8fcabda68309a60dc858741b76c32d7d0fc533cdc2539a55988cee236812") - add_deps("raylib 4.x") + add_deps("raylib 5.x") add_configs("implemention", { description = "Define implemention.", default = false, type = "boolean"}) diff --git a/packages/r/raylib-cpp/xmake.lua b/packages/r/raylib-cpp/xmake.lua new file mode 100644 index 000000000..dcd82771b --- /dev/null +++ b/packages/r/raylib-cpp/xmake.lua @@ -0,0 +1,24 @@ +package("raylib-cpp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/RobLoach/raylib-cpp") + set_description("C++ Object Oriented Wrapper for raylib") + set_license("zlib") + + add_urls("https://github.com/RobLoach/raylib-cpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/RobLoach/raylib-cpp.git") + + add_versions("v5.0.1", "6d10469019700fd5993db9a18bdd0ed025105b1bf7dd8916e353eef8bfac6355") + + add_deps("raylib 5.x") + + on_install("windows", "linux", "macosx", "mingw", function (package) + os.cp("include/*.hpp", package:installdir("include/raylib-cpp")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + raylib::Color color(255, 0, 0, 255); + } + ]]}, {configs = {languages = "c++17"}, includes = "raylib-cpp/raylib-cpp.hpp"})) + end) diff --git a/packages/r/raylib/xmake.lua b/packages/r/raylib/xmake.lua index 9967939f1..ff3596192 100644 --- a/packages/r/raylib/xmake.lua +++ b/packages/r/raylib/xmake.lua @@ -18,6 +18,7 @@ package("raylib") add_versions("4.0.0", "be73734815a7ef4eb3130f4a2ecaabb2059602745ae6ce1173201a74034c2ec9") add_versions("4.2.0", "5f79c103b82c577698b01c7b2c166d0c2b51615886b7fabdc671199f0aaf4b38") add_versions("4.5.0", "63deb87ffc32e5eb2023ba763aaea2cb5f41bd37bbc07760651efe251bd76f3d") + add_versions("5.0", "48e477d3dde2e20220572c9f93a332c48cf378fc1e1f205454b975180085565c") else add_urls("https://github.com/raysan5/raylib/archive/$(version).tar.gz", "https://github.com/raysan5/raylib.git") @@ -28,6 +29,7 @@ package("raylib") add_versions("4.0.0", "11f6087dc7bedf9efb3f69c0c872f637e421d914e5ecea99bbe7781f173dc38c") add_versions("4.2.0", "676217604a5830cb4aa31e0ede0e4233c942e2fc5c206691bded58ebcd82a590") add_versions("4.5.0", "163378604f2293ea5ebf3238f50c8926addde72d1a6bc8998ac2e96074ba8af8") + add_versions("5.0", "98f049b9ea2a9c40a14e4e543eeea1a7ec3090ebdcd329c4ca2cf98bc9793482") end if not (is_plat("macosx") and is_arch("x86_64")) then @@ -61,5 +63,5 @@ package("raylib") void test() { InitWindow(100, 100, "hello world!"); } - ]]}, {includes = {"raylib.h"}})) + ]]}, {includes = {"raylib.h"}, configs = {languages = "cxx11"}})) end) diff --git a/packages/r/rcmp/xmake.lua b/packages/r/rcmp/xmake.lua new file mode 100644 index 000000000..6b4d0da80 --- /dev/null +++ b/packages/r/rcmp/xmake.lua @@ -0,0 +1,44 @@ +package("rcmp") + set_homepage("https://github.com/Smertig/rcmp") + set_description("C++17, multi-architecture cross-platform hooking library with clean API.") + set_license("MIT") + + add_urls("https://github.com/Smertig/rcmp/archive/refs/tags/$(version).tar.gz", + "https://github.com/Smertig/rcmp.git") + + add_versions("v0.2.2", "accbf1d2c72b169857900ce816ca3c1718c63c9f67ded413613c236455a331d5") + + add_deps("cmake") + add_deps("nmd") + + on_install("linux", "windows", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + os.rm("external/nmd") + import("package.tools.cmake").install(package, configs, {packagedeps = "nmd", buildir = "build"}) + local version = package:version() + if version then + package:add("defines", "RCMP_VERSION_MAJOR=" .. version:major()) + package:add("defines", "RCMP_VERSION_MINOR=" .. version:minor()) + package:add("defines", "RCMP_VERSION_PATCH=" .. version:patch()) + end + os.cp("include", package:installdir()) + os.trycp("build/**.a", package:installdir("lib")) + os.trycp("build/**.so", package:installdir("lib")) + os.trycp("build/**.dll", package:installdir("bin")) + os.trycp("build/**.lib", package:installdir("lib")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + int bar(float arg) { + return static_cast(arg) + 5; + } + void test() { + rcmp::hook_function<&bar>([](auto original_bar, float arg) { + return original_bar(2 * arg) + 1; + }); + } + ]]}, {configs = {languages = "c++17"}, includes = {"rcmp.hpp"}})) + end) diff --git a/packages/r/re-flex/xmake.lua b/packages/r/re-flex/xmake.lua new file mode 100644 index 000000000..c150785f8 --- /dev/null +++ b/packages/r/re-flex/xmake.lua @@ -0,0 +1,44 @@ +package("re-flex") + set_homepage("https://www.genivia.com/doc/reflex/html") + set_description("A high-performance C++ regex library and lexical analyzer generator with Unicode support.") + set_license("BSD-3-Clause") + + add_urls("https://github.com/Genivia/RE-flex/archive/refs/tags/$(version).tar.gz", + "https://github.com/Genivia/RE-flex.git") + + add_versions("v4.3.0", "1658c1be9fa95bf948a657d75d2cef0df81b614bc6052284935774d4d8551d95") + + on_install(function (package) + io.writefile("xmake.lua",[[ + add_rules("mode.debug", "mode.release") + set_languages("cxx11") + add_includedirs("include") + set_encodings("utf-8") + add_vectorexts("all") + + target("re-flex") + set_kind("$(kind)") + add_headerfiles("include/(reflex/*.h)") + add_files("lib/*.cpp") + add_files("unicode/*.cpp") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + + target("reflex") + set_kind("binary") + add_files("src/*.cpp") + add_deps("re-flex") + ]]) + import("package.tools.xmake").install(package) + package:addenv("PATH", "bin") + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + reflex::Matcher matcher("\w+","114 514 1919 810"); + } + ]]}, {configs = {languages = "cxx11"}})) + end) diff --git a/packages/r/re2/xmake.lua b/packages/r/re2/xmake.lua index cc782bc8d..f1fd45eaa 100644 --- a/packages/r/re2/xmake.lua +++ b/packages/r/re2/xmake.lua @@ -10,15 +10,19 @@ package("re2") add_versions("2021.08.01", "cd8c950b528f413e02c12970dce62a7b6f37733d7f68807e73a2d9bc9db79bc8") add_versions("2021.11.01", "8c45f7fba029ab41f2a7e6545058d9eec94eef97ce70df58e92d85cfc08b4669") add_versions("2022.02.01", "9c1e6acfd0fed71f40b025a7a1dabaf3ee2ebb74d64ced1f9ee1b0b01d22fd27") + add_versions("2023.11.01", "4e6593ac3c71de1c0f322735bc8b0492a72f66ffccfad76e259fa21c41d27d8a") + add_versions("2024.03.01", "7b2b3aa8241eac25f674e5b5b2e23d4ac4f0a8891418a2661869f736f03f57f4") + add_versions("2024.04.01", "3f6690c3393a613c3a0b566309cf04dc381d61470079b653afc47c67fb898198") - add_deps("cmake") + add_deps("cmake", "abseil") if is_plat("linux") then add_syslinks("pthread") end - on_install(function (package) + on_install("macosx", "linux", "windows", "mingw", "cross", function (package) local configs = {"-DRE2_BUILD_TESTING=OFF"} + table.insert(configs, "-DCMAKE_CXX_STANDARD=17") table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) @@ -35,5 +39,5 @@ package("re2") assert(s == "ruby"); assert(i == 1234); } - ]]}, {configs = {languages = "c++11"}, includes = "re2/re2.h"})) + ]]}, {configs = {languages = "c++17"}, includes = "re2/re2.h"})) end) diff --git a/packages/r/reactiveplusplus/xmake.lua b/packages/r/reactiveplusplus/xmake.lua new file mode 100644 index 000000000..09e128523 --- /dev/null +++ b/packages/r/reactiveplusplus/xmake.lua @@ -0,0 +1,41 @@ +package("reactiveplusplus") + set_kind("library", {headeronly = true}) + set_homepage("https://victimsnino.github.io/ReactivePlusPlus/v2/docs/html/md_docs_2readme.html") + set_description("Implementation of async observable/observer (Reactive Programming) in C++ with care about performance and templates in mind in ReactiveX approach") + set_license("BSL-1.0") + + add_urls("https://github.com/victimsnino/ReactivePlusPlus/archive/refs/tags/$(version).tar.gz", + "https://github.com/victimsnino/ReactivePlusPlus.git") + + add_versions("v2.1.1", "0b962478d7c973a1f74062ce7f8d24c2fdcd2733031b1f014e65d252d59ebe6a", + "v2.1.0", "d84a194ef96b92201ea574f81780837c95e8956bbad09b3dc2dc5cef7c2eef98", + "v0.2.3", "9542419f8d7da98126ba2c6ae08fab287b4b3798d89cf75ed9bed2a9e3ec1678") + + add_deps("cmake") + add_includedirs("include/rpp") + + on_install(function (package) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + local snippets + if package:version() and package:version():le("0.2.3") then + snippets = [[ + void test() { + rpp::source::just(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) + .filter([](int v) { return v % 2 == 0; }) + .subscribe([](int v) {}); + } + ]] + else + snippets = [[ + void test() { + rpp::source::just(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) + | rpp::operators::filter([](int v) { return v % 2 == 0; }) + | rpp::operators::subscribe([](int v) {}); + } + ]] + end + assert(package:check_cxxsnippets({test = snippets}, {includes = "rpp/rpp.hpp", configs = {languages = "c++20"}})) + end) diff --git a/packages/r/readline/xmake.lua b/packages/r/readline/xmake.lua index a8099d87e..cd8bb1368 100644 --- a/packages/r/readline/xmake.lua +++ b/packages/r/readline/xmake.lua @@ -3,8 +3,8 @@ package("readline") set_description("Library for command-line editing") set_license("GPL-3.0-or-later") - add_urls("https://ftp.gnu.org/gnu/readline/readline-$(version).tar.gz", - "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz") + add_urls("https://ftpmirror.gnu.org/readline/readline-$(version).tar.gz", + "https://ftp.gnu.org/gnu/readline/readline-$(version).tar.gz") add_versions("8.1", "f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02") add_deps("ncurses") diff --git a/packages/r/recastnavigation/port/xmake.lua b/packages/r/recastnavigation/port/xmake.lua index 5f7d7467f..9ac9a6054 100644 --- a/packages/r/recastnavigation/port/xmake.lua +++ b/packages/r/recastnavigation/port/xmake.lua @@ -1,4 +1,4 @@ -set_xmakever("2.5.1") +set_xmakever("2.8.3") set_languages("cxx11") add_rules("mode.debug", "mode.release") diff --git a/packages/r/recastnavigation/xmake.lua b/packages/r/recastnavigation/xmake.lua index 4efbbac53..0d6d2475b 100644 --- a/packages/r/recastnavigation/xmake.lua +++ b/packages/r/recastnavigation/xmake.lua @@ -4,16 +4,14 @@ package("recastnavigation") set_description("Navigation-mesh Toolset for Games") set_license("zlib") - set_urls("https://github.com/recastnavigation/recastnavigation/archive/refs/tags/$(version).zip", + set_urls("https://github.com/recastnavigation/recastnavigation/archive/refs/tags/$(version).tar.gz", "https://github.com/recastnavigation/recastnavigation.git") - add_versions("1.5.1", "c541b56bab7543d7c741a3153af9a9024165b607de21503b90c9a399e626947a") + add_versions("1.5.1", "fdd0d9ac656993cb34d02d3c6c41e3a3311c1da79b84bbedca71c5d629f915fc") + add_versions("v1.6.0", "d48ca0121962fa0639502c0f56c4e3ae72f98e55d88727225444f500775c0074") on_install(function (package) local configs = {} - if package:config("shared") then - configs.kind = "shared" - end os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") import("package.tools.xmake").install(package, configs) end) diff --git a/packages/r/redis-plus-plus/xmake.lua b/packages/r/redis-plus-plus/xmake.lua index 8bcde7b4a..be7b44927 100644 --- a/packages/r/redis-plus-plus/xmake.lua +++ b/packages/r/redis-plus-plus/xmake.lua @@ -4,6 +4,8 @@ package("redis-plus-plus") add_urls("https://github.com/sewenew/redis-plus-plus/archive/refs/tags/$(version).tar.gz", "https://github.com/sewenew/redis-plus-plus.git") + add_versions("1.3.12", "26c1e45cdbafe1af4d2cf756957b2268baab6f802b53bcdd435864620e2c03c7") + add_versions("1.3.11", "bb4990eed60d3654cd6902b9e67b3ab43e52557e84315560660b0c9e64b6ff77") add_versions("1.3.5", "a49a72fef26ed39d36a278fcc4e4d92822e111697b5992d8f26f70d16edc6c1f") add_versions("1.3.6", "87dcadca50c6f0403cde47eb1f79af7ac8dd5a19c3cad2bb54ba5a34f9173a3e") add_versions("1.3.7", "89cb83b0a23ac5825300c301814eab74aa3cdcfcd12e87d443c2692e367768ba") diff --git a/packages/r/reflect-cpp/patches/0.10.0/cmake.patch b/packages/r/reflect-cpp/patches/0.10.0/cmake.patch new file mode 100644 index 000000000..9205d33b5 --- /dev/null +++ b/packages/r/reflect-cpp/patches/0.10.0/cmake.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cc26bcb..f1c1dcc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,15 +27,11 @@ project(reflectcpp) + + set(CMAKE_CXX_STANDARD 20) + +-if (REFLECTCPP_BUILD_SHARED) +- add_library(reflectcpp SHARED src/yyjson.c) +-else () +- add_library(reflectcpp STATIC src/yyjson.c) +-endif () ++add_library(reflectcpp INTERFACE) + +-target_compile_features(reflectcpp PUBLIC cxx_std_20) ++target_compile_features(reflectcpp INTERFACE cxx_std_20) + +-target_include_directories(reflectcpp PUBLIC $ $ ) ++target_include_directories(reflectcpp INTERFACE $ $ ) + + if (REFLECTCPP_BSON) + find_package(bson-1.0 CONFIG REQUIRED) +@@ -82,7 +78,7 @@ if (REFLECTCPP_YAML) + target_link_libraries(reflectcpp INTERFACE yaml-cpp::yaml-cpp) + endif () + +-target_compile_options(reflectcpp PRIVATE -Wall) ++ + + if (REFLECTCPP_BUILD_TESTS) + if (MSVC) +@@ -109,7 +105,7 @@ install( + file(GLOB_RECURSE RFL_HEADERS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "${CMAKE_CURRENT_LIST_DIR}/include/*" ) + + target_sources(reflectcpp +- PUBLIC ++ INTERFACE + FILE_SET reflectcpp_headers + TYPE HEADERS + BASE_DIRS $ $ diff --git a/packages/r/reflect-cpp/xmake.lua b/packages/r/reflect-cpp/xmake.lua new file mode 100644 index 000000000..1aa041dda --- /dev/null +++ b/packages/r/reflect-cpp/xmake.lua @@ -0,0 +1,99 @@ +package("reflect-cpp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/getml/reflect-cpp") + set_description("A C++20 library for fast serialization, deserialization and validation using reflection. Supports JSON, BSON, CBOR, flexbuffers, msgpack, TOML, XML, YAML / msgpack.org[C++20]") + set_license("MIT") + + add_urls("https://github.com/getml/reflect-cpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/getml/reflect-cpp.git") + + add_versions("v0.10.0", "d2c8876d993ddc8c57c5804e767786bdb46a2bdf1a6cd81f4b14f57b1552dfd7") + + add_patches("0.10.0", "patches/0.10.0/cmake.patch", "b8929c0a13bd4045cbdeea0127e08a784e2dc8c43209ca9f056fff4a3ab5c4d3") + + add_configs("bson", {description = "Enable Bson Support.", default = false, type = "boolean", readonly = true}) + add_configs("yyjson", {description = "Enable yyjson Support.", default = true, type = "boolean"}) + add_configs("cbor", {description = "Enable Cbor Support.", default = false, type = "boolean"}) + add_configs("flatbuffers", {description = "Enable Flexbuffers Support.", default = false, type = "boolean"}) + add_configs("msgpack", {description = "Enable Msgpack Support.", default = false, type = "boolean"}) + add_configs("xml", {description = "Enable Xml Support.", default = false, type = "boolean"}) + add_configs("toml", {description = "Enable Toml Support.", default = false, type = "boolean"}) + add_configs("yaml", {description = "Enable Yaml Support.", default = false, type = "boolean"}) + + add_deps("cmake") + + on_check(function (package) + if package:is_plat("windows") then + import("core.tool.toolchain") + + local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + if msvc then + local vs = msvc:config("vs") + assert(vs and tonumber(vs) >= 2022, "package(reflect-cpp): need vs >= 2022") + end + else + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include + void test() { + constexpr std::string_view message = "Hello, C++20!"; + for (char c : std::views::filter(message, [](char c) { return std::islower(c); })) + std::cout << std::source_location::current().line() << ": " << c << '\n'; + } + ]]}, {configs = {languages = "c++20"}}), "package(reflect-cpp) Require at least C++20.") + end + end) + + on_load(function (package) + if package:config("yyjson") then + package:add("deps", "yyjson") + end + + if package:config("cbor") then + package:add("deps", "tinycbor") + end + + if package:config("flatbuffers") then + package:add("deps", "flatbuffers") + end + + if package:config("msgpack") then + package:add("deps", "msgpack-c") + end + + if package:config("xml") then + package:add("deps", "pugixml") + end + + if package:config("toml") then + package:add("deps", "tomlcpp") + end + + if package:config("yaml") then + package:add("deps", "yaml-cpp") + end + end) + + on_install(function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + struct Person { + std::string first_name; + std::string last_name; + int age; + }; + const auto homer = Person{.first_name = "Homer", + .last_name = "Simpson", + .age = 45}; + void test() { + const std::string json_string = rfl::json::write(homer); + auto homer2 = rfl::json::read(json_string).value(); + } + ]]}, {configs = {languages = "c++20"}})) + end) diff --git a/packages/r/rendergraph/xmake.lua b/packages/r/rendergraph/xmake.lua index 1bce6295e..a859ad8de 100644 --- a/packages/r/rendergraph/xmake.lua +++ b/packages/r/rendergraph/xmake.lua @@ -1,11 +1,13 @@ package("rendergraph") set_homepage("https://github.com/DragonJoker/RenderGraph/") - set_description("Vulkan render graph management library. .") + set_description("Vulkan render graph management library.") set_license("MIT") set_urls("https://github.com/DragonJoker/RenderGraph/archive/refs/tags/$(version).tar.gz", "https://github.com/DragonJoker/RenderGraph.git") + add_versions("v1.4.1", "7096a6384165f98ec3fab995deba10523b42a4f170f9ad9473107bc03eb50a3d") + add_versions("v1.4.0", "0009eac85885231069f7ba644d22a801e71505cc") add_versions("v1.3.0", "b9c68b6949c7b60ffb49f9b9997432aac5baec69") add_versions("v1.2.0", "3f434cc347048656f02bfb87b0ce69ac02b9b18af4262d221c0d4b0ecf1b7bae") add_versions("v1.1.0", "b2fb87cdc0cdec94d4e2a9139533e5f72c0fadfe090c085308edbb84084b4a0c") @@ -23,7 +25,7 @@ package("rendergraph") set_kind("$(kind)") add_includedirs("include") add_files("source/RenderGraph/**.cpp") - set_languages("c++20") + set_languages("c++17") if is_plat("windows") then if is_kind("shared") then add_defines("RenderGraph_EXPORTS") @@ -48,7 +50,7 @@ package("rendergraph") crg::ResourceHandler handler; crg::FrameGraph graph{ handler, "test" }; } - ]]}, {configs = {languages = "cxx20"}, + ]]}, {configs = {languages = "cxx17"}, includes = { "RenderGraph/FrameGraph.hpp", "RenderGraph/ResourceHandler.hpp"}})) diff --git a/packages/r/reproc/patches/0001-to-head.diff b/packages/r/reproc/patches/0001-to-head.diff new file mode 100644 index 000000000..bbf835972 --- /dev/null +++ b/packages/r/reproc/patches/0001-to-head.diff @@ -0,0 +1,289 @@ +diff --git a/.clang-tidy b/.clang-tidy +index 35bb58f..de92997 100644 +--- a/.clang-tidy ++++ b/.clang-tidy +@@ -34,6 +34,7 @@ Checks: + -performance-no-int-to-ptr, + -readability-else-after-return, + -readability-function-cognitive-complexity, ++-readability-identifier-length, + -readability-magic-numbers, + ' + HeaderFilterRegex: '.*reproc\+\+.*$' +diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml +index 4000454..3858f59 100644 +--- a/.github/workflows/main.yml ++++ b/.github/workflows/main.yml +@@ -74,7 +74,7 @@ jobs: + - name: Install (Windows) + if: runner.os == 'Windows' + run: | +- Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') ++ iex "& {$(irm get.scoop.sh)} -RunAsAdmin" + scoop install ninja llvm --global + + if ("${{ matrix.compiler }}" -eq "gcc") { +diff --git a/README.md b/README.md +index 62cc299..e7e940d 100644 +--- a/README.md ++++ b/README.md +@@ -225,6 +225,16 @@ occurred. You can test against these error codes using values from the + + See the examples for more information on how to handle errors when using reproc. + ++Note: ++ ++Both reproc and reproc++ APIs take `options` argument that may define one or more ++`stop` actions such as `terminate` or `kill`. ++For that reason if the child process is being terminated or killed using a signal ++on POSIX, the error code will **not** reflect an error. ++ ++It's up to the downstream project to *interpret* status codes reflecting unexpected ++behaviors alongside error codes (see this [example](https://github.com/DaanDeMeyer/reproc/issues/68#issuecomment-959074504)). ++ + ## Multithreading + + Don't call the same operation on the same child process from more than one +diff --git a/reproc++/include/reproc++/reproc.hpp b/reproc++/include/reproc++/reproc.hpp +index ab6f139..f722245 100644 +--- a/reproc++/include/reproc++/reproc.hpp ++++ b/reproc++/include/reproc++/reproc.hpp +@@ -88,18 +88,18 @@ struct redirect { + + struct options { + struct { +- env::type behavior; ++ reproc::env::type behavior; + /*! Implicitly converts from any STL container of string pairs to the + environment format expected by `reproc_start`. */ +- class env extra; ++ reproc::env extra; + } env = {}; + + const char *working_directory = nullptr; + + struct { +- redirect in; +- redirect out; +- redirect err; ++ struct redirect in; ++ struct redirect out; ++ struct redirect err; + bool parent; + bool discard; + FILE *file; +@@ -138,30 +138,12 @@ enum class stream { + err, + }; + +-class process; +- + namespace event { + +-enum { +- in = 1 << 0, +- out = 1 << 1, +- err = 1 << 2, +- exit = 1 << 3, +- deadline = 1 << 4, +-}; +- +-struct source { +- class process &process; +- int interests; +- int events; +-}; ++struct source; + + } + +-REPROCXX_EXPORT std::error_code poll(event::source *sources, +- size_t num_sources, +- milliseconds timeout = infinite); +- + /*! Improves on reproc's API by adding RAII and changing the API of some + functions to be more idiomatic C++. */ + class process { +@@ -220,4 +202,26 @@ private: + std::unique_ptr impl_; + }; + ++namespace event { ++ ++enum { ++ in = 1 << 0, ++ out = 1 << 1, ++ err = 1 << 2, ++ exit = 1 << 3, ++ deadline = 1 << 4, ++}; ++ ++struct source { ++ class process process; ++ int interests; ++ int events; ++}; ++ ++} ++ ++REPROCXX_EXPORT std::error_code poll(event::source *sources, ++ size_t num_sources, ++ milliseconds timeout = infinite); ++ + } +diff --git a/reproc++/src/reproc.cpp b/reproc++/src/reproc.cpp +index e4eed1a..534e9fb 100644 +--- a/reproc++/src/reproc.cpp ++++ b/reproc++/src/reproc.cpp +@@ -86,8 +86,9 @@ std::pair process::fork(const options &options) noexcept + std::pair process::poll(int interests, + milliseconds timeout) + { +- event::source source{ *this, interests, 0 }; ++ event::source source{ std::move(*this), interests, 0 }; + std::error_code ec = ::reproc::poll(&source, 1, timeout); ++ *this = std::move(source.process); + return { source.events, ec }; + } + +diff --git a/reproc/CMakeLists.txt b/reproc/CMakeLists.txt +index 949cc88..1bb4798 100644 +--- a/reproc/CMakeLists.txt ++++ b/reproc/CMakeLists.txt +@@ -1,6 +1,6 @@ + if(WIN32) + set(REPROC_WINSOCK_LIBRARY ws2_32) +-elseif(NOT APPLE) ++elseif(CMAKE_SYSTEM_NAME MATCHES Linux) + set(REPROC_RT_LIBRARY rt) # clock_gettime + endif() + +diff --git a/reproc/src/clock.windows.c b/reproc/src/clock.windows.c +index 3130f85..8c6c85a 100644 +--- a/reproc/src/clock.windows.c ++++ b/reproc/src/clock.windows.c +@@ -1,4 +1,8 @@ +-#define _WIN32_WINNT _WIN32_WINNT_VISTA ++#ifndef _WIN32_WINNT ++ #define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA ++#elif _WIN32_WINNT < 0x0600 ++ #error "_WIN32_WINNT must be greater than _WIN32_WINNT_VISTA (0x0600)" ++#endif + + #include "clock.h" + +diff --git a/reproc/src/error.windows.c b/reproc/src/error.windows.c +index b8d8234..9459027 100644 +--- a/reproc/src/error.windows.c ++++ b/reproc/src/error.windows.c +@@ -1,4 +1,8 @@ +-#define _WIN32_WINNT _WIN32_WINNT_VISTA ++#ifndef _WIN32_WINNT ++ #define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA ++#elif _WIN32_WINNT < 0x0600 ++ #error "_WIN32_WINNT must be greater than _WIN32_WINNT_VISTA (0x0600)" ++#endif + + #include "error.h" + +diff --git a/reproc/src/handle.windows.c b/reproc/src/handle.windows.c +index e0cd500..f0fbe56 100644 +--- a/reproc/src/handle.windows.c ++++ b/reproc/src/handle.windows.c +@@ -1,4 +1,8 @@ +-#define _WIN32_WINNT _WIN32_WINNT_VISTA ++#ifndef _WIN32_WINNT ++ #define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA ++#elif _WIN32_WINNT < 0x0600 ++ #error "_WIN32_WINNT must be greater than _WIN32_WINNT_VISTA (0x0600)" ++#endif + + #include "handle.h" + +diff --git a/reproc/src/init.windows.c b/reproc/src/init.windows.c +index 8357b7c..52519bf 100644 +--- a/reproc/src/init.windows.c ++++ b/reproc/src/init.windows.c +@@ -1,4 +1,8 @@ +-#define _WIN32_WINNT _WIN32_WINNT_VISTA ++#ifndef _WIN32_WINNT ++ #define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA ++#elif _WIN32_WINNT < 0x0600 ++ #error "_WIN32_WINNT must be greater than _WIN32_WINNT_VISTA (0x0600)" ++#endif + + #include "init.h" + +diff --git a/reproc/src/pipe.windows.c b/reproc/src/pipe.windows.c +index bb355be..befeaf1 100644 +--- a/reproc/src/pipe.windows.c ++++ b/reproc/src/pipe.windows.c +@@ -1,4 +1,8 @@ +-#define _WIN32_WINNT _WIN32_WINNT_VISTA ++#ifndef _WIN32_WINNT ++ #define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA ++#elif _WIN32_WINNT < 0x0600 ++ #error "_WIN32_WINNT must be greater than _WIN32_WINNT_VISTA (0x0600)" ++#endif + + #include "pipe.h" + +diff --git a/reproc/src/process.posix.c b/reproc/src/process.posix.c +index 0f0fe0d..8dcbfd1 100644 +--- a/reproc/src/process.posix.c ++++ b/reproc/src/process.posix.c +@@ -17,6 +17,8 @@ + #include "pipe.h" + #include "strv.h" + ++#define CWD_BUF_SIZE_INCREMENT 4096 ++ + const pid_t PROCESS_INVALID = -1; + + static int signal_mask(int how, const sigset_t *newmask, sigset_t *oldmask) +@@ -51,7 +53,7 @@ static char *path_prepend_cwd(const char *path) + ASSERT(path); + + size_t path_size = strlen(path); +- size_t cwd_size = PATH_MAX; ++ size_t cwd_size = CWD_BUF_SIZE_INCREMENT; + + // We always allocate sufficient space for `path` but do not include this + // space in `cwd_size` so we can be sure that when `getcwd` succeeds there is +@@ -70,7 +72,7 @@ static char *path_prepend_cwd(const char *path) + return NULL; + } + +- cwd_size += PATH_MAX; ++ cwd_size += CWD_BUF_SIZE_INCREMENT; + + char *result = realloc(cwd, cwd_size + path_size + 1); + if (result == NULL) { +diff --git a/reproc/src/process.windows.c b/reproc/src/process.windows.c +index 666f3cb..6e28589 100644 +--- a/reproc/src/process.windows.c ++++ b/reproc/src/process.windows.c +@@ -1,4 +1,8 @@ +-#define _WIN32_WINNT _WIN32_WINNT_VISTA ++#ifndef _WIN32_WINNT ++ #define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA ++#elif _WIN32_WINNT < 0x0600 ++ #error "_WIN32_WINNT must be greater than _WIN32_WINNT_VISTA (0x0600)" ++#endif + + #include "process.h" + +diff --git a/reproc/src/redirect.windows.c b/reproc/src/redirect.windows.c +index c634145..151f407 100644 +--- a/reproc/src/redirect.windows.c ++++ b/reproc/src/redirect.windows.c +@@ -1,4 +1,8 @@ +-#define _WIN32_WINNT _WIN32_WINNT_VISTA ++#ifndef _WIN32_WINNT ++ #define _WIN32_WINNT 0x0600 // _WIN32_WINNT_VISTA ++#elif _WIN32_WINNT < 0x0600 ++ #error "_WIN32_WINNT must be greater than _WIN32_WINNT_VISTA (0x0600)" ++#endif + + #include "redirect.h" + diff --git a/packages/r/reproc/xmake.lua b/packages/r/reproc/xmake.lua index 4333c5191..fc82568a2 100644 --- a/packages/r/reproc/xmake.lua +++ b/packages/r/reproc/xmake.lua @@ -6,27 +6,36 @@ package("reproc") add_urls("https://github.com/DaanDeMeyer/reproc/archive/refs/tags/$(version).tar.gz", "https://github.com/DaanDeMeyer/reproc.git") + add_versions("v14.2.5", "69467be0cfc80734b821c54ada263c8f1439f964314063f76b7cf256c3dc7ee8") add_versions("v14.2.4", "55c780f7faa5c8cabd83ebbb84b68e5e0e09732de70a129f6b3c801e905415dd") + add_patches("v14.2.4", path.join(os.scriptdir(), "patches", "0001-to-head.diff"), + "a5ed818fc36a93bf1f146e6b993e7d0e78daac9c3e5c005f7c84d3e7441f80bb") add_deps("cmake") - if is_plat("linux") or is_plat("mingw") then - add_syslinks("pthread") - end - if is_plat("windows") or is_plat("mingw") then + if is_plat("windows", "mingw") then add_syslinks("ws2_32") end add_configs("c++", { description = "Build reproc C++ library.", default = true, type = "boolean" }) + add_configs("multithreaded", { description = "Enable multithreading.", default = true, type = "boolean" }) on_install(function(package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "RelWithDebInfo")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DREPROC++=" .. (package:config("c++") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs, { buildir = "build" }) + table.insert(configs, "-DREPROC_MULTITHREADED=" .. (package:config("multithreaded") and "ON" or "OFF")) + + if package:config("multithreaded") and not package:is_plat("windows", "android") then + package:add("syslinks", "pthread") + end + + import("package.tools.cmake").install(package, configs) + package:add("linkorders", {"reproc++", "reproc"}) end) on_test(function(package) assert(package:has_cfuncs("reproc_run", { includes = "reproc/run.h" })) end) + diff --git a/packages/r/rhash/xmake.lua b/packages/r/rhash/xmake.lua index f1d696a39..2f986777b 100644 --- a/packages/r/rhash/xmake.lua +++ b/packages/r/rhash/xmake.lua @@ -5,6 +5,7 @@ package("rhash") add_urls("https://sourceforge.net/projects/rhash/files/rhash/$(version)/rhash-$(version)-src.tar.gz") add_urls("https://github.com/rhash/RHash/archive/refs/tags/v$(version).tar.gz") + add_versions("1.4.4", "8e7d1a8ccac0143c8fe9b68ebac67d485df119ea17a613f4038cda52f84ef52a") add_versions("1.4.2", "600d00f5f91ef04194d50903d3c79412099328c42f28ff43a0bdb777b00bec62") add_configs("gettext", {description = "Enable gettext (localization) support.", default = false, type = "boolean"}) diff --git a/packages/r/ricab-scope_guard/xmake.lua b/packages/r/ricab-scope_guard/xmake.lua new file mode 100644 index 000000000..0e282aa6e --- /dev/null +++ b/packages/r/ricab-scope_guard/xmake.lua @@ -0,0 +1,24 @@ +package("ricab-scope_guard") + set_kind("library", {headeronly = true}) + set_homepage("https://ricab.github.io/scope_guard/") + set_description("A modern C++ scope guard that is easy to use but hard to misuse.") + set_license("Unlicense") + + add_urls("https://github.com/ricab/scope_guard/archive/refs/tags/$(version).tar.gz", + "https://github.com/ricab/scope_guard.git") + + add_versions("v1.1.0", "ddaf22ccd07e59af4698e2b9f912171adb664dc88f34b317f39dde3b88de4507") + + on_install(function (package) + os.cp("scope_guard.hpp", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void my_callback() {} + void test() { + auto guard = sg::make_scope_guard(my_callback); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/r/ring-span-lite/xmake.lua b/packages/r/ring-span-lite/xmake.lua new file mode 100644 index 000000000..e0fe68e70 --- /dev/null +++ b/packages/r/ring-span-lite/xmake.lua @@ -0,0 +1,28 @@ +package("ring-span-lite") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/martinmoene/ring-span-lite") + set_description("ring-span lite - A C++yy-like ring_span type for C++98, C++11 and later in a single-file header-only library") + set_license("BSL-1.0") + + add_urls("https://github.com/martinmoene/ring-span-lite/archive/refs/tags/$(version).tar.gz", + "https://github.com/martinmoene/ring-span-lite.git") + + add_versions("v0.7.0", "7650bb1bcf76cb0f7ac75240c5346203cbe7eb7027c0843c60253f6db08a93c1") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package, {"-DRING_SPAN_LITE_OPT_BUILD_TESTS=OFF"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + template< typename T, size_t N > + inline size_t dim( T (&arr)[N] ) { return N; } + void test() { + double arr[] = { 2.0 , 3.0, 5.0, }; + double coeff[] = { 0.25, 0.5, 0.25 }; + nonstd::ring_span buffer( arr, arr + dim(arr), arr, dim(arr) ); + } + ]]}, {includes = "nonstd/ring_span.hpp"})) + end) diff --git a/packages/r/rmlui/xmake.lua b/packages/r/rmlui/xmake.lua index bd97fb083..ac9415d90 100644 --- a/packages/r/rmlui/xmake.lua +++ b/packages/r/rmlui/xmake.lua @@ -1,11 +1,12 @@ package("rmlui") - set_homepage("https://mikke89.github.io/RmlUiDoc/") set_description("RmlUi is the C++ user interface library based on the HTML and CSS standards.") set_license("MIT") add_urls("https://github.com/mikke89/RmlUi/archive/refs/tags/$(version).tar.gz", "https://github.com/mikke89/RmlUi.git") + + add_versions("5.1", "0d28177118f0777e42864b2b7ddfc2937e81eb0dc4c52fc034c71a0c93516626") add_versions("5.0", "1f6eac0e140c35275df32088579fc3a0087fa523082c21c28d5066bd6d18882a") add_configs("freetype", {description = "Building with the default FreeType font engine.", default = true, type = "boolean"}) @@ -14,12 +15,14 @@ package("rmlui") add_configs("svg", {description = "Build with SVG plugin enabled.", default = false, type = "boolean"}) add_configs("lottie", {description = "Build with Lottie plugin enabled.", default = false, type = "boolean"}) - add_deps("cmake") if is_plat("windows") then add_syslinks("shlwapi", "imm32") elseif is_plat("macosx") then add_frameworks("Cocoa") end + + add_deps("cmake") + on_load("windows", "macosx", "linux", function (package) if not package:config("shared") then package:add("defines", "RMLUI_STATIC_LIB") @@ -39,6 +42,10 @@ package("rmlui") end) on_install("windows", "macosx", "linux", function (package) + if package:is_plat("linux") then + io.replace("Include/RmlUi/Core/Types.h", "#include ", "#include \n#include \n", {plain = true}) + end + local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_SAMPLES=OFF"} if package:is_plat("macosx") and package:is_arch("arm64") then table.insert(configs, "-DCMAKE_OSX_ARCHITECTURES=arm64") diff --git a/packages/r/robin-map/xmake.lua b/packages/r/robin-map/xmake.lua index 66047b5b7..40db4eb4c 100644 --- a/packages/r/robin-map/xmake.lua +++ b/packages/r/robin-map/xmake.lua @@ -6,6 +6,9 @@ package("robin-map") set_license("MIT") add_urls("https://github.com/Tessil/robin-map/archive/refs/tags/$(version).tar.gz") + add_versions("v1.3.0", "a8424ad3b0affd4c57ed26f0f3d8a29604f0e1f2ef2089f497f614b1c94c7236") + add_versions("v1.2.2", "c72767ecea2a90074c7efbe91620c8f955af666505e22782e82813c652710821") + add_versions("v1.2.1", "2b54d2c1de2f73bea5c51d5dcbd64813a08caf1bfddcfdeee40ab74e9599e8e3") add_versions("v0.6.3", "e6654c8c2598f63eb0b1d52ff8bdf39cfcc91d81dd5d05274a6dca91241cd72f") add_deps("cmake") diff --git a/packages/r/rocksdb/xmake.lua b/packages/r/rocksdb/xmake.lua index 4f6b09813..2d09c0a02 100644 --- a/packages/r/rocksdb/xmake.lua +++ b/packages/r/rocksdb/xmake.lua @@ -4,6 +4,8 @@ package("rocksdb") add_urls("https://github.com/facebook/rocksdb/archive/refs/tags/$(version).tar.gz", "https://github.com/facebook/rocksdb.git") + add_versions("v9.1.1", "54ca90dd782a988cd3ebc3e0e9ba9b4efd563d7eb78c5e690c2403f1b7d4a87a") + add_versions("v9.0.0", "013aac178aa12837cbfa3b1e20e9e91ff87962ab7fdd044fd820e859f8964f9b") add_versions("v7.10.2", "4619ae7308cd3d11cdd36f0bfad3fb03a1ad399ca333f192b77b6b95b08e2f78") add_deps("cmake") @@ -15,6 +17,7 @@ package("rocksdb") add_configs("zlib", {description = "Build with zlib.", default = false, type = "boolean"}) add_configs("zstd", {description = "Build with zstd.", default = false, type = "boolean"}) add_configs("gflags", {description = "Build with gflags.", default = false, type = "boolean"}) + add_configs("rtti", {description = "Enable RTTI builds.", default = false, type = "boolean"}) if is_plat("linux") then add_syslinks("pthread", "rt", "dl") @@ -24,7 +27,7 @@ package("rocksdb") on_load(function (package) for name, enabled in pairs(package:configs()) do - if not package:extraconf("configs", name, "builtin") then + if (name ~= "rtti") and (not package:extraconf("configs", name, "builtin")) then if enabled then package:add("deps", name) end @@ -32,7 +35,7 @@ package("rocksdb") end end) - on_install("linux", "windows", "macosx", "mingw", function (package) + on_install("linux", "windows|arm", "windows|x64", "macosx", "mingw|x86_64", function (package) local configs = { "-DWITH_ALL_TESTS=OFF", "-DWITH_TESTS=OFF", @@ -44,7 +47,11 @@ package("rocksdb") table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DROCKSDB_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) for name, enabled in pairs(package:configs()) do - if not package:extraconf("configs", name, "builtin") then + if name == "rtti" then + if enabled then + table.insert(configs, "-DUSE_RTTI=1") + end + elseif not package:extraconf("configs", name, "builtin") then table.insert(configs, "-DWITH_" .. name:upper() .. "=" .. (enabled and "ON" or "OFF")) end end diff --git a/packages/r/rpm/xmake.lua b/packages/r/rpm/xmake.lua new file mode 100644 index 000000000..4b71cf6fb --- /dev/null +++ b/packages/r/rpm/xmake.lua @@ -0,0 +1,43 @@ +package("rpm") + set_kind("binary") + set_homepage("https://rpm.org") + set_description("Standard unix software packaging tool") + + add_urls("https://github.com/rpm-software-management/rpm/archive/refs/tags/rpm-$(version)-release.tar.gz") + + add_versions("4.19.0", "19083de356ef80f2497686fd6e52011ec2d3e2dfb481e113a9f4dd1b03b47347") + + add_deps("cmake", "lua", "doxygen") + add_deps("openssl", "popt", "libcap", "acl", "sqlite3", "libarchive", "libmagic", "lzma", "zstd", "bzip2", "lz4", "zlib") + add_deps("elfutils", {configs = {libdw = true}}) + + on_install("linux", function (package) + local configs = { + "-DCMAKE_INSTALL_LOCALSTATEDIR=etc", + "-DCMAKE_INSTALL_SHAREDSTATEDIR=var/lib", + "-DCMAKE_INSTALL_LOCALSTATEDIR=var", + "-DENABLE_NLS=ON", + "-DENABLE_PLUGINS=OFF", + "-DENABLE_PYTHON=OFF", + "-DWITH_AUDIT=OFF", + "-DWITH_INTERNAL_OPENPGP=ON", + "-DWITH_OPENSSL=ON", + "-DWITH_SELINUX=OFF", + "-DENABLE_TESTSUITE=OFF"} + io.replace("macros.in", "@prefix@", package:installdir(), {plain = true}) + io.replace("platform.in", "@prefix@", package:installdir(), {plain = true}) + io.replace("scripts/pkgconfigdeps.sh", "/usr/bin/pkg-config", "pkg-config", {plain = true}) + io.replace("CMakeLists.txt", "pkg_check_modules(LIBELF IMPORTED_TARGET libelf)", "", {plain = true}) + io.replace("CMakeLists.txt", "PkgConfig::LIBELF", "elf z zstd", {plain = true}) + io.replace("CMakeLists.txt", "PkgConfig::LIBARCHIVE", "archive z lzma bz2 zstd lz4", {plain = true}) + io.replace("build/CMakeLists.txt", "PkgConfig::LIBELF", "elf z zstd", {plain = true}) + io.replace("build/CMakeLists.txt", "PkgConfig::LIBDW", "dw", {plain = true}) + io.replace("build/CMakeLists.txt", "target_link_libraries(librpmbuild PUBLIC librpmio librpm)", + "target_link_libraries(librpmbuild PUBLIC librpmio librpm elf dw)", {plain = true}) + import("package.tools.cmake").install(package, configs, {jobs = 1, packagedeps = {"libarchive", "elfutils", "lzma", "zstd", "bzip2", "lz4", "zlib", "popt"}}) + end) + + on_test(function (package) + os.run("rpm --version") + os.run("rpmbuild --version") + end) diff --git a/packages/r/rpmalloc/xmake.lua b/packages/r/rpmalloc/xmake.lua index 698d8537c..26ff06634 100644 --- a/packages/r/rpmalloc/xmake.lua +++ b/packages/r/rpmalloc/xmake.lua @@ -1,34 +1,33 @@ -package("rpmalloc") - set_homepage("https://github.com/mjansson/rpmalloc") - set_description("Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C") - - add_urls("https://github.com/mjansson/rpmalloc/archive/refs/tags/$(version).tar.gz", - "https://github.com/mjansson/rpmalloc.git") - add_versions("1.4.4", "3859620c03e6473f0b3f16a4e965e7c049594253f70e8370fb9caa0e4118accb") - - if is_plat("windows") then - add_syslinks("advapi32") - end - - on_install(function (package) - local configs = {} - io.writefile("xmake.lua", [[ - add_rules("mode.release", "mode.debug") - target("rpmalloc") - set_kind("$(kind)") - add_files("rpmalloc/rpmalloc.c") - add_headerfiles("rpmalloc/(*.h)") - if is_plat("windows") and is_kind("shared") then - add_rules("utils.symbols.export_all") - add_syslinks("advapi32") - end - ]]) - if package:config("shared") then - configs.kind = "shared" - end - import("package.tools.xmake").install(package, configs) - end) - - on_test(function (package) - assert(package:has_cfuncs("rpmalloc", {includes = "rpmalloc.h"})) - end) +package("rpmalloc") + set_homepage("https://github.com/mjansson/rpmalloc") + set_description("Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C") + set_license("MIT") + + add_urls("https://github.com/mjansson/rpmalloc/archive/refs/tags/$(version).tar.gz", + "https://github.com/mjansson/rpmalloc.git") + + add_versions("1.4.5", "2513626697ef72a60957acc8caed17c39931a55c1a49202707de195742683d69") + add_versions("1.4.4", "3859620c03e6473f0b3f16a4e965e7c049594253f70e8370fb9caa0e4118accb") + + if is_plat("windows") then + add_syslinks("advapi32") + end + + on_install("!wasm", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("rpmalloc") + set_kind("$(kind)") + add_files("rpmalloc/rpmalloc.c") + add_headerfiles("rpmalloc/(*.h)") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + add_syslinks("advapi32") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("rpmalloc", {includes = "rpmalloc.h"})) + end) diff --git a/packages/r/rtaudio/xmake.lua b/packages/r/rtaudio/xmake.lua index 67a7c4b3e..43506f96b 100644 --- a/packages/r/rtaudio/xmake.lua +++ b/packages/r/rtaudio/xmake.lua @@ -5,6 +5,7 @@ package("rtaudio") add_urls("https://github.com/thestk/rtaudio/archive/refs/tags/$(version).tar.gz", "https://github.com/thestk/rtaudio.git") + add_versions("6.0.1", "7206c8b6cee43b474f43d64988fefaadfdcfc4264ed38d8de5f5d0e6ddb0a123") add_versions("6.0.0", "bbd637a45ab54ba999883410b9bdd84529c3ac894aee9a68fc3b9a6f0686b9fb") add_configs("asio", {description = "Build ASIO API", default = false, type = "boolean"}) diff --git a/packages/r/rtm/xmake.lua b/packages/r/rtm/xmake.lua index 7bde38796..ed645bd49 100644 --- a/packages/r/rtm/xmake.lua +++ b/packages/r/rtm/xmake.lua @@ -1,16 +1,20 @@ package("rtm") + set_kind("library", {headeronly = true}) set_homepage("https://github.com/nfrechette/rtm") set_description("Realtime Math") set_license("MIT") add_urls("https://github.com/nfrechette/rtm/archive/refs/tags/$(version).tar.gz", "https://github.com/nfrechette/rtm.git") + + add_versions("v2.3.1", "a16fc698feca580533fa12c92fe7d1df4f341f807df7ec314274659fdfec11fb") + add_versions("v2.3.0", "2b5f2c3761bb52ae89802a574e9dc9949aec3b183f7e100b9b66a65adcc6f5ab") add_versions("v2.1.5", "afb05cb00b59498756ca197028de291a1960e58d5f6fcad161d8240682481eae") on_install("linux", "macosx", "windows", function (package) - os.cp("includes", path.join(package:installdir(), "include")) + os.cp("includes/rtm", package:installdir("include")) end) on_test(function (package) - assert(package:has_cxxtypes("rtm::vector4d", {includes = "rtm/types.h"})) + assert(package:has_cxxtypes("rtm::vector4d", {configs = {languages = "c++11"}, includes = "rtm/types.h"})) end) diff --git a/packages/r/rtmidi/xmake.lua b/packages/r/rtmidi/xmake.lua index 4208194a0..4ff2eb518 100644 --- a/packages/r/rtmidi/xmake.lua +++ b/packages/r/rtmidi/xmake.lua @@ -7,6 +7,13 @@ package("rtmidi") add_versions("6.0.0", "ef7bcda27fee6936b651c29ebe9544c74959d0b1583b716ce80a1c6fea7617f0") + if is_plat("linux") then + add_configs("alsa", {default = false, description = "Use alsa api on linux.", type = "boolean"}) + end + if is_plat("linux", "macosx", "bsd") then + add_configs("jack", {default = false, description = "Use jack api on posix.", type = "boolean"}) + end + if is_plat("windows", "mingw") then add_syslinks("winmm") elseif is_plat("macosx") then @@ -21,8 +28,19 @@ package("rtmidi") add_deps("cmake") + on_load("linux", "macosx", "bsd", function(package) + if package:config("alsa") then + package:add("syslinks", "asound") + end + if package:config("jack") then + package:add("syslinks", "jack") + end + end) + on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", "iphoneos", "cross", "wasm", function (package) local configs = {"-DRTMIDI_BUILD_TESTING=OFF"} + table.insert(configs, "-DRTMIDI_API_ALSA=" .. (package:config("alsa") and "ON" or "OFF")) + table.insert(configs, "-DRTMIDI_API_JACK=" .. (package:config("jack") and "ON" or "OFF")) table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) diff --git a/packages/r/ruapu/xmake.lua b/packages/r/ruapu/xmake.lua new file mode 100644 index 000000000..526f14b72 --- /dev/null +++ b/packages/r/ruapu/xmake.lua @@ -0,0 +1,18 @@ +package("ruapu") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/nihui/ruapu") + set_description("Detect CPU features with single-file") + set_license("MIT") + + add_urls("https://github.com/nihui/ruapu/archive/refs/tags/$(version).tar.gz", + "https://github.com/nihui/ruapu.git") + + add_versions("0.1.0", "65fd826ed1772717d4cee70b6620277df0328408612f7643658a0064f1a163ff") + + on_install(function (package) + os.cp("ruapu.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:has_cfuncs("ruapu_init", {includes = "ruapu.h", defines = "RUAPU_IMPLEMENTATION"})) + end) diff --git a/packages/s/s2n-tls/xmake.lua b/packages/s/s2n-tls/xmake.lua new file mode 100644 index 000000000..54f20bb67 --- /dev/null +++ b/packages/s/s2n-tls/xmake.lua @@ -0,0 +1,40 @@ +package("s2n-tls") + set_homepage("https://aws.github.io/s2n-tls/doxygen/s2n_8h.html") + set_description("An implementation of the TLS/SSL protocols") + set_license("Apache-2.0") + + add_urls("https://github.com/aws/s2n-tls/archive/refs/tags/$(version).tar.gz", + "https://github.com/aws/s2n-tls.git") + + add_versions("v1.4.14", "90cd0b7b1e5ebc7e40ba5f810cc24a4d604aa534fac7260dee19a35678e38659") + add_versions("v1.4.12", "d0769f27eb9e6b8fc98d3e8e3eb87ed71e10b08fade87893b293878d84faaceb") + add_versions("v1.4.3", "e42551bdf6595f718e232eb98c4f0e37c7a284f29bfcbc09fa9c0a2145754ab9") + add_versions("v1.3.51", "75c650493c42dddafd5dec6a42f2258ab52e501719ee5a337ec580cc958ea67a") + + add_configs("pq", {description = [[Enables all Post Quantum Crypto code. You likely want this + for older compilers or uncommon platforms.]], default = false, type = "boolean"}) + add_configs("pq_asm", {description = [[Turns on the ASM for PQ Crypto even if it's available for the toolchain. You likely want this on older compilers.]], default = false, type = "boolean"}) + add_configs("stacktrace", {description = [[Enables stacktrace functionality in s2n-tls. Note that this functionality is + only available on platforms that support execinfo.]], default = false, type = "boolean"}) + + if is_plat("linux", "bsd") then + add_syslinks("m", "pthread") + end + + add_deps("cmake", "openssl") + + on_install("linux", "bsd", "cross", function (package) + local configs = {"-DBUILD_TESTING=OFF", "-DUNSAFE_TREAT_WARNINGS_AS_ERRORS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DS2N_LTO=" .. (package:config("lto") and "ON" or "OFF")) + + table.insert(configs, "-DS2N_NO_PQ=" .. (package:config("pq") and "OFF" or "ON")) + table.insert(configs, "-DS2N_NO_PQ_ASM=" .. (package:config("pq_asm") and "OFF" or "ON")) + table.insert(configs, "-DS2N_STACKTRACE=" .. (package:config("stacktrace") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("s2n_connection_new", {includes = "s2n.h"})) + end) diff --git a/packages/s/sailormoon_flags/xmake.lua b/packages/s/sailormoon_flags/xmake.lua new file mode 100644 index 000000000..80c0392b8 --- /dev/null +++ b/packages/s/sailormoon_flags/xmake.lua @@ -0,0 +1,23 @@ +package("sailormoon_flags") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/sailormoon/flags") + set_description("Simple, extensible, header-only C++17 argument parser released into the public domain.") + set_license("MIT") + + add_urls("https://github.com/sailormoon/flags/archive/refs/tags/v$(version).tar.gz") + add_versions("1.1", "f6626c97ba7a45c473557db2e4b68df4d9cda18a8a97c89a5d8d4e5c53dde904") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "flags.h" + void test() { + int argc = 2; + char **argv = NULL; + const flags::args args(argc, argv); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/s/samurai/xmake.lua b/packages/s/samurai/xmake.lua new file mode 100644 index 000000000..8ee0825b2 --- /dev/null +++ b/packages/s/samurai/xmake.lua @@ -0,0 +1,28 @@ +package("samurai") + set_kind("library", {headeronly = true}) + set_homepage("https://hpc-math-samurai.readthedocs.io") + set_description("Intervals coupled with algebra of set to handle adaptive mesh refinement and operators on it.") + set_license("BSD-3-Clause") + + add_urls("https://github.com/hpc-maths/samurai/archive/refs/tags/$(version).tar.gz", + "https://github.com/hpc-maths/samurai.git") + + add_versions("v0.14.0", "287d0526d58b56a653d6cd68085ad2b8e3cbc69153e4fa87bb256305b3726184") + add_versions("v0.12.0", "0cd94bda528085e6261f7e94e69821f81fd55e36560903078beb3c1025372897") + add_versions("v0.10.0", "06739ad6ddc6d62396669e8c0a3806a375c88f3a9345519ae1c1415666229c16") + add_versions("v0.6.0", "bab96adac8e1553b79678a22de2248bec67c7c205b5fd35e9e1aaccaca41286e") + + add_deps("xtensor", "highfive", "pugixml", "fmt") + + on_install("windows|!arm64", "linux", "macosx|!arm64", function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + samurai::CellList<2> cl; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/s/scnlib/xmake.lua b/packages/s/scnlib/xmake.lua index 0de5b47a4..700fce226 100644 --- a/packages/s/scnlib/xmake.lua +++ b/packages/s/scnlib/xmake.lua @@ -1,40 +1,110 @@ package("scnlib") - set_homepage("https://scnlib.readthedocs.io/") set_description("scnlib is a modern C++ library for replacing scanf and std::istream") + set_license("Apache-2.0") + + add_urls("https://github.com/eliaskosunen/scnlib/archive/refs/tags/$(version).tar.gz", + "https://github.com/eliaskosunen/scnlib.git") + + add_versions("v2.0.3", "507ed0e988f1d9460a9c921fc21f5a5244185a4015942f235522fbe5c21e6a51") + add_versions("v2.0.2", "a485076b8710576cf05fbc086d39499d16804575c0660b0dfaeeaf7823660a17") + add_versions("v1.1.2", "5ed3ec742302c7304bf188bde9c4012a65dc8124ff4e1a69b598480d664250e6") + add_versions("v0.4", "f23e66b00c9d38671b39b83c082a5b2db1cf05b3e3eff7b4a769487d9ed9d366") - set_urls("https://github.com/eliaskosunen/scnlib/archive/refs/tags/v$(version).zip") - add_versions("1.1.2", "72bf304662b03e00de5b438b9d4697a081e786d589e067817c356174fb2cb06c") - add_versions("0.4", "49a84f1439e52666532fbd5da3fa1d652622fc7ac376070e330e15c528d38190") + add_configs("header_only", {description = "Use header only version. (deprecated after v2.0.0)", default = false, type = "boolean"}) + add_configs("exceptions", {description = "Enable exception handling", default = true, type = "boolean"}) + add_configs("rtti", {description = "Enable rtti", default = true, type = "boolean"}) + add_configs("regex", {description = "Regex backend to use", type = "string", values = {"std", "boost", "re2"}}) - add_configs("header_only", {description = "Use header only version.", default = false, type = "boolean"}) + add_deps("fast_float") + + on_check("windows", function (package) + import("core.tool.toolchain") + import("core.base.semver") + + if package:version():ge("2.0.3") and package:is_arch("arm.*") then + local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + if msvc then + local vs_sdkver = msvc:config("vs_sdkver") + assert(vs_sdkver and semver.match(vs_sdkver):gt("10.0.19041"), "package(scnlib): need vs_sdkver > 10.0.19041.0") + end + end + end) on_load(function (package) - if package:config("header_only") then + if package:config("header_only") and package:version():lt("2.0.0") then + package:set("kind", "library", {headeronly = true}) package:add("defines", "SCN_HEADER_ONLY=1") else package:add("deps", "cmake") end + + if package:version():ge("2.0.3") then + package:add("links", "scn", "simdutf") + else + package:add("deps", "simdutf") + end + + local regex = package:config("regex") + if regex and regex ~= "std" then + package:add("deps", regex) + end end) - on_install(function (package) - if package:config("header_only") then + on_install("!android and !iphoneos and !wasm", function (package) + if package:config("header_only") and package:version():lt("2.0.0") then os.cp("include/scn", package:installdir("include")) return end - local configs = {"-DSCN_TESTS=OFF", "-DSCN_DOCS=OFF", "-DSCN_EXAMPLES=OFF", "-DSCN_BENCHMARKS=OFF", "-DSCN_PENDANTIC=OFF", "-DSCN_BUILD_FUZZING=OFF"} + + local configs = { + "-DSCN_DISABLE_TOP_PROJECT=ON", + "-DSCN_INSTALL=ON", + "-DSCN_TESTS=OFF", + "-DSCN_DOCS=OFF", + "-DSCN_EXAMPLES=OFF", + "-DSCN_BENCHMARKS=OFF", + "-DSCN_PENDANTIC=OFF", + "-DSCN_BUILD_FUZZING=OFF", + + "-DSCN_USE_EXTERNAL_FAST_FLOAT=ON" + } + + if package:version():le("2.0.2") then + io.replace("cmake/dependencies.cmake", "simdutf 4.0.0", "simdutf", {plain = true}) + table.insert(configs, "-DSCN_USE_EXTERNAL_SIMDUTF=ON") + end + + local regex = package:config("regex") + if regex then + table.insert(configs, "-DSCN_DISABLE_REGEX=OFF") + if regex == "boost" then + regex = "Boost" + end + table.insert(configs, "-DSCN_REGEX_BACKEND=" .. regex) + else + table.insert(configs, "-DSCN_DISABLE_REGEX=ON") + end + + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DSCN_USE_EXCEPTIONS=" .. (package:config("exceptions") and "ON" or "OFF")) + table.insert(configs, "-DSCN_USE_RTTI=" .. (package:config("rtti") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") + if package:config("shared") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end + end import("package.tools.cmake").install(package, configs) end) on_test(function (package) assert(package:check_cxxsnippets({test = [[ - #include - #include - - static void test() { - int i; - scn::prompt("What's your favorite number? ", "{}", i); - printf("Oh, cool, %d!", i); + void test() { + if (const auto result = scn::prompt("What's your favorite number? ", "{}")) { + std::printf("%d, interesting\n", result->value()); + } } - ]]}, {configs = {languages = "c++17"}, includes = "scn/scn.h"})) + ]]}, {configs = {languages = "c++17"}, includes = "scn/scan.h"})) end) diff --git a/packages/s/scons/xmake.lua b/packages/s/scons/xmake.lua index 0c7cce6d3..16bfeceeb 100644 --- a/packages/s/scons/xmake.lua +++ b/packages/s/scons/xmake.lua @@ -6,6 +6,8 @@ package("scons") add_urls("https://github.com/SCons/scons/archive/refs/tags/$(version).zip", "https://github.com/SCons/scons.git") + add_versions("4.7.0", "c783ac12040d1682b81ffd153b48ac1dd9a0eff5a9fbfbb55d86c5d186e88e4a") + add_versions("4.6.0", "ae729515e951cde252205c1c5a7f237025ce204db8e8b9a145616614d87c6f86") add_versions("4.1.0", "106259e92ba001feae5b50175bcec92306d0420bb08229fb037440cf303fcfc3") add_versions("4.3.0", "c8cb3be5861c05a46250c60938857b9711c29a1500001da187e36dc05ee70295") @@ -33,8 +35,11 @@ package("scons") io.writefile("build/doc/man/sconsign.1", "") end + -- fix ml64 support for x64 + -- @see https://stackoverflow.com/questions/58919970/building-x64-nsis-using-vs2012 + io.replace("SCons/Tool/masm.py", "'ml'", "'ml64' if env.get('TARGET_ARCH')=='amd64' else 'ml'", {plain = true}) os.vrunv("python", {"setup.py", "install", "--prefix", package:installdir()}) - if package:is_plat("windows") then + if is_host("windows", "msys") then os.mv(package:installdir("Scripts", "*"), package:installdir("bin")) os.rmdir(package:installdir("Scripts")) end diff --git a/packages/s/seasocks/xmake.lua b/packages/s/seasocks/xmake.lua new file mode 100644 index 000000000..d57510115 --- /dev/null +++ b/packages/s/seasocks/xmake.lua @@ -0,0 +1,46 @@ +package("seasocks") + set_homepage("https://github.com/mattgodbolt/seasocks") + set_description("Simple, small, C++ embeddable webserver with WebSockets support") + set_license("BSD-2-Clause") + + add_urls("https://github.com/mattgodbolt/seasocks/archive/refs/tags/$(version).tar.gz", + "https://github.com/mattgodbolt/seasocks.git") + + add_versions("v1.4.6", "fc69636ce1205d338d4c02784333b04cd774fa368843fcf9f4fe6f8530a2cd67") + + add_configs("deflate", {description = "Include support for deflate (requires zlib).", default = false, type = "boolean"}) + + if is_plat("windows") then + add_syslinks("ws2_32") + elseif is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + add_deps("cmake") + add_deps("python", {kind = "binary"}) + + on_load(function (package) + if package:config("deflate") then + package:add("deps", "zlib") + end + end) + + on_install("windows", "linux", "bsd", function (package) + local configs = {"-DUNITTESTS=OFF", "-DSEASOCKS_EXAMPLE_APP=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DSEASOCKS_SHARED=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DDEFLATE_SUPPORT=" .. (package:config("deflate") and "ON" or "OFF")) + if package:is_plat("windows") and package:config("shared") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + std::string dir = seasocks::getWorkingDir(); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/s/semver/xmake.lua b/packages/s/semver/xmake.lua index 5dcd17381..78ce18240 100644 --- a/packages/s/semver/xmake.lua +++ b/packages/s/semver/xmake.lua @@ -1,9 +1,12 @@ package("semver") + set_kind("library", {headeronly = true}) set_homepage("https://github.com/Neargye/semver") set_description("Semantic Versioning for modern C++") set_license("MIT") add_urls("https://github.com/Neargye/semver.git") + + add_versions("2023.10.04", "92df4b229d0f43382f5934ed50d6489d44e4a9c4") add_versions("2023.05.27", "492ba1beb1da6a4f150b8ca45985290f152396ed") on_install(function (package) diff --git a/packages/s/sentry-native/xmake.lua b/packages/s/sentry-native/xmake.lua index 50a1e402f..00f704328 100644 --- a/packages/s/sentry-native/xmake.lua +++ b/packages/s/sentry-native/xmake.lua @@ -5,6 +5,12 @@ package("sentry-native") set_urls("https://github.com/getsentry/sentry-native/releases/download/$(version)/sentry-native.zip", "https://github.com/getsentry/sentry-native.git") + add_versions("0.7.5", "d9f1b44753fae3e9462aa1e6fd3021cb0ff2f51c1a1fa02b34510e3bc311f429") + add_versions("0.7.2", "afb44d5cc4e0ec5f2e8068132c68256959188f6bf015e1837e7cc687014b9c70") + add_versions("0.7.1", "c450a064b0dbb1883a355455db2b6469abef59c04686a53719384bbc7ff507d3") + add_versions("0.7.0", "4dfccc879a81771b9da1c335947ffc9e5987ca3d16b3035efa2c66a06f727543") + add_versions("0.6.7", "37d7880f837c85d0b19cac106b631c7b4524ff13f11cd31e8337da10842ea779") + add_versions("0.6.6", "7a98467c0b2571380a3afc5e681cb13aa406a709529be12d74610b0015ccde0c") add_versions("0.6.5", "5f74a5c5c3abc6e1e7825d3306be9e3b3fd4e0f586f3cf7e86607d6f56a71995") add_versions("0.6.4", "e00278bf9a4821bb4008985a5a552a84aba6ebb06d3f9e828082fcbf06b04a38") add_versions("0.6.3", "6b515c17a9b860ea47c6a5fd7abdfdc89b4b8cbc654c23a8bb42a39bfcb87ad9") @@ -35,17 +41,25 @@ package("sentry-native") package:add("defines", "SENTRY_BUILD_STATIC") end + local backend + if package:is_plat("linux") then -- linux defaults to breakpad before 0.7 and then defaults to crashpad + backend = package:version() and package:version():ge("0.7") and "crashpad" or "breakpad" + end if package:config("backend") == "crashpad" then + backend = "crashpad" + elseif package:config("backend") == "breakpad" then + backend = "breakpad" + end + + if backend == "crashpad" then package:add("links", "sentry", "crashpad_client", "crashpad_util", "crashpad_minidump", "crashpad_handler_lib", "mini_chromium", "crashpad_tools", "crashpad_compat", "crashpad_snapshot") package:add("deps", "zlib") - elseif package:config("backend") == "breakpad" then - package:add("links", "sentry", "breakpad_client") - elseif package:is_plat("linux") then -- linux defaults to breakpad + elseif backend == "breadpad" then package:add("links", "sentry", "breakpad_client") end end) - on_install("windows|x86", "windows|x64", "linux", "macosx", function (package) -- TODO: to enable android you will need to figure out the order of libs + on_install("windows|x86", "windows|x64", "linux", "macosx|x86_64", function (package) -- TODO: to enable android you will need to figure out the order of libs local opt = {} local configs = {} table.insert(configs, "-DSENTRY_BUILD_EXAMPLES=OFF") diff --git a/packages/s/sfl-library/xmake.lua b/packages/s/sfl-library/xmake.lua new file mode 100644 index 000000000..d207a8297 --- /dev/null +++ b/packages/s/sfl-library/xmake.lua @@ -0,0 +1,19 @@ +package("sfl-library") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/slavenf/sfl-library") + set_description("C++11 header-only library. Small and static vector. Small and static flat map/set. Compact vector. Segmented vector.") + set_license("zlib") + + add_urls("https://github.com/slavenf/sfl-library/archive/refs/tags/$(version).tar.gz", + "https://github.com/slavenf/sfl-library.git") + + add_versions("1.6.0", "f5121d95c2f3922da4f1cec9bb6045d8733892ddc55ee3c47c99e761e5df5ec4") + add_versions("1.5.0", "767d9b3627540071d2a80f18f034d80d6e9eaffc027876c7898c51aeebd3bf37") + + on_install(function (package) + os.vcp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:has_cxxtypes("sfl::small_vector", {configs = {languages = "c++11"}, includes = "sfl/small_vector.hpp"})) + end) diff --git a/packages/s/sfml/xmake.lua b/packages/s/sfml/xmake.lua index e2bbf3a43..fd97debdf 100644 --- a/packages/s/sfml/xmake.lua +++ b/packages/s/sfml/xmake.lua @@ -23,6 +23,8 @@ package("sfml") if is_plat("macosx") then add_extsources("brew::sfml/sfml-all") + elseif not is_host("windows") then + add_extsources("pkgconfig::sfml-all") end on_component("graphics", function (package, component) @@ -33,6 +35,7 @@ package("sfml") component:add("links", "sfml-graphics" .. e) component:add("deps", "window", "system") component:add("extsources", "brew::sfml/sfml-graphics") + component:add("extsources", "pkgconfig::sfml-graphics") end) on_component("window", function (package, component) @@ -43,6 +46,7 @@ package("sfml") component:add("links", "sfml-window" .. e) component:add("deps", "system") component:add("extsources", "brew::sfml/sfml-window") + component:add("extsources", "pkgconfig::sfml-window") if not package:config("shared") then if package:is_plat("windows", "mingw") then component:add("syslinks", "opengl32", "gdi32", "advapi32", "user32") @@ -66,6 +70,7 @@ package("sfml") component:add("links", "sfml-audio" .. e) component:add("deps", "system") component:add("extsources", "brew::sfml/sfml-audio") + component:add("extsources", "pkgconfig::sfml-audio") if not package:config("shared") and package:is_plat("windows", "mingw") then component:add("links", "openal32", "flac", "vorbisenc", "vorbisfile", "vorbis", "ogg") end @@ -79,6 +84,7 @@ package("sfml") component:add("links", "sfml-network" .. e) component:add("deps", "system") component:add("extsources", "brew::sfml/sfml-network") + component:add("extsources", "pkgconfig::sfml-network") component:add("extsources", "apt::sfml-network") if not package:config("shared") and package:is_plat("windows", "mingw") then component:add("syslinks", "ws2_32") @@ -98,6 +104,7 @@ package("sfml") component:add("deps", "main") end component:add("extsources", "brew::sfml/sfml-system") + component:add("extsources", "pkgconfig::sfml-system") if not package:config("shared") then if package:is_plat("windows", "mingw") then component:add("syslinks", "winmm") diff --git a/packages/s/sfparse/xmake.lua b/packages/s/sfparse/xmake.lua new file mode 100644 index 000000000..0c2d1d5c6 --- /dev/null +++ b/packages/s/sfparse/xmake.lua @@ -0,0 +1,27 @@ +package("sfparse") + set_homepage("https://github.com/ngtcp2/sfparse") + set_description("Structured Field Values parser") + set_license("MIT") + + set_urls("https://github.com/ngtcp2/sfparse.git", {submodules = false}) + add_versions("2024.05.12", "c669673012f9d535ec3bcf679fe911c8c75a479f") + + add_includedirs("include", "include/sfparse") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + target("sfparse") + set_kind("$(kind)") + add_files("sfparse.c") + add_headerfiles("sfparse.h", {prefixdir = "sfparse"}) + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("sf_parser_param", {includes = "sfparse.h"})) + end) diff --git a/packages/s/shaderc/xmake.lua b/packages/s/shaderc/xmake.lua index 4d5561706..2288f1598 100644 --- a/packages/s/shaderc/xmake.lua +++ b/packages/s/shaderc/xmake.lua @@ -1,27 +1,40 @@ package("shaderc") - set_homepage("https://github.com/google/shaderc") set_description("A collection of tools, libraries, and tests for Vulkan shader compilation.") set_license("Apache-2.0") add_urls("https://github.com/google/shaderc/archive/refs/tags/$(version).tar.gz", "https://github.com/google/shaderc.git") + + add_versions("v2024.1", "eb3b5f0c16313d34f208d90c2fa1e588a23283eed63b101edd5422be6165d528") + add_versions("v2024.0", "c761044e4e204be8e0b9a2d7494f08671ca35b92c4c791c7049594ca7514197f") add_versions("v2022.2", "517d36937c406858164673db696dc1d9c7be7ef0960fbf2965bfef768f46b8c0") - if is_plat("windows") then + add_configs("binaryonly", {description = "Only use binary program.", default = false, type = "boolean"}) + add_configs("exceptions", {description = "Enable exception handling", default = true, type = "boolean"}) + if is_plat("windows", "wasm") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end - add_deps("cmake", "python 3.x", {kind = "binary"}) + add_deps("cmake") if is_plat("linux") then add_syslinks("pthread") end on_load(function (package) - if package:is_binary() then + if package:config("binaryonly") then package:set("kind", "binary") end + + if package:version():ge("2022.3") then + package:add("deps", "glslang") + else + -- real version: glslang <1.3.231.0 + package:add("deps", "glslang <=1.3.211") + end + package:add("deps", "spirv-tools", "spirv-headers") + if package:config("shared") then package:add("links", "shaderc_shared") else @@ -35,22 +48,87 @@ package("shaderc") end end) - on_install("linux", "windows", "macosx", function (package) - os.execv("python3", {"./utils/git-sync-deps"}) - package:addenv("PATH", "bin") - local configs = {"-DSHADERC_ENABLE_EXAMPLES=OFF", "-DSHADERC_SKIP_TESTS=ON", "-DSHADERC_ENABLE_COPYRIGHT_CHECK=OFF"} + on_install(function (package) + local opt = {} + opt.packagedeps = {"glslang", "spirv-tools", "spirv-headers"} + io.replace("CMakeLists.txt", "add_subdirectory(third_party)", "", {plain = true}) + io.replace("libshaderc_util/src/compiler.cc", "SPIRV/GlslangToSpv.h", "glslang/SPIRV/GlslangToSpv.h", {plain = true}) + + if not package:has_tool("sh", "link") then + local links = {} + for _, dep in ipairs({"glslang", "spirv-tools"}) do + local fetchinfo = package:dep(dep):fetch() + if fetchinfo then + for _, link in ipairs(fetchinfo.links) do + table.insert(links, link) + end + end + end + if package:version():ge("2023.8") then + io.replace("libshaderc_util/CMakeLists.txt", "glslang SPIRV", table.concat(links, " "), {plain = true}) + else + io.replace("glslc/CMakeLists.txt", "glslang OSDependent OGLCompiler HLSL glslang SPIRV", "", {plain = true}) + io.replace("libshaderc_util/CMakeLists.txt", "glslang OSDependent OGLCompiler HLSL glslang SPIRV", table.concat(links, " "), {plain = true}) + end + links = table.join({"shaderc", "shaderc_util"}, links) + io.replace("glslc/CMakeLists.txt", "shaderc_util shaderc", table.concat(links, " "), {plain = true}) + end + -- glslc --version + local version_str = format("shaderc %s\nspirv-tools %s\nglslang %s\0", + package:version(), + package:dep("spirv-tools"):version(), + package:dep("glslang"):version() + ) + + -- const char[] = {'s', 'h' ...}; + local version_c_array = "{" + for i = 1, #version_str do + local char = version_str:sub(i, i) + if char == "\n" then + char = [[\n]] + end + if char == "\0" then + char = [[\0]] + end + version_c_array = format([[%s'%s',]], version_c_array, char) + end + version_c_array = version_c_array .. "}" + + -- remove python codegen + io.writefile("glslc/src/build-version.inc", version_c_array) + io.replace("glslc/CMakeLists.txt", "add_dependencies(glslc_exe build-version)", "", {plain = true}) + + local configs = { + "-DSHADERC_SKIP_EXAMPLES=ON", + "-DSHADERC_SKIP_TESTS=ON", + "-DSHADERC_ENABLE_COPYRIGHT_CHECK=OFF" + } table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) if package:is_plat("windows") then + io.replace("CMakeLists.txt", [[set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL")]], "", {plain = true}) + io.replace("CMakeLists.txt", [[set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>")]], "", {plain = true}) table.insert(configs, "-DSHADERC_ENABLE_SHARED_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "OFF" or "ON")) end - import("package.tools.cmake").install(package, configs) + + if package:config("exceptions") then + table.insert(configs, "-DDISABLE_EXCEPTIONS=OFF") + if package:is_plat("windows") and package:has_tool("cxx", "cl", "clang_cl") then + opt.cxflags = "/EHsc" + end + else + table.insert(configs, "-DDISABLE_EXCEPTIONS=ON") + end + import("package.tools.cmake").install(package, configs, opt) + package:addenv("PATH", "bin") end) on_test(function (package) - os.vrun("glslc --version") + if not package:is_cross() then + os.vrun("glslc --version") + end + if not package:is_binary() then assert(package:has_cfuncs("shaderc_compiler_initialize", {includes = "shaderc/shaderc.h"})) end end) - diff --git a/packages/s/shaderwriter/xmake.lua b/packages/s/shaderwriter/xmake.lua index 3b567be27..ca2474019 100644 --- a/packages/s/shaderwriter/xmake.lua +++ b/packages/s/shaderwriter/xmake.lua @@ -15,6 +15,7 @@ package("shaderwriter") add_versions("2.5", "4b456bb6f36103936f4862edff397af943a40621") add_versions("2.6", "ab06f63bb941ac60437120e3221c024555a2bcaa") add_versions("2.6.1", "047ca8f5a2d2ad2fa569bd53a8325939a9d17f6c") + add_versions("2.7", "c8af31d7589c729c450c8d08f56677bd2d355cfb") add_deps("cmake") diff --git a/packages/s/sheenbidi/xmake.lua b/packages/s/sheenbidi/xmake.lua index 6a9f53c73..a3f860543 100644 --- a/packages/s/sheenbidi/xmake.lua +++ b/packages/s/sheenbidi/xmake.lua @@ -6,6 +6,7 @@ package("sheenbidi") add_urls("https://github.com/Tehreer/SheenBidi/archive/refs/tags/$(version).tar.gz", "https://github.com/Tehreer/SheenBidi.git") + add_versions("v2.7", "620f732141fd62354361f921a67ba932c44d94e73f127379a0c73ad40c7fa6e0") add_versions("v2.6", "f538f51a7861dd95fb9e3f4ad885f39204b5c670867019b5adb7c4b410c8e0d9") on_install(function (package) diff --git a/packages/s/simdcomp/xmake.lua b/packages/s/simdcomp/xmake.lua new file mode 100644 index 000000000..94f0b5640 --- /dev/null +++ b/packages/s/simdcomp/xmake.lua @@ -0,0 +1,26 @@ +package("simdcomp") + set_homepage("https://github.com/lemire/simdcomp") + set_description("A simple C library for compressing lists of integers using binary packing") + set_license("BSD-3-Clause") + + add_urls("https://github.com/lemire/simdcomp.git") + add_versions("2023.08.19", "009c67807670d16f8984c0534aef0e630e5465a4") + + on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", function(package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + target("simdcomp") + set_kind("$(kind)") + add_files("src/*.c") + add_includedirs("include") + add_headerfiles("include/*.h") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function(package) + assert(package:has_cfuncs("maxbits", {includes = "simdcomputil.h"})) + end) diff --git a/packages/s/simde/xmake.lua b/packages/s/simde/xmake.lua index a775472df..ad8811f9e 100644 --- a/packages/s/simde/xmake.lua +++ b/packages/s/simde/xmake.lua @@ -6,9 +6,10 @@ package("simde") set_urls("https://github.com/simd-everywhere/simde/releases/download/v$(version)/simde-amalgamated-$(version).tar.xz") + add_versions("0.8.2", "59068edc3420e75c5ff85ecfd80a77196fb3a151227a666cc20abb313a5360bf") add_versions("0.7.2", "544c8aac764f0e24e444b1a7842d0314fa0231802d3b1b2020a03677b5be6142") - on_install(function (package) + on_install("windows|x86", "windows|x64", "macosx", "linux", "mingw", "iphoneos", "bsd", "wasm", function (package) os.cp("*", package:installdir("include")) end) diff --git a/packages/s/simdjson/xmake.lua b/packages/s/simdjson/xmake.lua index bda84308c..f18da6a04 100644 --- a/packages/s/simdjson/xmake.lua +++ b/packages/s/simdjson/xmake.lua @@ -6,12 +6,18 @@ package("simdjson") add_urls("https://github.com/simdjson/simdjson/archive/refs/tags/$(version).tar.gz", "https://github.com/simdjson/simdjson.git") - add_versions("v0.9.5", "db69582fc5e4ece8c0a6a64894efeef475fe22fe466bd67195422de11b08b4d2") - add_versions("v0.9.7", "a21279ae4cf0049234a822c5c3550f99ec1707d3cda12156d331dcc8cd411ba0") - add_versions("v1.0.0", "fe54be1459b37e88abd438b01968144ed4774699d1272dd47a790b9362c5df42") - add_versions("v1.1.0", "9effcb21fe48e4bcc9b96031e60c3911c58aa656ad8c78212d269c0db9e0133e") - add_versions("v3.0.0", "e6dd4bfaad2fd9599e6a026476db39a3bb9529436d3508ac3ae643bc663526c5") + add_versions("v3.9.3", "2e3d10abcde543d3dd8eba9297522cafdcebdd1db4f51b28f3bc95bf1d6ad23c") + add_versions("v3.9.2", "79fbe700f4ac3dd69c4f08275af58399daabd612bca0c0465aea959c60256651") + add_versions("v3.9.1", "a4b6e7cd83176e0ccb107ce38521da40a8df41c2d3c90566f2a0af05b0cd05c4") + add_versions("v3.8.0", "e28e3f46f0012d405b67de6c0a75e8d8c9a612b0548cb59687822337d73ca78b") + add_versions("v3.7.0", "27315c4861893b3e036c1f672b1c238ee86be6edb84c0824d1ed20dea5999777") + add_versions("v3.6.0", "9eab3197231382b8b99d14d8ca647d6ab6bea1b40008df086d25e6f687309bf6") add_versions("v3.1.1", "4fcb1c9b1944e2eb8a4a4a22c979e2827165216f859e94d93c846c1261e0e432") + add_versions("v3.0.0", "e6dd4bfaad2fd9599e6a026476db39a3bb9529436d3508ac3ae643bc663526c5") + add_versions("v1.1.0", "9effcb21fe48e4bcc9b96031e60c3911c58aa656ad8c78212d269c0db9e0133e") + add_versions("v1.0.0", "fe54be1459b37e88abd438b01968144ed4774699d1272dd47a790b9362c5df42") + add_versions("v0.9.7", "a21279ae4cf0049234a822c5c3550f99ec1707d3cda12156d331dcc8cd411ba0") + add_versions("v0.9.5", "db69582fc5e4ece8c0a6a64894efeef475fe22fe466bd67195422de11b08b4d2") add_configs("threads", { description = "Enable threads.", default = true, type = "boolean"}) add_configs("noexceptions", { description = "Disable exceptions.", default = false, type = "boolean"}) diff --git a/packages/s/simdutf/xmake.lua b/packages/s/simdutf/xmake.lua index 4197a56a0..6d2451162 100644 --- a/packages/s/simdutf/xmake.lua +++ b/packages/s/simdutf/xmake.lua @@ -6,6 +6,11 @@ package("simdutf") add_urls("https://github.com/simdutf/simdutf/archive/refs/tags/$(version).tar.gz", "https://github.com/simdutf/simdutf.git") + add_versions("v5.2.8", "2706f1bef85a6d8598f82defd3848f1c5100e2e065c5d416d993118b53ea8d77") + add_versions("v5.2.6", "ab9e56facf7cf05f4e9d062a0adef310fc6a0f82a8132e8ec1e1bb7ab5e234df") + add_versions("v5.2.4", "36281d6489a4a8c2b5bfac2d41c03dce8fc89ec1cda15cc05c53d44f5ad30b4d") + add_versions("v5.2.3", "dfa55d85c3ee51e9b52e55c02701b16f83dcf1921e1075b67f99b1036df5adb8") + add_versions("v4.0.9", "599e6558fc8d06f8346e5f210564f8b18751c93d83bce1a40a0e6a326c57b61e") add_versions("v3.2.17", "c24e3eec1e08522a09b33e603352e574f26d367a7701bf069a65881f64acd519") add_configs("iconv", {description = "Whether to use iconv as part of the CMake build if available.", default = false, type = "boolean"}) @@ -24,6 +29,7 @@ package("simdutf") table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DSIMDUTF_ICONV=" .. (package:config("iconv") and "ON" or "OFF")) io.replace("CMakeLists.txt", "add_subdirectory(singleheader)", "", {plain = true}) + io.replace("src/CMakeLists.txt", "/WX", "", {plain = true}) import("package.tools.cmake").install(package, configs) end) diff --git a/packages/s/simpleini/xmake.lua b/packages/s/simpleini/xmake.lua index db3882dbf..75d225ac3 100644 --- a/packages/s/simpleini/xmake.lua +++ b/packages/s/simpleini/xmake.lua @@ -6,6 +6,7 @@ package("simpleini") set_urls("https://github.com/brofield/simpleini/archive/refs/tags/$(version).tar.gz", "https://github.com/brofield/simpleini.git") + add_versions("v4.22", "b3a4b8f9e03aabd491aa55fd57457115857b9b9c7ecf4abf7ff035ca9d026eb8") add_versions("v4.19", "dc10df3fa363be2c57627d52cbb1b5ddd0689d474bf13908e822c1522df8377e") add_configs("convert", {description = "Unicode converter to use.", type = "string", values = {"none", "generic", "icu", "win32"}}) diff --git a/packages/s/simsimd/xmake.lua b/packages/s/simsimd/xmake.lua new file mode 100644 index 000000000..97f896bba --- /dev/null +++ b/packages/s/simsimd/xmake.lua @@ -0,0 +1,22 @@ +package("simsimd") + set_kind("library", {headeronly = true}) + set_homepage("https://ashvardanian.com/posts/simsimd-faster-scipy/") + set_description("Vector Similarity Functions 3x-200x Faster than SciPy and NumPy") + set_license("Apache-2.0") + + add_urls("https://github.com/ashvardanian/SimSIMD/archive/refs/tags/$(version).tar.gz", + "https://github.com/ashvardanian/SimSIMD.git") + + add_versions("v4.3.1", "d3c54c5b27f8bbb161c8523c47ddc98bfeb75cac17066c959f42ebe78c518b0f") + add_versions("v3.9.0", "8e79b628ba89beebc7c4c853323db0e10ebb6f85bcda2641e1ebaf77cfbda7f9") + + on_install(function (package) + os.cp("include", package:installdir()) + if not package:has_ctypes("_Float16") then + package:add("defines", "SIMSIMD_NATIVE_F16=0") + end + end) + + on_test(function (package) + assert(package:has_cincludes("simsimd/simsimd.h")) + end) diff --git a/packages/s/slang/xmake.lua b/packages/s/slang/xmake.lua new file mode 100644 index 000000000..ac60fe7ea --- /dev/null +++ b/packages/s/slang/xmake.lua @@ -0,0 +1,53 @@ +package("slang") + set_homepage("https://github.com/shader-slang/slang") + set_description("Making it easier to work with shaders") + set_license("MIT") + + add_urls("https://github.com/shader-slang/slang.git") + + add_versions("v2024.1.18", "efdbb954c57b89362e390f955d45f90e59d66878") + add_versions("v2024.1.17", "62b7219e715bd4c0f984bcd98c9767fb6422c78f") + + add_configs("shared", { description = "Build shared library", default = true, type = "boolean", readonly = true }) + add_configs("embed_stdlib_source", { description = "Embed stdlib source in the binary", default = true, type = "boolean" }) + add_configs("embed_stdlib", { description = "Build slang with an embedded version of the stdlib", default = false, type = "boolean" }) + add_configs("full_ir_validation", { description = "Enable full IR validation (SLOW!)", default = false, type = "boolean" }) + add_configs("gfx", { description = "Enable gfx targets", default = false, type = "boolean" }) + add_configs("slangd", { description = "Enable language server target", default = false, type = "boolean" }) + add_configs("slangc", { description = "Enable standalone compiler target", default = false, type = "boolean" }) + add_configs("slangrt", { description = "Enable runtime target", default = false, type = "boolean" }) + add_configs("slang_glslang", { description = "Enable glslang dependency and slang-glslang wrapper target", default = false, type = "boolean" }) + add_configs("slang_llvm_flavor", { description = "How to get or build slang-llvm (available options: FETCH_BINARY, USE_SYSTEM_LLVM, DISABLE)", default = "DISABLE", type = "string" }) + + add_deps("cmake") + + on_install("windows|x64", "macosx", "linux|x86_64", function (package) + local configs = {"-DSLANG_ENABLE_TESTS=OFF", "-DSLANG_ENABLE_EXAMPLES=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DSLANG_LIB_TYPE=" .. (package:config("shared") and "SHARED" or "STATIC")) + table.insert(configs, "-DSLANG_EMBED_STDLIB_SOURCE=" .. (package:config("embed_stdlib_source") and "ON" or "OFF")) + table.insert(configs, "-DSLANG_EMBED_STDLIB=" .. (package:config("embed_stdlib") and "ON" or "OFF")) + table.insert(configs, "-DSLANG_ENABLE_FULL_IR_VALIDATION=" .. (package:config("full_ir_validation") and "ON" or "OFF")) + table.insert(configs, "-DSLANG_ENABLE_ASAN=" .. (package:config("asan") and "ON" or "OFF")) + table.insert(configs, "-DSLANG_ENABLE_GFX=" .. (package:config("gfx") and "ON" or "OFF")) + table.insert(configs, "-DSLANG_ENABLE_SLANGD=" .. (package:config("slangd") and "ON" or "OFF")) + table.insert(configs, "-DSLANG_ENABLE_SLANGC=" .. (package:config("slangc") and "ON" or "OFF")) + table.insert(configs, "-DSLANG_ENABLE_SLANGRT=" .. (package:config("slangrt") and "ON" or "OFF")) + table.insert(configs, "-DSLANG_ENABLE_SLANG_GLSLANG=" .. (package:config("slang_glslang") and "ON" or "OFF")) + table.insert(configs, "-DSLANG_SLANG_LLVM_FLAVOR=" .. package:config("slang_llvm_flavor")) + + import("package.tools.cmake").install(package, configs) + package:addenv("PATH", "bin") + end) + + on_test(function (package) + assert(package:check_cxxsnippets({ test = [[ + #include + #include + + void test() { + Slang::ComPtr global_session; + slang::createGlobalSession(global_session.writeRef()); + } + ]] }, {configs = {languages = "c++17"}})) + end) diff --git a/packages/s/smoothcpp/xmake.lua b/packages/s/smoothcpp/xmake.lua new file mode 100644 index 000000000..f8cd94ac7 --- /dev/null +++ b/packages/s/smoothcpp/xmake.lua @@ -0,0 +1,28 @@ +package("smoothcpp") + + set_homepage("https://github.com/heheda123123/smoothcpp") + set_description("Easy to use first cross platform cpp library. Intended as a supplement to the c++ standard library.") + set_license("MIT") + + set_urls("https://github.com/heheda123123/smoothcpp.git") + add_versions("2023.12.20", "1ac3b09aaf2c4529d5f2bc1f4a6689c77228f02a") + + on_install("windows", "mingw", "linux", "macosx", function (package) + local configs = {} + if package:config("shared") then + configs.kind = "shared" + end + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "scpp/string/string.h" + #include + + void test() { + bool a = (scpp::to_lower("aAaAAbb") == "aaaaabb"); + std::cout << a << std::endl; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/s/snappy/patches/1.1.10/cmake.patch b/packages/s/snappy/patches/1.1.10/cmake.patch new file mode 100644 index 000000000..38cd32bfc --- /dev/null +++ b/packages/s/snappy/patches/1.1.10/cmake.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c3062e2..47443d1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -194,9 +194,9 @@ int main() { + check_cxx_source_compiles(" + #include + int main() { +- uint8_t val = 3, dup[8]; ++ uint8_t val = 3; + uint8x16_t v = vld1q_dup_u8(&val); +- vst1q_u8(dup, v); ++ val = vmaxvq_u8(v); + return 0; + }" SNAPPY_HAVE_NEON) + diff --git a/packages/s/snappy/xmake.lua b/packages/s/snappy/xmake.lua index 09afcc60f..6f2b8be4b 100644 --- a/packages/s/snappy/xmake.lua +++ b/packages/s/snappy/xmake.lua @@ -1,5 +1,4 @@ package("snappy") - set_homepage("https://github.com/google/snappy") set_description("A fast compressor/decompressor") @@ -8,8 +7,10 @@ package("snappy") add_versions("1.1.8", "16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f") add_versions("1.1.9", "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7") + add_versions("1.1.10", "49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90") - add_patches("1.1.9", path.join(os.scriptdir(), "patches", "1.1.9", "inline.patch"), "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b") + add_patches("1.1.9", "patches/1.1.9/inline.patch", "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b") + add_patches("1.1.10", "patches/1.1.10/cmake.patch", "d4883111dcfab81ea35ac1e4e157e55105cec02a0ba804458405be25cbf7b6bb") add_deps("cmake") @@ -17,14 +18,20 @@ package("snappy") add_configs("avx2", {description = "Use the AVX2 instruction set", default = false, type = "boolean"}) add_configs("bmi2", {description = "Use the BMI2 instruction set", default = false, type = "boolean"}) - on_install("windows", "linux", "macosx", "mingw", "android", function (package) + on_install(function (package) + io.replace("CMakeLists.txt", "-Werror", "", {plain = true}) + + if package:version():eq("1.1.10") then + io.replace("snappy.cc", "(op + deferred_length) < op_limit_min_slop);", "static_cast(op + deferred_length) < op_limit_min_slop);", {plain = true}) + end local configs = {"-DSNAPPY_BUILD_TESTS=OFF", "-DSNAPPY_BUILD_BENCHMARKS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DSNAPPY_REQUIRE_AVX=" .. (package:config("avx") and "ON" or "OFF")) table.insert(configs, "-DSNAPPY_REQUIRE_AVX2=" .. (package:config("avx2") and "ON" or "OFF")) table.insert(configs, "-DSNAPPY_HAVE_BMI2=" .. (package:config("bmi2") and "ON" or "OFF")) - if package:config("pic") ~= false then - table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''") end import("package.tools.cmake").install(package, configs) end) @@ -34,5 +41,5 @@ package("snappy") void test(int args, char** argv) { snappy::Compress(nullptr, nullptr); } - ]]}, {configs = {languages = "c++17"}, includes = "snappy.h"})) + ]]}, {configs = {languages = "c++11"}, includes = "snappy.h"})) end) diff --git a/packages/s/snitch/xmake.lua b/packages/s/snitch/xmake.lua index 797dacb90..5bd417af6 100644 --- a/packages/s/snitch/xmake.lua +++ b/packages/s/snitch/xmake.lua @@ -6,6 +6,8 @@ package("snitch") add_urls("https://github.com/cschreib/snitch/archive/refs/tags/v$(version).tar.gz", "https://github.com/cschreib/snitch.git") + add_versions("1.2.5", "87be73638ebf14667ef7dd9e6372faa7ad4fa9b2c6367c844f733469680469a2") + add_versions("1.2.4", "0dbcbd2fa682c9215f049905e9f13be00a6bb6a3c5c4a83704e0237d71dbd23b") add_versions("1.0.0", "9616a854e5d7d26b9003d1bb0fa1a1e4dba03a6e380b0f71ac989648e452a994") add_configs("main", {description = "Using your own main function", default = false, type = "boolean"}) diff --git a/packages/s/snmalloc/xmake.lua b/packages/s/snmalloc/xmake.lua index e822645bd..1f224f091 100644 --- a/packages/s/snmalloc/xmake.lua +++ b/packages/s/snmalloc/xmake.lua @@ -5,6 +5,8 @@ package("snmalloc") add_urls("https://github.com/microsoft/snmalloc/archive/refs/tags/$(version).tar.gz", "https://github.com/microsoft/snmalloc.git") + + add_versions("0.6.2", "e0486ccf03eac5dd8acbb66ea8ad33bec289572a51614acdf7117397e4f1af8c") add_versions("0.6.0", "de1bfb86407d5aac9fdad88319efdd5593ca2f6c61fc13371c4f34aee0b6664f") add_deps("cmake") @@ -13,8 +15,8 @@ package("snmalloc") add_syslinks("onecore") end - on_install("macosx", "windows", "linux", "bsd", function (package) - local configs = {} + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", function (package) + local configs = {"-DSNMALLOC_BUILD_TESTING=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) local cxflags diff --git a/packages/s/soci/xmake.lua b/packages/s/soci/xmake.lua new file mode 100644 index 000000000..7606b5c79 --- /dev/null +++ b/packages/s/soci/xmake.lua @@ -0,0 +1,54 @@ +package("soci") + set_homepage("http://soci.sourceforge.net/") + set_description("Official repository of the SOCI - The C++ Database Access Library") + set_license("BSL-1.0") + + add_urls("https://github.com/SOCI/soci/archive/refs/tags/$(version).tar.gz", + "https://github.com/SOCI/soci.git") + + add_versions("v4.0.3", "4b1ff9c8545c5d802fbe06ee6cd2886630e5c03bf740e269bb625b45cf934928") + + add_configs("empty", {description = "Build empty backend", default = false, type = "boolean"}) + add_configs("sqlite3", {description = "Build sqlite3 backend", default = false, type = "boolean"}) + add_configs("db2", {description = "Build db2 backend", default = false, type = "boolean"}) + add_configs("odbc", {description = "Build odbc backend", default = false, type = "boolean"}) + add_configs("oracle", {description = "Build oracle backend", default = false, type = "boolean"}) + add_configs("firebird", {description = "Build firebird backend", default = false, type = "boolean"}) + add_configs("mysql", {description = "Build mysql backend", default = false, type = "boolean"}) + add_configs("postgresql", {description = "Build postgresql backend", default = false, type = "boolean"}) + add_configs("boost", {description = "Build boost backend", default = false, type = "boolean"}) + + add_deps("cmake") + + on_install(function (package) + for _, pkg in ipairs({"sqlite3", "mysql", "postgresql"}) do + if package:config(pkg) then + package:add("deps", pkg) + end + end + end) + + on_install(function (package) + local configs = {"-DSOCI_TESTS=OFF", "-DSOCI_CXX11=ON"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DSOCI_SHARED=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DSOCI_STATIC=" .. (package:config("shared") and "OFF" or "ON")) + table.insert(configs, "-DSOCI_LTO=" .. (package:config("lto") and "ON" or "OFF")) + table.insert(configs, "-DSOCI_ASAN=" .. (package:config("asan") and "ON" or "OFF")) + table.insert(configs, "-DSOCI_EMPTY=" .. (package:config("empty") and "ON" or "OFF")) + for name, enabled in pairs(package:configs()) do + if (not package:extraconf("configs", name, "builtin")) and (name ~= "empty") then + table.insert(configs, "-DWITH_" .. name:upper() .. "=" .. (package:config(name) and "ON" or "OFF")) + end + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + soci::session sql("connectString"); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/s/sockpp/patches/0.8.1/strerror.patch b/packages/s/sockpp/patches/0.8.1/strerror.patch index 45de67fd3..aee4db447 100644 --- a/packages/s/sockpp/patches/0.8.1/strerror.patch +++ b/packages/s/sockpp/patches/0.8.1/strerror.patch @@ -1,53 +1,13 @@ diff --git a/src/exception.cpp b/src/exception.cpp -index 7cb010d..e9f1da1 100644 +index 72aae7e..16d11ad 100644 --- a/src/exception.cpp +++ b/src/exception.cpp -@@ -57,30 +57,30 @@ sys_error::sys_error(int err) : runtime_error(error_str(err)), errno_(err) - - std::string sys_error::error_str(int err) - { -- char buf[1024]; -- buf[0] = '\x0'; -+ char buf[1024]; -+ buf[0] = '\x0'; - -- #if defined(_WIN32) -- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, -- NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), -- buf, sizeof(buf), NULL); -+ #if defined(_WIN32) -+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, -+ NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), -+ buf, sizeof(buf), NULL); +@@ -66,7 +66,7 @@ string sys_error::error_str(int err) + buf, sizeof(buf), NULL); #else -- #ifdef _GNU_SOURCE + #ifdef _GNU_SOURCE - #if !defined(__GLIBC__) -- // use the XSI standard behavior. -- int e = strerror_r(err, buf, sizeof(buf)); -- auto s = strerror(e); -- return s ? std::string(s) : std::string(); -- #else -- // assume GNU exception -- auto s = strerror_r(err, buf, sizeof(buf)); -- return s ? std::string(s) : std::string(); -- #endif -+ #ifdef _GNU_SOURCE -+ #if defined(__GLIBC__) || (defined(__ANDROID_API__) && __ANDROID_API__ >= 23) -+ // assume GNU exception -+ auto s = strerror_r(err, buf, sizeof(buf)); -+ return s ? std::string(s) : std::string(); -+ #else -+ // use the XSI standard behavior. -+ int e = strerror_r(err, buf, sizeof(buf)); -+ auto s = strerror(e); -+ return s ? std::string(s) : std::string(); -+ #endif - #else - ignore_result(strerror_r(err, buf, sizeof(buf))); - #endif - #endif -- return std::string(buf); -+ return std::string(buf); - } - - ///////////////////////////////////////////////////////////////////////////// ++ #if (!defined(__GLIBC__) && !defined(__ANDROID_API__)) || (defined(__ANDROID_API__) && __ANDROID_API__ < 23) + // use the XSI standard behavior. + int e = strerror_r(err, buf, sizeof(buf)); + auto s = strerror(e); diff --git a/packages/s/sockpp/xmake.lua b/packages/s/sockpp/xmake.lua index 8d7114f95..595d8bc07 100644 --- a/packages/s/sockpp/xmake.lua +++ b/packages/s/sockpp/xmake.lua @@ -7,8 +7,10 @@ package("sockpp") "https://github.com/fpagliughi/sockpp.git") add_versions("v0.8.1", "a8aedff8bd8c1da530b91be650352008fddabc9f1df0d19701d76cbc359c8651") + add_versions("v0.8.3", "dcacfae173ae4a1e535078d3023d338c3eb170193fe1b82bc04138e9c02470ef") + add_versions("v1.0.0", "818477fae6eb29b9daacef71a3d0c494de9e48f6fd267a7fc5a4c332db211bc5") - add_patches("0.8.1", path.join(os.scriptdir(), "patches", "0.8.1", "strerror.patch"), "8de819ba185c644254633d1de609e2c571c6c6f1aa7d2ac4329676ecf96fa556") + add_patches(">=0.8.1", path.join(os.scriptdir(), "patches", "0.8.1", "strerror.patch"), "161796afa58b838a504cbee14f3db8b1bba451b54acb3165503966cad527cafe") if is_plat("windows", "mingw") then add_syslinks("ws2_32") diff --git a/packages/s/soloud/xmake.lua b/packages/s/soloud/xmake.lua index 4778ba2a6..4b4064ecd 100644 --- a/packages/s/soloud/xmake.lua +++ b/packages/s/soloud/xmake.lua @@ -12,8 +12,6 @@ package("soloud") if is_plat("linux") then add_syslinks("pthread", "dl") - elseif is_plat("macosx", "iphoneos") then - add_frameworks("AudioToolbox", "AVFoundation", "CoreFoundation", "Foundation") end on_install(function (package) @@ -40,7 +38,6 @@ package("soloud") add_files("src/**.c|tools/**.c|backend/**.c") if is_plat("iphoneos", "macosx") then - add_frameworks("AudioToolbox", "AVFoundation", "CoreFoundation", "Foundation") add_files("src/backend/miniaudio/*.mm") else add_files("src/backend/miniaudio/*.cpp") diff --git a/packages/s/sonic-cpp/xmake.lua b/packages/s/sonic-cpp/xmake.lua index 59e9e99a0..b7b666379 100644 --- a/packages/s/sonic-cpp/xmake.lua +++ b/packages/s/sonic-cpp/xmake.lua @@ -5,6 +5,7 @@ package("sonic-cpp") set_license("Apache-2.0") add_urls("https://github.com/bytedance/sonic-cpp/archive/refs/tags/v$(version).zip") + add_versions("1.0.1", "4c892a72970df301b39416ee1f038d0573507f374391053ecd6e9a9c686c3d11") add_versions("1.0.0", "409441bfc8b8b9fea8641dc0a0cdfaeed784246066a5c49fc7d6e74c39999f7b") add_cxxflags("-march=haswell") diff --git a/packages/s/span-lite/xmake.lua b/packages/s/span-lite/xmake.lua index a35009d45..b1e2b3441 100644 --- a/packages/s/span-lite/xmake.lua +++ b/packages/s/span-lite/xmake.lua @@ -7,6 +7,7 @@ package("span-lite") add_urls("https://github.com/martinmoene/span-lite/archive/refs/tags/v$(version).zip", "https://github.com/martinmoene/span-lite.git") + add_versions("0.11.0", "315a321ddc586e78e5fc345661c3259e237c8c8968087c1aa36c4407343d7ddb") add_versions("0.10.3", "e9d4facd0c98b12b045de356c6c6c0c06d047d741fe61bde02ca9a68c82d7658") add_deps("cmake") diff --git a/packages/s/sparse-map/xmake.lua b/packages/s/sparse-map/xmake.lua new file mode 100644 index 000000000..b93796f4f --- /dev/null +++ b/packages/s/sparse-map/xmake.lua @@ -0,0 +1,28 @@ +package("sparse-map") + + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/Tessil/sparse-map") + set_description("C++ implementation of a memory efficient hash map and hash set") + set_license("MIT") + + add_urls("https://github.com/Tessil/sparse-map/archive/refs/tags/$(version).tar.gz", + "https://github.com/Tessil/sparse-map.git") + + add_versions("v0.6.2", "7020c21e8752e59d72e37456cd80000e18671c803890a3e55ae36b295eba99f6") + + on_install("windows|x86", "windows|x64", "linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", "cross", function (package) + os.cp("include/*", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "tsl/sparse_map.h" + + void test() { + tsl::sparse_map map = {{1, 1}, {2, 1}, {3, 1}}; + for(auto it = map.begin(); it != map.end(); ++it) { + it.value() = 2; + } + } + ]]}, {configs = {languages = "cxx11"}})) + end) diff --git a/packages/s/spdlog/xmake.lua b/packages/s/spdlog/xmake.lua index 136d00e31..4077ddac7 100644 --- a/packages/s/spdlog/xmake.lua +++ b/packages/s/spdlog/xmake.lua @@ -2,9 +2,13 @@ package("spdlog") set_homepage("https://github.com/gabime/spdlog") set_description("Fast C++ logging library.") + set_license("MIT") - set_urls("https://github.com/gabime/spdlog/archive/$(version).zip", + add_urls("https://github.com/gabime/spdlog/archive/refs/tags/$(version).zip", "https://github.com/gabime/spdlog.git") + add_versions("v1.14.1", "429dfdf3afc1984feb59e414353c21c110bc79609f6d7899d52f6aa388646f6d") + add_versions("v1.14.0", "2cd8a65885e7937fdd046b181eed7e95d61bab7006bd0fb7b9c766185ed3e0ae") + add_versions("v1.13.0", "9f6763bb76fff7db371f5733626c83352edd7c57899501ab00248fafad9cc504") add_versions("v1.12.0", "6174bf8885287422a6c6a0312eb8a30e8d22bcfcee7c48a6d02d1835d7769232") add_versions("v1.11.0", "33f83c6b86ec0fbbd0eb0f4e980da6767494dc0ad063900bcfae8bc3e9c75f21") add_versions("v1.10.0", "7be28ff05d32a8a11cfba94381e820dd2842835f7f319f843993101bcab44b66") @@ -30,6 +34,8 @@ package("spdlog") if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) add_configs("wchar", {description = "Support wchar api.", default = false, type = "boolean"}) + elseif is_plat("linux", "bsd") then + add_syslinks("pthread") end on_load(function (package) diff --git a/packages/s/spectra/xmake.lua b/packages/s/spectra/xmake.lua new file mode 100644 index 000000000..445d607d9 --- /dev/null +++ b/packages/s/spectra/xmake.lua @@ -0,0 +1,30 @@ +package("spectra") + + set_kind("library", {headeronly = true}) + set_homepage("https://spectralib.org/") + set_description("Sparse Eigenvalue Computation Toolkit as a Redesigned ARPACK") + set_license("MPL-2.0") + + add_urls("https://github.com/yixuan/spectra/archive/refs/tags/$(version).tar.gz", + "https://github.com/yixuan/spectra.git") + add_versions("v1.0.1", "919e3fbc8c539a321fd5a0766966922b7637cc52eb50a969241a997c733789f3") + + add_deps("cmake", "eigen") + on_install("windows", "macosx", "linux", "mingw", "cross", function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + Eigen::MatrixXd A = Eigen::MatrixXd::Random(10, 10); + Eigen::MatrixXd M = A + A.transpose(); + Spectra::DenseSymMatProd op(M); + Spectra::SymEigsSolver> eigs(op, 3, 6); + eigs.init(); + int nconv = eigs.compute(Spectra::SortRule::LargestAlge); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/s/spirv-cross/xmake.lua b/packages/s/spirv-cross/xmake.lua index 27fc62fe3..e2fb0e992 100644 --- a/packages/s/spirv-cross/xmake.lua +++ b/packages/s/spirv-cross/xmake.lua @@ -1,5 +1,4 @@ package("spirv-cross") - set_homepage("https://github.com/KhronosGroup/SPIRV-Cross/") set_description("SPIRV-Cross is a practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.") set_license("Apache-2.0") @@ -9,18 +8,51 @@ package("spirv-cross") add_versions("1.2.162+0", "6d10da0224bd3214c9a507832e62d9fb6ae9620d") add_versions("1.2.189+1", "0e2880ab990e79ce6cc8c79c219feda42d98b1e8") add_versions("1.3.231+1", "f09ba2777714871bddb70d049878af34b94fa54d") + add_versions("1.3.268+0", "2de1265fca722929785d9acdec4ab728c47a0254") + + add_configs("exceptions", {description = "Enable exception handling", default = true, type = "boolean"}) add_deps("cmake") - add_links("spirv-cross-c", "spirv-cross-cpp", "spirv-cross-reflect", "spirv-cross-msl", "spirv-cross-util", "spirv-cross-hlsl", "spirv-cross-glsl", "spirv-cross-core") + + if is_plat("windows") then + set_policy("platform.longpaths", true) + end + + on_load(function (package) + local links = {"spirv-cross-c", "spirv-cross-cpp", "spirv-cross-reflect", + "spirv-cross-msl", "spirv-cross-util", "spirv-cross-hlsl", + "spirv-cross-glsl", "spirv-cross-core"} + for _, link in ipairs(links) do + if package:is_plat("windows") and package:is_debug() then + link = link .. "d" + end + package:add("links", link) + end + end) on_install("windows", "linux", "macosx", "mingw", function (package) local configs = {"-DSPIRV_CROSS_ENABLE_TESTS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + + local cxflags + if package:config("exceptions") then + table.insert(configs, "-DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS=OFF") + if package:is_plat("windows") and package:has_tool("cxx", "cl", "clang_cl") then + cxflags = {"/EHsc"} + end + else + table.insert(configs, "-DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS=ON") + end + if package:is_plat("windows") and package:is_debug() then + cxflags = cxflags or {} + table.insert(cxflags, "/FS") + end if package:config("shared") then table.insert(configs, "-DSPIRV_CROSS_SHARED=ON") else table.insert(configs, "-DSPIRV_CROSS_SHARED=OFF") end - import("package.tools.cmake").install(package, configs) + import("package.tools.cmake").install(package, configs, {cxflags = cxflags}) package:addenv("PATH", "bin") end) diff --git a/packages/s/spirv-headers/xmake.lua b/packages/s/spirv-headers/xmake.lua index 43440f65a..1b714848e 100644 --- a/packages/s/spirv-headers/xmake.lua +++ b/packages/s/spirv-headers/xmake.lua @@ -4,7 +4,14 @@ package("spirv-headers") set_description("SPIR-V Headers") set_license("MIT") - add_urls("https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/$(version).tar.gz", {version = function (version) return version:startswith("v") and version or "sdk-" .. version:gsub("%+", ".") end}) + add_urls("https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/$(version).tar.gz", {version = function (version) + local prefix = "sdk-" + if version:gt("1.3.261+1") then + prefix = "vulkan-sdk-" + end + return version:startswith("v") and version or prefix .. version:gsub("%+", ".") + end}) + add_versions("1.2.198+0", "3301a23aca0434336a643e433dcacacdd60000ab3dd35dc0078a297c06124a12") add_versions("1.3.211+0", "30a78e61bd812c75e09fdc7a319af206b1044536326bc3e85fea818376a12568") add_versions("1.3.231+1", "fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3") @@ -13,13 +20,20 @@ package("spirv-headers") add_versions("1.3.246+1", "71668e18ef7b318b06f8c466f46abad965b2646eaa322594cd015c2ac87133e6") add_versions("1.3.250+1", "d5f8c4b7906baf9c51aedbbb2dd942009e8658e3340c6e64699518666a03e043") add_versions("1.3.261+1", "32b4c6ae6a2fa9b56c2c17233c8056da47e331f76e117729925825ea3e77a739") + add_versions("1.3.268+0", "1022379e5b920ae21ccfb5cb41e07b1c59352a18c3d3fdcbf38d6ae7733384d4") + add_versions("1.3.275+0", "d46b261f1fbc5e85022cb2fada9a6facb5b0c9932b45007a77fe05639a605bd1") + add_versions("1.3.280+0", "a00906b6bddaac1e37192eff2704582f82ce2d971f1aacee4d51d9db33b0f772") + add_versions("1.3.283+0", "a68a25996268841073c01514df7bab8f64e2db1945944b45087e5c40eed12cb9") add_patches("1.3.261+1", "https://github.com/KhronosGroup/SPIRV-Headers/commit/c43effd54686240d8b13762279d5392058d10e27.patch", "b97a05c35c00620519a5f3638a974fc2a01f062bf6e86b74b49a234f82cc55ce") add_deps("cmake") on_install(function (package) - import("package.tools.cmake").install(package, {"-DSPIRV_HEADERS_SKIP_EXAMPLES=ON"}) + import("package.tools.cmake").install(package, { + "-DSPIRV_HEADERS_SKIP_EXAMPLES=ON", + "-DSPIRV_HEADERS_ENABLE_TESTS=OFF" + }) end) on_test(function (package) diff --git a/packages/s/spirv-reflect/xmake.lua b/packages/s/spirv-reflect/xmake.lua index 4f1c336ce..7144bef76 100644 --- a/packages/s/spirv-reflect/xmake.lua +++ b/packages/s/spirv-reflect/xmake.lua @@ -10,6 +10,10 @@ package("spirv-reflect") add_versions("1.3.231+1", "b68b5a8a5d8ab5fce79e6596f3a731291046393a") add_versions("1.3.250+1", "1fd43331f0bd77cc0f421745781f79a14d8f2bb1") add_versions("1.3.261+1", "d7e316e7d592d16ac58f1fe39b1df7babfe65c0d") + add_versions("1.3.268+0", "3f468129720eded0cef4077302e491036d099856") + add_versions("1.3.275+0", "2f7460f0be0f73c9ffde719bc3e924b4250f4d98") + add_versions("1.3.280+0", "8406f76dcf6cca11fe430058c4f0ed4b846f3be4") + add_versions("1.3.283+0", "ee5b57fba6a986381f998567761bbc064428e645") add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) diff --git a/packages/s/spirv-tools/xmake.lua b/packages/s/spirv-tools/xmake.lua index 6ff31436e..8940f4d8c 100644 --- a/packages/s/spirv-tools/xmake.lua +++ b/packages/s/spirv-tools/xmake.lua @@ -14,6 +14,10 @@ package("spirv-tools") add_versions("1.3.246+1", "sdk-1.3.246.1") add_versions("1.3.250+1", "sdk-1.3.250.1") add_versions("1.3.261+1", "sdk-1.3.261.1") + add_versions("1.3.268+0", "vulkan-sdk-1.3.268.0") + add_versions("1.3.275+0", "vulkan-sdk-1.3.275.0") + add_versions("1.3.280+0", "vulkan-sdk-1.3.280.0") + add_versions("1.3.283+0", "vulkan-sdk-1.3.283.0") add_deps("cmake >=3.17.2") add_deps("python 3.x", {kind = "binary"}) diff --git a/packages/s/sqlite3/xmake.lua b/packages/s/sqlite3/xmake.lua index be1f548a2..440fc204a 100644 --- a/packages/s/sqlite3/xmake.lua +++ b/packages/s/sqlite3/xmake.lua @@ -2,13 +2,18 @@ package("sqlite3") set_homepage("https://sqlite.org/") set_description("The most used database engine in the world") + set_license("Public Domain") set_urls("https://sqlite.org/$(version)", {version = function (version) - local year = "2022" + local year = "2024" if version:le("3.24") then year = "2018" elseif version:le("3.36") then year = "2021" + elseif version:le("3.42") then + year = "2022" + elseif version:le("3.44") then + year = "2023" end local version_str = version:gsub("[.+]", "") if #version_str < 7 then @@ -25,6 +30,11 @@ package("sqlite3") add_versions("3.36.0+0", "bd90c3eb96bee996206b83be7065c9ce19aef38c3f4fb53073ada0d0b69bbce3") add_versions("3.37.0+200", "4089a8d9b467537b3f246f217b84cd76e00b1d1a971fe5aca1e30e230e46b2d8") add_versions("3.39.0+200", "852be8a6183a17ba47cee0bbff7400b7aa5affd283bf3beefc34fcd088a239de") + add_versions("3.43.0+200", "6d422b6f62c4de2ca80d61860e3a3fb693554d2f75bb1aaca743ccc4d6f609f0") + add_versions("3.45.0+100", "cd9c27841b7a5932c9897651e20b86c701dd740556989b01ca596fcfa3d49a0a") + add_versions("3.45.0+200", "bc9067442eedf3dd39989b5c5cfbfff37ae66cc9c99274e0c3052dc4d4a8f6ae") + add_versions("3.45.0+300", "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531") + add_versions("3.46.0+0", "6f8e6a7b335273748816f9b3b62bbdc372a889de8782d7f048c653a447417a7d") if is_plat("macosx", "linux", "bsd") then add_syslinks("pthread", "dl") @@ -33,6 +43,7 @@ package("sqlite3") on_install(function (package) local xmake_lua = [[ add_rules("mode.debug", "mode.release") + set_encodings("utf-8") target("sqlite3") set_kind("$(kind)") add_files("sqlite3.c") diff --git a/packages/s/sqlitecpp/xmake.lua b/packages/s/sqlitecpp/xmake.lua index 8b90fa3e6..3cd12d26c 100644 --- a/packages/s/sqlitecpp/xmake.lua +++ b/packages/s/sqlitecpp/xmake.lua @@ -1,11 +1,12 @@ package("sqlitecpp") - set_homepage("http://srombauts.github.io/SQLiteCpp") set_description("SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper.") + set_license("MIT") set_urls("https://github.com/SRombauts/SQLiteCpp/archive/refs/tags/$(version).tar.gz", "https://github.com/SRombauts/SQLiteCpp.git") + add_versions("3.3.1", "71f990f9fb4b004533b6859ce40729af823b87fe691dd99ca084a7fd40db54b9") add_versions("3.2.1", "70c67d5680c47460f82a7abf8e6b0329bf2fb10795a982a6d8abc06adb42d693") if is_plat("android", "wasm") then @@ -51,18 +52,28 @@ package("sqlitecpp") table.insert(configs, "-DSQLITE_OMMIT_LOAD_EXTENSION=" .. (package:config("ommit_load_extension") and "ON" or "OFF")) table.insert(configs, "-DSQLITECPP_DISABLE_STD_FILESYSTEM=" .. (package:config("filesystem") and "ON" or "OFF")) table.insert(configs, "-DSQLITECPP_USE_STACK_PROTECTION=" .. (package:config("stack_protection") and "ON" or "OFF")) - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) - if is_plat("windows") then + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + + if package:is_plat("windows") then if package:config("shared") then if package:version():gt("3.2.1") then - table.insert(configs, "-DBUILD_SHARED_LIBS=ON") + package:add("defines", "SQLITECPP_COMPILE_DLL") else + table.remove(configs, #configs) -- BUILD_SHARED_LIBS table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") end end table.insert(configs, "-DSQLITECPP_USE_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) end import("package.tools.cmake").install(package, configs) + + os.trycp("**.dll", package:installdir("bin")) + os.trycp("**.so", package:installdir("lib")) + if package:config("sqlite3_external") then + os.tryrm(package:installdir("bin/sqlite3*")) + os.tryrm(package:installdir("lib/sqlite3*")) + end end) on_test(function (package) diff --git a/packages/s/sqlpp11/xmake.lua b/packages/s/sqlpp11/xmake.lua index a2094c210..1fb3fd738 100644 --- a/packages/s/sqlpp11/xmake.lua +++ b/packages/s/sqlpp11/xmake.lua @@ -5,6 +5,7 @@ package("sqlpp11") add_urls("https://github.com/rbock/sqlpp11/archive/refs/tags/$(version).tar.gz", "https://github.com/rbock/sqlpp11.git") + add_versions("0.64", "72e6d37c716cc45b38c3cf4541604f16224aaa3b511d1f1d0be0c49176c3be86") add_versions("0.61", "d5a95e28ae93930f7701f517b1342ac14bcf33a9b1c5b5f0dff6aea5e315bb50") add_deps("cmake") diff --git a/packages/s/srpc/xmake.lua b/packages/s/srpc/xmake.lua new file mode 100644 index 000000000..a91693435 --- /dev/null +++ b/packages/s/srpc/xmake.lua @@ -0,0 +1,40 @@ +package("srpc") + set_homepage("https://github.com/sogou/srpc") + set_description("RPC framework based on C++ Workflow. Supports SRPC, Baidu bRPC, Tencent tRPC, thrift protocols.") + set_license("Apache-2.0") + + add_urls("https://github.com/sogou/srpc/archive/refs/tags/$(version).tar.gz", + "https://github.com/sogou/srpc.git") + + add_versions("v0.10.2", "da570f3522e9dfec9c396632044fcb51b5ddc5c854ba7824d1770de138f469fb") + + add_deps("cmake", "protobuf-cpp") + add_deps("workflow", "snappy", "lz4", "zlib") + + on_install("linux", "macosx", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + os.rm("third_party") + io.replace("CMakeLists.txt", 'check_include_file_cxx("workflow/Workflow.h" WORKFLOW_INSTALLED)', + "set(WORKFLOW_INSTALLED TRUE)", {plain = true}) + import("package.tools.cmake").install(package, configs, {packagedeps = { + "workflow", "snappy", "lz4", "zlib"}}) + if package:config("shared") then + os.rm(path.join(package:installdir("lib"), "*.a")) + else + os.tryrm(path.join(package:installdir("lib"), "*.dylib")) + os.tryrm(path.join(package:installdir("lib"), "*.so")) + end + package:addenv("PATH", "bin") + end) + + on_test(function (package) + os.vrun("srpc_generator --version") + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + std::cout << srpc::GET_CURRENT_MS() << std::endl; + } + ]]}, {configs = {languages = "c++17"}, includes = "srpc/rpc_basic.h"})) + end) diff --git a/packages/s/srt/xmake.lua b/packages/s/srt/xmake.lua index fa4ba4eef..efe6dc3ca 100644 --- a/packages/s/srt/xmake.lua +++ b/packages/s/srt/xmake.lua @@ -5,6 +5,7 @@ package("srt") add_urls("https://github.com/Haivision/srt/archive/refs/tags/$(version).tar.gz", "https://github.com/Haivision/srt.git") + add_versions("v1.5.3", "befaeb16f628c46387b898df02bc6fba84868e86a6f6d8294755375b9932d777") add_versions("v1.4.2", "28a308e72dcbb50eb2f61b50cc4c393c413300333788f3a8159643536684a0c4") add_deps("cmake") diff --git a/packages/s/srtp/xmake.lua b/packages/s/srtp/xmake.lua new file mode 100644 index 000000000..ad1200c40 --- /dev/null +++ b/packages/s/srtp/xmake.lua @@ -0,0 +1,41 @@ +package("srtp") + set_homepage("https://github.com/cisco/libsrtp") + set_description("Library for SRTP (Secure Realtime Transport Protocol)") + + add_urls("https://github.com/cisco/libsrtp/archive/refs/tags/$(version).tar.gz", + "https://github.com/cisco/libsrtp.git") + + add_versions("v2.6", "f1886f72eff1d8aa82ada40b2fc3d342a3ecaf0f8988cb63d4af234fccf2253d") + add_versions("v2.5.0", "8a43ef8e9ae2b665292591af62aa1a4ae41e468b6d98d8258f91478735da4e09") + + add_configs("openssl", {description = "Enable OpenSSL crypto engine", default = false, type = "boolean"}) + add_configs("mbedtls", {description = "Enable MbedTLS crypto engine", default = false, type = "boolean"}) + add_configs("nss", {description = "Enable NSS crypto engine", default = false, type = "boolean"}) + + add_deps("cmake") + add_deps("openssl") + + on_install("windows", "linux", "macosx", "android@linux,macosx", "cross", "bsd", "mingw", function (package) + local configs = + { + "-DLIBSRTP_TEST_APPS=OFF", + "-DTEST_APPS=OFF", + "-DBUILD_WITH_WARNINGS=OFF", + "-DENABLE_WARNINGS=OFF", + "-DENABLE_WARNINGS_AS_ERRORS=OFF", + } + + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + for name, enabled in pairs(package:configs()) do + if not package:extraconf("configs", name, "builtin") then + table.insert(configs, "-DENABLE_" .. name:upper() .. "=" .. (enabled and "ON" or "OFF")) + end + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("srtp_init", {includes = "srtp2/srtp.h"})) + end) + diff --git a/packages/s/ssp/xmake.lua b/packages/s/ssp/xmake.lua new file mode 100644 index 000000000..1f32bdee5 --- /dev/null +++ b/packages/s/ssp/xmake.lua @@ -0,0 +1,28 @@ +package("ssp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/red0124/ssp") + set_description("C++ CSV parser") + set_license("MIT") + + add_urls("https://github.com/red0124/ssp/archive/refs/tags/$(version).tar.gz", + "https://github.com/red0124/ssp.git") + + add_versions("v1.8.0", "a4416746023c8a60f6808200193dd207f1044b6e37e6c5bc0462e85452307d1d") + add_versions("v1.6.1", "4cdf75959b0a5fabd0b3e6ec1bad41d7c3f298d5b7f822d6e12b7e4d7dfcdd34") + + add_deps("cmake", "fast_float") + + on_install(function (package) + import("package.tools.cmake").install(package, configs) + os.tryrm(package:installdir("include", "fast_float")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + auto converter = ss::converter{}; + auto val = converter.convert("5"); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/s/standardlib/xmake.lua b/packages/s/standardlib/xmake.lua new file mode 100644 index 000000000..5b96ec341 --- /dev/null +++ b/packages/s/standardlib/xmake.lua @@ -0,0 +1,24 @@ +package("standardlib") + + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/gregoryc/standardlib") + set_description("an actually usable and maximally efficient C standard library to make C as easy (or easier) than other languages") + + add_urls("https://github.com/gregoryc/standardlib.git") + add_versions("2023.12.5", "4fb308a5716927e5622a0488d7aa104660c96841") + + on_install("linux", function (package) + os.cp("standardlib.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "standardlib.h" + #include + void test() { + const char *text = "This is a sample text"; + const char *suffix = "text"; + printf("Does the string end with \"%s\"? %s\n", suffix, ends_with(text, suffix) ? "Yes" : "No"); + } + ]]})) + end) diff --git a/packages/s/stb/xmake.lua b/packages/s/stb/xmake.lua index 54a526934..4de3193a0 100644 --- a/packages/s/stb/xmake.lua +++ b/packages/s/stb/xmake.lua @@ -8,6 +8,7 @@ package("stb") add_versions("2021.07.13", "3a1174060a7dd4eb652d4e6854bc4cd98c159200") add_versions("2021.09.10", "af1a5bc352164740c1cc1354942b1c6b72eacb8a") add_versions("2023.01.30", "5736b15f7ea0ffb08dd38af21067c314d6a3aae9") + add_versions("2023.12.15", "f4a71b13373436a2866c5d68f8f80ac6f0bc1ffe") if is_plat("mingw") and is_subhost("msys") then add_extsources("pacman::stb") diff --git a/packages/s/stc/xmake.lua b/packages/s/stc/xmake.lua new file mode 100644 index 000000000..bdfc3096f --- /dev/null +++ b/packages/s/stc/xmake.lua @@ -0,0 +1,19 @@ +package("stc") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/stclib/STC") + set_description("A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers.") + set_license("MIT") + + add_urls("https://github.com/stclib/STC/archive/refs/tags/$(version).tar.gz", + "https://github.com/stclib/STC.git") + + add_versions("v4.2", "f16c3185ba5693f0257e5b521f0b6b3c11041433a4abbbbc531370364eb75d0c") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + local defines = {"i_type=Floats", "i_val=float"} + assert(package:has_cfuncs("Floats_push", {includes = "stc/cvec.h", configs = {defines = defines}})) + end) diff --git a/packages/s/stdexec/xmake.lua b/packages/s/stdexec/xmake.lua new file mode 100644 index 000000000..4b6bf0efa --- /dev/null +++ b/packages/s/stdexec/xmake.lua @@ -0,0 +1,21 @@ +package("stdexec") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/NVIDIA/stdexec") + set_description("`std::execution`, the proposed C++ framework for asynchronous and parallel programming. ") + + add_urls("https://github.com/NVIDIA/stdexec.git") + + add_versions("2024.03.08", "b3ba13a7b8c206371207196e08844fb7bc745438") + + add_deps("cmake") + + on_install("linux", "macosx", function (package) + local configs = {"-DSTDEXEC_BUILD_EXAMPLES=OFF", "-DSTDEXEC_BUILD_TESTS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cxxincludes("exec/static_thread_pool.hpp", {configs = {languages = "c++20"}})) + end) diff --git a/packages/s/stduuid/xmake.lua b/packages/s/stduuid/xmake.lua new file mode 100644 index 000000000..e4b6e4fd2 --- /dev/null +++ b/packages/s/stduuid/xmake.lua @@ -0,0 +1,27 @@ +package("stduuid") + set_kind("library") + set_homepage("https://github.com/mariusbancila/stduuid") + set_description("A C++17 cross-platform implementation for UUIDs") + set_license("MIT") + + add_urls("https://github.com/mariusbancila/stduuid/archive/refs/tags/v$(version).zip") + add_versions("1.2.3", "0f867768ce55f2d8fa361be82f87f0ea5e51438bc47ca30cd92c9fd8b014e84e") + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DUUID_BUILD_TESTS=OFF") + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "uuid.h" + using namespace uuids; + void test() { + uuid empty; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/s/streamvbyte/xmake.lua b/packages/s/streamvbyte/xmake.lua new file mode 100644 index 000000000..d19066981 --- /dev/null +++ b/packages/s/streamvbyte/xmake.lua @@ -0,0 +1,23 @@ +package("streamvbyte") + set_homepage("https://github.com/lemire/streamvbyte") + set_description("Fast integer compression in C using the StreamVByte codec") + set_license("Apache-2.0") + + add_urls("https://github.com/lemire/streamvbyte/archive/refs/tags/$(version).tar.gz", + "https://github.com/lemire/streamvbyte.git") + + add_versions("v1.0.0", "6b1920e9865146ba444cc317aa61cd39cdf760236e354ef7956011a9fe577882") + + add_deps("cmake") + + on_install(function (package) + local configs = {"-DSTREAMVBYTE_ENABLE_EXAMPLES=OFF", "-DSTREAMVBYTE_ENABLE_TESTS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DSTREAMVBYTE_SANITIZE=" .. (package:config("asan") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("streamvbyte_encode", {includes = "streamvbyte.h"})) + end) diff --git a/packages/s/stringbuilder/xmake.lua b/packages/s/stringbuilder/xmake.lua new file mode 100644 index 000000000..f5147e664 --- /dev/null +++ b/packages/s/stringbuilder/xmake.lua @@ -0,0 +1,24 @@ +package("stringbuilder") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/Isameru/stringbuilder") + set_description("Fast, efficient and convenient alternative to std::stringstream and std::string concatenation.") + set_license("MIT") + + add_urls("https://github.com/Isameru/stringbuilder.git") + add_versions("2023.7.10", "ab772a6f0db237155d17a68c8f72b48383137872") + + on_install("!windows", function (package) + io.replace("include/stringbuilder.h", "#pragma once", "#pragma once\n#include \n#include ", {plain = true}) + io.replace("include/stringbuilder.h", "#include ", "", {plain = true}) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + auto sb = sbldr::stringbuilder<5>{}; + sb << "123"; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/s/strings_h/xmake.lua b/packages/s/strings_h/xmake.lua new file mode 100644 index 000000000..7319e2b7e --- /dev/null +++ b/packages/s/strings_h/xmake.lua @@ -0,0 +1,23 @@ +package("strings_h") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/win32ports/strings_h") + set_description("header-only Windows implementation of the header") + set_license("MIT") + + add_urls("https://github.com/win32ports/strings_h.git") + add_versions("2023.03.17", "822de6e8c368abb986b403792082189f3c602c45") + + on_install("windows", function (package) + os.cp("strings.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_csnippets({test = [[ + #include + + void test() { + char buffer[6]; + bcopy("hello", buffer, 5); + } + ]]})) + end) diff --git a/packages/s/stringzilla/xmake.lua b/packages/s/stringzilla/xmake.lua new file mode 100644 index 000000000..28476e802 --- /dev/null +++ b/packages/s/stringzilla/xmake.lua @@ -0,0 +1,56 @@ +package("stringzilla") + set_kind("library", {headeronly = true}) + set_homepage("https://ashvardanian.com/posts/stringzilla/") + set_description("Up to 10x faster string search, split, sort, and shuffle for long strings and multi-gigabyte files in Python and C, leveraging SIMD with just a few lines of Arm Neon and x86 AVX2 & AVX-512 intrinsics 🦖") + set_license("Apache-2.0") + + add_urls("https://github.com/ashvardanian/StringZilla/archive/refs/tags/$(version).tar.gz", + "https://github.com/ashvardanian/StringZilla.git") + + add_versions("v3.8.4", "4132957633d28ce2651e587f2ab736cdf174e61b8ab1bcef453b21d40a2d872e") + add_versions("v3.8.3", "17c4527012495b66028236f62223a7c84c32c14dce91821f2ebb36a67bce489b") + add_versions("v3.8.2", "1f1e940c6c74aecc06964aa650fe23d0b64570b5d4d83a820d2d11428050d853") + add_versions("v3.8.1", "6ed752ed72024c66468800d92861cf8e213dab8ee153c04f7d4e23e537686e5f") + add_versions("v3.8.0", "ccfe9ccbdc34f72f8fb76bdab2ace37e29453dd6bcd16837e8e4a9e7b22c74bb") + add_versions("v3.7.3", "85bc8c990c0a6d6a924d062cf1166b0ce120e48e9f398518930cd8d493e0d593") + add_versions("v3.7.2", "ff84205286a2d8454a17f000013c634e1620df27c088eddea55fa83ce40274de") + add_versions("v3.7.1", "60cc703b8e8ad317db4d114edc355c8b57c2c5a927d546aea800b810e676e9b7") + add_versions("v3.7.0", "214d926fc827e5975fabe63f112cbd4d676d5ceb1c37fc4d6d83785a50c518e0") + add_versions("v3.6.8", "9e29b31f4924fe89c835f40d852e3f8b62e3dfb164a657283bdc92ce014286cc") + add_versions("v3.6.7", "d7f8ed81367047bade36f550880e1df9fed60d08722a2f58405434690b3a1ffe") + add_versions("v3.6.6", "41a39fc8873b30fc6986cc9f7a80cd1b9f119a0ff3dbe5d6400b1c9fd3cb0f38") + add_versions("v3.6.5", "047083d8778bbb684a0c335e8fd91b036e5b0e1db4c8ecbf3c93a37ffe8ca907") + add_versions("v3.6.4", "342619f79c259fdf338c60678145123244fe1101b2eb077ef84bf9cc3cec64a5") + add_versions("v3.6.3", "3f570bd7c9e9f780259148b42335e8eafcce70c96fe1e33cbf2b90d5d7ca68c4") + add_versions("v3.6.2", "5e6905348afb4ea55195e20b684abf8ad1e1373dbe2680d1d238cb27f59020b8") + add_versions("v3.6.1", "416ca84773b2fa2f401bfa767d69bb146e525f163c4edf785e9dfbdfb2411fd9") + add_versions("v3.6.0", "a8b0eea55c535e72451fc1ca4c6c8531268b1fdf2562acf38ca6030b5c97d64d") + add_versions("v3.5.0", "a7b990e32859683496b4c16e4e756cc862316f78f676fc642b14ddc4190cf39a") + add_versions("v3.4.1", "062587d0ec08b62bba888b1ec0dcb42a68a53043af7ae6b4d0185381543c1297") + add_versions("v3.4.0", "b9f15c00079844b7eb82e613bab59a89204bdb9b1bacd1ef485fa74c8ef7ec77") + add_versions("v3.3.1", "3f6bcf9ce10089628cdb9fdb55bc94026440f07961473a0eb140ae969889aeae") + add_versions("v3.3.0", "15924a562e3166840a5385959dcc190eb40b49cec82900fde319774963c5d85a") + add_versions("v3.2.0", "12789c5f81d63e569e7a1221933aa371274fa3f22f8143f7bd65b5248c66a7d9") + add_versions("v3.1.2", "aa25438112551eab9eec9a532749e430fe26b6562adae517c56ce0fe762af2b6") + add_versions("v3.1.1", "6f7905ee481fda0230a55075f9f4704284f2c18bd53d9e1c6ef78e3eaf29cea9") + add_versions("v3.1.0", "32580513dbc054cc23941d36e19741bce1fa106c3031670065719eb4b95afde8") + add_versions("v3.0.0", "50bc3544d97c6c1d82022a78af4ab062010a1d35096330cb84d952b0cf7d54fb") + add_versions("v2.0.4", "440d3d586f8cfe96bc7648f01f2d3c514c4e2dc22446caeb50599383d1970ed2") + add_versions("v2.0.3", "6b52a7b4eb8383cbcf83608eaa08e5ba588a378449439b73584713a16d8920e3") + add_versions("v1.2.2", "2e17c49965841647a1c371247f53b2f576e5fb32fe4b84a080d425b12f17703c") + + on_install("android|!armeabi-v7a or !android",function (package) + if package:version():gt("2.0.4") then + os.cp("include/stringzilla/stringzilla.h", package:installdir("include")) + else + os.cp("stringzilla/stringzilla.h", package:installdir("include")) + end + end) + + on_test(function (package) + if package:version():gt("2.0.0") then + assert(package:has_cfuncs("sz_sort", {includes = "stringzilla.h"})) + else + assert(package:has_cxxfuncs("strzl_sort", {includes = "stringzilla.h", configs = {languages = "c++17"}})) + end + end) diff --git a/packages/s/stx/xmake.lua b/packages/s/stx/xmake.lua new file mode 100644 index 000000000..fafb567c3 --- /dev/null +++ b/packages/s/stx/xmake.lua @@ -0,0 +1,45 @@ +package("stx") + set_homepage("https://lamarrr.github.io/STX") + set_description("C++17 & C++ 20 error-handling and utility extensions. ") + set_license("MIT") + + add_urls("https://github.com/lamarrr/STX/archive/refs/tags/$(version).tar.gz", + "https://github.com/lamarrr/STX.git") + + add_versions("v1.0.5", "d21a1895bc7057c8c6118a042ec39f364b2ad768394d4facb2fd64b73b07d97f") + add_versions("v1.0.3", "0118b76a5f2a7a60132edecc9b632d9fc82a187bc232ac1a3fd9200fdd92dc7d") + + add_configs("backtrace", {description = "Enable stack backtraces", default = false, type = "boolean"}) + add_configs("custom_handler", {description = "Override the default panic behaviour by implementing a custom panic handler. The default behavior is to print the panic report and abort the program. (You can read the docs for more details)", default = false, type = "boolean"}) + add_configs("shared", {description = "Build shared binaries", default = false, type = "boolean", readonly = true}) + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + add_deps("cmake") + + on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", "iphoneos", "cross", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DSTX_ENABLE_BACKTRACE=" .. (package:config("backtrace") and "ON" or "OFF")) + table.insert(configs, "-DSTX_CUSTOM_PANIC_HANDLER=" .. (package:config("custom_handler") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + using stx::Option, stx::Some, stx::None; + auto safe_divide(double numerator, double denominator) -> Option { + if (denominator == 0.0) return None; + return Some(numerator / denominator); + } + void test() { + safe_divide(5.0, 2.0).match( + [](auto value){}, + [](){}); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/s/suitesparse/port/xmake.lua b/packages/s/suitesparse/port/xmake.lua index c95f01fd5..510fa0d93 100644 --- a/packages/s/suitesparse/port/xmake.lua +++ b/packages/s/suitesparse/port/xmake.lua @@ -5,10 +5,11 @@ set_languages("cxx14") add_rules("mode.debug", "mode.release") -- initialize options -option("with_cuda", {default = false, showmenu = true, description = "Build with CUDA support."}) -option("with_blas", {default = "mkl", showmenu = true, description = "Choose BLAS vendor.", values={"mkl", "openblas"}}) -option("complex", {default = false, showmenu = true, description = "Build with complex number support."}) -option("graphblas", {default = false, showmenu = true, description = "Build GraphBLAS module."}) +option("with_cuda", {default = false, showmenu = true, description = "Build with CUDA support."}) +option("with_blas", {default = "mkl", showmenu = true, description = "Choose BLAS vendor.", values={"mkl", "openblas"}}) +option("complex", {default = false, showmenu = true, description = "Build with complex number support."}) +option("graphblas", {default = false, showmenu = true, description = "Build GraphBLAS module."}) +option("graphblas_static", {default = false, showmenu = true, description = "Build static GraphBLAS module."}) -- set dependencies add_requires("metis") @@ -161,12 +162,21 @@ target("SPQR") target_end() if has_config("graphblas") then +if has_config("graphblas_static") then target("GraphBLAS") - set_kind("$(kind)") + set_kind("static") add_files("GraphBLAS/Source/*.c", "GraphBLAS/Source/Generated/*.c") add_includedirs("GraphBLAS/Include", "GraphBLAS/Source", "GraphBLAS/Source/Template", "GraphBLAS/Source/Generated") add_headerfiles("GraphBLAS/Include/*.h") target_end() +else +target("GraphBLAS") + set_kind("shared") + add_files("GraphBLAS/Source/*.c", "GraphBLAS/Source/Generated/*.c") + add_includedirs("GraphBLAS/Include", "GraphBLAS/Source", "GraphBLAS/Source/Template", "GraphBLAS/Source/Generated") + add_headerfiles("GraphBLAS/Include/*.h") +target_end() +end end if has_config("with_cuda") then diff --git a/packages/s/suitesparse/xmake.lua b/packages/s/suitesparse/xmake.lua index 47ae28300..7b6edc0f5 100644 --- a/packages/s/suitesparse/xmake.lua +++ b/packages/s/suitesparse/xmake.lua @@ -5,44 +5,108 @@ package("suitesparse") add_urls("https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/$(version).tar.gz", "https://github.com/DrTimothyAldenDavis/SuiteSparse.git") + add_versions("v7.7.0", "529b067f5d80981f45ddf6766627b8fc5af619822f068f342aab776e683df4f3") + add_versions("v7.6.0", "19cbeb9964ebe439413dd66d82ace1f904adc5f25d8a823c1b48c34bd0d29ea5") add_versions("v5.10.1", "acb4d1045f48a237e70294b950153e48dce5b5f9ca8190e86c2b8c54ce00a7ee") add_versions("v5.12.0", "5fb0064a3398111976f30c5908a8c0b40df44c6dd8f0cc4bfa7b9e45d8c647de") add_versions("v5.13.0", "59c6ca2959623f0c69226cf9afb9a018d12a37fab3a8869db5f6d7f83b6b147d") + add_versions("v7.5.1", "dccfb5f75aa83fe2edb4eb2462fc984a086c82bad8433f63c31048d84b565d74") add_patches("5.x", path.join(os.scriptdir(), "patches", "5.10.1", "msvc.patch"), "8ac61e9acfaa864a2528a14d3a7e6e86f6e6877de2fe93fdc87876737af5bf31") + add_configs("openmp", {description = "Enable OpenMP support.", default = true, type = "boolean"}) add_configs("cuda", {description = "Enable CUDA support.", default = false, type = "boolean"}) - add_configs("blas", {description = "Set BLAS vendor.", default = "openblas", type = "string", values = {"mkl", "openblas"}}) - add_configs("graphblas", {description = "Enable GraphBLAS module.", default = false, type = "boolean"}) + add_configs("blas", {description = "Set BLAS vendor.", default = "openblas", type = "string", values = {"mkl", "openblas", "apple"}}) + add_configs("blas_static", {description = "Use static BLAS library.", default = true, type = "boolean"}) + add_configs("graphblas", {description = "Enable GraphBLAS module.", default = not is_arch("x86"), type = "boolean"}) + add_configs("graphblas_static", {description = "Enable static GraphBLAS module.", default = false, type = "boolean"}) add_deps("metis") + if not is_plat("windows") then + add_deps("gmp", "mpfr") + end if is_plat("linux") then add_syslinks("m", "rt") end on_load("windows", "macosx", "linux", function (package) - if package:config("cuda") then - package:add("deps", "cuda", {system = true, configs = {utils = {"cublas"}}}) - package:add("links", "GPUQREngine") - package:add("links", "SuiteSparse_GPURuntime") + if package:version():ge("7.4.0") then + package:add("deps", "cmake") + end + if package:config("openmp") then + package:add("deps", "openmp") end - if package:config("graphblas") then - package:add("links", "GraphBLAS") + if package:config("blas") == "apple" then + package:add("frameworks", "Accelerate") + else + package:add("deps", package:config("blas")) end - package:add("deps", package:config("blas")) - for _, lib in ipairs({"SPQR", "UMFPACK", "LDL", "KLU", "CXSparse", "CHOLMOD", "COLAMD", "CCOLAMD", "CAMD", "BTF", "AMD", "suitesparseconfig"}) do - package:add("links", lib) + if package:version():ge("7.4.0") then + local suffix = "" + if package:is_plat("windows") and not package:config("shared") then + suffix = "_static" + if package:config("graphblas") then + package:add("links", "graphblas" .. (package:config("graphblas_static") and "_static" or "")) + end + end + for _, lib in ipairs({"lagraphx", "lagraph", "graphblas", "spex", "spqr", "rbio", "ParU", "umfpack", "ldl", "klu", "klu_cholmod", "cxsparse", "cholmod", "colamd", "ccolamd", "camd", "btf", "amd", "suitesparse_mongoose", "suitesparseconfig"}) do + package:add("links", lib .. suffix) + end + else + if package:config("cuda") then + package:add("deps", "cuda", {system = true, configs = {utils = {"cublas"}}}) + package:add("links", "GPUQREngine") + package:add("links", "SuiteSparse_GPURuntime") + end + for _, lib in ipairs({"SPQR", "UMFPACK", "LDL", "KLU", "CXSparse", "CHOLMOD", "COLAMD", "CCOLAMD", "CAMD", "BTF", "AMD", "suitesparseconfig"}) do + package:add("links", lib) + end end end) - on_install("windows", "macosx", "linux", function (package) - os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") - local configs = {} - configs.with_blas = package:config("blas") - configs.with_cuda = package:config("cuda") - configs.graphblas = package:config("graphblas") - import("package.tools.xmake").install(package, configs) + on_install("windows|x64", "windows|x86", "macosx", "linux", function (package) + if package:version():ge("7.4.0") then + local configs = {"-DSUITESPARSE_DEMOS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) + table.insert(configs, "-DGRAPHBLAS_BUILD_STATIC_LIBS=" .. (package:config("graphblas_static") and "ON" or "OFF")) + table.insert(configs, "-DSUITESPARSE_USE_OPENMP=" .. (package:config("openmp") and "ON" or "OFF")) + table.insert(configs, "-DSUITESPARSE_USE_CUDA=" .. (package:config("cuda") and "ON" or "OFF")) + local bla_vendor = {mkl = "Intel10_64lp", openblas = "OpenBLAS", apple = "Apple"} + table.insert(configs, "-DBLA_VENDOR=" .. bla_vendor[package:config("blas")]) + table.insert(configs, "-DBLA_STATIC=" .. (package:config("blas_static") and "ON" or "OFF")) + if package:is_plat("windows") then + if package:config("graphblas") then + table.insert(configs, "-DSUITESPARSE_ENABLE_PROJECTS=suitesparse_config;mongoose;amd;btf;camd;ccolamd;colamd;cholmod;cxsparse;ldl;klu;umfpack;paru;rbio;spqr;graphblas;lagraph") -- remove spex since it does not support windows + else + table.insert(configs, "-DSUITESPARSE_ENABLE_PROJECTS=suitesparse_config;mongoose;amd;btf;camd;ccolamd;colamd;cholmod;cxsparse;ldl;klu;umfpack;paru;rbio;spqr") + end + local vs_sdkver = import("core.tool.toolchain").load("msvc"):config("vs_sdkver") + if vs_sdkver then + local build_ver = string.match(vs_sdkver, "%d+%.%d+%.(%d+)%.?%d*") + assert(tonumber(build_ver) >= 18362, "cpuinfo requires Windows SDK to be at least 10.0.18362.0") + table.insert(configs, "-DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=" .. vs_sdkver) + table.insert(configs, "-DCMAKE_SYSTEM_VERSION=" .. vs_sdkver) + end + elseif not package:config("graphblas") then + table.insert(configs, "-DSUITESPARSE_ENABLE_PROJECTS=suitesparse_config;mongoose;amd;btf;camd;ccolamd;colamd;cholmod;cxsparse;ldl;klu;umfpack;paru;rbio;spqr;spex") + end + import("package.tools.cmake").install(package, configs) + else + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + local configs = {} + configs.with_blas = package:config("blas") + configs.with_cuda = package:config("cuda") + configs.graphblas = package:config("graphblas") + configs.graphblas_static = package:config("graphblas_static") + import("package.tools.xmake").install(package, configs) + end end) on_test(function (package) - assert(package:has_cfuncs("SuiteSparse_start", {includes = "SuiteSparse_config.h"})) + if package:version():ge("7.4.0") then + assert(package:has_cfuncs("SuiteSparse_start", {includes = "suitesparse/SuiteSparse_config.h"})) + else + assert(package:has_cfuncs("SuiteSparse_start", {includes = "SuiteSparse_config.h"})) + end end) diff --git a/packages/s/symengine/xmake.lua b/packages/s/symengine/xmake.lua new file mode 100644 index 000000000..c9adf117b --- /dev/null +++ b/packages/s/symengine/xmake.lua @@ -0,0 +1,59 @@ +package("symengine") + set_homepage("https://symengine.org") + set_description("SymEngine is a fast symbolic manipulation library, written in C++") + set_license("MIT") + + add_urls("https://github.com/symengine/symengine/archive/refs/tags/$(version).tar.gz", + "https://github.com/symengine/symengine.git") + + add_versions("v0.12.0", "1b5c3b0bc6a9f187635f93585649f24a18e9c7f2167cebcd885edeaaf211d956") + add_versions("v0.11.2", "f6972acd6a65354f6414e69460d2e175729470632bdac05919bc2f7f32e48cbd") + + add_configs("integer_class", {description = "Integer class for symengine. Either gmp, gmpxx, flint or piranha", default = "boost", type = "string", values = {"boost", "gmp"}}) + add_configs("teuchos", {description = "Build with teuchos", default = false, type = "boolean"}) + + if is_plat("linux") then + add_syslinks("m") + end + + add_deps("cmake") + + on_load(function (package) + -- Unsupported gmp + if package:is_plat("windows") then + package:config_set("integer_class", "boost") + end + package:add("deps", package:config("integer_class")) + end) + + on_install("windows", "linux", "macosx", "bsd", "mingw", "cross", function (package) + local configs = {"-DBUILD_TESTS=OFF", "-DBUILD_BENCHMARKS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DWITH_SYMENGINE_TEUCHOS=" .. (package:config("teuchos") and "ON" or "OFF")) + if package:config("integer_class") == "boost" then + table.insert(configs, "-DINTEGER_CLASS=boostmp") + else + table.insert(configs, "-DINTEGER_CLASS=gmp") + end + if package:is_plat("windows") then + table.insert(configs, "-DMSVC_USE_MT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + + if os.isfile(package:installdir("lib/libteuchos.a")) then + package:add("links", "symengine", "teuchos") + end + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + using SymEngine::Expression; + void test() { + Expression x("x"); + auto ex = pow(x+sqrt(Expression(2)), 6); + } + ]]}, {configs = {languages = "c++14"}})) + assert(package:has_cfuncs("basic_new_stack", {includes = "symengine/cwrapper.h"})) + end) diff --git a/packages/s/sys_time_h/xmake.lua b/packages/s/sys_time_h/xmake.lua new file mode 100644 index 000000000..764561f31 --- /dev/null +++ b/packages/s/sys_time_h/xmake.lua @@ -0,0 +1,16 @@ +package("sys_time_h") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/win32ports/sys_time_h") + set_description("header-only Windows implementation of the header") + set_license("MIT") + + add_urls("https://github.com/win32ports/sys_time_h.git") + add_versions("2023.03.22", "128ff475e1abc2aec0450f369bf91952a9bd2a3e") + + on_install("windows", function (package) + os.cp("sys", package:installdir("include")) + end) + + on_test(function (package) + assert(package:has_cfuncs("gettimeofday", {includes = "sys/time.h"})) + end) diff --git a/packages/s/sys_wait_h/xmake.lua b/packages/s/sys_wait_h/xmake.lua new file mode 100644 index 000000000..a904d7f35 --- /dev/null +++ b/packages/s/sys_wait_h/xmake.lua @@ -0,0 +1,16 @@ +package("sys_wait_h") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/win32ports/sys_wait_h") + set_description("header-only Windows implementation of the header") + set_license("MIT") + + add_urls("https://github.com/win32ports/sys_wait_h.git") + add_versions("2019.05.12", "229dee8de9cb4c29a3a31115112a4175df84a8eb") + + on_install("windows", function (package) + os.cp("sys", package:installdir("include")) + end) + + on_test(function (package) + assert(package:has_cfuncs("wait", {includes = "sys/wait.h"})) + end) diff --git a/packages/t/taskflow/xmake.lua b/packages/t/taskflow/xmake.lua index 76ace0007..4db6cd362 100644 --- a/packages/t/taskflow/xmake.lua +++ b/packages/t/taskflow/xmake.lua @@ -7,6 +7,7 @@ package("taskflow") add_urls("https://github.com/taskflow/taskflow.git") add_urls("https://github.com/taskflow/taskflow/archive/$(version).tar.gz") + add_versions("v3.7.0", "788b88093fb3788329ebbf7c7ee05d1f8960d974985a301798df01e77e04233b") add_versions("v3.6.0", "5a1cd9cf89f93a97fcace58fd73ed2fc8ee2053bcb43e047acb6bc121c3edf4c") add_versions("v3.5.0", "33c44e0da7dfda694d2b431724d6c8fd25a889ad0afbb4a32e8da82e2e9c2a92") add_versions("v3.4.0", "8f449137d3f642b43e905aeacdf1d7c5365037d5e1586103ed4f459f87cecf89") diff --git a/packages/t/tbb/fetch.lua b/packages/t/tbb/fetch.lua index 4395fcb01..3f4418432 100644 --- a/packages/t/tbb/fetch.lua +++ b/packages/t/tbb/fetch.lua @@ -11,7 +11,7 @@ function _find_package_on_windows(package, opt) -- find includes and links local result = {links = {}, linkdirs = {}, includedirs = {}} for _, lib in ipairs({"tbb", "tbbmalloc", "tbbmalloc_proxy"}) do - local linkinfo = find_library(lib, paths, {suffixes = path.join("lib", rdir, "vc14")}) + local linkinfo = find_library(lib, paths, {suffixes = {"lib", path.join("lib", rdir, "vc14")}}) if linkinfo then table.insert(result.linkdirs, linkinfo.linkdir) table.insert(result.links, lib) diff --git a/packages/t/tbb/xmake.lua b/packages/t/tbb/xmake.lua index 6c9552911..3ca49861c 100644 --- a/packages/t/tbb/xmake.lua +++ b/packages/t/tbb/xmake.lua @@ -18,6 +18,8 @@ package("tbb") add_versions("2021.5.0", "e5b57537c741400cf6134b428fc1689a649d7d38d9bb9c1b6d64f092ea28178a") add_versions("2021.7.0", "2cae2a80cda7d45dc7c072e4295c675fff5ad8316691f26f40539f7e7e54c0cc") add_versions("2021.10.0", "487023a955e5a3cc6d3a0d5f89179f9b6c0ae7222613a7185b0227ba0c83700b") + add_versions("2021.11.0", "782ce0cab62df9ea125cdea253a50534862b563f1d85d4cda7ad4e77550ac363") + add_versions("2021.12.0", "c7bb7aa69c254d91b8f0041a71c5bcc3936acb64408a1719aec0b2b7639dd84f") else add_urls("https://github.com/oneapi-src/oneTBB/archive/v$(version).tar.gz") add_versions("2020.3", "ebc4f6aa47972daed1f7bf71d100ae5bf6931c2e3144cf299c8cc7d041dca2f3") @@ -27,7 +29,9 @@ package("tbb") add_versions("2021.5.0", "e5b57537c741400cf6134b428fc1689a649d7d38d9bb9c1b6d64f092ea28178a") add_versions("2021.7.0", "2cae2a80cda7d45dc7c072e4295c675fff5ad8316691f26f40539f7e7e54c0cc") add_versions("2021.10.0", "487023a955e5a3cc6d3a0d5f89179f9b6c0ae7222613a7185b0227ba0c83700b") - + add_versions("2021.11.0", "782ce0cab62df9ea125cdea253a50534862b563f1d85d4cda7ad4e77550ac363") + add_versions("2021.12.0", "c7bb7aa69c254d91b8f0041a71c5bcc3936acb64408a1719aec0b2b7639dd84f") + add_patches("2021.2.0", path.join(os.scriptdir(), "patches", "2021.2.0", "gcc11.patch"), "181511cf4878460cb48ac0531d3ce8d1c57626d698e9001a0951c728fab176fb") add_patches("2021.5.0", path.join(os.scriptdir(), "patches", "2021.5.0", "i386.patch"), "1a1c11724839cf98b1b8f4d415c0283ec7719c330b11503c578739eb02889ec0") @@ -62,7 +66,18 @@ package("tbb") io.replace("cmake/compilers/GNU.cmake", "-Wl,-z,relro,-z,now,-z,noexecstack", "", {plain = true}) table.insert(configs, "-DCMAKE_SYSTEM_PROCESSOR=" .. (package:is_arch("x86_64") and "AMD64" or "i686")) end - import("package.tools.cmake").install(package, configs) + + local exflags + if package:is_plat("android") then + import("core.tool.toolchain") + + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndkver = ndk:config("ndkver") + if ndkver == 26 then + exflags = {"-Wl,--undefined-version"} + end + end + import("package.tools.cmake").install(package, configs, {shflags = exflags, ldflags = exflags}) if package:is_plat("mingw") then local ext = package:config("shared") and ".dll.a" or ".a" local libfiles = os.files(path.join(package:installdir("lib"), "libtbb*" .. ext)) diff --git a/packages/t/tbox/xmake.lua b/packages/t/tbox/xmake.lua index a10fd7c45..fb6ce0a20 100644 --- a/packages/t/tbox/xmake.lua +++ b/packages/t/tbox/xmake.lua @@ -17,6 +17,7 @@ package("tbox") add_versions("v1.6.9", "31db6cc51af7db76ad5b5da88356982b1e0f1e624c466c749646dd203b68adae") add_versions("v1.7.1", "236493a71ffc9d07111e906fc2630893b88d32c0a5fbb53cd94211f031bd65a1") add_versions("v1.7.4", "c2eb29ad0cab15b851ab54cea6ae99555222a337a0f83340ae820b4a6e76a10c") + add_versions("v1.7.5", "6382cf7d6110cbe6f29e8346d0e4eb078dd2cbf7e62913b96065848e351eb15e") add_configs("micro", {description = "Compile micro core library for the embed system.", default = false, type = "boolean"}) add_configs("float", {description = "Enable or disable the float type.", default = true, type = "boolean"}) diff --git a/packages/t/teascript/xmake.lua b/packages/t/teascript/xmake.lua new file mode 100644 index 000000000..0427001e9 --- /dev/null +++ b/packages/t/teascript/xmake.lua @@ -0,0 +1,36 @@ +package("teascript") + set_kind("library", {headeronly = true}) + set_homepage("https://tea-age.solutions/teascript/overview-and-highlights/") + set_description("TeaScript C++ Library - embedded scripting language for C++ Applications") + set_license("MPL-2.0") + + add_urls("https://github.com/Florian-Thake/TeaScript-Cpp-Library/archive/refs/tags/$(version).tar.gz", + "https://github.com/Florian-Thake/TeaScript-Cpp-Library.git") + + add_versions("v0.13.0", "7c8cc05a8775ee2c857278b5e353670bf02442b2fa3a411343e82b2b85eedced") + + add_configs("fmt", {description = "Use fmt for printing.", default = true, type = "boolean"}) + add_configs("toml++", {description = "Enable toml support.", default = true, type = "boolean"}) + + on_load(function (package) + if package:config("fmt") then + package:add("deps", "fmt") + end + if package:config("toml++") then + package:add("deps", "toml++") + end + end) + + on_install("windows", "linux", "macosx|arm64", "bsd", "msys", "mingw|i386", function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "teascript/Engine.hpp" + void test() { + teascript::Engine engine; + engine.ExecuteCode("println(\"Hello, World!\");"); + } + ]]}, {configs = {languages = "c++20"}})) + end) diff --git a/packages/t/telebot/xmake.lua b/packages/t/telebot/xmake.lua new file mode 100644 index 000000000..290eed9da --- /dev/null +++ b/packages/t/telebot/xmake.lua @@ -0,0 +1,54 @@ +package("telebot") + set_homepage("https://elmurod.net/telebot") + set_description("Telegram Bot API in C") + set_license("Apache-2.0") + + add_urls("https://github.com/smartnode/telebot.git") + add_versions("2024.05.11", "63693b4f9bcdc3fd0b0f2b37104b6694d723b5b4") + + if is_plat("linux") then + add_syslinks("pthread") + end + + add_deps("json-c", "libcurl") + if is_plat("windows", "mingw@macosx,linux") then + add_deps("pthreads4w") + end + + on_install("windows|x64", "windows|x86", "mingw@macosx,linux", "linux", function (package) + if package:is_plat("windows") then + io.replace("src/telebot.c", "#include ", "", {plain = true}) + io.replace("src/telebot-core.c", "#include ", "", {plain = true}) + end + + io.replace("src/telebot.c", "#include ", "#include ", {plain = true}) + io.replace("src/telebot-core.c", "#include ", "#include ", {plain = true}) + io.replace("src/telebot-parser.c", "#include ", "#include ", {plain = true}) + + io.replace("src/telebot.c", "#include ", "#include ", {plain = true}) + io.replace("src/telebot-parser.c", "#include ", "#include ", {plain = true}) + + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + set_encodings("utf-8") + if is_plat("windows", "mingw@macosx,linux") then + add_requires("pthreads4w") + add_packages("pthreads4w") + end + add_requires("json-c", "libcurl") + add_packages("json-c", "libcurl") + target("telebot") + set_kind("$(kind)") + add_files("src/*.c") + add_headerfiles("include/*.h") + add_includedirs("include") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("telebot_create", {includes = "telebot.h"})) + end) diff --git a/packages/t/tesseract/xmake.lua b/packages/t/tesseract/xmake.lua index c614ec589..853c8f02d 100644 --- a/packages/t/tesseract/xmake.lua +++ b/packages/t/tesseract/xmake.lua @@ -4,12 +4,13 @@ package("tesseract") set_description("Tesseract Open Source OCR Engine") set_license("Apache-2.0") - add_urls("https://github.com/tesseract-ocr/tesseract/archive/$(version).tar.gz", + add_urls("https://github.com/tesseract-ocr/tesseract/archive/refs/tags/$(version).tar.gz", "https://github.com/tesseract-ocr/tesseract.git") add_versions("4.1.1", "2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb") add_versions("4.1.3", "83dc56b544be938983f528c777e4e1d906205b0f6dc0110afc223f2cc1cec6d3") add_versions("5.0.1", "b5b0e561650ed67feb1e9de38d4746121d302ae4c876c95b99b8b6f9f89d5c58") add_versions("5.2.0", "eba4deb2f92a3f89a6623812074af8c53b772079525b3c263aa70bbf7b748b3c") + add_versions("5.3.4", "141afc12b34a14bb691a939b4b122db0d51bd38feda7f41696822bacea7710c7") add_configs("training", {description = "Build training tools.", default = false, type = "boolean"}) add_configs("libarchive", {description = "Enable build with libarchive.", default = false, type = "boolean"}) @@ -40,7 +41,7 @@ package("tesseract") io.replace("CMakeLists.txt", "find_package(PkgConfig)", "", {plain = true}) io.replace("src/training/CMakeLists.txt", "find_package(PkgConfig)", "", {plain = true}) local configs = {"-DSW_BUILD=OFF", "-DBUILD_TESTS=OFF", "-DUSE_SYSTEM_ICU=ON"} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) if package:is_plat("windows") then table.insert(configs, "-DWIN32_MT_BUILD=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) @@ -49,7 +50,13 @@ package("tesseract") table.insert(configs, "-DDISABLE_ARCHIVE=" .. (package:config("libarchive") and "OFF" or "ON")) table.insert(configs, "-DDISABLE_CURL=" .. (package:config("libcurl") and "OFF" or "ON")) table.insert(configs, "-DENABLE_OPENCL=" .. (package:config("opencl") and "ON" or "OFF")) - import("package.tools.cmake").install(package, configs) + + local packagedeps = {} + if package:is_plat("macosx") then + table.insert(packagedeps, "libtiff") + end + + import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps}) package:addenv("PATH", "bin") end) diff --git a/packages/t/texinfo/xmake.lua b/packages/t/texinfo/xmake.lua index 6227479cd..64631e4e4 100644 --- a/packages/t/texinfo/xmake.lua +++ b/packages/t/texinfo/xmake.lua @@ -5,8 +5,8 @@ package("texinfo") set_description("Official documentation format of the GNU project") set_license("GPL-3.0") - set_urls("https://ftp.gnu.org/gnu/texinfo/texinfo-$(version).tar.xz", - "https://ftpmirror.gnu.org/texinfo/texinfo-$(version).tar.xz") + set_urls("https://ftpmirror.gnu.org/texinfo/texinfo-$(version).tar.xz", + "https://ftp.gnu.org/gnu/texinfo/texinfo-$(version).tar.xz") add_versions("6.7", "988403c1542d15ad044600b909997ba3079b10e03224c61188117f3676b02caa") -- FIXME, we need fix gnulib on linux, @see https://www.mail-archive.com/bug-texinfo@gnu.org/msg10181.html --add_versions("6.8", "8eb753ed28bca21f8f56c1a180362aed789229bd62fff58bf8368e9beb59fec4") diff --git a/packages/t/tf_workstealingqueue/xmake.lua b/packages/t/tf_workstealingqueue/xmake.lua new file mode 100644 index 000000000..5984a0876 --- /dev/null +++ b/packages/t/tf_workstealingqueue/xmake.lua @@ -0,0 +1,26 @@ +package("tf_workstealingqueue") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/taskflow/work-stealing-queue") + set_description("A fast work-stealing queue template in C++") + set_license("MIT") + + add_urls("https://github.com/taskflow/work-stealing-queue.git") + add_versions("2022.07.20", "378e297749374300bf9bc0229096285447993877") + + on_install(function (package) + os.cp("wsq.hpp", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + static void test() { + WorkStealingQueue queue; + queue.push(0); + queue.push(1); + + std::optional item1 = queue.pop(); + std::optional item2 = queue.steal(); + } + ]]}, {configs = {languages = "c++17"}, includes = {"wsq.hpp"}})) + end) + diff --git a/packages/t/tgbot-cpp/xmake.lua b/packages/t/tgbot-cpp/xmake.lua index 525c9a034..a956c9f59 100644 --- a/packages/t/tgbot-cpp/xmake.lua +++ b/packages/t/tgbot-cpp/xmake.lua @@ -6,6 +6,7 @@ package("tgbot-cpp") set_urls("https://github.com/reo7sp/tgbot-cpp/archive/refs/tags/$(version).tar.gz", "https://github.com/reo7sp/tgbot-cpp.git") + add_versions("v1.7.3", "f1d2863a7ac77f2a58b3c6f8a163b4d6e9d191ab5bff0dcf6e271adabf9111a9") add_versions("v1.7.2", "3a41c25c5e4b60bda3f278550a380f1c7c382fd50ea1ab1801edc837d1535462") add_configs("curl", {description = "Use curl-based http client CurlHttpClient", default = false, type = "boolean"}) @@ -20,7 +21,6 @@ package("tgbot-cpp") end) on_install("windows", "linux", "macosx", "mingw", "cross", function (package) - local configs = {} io.writefile("xmake.lua", [[ add_requires("openssl", "zlib") add_requires("boost", {configs = {system = true}}) @@ -33,7 +33,8 @@ package("tgbot-cpp") add_files("src/**.cpp") add_includedirs("include") add_headerfiles("include/(tgbot/**.h)") - set_languages("c++14") + set_languages("c++17") + set_exceptions("cxx") if is_plat("windows") then add_defines("_WIN32_WINNT=0x0601", "WIN32_LEAN_AND_MEAN", "NOMINMAX") end @@ -49,10 +50,7 @@ package("tgbot-cpp") add_defines("HAVE_CURL") end ]]) - if package:config("shared") then - configs.kind = "shared" - end - import("package.tools.xmake").install(package, configs) + import("package.tools.xmake").install(package) end) on_test(function (package) @@ -61,5 +59,5 @@ package("tgbot-cpp") void test() { TgBot::Bot bot("PLACE YOUR TOKEN HERE"); } - ]]}, {configs = {languages = "c++14"}})) + ]]}, {configs = {languages = "c++17"}})) end) diff --git a/packages/t/thorvg/xmake.lua b/packages/t/thorvg/xmake.lua new file mode 100644 index 000000000..25cb606b0 --- /dev/null +++ b/packages/t/thorvg/xmake.lua @@ -0,0 +1,100 @@ +package("thorvg") + set_homepage("https://www.thorvg.org") + set_description("Thor Vector Graphics is a lightweight portable library used for drawing vector-based scenes and animations including SVG and Lottie. It can be freely utilized across various software platforms and applications to visualize graphical contents.") + set_license("MIT") + + add_urls("https://github.com/thorvg/thorvg/archive/refs/tags/$(version).tar.gz", + "https://github.com/thorvg/thorvg.git") + + add_versions("v0.13.6", "f24fd3647e1a309dec00f6455b32258c0dd0e0dbd1133233169467571f188bad") + add_versions("v0.13.5", "977ed74c3846c9a6acd5765aff776745d40e3c91507b22e51177d59c69afd198") + add_versions("v0.13.2", "03b5dbb4c73ff221a4bd7243cc0ad377aecff4c3077f5a57ee2902e4122d3218") + + add_configs("engines", {description = "Enable Rasterizer Engine in thorvg", default = {"sw"}, type = "table"}) + add_configs("loaders", {description = "Enable File Loaders", type = "table"}) + add_configs("savers", {description = "Enable File Savers", type = "table"}) + add_configs("tools", {description = "Enable building thorvg tools", type = "table"}) + add_configs("extra", {description = "Enable support for exceptionally advanced features", type = "table"}) + add_configs("threads", {description = "Enable the multi-threading task scheduler in thorvg", default = false, type = "boolean"}) + add_configs("simd", {description = "Enable CPU Vectorization(SIMD) in thorvg", default = false, type = "boolean"}) + add_configs("log", {description = "Enable log message", default = false, type = "boolean"}) + add_configs("c_api", {description = "Enable API bindings", default = false, type = "boolean"}) + if is_plat("wasm") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end + + if is_plat("linux", "bsd") then + add_syslinks("pthread", "m") + end + + add_deps("meson", "ninja") + if is_plat("windows") then + add_deps("pkgconf") + end + + on_load(function (package) + import("core.base.hashset") + + local loaders = package:config("loaders") + if loaders then + local loaders = hashset.from(loaders) + if loaders then + local deps = {jpg = "libjpeg-turbo", png = "libpng", webp = "libwebp"} + if loaders:has("all") then + for _, dep in pairs(deps) do + package:add("deps", dep) + end + else + for name, dep in pairs(deps) do + if loaders:has(name) then + package:add("deps", dep) + end + end + end + end + end + end) + + on_install("!android", function (package) + if package:is_plat("mingw") then + io.replace("src/loaders/svg/tvgSvgLoader.cpp", "float_t", "float", {plain = true}) + end + + local configs = {} + if package:config("shared") then + table.insert(configs, "-Ddefault_library=shared") + else + table.insert(configs, "-Ddefault_library=static") + package:add("defines", "TVG_STATIC") + end + + local loaders = package:config("loaders") + local savers = package:config("savers") + local tools = package:config("tools") + local extra = package:config("extra") + table.insert(configs, "-Dengines=" .. table.concat(package:config("engines"), ",")) + table.insert(configs, "-Dloaders=" .. (loaders and table.concat(loaders, ",") or "")) + table.insert(configs, "-Dsavers=" .. (savers and table.concat(savers, ",") or "")) + table.insert(configs, "-Dtools=" .. (tools and table.concat(tools, ",") or "")) + table.insert(configs, "-Dextra=" .. (extra and table.concat(extra, ",") or "")) + if package:config("c_api") then + table.insert(configs, "-Dbindings=capi") + end + table.insert(configs, "-Dthreads=" .. (package:config("threads") and "true" or "false")) + table.insert(configs, "-Dsimd=" .. (package:config("simd") and "true" or "false")) + table.insert(configs, "-Dlog=" .. (package:config("log") and "true" or "false")) + import("package.tools.meson").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + tvg::Initializer::init(tvg::CanvasEngine::Sw, 0); + } + ]]}, {configs = {languages = "c++14"}})) + + if package:config("c_api") then + assert(package:has_cxxfuncs("tvg_engine_init", {includes = "thorvg_capi.h"})) + end + end) diff --git a/packages/t/thread-pool/xmake.lua b/packages/t/thread-pool/xmake.lua index 1b5040814..6cc243f0d 100644 --- a/packages/t/thread-pool/xmake.lua +++ b/packages/t/thread-pool/xmake.lua @@ -6,21 +6,18 @@ package("thread-pool") add_urls("https://github.com/bshoshany/thread-pool/archive/refs/tags/$(version).tar.gz", "https://github.com/bshoshany/thread-pool.git") + + add_versions("v4.1.0", "be7abecbc420bb87919eeef729b13ff7c29d5ce547bdae284923296c695415bd") add_versions("v3.3.0", "b76c0103c7ed07c137bd5b1988b9c09da280bbbad37588a096d2954c8d996e0f") on_install(function (package) - os.cp("BS_thread_pool.hpp", package:installdir("include")) + if package:version():ge("3.5.0") then + os.vcp("include", package:installdir()) + else + os.vcp("BS_thread_pool.hpp", package:installdir("include")) + end end) on_test(function (package) - assert(package:check_cxxsnippets({ - test = [[ - #include - static void test() { - BS::thread_pool pool; - std::future my_future = pool.submit([] { return 42; }); - std::cout << my_future.get(); - } - ]] - }, {configs = {languages = "c++17"}, includes = {"BS_thread_pool.hpp"}})) + assert(package:has_cxxtypes("BS::thread_pool", {configs = {languages = "c++17"}, includes = "BS_thread_pool.hpp"})) end) diff --git a/packages/t/thrift/patches/0.16.0/cmake.patch b/packages/t/thrift/patches/0.16.0/cmake.patch new file mode 100644 index 000000000..dd418e5ec --- /dev/null +++ b/packages/t/thrift/patches/0.16.0/cmake.patch @@ -0,0 +1,90 @@ +diff --git a/build/cmake/DefineInstallationPaths.cmake b/build/cmake/DefineInstallationPaths.cmake +index 23962b442..0c824cc7a 100644 +--- a/build/cmake/DefineInstallationPaths.cmake ++++ b/build/cmake/DefineInstallationPaths.cmake +@@ -20,11 +20,7 @@ + + # Define the default install paths + set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)") +-if(MSVC) +- set(LIB_INSTALL_DIR "bin${LIB_SUFFIX}" CACHE PATH "The library install dir (default: bin${LIB_SUFFIX})") +-else() +- set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})") +-endif() ++set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})") + set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)") + set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)") + set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)") +diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake +index b59292cd3..23caa09fe 100644 +--- a/build/cmake/DefineOptions.cmake ++++ b/build/cmake/DefineOptions.cmake +@@ -39,10 +39,7 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON) + # and enables the library if all are found. This means the default is to build as + # much as possible but leaving out libraries if their dependencies are not met. + +-if (NOT Boost_USE_STATIC_LIBS) +- add_definitions(-DBOOST_ALL_DYN_LINK) +- add_definitions(-DBOOST_TEST_DYN_LINK) +-endif() ++ + + # as3 + option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON) +diff --git a/lib/c_glib/CMakeLists.txt b/lib/c_glib/CMakeLists.txt +index 35571233d..ac6fc1d52 100644 +--- a/lib/c_glib/CMakeLists.txt ++++ b/lib/c_glib/CMakeLists.txt +@@ -71,7 +71,8 @@ set(thrift_c_glib_zlib_SOURCES + ) + + # If OpenSSL is not found just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list(APPEND thrift_c_glib_SOURCES + src/thrift/c_glib/transport/thrift_ssl_socket.c + ) +@@ -83,8 +84,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL) + list(APPEND SYSLIBS OpenSSL::Crypto) + endif() + else() +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + endif() + +diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt +index c2f15dd57..3f36a23c1 100644 +--- a/lib/cpp/CMakeLists.txt ++++ b/lib/cpp/CMakeLists.txt +@@ -97,7 +97,8 @@ else() + endif() + + # If OpenSSL is not found or disabled just ignore the OpenSSL stuff +-if(OPENSSL_FOUND AND WITH_OPENSSL) ++if(WITH_OPENSSL) ++ find_package(OpenSSL REQUIRED) + list(APPEND thriftcpp_SOURCES + src/thrift/transport/TSSLSocket.cpp + src/thrift/transport/TSSLServerSocket.cpp +@@ -112,8 +113,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL) + list(APPEND SYSLIBS OpenSSL::Crypto) + endif() + else() +- include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") +- list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") ++ list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto) + endif() + endif() + +@@ -174,7 +174,7 @@ if(WITH_LIBEVENT) + target_link_libraries(thriftnb PUBLIC thrift) + if(TARGET libevent::core AND TARGET libevent::extra) + # libevent was found via its cmake config, use modern style targets +- target_link_libraries(thriftnb PUBLIC libevent::core libevent::extra) ++ target_link_libraries(thriftnb PUBLIC libevent::core libevent::extra) + else() + target_link_libraries(thriftnb PUBLIC ${LIBEVENT_LIBRARIES}) + endif() diff --git a/packages/t/thrift/xmake.lua b/packages/t/thrift/xmake.lua index b658da9bb..bf113b878 100644 --- a/packages/t/thrift/xmake.lua +++ b/packages/t/thrift/xmake.lua @@ -1,14 +1,21 @@ package("thrift") - set_homepage("https://thrift.apache.org/") set_description("Thrift is a lightweight, language-independent software stack for point-to-point RPC implementation.") set_license("Apache-2.0") - add_urls("https://dlcdn.apache.org/thrift/0.16.0/thrift-0.16.0.tar.gz", {version = function (version) - return version:gsub("v", "") - end}) - add_urls("https://github.com/apache/thrift.git") - add_versions("v0.16.0", "f460b5c1ca30d8918ff95ea3eb6291b3951cf518553566088f3f2be8981f6209") + add_urls("https://github.com/apache/thrift/archive/refs/tags/$(version).tar.gz", + "https://github.com/apache/thrift.git") + + add_versions("v0.20.0", "cd7b829d3d9d87f9f7d708e004eef7629789591ee1d416f4741913bc33e5c27d") + add_versions("v0.19.0", "6428911db505702c51f7d993155a4a4c8afee83fdd021b52f2eccd8d34780629") + add_versions("v0.18.1", "9cea30b9700153329ae1926cc05a20bbe3e8451ae270b0c8c5c5fe9929924cb3") + add_versions("v0.18.0", "b42a659ebe3711a78de4b14a117ea44558106223593c3f09c0d8dbe8a1b26848") + add_versions("v0.17.0", "f5888bcd3b8de40c2c2ab86896867ad9b18510deb412cba3e5da76fb4c604c29") + add_versions("v0.16.0", "df2931de646a366c2e5962af679018bca2395d586e00ba82d09c0379f14f8e7b") + + add_patches(">=0.16.0", "patches/0.16.0/cmake.patch", "8dd82f54d52a37487e64aa3529f4dbcedcda671ab46fcb7a8c0f2c521ee0be9b") + + add_configs("compiler", {description = "Build compiler", default = false, type = "boolean"}) add_deps("cmake", "boost") if is_plat("windows") then @@ -17,16 +24,20 @@ package("thrift") add_deps("flex", "bison") end - local configdeps = {glib = "glib", libevent = "libevent", ssl = "openssl", zlib = "zlib"} - for config, dep in pairs(configdeps) do - add_configs(config, {description = "Enable " .. config .. " support.", default = false, type = "boolean"}) + local configdeps = {"glib", "libevent", "openssl", "zlib", "qt5"} + for _, dep in pairs(configdeps) do + add_configs(dep, {description = "Enable " .. dep .. " support.", default = false, type = "boolean"}) end on_load(function (package) - for name, dep in pairs(configdeps) do - if package:config(name) then - if name == "libevent" and package:config("ssl") then + for _, dep in pairs(configdeps) do + if package:config(dep) then + if dep == "libevent" and package:config("openssl") then package:add("deps", "libevent", {configs = {openssl = true}}) + elseif dep == "openssl" then + package:add("deps", "openssl3") + elseif dep == "qt5" then + package:add("deps", "qt5core", "qt5network") else package:add("deps", dep) end @@ -34,13 +45,11 @@ package("thrift") end end) - on_install("linux", "macosx", "cross", function (package) + on_install("windows", "linux", "macosx", "cross", function (package) local configs = { "-DBUILD_TESTING=OFF", - "-DWITH_STDTHREADS=ON", - "-DBUILD_COMPILER=ON", "-DBUILD_TUTORIALS=OFF", - -- language support. + "-DBUILD_CPP=ON", "-DBUILD_JAVA=OFF", "-DBUILD_JAVASCRIPT=OFF", @@ -48,17 +57,20 @@ package("thrift") "-DBUILD_PYTHON=OFF", } - for config, dep in pairs(configdeps) do - -- Use WITH_OPENSSL instead of WITH_SSL, thus use dep:upper(). + for _, dep in pairs(configdeps) do local feat = dep:upper() - if config == "glib" then + if dep == "glib" then feat = "C_GLIB" end - table.insert(configs, "-DWITH_" .. feat .. "=" .. (package:config(config) and "ON" or "OFF")) + table.insert(configs, "-DWITH_" .. feat .. "=" .. (package:config(dep) and "ON" or "OFF")) end - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_COMPILER=" .. (package:config("compiler") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DWITH_MT=" .. (package:has_runtime("MT") and "ON" or "OFF")) + end import("package.tools.cmake").install(package, configs) end) @@ -67,5 +79,5 @@ package("thrift") apache::thrift::transport::TTransport* test() { return new apache::thrift::transport::TSocket("localhost", 9090); } - ]]}, {configs = {languages = "c++11"}, includes="thrift/transport/TSocket.h"})) + ]]}, {configs = {languages = "c++11"}, includes = "thrift/transport/TSocket.h"})) end) diff --git a/packages/t/tiny-optional/xmake.lua b/packages/t/tiny-optional/xmake.lua new file mode 100644 index 000000000..4aadab32f --- /dev/null +++ b/packages/t/tiny-optional/xmake.lua @@ -0,0 +1,19 @@ +package("tiny-optional") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/Sedeniono/tiny-optional") + set_description("Replacement for std::optional that does not unnecessarily waste memory") + set_license("BSL-1.0") + + add_urls("https://github.com/Sedeniono/tiny-optional/archive/refs/tags/$(version).tar.gz", + "https://github.com/Sedeniono/tiny-optional.git") + + add_versions("v1.2.1", "0305d31c43ef8365befd7d022c13c431b913036d4c10c0c5419e9765077c5122") + add_versions("v1.2.0", "d4ce47d0c9c4f89ab41e4e0b96d25bfb98c0cc02da3d7b312337e5e4e6e1c9e8") + + on_install("windows|!arm*", "linux|!arm*", "macosx|!arm*", "bsd|!arm*", "mingw|!arm*", "msys|!arm*", "android|!arm*", function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:has_cxxtypes("tiny::optional", {configs = {languages = "c++17"}, includes = "tiny/optional.h"})) + end) diff --git a/packages/t/tinyalloc/xmake.lua b/packages/t/tinyalloc/xmake.lua new file mode 100644 index 000000000..6b2bb2cce --- /dev/null +++ b/packages/t/tinyalloc/xmake.lua @@ -0,0 +1,25 @@ +package("tinyalloc") + set_homepage("https://github.com/thi-ng/tinyalloc") + set_description("malloc / free replacement for unmanaged, linear memory situations (e.g. WASM, embedded devices...)") + set_license("Apache-2.0") + + add_urls("https://github.com/thi-ng/tinyalloc.git") + add_versions("2021.10.08", "b60fcd7a351dea8a51f3ec95b19fc0d0d2e4dcd9") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("tinyalloc") + set_kind("$(kind)") + add_files("tinyalloc.c") + add_headerfiles("tinyalloc.h") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("ta_init", {includes = "tinyalloc.h"})) + end) diff --git a/packages/t/tinydir/xmake.lua b/packages/t/tinydir/xmake.lua new file mode 100644 index 000000000..815e569f7 --- /dev/null +++ b/packages/t/tinydir/xmake.lua @@ -0,0 +1,17 @@ +package("tinydir") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/cxong/tinydir") + set_description("Lightweight, portable and easy to integrate C directory and file reader") + + add_urls("https://github.com/cxong/tinydir/archive/refs/tags/$(version).tar.gz", + "https://github.com/cxong/tinydir.git") + + add_versions("1.2.6", "1ecbdf8d04b079f8a9404662708d2333d6b72b956effb0d5296d063db3a02b4e") + + on_install(function (package) + os.cp("tinydir.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:has_cfuncs("tinydir_open", {includes = "tinydir.h"})) + end) diff --git a/packages/t/tinyexr/xmake.lua b/packages/t/tinyexr/xmake.lua index 55818bc04..3b816b1e6 100644 --- a/packages/t/tinyexr/xmake.lua +++ b/packages/t/tinyexr/xmake.lua @@ -7,6 +7,7 @@ package("tinyexr") add_urls("https://github.com/syoyo/tinyexr/archive/refs/tags/$(version).tar.gz", "https://github.com/syoyo/tinyexr.git") add_versions("v1.0.1", "4dbbd8c7d17597ad557518de5eb923bd02683d26d0de765f9224e8d57d121677") + add_versions("v1.0.8", "b56446533f36496c3c76b8e4f664f04736b173c5e3f4903f6edff3753f363302") add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) diff --git a/packages/t/tinyfiledialogs/xmake.lua b/packages/t/tinyfiledialogs/xmake.lua index 34b6b9b55..082563762 100644 --- a/packages/t/tinyfiledialogs/xmake.lua +++ b/packages/t/tinyfiledialogs/xmake.lua @@ -6,6 +6,7 @@ package("tinyfiledialogs") add_urls("https://git.code.sf.net/p/tinyfiledialogs/code.git") add_versions("3.8.8", "d89567798fb1b989c6fc46a61698e4734760e0bf") + add_versions("3.15.1", "776ad52d7b7057f330caa74f00e5e9d9eae85631") if is_plat("windows") then add_syslinks("comdlg32", "ole32", "user32", "shell32") diff --git a/packages/t/tinygltf/xmake.lua b/packages/t/tinygltf/xmake.lua index b17175fb9..6fcf5f67a 100644 --- a/packages/t/tinygltf/xmake.lua +++ b/packages/t/tinygltf/xmake.lua @@ -6,6 +6,7 @@ package("tinygltf") add_urls("https://github.com/syoyo/tinygltf/archive/refs/tags/$(version).tar.gz", "https://github.com/syoyo/tinygltf.git") + add_versions("v2.8.21", "e567257d7addde58b0a483832cbaa5dd8f15e5bcaee6f023831e215d1a2c0502") add_versions("v2.5.0", "5d85bd556b60b1b69527189293cfa4902957d67fabb8582b6532f23a5ef27ec1") add_versions("v2.6.3", "f61e4a501baa7fbf31b18ea0f6815a59204ad0de281f7b04f0168f6bbd17c340") add_versions("v2.8.9", "cfff42b9246e1e24d36ec4ae94a22d5f4b0a1c63c796babb5c2a13fe66aed5e9") diff --git a/packages/t/tinyobjloader/xmake.lua b/packages/t/tinyobjloader/xmake.lua index c5b3ac77a..8e991d6c3 100644 --- a/packages/t/tinyobjloader/xmake.lua +++ b/packages/t/tinyobjloader/xmake.lua @@ -8,6 +8,7 @@ package("tinyobjloader") add_urls("https://github.com/tinyobjloader/tinyobjloader.git") add_versions("v1.0.7", "b9d08b675ba54b9cb00ffc99eaba7616d0f7e6f6b8947a7e118474e97d942129") add_versions("v2.0.0rc10", "e1bc2e5547b562d33ca4a90b581717984a70d58113d83208dbc97c82e137b9fe") + add_versions("v2.0.0rc13", "0feb92b838f8ce4aa6eb0ccc32dff30cb64a891e0ec3bde837fca49c78d44334") add_configs("double", {description = "Use double precision floating numbers.", default = false, type = "boolean"}) if is_plat("windows") then @@ -20,7 +21,7 @@ package("tinyobjloader") end end) - on_install("macosx", "linux", "windows", "mingw", "android", "iphoneos", function (package) + on_install("macosx", "linux", "windows", "mingw", "android", "iphoneos", "cross", function (package) io.writefile("xmake.lua", string.format([[ add_rules("mode.debug", "mode.release") add_rules("utils.install.cmake_importfiles") diff --git a/packages/t/tinyply/xmake.lua b/packages/t/tinyply/xmake.lua new file mode 100644 index 000000000..a13303383 --- /dev/null +++ b/packages/t/tinyply/xmake.lua @@ -0,0 +1,29 @@ +package("tinyply") + + set_homepage("https://github.com/ddiakopoulos/tinyply") + set_description("C++11 ply 3d mesh format importer & exporter") + set_license("BSD-2-Clause") + + add_urls("https://github.com/ddiakopoulos/tinyply/archive/$(version).tar.gz") + add_urls("https://github.com/ddiakopoulos/tinyply.git") + add_versions("2.3.4", "1bb1462727a363f7b77a10e51cd023095db7b281d2f201167620a83e495513c6") + + on_install("macosx", "linux", "windows", "mingw", "android", "iphoneos", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + target("tinyply") + set_kind("$(kind)") + set_languages("c++11") + add_files("source/tinyply.cpp") + add_headerfiles("source/tinyply.h") + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + tinyply::PlyFile plyFile; + } + ]]}, {configs = {languages = "c++11"}, includes = "tinyply.h"})) + end) diff --git a/packages/t/tinyxml/xmake.lua b/packages/t/tinyxml/xmake.lua index a6c0897e4..1cd6940a3 100644 --- a/packages/t/tinyxml/xmake.lua +++ b/packages/t/tinyxml/xmake.lua @@ -7,6 +7,9 @@ package("tinyxml") add_urls("https://sourceforge.net/projects/tinyxml/files/tinyxml/$(version).zip", {version = function (version) return version .. "/tinyxml_" .. version:gsub("%.", "_") end}) add_versions("2.6.2", "ac6bb9501c6f50cc922d22f26b02fab168db47521be5e845b83d3451a3e1d512") + if is_plat("windows") then + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + end add_configs("stl", {description = "Enable STL support.", default = true, type = "boolean"}) on_install(function (package) @@ -20,13 +23,7 @@ package("tinyxml") add_files("tinyxml.cpp", "tinystr.cpp", "tinyxmlerror.cpp", "tinyxmlparser.cpp") add_headerfiles("tinyxml.h", "tinystr.h") ]]) - local configs = {} - if not package:is_plat("windows") and package:config("shared") then - configs.kind = "shared" - elseif package:is_plat("linux") and package:config("pic") ~= false then - configs.cxflags = "-fPIC" - end - import("package.tools.xmake").install(package, configs) + import("package.tools.xmake").install(package) end) on_test(function (package) diff --git a/packages/t/tinyxml2/xmake.lua b/packages/t/tinyxml2/xmake.lua index b4bfdedda..471bddc6c 100644 --- a/packages/t/tinyxml2/xmake.lua +++ b/packages/t/tinyxml2/xmake.lua @@ -2,18 +2,20 @@ package("tinyxml2") set_homepage("http://www.grinninglizard.com/tinyxml2/") set_description("simple, small, efficient, C++ XML parser that can be easily integrating into other programs.") + set_license("zlib") add_urls("https://github.com/leethomason/tinyxml2/archive/$(version).tar.gz") add_urls("https://github.com/leethomason/tinyxml2.git") add_versions("8.0.0", "6ce574fbb46751842d23089485ae73d3db12c1b6639cda7721bf3a7ee862012c") add_versions("9.0.0", "cc2f1417c308b1f6acc54f88eb70771a0bf65f76282ce5c40e54cfe52952702c") + add_versions("10.0.0", "3bdf15128ba16686e69bce256cc468e76c7b94ff2c7f391cc5ec09e40bff3839") if is_plat("linux", "macosx", "windows") then add_deps("cmake") end on_install("linux", "macosx", "windows", function (package) - local configs = {"-DBUILD_TESTS=OFF"} + local configs = {"-DBUILD_TESTING=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) @@ -28,7 +30,7 @@ package("tinyxml2") add_headerfiles("tinyxml2.h") add_files("tinyxml2.cpp") ]]) - import("package.tools.xmake").install(package, {kind = package:config("shared") and "shared" or "static"}) + import("package.tools.xmake").install(package) end) on_test(function (package) diff --git a/packages/t/tl_optional/xmake.lua b/packages/t/tl_optional/xmake.lua new file mode 100644 index 000000000..de8350c14 --- /dev/null +++ b/packages/t/tl_optional/xmake.lua @@ -0,0 +1,24 @@ +package("tl_optional") + + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/TartanLlama/optional") + set_description("C++11/14/17 std::optional with functional-style extensions and support for references.") + set_license("CC0") + + set_urls("https://github.com/TartanLlama/optional/archive/refs/tags/$(version).zip", + "https://github.com/TartanLlama/optional.git") + + add_versions("v1.1.0", "a336bb10f51945369c1dd6dc6d2a7086602ab9cab52c98a7a6224bfd782bc0c7") + + on_install(function (package) + os.cp("include/tl", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + tl::optional e1 = 42; + } + ]]}, {configs = {languages = "c++11"}, includes = {"tl/optional.hpp"}})) + end) + diff --git a/packages/t/tmx/xmake.lua b/packages/t/tmx/xmake.lua new file mode 100644 index 000000000..b7b401c4b --- /dev/null +++ b/packages/t/tmx/xmake.lua @@ -0,0 +1,54 @@ +package("tmx") + set_homepage("http://libtmx.rtfd.io/") + set_description("C tmx map loader") + set_license("BSD-2-Clause") + + add_urls("https://github.com/baylej/tmx/archive/refs/tags/tmx_$(version).tar.gz", + "https://github.com/baylej/tmx.git") + + add_versions("1.2.0", "6f9ecb91beba1f73d511937fba3a04306a5af0058a4c2b623ad2219929a4116a") + + add_configs("zlib", {description = "use zlib (ability to decompress layers data)", default = false, type = "boolean"}) + add_configs("zstd", {description = "use zstd (ability to decompress layers data)", default = false, type = "boolean"}) + + add_deps("cmake") + add_deps("libxml2") + + on_load(function (package) + if package:config("zlib") then + package:add("deps", "zlib") + end + if package:config("zstd") then + package:add("deps", "zstd") + end + end) + + on_install("windows", "linux", "macosx", "iphoneos", "android", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DWANT_ZLIB=" .. (package:config("zlib") and "ON" or "OFF")) + table.insert(configs, "-DWANT_ZSTD=" .. (package:config("zstd") and "ON" or "OFF")) + if package:config("zstd") then + table.insert(configs, "-DZSTD_PREFER_STATIC=" .. (package:dep("zstd"):config("shared") and "OFF" or "ON")) + end + + local packagedeps + local cxflags + local shflags + if package:is_plat("windows") then + cxflags = {"-DLIBXML_STATIC"} + if package:config("shared") then + shflags = {"ws2_32.lib"} + end + elseif package:is_plat("android") then + packagedeps = {"libxml2"} + io.replace("CMakeLists.txt", "find_package(LibXml2 REQUIRED)", "", {plain = true}) + io.replace("CMakeLists.txt", "target_link_libraries(tmx LibXml2::LibXml2)", "", {plain = true}) + end + import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps, cxflags = cxflags, shflags = shflags}) + end) + + on_test(function (package) + assert(package:has_cfuncs("tmx_load", {includes = "tmx.h"})) + end) diff --git a/packages/t/tmxlite/xmake.lua b/packages/t/tmxlite/xmake.lua new file mode 100644 index 000000000..f5964b787 --- /dev/null +++ b/packages/t/tmxlite/xmake.lua @@ -0,0 +1,31 @@ +package("tmxlite") + set_homepage("https://github.com/fallahn/tmxlite") + set_description("lightweight C++14 parser for Tiled tmx files") + set_license("zlib") + + add_urls("https://github.com/fallahn/tmxlite/archive/refs/tags/$(version).tar.gz", + "https://github.com/fallahn/tmxlite.git") + + add_versions("v1.4.4", "ec8893efc8396308f291c284cb09f007441a15aabbb0e5722096cf79c65c9e58") + + add_deps("cmake", "pugixml", "zlib", "zstd") + + on_install("windows", "mingw", "linux", "macos", "bsd", "iphoneos", "cross", function (package) + os.cd("tmxlite") + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DTMXLITE_STATIC_LIB=" .. (package:config("shared") and "OFF" or "ON")) + table.insert(configs, "-DUSE_EXTLIBS=ON") + table.insert(configs, "-DUSE_ZSTD=ON") + + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + tmx::Map map; + map.load("assets/test.tmx"); + } + ]]}, {configs = {languages = "c++14"}, includes = "tmxlite/Map.hpp"})) + end) diff --git a/packages/t/tobiaslocker_base64/xmake.lua b/packages/t/tobiaslocker_base64/xmake.lua new file mode 100644 index 000000000..586d4a334 --- /dev/null +++ b/packages/t/tobiaslocker_base64/xmake.lua @@ -0,0 +1,25 @@ +package("tobiaslocker_base64") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/tobiaslocker/base64") + set_description("A modern C++ base64 encoder / decoder ") + set_license("MIT") + + add_urls("https://github.com/tobiaslocker/base64.git") + add_versions("2024.02.26", "387b32f337b83d358ac1ffe574e596ba99c41d31") + + on_install("windows|!arm64 or !windows", function (package) + os.cp("include/base64.hpp", package:installdir("include/tobiaslocker_base64")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + auto encoded_str = base64::to_base64("Hello, World!"); + std::cout << encoded_str << std::endl; + auto decoded_str = base64::from_base64("SGVsbG8sIFdvcmxkIQ=="); + std::cout << decoded_str << std::endl; + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/t/toml++/xmake.lua b/packages/t/toml++/xmake.lua index 992e03ab2..9e6ff0a4a 100644 --- a/packages/t/toml++/xmake.lua +++ b/packages/t/toml++/xmake.lua @@ -10,6 +10,7 @@ package("toml++") add_versions("v3.1.0", "dae72714fc356ca1b019298d9e6275cc41ba95546ae722ccdb6795e92f47762e") add_versions("v3.2.0", "aeba776441df4ac32e4d4db9d835532db3f90fd530a28b74e4751a2915a55565") add_versions("v3.3.0", "fc1a5eb410f3c67e90e5ad1264a1386d020067cfb01b633cc8c0441789aa6cf2") + add_versions("v3.4.0", "8517f65938a4faae9ccf8ebb36631a38c1cadfb5efa85d9a72e15b9e97d25155") add_configs("header_only", {description = "Use header only version.", default = true, type = "boolean"}) diff --git a/packages/t/toml11/xmake.lua b/packages/t/toml11/xmake.lua index d0d251cb9..7ffbc46f1 100644 --- a/packages/t/toml11/xmake.lua +++ b/packages/t/toml11/xmake.lua @@ -6,12 +6,14 @@ package("toml11") add_urls("https://github.com/ToruNiina/toml11/archive/refs/tags/$(version).tar.gz", "https://github.com/ToruNiina/toml11.git") + + add_versions("v3.8.1", "6a3d20080ecca5ea42102c078d3415bef80920f6c4ea2258e87572876af77849") add_versions("v3.7.0", "a0b6bec77c0e418eea7d270a4437510884f2fe8f61e7ab121729624f04c4b58e") add_deps("cmake") on_install(function (package) - local configs = {} + local configs = {"-DCMAKE_CXX_STANDARD=11"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) diff --git a/packages/t/tomlc99/xmake.lua b/packages/t/tomlc99/xmake.lua new file mode 100644 index 000000000..5c1f8b8b9 --- /dev/null +++ b/packages/t/tomlc99/xmake.lua @@ -0,0 +1,25 @@ +package("tomlc99") + set_homepage("https://github.com/cktan/tomlc99") + set_description("TOML C library") + set_license("MIT") + + add_urls("https://github.com/cktan/tomlc99.git") + add_versions("2023.09.30", "5221b3d3d66c25a1dc6f0372b4f824f1202fe398") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("tomlc99") + set_kind("$(kind)") + add_files("toml.c") + add_headerfiles("toml.h") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("toml_parse", {includes = "toml.h"})) + end) diff --git a/packages/t/tomlcpp/xmake.lua b/packages/t/tomlcpp/xmake.lua new file mode 100644 index 000000000..49f43ba6c --- /dev/null +++ b/packages/t/tomlcpp/xmake.lua @@ -0,0 +1,35 @@ +package("tomlcpp") + set_homepage("https://github.com/cktan/tomlcpp") + set_description("No fanfare TOML C++ Library") + set_license("MIT") + + add_urls("https://github.com/cktan/tomlcpp.git") + add_versions("2022.06.25", "4212f1fccf530e276a2e1b63d3f99fbfb84e86a4") + + add_deps("tomlc99") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_requires("tomlc99") + set_languages("c++14") + add_rules("mode.release", "mode.debug") + target("tomlcpp") + set_kind("$(kind)") + add_files("tomlcpp.cpp") + add_headerfiles("tomlcpp.hpp") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + add_packages("tomlc99") + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + auto res = toml::parseFile("sample.toml"); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/t/tracy/xmake.lua b/packages/t/tracy/xmake.lua index 4ab7e4857..3ae18c288 100644 --- a/packages/t/tracy/xmake.lua +++ b/packages/t/tracy/xmake.lua @@ -5,16 +5,77 @@ package("tracy") add_urls("https://github.com/wolfpld/tracy/archive/refs/tags/$(version).tar.gz", "https://github.com/wolfpld/tracy.git") + add_versions("v0.10", "a76017d928f3f2727540fb950edd3b736caa97b12dbb4e5edce66542cbea6600") add_versions("v0.9.1", "c2de9f35ab2a516a9689ff18f5b62a55b73b93b66514bd09ba013d7957993cd7") add_versions("v0.9", "93a91544e3d88f3bc4c405bad3dbc916ba951cdaadd5fcec1139af6fa56e6bfc") add_versions("v0.8.2", "4784eddd89c17a5fa030d408392992b3da3c503c872800e9d3746d985cfcc92a") + + add_configs("on_demand", { default = false, type = "boolean", description = "On-demand profiling"}) + add_configs("enforce_callstack", { default = false, type = "boolean", description = "Enforce callstack collection for tracy regions"}) + add_configs("callstack", { default = true, type = "boolean", description = "Enable all callstack related functionality"}) + add_configs("callstack_inlines", { default = true, type = "boolean", description = "Enables the inline functions in callstacks"}) + add_configs("only_localhost", { default = false, type = "boolean", description = "Only listen on the localhost interface"}) + add_configs("broadcast", { default = true, type = "boolean", description = "Enable client discovery by broadcast to local network"}) + add_configs("only_ipv4", { default = false, type = "boolean", description = "Tracy will only accept connections on IPv4 addresses (disable IPv6)"}) + add_configs("code_transfer", { default = true, type = "boolean", description = "Enable collection of source code"}) + add_configs("context_switch", { default = true, type = "boolean", description = "Enable capture of context switches"}) + add_configs("exit", { default = true, type = "boolean", description = "Enable executable does not exit until all profile data is sent to server"}) + add_configs("sampling", { default = true, type = "boolean", description = "Enable call stack sampling"}) + add_configs("verify", { default = true, type = "boolean", description = "Enable zone validation for C API"}) + add_configs("vsync_capture", { default = true, type = "boolean", description = "Enable capture of hardware Vsync events"}) + add_configs("frame_image", { default = true, type = "boolean", description = "Enable the frame image support and its thread"}) + add_configs("system_tracing", { default = true, type = "boolean", description = "Enable systrace sampling"}) + add_configs("patchable_nopsleds", { default = false, type = "boolean", description = "Enable nopsleds for efficient patching by system-level tools (e.g. rr)"}) + add_configs("delayed_init", { default = false, type = "boolean", description = "Enable delayed initialization of the library (init on first call)"}) + add_configs("manual_lifetime", { default = false, type = "boolean", description = "Enable the manual lifetime management of the profile"}) + add_configs("fibers", { default = false, type = "boolean", description = "Enable fibers support"}) + add_configs("crash_handler", { default = true, type = "boolean", description = "Enable crash handling"}) + add_configs("timer_fallback", { default = false, type = "boolean", description = "Use lower resolution timers"}) + add_configs("libunwind_backtrace", { default = false, type = "boolean", description = "Use libunwind backtracing where supported"}) + add_configs("symbol_offline_resolve", { default = false, type = "boolean", description = "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution"}) + add_configs("libbacktrace_elf_dynload_support", { default = false, type = "boolean", description = "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation"}) + add_deps("cmake") on_install("windows|x64", "macosx", "linux|x86_64", function (package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + + table.insert(configs, "-DTRACY_ON_DEMAND=" .. (package:config("on_demand") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_CALLSTACK=" .. (package:config("enforce_callstack") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_NO_CALLSTACK=" .. (package:config("callstack") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_NO_CALLSTACK_INLINES=" .. (package:config("callstack_inlines") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_ONLY_LOCALHOST=" .. (package:config("only_localhost") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_NO_BROADCAST=" .. (package:config("broadcast") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_ONLY_IPV4=" .. (package:config("only_ipv4") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_NO_CODE_TRANSFER=" .. (package:config("code_transfer") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_NO_CONTEXT_SWITCH=" .. (package:config("context_switch") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_NO_EXIT=" .. (package:config("exit") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_NO_SAMPLING=" .. (package:config("sampling") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_NO_VERIFY=" .. (package:config("verify") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_NO_VSYNC_CAPTURE=" .. (package:config("vsync_capture") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_NO_FRAME_IMAGE=" .. (package:config("frame_image") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_NO_SYSTEM_TRACING=" .. (package:config("system_tracing") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_PATCHABLE_NOPSLEDS=" .. (package:config("patchable_nopsleds") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_DELAYED_INIT=" .. (package:config("delayed_init") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_MANUAL_LIFETIME=" .. (package:config("manual_lifetime") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_FIBERS=" .. (package:config("fibers") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_NO_CRASH_HANDLER=" .. (package:config("crash_handler") and "OFF" or "ON")) + table.insert(configs, "-DTRACY_TIMER_FALLBACK=" .. (package:config("timer_fallback") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_LIBUNWIND_BACKTRACE=" .. (package:config("libunwind_backtrace") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_SYMBOL_OFFLINE_RESOLVE=" .. (package:config("symbol_offline_resolve") and "ON" or "OFF")) + table.insert(configs, "-DTRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT=" .. (package:config("libbacktrace_elf_dynload_support") and "ON" or "OFF")) + + -- collect tracy defines from cmake configs + for _, config in ipairs(configs) do + local define, value = config:match("-D(TRACY_%S+)=(.*)") + if define and value and value == "ON" then + package:add("defines", define) + end + end + import("package.tools.cmake").install(package, configs) end) diff --git a/packages/t/transwarp/xmake.lua b/packages/t/transwarp/xmake.lua new file mode 100644 index 000000000..7940dc84b --- /dev/null +++ b/packages/t/transwarp/xmake.lua @@ -0,0 +1,23 @@ +package("transwarp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/bloomen/transwarp") + set_description("A header-only C++ library for task concurrency") + set_license("MIT") + + add_urls("https://github.com/bloomen/transwarp/archive/refs/tags/$(version).zip") + add_versions("2.2.3", "41c45e1131233fed24ded3e5e49ec412e97b76bdeaf3bd7259a7c8c8f2f7189a") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "transwarp.h" + namespace tw = transwarp; + void test() { + double x = 0; + auto parent1 = tw::make_task(tw::root, [&x]{ return 13.3 + x; })->named("something"); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/t/trantor/xmake.lua b/packages/t/trantor/xmake.lua index a5413ca2f..b1e0d09f2 100644 --- a/packages/t/trantor/xmake.lua +++ b/packages/t/trantor/xmake.lua @@ -6,6 +6,8 @@ package("trantor") add_urls("https://github.com/an-tao/trantor/archive/refs/tags/$(version).tar.gz", "https://github.com/an-tao/trantor.git") + add_versions("v1.5.18", "f8227eb5307671496db435736e0b856529afae420b148c60a2b36839d6738707") + add_versions("v1.5.17", "10689dc1864a3fdb08cba824475996346a1bfb083575fd3d62858aaefa9044d9") add_versions("v1.3.0", "524589dc9258e1ace3b2f887b835cfbeccab3c5efc4ba94963c59f3528248d9b") add_versions("v1.4.1", "aa3f4dddfd3fd1a6e04f79744e69f23bb6472c314724eaa3051872a2a03bbda9") add_versions("v1.5.0", "8704df75b783089d7e5361174054e0e46a09cc315b851dbc2ab6736e631b090b") @@ -14,7 +16,8 @@ package("trantor") add_versions("v1.5.6", "827aca30e120244a8ede9d07446481328d9a3869228f01fc4978b19301d66e65") add_versions("v1.5.7", "42576563afbf1e58c7d68f758cf3fca4d193496d4e3f82c80069d8389a7839d5") add_versions("v1.5.8", "705ec0176681be5c99fcc7af37416ece9d65ff4d907bca764cb11471b104fbf8") - + add_versions("v1.5.14", "80775d65fd49dfb0eb85d70cd9c0f0cff38a7f46c90db918862c46e03ae63810") + add_patches("v1.5.8", path.join(os.scriptdir(), "patches", "1.5.8", "skip_doc.patch" ), "4124f3cc1e486ad75bc5ec2fa454ea5319d68287d0b1d8cfa3b5ab865f8ca5fd") add_deps("cmake") @@ -27,6 +30,9 @@ package("trantor") end on_install("windows", "macosx", "linux", "mingw@windows", function (package) + io.replace("CMakeLists.txt", "\"${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/Findc-ares.cmake\"", "", {plain = true}) + io.replace("CMakeLists.txt", "find_package(c-ares)", "find_package(c-ares CONFIG)", {plain = true}) + io.replace("CMakeLists.txt", "c-ares_lib", "c-ares::cares", {plain = true}) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) if package:config("pic") ~= false then diff --git a/packages/t/tree-sitter/port/xmake.lua b/packages/t/tree-sitter/port/xmake.lua new file mode 100644 index 000000000..da2fbc704 --- /dev/null +++ b/packages/t/tree-sitter/port/xmake.lua @@ -0,0 +1,8 @@ +add_rules("mode.debug", "mode.release") +target("tree-sitter") + set_kind("$(kind)") + add_files("lib/src/lib.c") + add_includedirs({ + "lib/src", + "lib/include"}) + add_headerfiles("lib/include/(**.h)") \ No newline at end of file diff --git a/packages/t/tree-sitter/xmake.lua b/packages/t/tree-sitter/xmake.lua new file mode 100644 index 000000000..7d3025ff5 --- /dev/null +++ b/packages/t/tree-sitter/xmake.lua @@ -0,0 +1,40 @@ +package("tree-sitter") + + set_homepage("https://tree-sitter.github.io/") + set_description("An incremental parsing system for programming tools") + + add_urls("https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v$(version).zip") + + add_versions("0.22.6", "eb2d8bfcb6d21b820ac88add96d71ef9ebaec9d2a171b86a48c27c0511a17e4e") + add_versions("0.22.5", "b8c0da9f5cafa3214547bc3bbfa0d0f05a642f9d0c045e505a940cf487300849") + add_versions("0.22.2", "df0cd4aacc53b6feb9519dd4b74a7a6c8b7f3f7381fcf7793250db3e5e63fb80") + add_versions("0.21.0", "874794e6b3b985f7f9e87dfe29e4bfdbe5c0339e67740f35dfc4fa85804ba708") + + on_install(function(package) + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + + local configs = {} + if package:config("shared") then + configs.kind = "shared" + end + import("package.tools.xmake").install(package, configs) + end) + + on_test(function(package) + assert(package:check_csnippets({ + test = [[ + #include + #include + void test() { + TSParser *parser = ts_parser_new(); + const char *source_code = "[1, null]"; + TSTree *tree = ts_parser_parse_string( + parser, + NULL, + source_code, + strlen(source_code) + ); + } + ]] + })) + end) diff --git a/packages/t/trompeloeil/xmake.lua b/packages/t/trompeloeil/xmake.lua index de90d6ae4..e1e2e6e91 100644 --- a/packages/t/trompeloeil/xmake.lua +++ b/packages/t/trompeloeil/xmake.lua @@ -6,6 +6,7 @@ package("trompeloeil") set_license("BSL-1.0") add_urls("https://github.com/rollbear/trompeloeil/archive/refs/tags/$(version).tar.gz") + add_versions("v47", "4a1d79260c1e49e065efe0817c8b9646098ba27eed1802b0c3ba7d959e4e5e84") add_versions("v43", "86a0afa2e97347202a0a883ab43da78c1d4bfff0d6cb93205cfc433d0d9eb9eb") on_install(function (package) diff --git a/packages/t/type_safe/xmake.lua b/packages/t/type_safe/xmake.lua index d80c43463..704347ead 100644 --- a/packages/t/type_safe/xmake.lua +++ b/packages/t/type_safe/xmake.lua @@ -1,25 +1,26 @@ -package("type_safe") - set_kind("library", {headeronly = true}) - set_homepage("https://type_safe.foonathan.net") - set_description("Zero overhead utilities for preventing bugs at compile time") - set_license("MIT") - - add_urls("https://github.com/foonathan/type_safe/archive/refs/tags/$(version).tar.gz", - "https://github.com/foonathan/type_safe.git") - add_versions("v0.2.2", "34d97123fb9bca04a333565c4a2498425d602ec0c759de4be1b8cfae77d05823") - - add_deps("cmake", "debug_assert") - - on_install(function (package) - io.replace("CMakeLists.txt", [[ OR (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)]], "", { plain = true }) - local configs = {"-DTYPE_SAFE_BUILD_TEST_EXAMPLE=OFF"} - import("package.tools.cmake").install(package, configs) - end) - - on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - void only_unsigned(type_safe::unsigned_t val) - { - } - ]]}, {configs = {languages = "c++11"}, includes = {"type_safe/types.hpp"}})) - end) +package("type_safe") + set_kind("library", {headeronly = true}) + set_homepage("https://type_safe.foonathan.net") + set_description("Zero overhead utilities for preventing bugs at compile time") + set_license("MIT") + + add_urls("https://github.com/foonathan/type_safe/archive/refs/tags/$(version).tar.gz", + "https://github.com/foonathan/type_safe.git") + add_versions("v0.2.4", "a631d03c18c65726b3d1b7d41ac5806e9121367afe10dd2f408a2d75e144b734") + add_versions("v0.2.2", "34d97123fb9bca04a333565c4a2498425d602ec0c759de4be1b8cfae77d05823") + + add_deps("cmake", "debug_assert") + + on_install(function (package) + io.replace("CMakeLists.txt", [[ OR (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)]], "", { plain = true }) + local configs = {"-DTYPE_SAFE_BUILD_TEST_EXAMPLE=OFF"} + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void only_unsigned(type_safe::unsigned_t val) + { + } + ]]}, {configs = {languages = "c++11"}, includes = {"type_safe/types.hpp"}})) + end) diff --git a/packages/u/ucx/xmake.lua b/packages/u/ucx/xmake.lua index 24739a710..ec4657dc9 100644 --- a/packages/u/ucx/xmake.lua +++ b/packages/u/ucx/xmake.lua @@ -5,6 +5,8 @@ package("ucx") set_license("BSD-3-Clause") add_urls("https://github.com/openucx/ucx/releases/download/v$(version)/ucx-$(version).tar.gz") + add_versions("1.16.0", "f73770d3b583c91aba5fb07557e655ead0786e057018bfe42f0ebe8716e9d28c") + add_versions("1.15.0", "4b202087076bc1c98f9249144f0c277a8ea88ad4ca6f404f94baa9cb3aebda6d") add_versions("1.11.0", "b7189b69fe0e16e3c03784ef674e45687a9c520750bd74a45125c460ede37647") add_configs("cuda", {description = "Enable CUDA support.", default = false, type = "boolean"}) @@ -16,7 +18,10 @@ package("ucx") end) on_install("linux", function (package) - local configs = {"--disable-doxygen-doc", "--without-java", "--without-rte", "--without-fuse3", "--without-gdrcopy", "--without-rdmacm", "--without-knem", "--without-xpmem", "--without-ugni"} + -- Already fixed in the upstream, please remove it in the next release. + -- https://github.com/openucx/ucx/commit/98496827bef6f4619a4a8058443f61ef78b8ab72 + io.replace("src/ucm/ptmalloc286/malloc.c", "int nfences = 0;", "int __attribute__((unused)) nfences = 0;") + local configs = {"--disable-doxygen-doc", "--without-go", "--without-java", "--without-rte", "--without-fuse3", "--without-gdrcopy", "--without-rdmacm", "--without-knem", "--without-xpmem", "--without-ugni"} if package:config("cuda") then local cuda = package:dep("cuda"):fetch() table.insert(configs, "--with-cuda=" .. path.directory(cuda.sysincludedirs[1])) diff --git a/packages/u/ufbx/xmake.lua b/packages/u/ufbx/xmake.lua new file mode 100644 index 000000000..fdace7cf0 --- /dev/null +++ b/packages/u/ufbx/xmake.lua @@ -0,0 +1,32 @@ +package("ufbx") + set_homepage("https://github.com/ufbx/ufbx") + set_description("Single source file FBX loader") + set_license("MIT") + + set_urls("https://github.com/ufbx/ufbx/archive/refs/tags/$(version).tar.gz", + "https://github.com/ufbx/ufbx.git") + + add_versions("v0.14.2", "0a50e7328a20a5e8be25a4ae13af1f2dacb51531a94321ef3fe5c57d799fc72e") + add_versions("v0.14.0", "7bc48494b236e2ed41000f0008cecc9459956dd25154d91c4af4144c2a26fe6d") + add_versions("v0.13.0", "7715ca1e66c005dea6cfe4817be71fa8e31a8e3d36bed18aec5e0df1a953a22c") + add_versions("v0.12.0", "5897de4ff727f718df8b2dbe30797fbcbb0f2d7d47ec52f01d30729e62b314b3") + add_versions("v0.11.1", "c95a698076179fcb1deb163cea9ab0c7c1cdc6b1bc7fb492da20f4a1315a186a") + add_versions("v0.6.1", "117a67e2b6d2866fb989bf1b740c89cfb3d5f2a97d46a821be536d9d0fbd5134") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.release", "mode.debug") + target("ufbx") + set_kind("$(kind)") + add_files("ufbx.c") + add_headerfiles("ufbx.h") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("ufbx_load_file", {includes = "ufbx.h"})) + end) diff --git a/packages/u/ultralight/xmake.lua b/packages/u/ultralight/xmake.lua new file mode 100644 index 000000000..165b0633a --- /dev/null +++ b/packages/u/ultralight/xmake.lua @@ -0,0 +1,40 @@ +package("ultralight") + set_homepage("https://ultralig.ht") + set_description("Ultralight makes it easy for C/C++ developers to seamlessly integrate web-content into games and desktop apps.") + set_license("LGPL") + + if is_plat("windows") then + add_urls("https://github.com/ultralight-ux/Ultralight/releases/download/v1.3.0/ultralight-sdk-1.3.0-win-x64.7z") + add_versions("1.3.0", "cc8bfc66a4c40c88fa02691febe6f21c248a2a30d17cfe5470fccc3a461ce49e") + elseif is_plat("linux") then + add_urls("https://github.com/ultralight-ux/Ultralight/releases/download/v1.3.0/ultralight-sdk-1.3.0-linux-x64.7z") + add_versions("1.3.0", "1de6298b5ed3c5e0c22ac27e0e30fcb0ba6d195467a58ee44ef4e13dd1a6d352") + elseif is_plat("macosx") then + add_urls("https://github.com/ultralight-ux/Ultralight/releases/download/v1.3.0/ultralight-sdk-1.3.0-mac-x64.7z") + add_versions("1.3.0", "bbf81ed456a617a60a19e9a76946e4479d5bac877f859005c50f66e9ec3c77a2") + end + + add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) + + on_install("windows|x64", "linux|x86_64", "macosx|x86_64", function (package) + if package:is_plat("linux") then + if linuxos.name() ~= "ubuntu" and linuxos.name() ~= "debian" or (linuxos.version():major() < 9 and linuxos.version():minor() < 5) then + print("Ultralight is officially supported on Ubuntu/Debian 9.5+. use it at your own risks") + end + end + os.cp("include", package:installdir()) + os.trycp("lib", package:installdir()) + os.trycp("bin", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + + void test() + { + auto app = ultralight::App::Create(); + } + ]]}, {configs = {languages = "c++17"}})) + end) \ No newline at end of file diff --git a/packages/u/uni_algo/xmake.lua b/packages/u/uni_algo/xmake.lua index e1d499198..3f4d8e920 100644 --- a/packages/u/uni_algo/xmake.lua +++ b/packages/u/uni_algo/xmake.lua @@ -6,6 +6,7 @@ package("uni_algo") add_urls("https://github.com/uni-algo/uni-algo/archive/refs/tags/$(version).tar.gz", "https://github.com/uni-algo/uni-algo.git") + add_versions("v1.2.0", "f2a1539cd8635bc6088d05144a73ecfe7b4d74ee0361fabed6f87f9f19e74ca9") add_versions("v0.7.1", "9ff1f03d6ffd81df7a2a21df353502db55d198a940da0aef0546b37ca934fdfb") add_versions("v0.8.0", "657f124f4fb4705f948e9c0835ec88484ee4745d7b19cb2ddb772119a7ea024e") add_versions("v0.8.1", "11192280fa435a9d68131d5368d2b314201d7089e6d2f38f29a8591c9aafa776") diff --git a/packages/u/unistd_h/xmake.lua b/packages/u/unistd_h/xmake.lua new file mode 100644 index 000000000..c956cd483 --- /dev/null +++ b/packages/u/unistd_h/xmake.lua @@ -0,0 +1,16 @@ +package("unistd_h") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/win32ports/unistd_h") + set_description("header-only Windows implementation of the header") + set_license("MIT") + + add_urls("https://github.com/win32ports/unistd_h.git") + add_versions("2019.07.30", "0dfc48c1bc67fa27b02478eefe0443b8d2750cc2") + + on_install("windows", function (package) + os.cp("unistd.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:has_cfuncs("access", {includes = "unistd.h"})) + end) diff --git a/packages/u/unity_test/xmake.lua b/packages/u/unity_test/xmake.lua index 80a54c2f3..12495eed9 100644 --- a/packages/u/unity_test/xmake.lua +++ b/packages/u/unity_test/xmake.lua @@ -6,6 +6,7 @@ package("unity_test") add_urls("https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/$(version).tar.gz", "https://github.com/ThrowTheSwitch/Unity.git") + add_versions("v2.6.0", "aa4c9fb1ae5fc5242f914c65f3557e817e40cb37f04a31e5ff76d1ab89dbf674") add_versions("v2.5.2", "3786de6c8f389be3894feae4f7d8680a02e70ed4dbcce36109c8f8646da2671a") add_versions("v2.5.1", "5ce08ef62f5f64d18f8137b3eaa6d29199ee81d1fc952cef0eea96660a2caf47") add_versions("v2.5.0", "d470165dc46652cf73fda54e2650b483b94a7e24ccf793ded28615729b2f41ed") diff --git a/packages/u/universal_stacktrace/xmake.lua b/packages/u/universal_stacktrace/xmake.lua index 051041a4c..c7f041bc6 100644 --- a/packages/u/universal_stacktrace/xmake.lua +++ b/packages/u/universal_stacktrace/xmake.lua @@ -6,6 +6,8 @@ package("universal_stacktrace") add_urls("https://github.com/MisterTea/UniversalStacktrace.git", {submodules = false}) add_versions("2022.11.06", "28f5230d75e677ce8e4e140b2f3e0b8550195c85") + add_versions("2023.10.15", "88281dcc43c169afd5eea9fe26f68999656140e3") + if is_plat("windows") then add_syslinks("dbghelp") diff --git a/packages/u/unordered_dense/xmake.lua b/packages/u/unordered_dense/xmake.lua index 446ed9110..bfbd5f0fa 100644 --- a/packages/u/unordered_dense/xmake.lua +++ b/packages/u/unordered_dense/xmake.lua @@ -11,12 +11,33 @@ package("unordered_dense") add_versions("v2.0.2", "d4be48c164fa2f49deb55354b33c335688da3bd4b2299b3a46b8092602f67556") add_versions("v3.0.0", "e73452d7c1e274b4a15b553c0904f1de4bcfa61b00514acd1eaad7deac805ef0") add_versions("v4.0.4", "b34a8c942963e3a647f1bbc192a6391cd56d7ae615b2ddc1601c1779b5792206") + add_versions("v4.4.0", "3976399793e8cb4db1409ce15610fbd9e5e406ced4745f262d393a9311efbd88") + add_configs("modules", {description = "Build with C++20 modules support.", default = false, type = "boolean"}) + + on_load(function (package) + if not package:config("modules") then + package:add("deps", "cmake") + end + end) - add_deps("cmake") on_install(function (package) - import("package.tools.cmake").install(package) - os.cp("include", package:installdir()) + if not package:config("modules") then + import("package.tools.cmake").install(package) + os.cp("include", package:installdir()) + else + os.cp("src/ankerl.unordered_dense.cpp", "src/ankerl.unordered_dense.cppm") + io.writefile("xmake.lua", [[ + target("unordered_dense") + set_kind("static") + set_languages("c++20") + add_headerfiles("include/(**.h)") + add_includedirs("include") + add_files("src/**.cppm", {public = true}) + ]]) + local configs = {} + import("package.tools.xmake").install(package, configs) + end end) on_test(function (package) diff --git a/packages/u/unzip/xmake.lua b/packages/u/unzip/xmake.lua index 6fc732779..974b5b387 100644 --- a/packages/u/unzip/xmake.lua +++ b/packages/u/unzip/xmake.lua @@ -12,7 +12,7 @@ package("unzip") io.replace("win32/nt.c", "#include \"../unzip.h\"", "#include \"../unzip.h\"\n#ifdef CR\n#undef CR\n#endif", {plain = true}) io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") - includes("check_cfuncs.lua") + includes("@builtin/check") check_cfuncs("HAVE_LCHMOD", "lchmod", {includes = "sys/stat.h"}) target("unzip") set_kind("binary") diff --git a/packages/u/urdfdom-headers/xmake.lua b/packages/u/urdfdom-headers/xmake.lua index 933c5fd3a..6857973c9 100644 --- a/packages/u/urdfdom-headers/xmake.lua +++ b/packages/u/urdfdom-headers/xmake.lua @@ -8,12 +8,13 @@ package("urdfdom-headers") add_urls("https://github.com/ros/urdfdom_headers/archive/refs/tags/$(version).tar.gz", "https://github.com/ros/urdfdom_headers.git") add_versions("1.0.5", "76a68657c38e54bb45bddc4bd7d823a3b04edcd08064a56d8e7d46b9912035ac") + add_versions("1.1.1", "b2ee5bffa51eea4958f64479b4fa273881d82a3bfa1d98686a16f8d8ca6c2350") add_patches("1.0.5", path.join(os.scriptdir(), "patches", "1.0.5", "export.patch"), "c7c15c0fba7b618c4ff9207a561caae70374e642a779fb346f2c084d5da6ed8b") add_deps("cmake") on_install(function (package) - import("package.tools.cmake").install(package) + import("package.tools.cmake").install(package, {"-DAPPEND_PROJECT_NAME_TO_INCLUDEDIR=OFF"}) end) on_test(function (package) diff --git a/packages/u/urdfdom/xmake.lua b/packages/u/urdfdom/xmake.lua index 8f0aaf0ec..2ed8825ac 100644 --- a/packages/u/urdfdom/xmake.lua +++ b/packages/u/urdfdom/xmake.lua @@ -7,13 +7,22 @@ package("urdfdom") add_urls("https://github.com/ros/urdfdom/archive/refs/tags/$(version).tar.gz", "https://github.com/ros/urdfdom.git") add_versions("1.0.4", "8f3d56b0cbc4b84436d8baf4c8346cd2ee7ffb257bba5ddd9892c41bf516edc4") + add_versions("4.0.0", "9848d106dc88dc0b907d5667c09da3ca53241fbcf17e982d8c234fe3e0d6ddcc") add_patches("1.0.4", path.join(os.scriptdir(), "patches", "1.0.4", "build.patch"), "1f51148afccef7b9bf079ef4137c12d578fb7a76f7aed6e282ca2ceaf4a188ba") add_deps("cmake") - add_deps("urdfdom-headers", "console-bridge", "tinyxml") + add_deps("urdfdom-headers", "console-bridge") + on_load("windows", "linux", "macosx", function (package) + if package:version():ge("4.0.0") then + package:add("deps", "tinyxml2") + else + package:add("deps", "tinyxml") + end + end) + on_install("windows", "linux", "macosx", function (package) - local configs = {"-DCMAKE_INSTALL_LIBDIR=lib"} + local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) diff --git a/packages/u/uriparser/xmake.lua b/packages/u/uriparser/xmake.lua index 22da790d9..c8b1b1cd6 100644 --- a/packages/u/uriparser/xmake.lua +++ b/packages/u/uriparser/xmake.lua @@ -5,9 +5,10 @@ package("uriparser") set_license("BSD-3-Clause") add_urls("https://github.com/uriparser/uriparser/archive/refs/tags/uriparser-$(version).tar.gz") - add_versions("0.9.5", "dece5067b4517c4b16cde332c491b4b3508249d2a8f4ba393229575d3c5241c0") - add_versions("0.9.6", "defaf550bf6fe05e89afb9814dccc6bd643a3b0a8308801a2c04b76682b87383") + add_versions("0.9.8", "d6289387eaf2495e38ed80d709ad673fe04d63fad707badfee96f3d2dabc7c35") add_versions("0.9.7", "8e19250654a204af0858408b55dc78941382a8c824bf38fc7f2a95ca6e16d7a0") + add_versions("0.9.6", "defaf550bf6fe05e89afb9814dccc6bd643a3b0a8308801a2c04b76682b87383") + add_versions("0.9.5", "dece5067b4517c4b16cde332c491b4b3508249d2a8f4ba393229575d3c5241c0") add_deps("cmake") on_load(function (package) diff --git a/packages/u/usockets/port/xmake.lua b/packages/u/usockets/port/xmake.lua new file mode 100644 index 000000000..468c127e6 --- /dev/null +++ b/packages/u/usockets/port/xmake.lua @@ -0,0 +1,49 @@ +option("ssl", {default = nil, type = "string"}) +option("uv", {showmenu = true, default = false}) +option("uring", {showmenu = true, default = false}) +option("quic", {showmenu = true, default = false}) + +add_rules("mode.debug", "mode.release") + +local ssl = get_config("ssl") +if ssl then + add_requires(ssl) + add_packages(ssl) + if ssl == "openssl" or ssl == "boringssl" then + add_defines("LIBUS_USE_OPENSSL") + elseif ssl == "wolfssl" then + add_defines("LIBUS_USE_WOLFSSL") + end +else + add_defines("LIBUS_NO_SSL") +end + +if is_plat("windows") or has_config("uv") then + add_requires("libuv") + add_packages("libuv") + add_defines("LIBUS_USE_LIBUV") +end + +if is_plat("linux") and has_config("uring") then + add_requires("liburing") + add_packages("liburing") + add_defines("LIBUS_USE_IO_URING") +end + +if has_config("quic") then + add_requires("lsquic") + add_packages("lsquic") + add_defines("LIBUS_USE_QUIC") +end + +target("usockets") + set_kind("$(kind)") + set_languages("c++17") + + add_files("src/**.cpp", "src/**.c") + add_includedirs("src") + add_headerfiles("src/libusockets.h") + + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end diff --git a/packages/u/usockets/xmake.lua b/packages/u/usockets/xmake.lua new file mode 100644 index 000000000..b3cb3845f --- /dev/null +++ b/packages/u/usockets/xmake.lua @@ -0,0 +1,63 @@ +package("usockets") + set_homepage("https://github.com/uNetworking") + set_description("µSockets is the non-blocking, thread-per-CPU foundation library used by µWebSockets. It provides optimized networking - using the same opaque API (programming interface) across all supported transports, event-loops and platforms.") + set_license("Apache-2.0") + + add_urls("https://github.com/uNetworking/uSockets/archive/refs/tags/$(version).tar.gz", + "https://github.com/uNetworking/uSockets.git") + + add_versions("v0.8.8", "d14d2efe1df767dbebfb8d6f5b52aa952faf66b30c822fbe464debaa0c5c0b17") + + add_configs("ssl", {description = "Select ssl library", default = nil, type = "string", values = {"openssl", "wolfssl", "boringssl"}}) + add_configs("uv", {description = "Enable libuv", default = false, type = "boolean"}) + add_configs("uring", {description = "Enable liburing", default = false, type = "boolean"}) + add_configs("quic", {description = "Enable lsquic", default = false, type = "boolean"}) + + on_load(function (package) + local ssl = package:config("ssl") + if ssl then + package:add("deps", ssl) + if ssl == "openssl" or ssl == "boringssl" then + package:add("defines", "LIBUS_USE_OPENSSL") + elseif ssl == "wolfssl" then + package:add("defines", "LIBUS_USE_WOLFSSL") + end + else + package:add("defines", "LIBUS_NO_SSL") + end + + if package:is_plat("windows") then + package:add("deps", "libuv") + package:config_set("uv", true) + else + if package:config("libuv") then + package:add("deps", "libuv") + package:add("defines", "LIBUS_USE_LIBUV") + end + end + + if package:is_plat("linux") and package:config("uring") then + package:add("deps", "liburing") + package:add("defines", "LIBUS_USE_IO_URING") + end + + if package:config("quic") then + package:add("deps", "lsquic") + package:add("defines", "LIBUS_USE_QUIC") + end + end) + + on_install("windows", "macosx", "linux", function (package) + local configs = {} + configs.ssl = package:config("ssl") + configs.uv = package:config("uv") + configs.uring = package:config("uring") + configs.quic = package:config("quic") + + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("us_create_socket_context", {includes = {"libusockets.h"}})) + end) diff --git a/packages/u/utf8proc/xmake.lua b/packages/u/utf8proc/xmake.lua index 8e624c4ee..4fea5bc6a 100644 --- a/packages/u/utf8proc/xmake.lua +++ b/packages/u/utf8proc/xmake.lua @@ -6,6 +6,7 @@ package("utf8proc") add_urls("https://github.com/JuliaStrings/utf8proc/archive/refs/tags/$(version).tar.gz", "https://github.com/JuliaStrings/utf8proc.git") + add_versions("v2.9.0", "18c1626e9fc5a2e192311e36b3010bfc698078f692888940f1fa150547abb0c1") add_versions("v2.7.0", "4bb121e297293c0fd55f08f83afab6d35d48f0af4ecc07523ad8ec99aa2b12a1") add_versions("v2.8.0", "a0a60a79fe6f6d54e7d411facbfcc867a6e198608f2cd992490e46f04b1bcecc") diff --git a/packages/u/utfcpp/xmake.lua b/packages/u/utfcpp/xmake.lua index c702e4593..0010ce9cb 100644 --- a/packages/u/utfcpp/xmake.lua +++ b/packages/u/utfcpp/xmake.lua @@ -1,5 +1,4 @@ package("utfcpp") - set_kind("library", {headeronly = true}) set_homepage("https://github.com/nemtrif/utfcpp") set_description("UTF8-CPP: UTF-8 with C++ in a Portable Way") @@ -7,13 +6,29 @@ package("utfcpp") add_urls("https://github.com/nemtrif/utfcpp/archive/refs/tags/$(version).tar.gz", "https://github.com/nemtrif/utfcpp.git") + add_versions("v4.0.5", "ffc668a310e77607d393f3c18b32715f223da1eac4c4d6e0579a11df8e6b59cf") + add_versions("v4.0.4", "7c8a403d0c575d52473c8644cd9eb46c6ba028d2549bc3e0cdc2d45f5cfd78a0") + add_versions("v4.0.3", "05e7d023b2bf606777442efc49038e0efce317596582db15adf5c776e237a326") + add_versions("v4.0.2", "d3c032650cd30823b7ebbebbe91f39d8c0e91221b2e3e92b93ca425478f986f2") + add_versions("v4.0.1", "9014342a716258da00b97bf8c201a2edc4d72d2025cd8d62f0650ac627038f95") + add_versions("v4.0.0", "ac44d9652aa2ee64d405c1705718f26b385337a9b8cf20bf2b2aac6435a16c1e") + add_versions("v3.2.5", "14fd1b3c466814cb4c40771b7f207b61d2c7a0aa6a5e620ca05c00df27f25afd") add_versions("v3.2.4", "fde21a4c519eed25f095a1cd8490167409cc70d7b5e9c38756142e588ccb7c7e") add_versions("v3.2.3", "3ba9b0dbbff08767bdffe8f03b10e596ca351228862722e4c9d4d126d2865250") add_versions("v3.2.1", "8d6aa7d77ad0abb35bb6139cb9a33597ac4c5b33da6a004ae42429b8598c9605") - add_extsources("apt::libutfcpp-dev", "pacman::utf8cpp") + if is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::utf8cpp") + elseif is_plat("linux") then + add_extsources("apt::libutfcpp-dev", "pacman::utf8cpp") + elseif is_plat("macosx") then + add_extsources("brew::utf8cpp") + end add_deps("cmake") + + add_includedirs("include", "include/utf8cpp") + on_install(function (package) local configs = {"-DUTF8_TESTS=OFF", "-DUTF8_INSTALL=ON", "-DUTF8_SAMPLES=OFF"} import("package.tools.cmake").install(package, configs) @@ -22,7 +37,7 @@ package("utfcpp") on_test(function (package) local test_snippet = [[ #define UTF_CPP_CPLUSPLUS 201103L - #include + #include void test() { std::string line("你好,世界"); std::u16string u16line = utf8::utf8to16(line); diff --git a/packages/u/util-linux/xmake.lua b/packages/u/util-linux/xmake.lua index 72e7633da..6cdbc1db9 100644 --- a/packages/u/util-linux/xmake.lua +++ b/packages/u/util-linux/xmake.lua @@ -10,6 +10,7 @@ package("util-linux") add_versions("2.32.1", "86e6707a379c7ff5489c218cfaf1e3464b0b95acf7817db0bc5f179e356a67b2") add_versions("2.36.2", "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f") add_versions("2.39", "32b30a336cda903182ed61feb3e9b908b762a5e66fe14e43efb88d37162075cb") + add_versions("2.39.2", "87abdfaa8e490f8be6dde976f7c80b9b5ff9f301e1b67e3899e1f05a59a1531f") add_patches("2.36.2", path.join(os.scriptdir(), "patches", "2.36.2", "includes.patch"), "7274762cac2810b5f0d17ecb5ac69c7069e7ff2b880df663b7072628df0867f3") @@ -20,6 +21,7 @@ package("util-linux") add_deps("ncurses", "zlib") end + add_configs("nls", {description = "Enable Native Language Support.", default = false, type = "boolean"}) add_configs("ipcs", {description = "Enable ipcs.", default = false, type = "boolean"}) add_configs("ipcrm", {description = "Enable ipcrm.", default = false, type = "boolean"}) add_configs("wall", {description = "Enable wall.", default = false, type = "boolean"}) @@ -41,6 +43,9 @@ package("util-linux") add_configs("makeinstall-setuid", {description = "Enable makeinstall-setuid.", default = false, type = "boolean"}) on_load(function (package) + if package:is_plat("macosx") and package:config("nls") then + package:add("deps", "libintl") + end package:addenv("PATH", "bin") package:addenv("PATH", "sbin") end) diff --git a/packages/u/util-macros/xmake.lua b/packages/u/util-macros/xmake.lua index 28c051a07..ae511f549 100644 --- a/packages/u/util-macros/xmake.lua +++ b/packages/u/util-macros/xmake.lua @@ -3,9 +3,14 @@ package("util-macros") set_homepage("https://www.x.org/") set_description("X.Org: Set of autoconf macros used to build other xorg packages") - set_urls("https://www.x.org/archive/individual/util/util-macros-$(version).tar.bz2") - add_versions("1.19.2", "d7e43376ad220411499a79735020f9d145fdc159284867e99467e0d771f3e712") - add_versions("1.19.3", "0f812e6e9d2786ba8f54b960ee563c0663ddbe2434bf24ff193f5feab1f31971") + add_urls("https://www.x.org/archive/individual/util/util-macros-$(version).tar.gz", + "https://xorg.freedesktop.org/archive/individual/util/util-macros-$(version).tar.gz") + add_versions("1.19.3", "624bb6c3a4613d18114a7e3849a3d70f2d7af9dc6eabeaba98060d87e3aef35b") + add_versions("1.20.0", "8daf36913d551a90fd1013cb078401375dabae021cb4713b9b256a70f00eeb74") + + if is_plat("linux") then + add_extsources("apt::xutils-dev", "pkgconfig::xorg-macros") + end add_deps("pkg-config") diff --git a/packages/u/uuid_v4/xmake.lua b/packages/u/uuid_v4/xmake.lua new file mode 100644 index 000000000..91d9cfea5 --- /dev/null +++ b/packages/u/uuid_v4/xmake.lua @@ -0,0 +1,35 @@ +package("uuid_v4") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/crashoz/uuid_v4") + set_description("Super fast C++ library to generate and parse UUIDv4") + set_license("MIT") + + add_urls("https://github.com/crashoz/uuid_v4/archive/refs/tags/$(version).tar.gz", + "https://github.com/crashoz/uuid_v4.git") + + add_versions("v1.0.0", "0d858bc8e7466be693332f4f16768b29f605ff386443f37a07b1f872db29ff2d") + + on_load(function (package) + if package:version():gt("1.0.0") then + package:add("deps", "cmake") + end + end) + + on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "mingw", "msys", function (package) + if package:version():gt("1.0.0") then + import("package.tools.cmake").install(package) + else + os.cp("uuid_v4.h", package:installdir("include")) + os.cp("endianness.h", package:installdir("include")) + end + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + UUIDv4::UUIDGenerator uuidGenerator; + UUIDv4::UUID uuid = uuidGenerator.getUUID(); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/u/uvatlas/xmake.lua b/packages/u/uvatlas/xmake.lua index 3989c497d..dc237262f 100644 --- a/packages/u/uvatlas/xmake.lua +++ b/packages/u/uvatlas/xmake.lua @@ -6,10 +6,12 @@ package("uvatlas") local tag = { ["2023.06"] = "jun2023", + ["2024.02"] = "feb2024" } add_urls("https://github.com/microsoft/UVAtlas/archive/refs/tags/$(version).zip", {version = function (version) return tag[tostring(version)] end}) add_urls("https://github.com/microsoft/UVAtlas.git") add_versions("2023.06", "b3ac09b88a26179a91822ff3f3b15df574803c94641fd6cf694ea44cb91ad75f") + add_versions("2024.02", "fdbbe3dd26828a47f64c577a0cd1ff57fa3f70d1cd233786157e8d60a552eff6") add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) add_configs("tools", {description = "Build UVAtlasTool", default = false, type = "boolean"}) diff --git a/packages/u/uvwasi/patches/0.0.20/cmake.patch b/packages/u/uvwasi/patches/0.0.20/cmake.patch new file mode 100644 index 000000000..3230d135d --- /dev/null +++ b/packages/u/uvwasi/patches/0.0.20/cmake.patch @@ -0,0 +1,71 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5a5e87c..48db2d6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,7 +20,7 @@ cmake_dependent_option(UVWASI_BUILD_TESTS + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out) + + if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU") +- list(APPEND uvwasi_cflags -fvisibility=hidden --std=gnu89) ++ list(APPEND uvwasi_cflags --std=gnu89) + list(APPEND uvwasi_cflags -Wall -Wsign-compare -Wextra -Wstrict-prototypes) + list(APPEND uvwasi_cflags -Wno-unused-parameter) + endif() +@@ -33,27 +33,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + list(APPEND uvwasi_defines _GNU_SOURCE _POSIX_C_SOURCE=200112) + endif() + +-find_package(LIBUV QUIET) +-if(LIBUV_FOUND) +- include_directories(${LIBUV_INCLUDE_DIR}) +-else() +- include(FetchContent) +- ## https://libuv.org +- FetchContent_Declare( +- libuv +- GIT_REPOSITORY https://github.com/libuv/libuv.git +- GIT_TAG ${LIBUV_VERSION}) +- +- FetchContent_GetProperties(libuv) +- if(NOT libuv_POPULATED) +- FetchContent_Populate(libuv) +- include_directories("${libuv_SOURCE_DIR}/include") +- add_subdirectory(${libuv_SOURCE_DIR} ${libuv_BINARY_DIR} EXCLUDE_FROM_ALL) +- endif() +- set(LIBUV_INCLUDE_DIR ${libuv_SOURCE_DIR}/include) +- set(LIBUV_LIBRARIES uv_a) +-endif() +- + ## uvwasi source code files. + set(uvwasi_sources + src/clocks.c +@@ -97,19 +76,7 @@ if(ASAN AND CMAKE_C_COMPILER_ID MATCHES "AppleClang|GNU|Clang") + set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") + endif() + +-## Static library target. +-add_library(uvwasi_a STATIC ${uvwasi_sources}) +-target_compile_definitions(uvwasi_a PRIVATE ${uvwasi_defines}) +-target_compile_options(uvwasi_a PRIVATE ${uvwasi_cflags}) +-target_include_directories(uvwasi_a PRIVATE ${PROJECT_SOURCE_DIR}/include) +-if(CODE_COVERAGE) +- target_link_libraries(uvwasi_a PUBLIC ${LIBUV_LIBRARIES} coverage_config) +-else() +- target_link_libraries(uvwasi_a PRIVATE ${LIBUV_LIBRARIES}) +-endif() +- +-## Shared library target. +-add_library(uvwasi SHARED ${uvwasi_sources}) ++add_library(uvwasi ${uvwasi_sources}) + target_compile_definitions(uvwasi PRIVATE ${uvwasi_defines}) + target_compile_options(uvwasi PRIVATE ${uvwasi_cflags}) + target_include_directories(uvwasi PRIVATE ${PROJECT_SOURCE_DIR}/include) +@@ -159,7 +126,7 @@ if(INSTALL_UVWASI AND NOT CODE_COVERAGE) + configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in ${config_file} INSTALL_DESTINATION ${cmake_files_install_dir}) + + install( +- TARGETS uvwasi_a uvwasi ++ TARGETS uvwasi + EXPORT ${target_export_name} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/packages/u/uvwasi/xmake.lua b/packages/u/uvwasi/xmake.lua index 22b399deb..665b1602e 100644 --- a/packages/u/uvwasi/xmake.lua +++ b/packages/u/uvwasi/xmake.lua @@ -5,29 +5,43 @@ package("uvwasi") add_urls("https://github.com/nodejs/uvwasi/archive/refs/tags/$(version).tar.gz", "https://github.com/nodejs/uvwasi.git") + + add_versions("v0.0.21", "5cf32f166c493f41c0de7f3fd578d0be1b692c81c54f0c68889e62240fe9ab60") + add_versions("v0.0.20", "417e5ecc40005d9c8008bad2b6a2034e109b2a0a1ebd108b231cb419cfbb980a") add_versions("v0.0.12", "f310a628d2657b9ed523a19284f58e4a407466f2e17efb2250d2e58524d02c53") + add_patches("v0.0.20", path.join(os.scriptdir(), "patches", "0.0.20", "cmake.patch"), "50d70983aa498e63e02e66d71e3c7c78ed1c802c61063d1b085e8a12abbcf751") + + add_includedirs("include", "include/uvwasi") + add_deps("cmake", "libuv") on_install("linux", "windows", "macosx", function (package) - local configs = {"-DWITH_SYSTEM_LIBUV=ON", "-DUVWASI_BUILD_TESTS=OFF"} - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - if package:config("shared") then - io.replace("CMakeLists.txt", "-fvisibility=hidden", "", {plain = true}) - end - if package:is_plat("windows") then - table.insert(configs, "-DLIBUV_LIBRARIES=uv_a.lib") - end - import("package.tools.cmake").install(package, configs, {buildir = "build", packagedeps = "libuv"}) - os.cp("include", package:installdir()) - if package:config("shared") then - os.trycp("build/*.dll", package:installdir("bin")) - os.trycp("build/*.so", package:installdir("lib")) - os.trycp("build/*.dylib", package:installdir("lib")) + local configs = {"-DUVWASI_BUILD_TESTS=OFF"} + if package:version():ge("0.0.20") then + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("windows") and package:config("shared") then + table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + end + import("package.tools.cmake").install(package, configs, {packagedeps = "libuv"}) else - os.trycp("build/*.a", package:installdir("lib")) - os.trycp("build/*.lib", package:installdir("lib")) + table.insert(configs, "-DWITH_SYSTEM_LIBUV=ON") + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:config("shared") then + io.replace("CMakeLists.txt", "-fvisibility=hidden", "", {plain = true}) + end + import("package.tools.cmake").install(package, configs, {packagedeps = "libuv"}) + os.cp("include", package:installdir()) + if package:config("shared") then + os.trycp("build/*.dll", package:installdir("bin")) + os.trycp("build/*.so", package:installdir("lib")) + os.trycp("build/*.dylib", package:installdir("lib")) + else + os.trycp("build/*.a", package:installdir("lib")) + os.trycp("build/*.lib", package:installdir("lib")) + end end end) diff --git a/packages/u/uwebsockets/xmake.lua b/packages/u/uwebsockets/xmake.lua new file mode 100644 index 000000000..d62ccaf79 --- /dev/null +++ b/packages/u/uwebsockets/xmake.lua @@ -0,0 +1,61 @@ +package("uwebsockets") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/uNetworking") + set_description("Simple, secure & standards compliant web server for the most demanding of applications.") + set_license("Apache-2.0") + + add_urls("https://github.com/uNetworking/uWebSockets/archive/refs/tags/$(version).tar.gz", + "https://github.com/uNetworking/uWebSockets.git") + + add_versions("v20.62.0", "03dfc8037cf43856a41e64bbc7fc5a7cf5e6369c9158682753074ecbbe09eed1") + add_versions("v20.61.0", "94778209571f832740fe1a4f19dbc059990b6acc34b8789f39cda6a158178d1f") + add_versions("v20.60.0", "eb72223768f93d40038181653ee5b59a53736448a6ff4e8924fd56b2fcdc00db") + + add_configs("zip", {description = "Enable libzip", default = false, type = "boolean"}) + add_configs("deflate", {description = "Enable libdeflate", default = false, type = "boolean"}) + + add_deps("usockets") + + on_load(function (package) + if package:config("zip") then + package:add("deps", "libzip") + if package:config("deflate") then + package:add("deps", "libdeflate") + package:add("defines", "UWS_USE_LIBDEFLATE") + end + else + package:add("defines", "UWS_NO_ZLIB") + end + end) + + on_install("windows", "macosx", "linux", function (package) + os.cp("src/*", package:installdir("include/uwebsockets")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test(){ + struct UserData {}; + uWS::App().get("/hello/:name", [](auto *res, auto *req) { + res->writeStatus("200 OK"); + res->writeHeader("Content-Type", "text/html; charset=utf-8"); + res->write("

Hello "); + res->write(req->getParameter("name")); + res->end("!

"); + }).ws("/*", { + .open = [](auto *ws) { + ws->subscribe("oh_interesting_subject"); + }, + .message = [](auto *ws, std::string_view message, uWS::OpCode opCode) { + ws->send(message, opCode); + } + }).listen(9001, [](auto *listenSocket) { + if (listenSocket) { + std::cout << "Listening on port " << 9001 << std::endl; + } else { + std::cout << "Failed to load certs or to bind to port" << std::endl; + } + }).run(); + } + ]]}, {configs = {languages = "cxx20"}, includes = "uwebsockets/App.h"})) + end) diff --git a/packages/v/vc-ltl5/xmake.lua b/packages/v/vc-ltl5/xmake.lua index 7ac0f9607..d68a10752 100644 --- a/packages/v/vc-ltl5/xmake.lua +++ b/packages/v/vc-ltl5/xmake.lua @@ -6,6 +6,7 @@ package("vc-ltl5") add_urls("https://github.com/Chuyu-Team/VC-LTL5/releases/download/v$(version)/VC-LTL-$(version)-Binary.7z") add_versions("5.0.6", "e406f829f75d59c34ee1e34cb6e994eb7db0810123ae7196499f26df88bc0a6f") add_versions("5.0.7", "08555aca30b2f77a484534be0799cfed05bfdeb1d1e461d91576264d7123e687") + add_versions("5.0.9", "71a3099978ff3dc83fe8e2ebddf104e2f916d13cd10fb01fe02317ebc7fb02d9") local default_min_version = "6.0.6000.0" if is_plat("windows") then diff --git a/packages/v/vcglib/xmake.lua b/packages/v/vcglib/xmake.lua index fcbb839d8..8c73cbb93 100644 --- a/packages/v/vcglib/xmake.lua +++ b/packages/v/vcglib/xmake.lua @@ -7,6 +7,7 @@ package("vcglib") add_urls("https://github.com/cnr-isti-vclab/vcglib/archive/refs/tags/$(version).tar.gz", "https://github.com/cnr-isti-vclab/vcglib.git") + add_versions("2023.12", "5a84db6d596be1cb4abdc450d130dc8e2224a4c7b4198b60cd9ac55f45ac5c7b") add_versions("2020.12", "731c57435e39c4b958a1d766cadd9865d9db35e36410708f2da7818e9fa5f786") add_versions("2021.07", "384bb4bb86b4114391cbc0fb8990f218473a656d06f2214bcc3725dac193db1c") add_versions("2021.10", "a443a4a63c0f6691229c80aa22a15f17ab7d9da2b0b6a5111cf39aee86632d5a") @@ -14,7 +15,10 @@ package("vcglib") add_deps("eigen") on_install("windows", "macosx", "linux", function (package) + os.mv("apps", package:installdir("include")) + os.mv("eigenlib", package:installdir("include")) os.mv("vcg", package:installdir("include")) + os.mv("wrap", package:installdir("include")) end) on_test(function (package) diff --git a/packages/v/vcpkg/xmake.lua b/packages/v/vcpkg/xmake.lua new file mode 100644 index 000000000..64a4ed4bf --- /dev/null +++ b/packages/v/vcpkg/xmake.lua @@ -0,0 +1,26 @@ +package("vcpkg") + set_kind("binary") + set_homepage("https://github.com/microsoft/vcpkg") + set_description("Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS.") + set_license("MIT") + + add_urls("https://github.com/microsoft/vcpkg/archive/refs/tags/$(version).tar.gz") + add_versions("2024.05.24", "3034e534d4ed13e6e6edad3c331c0e9e3280f579dd4ba86151aa1e2896b85d31") + + add_deps("zip", "unzip", "cmake", "ninja", "curl") + + on_install("@linux", "@macosx", "@windows", function(package) + if package:is_plat("windows") then + os.vrun("bootstrap-vcpkg.bat") + else + os.vrunv("./bootstrap-vcpkg.sh", {shell = true}) + end + os.cp(".", package:installdir()) + package:setenv("VCPKG_ROOT", ".") + package:addenv("PATH", ".") + package:mark_as_pathenv("VCPKG_ROOT") + end) + + on_test(function(package) + os.vrun("vcpkg --help") + end) diff --git a/packages/v/verilator/xmake.lua b/packages/v/verilator/xmake.lua index e8ac74db8..a8dde10ba 100644 --- a/packages/v/verilator/xmake.lua +++ b/packages/v/verilator/xmake.lua @@ -3,12 +3,10 @@ package("verilator") set_homepage("https://verilator.org") set_description("Verilator open-source SystemVerilog simulator and lint system") --- add_urls("https://github.com/verilator/verilator/archive/refs/tags/$(version).tar.gz") + add_urls("https://github.com/verilator/verilator/archive/refs/tags/$(version).tar.gz") add_urls("https://github.com/verilator/verilator.git") - add_versions("2023.1.10", "5fce23e90d2a721bb712dc9aacde594558489dda") - -- wait for next release with cmake --- add_versions("v5.004", "7d193a09eebefdbec8defaabfc125663f10cf6ab0963ccbefdfe704a8a4784d2") + add_versions("v5.016", "66fc36f65033e5ec904481dd3d0df56500e90c0bfca23b2ae21b4a8d39e05ef1") on_load(function (package) if not package:is_precompiled() then diff --git a/packages/v/vk-bootstrap/xmake.lua b/packages/v/vk-bootstrap/xmake.lua index f2ef58222..622239b50 100644 --- a/packages/v/vk-bootstrap/xmake.lua +++ b/packages/v/vk-bootstrap/xmake.lua @@ -6,9 +6,16 @@ package("vk-bootstrap") add_urls("https://github.com/charles-lunarg/vk-bootstrap/archive/refs/tags/$(version).tar.gz", "https://github.com/charles-lunarg/vk-bootstrap.git") + add_versions("v1.3.285", "c86b12ac2a0a809f7bf2af009a612be188aa4bb3a669d5955b22007989b3e07c") + add_versions("v1.3.284", "753a7cc337ae7dcfcbfad1547c010287fd4bec1237bf17f35349470c7430830c") + add_versions("v1.3.283", "1e6e43b76c14fa544d057b3e4825817e1aed50c3a2efbaf94862340c6304dc24") + add_versions("v1.3.282", "80aba4c2903e7f7f54a43d4c41dd6e2014b79c26fa432c417efb566e8b42fe67") add_versions("v0.5", "7ec1017d71d48595c078a4488140b230fd9cad1059986a18a507f356bf00e89b") add_versions("v0.6", "95dedaa5cedf7a271f051d91b24b3b6c78aa3c5b2bc3cf058554c92748a421b2") add_versions("v0.7", "7b2c30a4c46514cc5b20d2bebab25c495df39574b9e117c760d1cfe19f71d9aa") + add_versions("v1.3.268", "028300b0dac2dfaf193ca95d2ecd46a450f6da31095a09334c4c3b76c561714c") + add_versions("v1.3.275", "33737a731e8b3a4539812e63502ea55dffb3dbc7331b44c4cc0902fbf797f5ff") + add_versions("v1.3.280", "0b8b434b4d02a4ace9238acdd403c4c7993957176182c45bd8f0c1225733a599") add_deps("vulkan-headers") @@ -19,12 +26,19 @@ package("vk-bootstrap") end on_install("windows", "linux", "macosx", function (package) + local version = package:version() + local language_version + if not version or version:ge("1.3.270") then + language_version = "cxx17" + else + language_version = "cxx14" + end io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") add_requires("vulkan-headers") target("vk-bootstrap") set_kind("static") - set_languages("cxx14") + ]] .. "set_languages(\"" .. language_version .. "\")" .. [[ add_files("src/VkBootstrap.cpp") add_headerfiles("src/VkBootstrap.h") add_headerfiles("src/VkBootstrapDispatch.h") @@ -37,11 +51,18 @@ package("vk-bootstrap") end) on_test(function (package) + local configs = {} + local version = package:version() + if not version or version:ge("1.3.270") then + configs.languages = "cxx17" + else + configs.languages = "cxx14" + end assert(package:check_cxxsnippets({test = [[ vkb::InstanceBuilder builder; auto inst_ret = builder.set_app_name ("Example Vulkan Application") .request_validation_layers () .use_default_debug_messenger () .build (); - ]]}, {configs = {languages = "cxx14"}, includes = "VkBootstrap.h"})) + ]]}, {configs = configs, includes = "VkBootstrap.h"})) end) diff --git a/packages/v/volk/xmake.lua b/packages/v/volk/xmake.lua index fb0a89d56..e8064a534 100644 --- a/packages/v/volk/xmake.lua +++ b/packages/v/volk/xmake.lua @@ -4,7 +4,13 @@ package("volk") set_license("MIT") add_urls("https://github.com/zeux/volk/archive/$(version).tar.gz", {version = function (version) - return version:ge("1.3.226") and format("sdk-%s", version:gsub("%+", ".")) or version + local prefix = "" + if version:gt("1.3.261+1") then + prefix = "vulkan-sdk-" + elseif version:ge("1.3.226") then + prefix = "sdk-" + end + return prefix .. version:gsub("%+", ".") end}) add_urls("https://github.com/zeux/volk.git") add_versions("1.2.190", "07f03720b8c70a626c98cc9545350538122bca9f853e6ed20ccad5a25d55fa4b") @@ -13,6 +19,10 @@ package("volk") add_versions("1.3.231+1", "fac8d3d295e88bcc6bfb2b729d2c4babb2ea04ccb39fd918a3471b2d756789b9") add_versions("1.3.250+1", "673241c6561fb4965f873d7fcdece17d950b24c77d6cf41466e47bdc2af67b81") add_versions("1.3.261+1", "052866c6cbff9efdf1e73e71c1d65070c36863730c95a4e93833500b4d894d69") + add_versions("1.3.268+0", "f1d30fac1cdc17a8fdc8c69f371663547f92db99cfd612962190bb1e2c8ce74d") + add_versions("1.3.275+0", "b68d24e139190e49e5eafd72894f6e85c80472b8745bddc6ef91d6bf339df813") + add_versions("1.3.280+0", "af9c98d09284eef29f6826bb1620bfe551a91a864fce707416b83c255efe3c25") + add_versions("1.3.283+0", "872035f1f26c53b218632a3a8dbccbd276710aaabafb9bb1bc1a6c0633ee6aab") add_deps("vulkan-headers") @@ -67,4 +77,4 @@ package("volk") volkInitialize(); } ]]}, {configs = {defines = defines}})) - end) \ No newline at end of file + end) diff --git a/packages/v/vulkan-headers/xmake.lua b/packages/v/vulkan-headers/xmake.lua index 17d44748b..8208517af 100644 --- a/packages/v/vulkan-headers/xmake.lua +++ b/packages/v/vulkan-headers/xmake.lua @@ -3,11 +3,23 @@ package("vulkan-headers") set_homepage("https://github.com/KhronosGroup/Vulkan-Headers/") set_description("Vulkan Header files and API registry") set_license("Apache-2.0") - + add_urls("https://github.com/KhronosGroup/Vulkan-Headers.git") - add_urls("https://github.com/KhronosGroup/Vulkan-Headers/archive/$(version).tar.gz", {version = function (version) return version:startswith("v") and version or "sdk-" .. version:gsub("%+", ".") end}) + add_urls("https://github.com/KhronosGroup/Vulkan-Headers/archive/$(version).tar.gz", {version = function (version) + local prefix = "sdk-" + if version:gt("1.3.261+1") then + prefix = "vulkan-sdk-" + end + return version:startswith("v") and version or prefix .. version:gsub("%+", ".") + end}) + + add_configs("modules", {description = "Build with C++20 modules support.", default = false, type = "boolean"}) - -- when adding a new sdk version, please also update vulkan-loader, spirv-headers, spirv-reflect, glslang and volk packages + -- when adding a new sdk version, please also update vulkan-hpp, vulkan-loader, vulkan-utility-libraries, spirv-headers, spirv-reflect, glslang and volk packages + add_versions("1.3.283+0", "cf54a812911b4e3e4ff15716c222a8fb9a87c2771c0b86060cb0ca2570ea55a9") + add_versions("1.3.280+0", "14caa991988be6451755ad1c81df112f4b6f2bea05f0cf2888a52d4d0f0910f6") + add_versions("1.3.275+0", "fcd2136a9feb0402820b334d8242773462cc47ed397aa20c8f4d04f7ea18d810") + add_versions("1.3.268+0", "94993cbe2b1a604c0d5d9ea37a767e1aba4d771d2bfd4ddceefd66243095164f") add_versions("1.3.261+1", "7a25ebdb6325e626dc5d33bc937b289ccce7ddb7b0ac1a1b1d5d7ff33b6715d3") add_versions("1.3.250+1", "e5b563a415e73725bcf471b7e3e837804ed3703b47cce4553db5e7e73821c5ee") add_versions("1.3.246+1", "f9fa6a05ac1e059cd6f8f3a21705fb5bc093743d97315b7acf3bc20921abc27c") @@ -21,14 +33,35 @@ package("vulkan-headers") add_versions("1.2.162+0", "eb0f6a79ac38e137f55a0e13641140e63b765c8ec717a65bf3904614ef754365") add_versions("1.2.154+0", "a0528ade4dd3bd826b960ba4ccabc62e92ecedc3c70331b291e0a7671b3520f9") - add_deps("cmake") - - if is_plat("linux") then - add_extsources("pacman::vulkan-headers") - end + on_load(function (package) + if not package:config("modules") then + package:add("deps", "cmake") + if package:is_plat("mingw") and is_subhost("msys") then + package:add("extsources", "pacman::vulkan-headers") + elseif package:is_plat("linux") then + package:add("extsources", "apt::libvulkan-dev") + elseif package:is_plat("macosx") then + package:add("extsources", "brew::vulkan-headers") + end + end + end) on_install(function (package) - import("package.tools.cmake").install(package) + if not package:config("modules") then + import("package.tools.cmake").install(package) + else + io.writefile("xmake.lua", [[ + target("vulkan-headers") + set_kind("static") + set_languages("c++20") + add_headerfiles("include/(**.h)") + add_headerfiles("include/(**.hpp)") + add_includedirs("include") + add_files("include/**.cppm", {public = true}) + ]]) + local configs = {} + import("package.tools.xmake").install(package, configs) + end end) on_test(function (package) diff --git a/packages/v/vulkan-hpp/xmake.lua b/packages/v/vulkan-hpp/xmake.lua index 66f64347a..1f6afc351 100644 --- a/packages/v/vulkan-hpp/xmake.lua +++ b/packages/v/vulkan-hpp/xmake.lua @@ -6,6 +6,7 @@ package("vulkan-hpp") set_license("Apache-2.0") add_urls("https://github.com/KhronosGroup/Vulkan-Hpp.git") + -- when adding a new sdk version, please also update vulkan-headers, vulkan-loader, vulkan-utility-libraries, spirv-headers, spirv-reflect, glslang and volk packages add_versions("v1.2.180", "bfa6d4765212505c8241a44b97dc5a9ce3aa2969") add_versions("v1.2.189", "58ff1da4c03f5f124eb835f41a9dd8fe3c2e8087") add_versions("v1.2.198", "d8c9f4f0eee6972622a1c3aabab5ed558d37c1c0") @@ -15,12 +16,29 @@ package("vulkan-hpp") add_versions("v1.3.244", "1bd3877dcc7f3fbf5a43e4d2f0fcc4ebadf6af85") add_versions("v1.3.254", "9f89f760a661ff5d7e1e5cc93de13eb4026307b5") add_versions("v1.3.261", "3d27c1736a8d520f4d577d9d41566ce1b1fc346e") + add_versions("v1.3.268", "d2134fefe22279595aee73752099022222468a60") + add_versions("v1.3.272", "e621db07719c0c1c738ad39ef400737a750bb23a") + add_versions("v1.3.275", "1a24b015830c116632a0723f3ccfd1f06009ce12") + add_versions("v1.3.276", "d4b36b82236e052a5e6e4cea5fe7967d5b565ebc") + add_versions("v1.3.277", "c5c1994f79298543af93d7956b654bdefdfbdd26") + add_versions("v1.3.278", "29723f90a127ff08d9099855378162f04b4ffddd") + add_versions("v1.3.279", "6fb8def27290f8b87d7835457a9c68190aed9a9a") + add_versions("v1.3.280", "e35acfe75215116029298aebf681170559a4fe6a") + add_versions("v1.3.281", "88d508b32f207ba85b37fe22fe3732322d1c248d") + add_versions("v1.3.282", "4bf2835dd1a530291cd2b340a58dd7e369d5c86c") + add_versions("v1.3.283", "2fbc146feefa43b8201af4b01eb3570110f9fa32") - add_deps("cmake") + add_configs("modules", {description = "Build with C++20 modules support.", default = false, type = "boolean"}) + + on_load(function (package) + if not package:config("modules") then + package:add("deps", "cmake") + if package:is_plat("linux") then + package:add("extsources", "pacman::vulkan-headers") + end + end + end) - if is_plat("linux") then - add_extsources("pacman::vulkan-headers") - end on_install("windows|x86", "windows|x64", "linux", "macosx", "mingw", "android", "iphoneos", function (package) local arch_prev @@ -31,6 +49,8 @@ package("vulkan-hpp") package:plat_set(os.host()) package:arch_set(os.arch()) end + io.replace("CMakeLists.txt", "-Werror", "", {plain = true}) + io.replace("CMakeLists.txt", "/WX", "", {plain = true}) import("package.tools.cmake").build(package, {buildir = "build"}) if arch_prev and plat_prev then package:plat_set(plat_prev) @@ -43,8 +63,25 @@ package("vulkan-hpp") os.cp(path.join("**", "VulkanHppGenerator"), "build") end os.runv(path.join("build", "VulkanHppGenerator")) - os.cp("Vulkan-Headers/include", package:installdir()) - os.cp("vulkan/*.hpp", package:installdir(path.join("include", "vulkan"))) + if not package:config("modules") then + os.cp("Vulkan-Headers/include", package:installdir()) + os.cp("vulkan/*.hpp", package:installdir(path.join("include", "vulkan"))) + else + io.writefile("xmake.lua", [[ + target("vulkan-hpp") + set_kind("static") + set_languages("c++20") + add_headerfiles("Vulkan-Headers/include/(**.h)") + add_headerfiles("Vulkan/(**.h)") + add_headerfiles("Vulkan-Headers/include/(**.hpp)") + add_headerfiles("Vulkan/(**.hpp)") + add_includedirs("Vulkan") + add_includedirs("Vulkan-Headers/include") + add_files("Vulkan/vulkan.cppm", {public = true}) + ]]) + local configs = {} + import("package.tools.xmake").install(package, configs) + end end) on_test(function (package) diff --git a/packages/v/vulkan-loader/xmake.lua b/packages/v/vulkan-loader/xmake.lua index 2ae82c724..3342ceb2f 100644 --- a/packages/v/vulkan-loader/xmake.lua +++ b/packages/v/vulkan-loader/xmake.lua @@ -3,7 +3,18 @@ package("vulkan-loader") set_description("This project provides the Khronos official Vulkan ICD desktop loader for Windows, Linux, and MacOS.") set_license("Apache-2.0") - add_urls("https://github.com/KhronosGroup/Vulkan-Loader/archive/sdk-$(version).tar.gz", {version = function (version) return version:gsub("%+", ".") end}) + add_urls("https://github.com/KhronosGroup/Vulkan-Loader/archive/$(version).tar.gz", {version = function (version) + local prefix = "sdk-" + if version:gt("1.3.261+1") then + prefix = "vulkan-sdk-" + end + return prefix .. version:gsub("%+", ".") + end}) + + add_versions("1.3.283+0", "59151a3cdbf8dcfe9c2ce4b5bf33358255a197f48d8d0ee8a1d8642ed9ace80f") + add_versions("1.3.280+0", "f9317667a180257381dcbc74726083af581189f51e10e0246adaa86df075fe16") + add_versions("1.3.275+0", "f49a2653cd592439c5b4b987ffa0b2577b7fa72b7d344d7a2a89f7d6cb2b342e") + add_versions("1.3.268+0", "404fa621f1ab2731bcc68bcbff64d8c6de322faad2d87f9198641bd37255fd39") add_versions("1.3.261+1", "f85f0ea57b63750d4ddaf6c8649df781c4777006daa3cd772b01e7b5ed02f3f2") add_versions("1.3.250+1", "b982ec5fae9af6364816a7c5fcf4d3e5c29bfdca35f4b12ee1f90e492e41adc2") add_versions("1.3.246+1", "5ffb79b83ec539233ee793dd3c50aa241bd9bd67103d45d3f4b657f1620b7553") @@ -18,9 +29,13 @@ package("vulkan-loader") add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) - if is_plat("linux") then + if is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::vulkan-loader") + elseif is_plat("linux") then add_extsources("apt::libvulkan-dev", "pacman::vulkan-icd-loader") add_deps("wayland", "libxrandr", "libxrender", "libxcb", "libxkbcommon") + elseif is_plat("macosx") then + add_extsources("brew::vulkan-loader") end on_load("windows", "linux", "macosx", function (package) diff --git a/packages/v/vulkan-memory-allocator-hpp/xmake.lua b/packages/v/vulkan-memory-allocator-hpp/xmake.lua index 113de5b3d..537e6bb5e 100644 --- a/packages/v/vulkan-memory-allocator-hpp/xmake.lua +++ b/packages/v/vulkan-memory-allocator-hpp/xmake.lua @@ -10,14 +10,48 @@ package("vulkan-memory-allocator-hpp") add_versions("v3.0.1-1", '0e0c374751d5ca6123d0ae0df756693f0674412d7c758ec4a39a5a9dcc412911') add_versions("v3.0.1-3", '66a3d4be3bc1404c844b5a36aadeb6b366878e7cf1efe899eb0a0095f3871aae') + add_configs("modules", {description = "Build with C++20 modules support.", default = false, type = "boolean"}) + add_configs("use_vulkanheaders", {description = "Use vulkan-headers package instead of vulkan-hpp.", default = false, type = "boolean"}) + add_deps("vulkan-memory-allocator") on_install("windows|x86", "windows|x64", "linux", "macosx", "mingw", "android", "iphoneos", function (package) - os.cp("include", package:installdir()) - if package:gitref() or package:version():ge("3.0.1") then - package:add("deps", "vulkan-hpp >= 1.3.234") + if not package:config("modules") then + if package:config("use_vulkanheaders") then + if package:gitref() or package:version():ge("3.0.1") then + package:add("deps", "vulkan-headers >= 1.3.234") + else + package:add("deps", "vulkan-headers < 1.3.234") + end + else + if package:gitref() or package:version():ge("3.0.1") then + package:add("deps", "vulkan-hpp >= 1.3.234") + else + package:add("deps", "vulkan-hpp < 1.3.234") + end + end + os.cp("include", package:installdir()) else - package:add("deps", "vulkan-hpp < 1.3.234") + local vulkan_dep + if package:config("use_vulkanheaders") then + vulkan_dep = "vulkan-headers" + package:add("deps", "vulkan-headers >= 1.3.275") + else + vulkan_dep = "vulkan-hpp" + package:add("deps", "vulkan-hpp >= 1.3.275") + end + io.writefile("xmake.lua", format([[ + add_requires("vulkan-memory-allocator", "%s >= 1.3.275") + target("vulkan-memory-allocator-hpp") + set_kind("static") + set_languages("c++20") + add_headerfiles("include/(**.hpp)") + add_includedirs("include") + add_files("src/*.cppm", {public = true}) + add_packages("vulkan-memory-allocator", "%s") + ]], vulkan_dep, vulkan_dep)) + local configs = {} + import("package.tools.xmake").install(package, configs) end end) @@ -26,5 +60,5 @@ package("vulkan-memory-allocator-hpp") void test() { int version = VMA_VULKAN_VERSION; } - ]]}, {includes = "vk_mem_alloc.hpp", configs = {languages = "c++11"} })) + ]]}, {includes = "vk_mem_alloc.hpp", configs = {languages = "c++14"} })) end) diff --git a/packages/v/vulkan-utility-libraries/xmake.lua b/packages/v/vulkan-utility-libraries/xmake.lua new file mode 100644 index 000000000..924505307 --- /dev/null +++ b/packages/v/vulkan-utility-libraries/xmake.lua @@ -0,0 +1,44 @@ +package("vulkan-utility-libraries") + set_homepage("https://github.com/KhronosGroup/Vulkan-Utility-Libraries") + set_description("Utility libraries for Vulkan developers") + set_license("Apache-2.0") + + add_urls("https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git") + add_urls("https://github.com/KhronosGroup/Vulkan-Utility-Libraries/archive/refs/tags/$(version).tar.gz", {version = function (version) + local prefix = "sdk-" + if version:gt("1.3.261+1") then + prefix = "vulkan-sdk-" + end + return version:startswith("v") and version or prefix .. version:gsub("%+", ".") + end}) + + add_versions("v1.3.283", "a446616dede2b0168726f4e1b51777ba5c20ec46c475b378e2c07fd4ab4375ee") + add_versions("v1.3.280", "075e13f2fdeeca3bb6fb39155c8cc345cf216ab93661549b1a33368aa28a9dea") + add_versions("v1.3.275", "96d3ec7bda7b6e9fabbb471c570104a7b1cb56928d097dd0441c96129468b888") + add_versions("v1.3.268", "990de84b66094b647ae420ba13356b79d69e1c6f95532f40466457d51a9d127d") + + if is_plat("windows") then + add_syslinks("advapi32") + end + + add_deps("cmake") + add_deps("vulkan-headers") + + if is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::vulkan-utility-libraries") + elseif is_plat("linux") then + add_extsources("apt::vulkan-utility-libraries-dev", "pacman::vulkan-utility-libraries") + elseif is_plat("macosx") then + add_extsources("brew::vulkan-utility-libraries") + end + + on_install("windows", "linux", "macosx", "bsd", "mingw", "msys", "cross", function (package) + local configs = {"-DBUILD_TESTS=OFF", "-DUPDATE_DEPS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("vkuCreateLayerSettingSet", {includes = "vulkan/layer/vk_layer_settings.h"})) + end) diff --git a/packages/v/vulkan-validationlayers/xmake.lua b/packages/v/vulkan-validationlayers/xmake.lua index 24c0ca7d1..0009dee76 100644 --- a/packages/v/vulkan-validationlayers/xmake.lua +++ b/packages/v/vulkan-validationlayers/xmake.lua @@ -4,15 +4,34 @@ package("vulkan-validationlayers") set_license("Apache-2.0") if is_plat("android") then - add_urls("https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download/sdk-$(version)/android-binaries-$(version).tar.gz", {version = function (version) return (version:ge("1.3.261") and "sdk-" or "") .. version:gsub("%+", ".") end}) + add_urls("https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download/$(version).tar.gz", {version = function (version) + local versionLoc = version:gsub("%+", ".") + if version:gt("1.3.268+0") then + return "vulkan-sdk-" .. versionLoc .. "/android-binaries-" .. versionLoc + elseif version:gt("1.3.261+1") then + return "vulkan-sdk-" .. versionLoc .. "/android-binaries-vulkan-sdk-" .. versionLoc + elseif version:gt("1.3.250+1") then + return "sdk-" .. versionLoc .. "/android-binaries-sdk-" .. versionLoc + else + return "sdk-" .. versionLoc .. "/android-binaries-" .. versionLoc + end + end}) + add_versions("1.3.275+0", "6e22fb13601c1e780c44a17497a3c999cc5207e52a09819e7c32ecd8439eff7a") add_versions("1.2.198+0", "5436e974d6b3133b3454edf1910f76b9f869db8bbe086859b2abe32fdb539cbc") add_versions("1.2.189+1", "b3e69b60a67a17b023825f9eb0ce1aef22e6b59d095afa204d883a9ce3d81021") add_versions("1.3.261+1", "ebb324859653e15fb4a9cf7cd1b3252d1aeab370d15e19f9d0c4b7330aef790c") else - add_urls("https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/sdk-$(version).tar.gz", {version = function (version) return version:gsub("%+", ".") end}) + add_urls("https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/$(version).tar.gz", {version = function (version) + local prefix = "sdk-" + if version:gt("1.3.261+1") then + prefix = "vulkan-sdk-" + end + return version:startswith("v") and version or prefix .. version:gsub("%+", ".") + end}) add_versions("1.3.261+1", "1372d522f297bb3fb386802b1aa4b7f885a9e1e969a6a3c6e9b29d381357f21d") + add_versions("1.3.275+0", "acfd84039109220129624b0ecb69980bbc3a858978c62b556dbe16efd0f26755") add_versions("1.2.198+0", "4a70cc5da26baf873fcf69b081eeeda545515dd66e5904f18fee32b4d275593a") add_versions("1.2.189+1", "d169ae71ae3ba12159df355b58f86f5635062c695d1deac9b97d5653561d517d") add_versions("1.2.182+0", "e88492143c8b08154807e7ead0ac784365b14464bb5016c2800cbff176ff61e7") @@ -22,13 +41,20 @@ package("vulkan-validationlayers") add_patches("1.2.154+0", "https://github.com/KhronosGroup/Vulkan-ValidationLayers/commit/9d3ef3258715573b17e8195855c76626600998be.patch", "1fa39483c345fbfb43b925e8410a55e58fa8a9776f9e5443c6e4ec994a554749") add_deps("cmake") - + add_deps("glslang", "spirv-headers", "spirv-tools") + if is_plat("windows") then add_syslinks("Advapi32") + end + + if is_plat("mingw") and is_subhost("msys") then + add_extsources("pacman::vulkan-validation-layers") elseif is_plat("linux") then - add_extsources("apt::vulkan-validationlayers-dev", "pacman::vulkan-extra-layers") + add_extsources("apt::vulkan-validationlayers-dev", "pacman::vulkan-validation-layers") add_deps("ninja") add_deps("wayland", "libxrandr", "libxcb", "libxkbcommon") + elseif is_plat("macosx") then + add_extsources("brew::vulkan-validationlayers") end end @@ -41,6 +67,10 @@ package("vulkan-validationlayers") if package:version():ge("1.2.189") then package:add("deps", "robin-hood-hashing") end + + if package:version():ge("1.3.275") then + package:add("deps", "vulkan-utility-libraries " .. sdkver) + end end) on_install("windows", "linux", "macosx", function (package) diff --git a/packages/v/vvenc/xmake.lua b/packages/v/vvenc/xmake.lua index e2c891f43..132d2a63b 100644 --- a/packages/v/vvenc/xmake.lua +++ b/packages/v/vvenc/xmake.lua @@ -6,6 +6,7 @@ package("vvenc") add_urls("https://github.com/fraunhoferhhi/vvenc/archive/refs/tags/$(version).tar.gz", "https://github.com/fraunhoferhhi/vvenc.git") + add_versions("v1.11.1", "4f0c8ac3f03eb970bee7a0cacc57a886ac511d58f081bb08ba4bce6f547d92fa") add_versions("v1.9.0", "4ddb365dfc21bbbb7ed54655c7630ae3e8e977af31f22b28195e720215b1072d") add_configs("postfix", {description = "set build type postfix for apps and libs", default = false, type = "boolean"}) @@ -15,7 +16,7 @@ package("vvenc") add_deps("cmake") on_install("windows|x86", "windows|x64", "linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", function (package) - local configs = {} + local configs = {"-DVVENC_OVERRIDE_COMPILER_CHECK=ON"} if package:is_debug() then table.insert(configs, "-DCMAKE_BUILD_TYPE=Debug") table.insert(configs, "-DVVENC_ENABLE_TRACING=ON") diff --git a/packages/w/wangle/xmake.lua b/packages/w/wangle/xmake.lua new file mode 100644 index 000000000..4e8e67970 --- /dev/null +++ b/packages/w/wangle/xmake.lua @@ -0,0 +1,29 @@ +package("wangle") + set_homepage("https://github.com/facebook/wangle") + set_description("Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.") + set_license("Apache-2.0") + + add_urls("https://github.com/facebook/wangle/releases/download/v$(version).00/wangle-v$(version).00.zip", + "https://github.com/facebook/wangle.git") + add_versions("2024.02.26", "762d24613d17899b3a943285f54c20e680d382ab3d6889aeb0cf92092238d733") + add_versions("2024.03.04", "9f9e45dd7afb9aa071f9e6bfe83ccdf67cae7b6cc0a2b6db774fb68ab3152974") + add_versions("2024.03.11", "ad9fc14426c9463b9469848214e095fc1793779045bd9685c2d4d0432cb49674") + add_versions("2024.03.18", "578986898b3464ed9bd2e392a08d07604b68b2251322518c1f819c965eebe8f2") + add_versions("2024.03.25", "3de926ff92e59f5185e89e5e9365925530e5e57fd70f8e5107938149ce2fe140") + add_versions("2024.04.01", "c21c3616d3017bc7b72f6b2315f81be4fd9be4c0dc6e1fae0266ec545fbc5535") + + add_deps("cmake", "folly", "fizz") + + on_install("linux", "macosx", function (package) + os.cd("wangle") + local configs = {"-DBUILD_TESTS=OFF", + "-DBUILD_EXAMPLES=OFF", + "-DCMAKE_CXX_STANDARD=17"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cxxincludes("wangle/channel/AsyncSocketHandler.h", {configs = {languages = "c++17"}})) + end) diff --git a/packages/w/wasm-micro-runtime/patches/1.2.3/cmake.patch b/packages/w/wasm-micro-runtime/patches/1.2.3/cmake.patch new file mode 100644 index 000000000..260ace78a --- /dev/null +++ b/packages/w/wasm-micro-runtime/patches/1.2.3/cmake.patch @@ -0,0 +1,86 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fbea2616..a1952ca8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -108,16 +108,12 @@ endif () + set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + + # Set the strip command based on the system (GNU or Clang) +-if (CMAKE_STRIP) +- set (CMAKE_STRIP_FLAGS "--strip-all") +-endif () ++ + + include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) + +-set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wshadow -Wno-unused-parameter") + # set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wsign-conversion") + +-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wno-unused") + + if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64") + if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang")) +@@ -134,42 +130,37 @@ endif () + #set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,noexecstack,-z,relro,-z,now") + + include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) +- ++if (NOT BUILD_SHARED_LIBS) + # STATIC LIBRARY + add_library(iwasm_static STATIC ${WAMR_RUNTIME_LIB_SOURCE}) + set_target_properties (iwasm_static PROPERTIES OUTPUT_NAME vmlib) + target_include_directories(iwasm_static INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include) +-target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) ++target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS}) + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_static INTERFACE boringssl_crypto) + endif () + + install (TARGETS iwasm_static ARCHIVE DESTINATION lib) + +-# If it's a Release build, strip the static library +-if (CMAKE_STRIP AND CMAKE_BUILD_TYPE STREQUAL "Release") +- # Strip static library +- message (STATUS "Stripping static library after build!") +- add_custom_command (TARGET iwasm_static POST_BUILD +- COMMAND ${CMAKE_STRIP} ${CMAKE_STRIP_FLAGS} $ +- ) +-endif () ++else () + + # SHARED LIBRARY + add_library (iwasm_shared SHARED ${WAMR_RUNTIME_LIB_SOURCE}) + set_target_properties (iwasm_shared PROPERTIES OUTPUT_NAME iwasm) + target_include_directories(iwasm_shared INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include) +-target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) ++target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS}) + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_shared INTERFACE boringssl_crypto) + endif () +- ++if (WIN32) ++target_link_libraries (iwasm_shared ntdll) ++endif () + if (MINGW) + target_link_libraries (iwasm_shared -lWs2_32) + endif () + + install (TARGETS iwasm_shared LIBRARY DESTINATION lib) +- ++endif () + # HEADERS + install (FILES + ${WAMR_ROOT_DIR}/core/iwasm/include/wasm_c_api.h +@@ -177,11 +168,4 @@ install (FILES + ${WAMR_ROOT_DIR}/core/iwasm/include/lib_export.h + DESTINATION include) + +-# If it's a Release build, strip the shared library +-if (CMAKE_STRIP AND CMAKE_BUILD_TYPE STREQUAL "Release") +- # Strip shared library +- message (STATUS "Stripping shared library after build!") +- add_custom_command (TARGET iwasm_shared POST_BUILD +- COMMAND ${CMAKE_STRIP} ${CMAKE_STRIP_FLAGS} $ +- ) +-endif () ++ diff --git a/packages/w/wasm-micro-runtime/patches/1.3.2/cmake.patch b/packages/w/wasm-micro-runtime/patches/1.3.2/cmake.patch new file mode 100644 index 000000000..39c6392c5 --- /dev/null +++ b/packages/w/wasm-micro-runtime/patches/1.3.2/cmake.patch @@ -0,0 +1,55 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1c879949..8f8a73c7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -109,10 +109,8 @@ set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + + include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) + +-set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wshadow -Wno-unused-parameter") + # set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wsign-conversion") + +-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wno-unused") + + if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64") + if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang")) +@@ -131,31 +129,34 @@ endif () + include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) + + # STATIC LIBRARY ++if (NOT BUILD_SHARED_LIBS) + add_library(iwasm_static STATIC ${WAMR_RUNTIME_LIB_SOURCE}) + set_target_properties (iwasm_static PROPERTIES OUTPUT_NAME vmlib) + target_include_directories(iwasm_static INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include) +-target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) ++target_link_libraries (iwasm_static INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS}) + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_static INTERFACE boringssl_crypto) + endif () + + install (TARGETS iwasm_static ARCHIVE DESTINATION lib) +- ++else () + # SHARED LIBRARY + add_library (iwasm_shared SHARED ${WAMR_RUNTIME_LIB_SOURCE}) + set_target_properties (iwasm_shared PROPERTIES OUTPUT_NAME iwasm) + target_include_directories(iwasm_shared INTERFACE ${WAMR_ROOT_DIR}/core/iwasm/include) +-target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) ++target_link_libraries (iwasm_shared INTERFACE ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS}) + if (WAMR_BUILD_WASM_CACHE EQUAL 1) + target_link_libraries(iwasm_shared INTERFACE boringssl_crypto) + endif () +- ++if (WIN32) ++ target_link_libraries (iwasm_shared ntdll) ++endif () + if (MINGW) + target_link_libraries (iwasm_shared -lWs2_32) + endif () + + install (TARGETS iwasm_shared LIBRARY DESTINATION lib) +- ++endif () + # HEADERS + install (FILES + ${WAMR_ROOT_DIR}/core/iwasm/include/wasm_c_api.h diff --git a/packages/w/wasm-micro-runtime/patches/libc_uvwasi.patch b/packages/w/wasm-micro-runtime/patches/libc_uvwasi.patch new file mode 100644 index 000000000..7b1215f2f --- /dev/null +++ b/packages/w/wasm-micro-runtime/patches/libc_uvwasi.patch @@ -0,0 +1,53 @@ +diff --git a/core/iwasm/libraries/libc-uvwasi/libc_uvwasi.cmake b/core/iwasm/libraries/libc-uvwasi/libc_uvwasi.cmake +index 7a3bfbdc..3c8c4b19 100644 +--- a/core/iwasm/libraries/libc-uvwasi/libc_uvwasi.cmake ++++ b/core/iwasm/libraries/libc-uvwasi/libc_uvwasi.cmake +@@ -12,48 +12,6 @@ include(FetchContent) + # Point CMake at the custom modules to find libuv and uvwasi + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + +-## libuv +-find_package(LIBUV QUIET) +-if (LIBUV_FOUND) +- include_directories(${LIBUV_INCLUDE_DIR}) +-else() +- FetchContent_Declare( +- libuv +- GIT_REPOSITORY https://github.com/libuv/libuv.git +- GIT_TAG ${LIBUV_VERSION} +- ) +- FetchContent_GetProperties(libuv) +- if (NOT libuv_POPULATED) +- message("-- Fetching libuv ..") +- FetchContent_Populate(libuv) +- include_directories("${libuv_SOURCE_DIR}/include") +- add_subdirectory(${libuv_SOURCE_DIR} ${libuv_BINARY_DIR} EXCLUDE_FROM_ALL) +- set (LIBUV_LIBRARIES uv_a) +- set_target_properties(uv_a PROPERTIES POSITION_INDEPENDENT_CODE 1) +- endif() +-endif() +- +-## uvwasi +-find_package(UVWASI QUIET) +-if (UVWASI_FOUND) +- include_directories(${UVWASI_INCLUDE_DIR}) +-else() +- FetchContent_Declare( +- uvwasi +- GIT_REPOSITORY https://github.com/nodejs/uvwasi.git +- GIT_TAG main +- ) +- FetchContent_GetProperties(uvwasi) +- if (NOT uvwasi_POPULATED) +- message("-- Fetching uvwasi ..") +- FetchContent_Populate(uvwasi) +- include_directories("${uvwasi_SOURCE_DIR}/include") +- add_subdirectory(${uvwasi_SOURCE_DIR} ${uvwasi_BINARY_DIR} EXCLUDE_FROM_ALL) +- set (UVWASI_LIBRARIES uvwasi_a) +- set_target_properties(uvwasi_a PROPERTIES POSITION_INDEPENDENT_CODE 1) +- endif() +-endif() +- + set (UV_A_LIBS ${LIBUV_LIBRARIES} ${UVWASI_LIBRARIES}) + + file (GLOB_RECURSE source_all ${LIBC_WASI_DIR}/*.c) diff --git a/packages/w/wasm-micro-runtime/patches/ntapi.patch b/packages/w/wasm-micro-runtime/patches/ntapi.patch new file mode 100644 index 000000000..4fba31892 --- /dev/null +++ b/packages/w/wasm-micro-runtime/patches/ntapi.patch @@ -0,0 +1,36 @@ +diff --git a/core/shared/platform/windows/win_clock.c b/core/shared/platform/windows/win_clock.c +index c96bdfb3..48e2c449 100644 +--- a/core/shared/platform/windows/win_clock.c ++++ b/core/shared/platform/windows/win_clock.c +@@ -55,14 +55,30 @@ os_clock_res_get(__wasi_clockid_t clock_id, __wasi_timestamp_t *resolution) + case __WASI_CLOCK_THREAD_CPUTIME_ID: + { + #if WINAPI_PARTITION_DESKTOP ++ HMODULE ntdll = LoadLibrary("ntdll.dll"); ++ if (!ntdll) { ++ return __WASI_ENOTSUP; ++ } ++ ++ typedef NTSTATUS(NTAPI *LPFN_NtQueryTimerResolution)( ++ OUT PULONG MinimumResolution, ++ OUT PULONG MaximumResolution, ++ OUT PULONG CurrentResolution ++ ); ++ LPFN_NtQueryTimerResolution pNtQueryTimerResolution = (LPFN_NtQueryTimerResolution)GetProcAddress(ntdll, "NtQueryTimerResolution"); ++ if (!pNtQueryTimerResolution) { ++ return __WASI_ENOTSUP; ++ } ++ + ULONG maximum_time; + ULONG minimum_time; + ULONG current_time; + NTSTATUS +- status = NtQueryTimerResolution(&maximum_time, &minimum_time, ++ status = pNtQueryTimerResolution(&maximum_time, &minimum_time, + ¤t_time); + uint64 result = (uint64)current_time * NANOSECONDS_PER_TICK; + *resolution = result / (uint64)NANOSECONDS_PER_SECOND; ++ FreeLibrary(ntdll); + return error; + #else + return __WASI_ENOTSUP; diff --git a/packages/w/wasm-micro-runtime/xmake.lua b/packages/w/wasm-micro-runtime/xmake.lua index 8143ad3d2..efe4532e0 100644 --- a/packages/w/wasm-micro-runtime/xmake.lua +++ b/packages/w/wasm-micro-runtime/xmake.lua @@ -3,11 +3,18 @@ package("wasm-micro-runtime") set_description("WebAssembly Micro Runtime (WAMR)") set_license("Apache-2.0") - add_urls("https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-$(version).tar.gz", - "https://github.com/bytecodealliance/wasm-micro-runtime.git") + add_urls("https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-$(version).tar.gz", {excludes = {"*/language-bindings/python/LICENSE"}}) + add_urls("https://github.com/bytecodealliance/wasm-micro-runtime.git") + add_versions("1.3.2", "58961ba387ed66ace2dd903597f1670a42b8154a409757ae6f06f43fe867a98c") add_versions("1.2.3", "85057f788630dc1b8c371f5443cc192627175003a8ea63c491beaff29a338346") + add_patches("1.3.2", path.join(os.scriptdir(), "patches", "1.3.2", "cmake.patch"), "cf0e992bdf3fe03f7dc03624fd757444291a5286b1ceef6532bbf3f9567f394b") + add_patches("1.2.3", path.join(os.scriptdir(), "patches", "1.2.3", "cmake.patch"), "97d99509997b86d24a84cd1b2eca0d4dace7b460d5cb85bc23881d02e7ef08ed") + + add_patches("1.3.2", path.join(os.scriptdir(), "patches", "libc_uvwasi.patch"), "e83ff42588cc112588c7fde48a1bd9df7ffa8fa41f70dd99af5d6b0325ce46f7") + add_patches("1.2.3", path.join(os.scriptdir(), "patches", "libc_uvwasi.patch"), "e83ff42588cc112588c7fde48a1bd9df7ffa8fa41f70dd99af5d6b0325ce46f7") + add_configs("interp", {description = "Enable interpreter", default = true, type = "boolean"}) add_configs("fast_interp", {description = "Enable fast interpreter", default = false, type = "boolean"}) add_configs("aot", {description = "Enable AOT", default = false, type = "boolean"}) @@ -15,6 +22,9 @@ package("wasm-micro-runtime") add_configs("jit", {description = "Enable JIT", default = false, type = "boolean", readonly = true}) add_configs("fast_jit", {description = "Enable Fast JIT", default = false, type = "boolean", readonly = true}) add_configs("libc", {description = "Choose libc", default = "builtin", type = "string", values = {"builtin", "wasi", "uvwasi"}}) + add_configs("libc_builtin", {description = "Enable builtin libc", default = false, type = "boolean"}) + add_configs("libc_wasi", {description = "Enable wasi libc", default = false, type = "boolean"}) + add_configs("libc_uvwasi", {description = "Enable uvwasi libc", default = false, type = "boolean"}) add_configs("multi_module", {description = "Enable multiple modules", default = false, type = "boolean"}) add_configs("mini_loader", {description = "Enable wasm mini loader", default = false, type = "boolean"}) add_configs("wasi_threads", {description = "Enable wasi threads library", default = false, type = "boolean"}) @@ -22,28 +32,35 @@ package("wasm-micro-runtime") add_configs("ref_types", {description = "Enable reference types", default = false, type = "boolean"}) if is_plat("windows", "mingw") then - add_syslinks("ws2_32") + add_syslinks("ntdll", "ws2_32") elseif is_plat("linux", "bsd") then - add_syslinks("m", "pthread") + add_syslinks("m", "dl", "pthread") end add_deps("cmake") on_load(function (package) - if package:config("libc") == "uvwasi" then - package:add("deps", "uvwasi") + if package:is_plat("windows") and package:is_arch("x86") and winos.version():le("10.0.17763") then + package:add("patches", "1.3.2", path.join(os.scriptdir(), "patches", "ntapi.patch"), "436c3f6bbb536a362e277d654ef8dc74e0d757dd815de2d89209bd2a9ac2f114") + end + if package:config("libc_uvwasi") or package:config("libc") == "uvwasi" then + if package:is_plat("windows", "linux", "macosx") then + package:add("deps", "uvwasi") + else + raise("xrepo(uvwasi) only support windows/linux/macosx") + end end if package:config("jit", "fast_jit") then package:add("deps", "llvm") end end) - on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "android", function (package) - local configs = {} + on_install("windows", "linux", "macosx", "bsd", "android", function (package) + local configs = {"-DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - if package:is_plat("windows") and package:config("shared") then - table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") + if package:is_plat("windows") and (not package:config("shared")) then + package:add("defines", "COMPILING_WASM_RUNTIME_API=1") end table.insert(configs, "-DWAMR_BUILD_INTERP=" .. (package:config("interp") and "1" or "0")) @@ -52,9 +69,9 @@ package("wasm-micro-runtime") table.insert(configs, "-DWAMR_BUILD_JIT=" .. (package:config("jit") and "1" or "0")) table.insert(configs, "-DWAMR_BUILD_FAST_JIT=" .. (package:config("fast_jit") and "1" or "0")) - table.insert(configs, "-DWAMR_BUILD_LIBC_BUILTIN=" .. ((package:config("libc") == "builtin") and "1" or "0")) - table.insert(configs, "-DWAMR_BUILD_LIBC_WASI=" .. ((package:config("libc") == "wasi") and "1" or "0")) - table.insert(configs, "-DWAMR_BUILD_LIBC_UVWASI=" .. ((package:config("libc") == "uvwasi") and "1" or "0")) + table.insert(configs, "-DWAMR_BUILD_LIBC_BUILTIN=" .. ((package:config("libc_builtin") or package:config("libc") == "builtin" ) and "1" or "0")) + table.insert(configs, "-DWAMR_BUILD_LIBC_WASI=" .. ((package:config("libc_wasi") or package:config("libc") == "wasi" ) and "1" or "0")) + table.insert(configs, "-DWAMR_BUILD_LIBC_UVWASI=" .. ((package:config("libc_uvwasi") or package:config("libc") == "uvwasi" ) and "1" or "0")) table.insert(configs, "-DWAMR_BUILD_MULTI_MODULE=" .. (package:config("multi_module") and "1" or "0")) table.insert(configs, "-DWAMR_BUILD_MINI_LOADER=" .. (package:config("mini_loader") and "1" or "0")) @@ -62,28 +79,18 @@ package("wasm-micro-runtime") table.insert(configs, "-DWAMR_BUILD_SIMD=" .. (package:config("simd") and "1" or "0")) table.insert(configs, "-DWAMR_BUILD_REF_TYPES=" .. (package:config("ref_types") and "1" or "0")) - local plat - if package:is_plat("windows", "mingw") then - plat = "windows" - elseif package:is_plat("linux") then - plat = "linux" - elseif package:is_plat("macosx") then - plat = "darwin" - elseif package:is_plat("bsd") then - plat = "freebsd" - elseif package:is_plat("android") then - plat = "android" - elseif package:is_plat("iphoneos") then - plat = "ios" + local packagedeps + if package:config("libc_uvwasi") or package:config("libc") == "uvwasi" then + if package:is_plat("windows", "linux", "macosx") then + packagedeps = {"uvwasi", "libuv"} + end end - - os.cp("core/iwasm/include", package:installdir()) - os.cd("product-mini/platforms/" .. plat) - import("package.tools.cmake").install(package, configs) - - os.trymv(package:installdir("lib", "*.dll"), package:installdir("bin")) + if package:is_plat("android") then + table.insert(configs, "-DWAMR_BUILD_PLATFORM=android") + end + import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps}) end) on_test(function (package) - assert(package:has_cfuncs("wasm_engine_new", {includes = "wasm_c_api.h", {configs = {languages = "c99"}}})) + assert(package:has_cfuncs("wasm_engine_new", {includes = "wasm_c_api.h"})) end) diff --git a/packages/w/watcher/xmake.lua b/packages/w/watcher/xmake.lua new file mode 100644 index 000000000..9f6a5f62d --- /dev/null +++ b/packages/w/watcher/xmake.lua @@ -0,0 +1,30 @@ +package("watcher") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/e-dant/watcher") + set_description("Filesystem watcher. Works anywhere. Simple, efficient and friendly.") + set_license("MIT") + + set_urls("https://github.com/e-dant/watcher/archive/refs/tags/release/$(version).tar.gz", + "https://github.com/e-dant/watcher.git") + + add_versions("0.9.5", "41b74d138eec106c35a99e7544def599453a8bf4cf4887ad627e1c9e3355287c") + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + elseif is_plat("macosx") then + add_frameworks("CoreFoundation", "CoreServices") + end + + on_install("windows", "linux", "macosx", "mingw", "msys", "android", "cross", function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + auto cb = [](wtr::event const& ev) {}; + auto watcher = wtr::watch(".", cb); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/w/wavpack/xmake.lua b/packages/w/wavpack/xmake.lua index 3a6c19016..1c264776c 100644 --- a/packages/w/wavpack/xmake.lua +++ b/packages/w/wavpack/xmake.lua @@ -6,10 +6,11 @@ package("wavpack") add_urls("https://github.com/dbry/WavPack//archive/refs/tags/$(version).tar.gz", "https://github.com/dbry/WavPack.git") - add_versions("4.80.0", "c72cb0bbe6490b84881d61f326611487eedb570d8d2e74f073359578b08322e2") - add_versions("5.4.0", "abbe5ca3fc918fdd64ef216200a5c896243ea803a059a0662cd362d0fa827cd2") - add_versions("5.5.0", "b3d11ba35d12c7d2ed143036478b6f9f4bdac993d84b5ed92615bc6b60697b8a") + add_versions("5.7.0", "c5742ba1054d36ff3d22f0101a9be066f55f6becb9b2a7352c79fa362f2d3d76") add_versions("5.6.0", "44043e8ffe415548d5723e9f4fc6bda5e1f429189491c5fb3df08b8dcf28df72") + add_versions("5.5.0", "b3d11ba35d12c7d2ed143036478b6f9f4bdac993d84b5ed92615bc6b60697b8a") + add_versions("5.4.0", "abbe5ca3fc918fdd64ef216200a5c896243ea803a059a0662cd362d0fa827cd2") + add_versions("4.80.0", "c72cb0bbe6490b84881d61f326611487eedb570d8d2e74f073359578b08322e2") add_configs("legacy", {description = "Decode legacy (< 4.0) WavPack files", default = false, type = "boolean"}) add_configs("threads", {description = "Enable support for threading in libwavpack", default = true, type = "boolean"}) @@ -25,6 +26,16 @@ package("wavpack") end on_install("windows", "linux", "bsd", "macosx", "mingw", "android", "wasm", function (package) + if package:is_plat("android") and package:is_arch("armeabi-v7a") then + import("core.tool.toolchain") + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndk_sdkver = ndk:config("ndk_sdkver") + if tonumber(ndk_sdkver) < 24 then + -- cross compilation check failure, remove it + io.replace("CMakeLists.txt", "$<$:HAVE_FSEEKO>", "", {plain = true}) + end + end + local configs = {"-DWAVPACK_INSTALL_CMAKE_MODULE=OFF", "-DWAVPACK_INSTALL_DOCS=OFF", "-DWAVPACK_INSTALL_PKGCONFIG_MODULE=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) diff --git a/packages/w/wayland-protocols/rules/wayland_protocols.lua b/packages/w/wayland-protocols/rules/wayland_protocols.lua index 08dea7159..0b1da930f 100644 --- a/packages/w/wayland-protocols/rules/wayland_protocols.lua +++ b/packages/w/wayland-protocols/rules/wayland_protocols.lua @@ -1,8 +1,8 @@ --- Generate source files from wayland protocol files --- for example +-- Generate source files from wayland protocol files. +-- Example: --[[ if is_plat("linux") then - add_rules("wayland-protocols@wayland.protocols") + add_rules("@wayland-protocols/wayland.protocols") on_load(function(target) local pkg = target:pkg("wayland-protocols") local wayland_protocols_dir = path.join(target:pkg("wayland-protocols"):installdir() or "/usr", "share", "wayland-protocols") @@ -14,39 +14,64 @@ end) end ]] +-- Options: +--[[ + add_rules("@wayland-protocols/wayland.protocols", { + outputdir = "...", -- Path for generated files, default is `path.join(target:autogendir(), "rules", "wayland.protocols")` + client = "...", -- Path format for client protocol header files, default is `"%s.h"`, set to `false` to disable its generation + server = "...", -- Path format for server protocol header files, default is `nil` + code = "...", -- Path format for code files, default is `"%s.c"` + public = false, -- Visibility for headers and symbols in generated code, can be `false` or `true`, default is `false` + }) +]] + rule("wayland.protocols") set_extensions(".xml") - on_load(function(target) + on_config(function(target) + import("core.base.option") + + local rule_name = "@wayland-protocols/wayland.protocols" + if target:rule("c++.build") then local rule = target:rule("c++.build"):clone() - rule:add("deps", "wayland.protocols", {order = true}) + rule:add("deps", rule_name, {order = true}) target:rule_add(rule) end - end) - on_config(function(target) - import("core.base.option") + local public = target:extraconf("rules", rule_name, "public") - local outputdir = target:extraconf("rules", "wayland.protocols", "outputdir") or path.join(target:autogendir(), "rules", "wayland.protocols") + local outputdir = target:extraconf("rules", rule_name, "outputdir") or path.join(target:autogendir(), "rules", "wayland.protocols") if not os.isdir(outputdir) then os.mkdir(outputdir) end - target:add("includedirs", outputdir) + target:add("includedirs", outputdir, {public = public}) local dryrun = option.get("dry-run") - local sourcebatches = target:sourcebatches() - if not dryrun and sourcebatches["wayland.protocols"] and sourcebatches["wayland.protocols"].sourcefiles then - for _, protocol in ipairs(sourcebatches["wayland.protocols"].sourcefiles) do - local clientfile = path.join(outputdir, path.basename(protocol) .. ".h") - local privatefile = path.join(outputdir, path.basename(protocol) .. ".c") - - -- for c++ module dependency discovery - if not os.exists(clientfile) then + local sourcebatches = target:sourcebatches()[rule_name] + if not dryrun and sourcebatches and sourcebatches.sourcefiles then + local client = target:extraconf("rules", rule_name, "client") + if client == nil then + client = "%s.h" + end + local server = target:extraconf("rules", rule_name, "server") + for _, protocol in ipairs(sourcebatches.sourcefiles) do + local basename = path.basename(protocol) + + -- For C++ module dependency discovery + if client then + local clientfile = path.join(outputdir, client:format(basename)) os.touch(clientfile) end + if server then + local serverfile = path.join(outputdir, server:format(basename)) + os.touch(serverfile) + end - target:add("files", privatefile, {always_added = true}) + -- Add code file to target + local code = target:extraconf("rules", rule_name, "code") or "%s.c" + local codefile = path.join(outputdir, code:format(basename)) + target:add("files", codefile, {always_added = true}) end end end) @@ -54,27 +79,47 @@ rule("wayland.protocols") before_buildcmd_file(function(target, batchcmds, sourcefile, opt) import("lib.detect.find_tool") - local outputdir = target:extraconf("rules", "wayland.protocols", "outputdir") or path.join(target:autogendir(), "rules", "wayland.protocols") + local rule_name = "@wayland-protocols/wayland.protocols" + + local outputdir = target:extraconf("rules", rule_name, "outputdir") or path.join(target:autogendir(), "rules", "wayland.protocols") local wayland_scanner = find_tool("wayland-scanner") assert(wayland_scanner, "wayland-scanner not found! please install wayland package") - local clientfile = path.join(outputdir, path.basename(sourcefile) .. ".h") - local privatefile = path.join(outputdir, path.basename(sourcefile) .. ".c") + local basename = path.basename(sourcefile) - local client_flag = "client-header" - local private_flag = "private-code" + -- Generate client protocol header + local client = target:extraconf("rules", rule_name, "client") + if client == nil then + client = "%s.h" + end + if client then + local clientfile = path.join(outputdir, client:format(basename)) + local client_args = {"client-header", sourcefile, clientfile} + batchcmds:show_progress(opt.progress, "${color.build.object}generating.wayland.protocol.client %s", basename) + batchcmds:vexecv(wayland_scanner.program, client_args) + end - local client_flags = {client_flag, sourcefile, clientfile} - local private_flags = {private_flag, sourcefile, privatefile} + -- Generate server protocol header + local server = target:extraconf("rules", rule_name, "server") + if server then + local serverfile = path.join(outputdir, server:format(basename)) + local server_args = {"server-header", sourcefile, serverfile} + batchcmds:show_progress(opt.progress, "${color.build.object}generating.wayland.protocol.server %s", basename) + batchcmds:vexecv(wayland_scanner.program, server_args) + end - batchcmds:show_progress(opt.progress, "${color.build.object}generating.wayland.protocol.client %s", path.basename(sourcefile)) - batchcmds:vexecv(wayland_scanner.program, client_flags) + -- Generate code + local public = target:extraconf("rules", rule_name, "public") + local visibility = public and "public" or "private" - batchcmds:show_progress(opt.progress, "${color.build.object}generating.wayland.protocol.private %s", path.basename(sourcefile)) - batchcmds:vexecv(wayland_scanner.program, private_flags) + local code = target:extraconf("rules", rule_name, "code") or "%s.c" + local codefile = path.join(outputdir, code:format(basename)) + local code_args = {visibility .. "-code", sourcefile, codefile} + batchcmds:show_progress(opt.progress, "${color.build.object}generating.wayland.protocol.%s %s", visibility, basename) + batchcmds:vexecv(wayland_scanner.program, code_args) batchcmds:add_depfiles(sourcefile) - batchcmds:set_depmtime(os.mtime(privatefile)) - batchcmds:set_depcache(target:dependfile(privatefile)) + batchcmds:set_depmtime(os.mtime(codefile)) + batchcmds:set_depcache(target:dependfile(codefile)) end) diff --git a/packages/w/wayland-protocols/xmake.lua b/packages/w/wayland-protocols/xmake.lua index 05a5a40fd..ede18886c 100644 --- a/packages/w/wayland-protocols/xmake.lua +++ b/packages/w/wayland-protocols/xmake.lua @@ -3,18 +3,26 @@ package("wayland-protocols") set_description("Additional Wayland protocols") set_license("MIT") - set_urls("https://wayland.freedesktop.org/releases/wayland-protocols-$(version).tar.xz") + add_urls("https://wayland.freedesktop.org/releases/wayland-protocols-$(version).tar.xz") + add_urls("https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/$(version)/downloads/wayland-protocols-$(version).tar.xz") add_versions("1.24", "bff0d8cffeeceb35159d6f4aa6bab18c807b80642c9d50f66cba52ecf7338bc2") + add_versions("1.25", "f1ff0f7199d0a0da337217dd8c99979967808dc37731a1e759e822b75b571460") + add_versions("1.26", "c553384c1c68afd762fa537a2569cc9074fe7600da12d3472761e77a2ba56f13") + add_versions("1.27", "9046f10a425d4e2a00965a03acfb6b3fb575a56503ac72c2b86821c69653375c") + add_versions("1.28", "c7659fb6bf14905e68ef605f898de60d1c066bf66dbea92798573dddec1535b6") + add_versions("1.29", "e25e9ab75ac736704ddefe92e8f9ac8730beab6f564db62f7ad695bba4ff9ed8") + add_versions("1.30", "3c1498fb65fd2b80b0376d7e87cf215e6ae957b2ccdba5da45a448718831bc60") + add_versions("1.31", "a07fa722ed87676ec020d867714bc9a2f24c464da73912f39706eeef5219e238") + add_versions("1.32", "7459799d340c8296b695ef857c07ddef24c5a09b09ab6a74f7b92640d2b1ba11") add_deps("meson", "ninja", "wayland", "pkg-config") if is_plat("linux") then - add_extsources("pacman::wayland-protocols") + add_extsources("apt::wayland-protocols", "pacman::wayland-protocols") end on_install("linux", function (package) - local configs = {} - table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + local configs = {"-Dtests=false"} import("package.tools.meson").install(package, configs) end) diff --git a/packages/w/webdriverxx/patches/2023.04.22/fix_cxx23.patch b/packages/w/webdriverxx/patches/2023.04.22/fix_cxx23.patch new file mode 100644 index 000000000..327fd5045 --- /dev/null +++ b/packages/w/webdriverxx/patches/2023.04.22/fix_cxx23.patch @@ -0,0 +1,13 @@ +diff --git a/include/webdriverxx/by.h b/include/webdriverxx/by.h +index 0ee2a1b..3f5b44e 100644 +--- a/include/webdriverxx/by.h ++++ b/include/webdriverxx/by.h +@@ -8,7 +8,7 @@ namespace webdriverxx { + + class By { // copyable + public: +- By() : strategy_("css selector"), value_(nullptr) {} ++ By() : strategy_("css selector"), value_("") {} + + By(const std::string& strategy, const std::string& value) + : strategy_(strategy) diff --git a/packages/w/webdriverxx/patches/2023.04.22/picojson.patch b/packages/w/webdriverxx/patches/2023.04.22/picojson.patch new file mode 100644 index 000000000..0d9eb80e6 --- /dev/null +++ b/packages/w/webdriverxx/patches/2023.04.22/picojson.patch @@ -0,0 +1,91 @@ +diff --git a/include/webdriverxx/capabilities.h b/include/webdriverxx/capabilities.h +index ca5cb64..052ad27 100644 +--- a/include/webdriverxx/capabilities.h ++++ b/include/webdriverxx/capabilities.h +@@ -2,7 +2,7 @@ + #define WEBDRIVERXX_CAPABILITIES_H + + #include "conversions.h" +-#include "picojson.h" ++#include + #include + + namespace webdriverxx { +diff --git a/include/webdriverxx/client.h b/include/webdriverxx/client.h +index 5548438..d4b6a3e 100644 +--- a/include/webdriverxx/client.h ++++ b/include/webdriverxx/client.h +@@ -5,7 +5,7 @@ + #include "capabilities.h" + #include "detail/resource.h" + #include "detail/http_connection.h" +-#include "picojson.h" ++#include + #include + #include + +diff --git a/include/webdriverxx/conversions.h b/include/webdriverxx/conversions.h +index 8374073..510b5a0 100644 +--- a/include/webdriverxx/conversions.h ++++ b/include/webdriverxx/conversions.h +@@ -4,7 +4,7 @@ + #include "types.h" + #include "detail/error_handling.h" + #include "detail/meta_tools.h" +-#include "picojson.h" ++#include + #include + + namespace webdriverxx { +diff --git a/include/webdriverxx/detail/resource.h b/include/webdriverxx/detail/resource.h +index 26e3ed6..185c5e0 100644 +--- a/include/webdriverxx/detail/resource.h ++++ b/include/webdriverxx/detail/resource.h +@@ -6,7 +6,7 @@ + #include "shared.h" + #include "../conversions.h" + #include "../response_status_code.h" +-#include "../picojson.h" ++#include + + namespace webdriverxx { + namespace detail { +diff --git a/include/webdriverxx/detail/types.h b/include/webdriverxx/detail/types.h +index f218900..fcbe4e9 100644 +--- a/include/webdriverxx/detail/types.h ++++ b/include/webdriverxx/detail/types.h +@@ -3,7 +3,7 @@ + + #include "../conversions.h" + #include "../capabilities.h" +-#include "../picojson.h" ++#include + #include + + #define CXX17_2X ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) +diff --git a/include/webdriverxx/js_args.h b/include/webdriverxx/js_args.h +index 0944f28..6e90c94 100644 +--- a/include/webdriverxx/js_args.h ++++ b/include/webdriverxx/js_args.h +@@ -2,7 +2,7 @@ + #define WEBDRIVERXX_JS_ARGS_H + + #include "conversions.h" +-#include "picojson.h" ++#include + + namespace webdriverxx { + +diff --git a/include/webdriverxx/session.h b/include/webdriverxx/session.h +index ee5410d..24f4cd5 100644 +--- a/include/webdriverxx/session.h ++++ b/include/webdriverxx/session.h +@@ -12,7 +12,7 @@ + #include "detail/keyboard.h" + #include "detail/shared.h" + #include "detail/factories_impl.h" +-#include "picojson.h" ++#include + #include "utils/picobase64.h" + #include + #include diff --git a/packages/w/webdriverxx/xmake.lua b/packages/w/webdriverxx/xmake.lua new file mode 100644 index 000000000..386f8482a --- /dev/null +++ b/packages/w/webdriverxx/xmake.lua @@ -0,0 +1,29 @@ +package("webdriverxx") + set_kind("library", {headeronly = true}) + set_homepage("https://GermanAizek.github.io/webdriverxx") + set_description("A C++ client library for Selenium Webdriver") + set_license("MIT") + + add_urls("https://github.com/GermanAizek/webdriverxx.git", {submodules = false}) + add_versions("2023.04.22", "b8c9ac36360021daca7b0fd006a092b605b19e29") + + add_patches("2023.04.22", "patches/2023.04.22/picojson.patch", "11e23fe37c7e3b8ec174642542567c9d6bae3657892f5d7ac8203cbb89c9112c") + add_patches("2023.04.22", "patches/2023.04.22/fix_cxx23.patch", "da63a9b134ba78cb17b099486b83d2bc846c9786590265eb4e31f88a9911aeab") + + add_deps("libcurl", "picojson") + + on_install("!bsd and !wasm", function (package) + os.rm("include/webdriverxx/picojson.h") + os.cp("include/webdriverxx.h", package:installdir("include")) + os.cp("include/webdriverxx", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + using namespace webdriverxx; + void test() { + WebDriver chrome = Start(Chrome()); + } + ]]}, {configs = {languages = "c++17"}})) + end) diff --git a/packages/w/webui/xmake.lua b/packages/w/webui/xmake.lua index af3653a50..eae932518 100644 --- a/packages/w/webui/xmake.lua +++ b/packages/w/webui/xmake.lua @@ -1,21 +1,32 @@ package("webui") - set_homepage("https://webui.me") set_description("Use any web browser as GUI, with your preferred language in the backend and HTML5 in the frontend, all in a lightweight portable lib.") set_license("MIT") set_urls("https://github.com/webui-dev/webui/archive/refs/tags/$(version).tar.gz", "https://github.com/webui-dev/webui.git") + + add_versions("2.4.2", "c51967bbab472655d04e28ce1668ee4adda1f320e05f98c14f071b2cdf61228b") add_versions("2.3.0", "14be57405b12cf434daade2310178534240866e3169c7213a6fa0e4a6c6f9f27") if is_plat("windows") then - add_syslinks("user32", "advapi32") + add_syslinks("user32", "advapi32", "shell32") elseif is_plat("mingw") then add_syslinks("ws2_32") end on_install("windows", "linux", "macosx", "mingw", "msys", "android", "cross", function (package) - local configs = {} + if package:is_plat("android") and package:is_arch("armeabi-v7a") then + import("core.tool.toolchain") + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndk_sdkver = ndk:config("ndk_sdkver") + if tonumber(ndk_sdkver) < 24 then + -- https://github.com/marzer/tomlplusplus/pull/205 + io.replace("src/civetweb/civetweb.c", "ftello", "ftell", {plain = true}) + io.replace("src/civetweb/civetweb.c", "fseeko", "fseek", {plain = true}) + end + end + io.writefile("xmake.lua", [[ add_rules("mode.debug", "mode.release") target("webui") @@ -25,15 +36,12 @@ package("webui") add_headerfiles("include/webui.h", "include/webui.hpp") add_includedirs("include", "src/civetweb") if is_plat("windows") then - add_syslinks("user32", "advapi32") + add_syslinks("user32", "advapi32", "shell32") elseif is_plat("mingw") then add_syslinks("ws2_32") end ]]) - if package:config("shared") then - configs.kind = "shared" - end - import("package.tools.xmake").install(package, configs) + import("package.tools.xmake").install(package) end) on_test(function (package) @@ -44,5 +52,5 @@ package("webui") webui_show(my_window, "Hello"); webui_wait(); } - ]]})) + ]]}, {configs = {languages = "c++17"}})) end) diff --git a/packages/w/wfrest/xmake.lua b/packages/w/wfrest/xmake.lua index 569ad9771..5ee88a215 100644 --- a/packages/w/wfrest/xmake.lua +++ b/packages/w/wfrest/xmake.lua @@ -1,12 +1,15 @@ package("wfrest") set_homepage("https://github.com/wfrest/wfrest") - set_description("wfrest: C++ Web Framework REST API") + set_description("C++ Web Framework REST API") set_license("Apache-2.0") add_urls("https://github.com/wfrest/wfrest/archive/refs/tags/$(version).tar.gz", "https://github.com/wfrest/wfrest.git") add_versions("v0.9.3", "1bd0047484e81e23c7a8ab7ba41634109169c37d80aeb2c480728214db42878e") + add_versions("v0.9.4", "1f8811e90e6c89af91db04cab0c37dc86cf4777f4f4713d6003ac0ec1a2471a9") + add_versions("v0.9.5", "46e4957a5c00c95c85979bbc41807b4c4f2aacc11c43e123039ce440ebecab84") + add_versions("v0.9.6", "8199e79d8703ad7e8b3c6e546395fb8f0adc302ca1d02b654fd91edb31416854") add_deps("openssl", "workflow", "zlib") diff --git a/packages/w/wgpu-native/xmake.lua b/packages/w/wgpu-native/xmake.lua index 846531020..a12756096 100644 --- a/packages/w/wgpu-native/xmake.lua +++ b/packages/w/wgpu-native/xmake.lua @@ -5,18 +5,29 @@ package("wgpu-native") if is_plat("windows") and is_arch("x64") then add_urls("https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-windows-x86_64-release.zip", {version = function(version) return version:gsub("%+", ".") end}) + add_versions("v0.19.4+1", "9e1591d60c2d2ee20d6d4a63bc01c7c5eecf7734761673160aa639e550a1ba4d") add_versions("v0.17.0+2", "1b8ae05bb7626e037ab7088f9f11fc8bb8341a32800d33857c09ff2fb1b3893f") elseif is_plat("windows") and is_arch("x86") then add_urls("https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-windows-i686-release.zip", {version = function(version) return version:gsub("%+", ".") end}) + add_versions("v0.19.4+1", "6bd7d57d132282adf46150e7fb176d86fe6ffd10aa833ad2e70d9dfbe17700df") add_versions("v0.17.0+2", "098037ca18c1a3fbf25f061f822762d5eab1cd4ecf8e7d039f9ccbd357322a54") elseif is_plat("linux") and is_arch("x86_64") then add_urls("https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-linux-x86_64-release.zip", {version = function(version) return version:gsub("%+", ".") end}) + add_versions("v0.19.4+1", "7d73bd7af2be60b632e5ab814996acb381d1b459975d6629f91c468049c8866a") add_versions("v0.17.0+2", "2bfebb48072cafee316fcec452d49d02aa46d7096325097e637c3c2e784eca5b") + elseif is_plat("linux") and is_arch("arm64-v8a") then + add_urls("https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-linux-x86_64-release.zip", {version = function(version) return version:gsub("%+", ".") end}) + add_versions("v0.19.4+1", "6e53aa3f0aec4b2b65cb0d7635000cf39bddd672bcb6138a593bf8cb8134f621") elseif is_plat("macosx") and is_arch("x86_64") then add_urls("https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-macos-x86_64-release.zip", {version = function(version) return version:gsub("%+", ".") end}) + add_versions("v0.19.4+1", "e41a35bf4f2b1c7dd87092cfcb932b7a96118971129a6213b7be240deb07e614") add_versions("v0.17.0+2", "749683e616659b5fa9a42151b7b71c2308e114c0322df78975d486aaf43650e9") elseif is_plat("macosx") and is_arch("arm64") then - add_urls("https://github.com/gfx-rs/wgpu-native/releases/download/$(version)/wgpu-macos-arm64-release.zip", {version = function(version) return version:gsub("%+", ".") end}) + add_urls("https://github.com/gfx-rs/wgpu-native/releases/download/$(version).zip", {version = function(version) + local arch = version:ge("v0.18.1+3") and "aarch64" or "arm64" + return version:gsub("%+", ".") .. "/wgpu-macos-" .. arch .. "-release" + end}) + add_versions("v0.19.4+1", "21cf8e69a4a775ea63f437f170a93e371df0f72c83119c81c25a668611c1771d") add_versions("v0.17.0+2", "9af5dadcd05fa8d47d37cf171abae65c7d813123d0a60f0b50392da381279d04") end @@ -28,7 +39,13 @@ package("wgpu-native") on_load("windows", function (package) if not package:config("shared") then - package:add("syslinks", "Advapi32", "bcrypt", "d3dcompiler", "NtDll", "User32", "Userenv", "WS2_32") + package:add("syslinks", "Advapi32", "bcrypt", "d3dcompiler", "NtDll", "User32", "Userenv", "WS2_32", "Gdi32", "Opengl32") + end + end) + + on_load("linux", function (package) + if not package:config("shared") then + package:add("syslinks", "dl", "pthread") end end) @@ -39,7 +56,7 @@ package("wgpu-native") end end) - on_install("windows|x64", "windows|x86", "linux|x86_64", "macosx|x86_64", "macosx|arm64", function (package) + on_install("windows|x64", "windows|x86", "linux|arm64-v8a", "linux|x86_64", "macosx|x86_64", "macosx|arm64", function (package) os.cp("*.h", package:installdir("include", "webgpu")) if package:is_plat("windows") then if package:config("shared") then diff --git a/packages/w/which/xmake.lua b/packages/w/which/xmake.lua index 398f9751a..eb4cbd4cd 100644 --- a/packages/w/which/xmake.lua +++ b/packages/w/which/xmake.lua @@ -4,7 +4,8 @@ package("which") set_homepage("https://www.gnu.org/software/which/") set_description("shows the full path of (shell) commands") - add_urls("https://ftp.gnu.org/gnu/which/which-$(version).tar.gz", + add_urls("https://ftpmirror.gnu.org/gnu/which/which-$(version).tar.gz", + "https://ftp.gnu.org/gnu/which/which-$(version).tar.gz", "https://carlowood.github.io/which/which-$(version).tar.gz", "https://mirrors.ustc.edu.cn/gnu/which/which-$(version).tar.gz") add_versions("2.16", "0ac8502e9985a3ac6b0e2aa4f2a60f91cad0dc0cca6dc9c1c142ebba4b8dd664") diff --git a/packages/w/whisper.cpp/xmake.lua b/packages/w/whisper.cpp/xmake.lua index 703bc8dbc..b8a20fc3f 100644 --- a/packages/w/whisper.cpp/xmake.lua +++ b/packages/w/whisper.cpp/xmake.lua @@ -6,6 +6,10 @@ package("whisper.cpp") set_urls("https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v$(version).tar.gz", "https://github.com/ggerganov/whisper.cpp.git") + add_versions("1.6.2", "da7988072022acc3cfa61b370b3c51baad017f1900c3dc4e68cb276499f66894") + add_versions("1.6.0", "2729a83662edf909dad66115a3b616c27011cbe4c05335656034954c91ba0c92") + add_versions("1.5.5", "27fa5c472657af2a6cee63de349a34b23d0f3781fa9b8ef301a940cf64964a79") + add_versions("1.5.4", "06eed84de310fdf5408527e41e863ac3b80b8603576ba0521177464b1b341a3a") add_versions("1.4.2", "1b988dcc77fca55f188dbc4e472f971a80854c1d44309cf3eaab9d5677f175e1") add_patches("1.4.2", path.join(os.scriptdir(), "patches", "1.4.2", "fix.patch"), "1330bdbb769aad37f0de6998ac9b0107423ec62385bbfb0a89a98c226daace48") @@ -45,6 +49,9 @@ package("whisper.cpp") table.insert(configs, "-DWHISPER_PERF=" .. (package:config("perf") and "ON" or "OFF")) table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("mingw") then + table.insert(configs, "-DCMAKE_SYSTEM_PROCESSOR=" .. package:arch()) + end import("package.tools.cmake").install(package, configs) end) diff --git a/packages/w/wigxjpf/xmake.lua b/packages/w/wigxjpf/xmake.lua new file mode 100644 index 000000000..32961c087 --- /dev/null +++ b/packages/w/wigxjpf/xmake.lua @@ -0,0 +1,25 @@ +package("wigxjpf") + set_homepage("https://fy.chalmers.se/subatom/wigxjpf/") + set_description("WIGXJPF evaluates Wigner 3j, 6j and 9j symbols accurately using prime factorisation and multi-word integer arithmetic.") + set_license("GPL-3.0", "LGPL-3.0") + + set_urls("https://fy.chalmers.se/subatom/wigxjpf/wigxjpf-$(version).tar.gz") + add_versions("1.13", "90ab9bfd495978ad1fdcbb436e274d6f4586184ae290b99920e5c978d64b3e6a") + + on_install("linux", "macosx", function (package) + local configs = {} + if package:config("shared") then + table.insert(configs, "shared") + end + import("package.tools.make").build(package, configs) + os.cp("inc/*.h", package:installdir("include")) + if package:config("shared") then + os.cp("lib/*.so", package:installdir("lib")) + else + os.cp("lib/*.a", package:installdir("lib")) + end + end) + + on_test(function (package) + assert(package:has_cfuncs("wig3jj", {includes = "wigxjpf.h"})) + end) diff --git a/packages/w/wil/xmake.lua b/packages/w/wil/xmake.lua index 5323a53b7..eafad1ff3 100644 --- a/packages/w/wil/xmake.lua +++ b/packages/w/wil/xmake.lua @@ -6,6 +6,7 @@ package("wil") add_urls("https://github.com/microsoft/wil.git") add_versions("2022.09.16", "5f4caba4e7a9017816e47becdd918fcc872039ba") + add_versions("2023.12.16", "572b8728926eb9c8fc55572bb4b84bb92dabd79d") on_install("windows", function (package) os.cp("include", package:installdir()) diff --git a/packages/w/wingetopt/xmake.lua b/packages/w/wingetopt/xmake.lua new file mode 100644 index 000000000..4e36f57cf --- /dev/null +++ b/packages/w/wingetopt/xmake.lua @@ -0,0 +1,19 @@ +package("wingetopt") + set_homepage("https://github.com/alex85k/wingetopt") + set_description("getopt library for Windows compilers") + + add_urls("https://github.com/alex85k/wingetopt.git") + add_versions("2023.10.29", "e8531ed21b44f5a723c1dd700701b2a58ce3ea01") + + add_deps("cmake") + + on_install("windows", "mingw", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("getopt", {includes = "getopt.h"})) + end) diff --git a/packages/w/winreg/xmake.lua b/packages/w/winreg/xmake.lua index 727761374..014113c50 100644 --- a/packages/w/winreg/xmake.lua +++ b/packages/w/winreg/xmake.lua @@ -7,6 +7,7 @@ package("winreg") add_urls("https://github.com/GiovanniDicanio/WinReg/archive/refs/tags/$(version).tar.gz", "https://github.com/GiovanniDicanio/WinReg.git") + add_versions("v6.2.0", "9dc1b287fb8c765a35791bf0deea0da81e52a969827bc2d8777f54f26ade588d") add_versions("v6.1.0", "d4118ccfd4f4edee29e0f6b3706979791ad537278e2f74818c150bb66f8fcc53") on_install("windows", "mingw", "msys", function (package) diff --git a/packages/w/wintoast/xmake.lua b/packages/w/wintoast/xmake.lua new file mode 100644 index 000000000..854c3baa3 --- /dev/null +++ b/packages/w/wintoast/xmake.lua @@ -0,0 +1,40 @@ +package("wintoast") + set_homepage("https://github.com/mohabouje/WinToast") + set_description("WinToast is a lightly library written in C++ which brings a complete integration of the modern toast notifications of Windows 8, Windows 10 and Windows 11.") + set_license("MIT") + + add_urls("https://github.com/mohabouje/WinToast/archive/refs/tags/$(version).tar.gz", + "https://github.com/mohabouje/WinToast.git") + add_versions("v1.3.0", "998bd82fb2f49ee4b0df98774424d72c2bc18225188f251a9242af28bb80e6d4") + + on_install("windows", function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + set_languages("c++11") + target("wintoast") + set_kind("$(kind)") + add_headerfiles("include/(wintoastlib.h)") + add_files("src/wintoastlib.cpp") + add_includedirs("include") + if not is_mode("debug") then + add_defines("NDEBUG") + end + ]]) + local configs = {} + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include "wintoastlib.h" + using namespace WinToastLib; + void test() { + if (WinToast::isCompatible()) { + WinToastTemplate templ = WinToastTemplate(WinToastTemplate::Text01); + templ.setTextField(L"Hello World", WinToastTemplate::FirstLine); + } else { + std::cout << "Error, your system in not supported!" << std::endl; + } + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/w/wixtoolset/xmake.lua b/packages/w/wixtoolset/xmake.lua new file mode 100644 index 000000000..1e05b8504 --- /dev/null +++ b/packages/w/wixtoolset/xmake.lua @@ -0,0 +1,29 @@ +package("wixtoolset") + set_kind("binary") + set_homepage("https://wixtoolset.org/") + set_description("The most powerful set of tools available to create your Windows installation experience.") + + set_urls("https://www.nuget.org/api/v2/package/wix/$(version)/#wix-$(version).zip") + + add_versions("5.0.0", "e8243606c71fa5bc2e0eb14d6005f42f1282b61540fb224b0004de563a81f74d") + add_resources("5.0.0", "ui", "https://www.nuget.org/api/v2/package/WixToolset.UI.wixext/5.0.0/#ui-5.0.0.zip", "fd0ccff8bf56eeb5fe306f3ad09eb74ba9546186f51d9d065f75dfc28310aa9d") + + on_load(function (package) + package:addenv("WIX_EXTENSIONS", "bin") + package:mark_as_pathenv("WIX_EXTENSIONS") + end) + + on_install("windows", function (package) + import("lib.detect.find_file") + import("lib.detect.find_directory") + local wix_folder = path.directory(find_file("wix.exe", "tools/**")) + os.cp(path.join(wix_folder, "/**"), package:installdir("bin")) + + local version = package:version():rawstr() + local ui_folder = path.join(package:installdir("bin"), ".wix", "extensions", "WixToolset.UI.wixext", version) + os.cp(path.join(package:resourcedir("ui")), ui_folder) + end) + + on_test(function(package) + os.vrunv("wix", {"--version"}) + end) diff --git a/packages/w/wolfssl/xmake.lua b/packages/w/wolfssl/xmake.lua index 376ccb6a8..cc4b99c47 100644 --- a/packages/w/wolfssl/xmake.lua +++ b/packages/w/wolfssl/xmake.lua @@ -6,6 +6,9 @@ package("wolfssl") add_urls("https://github.com/wolfSSL/wolfssl/archive/refs/tags/v$(version)-stable.tar.gz", "https://github.com/wolfSSL/wolfssl.git") + add_versions("5.6.6", "3d2ca672d41c2c2fa667885a80d6fa03c3e91f0f4f72f87aef2bc947e8c87237") + add_versions("5.6.4", "031691906794ff45e1e792561cf31759f5d29ac74936bc8dffb8b14f16d820b4") + add_versions("5.6.3", "2e74a397fa797c2902d7467d500de904907666afb4ff80f6464f6efd5afb114a") add_versions("5.6.2", "eb252f6ca8d8dcc2a05926dfafbc42250fea78e5e07b4689c3fc26ad69d2dd73") add_versions("5.3.0", "1a3bb310dc01d3e73d9ad91b6ea8249d081016f8eef4ae8f21d3421f91ef1de9") diff --git a/packages/w/workflow/xmake.lua b/packages/w/workflow/xmake.lua index 5c69c1850..60a0e8229 100644 --- a/packages/w/workflow/xmake.lua +++ b/packages/w/workflow/xmake.lua @@ -1,18 +1,32 @@ package("workflow") set_homepage("https://github.com/sogou/workflow") - set_description("C++ Parallel Computing and Asynchronous Networking Engine") + set_description("C++ Parallel Computing and Asynchronous Networking Framework") set_license("Apache-2.0") - add_urls("https://github.com/sogou/workflow/archive/refs/tags/$(version).tar.gz", - "https://github.com/sogou/workflow.git") - - add_versions("v0.10.6", "5701ef31518a7927e61b26cd6cc1d699cb43393bf1ffc77fa61e73e64d2dd28e") - add_versions("v0.10.7", "aa9806983f32174597549db4a129e2ee8a3d1f005923fcbb924906bc70c0e123") - add_versions("v0.10.8", "bb5654e8011822d4251a7a433cbe4c5ecfd2c65c8f997a8196685742d24bcaf0") - add_versions("v0.10.9", "10f695aeb5da87ae138e3bcd2fa10c18aac782b0da20f11b2fd0b7b091d06767") + if is_plat("windows") then + add_urls("https://github.com/sogou/workflow/archive/refs/tags/$(version)-win.zip") + add_versions("v0.10.10", "6758b1d46c4beadfccc88d3e9492bb99cfad26e643c141749aec790907092417") + else + add_urls("https://github.com/sogou/workflow/archive/refs/tags/$(version).tar.gz", + "https://github.com/sogou/workflow.git") + + add_versions("v0.10.6", "5701ef31518a7927e61b26cd6cc1d699cb43393bf1ffc77fa61e73e64d2dd28e") + add_versions("v0.10.7", "aa9806983f32174597549db4a129e2ee8a3d1f005923fcbb924906bc70c0e123") + add_versions("v0.10.8", "bb5654e8011822d4251a7a433cbe4c5ecfd2c65c8f997a8196685742d24bcaf0") + add_versions("v0.10.9", "10f695aeb5da87ae138e3bcd2fa10c18aac782b0da20f11b2fd0b7b091d06767") + add_versions("v0.11.1", "06968ed4e43f6676811b620d09eb5c32ac57252305e7e28def6efde8ef1ceb19") + add_versions("v0.11.2", "cc2d18ab2b292e2f0163ef67ef6976912e2a21c271396da0e2151ca8cd22abd3") + add_versions("v0.11.3", "af7adcdd8151f8e72247599a43c28aa849d61ed39e58058cfa80649d011575bc") + add_versions("v0.11.4", "844fd03db120141fa61600b26a4ef35716dc0e75d1e8c8018078eb385cf746a4") + end add_deps("openssl") + if is_plat("windows") then + add_deps("cmake") + add_syslinks("Mswsock") + end + if is_plat("linux") then add_syslinks("pthread", "dl") end @@ -25,6 +39,13 @@ package("workflow") import("package.tools.xmake").install(package, configs) end) + on_install("windows", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + on_test(function (package) assert(package:check_cxxsnippets({test = [[ #include diff --git a/packages/w/wxwidgets/xmake.lua b/packages/w/wxwidgets/xmake.lua index e15d0ac21..70db80ef4 100644 --- a/packages/w/wxwidgets/xmake.lua +++ b/packages/w/wxwidgets/xmake.lua @@ -13,6 +13,14 @@ package("wxwidgets") add_resources("3.2.2", "releaseDLL", "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.2/wxMSW-3.2.2_vc14x_x64_ReleaseDLL.7z", "34e11c8d493e4f2856441942a88296864243db320e3f9057633d50b89a4f2848") + add_versions("3.2.3", "b8a6be72378d9947e303d7075a58c9bbc161d5debd25a187b654373b4d204873") + add_resources("3.2.3", "releaseDLL", + "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.3/wxMSW-3.2.3_vc14x_x64_ReleaseDLL.7z", + "ee0fde533b7ac8eac6ec112da2e3a488675aa8c1dda483eb8a9a2d4f8e5bb734") + add_versions("3.2.4", "b8be152f08031aed2bfeffd17d8409209c38667859094b319818e08f7a4ad065") + add_resources("3.2.4", "releaseDLL", + "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxMSW-3.2.4_vc14x_x64_ReleaseDLL.7z", + "0f9108e64f98978580fee2d4b3a53451ab4333e4b47dde45b82e7867d0bbfc2c") else add_urls("https://github.com/wxWidgets/wxWidgets/releases/download/v$(version)/wxMSW-$(version)_vc14x_Dev.7z") add_versions("3.2.0", "0cd2387edcf1f26924d59efcc3ea4c8a00783ee01bf396756dabdd7967e4b37b") @@ -23,6 +31,14 @@ package("wxwidgets") add_resources("3.2.2", "releaseDLL", "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.2/wxMSW-3.2.2_vc14x_ReleaseDLL.7z", "1a8d387fae963d2242b0fc628699d34bb6141751fb05dec8fa9c0e2784833426") + add_versions("3.2.3", "8961f24abb16362a542140912f3c6cb75b8f95111816311ecf5b00ea1e0c55f3") + add_resources("3.2.3", "releaseDLL", + "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.3/wxMSW-3.2.3_vc14x_ReleaseDLL.7z", + "b1b22d43509c2e1fe427d038210076dcb1d9953e5fef09ffa04e49f49c78a9a7") + add_versions("3.2.4", "efa6bf76d42373e7930af18a176e5e52fbdd43f5da41b9bf6cd3b347d820f8b7") + add_resources("3.2.4", "releaseDLL", + "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxMSW-3.2.4_vc14x_ReleaseDLL.7z", + "240308cb9ffb718ab2f1298238c6e6aea7708cb16aca5801a03bffee6f9ef673") end add_resources("3.2.0", "headers", "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.0/wxWidgets-3.2.0-headers.7z", @@ -30,6 +46,12 @@ package("wxwidgets") add_resources("3.2.2", "headers", "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.2/wxWidgets-3.2.2-headers.7z", "affad097f2c274f796bf08494c1624d999d75727e73959bce5a3d366aeebc721") + add_resources("3.2.3", "headers", + "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.3/wxWidgets-3.2.3-headers.7z", + "a610f1a044b93f4d8d5439c67fc42b3feb168d854bc4725aa2b5ff4569d89a06") + add_resources("3.2.4", "headers", + "https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxWidgets-3.2.4-headers.7z", + "b8c4fd1a62c104c65089a088670d80e827b3893b7425c1cab8d7e49879797326") add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MD", readonly = true}) @@ -39,12 +61,13 @@ package("wxwidgets") "https://github.com/wxWidgets/wxWidgets.git") add_versions("v3.2.0", "43480e3887f32924246eb439520a3a2bc04d7947712de1ea0590c5b58dedadd9") add_versions("v3.2.2", "2a4ec4d1af3f22fbfd0a40b051385a5d82628d9f28bae8427f5c30d72bdaade7") + add_versions("v3.2.3", "0eb9499c06778c6746dbd4aee2a124f1995a5db331e282d15237b0046c1788af") + add_versions("v3.2.4", "b358b7f59f5b7cb934265120d114e5fd510a8b40802d00a111a85911eb5100d1") add_deps("cmake") add_deps("libjpeg", "libpng", "nanosvg", "expat", "zlib") if is_plat("linux") then - add_deps("libx11", "libxext", "libxtst") - add_deps("gtk+3", "opengl", {optional = true}) + add_deps("gtk+3", "opengl") end end @@ -55,6 +78,7 @@ package("wxwidgets") elseif is_plat("linux") then add_defines("__WXGTK3__", "__WXGTK__") add_syslinks("pthread", "m", "dl") + add_syslinks("X11", "Xext", "Xtst", "xkbcommon") elseif is_plat("windows") then add_defines("WXUSINGDLL", "__WXMSW__", "wxSUFFIX=u", "wxMSVC_VERSION=14x") add_links( @@ -117,17 +141,31 @@ package("wxwidgets") table.insert(configs, "-DwxBUILD_DEBUG_LEVEL=2") end table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:is_plat("linux") then + local libgtk3 = package:dep("gtk+3"):fetch() + if libgtk3 then + table.insert(configs, "-DGTK3_INCLUDE_DIRS=" .. table.concat(libgtk3.sysincludedirs, ";")) + table.insert(configs, "-DGTK3_LIBRARIES=" .. table.concat(libgtk3.links, ";")) + end + end import("package.tools.cmake").install(package, configs) local version = package:version() local subdir = "wx-" .. version:major() .. "." .. version:minor() local setupdir = package:is_plat("macosx") and "osx" or "gtk" os.cp(path.join(package:installdir("include", subdir, "wx", setupdir, "setup.h")), path.join(package:installdir("include", subdir, "wx"))) + local lib_suffix = version:major() .. "." .. version:minor() + if package:is_plat("linux") then + package:add("links", "wx_gtk3u_xrc-" .. lib_suffix, "wx_gtk3u_html-" .. lib_suffix, "wx_gtk3u_qa-" .. lib_suffix, "wx_gtk3u_core-" .. lib_suffix, "wx_baseu_xml-" .. lib_suffix, "wx_baseu_net-" .. lib_suffix, "wx_baseu-" .. lib_suffix) + end end) on_test(function (package) assert(package:check_cxxsnippets({test = [[ - #include "wx/wx.h" + #include + #ifndef WX_PRECOMP + #include + #endif #include "wx/app.h" #include "wx/cmdline.h" void test() { diff --git a/packages/w/wyhash/xmake.lua b/packages/w/wyhash/xmake.lua new file mode 100644 index 000000000..2770bd962 --- /dev/null +++ b/packages/w/wyhash/xmake.lua @@ -0,0 +1,17 @@ +package("wyhash") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/wangyi-fudan/wyhash") + set_description("The FASTEST QUALITY hash function, random number generators (PRNG) and hash map.") + set_license("Unlicense") + + add_urls("https://github.com/wangyi-fudan/wyhash.git") + add_versions("2023.04.10", "77e50f267fbc7b8e2d09f2d455219adb70ad4749") + + on_install(function (package) + os.cp("old_versions", package:installdir("include")) + os.cp("*.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:has_cfuncs("wyhash", {includes = "wyhash.h"})) + end) diff --git a/packages/x/x264/xmake.lua b/packages/x/x264/xmake.lua index 849f7cc4c..2234f47b9 100644 --- a/packages/x/x264/xmake.lua +++ b/packages/x/x264/xmake.lua @@ -1,10 +1,9 @@ package("x264") - set_homepage("https://www.videolan.org/developers/x264.html") set_description("A free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format.") - add_urls("https://code.videolan.org/videolan/x264.git") - add_urls("https://github.com/mirror/x264.git") + add_urls("https://code.videolan.org/videolan/x264.git", + "https://github.com/mirror/x264.git") add_versions("v2023.04.04", "eaa68fad9e5d201d42fde51665f2d137ae96baf0") add_versions("v2021.09.29", "66a5bc1bd1563d8227d5d18440b525a09bcf17ca") add_versions("v2018.09.25", "545de2ffec6ae9a80738de1b2c8cf820249a2530") @@ -35,16 +34,27 @@ package("x264") add_configs("toolchains", {readonly = true, description = "Set package toolchains only for cross-compilation."}) - add_syslinks("pthread", "dl") + if is_plat("linux", "macosx") then + add_syslinks("pthread", "dl") + end if is_plat("wasm") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end - on_install("linux", "macosx", "wasm", function (package) + on_load("windows", "mingw", function (package) + if is_subhost("windows") and os.arch() == "x64" then + package:add("deps", "msys2", {configs = {msystem = "MINGW64", base_devel = true}}) + end + end) + + on_install("windows", "mingw", "linux", "macosx", "wasm", function (package) local configs = {} table.insert(configs, "--enable-" .. (package:config("shared") and "shared" or "static")) - if package:is_plat("wasm") then + if package:is_plat("mingw") then + -- todo: fix a way to make it work + package:config_set("asm", false) + elseif package:is_plat("wasm") then table.insert(configs, "--host=i686-gnu") package:config_set("asm", false) package:config_set("cli", false) @@ -59,7 +69,29 @@ package("x264") end end end - import("package.tools.autoconf").install(package, configs) + if package:is_plat("windows") then + import("core.base.option") + import("core.tool.toolchain") + local msvc = package:toolchain("msvc") or toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + assert(msvc:check(), "msvs not found!") + -- keep msys2 envs in front to prevent conflict with possibly installed sh.exe + local envs = os.joinenvs(os.getenvs(), msvc:runenvs()) + envs.CC = path.filename(package:build_getenv("cc")) + envs.SHELL = "sh" + + table.insert(configs, "--toolchain=msvc") + table.insert(configs, "--prefix=" .. package:installdir():gsub("\\", "/")) + os.vrunv("./configure", configs, {shell = true, envs = envs}) + local njob = option.get("jobs") or tostring(os.default_njob()) + local argv = {"-j" .. njob} + if option.get("verbose") then + table.insert(argv, "V=1") + end + os.vrunv("make", argv, {envs = envs}) + os.vrunv("make", {"install"}, {envs = envs}) + else + import("package.tools.autoconf").install(package, configs) + end end) on_test(function (package) diff --git a/packages/x/x265/xmake.lua b/packages/x/x265/xmake.lua index 8de1ef35c..0d98310c2 100644 --- a/packages/x/x265/xmake.lua +++ b/packages/x/x265/xmake.lua @@ -11,7 +11,7 @@ package("x265") add_versions("3.2.1", "b5ee7ea796a664d6e2763f9c0ae281fac5d25892fc2cb134698547103466a06a") add_versions("3.3", "ca25a38772fc6b49e5f1aa88733bc1dc92da7dc18f02a85cc3e99d76ba85b0a9") add_versions("3.4", "544d147bf146f8994a7bf8521ed878c93067ea1c7c6e93ab602389be3117eaaf") - + add_configs("hdr10_plus", {description = "Enable dynamic HDR10 compilation", default = false, type = "boolean"}) add_configs("svt_hevc", {description = "Enable SVT HEVC Encoder", default = false, type = "boolean"}) @@ -51,8 +51,10 @@ package("x265") if package:version() then table.insert(configs, "-DX265_LATEST_TAG=" .. package:version():rawstr()) end - table.insert(configs, "--trace") import("package.tools.cmake").install(package, configs) + if package:is_plat("windows") then -- fix x265.pc + io.replace(path.join(package:installdir("lib", "pkgconfig"), "x265.pc"), "-lx265", "-lx265-static", {plain = true}) + end end) on_test(function (package) diff --git a/packages/x/xaudio2redist/xmake.lua b/packages/x/xaudio2redist/xmake.lua new file mode 100644 index 000000000..3e87858c6 --- /dev/null +++ b/packages/x/xaudio2redist/xmake.lua @@ -0,0 +1,28 @@ +package("xaudio2redist") + set_homepage("https://www.nuget.org/packages/Microsoft.XAudio2.Redist") + set_description("Redistributable version of XAudio 2.9 for Windows 7 SP1 or later") + set_license("Microsoft") + + set_urls("https://www.nuget.org/api/v2/package/Microsoft.XAudio2.Redist/$(version)/#Microsoft.XAudio2.Redist-$(version).zip") + add_versions("1.2.11", "4552e0b5b59de0cdbc6c217261c45f5968f7bbf1e8ab5f208e4bca6fd8fc5780") + add_versions("1.2.10", "fe491da540331d9915cfef49493269142e60472cd7308d9fc7ff78b2a19f6380") + add_versions("1.2.9", "a02332cb8d4096c29430be0fdb6a079e8f4a29781623ae362a811fd5dc015bb5") + add_versions("1.2.8", "6641a1e4f12a8e47e950d805d9e030aeb765860b9a2f046c33fb13337939ff33") + add_versions("1.2.7", "9052696dc3ab23e3b6063c6b8d41be528e10602d47eb49aeb6a87cb48df38004") + add_versions("1.2.6", "ff3e64183760588765232f5c8e41adc361f99a3ca1f9b158ccfbe4b8eb220c2e") + + on_install("windows|x64", "windows|x86", function (package) + os.cp("build/native/include", package:installdir()) + os.cp(path.join("build/native", package:debug() and "debug" or "release", "lib/$(arch)/*.lib"), package:installdir("lib")) + os.cp(path.join("build/native", package:debug() and "debug" or "release", "bin/$(arch)/*.dll"), package:installdir("bin")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + IXAudio2* pXAudio2; + XAudio2Create(&pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR); + pXAudio2->Release(); + } + ]]}, { includes = "xaudio2.h" })) + end) diff --git a/packages/x/xbyak/xmake.lua b/packages/x/xbyak/xmake.lua index 79b7da3c2..93b75ed0c 100644 --- a/packages/x/xbyak/xmake.lua +++ b/packages/x/xbyak/xmake.lua @@ -1,12 +1,13 @@ package("xbyak") - set_kind("library", {headeronly = true}) set_homepage("https://github.com/herumi/xbyak") - set_description("A JIT assembler for x86(IA-32)/x64(AMD64, x86-64) MMX/SSE/SSE2/SSE3/SSSE3/SSE4/FPU/AVX/AVX2/AVX-512 by C++ header") + set_description("JIT assembler for x86(IA-32)/x64(AMD64, x86-64) MMX/SSE/SSE2/SSE3/SSSE3/SSE4/FPU/AVX/AVX2/AVX-512") set_urls("https://github.com/herumi/xbyak/archive/$(version).zip", "https://github.com/herumi/xbyak.git") + add_versions("v7.06", "2d4b312769d3ff12b26ede3e9b105d336ae2b6c7ad3175921acc1ed001213a63") + add_versions("v6.73", "8cb9cc090f6123b35a2c554ae4cc80c9a2fb65ebf0b378463094fc62360fb13d") add_versions("v6.03", "e13ec1247a3a34f602434cf5075f0dfeea42bbd9bc4a73fd59dcf3e44907e68a") add_versions("v6.02", "cd3fe5ee15df6bfa73c721584b101c885096551124e6ded31b6f866ecb381cf0") diff --git a/packages/x/xcb-proto/xmake.lua b/packages/x/xcb-proto/xmake.lua index d6e722b06..430d6b69c 100644 --- a/packages/x/xcb-proto/xmake.lua +++ b/packages/x/xcb-proto/xmake.lua @@ -3,14 +3,15 @@ package("xcb-proto") set_homepage("https://www.x.org/") set_description("X.Org: XML-XCB protocol descriptions for libxcb code generation") - set_urls("https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-$(version).tar.gz", + add_urls("https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-$(version).tar.gz", "https://xcb.freedesktop.org/dist/xcb-proto-$(version).tar.gz") add_versions("1.13", "0698e8f596e4c0dbad71d3dc754d95eb0edbb42df5464e0f782621216fa33ba7") add_versions("1.14", "1c3fa23d091fb5e4f1e9bf145a902161cec00d260fabf880a7a248b02ab27031") add_versions("1.14.1", "85cd21e9d9fbc341d0dbf11eace98d55d7db89fda724b0e598855fcddf0944fd") + add_versions("1.16.0", "d9c7f010b1105fc3858bf07b5169b2dd8e7493c6652b1fe45f3321d874f291d7") if is_plat("macosx", "linux") then - add_deps("pkg-config", "python 3.x") + add_deps("pkg-config", "python 3.x", {kind = "binary"}) end on_install("macosx", "linux", function (package) @@ -22,6 +23,11 @@ package("xcb-proto") end) on_test(function (package) - local envs = {PKG_CONFIG_PATH = path.join(package:installdir(), "lib", "pkgconfig")} + local envs + if package:version():le("1.15") then + envs = {PKG_CONFIG_PATH = path.join(package:installdir(), "lib", "pkgconfig")} + else + envs = {PKG_CONFIG_PATH = path.join(package:installdir(), "share", "pkgconfig")} + end os.vrunv("pkg-config", {"--exists", "xcb-proto"}, {envs = envs}) end) diff --git a/packages/x/xerces-c/patches/patch-android.diff b/packages/x/xerces-c/patches/patch-android.diff new file mode 100644 index 000000000..b8e2b171b --- /dev/null +++ b/packages/x/xerces-c/patches/patch-android.diff @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 33bc40f41..a5d0c5b6d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -111,6 +111,7 @@ include(XercesICU) + include(XercesMutexMgrSelection) + include(XercesNetAccessorSelection) + include(XercesMsgLoaderSelection) ++include(XercesWChar) + include(XercesTranscoderSelection) + include(XercesFileMgrSelection) + include(XercesXMLCh) +@@ -126,7 +127,6 @@ include(XercesStdLibs) + include(XercesStdNamespace) + include(XercesSSE2) + include(XercesPathMax) +-include(XercesWChar) + include(XercesIconvConst) + include(XercesLFS) + +diff --git a/cmake/XercesTranscoderSelection.cmake b/cmake/XercesTranscoderSelection.cmake +index 4ff5b1621..862cc4908 100644 +--- a/cmake/XercesTranscoderSelection.cmake ++++ b/cmake/XercesTranscoderSelection.cmake +@@ -82,7 +82,7 @@ check_function_exists(wcstombs HAVE_WCSTOMBS) + check_function_exists(mbstowcs HAVE_MBSTOWCS) + + set(iconv_available 0) +-if(HAVE_WCHAR_H AND HAVE_MBLEN AND HAVE_WCSTOMBS AND HAVE_MBSTOWCS) ++if(HAVE_WCHAR_H AND (HAVE_MBRLEN OR HAVE_MBLEN) AND HAVE_WCSTOMBS AND HAVE_MBSTOWCS) + set(iconv_available 1) + list(APPEND transcoders iconv) + endif() diff --git a/packages/x/xerces-c/xmake.lua b/packages/x/xerces-c/xmake.lua index 985c9723e..353a3bdd7 100644 --- a/packages/x/xerces-c/xmake.lua +++ b/packages/x/xerces-c/xmake.lua @@ -4,7 +4,8 @@ package("xerces-c") set_description("Xerces-C++ is a validating XML parser written in a portable subset of C++.") set_license("Apache-2.0") - add_urls("https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-$(version).zip") + add_urls("https://archive.apache.org/dist/xerces/c/3/sources/xerces-c-$(version).zip") + add_versions("3.2.5", "4aa0f7ed265a45d253f900fa145cc8cae10414d085695f1de03a2ec141a3358b") add_versions("3.2.4", "563a668b331ca5d1fc08ed52e5f62a13508b47557f88a068ad1db6f68e1f2eb2") add_deps("cmake") @@ -12,13 +13,19 @@ package("xerces-c") add_syslinks("advapi32") elseif is_plat("macosx") then add_frameworks("CoreFoundation", "CoreServices") + elseif is_plat("android") then + -- for NDK version less than 26 + add_patches(">=3.2.4", + path.join(os.scriptdir(), "patches", "patch-android.diff"), + "f58fa2c89e1d4a17d5af193df3e3e5918986b71beb6ce055e9edd1546c20318a") end + on_install("windows", "macosx", "linux", "android", function (package) - if package:is_plat("android") then + if package:is_plat("android") and package:is_arch("armeabi-v7a") then import("core.tool.toolchain") local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) local ndk_sdkver = ndk:config("ndk_sdkver") - assert(ndk_sdkver and tonumber(ndk_sdkver) >= 26, "package(xerces-c): need ndk api level >= 26 for android") + assert(ndk_sdkver and tonumber(ndk_sdkver) >= 26, "package(xerces-c): need ndk api level >= 26 for android armeabi-v7a") end local configs = {"-Dnetwork=OFF", "-DCMAKE_DISABLE_FIND_PACKAGE_ICU=ON", "-DCMAKE_DISABLE_FIND_PACKAGE_CURL=ON"} diff --git a/packages/x/xlsxio/port/xmake.lua b/packages/x/xlsxio/port/xmake.lua new file mode 100644 index 000000000..2622af058 --- /dev/null +++ b/packages/x/xlsxio/port/xmake.lua @@ -0,0 +1,57 @@ +set_allowedplats("windows", "linux", "macosx", "mingw", "cross") + +option("libzip", {showmenu = true, default = false}) +option("minizip_ng", {showmenu = true, default = false}) +option("wide", {showmenu = true, default = false}) + +add_rules("mode.debug", "mode.release") + +if has_config("wide") then + add_requires("expat", {configs = {char_type = "wchar_t"}}) +else + add_requires("expat") +end + +if has_config("libzip") then + add_requires("libzip") +elseif has_config("minizip_ng") then + add_requires("minizip-ng", {configs = {zlib = true}}) +else + add_requires("minizip") +end + +target("xlsxio") + set_kind("$(kind)") + add_files("lib/*.c") + add_includedirs("include") + add_headerfiles("include/*.h") + + add_defines("BUILD_XLSXIO") + if is_kind("shared") then + add_defines("BUILD_XLSXIO_SHARED", {public = true}) + else + add_defines("BUILD_XLSXIO_STATIC", {public = true}) + end + + if has_config("wide") then + add_defines("XML_UNICODE", {public = true}) + end + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + if has_config("libzip") then + add_defines("USE_LIBZIP") + add_packages("libzip") + else + add_defines("USE_MINIZIP") + if has_config("minizip_ng") then + add_defines("USE_MINIZIP_NG") + add_packages("minizip-ng") + else + add_packages("minizip") + end + end + + add_packages("expat") diff --git a/packages/x/xlsxio/xmake.lua b/packages/x/xlsxio/xmake.lua new file mode 100644 index 000000000..c6ec0e2ea --- /dev/null +++ b/packages/x/xlsxio/xmake.lua @@ -0,0 +1,55 @@ +package("xlsxio") + set_homepage("https://github.com/brechtsanders/xlsxio") + set_description("XLSX I/O - C library for reading and writing .xlsx files") + set_license("MIT") + + add_urls("https://github.com/brechtsanders/xlsxio/archive/refs/tags/$(version).tar.gz", + "https://github.com/brechtsanders/xlsxio.git") + + add_versions("0.2.35", "03a4d1b1613953d46c8fc2ea048cd32007fbddcd376ab6d4156f72da2815adfa") + add_versions("0.2.34", "726e3bc3cf571ac20e5c39b1f192f3793d24ebfdeaadcd210de74aa1ec100bb6") + + add_configs("libzip", {description = "Use libzip instead of Minizip", default = false, type = "boolean"}) + add_configs("minizip_ng", {description = "Use Minizip NG", default = false, type = "boolean"}) + add_configs("wide", {description = "Also build UTF-16 library (libxlsxio_readw)", default = false, type = "boolean"}) + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + on_load(function (package) + if package:config("libzip") then + package:add("deps", "libzip") + elseif package:config("minizip_ng") then + package:add("deps", "minizip-ng", {configs = {zlib = true}}) + else + package:add("deps", "minizip") + end + + if package:config("wide") then + package:add("deps", "expat", {configs = {char_type = "wchar_t"}}) + else + package:add("deps", "expat") + end + end) + + on_install("windows", "linux", "macosx", "mingw", "cross", function (package) + local configs = {} + if package:config("libzip") then + configs.libzip = true + elseif package:config("minizip_ng") then + configs.minizip_ng = true + end + if package:config("wide") then + package:add("defines", "XML_UNICODE") + configs.wide = true + end + package:add("defines", "BUILD_XLSXIO_" .. (package:config("shared") and "SHARED" or "STATIC")) + + os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua") + import("package.tools.xmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("xlsxioread_open", {includes = "xlsxio_read.h"})) + end) diff --git a/packages/x/xorgproto/xmake.lua b/packages/x/xorgproto/xmake.lua index 5a6618bbd..1d794e600 100644 --- a/packages/x/xorgproto/xmake.lua +++ b/packages/x/xorgproto/xmake.lua @@ -7,6 +7,7 @@ package("xorgproto") set_urls("https://xorg.freedesktop.org/archive/individual/proto/xorgproto-$(version).tar.gz") add_versions("2021.5", "be6ddd6590881452fdfa170c1c9ff87209a98d36155332cbf2ccbc431add86ff") add_versions("2022.2", "da351a403d07a7006d7bdc8dcfc14ddc1b588b38fb81adab9989a8eef605757b") + add_versions("2023.2", "c791aad9b5847781175388ebe2de85cb5f024f8dabf526d5d699c4f942660cc3") if is_plat("linux") then add_extsources("apt::x11proto-dev", "pkgconfig::xproto") diff --git a/packages/x/xpack/xmake.lua b/packages/x/xpack/xmake.lua new file mode 100644 index 000000000..303bf3c6b --- /dev/null +++ b/packages/x/xpack/xmake.lua @@ -0,0 +1,33 @@ +package("xpack") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/xyz347/xpack") + set_description("convert json/xml/bson to c++ struct") + set_license("Apache-2.0") + + add_urls("https://github.com/xyz347/xpack/archive/refs/tags/$(version).tar.gz", + "https://github.com/xyz347/xpack.git") + + add_versions("v1.0.6", "76ccd82b0f0ddaae93d2340b2fa49e3245c2eb15c147f4736e27e8b05616085d") + add_versions("v1.0.5", "ea8693dd3a53d54e0c1e3c9e6e06f31ff7f593f7f8cf8fb4889f5c3354dbae8e") + + add_deps("rapidjson", "rapidxml") + + on_install(function (package) + os.cp("*.h", package:installdir("include", "xpack")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + struct User { + int id; + std::string name; + XPACK(O(id, name)); + }; + void test() { + User u; + std::string data = "{\"id\":12345, \"name\":\"xpack\"}"; + xpack::json::decode(data, u); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/x/xproperty/xmake.lua b/packages/x/xproperty/xmake.lua new file mode 100644 index 000000000..9bfdba905 --- /dev/null +++ b/packages/x/xproperty/xmake.lua @@ -0,0 +1,29 @@ +package("xproperty") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/jupyter-xeus/xproperty") + set_description("Traitlets-like C++ properties and implementation of the observer pattern") + set_license("BSD-3-Clause") + + add_urls("https://github.com/jupyter-xeus/xproperty.git") + add_versions("2021.04.13", "4e5cc851733ad5f57dd75c33d3beb75aba2569aa") + + add_deps("cmake", "xtl") + + on_install("windows", "linux", "macosx", function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + struct Foo : public xp::xobserved + { + XPROPERTY(double, Foo, bar); + XPROPERTY(double, Foo, baz); + }; + void test() { + Foo foo; + XOBSERVE(foo, bar, [](Foo& f){}); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/x/xsimd/xmake.lua b/packages/x/xsimd/xmake.lua index 0c48811cd..1649d8bb5 100644 --- a/packages/x/xsimd/xmake.lua +++ b/packages/x/xsimd/xmake.lua @@ -1,5 +1,4 @@ package("xsimd") - set_kind("library", {headeronly = true}) set_homepage("https://github.com/xtensor-stack/xsimd/") set_description("C++ wrappers for SIMD intrinsics") @@ -7,10 +6,15 @@ package("xsimd") add_urls("https://github.com/xtensor-stack/xsimd/archive/refs/tags/$(version).tar.gz", "https://github.com/xtensor-stack/xsimd.git") + + add_versions("13.0.0", "8bdbbad0c3e7afa38d88d0d484d70a1671a1d8aefff03f4223ab2eb6a41110a3") + add_versions("12.1.1", "73f94a051278ef3da4533b691d31244d12074d5d71107473a9fd8d7be15f0110") add_versions("7.6.0", "eaf47f1a316ef6c3287b266161eeafc5aa61226ce5ac6c13502546435b790252") add_versions("8.0.3", "d1d41253c4f82eaf2f369d7fcb4142e35076cf8675b9d94caa06ecf883024344") add_versions("8.0.5", "0e1b5d973b63009f06a3885931a37452580dbc8d7ca8ad40d4b8c80d2a0f84d7") add_versions("9.0.1", "b1bb5f92167fd3a4f25749db0be7e61ed37e0a5d943490f3accdcd2cd2918cc0") + add_versions("10.0.0", "73f818368b3a4dad92fab1b2933d93694241bd2365a6181747b2df1768f6afdd") + add_versions("11.0.0", "50c31c319c8b36c8946eb954c7cca2e2ece86bf8a66a7ebf321b24cd273e7c47") if is_plat("windows") then add_cxxflags("/arch:AVX2") @@ -26,14 +30,25 @@ package("xsimd") on_test(function (package) if package:version():ge("8.0") then assert(package:check_cxxsnippets({test = [[ - #include - void test() { - xsimd::batch a{1.5, 2.5, 3.5, 4.5}; - xsimd::batch b{2.5, 3.5, 4.5, 5.5}; - auto mean = (a + b) / 2; - std::cout << mean << std::endl; + #include "xsimd/xsimd.hpp" + + namespace xsimd { + template + inline batch mandel(const batch_bool &_active, + const batch &c_re, + const batch &c_im, int maxIters) { + using float_batch_type = batch; + using int_batch_type = batch; + + float_batch_type z_re = c_re; + float_batch_type z_im = c_im; + int_batch_type vi(0); + return vi; } - ]]}, {configs = {languages = "c++14"}, includes = "xsimd/xsimd.hpp"})) + } // namespace xsimd + + void test() {} + ]]}, {configs = {languages = "c++14"}})) else assert(package:check_cxxsnippets({test = [[ #include diff --git a/packages/x/xtensor-blas/xmake.lua b/packages/x/xtensor-blas/xmake.lua index 31fedda0f..7e38f84cc 100644 --- a/packages/x/xtensor-blas/xmake.lua +++ b/packages/x/xtensor-blas/xmake.lua @@ -7,6 +7,7 @@ package("xtensor-blas") add_urls("https://github.com/xtensor-stack/xtensor-blas/archive/refs/tags/$(version).tar.gz", "https://github.com/xtensor-stack/xtensor-blas.git") + add_versions("0.21.0", "89ce6eceb47018f3b557945468502593e0bf0e5a816548aad8ac22247c8198b1") add_versions("0.19.1", "c77cc4e2297ebd22d0d1c6e8d0a6cf0975176afa8cb99dbfd5fb2be625a0248f") add_versions("0.20.0", "272f5d99bb7511a616bfe41b13a000e63de46420f0b32a25fa4fb935b462c7ff") diff --git a/packages/x/xtensor/xmake.lua b/packages/x/xtensor/xmake.lua index 9feb5139f..05367540c 100644 --- a/packages/x/xtensor/xmake.lua +++ b/packages/x/xtensor/xmake.lua @@ -1,5 +1,4 @@ package("xtensor") - set_kind("library", {headeronly = true}) set_homepage("https://github.com/xtensor-stack/xtensor/") set_description("Multi-dimensional arrays with broadcasting and lazy computing") @@ -7,15 +6,27 @@ package("xtensor") add_urls("https://github.com/xtensor-stack/xtensor/archive/refs/tags/$(version).tar.gz", "https://github.com/xtensor-stack/xtensor.git") - add_versions("0.23.10", "2e770a6d636962eedc868fef4930b919e26efe783cd5d8732c11e14cf72d871c") - add_versions("0.24.0", "37738aa0865350b39f048e638735c05d78b5331073b6329693e8b8f0902df713") - add_versions("0.24.1", "dd1bf4c4eba5fbcf386abba2627fcb4a947d14a806c33fde82d0cc1194807ee4") + + add_versions("0.25.0", "32d5d9fd23998c57e746c375a544edf544b74f0a18ad6bc3c38cbba968d5e6c7") + add_versions("0.24.7", "0fbbd524dde2199b731b6af99b16063780de6cf1d0d6cb1f3f4d4ceb318f3106") add_versions("0.24.3", "3acde856b9fb8cf4e2a7b66726da541275d40ab9b002e618ad985ab97f08ca4f") + add_versions("0.24.1", "dd1bf4c4eba5fbcf386abba2627fcb4a947d14a806c33fde82d0cc1194807ee4") + add_versions("0.24.0", "37738aa0865350b39f048e638735c05d78b5331073b6329693e8b8f0902df713") + add_versions("0.23.10", "2e770a6d636962eedc868fef4930b919e26efe783cd5d8732c11e14cf72d871c") + + add_configs("simd", {description = "Enable SIMD acceleration ", default = true, type = "boolean"}) add_deps("cmake") - add_deps("xtl", "xsimd") + add_deps("xtl ^0.7.0") + + on_load("windows", "macosx", "linux", "mingw@windows", function (package) + if package:config("simd") then + package:add("deps", "xsimd ^11.0.0") + end + end) on_install("windows", "macosx", "linux", "mingw@windows", function (package) - import("package.tools.cmake").install(package, {"-DXTENSOR_USE_XSIMD=ON"}) + local configs = {"-DXTENSOR_USE_XSIMD=" .. (package:config("simd") and "ON" or "OFF")} + import("package.tools.cmake").install(package, configs, {packagedeps = "xsimd"}) end) on_test(function (package) diff --git a/packages/x/xtl/xmake.lua b/packages/x/xtl/xmake.lua index 0859c9e2d..daaae2b93 100644 --- a/packages/x/xtl/xmake.lua +++ b/packages/x/xtl/xmake.lua @@ -7,9 +7,11 @@ package("xtl") add_urls("https://github.com/xtensor-stack/xtl/archive/refs/tags/$(version).tar.gz", "https://github.com/xtensor-stack/xtl.git") + add_versions("0.7.7", "44fb99fbf5e56af5c43619fc8c29aa58e5fad18f3ba6e7d9c55c111b62df1fbb") add_versions("0.7.2", "95c221bdc6eaba592878090916383e5b9390a076828552256693d5d97f78357c") add_versions("0.7.3", "f4a81e3c9ca9ddb42bd4373967d4859ecfdca1aba60b9fa6ced6c84d8b9824ff") add_versions("0.7.4", "3c88be0e696b64150c4de7a70f9f09c00a335186b0b0b409771ef9f56bca7d9a") + add_versions("0.7.6", "dda442dc81f390f77561913062471c39b6ef19ffc6f64d3cd12b5c4b4607c957") add_deps("cmake") add_deps("nlohmann_json") diff --git a/packages/x/xtrans/xmake.lua b/packages/x/xtrans/xmake.lua index 858b665fa..39bae6920 100644 --- a/packages/x/xtrans/xmake.lua +++ b/packages/x/xtrans/xmake.lua @@ -3,8 +3,9 @@ package("xtrans") set_homepage("https://www.x.org/") set_description("X.Org: X Network Transport layer shared code") - set_urls("https://www.x.org/archive/individual/lib/xtrans-$(version).tar.bz2") - add_versions("1.4.0", "377c4491593c417946efcd2c7600d1e62639f7a8bbca391887e2c4679807d773") + set_urls("https://www.x.org/archive/individual/lib/xtrans-$(version).tar.gz") + add_versions("1.4.0", "48ed850ce772fef1b44ca23639b0a57e38884045ed2cbb18ab137ef33ec713f9") + -- add_versions("1.5.0", "a806f8a92f879dcd0146f3f1153fdffe845f2fc0df9b1a26c19312b7b0a29c86") if is_plat("linux") then add_extsources("apt::xtrans-dev", "pacman::xtrans") diff --git a/packages/x/xz/xmake.lua b/packages/x/xz/xmake.lua index 7f694771c..0e1b34374 100644 --- a/packages/x/xz/xmake.lua +++ b/packages/x/xz/xmake.lua @@ -5,6 +5,7 @@ package("xz") set_urls("https://downloads.sourceforge.net/project/lzmautils/xz-$(version).tar.gz", "https://tukaani.org/xz/xz-$(version).tar.gz") + add_versions("5.4.6", "aeba3e03bf8140ddedf62a0a367158340520f6b384f75ca6045ccc6c0d43fd5c") add_versions("5.2.5", "f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10") add_versions("5.2.10", "eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3") add_versions("5.4.1", "e4b0f81582efa155ccf27bb88275254a429d44968e488fc94b806f2a61cd3e22") diff --git a/packages/y/yaml-cpp/xmake.lua b/packages/y/yaml-cpp/xmake.lua index 07e0c6477..ab7a89815 100644 --- a/packages/y/yaml-cpp/xmake.lua +++ b/packages/y/yaml-cpp/xmake.lua @@ -4,7 +4,7 @@ package("yaml-cpp") set_description("A YAML parser and emitter in C++") set_license("MIT") - add_urls("https://github.com/jbeder/yaml-cpp/archive/$(version).tar.gz", {version = function (version) + add_urls("https://github.com/jbeder/yaml-cpp/archive/refs/tags/$(version).tar.gz", {version = function (version) return version:le("0.7.0") and "yaml-cpp-" .. tostring(version) or version end}) add_urls("https://github.com/jbeder/yaml-cpp.git") diff --git a/packages/y/yas/xmake.lua b/packages/y/yas/xmake.lua new file mode 100644 index 000000000..9f6f5a60a --- /dev/null +++ b/packages/y/yas/xmake.lua @@ -0,0 +1,39 @@ +package("yas") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/niXman/yas") + set_description("Yet Another Serialization") + + add_urls("https://github.com/niXman/yas.git") + add_versions("2023.09.13", "7c5ced1d940ddc6826cf537468e65ea1f592bfe4") + + on_install(function (package) + io.replace("include/yas/detail/config/endian.hpp", + "|| defined(__ARM_ARCH_7S__)", + "|| defined(__ARM_ARCH_7S__) || defined(_M_ARM64)", {plain = true}) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + int a = 3, aa{}; + short b = 4, bb{}; + float c = 3.14, cc{}; + constexpr std::size_t flags = + yas::mem // IO type + |yas::json; // IO format + auto buf = yas::save( + YAS_OBJECT("myobject", a, b, c) + ); + yas::load(buf, + YAS_OBJECT_NVP("myobject" + ,("a", aa) + ,("b", bb) + ,("c", cc) + ) + ); + } + ]]}, {configs = {languages = "c++14"}})) + end) diff --git a/packages/y/yoga/xmake.lua b/packages/y/yoga/xmake.lua new file mode 100644 index 000000000..b3efbba62 --- /dev/null +++ b/packages/y/yoga/xmake.lua @@ -0,0 +1,29 @@ +package("yoga") + set_homepage("https://yogalayout.com/") + set_description("Yoga is a cross-platform layout engine which implements Flexbox. Follow https://twitter.com/yogalayout for updates.") + set_license("MIT") + + add_urls("https://github.com/facebook/yoga/archive/refs/tags/$(version).tar.gz", + "https://github.com/facebook/yoga.git") + + add_versions("v3.0.4", "ef3ce5106eed03ab2e40dcfe5b868936a647c5f02b7ffd89ffaa5882dca3ef7f") + add_versions("v3.0.3", "0ae44f7d30f8130cdf63e91293e11e34803afbfd12482fe4ef786435fc7fa8e7") + add_versions("v3.0.2", "73a81c51d9ceb5b95cd3abcafeb4c840041801d59f5048dacce91fbaab0cc6f9") + add_versions("v3.0.0", "da4739061315fd5b6442e0658c2541db24ded359f41525359d5e61edb2f45297") + add_versions("v2.0.1", "4c80663b557027cdaa6a836cc087d735bb149b8ff27cbe8442fc5e09cec5ed92") + + add_configs("shared", {description = "Build shared binaries", default = false, type = "boolean", readonly = true}) + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + io.replace("CMakeLists.txt", "add_subdirectory(tests)", "", {plain = true}) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("YGNodeNew", {includes = "yoga/Yoga.h"})) + end) diff --git a/packages/y/yomm2/xmake.lua b/packages/y/yomm2/xmake.lua index 5d7b5a421..3c66c84eb 100644 --- a/packages/y/yomm2/xmake.lua +++ b/packages/y/yomm2/xmake.lua @@ -6,6 +6,9 @@ package("yomm2") add_urls("https://github.com/jll63/yomm2/archive/refs/tags/$(version).tar.gz", "https://github.com/jll63/yomm2.git") + add_versions("v1.5.2", "12f3f735b4870606199b889a242ebfed84cf0cd392b04a1c32db11291de684be") + add_versions("v1.5.1", "323abba27a356555cc3ead3e3e950746ab43f90d97ad21950f2ba3afaf565ecc") + add_versions("v1.5.0", "daebc9bc56e3f67f1513c40b4b185cf435d8e16fe9936f3e5ed6fbb337a39030") add_versions("v1.4.0", "3f1f3a2b6fa5250405986b6cc4dff82299f866e2c6c2db75c7c3f38ecb91360f") add_deps("cmake", "boost") @@ -17,6 +20,8 @@ package("yomm2") end) on_install("windows", "linux", "macosx", "bsd", "mingw", "cross", function (package) + io.replace("CMakeLists.txt", "add_subdirectory(docs.in)", "", {plain = true}) + local configs = { "-DYOMM2_ENABLE_TESTS=OFF", diff --git a/packages/y/yy-thunks/xmake.lua b/packages/y/yy-thunks/xmake.lua index 5bfb854b6..3111c6989 100644 --- a/packages/y/yy-thunks/xmake.lua +++ b/packages/y/yy-thunks/xmake.lua @@ -4,6 +4,7 @@ package("yy-thunks") set_license("MIT") add_urls("https://github.com/Chuyu-Team/YY-Thunks/releases/download/v$(version)/YY-Thunks-$(version)-Binary.zip") + add_versions("1.0.9", "216b88757f28075d3d8c0363139e870d49ba84458fc10a0f094f264ebf0a302c") add_versions("1.0.7", "3607a79ac37f141cbcbf00aaea8d82a4c2628d81d8dad9e2a4dce4c8c17a025b") on_install("windows|x64", "windows|x86", function (package) diff --git a/packages/y/yyjson/xmake.lua b/packages/y/yyjson/xmake.lua index 37c4adee1..19b82c411 100644 --- a/packages/y/yyjson/xmake.lua +++ b/packages/y/yyjson/xmake.lua @@ -5,6 +5,8 @@ package("yyjson") add_urls("https://github.com/ibireme/yyjson/archive/$(version).tar.gz", "https://github.com/ibireme/yyjson.git") + add_versions("0.9.0", "59902bea55585d870fd7681eabe6091fbfd1a8776d1950f859d2dbbd510c74bd") + add_versions("0.8.0", "b2e39ac4c65f9050820c6779e6f7dd3c0d3fed9c6667f91caec0badbedce00f3") add_versions("0.5.1", "b484d40b4e20cc3174a6fdc160d0f20f961417f9cb3f6dc1cf6555fffa8359f3") add_versions("0.5.0", "1a65c41d25394c979ad26554a0befb8006ecbf9f7f3a5b0130fdae4f2dd03d42") add_versions("0.4.0", "061fe713391d7f3f85f13e8bb2752a4cdeb8e70ce20d68e1e9e4332bd0bf64fa") diff --git a/packages/z/zeromq/xmake.lua b/packages/z/zeromq/xmake.lua index 7474e669a..e6cfbe819 100644 --- a/packages/z/zeromq/xmake.lua +++ b/packages/z/zeromq/xmake.lua @@ -5,11 +5,16 @@ package("zeromq") set_urls("https://github.com/zeromq/libzmq/releases/download/v$(version)/zeromq-$(version).tar.gz", "https://github.com/zeromq/libzmq.git") + add_versions("4.3.5", "6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43") add_versions("4.3.2", "ebd7b5c830d6428956b67a0454a7f8cbed1de74b3b01e5c33c5378e22740f763") add_versions("4.3.4", "c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5") add_patches("4.3.4", "https://github.com/zeromq/libzmq/commit/438d5d88392baffa6c2c5e0737d9de19d6686f0d.patch", "08f8068e109225ff628f9205597b917f633f02bc0be9382b06fbd98b0de2f8a0") + if is_plat("macosx") then + add_extsources("brew::zeromq") + end + if is_plat("linux") then add_configs("libunwind", {description = "Enable libunwind.", default = false, type = "boolean"}) end @@ -43,9 +48,7 @@ package("zeromq") table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) table.insert(configs, "--enable-libunwind=" .. (package:config("libunwind") and "yes" or "no")) - if package:config("pic") then - table.insert(configs, "--with-pic") - end + table.insert(configs, "--libdir=" .. package:installdir("lib")) import("package.tools.autoconf").install(package, configs) end) diff --git a/packages/z/zeus_expected/patches/v1.0.0/fix_typename.patch b/packages/z/zeus_expected/patches/v1.0.0/fix_typename.patch new file mode 100644 index 000000000..762ccde8f --- /dev/null +++ b/packages/z/zeus_expected/patches/v1.0.0/fix_typename.patch @@ -0,0 +1,40 @@ +diff --git a/include/zeus/expected.hpp b/include/zeus/expected.hpp +index 50c286f..fa29889 100644 +--- a/include/zeus/expected.hpp ++++ b/include/zeus/expected.hpp +@@ -1778,7 +1778,7 @@ public: + { + using U = expected_detail::remove_cvref_tm_val))>>; + static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); +- static_assert(std::is_same_v, "The error type must be the same after calling the F"); ++ static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) + return std::invoke(std::forward(f), std::move(this->m_val)); +@@ -1790,7 +1790,7 @@ public: + { + using U = expected_detail::remove_cvref_tm_val))>>; + static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); +- static_assert(std::is_same_v, "The error type must be the same after calling the F"); ++ static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) + return std::invoke(std::forward(f), std::move(this->m_val)); +@@ -2469,7 +2469,7 @@ public: + { + using U = expected_detail::remove_cvref_t>; + static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); +- static_assert(std::is_same_v, "The error type must be the same after calling the F"); ++ static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) + return std::invoke(std::forward(f)); +@@ -2481,7 +2481,7 @@ public: + { + using U = expected_detail::remove_cvref_t>; + static_assert(expected_detail::is_specialization_v, "U (return type of F) must be specialization of expected"); +- static_assert(std::is_same_v, "The error type must be the same after calling the F"); ++ static_assert(std::is_same_v, "The error type must be the same after calling the F"); + + if (has_value()) + return std::invoke(std::forward(f)); diff --git a/packages/z/zeus_expected/xmake.lua b/packages/z/zeus_expected/xmake.lua new file mode 100644 index 000000000..27cb432aa --- /dev/null +++ b/packages/z/zeus_expected/xmake.lua @@ -0,0 +1,33 @@ +package("zeus_expected") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/zeus-cpp/expected") + set_description("Backporting std::expected to C++17.") + set_license("MIT") + + add_urls("https://github.com/zeus-cpp/expected/archive/refs/tags/$(version).tar.gz", + "https://github.com/zeus-cpp/expected.git") + + add_versions("v1.1.1", "47b411677ffb2fa0d43b308797542509ae2bdb101426cf0d4777e3c162b1d726") + add_versions("v1.1.0", "a963eba43f227498da2cbb924265344209696320c75ee63a92073936bb49f7e5") + add_versions("v1.0.1", "e2a7dd56837fa1c30ce255c52361b6a245e732d265cfbd449d60826a8d0625ae") + add_versions("v1.0.0", "a0d81798b777f9bfcc1e1e4f3046632067bd8c6071dbfcbec5012a31a5aebc68") + + add_patches("v1.0.0", path.join(os.scriptdir(), "patches", "v1.0.0", "fix_typename.patch"), "710d71f8c765a2937df25a2c52abec24f5f4ef5f43281f6aa01853d0498e2a47") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + local cxflags = {} + if package:is_plat("windows") then + table.insert(cxflags, "/Zc:__cplusplus") + end + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + zeus::expected e1 = 42; + zeus::expected e2 = zeus::unexpected(42); + } + ]]}, {configs = {languages = "cxx17", cxflags = cxflags}})) + end) diff --git a/packages/z/zfp/xmake.lua b/packages/z/zfp/xmake.lua index 313cf188f..5c81a7a98 100644 --- a/packages/z/zfp/xmake.lua +++ b/packages/z/zfp/xmake.lua @@ -5,6 +5,7 @@ package("zfp") set_license("BSD-3-Clause") add_urls("https://github.com/LLNL/zfp/releases/download/$(version)/zfp-$(version).tar.gz") + add_versions("1.0.1", "ca0f7b4ae88044ffdda12faead30723fe83dd8f5bb0db74125df84589e60e52b") add_versions("0.5.5", "fdf7b948bab1f4e5dccfe2c2048fd98c24e417ad8fb8a51ed3463d04147393c5") add_patches("0.5.5", path.join(os.scriptdir(), "patches", "0.5.5", "msvc.patch"), "5934c3fcd2abc64857c89c8dc16a2af855ab278e935e8a259bbcea89ddfe9a52") diff --git a/packages/z/zig/xmake.lua b/packages/z/zig/xmake.lua index 086334abd..f4adbea5d 100644 --- a/packages/z/zig/xmake.lua +++ b/packages/z/zig/xmake.lua @@ -8,32 +8,50 @@ package("zig") if os.arch() == "arm64" then set_urls("https://ziglang.org/download/$(version)/zig-macos-aarch64-$(version).tar.xz") add_versions("0.10.1", "b9b00477ec5fa1f1b89f35a7d2a58688e019910ab80a65eac2a7417162737656") + add_versions("0.11.0", "c6ebf927bb13a707d74267474a9f553274e64906fd21bf1c75a20bde8cadf7b2") + add_versions("0.12.0", "294e224c14fd0822cfb15a35cf39aa14bd9967867999bf8bdfe3db7ddec2a27f") else set_urls("https://ziglang.org/download/$(version)/zig-macos-x86_64-$(version).tar.xz") add_versions("0.10.1", "02483550b89d2a3070c2ed003357fd6e6a3059707b8ee3fbc0c67f83ca898437") + add_versions("0.11.0", "1c1c6b9a906b42baae73656e24e108fd8444bb50b6e8fd03e9e7a3f8b5f05686") + add_versions("0.12.0", "4d411bf413e7667821324da248e8589278180dbc197f4f282b7dbb599a689311") end elseif is_host("windows") then if os.arch() == "arm64" then set_urls("https://ziglang.org/download/$(version)/zig-windows-aarch64-$(version).zip") add_versions("0.10.1", "ece93b0d77b2ab03c40db99ef7ccbc63e0b6bd658af12b97898960f621305428") + add_versions("0.11.0", "5d4bd13db5ecb0ddc749231e00f125c1d31087d708e9ff9b45c4f4e13e48c661") + add_versions("0.12.0", "04c6b92689241ca7a8a59b5f12d2ca2820c09d5043c3c4808b7e93e41c7bf97b") else set_urls("https://ziglang.org/download/$(version)/zig-windows-x86_64-$(version).zip") add_versions("0.10.1", "5768004e5e274c7969c3892e891596e51c5df2b422d798865471e05049988125") + add_versions("0.11.0", "142caa3b804d86b4752556c9b6b039b7517a08afa3af842645c7e2dcd125f652") + add_versions("0.12.0", "2199eb4c2000ddb1fba85ba78f1fcf9c1fb8b3e57658f6a627a8e513131893f5") end elseif is_host("linux") then if os.arch() == "i386" then - set_urls("https://ziglang.org/download/$(version)/zig-linux-i386-$(version).tar.xz") - add_versions("0.10.1", "8c710ca5966b127b0ee3efba7310601ee57aab3dd6052a082ebc446c5efb2316") + set_urls("https://ziglang.org/download/$(version)/zig-linux-x86-$(version).tar.xz") + add_versions("0.11.0", "7b0dc3e0e070ae0e0d2240b1892af6a1f9faac3516cae24e57f7a0e7b04662a8") + add_versions("0.12.0", "fb752fceb88749a80d625a6efdb23bea8208962b5150d6d14c92d20efda629a5") elseif os.arch() == "arm64" then set_urls("https://ziglang.org/download/$(version)/zig-linux-aarch64-$(version).tar.xz") add_versions("0.10.1", "db0761664f5f22aa5bbd7442a1617dd696c076d5717ddefcc9d8b95278f71f5d") + add_versions("0.11.0", "956eb095d8ba44ac6ebd27f7c9956e47d92937c103bf754745d0a39cdaa5d4c6") + add_versions("0.12.0", "754f1029484079b7e0ca3b913a0a2f2a6afd5a28990cb224fe8845e72f09de63") else set_urls("https://ziglang.org/download/$(version)/zig-linux-x86_64-$(version).tar.xz") add_versions("0.10.1", "6699f0e7293081b42428f32c9d9c983854094bd15fee5489f12c4cf4518cc380") + add_versions("0.11.0", "2d00e789fec4f71790a6e7bf83ff91d564943c5ee843c5fd966efc474b423047") + add_versions("0.12.0", "c7ae866b8a76a568e2d5cfd31fe89cdb629bdd161fdd5018b29a4a0a17045cad") + end + elseif is_host("bsd") then + if os.arch() == "x86_64" then + set_urls("https://ziglang.org/download/$(version)/zig-freebsd-x86_64-$(version).tar.xz") + add_versions("0.11.0", "ea430327f9178377b79264a1d492868dcff056cd76d43a6fb00719203749e958") end end - on_install("@macosx", "@linux", "@windows", "@msys", function (package) + on_install("@macosx", "@linux", "@windows", "@msys", "@bsd", function (package) os.cp("*", package:installdir()) package:addenv("PATH", ".") end) diff --git a/packages/z/zip/xmake.lua b/packages/z/zip/xmake.lua new file mode 100644 index 000000000..520d3e3ea --- /dev/null +++ b/packages/z/zip/xmake.lua @@ -0,0 +1,46 @@ +package("zip") + set_kind("binary") + set_homepage("http://www.info-zip.org/Zip.html") + set_description("Info-ZIP zip utility") + + add_urls("https://github.com/LuaDist/zip.git") + add_versions("3.0", "f6cfe48f6bc5bf2d505a0e0eb265ce4cb238db89") + + add_deps("cmake") + + on_install("@windows", "@macosx", "@linux", function (package) + io.replace("zip.h", "#define __zip_h 1", [[#define __zip_h 1 + #if defined(WIN32) || defined(WINDLL) + # define WIN32_LEAN_AND_MEAN + # include + #endif + ]], {plain = true}) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + includes("@builtin/check") + check_cfuncs("HAVE_LCHMOD", "lchmod", {includes = "sys/stat.h"}) + target("zip") + set_kind("binary") + if not has_config("__HAVE_LCHMOD") then + add_defines("NO_LCHMOD") + end + add_files("crc32.c", "crypt.c", "deflate.c", + "fileio.c", "globals.c", "trees.c", "ttyio.c", "util.c", + "zip.c", "zipfile.c", "zipup.c") + if is_plat("windows") then + add_files("win32/*.c") + add_syslinks("user32", "advapi32") + add_defines("WIN32", "NO_ASM") + else + add_files("unix/unix.c") + add_defines("UNIX", "NO_OFF_T") + end + add_includedirs(".") + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + os.vrun("zip --help") + end) + diff --git a/packages/z/zlib-ng/xmake.lua b/packages/z/zlib-ng/xmake.lua index e1900c792..948767a9f 100644 --- a/packages/z/zlib-ng/xmake.lua +++ b/packages/z/zlib-ng/xmake.lua @@ -1,17 +1,52 @@ package("zlib-ng") - set_homepage("https://github.com/zlib-ng/zlib-ng") set_description("zlib replacement with optimizations for next generation systems.") set_license("zlib") add_urls("https://github.com/zlib-ng/zlib-ng/archive/refs/tags/$(version).tar.gz", "https://github.com/zlib-ng/zlib-ng.git") - add_versions("2.0.5", "eca3fe72aea7036c31d00ca120493923c4d5b99fe02e6d3322f7c88dbdcd0085") + + add_versions("2.1.6", "a5d504c0d52e2e2721e7e7d86988dec2e290d723ced2307145dedd06aeb6fef2") + add_versions("2.1.5", "3f6576971397b379d4205ae5451ff5a68edf6c103b2f03c4188ed7075fbb5f04") add_versions("2.0.6", "8258b75a72303b661a238047cb348203d88d9dddf85d480ed885f375916fcab6") + add_versions("2.0.5", "eca3fe72aea7036c31d00ca120493923c4d5b99fe02e6d3322f7c88dbdcd0085") add_deps("cmake") - on_install("windows", "macosx", "linux", "android", function (package) - local configs = {"-DZLIB_COMPAT=ON"} + + if on_check then + on_check("windows", "mingw", function (package) + import("core.tool.toolchain") + import("core.base.semver") + + if package:version():ge("2.1.5") and package:is_arch("arm.*") then + local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) + if msvc then + local vs_sdkver = msvc:config("vs_sdkver") + assert(vs_sdkver and semver.match(vs_sdkver):gt("10.0.19041"), "package(zlib-ng/arm >= 2.1.5): need vs_sdkver > 10.0.19041.0") + end + end + + if package:version():eq("2.1.6") and package:is_arch("i386") and package:is_cross() then + assert(false, "package(zlib-ng/i386): Unsupported cross compilation") + end + end) + end + + on_load(function (package) + if package:version():eq("2.1.5") then + if package:is_plat("android") or package:is_arch("arm.*") then + raise("zlib-ng 2.1.5 not support android and arm.") + end + end + end) + + on_install("windows", "macosx", "linux", "android", "mingw", function (package) + local configs = { + "-DZLIB_COMPAT=ON", + "-DZLIB_ENABLE_TESTS=OFF", + "-DZLIBNG_ENABLE_TESTS=OFF", + "-DWITH_GTEST=OFF", + } table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DINC_INSTALL_DIR=" .. package:installdir("include")) diff --git a/packages/z/zlib/xmake.lua b/packages/z/zlib/xmake.lua index 1f0a51d8f..50b0a6fc3 100644 --- a/packages/z/zlib/xmake.lua +++ b/packages/z/zlib/xmake.lua @@ -2,6 +2,7 @@ package("zlib") set_homepage("http://www.zlib.net") set_description("A Massively Spiffy Yet Delicately Unobtrusive Compression Library") + set_license("zlib") add_urls("https://github.com/madler/zlib/archive/$(version).tar.gz") add_urls("https://github.com/madler/zlib.git") @@ -10,6 +11,7 @@ package("zlib") add_versions("v1.2.12", "d8688496ea40fb61787500e863cc63c9afcbc524468cedeb478068924eb54932") add_versions("v1.2.13", "1525952a0a567581792613a9723333d7f8cc20b87a81f920fb8bc7e3f2251428") add_versions("v1.3", "b5b06d60ce49c8ba700e0ba517fa07de80b5d4628a037f4be8ad16955be7a7c0") + add_versions("v1.3.1", "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c") add_configs("zutil", {description = "Export zutil.h api", default = false, type = "boolean"}) @@ -21,9 +23,18 @@ package("zlib") add_extsources("brew::zlib") end + on_fetch(function (package, opt) + if xmake.version():lt("2.8.7") then return end -- disable system find if the bug is present + if opt.system then + if not package:is_plat("windows", "mingw") then + return package:find_package("system::z", {includes = "zlib.h"}) + end + end + end) + on_install(function (package) io.writefile("xmake.lua", [[ - includes("check_cincludes.lua") + includes("@builtin/check") add_rules("mode.debug", "mode.release") target("zlib") set_kind("$(kind)") diff --git a/packages/z/zlog/patches/1.2.17/cmake.patch b/packages/z/zlog/patches/1.2.17/cmake.patch new file mode 100644 index 000000000..8afe6a487 --- /dev/null +++ b/packages/z/zlog/patches/1.2.17/cmake.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 33e0fa1..6303c74 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,10 +24,7 @@ SET(zlog_so_ver ${CPACK_PACKAGE_VERSION_MAJOR}) + + message(STATUS "plateform : ${CMAKE_SYSTEM}") + +-add_definitions("-g -Wall -Wstrict-prototypes") +-set(CMAKE_C_FLAGS "-std=c99 -pedantic -D_DEFAULT_SOURCE") +-set(CMAKE_C_FLAGS_DEBUG "-ggdb3 -DDEBUG") +-set(CMAKE_C_FLAGS_RELEASE "-O2") ++ + + if (WIN32) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 ") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 2471e3a..4c58f96 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -10,7 +10,6 @@ endif() + list(REMOVE_ITEM SRCS ./zlog-chk-conf.c) + + add_library(zlog +- SHARED + ${SRCS} + ) + target_link_libraries(zlog +@@ -26,23 +25,6 @@ endif() + + set_target_properties(zlog PROPERTIES VERSION ${zlog_ver} SOVERSION ${zlog_so_ver}) + +-add_library(zlog_s +- STATIC +- ${SRCS} +- ) +-target_link_libraries(zlog_s +- ${CMAKE_THREAD_PREFER_PTHREAD} +- ) +- +-if (WIN32) +- target_link_libraries(zlog_s +- ${UNIXEM_LIBRARY} +- Ws2_32 +- ) +-endif() +- +-set_target_properties(zlog_s PROPERTIES OUTPUT_NAME zlog) +- + #================================================================ + # generate zlog-chk-conf + #================================================================ +@@ -53,7 +35,7 @@ target_link_libraries(zlog-chk-conf zlog) + # install + #================================================================ + install(TARGETS +- zlog zlog_s zlog-chk-conf ++ zlog zlog-chk-conf + COMPONENT zlog + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib diff --git a/packages/z/zlog/xmake.lua b/packages/z/zlog/xmake.lua new file mode 100644 index 000000000..7b76c3410 --- /dev/null +++ b/packages/z/zlog/xmake.lua @@ -0,0 +1,26 @@ +package("zlog") + set_homepage("https://github.com/HardySimpson/zlog") + set_description("A reliable, high-performance, thread safe, flexsible, clear-model, pure C logging library.") + set_license("Apache-2.0") + + add_urls("https://github.com/HardySimpson/zlog/archive/refs/tags/$(version).tar.gz", + "https://github.com/HardySimpson/zlog.git") + + add_versions("1.2.17", "7fe412130abbb75a0779df89ae407db5d8f594435cc4ff6b068d924e13fd5c68") + + add_patches("1.2.17", "patches/1.2.17/cmake.patch", "0558364a4a4a2d54375fffb1ae33877562058d90865712bb7519c9219b0f79e7") + + add_syslinks("pthread") + + add_deps("cmake") + + on_install("linux", "macosx", "cross", "iphoneos", function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("zlog_init", {includes = "zlog.h"})) + end) diff --git a/packages/z/zmqpb/xmake.lua b/packages/z/zmqpb/xmake.lua index 0e56ea123..d28473f88 100644 --- a/packages/z/zmqpb/xmake.lua +++ b/packages/z/zmqpb/xmake.lua @@ -6,21 +6,42 @@ package("zmqpb") set_urls("https://github.com/SFGrenade/ZmqPb/archive/refs/tags/v$(version).tar.gz", "https://github.com/SFGrenade/ZmqPb.git") add_versions("0.1", "4a34ec92faa381306356e84e2a2000093d8f76cfa037db1f4cd0adb0205faebb") + add_versions("0.2", "5dfa4d4cebb10cb7ae03943e18e8d48c8ff215e80371f24c5ade212be7f20721") + add_versions("0.3", "343c57c9f72facca47082422a259ec8c531f5c6e332a3828835080c4a96b9064") + add_versions("0.4", "7c0001db73b19e65b007adf6c9c5092c3589f043ab3e95a16b3ec2b2a87fa244") + add_versions("0.8", "93433dfe60b09add321d5f6fd467724409929211010963ad63be6c68494446ed") + add_versions("0.9", "c4192777fd7d62b3624a6389efea68a772c4f2820c3d85128961c3dd5ee94a67") add_deps("cppzmq") - add_deps("fmt") add_deps("protobuf-cpp") + -- protobuf needs it and somehow just doesn't publicizes the linkage + add_deps( "utf8_range" ) - on_install("windows", "macosx", "linux", function (package) + on_load("windows", "macosx", "linux", function (package) + if not package:gitref() and package:version():lt("0.3") then + package:add("deps", "fmt") + end + end) + + on_install("windows|native", "macosx", "linux", function (package) local configs = {} import("package.tools.xmake").install(package, configs) end) on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - void test() { - ZmqPb::ReqRep network( "tcp://127.0.0.1", 13337, false ); - network.run(); - } - ]]}, {configs = {languages = "c++14"}, includes = "zmqPb/reqRep.hpp"})) + if package:gitref() or package:version():ge("0.3") then + assert(package:check_cxxsnippets({test = [[ + void test() { + ZmqPb::ReqRep network( "tcp://127.0.0.1:13337", false ); + network.run(); + } + ]]}, {configs = {languages = "c++17"}, includes = "zmqPb/reqRep.hpp"})) + else + assert(package:check_cxxsnippets({test = [[ + void test() { + ZmqPb::ReqRep network( "tcp://127.0.0.1", 13337, false ); + network.run(); + } + ]]}, {configs = {languages = "c++14"}, includes = "zmqPb/reqRep.hpp"})) + end end) diff --git a/packages/z/zopfli/xmake.lua b/packages/z/zopfli/xmake.lua new file mode 100644 index 000000000..7cf157934 --- /dev/null +++ b/packages/z/zopfli/xmake.lua @@ -0,0 +1,20 @@ +package("zopfli") + set_homepage("https://github.com/google/zopfli") + set_description("Zopfli Compression Algorithm is a compression library programmed in C to perform very good, but slow, deflate or zlib compression.") + set_license("Apache-2.0") + + add_urls("https://github.com/google/zopfli.git") + add_versions("2021.06.14", "831773bc28e318b91a3255fa12c9fcde1606058b") + + add_deps("cmake") + + on_install(function (package) + local configs = {"-DZOPFLI_BUILD_INSTALL=ON"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("ZopfliCompress", {includes = "zopfli.h"})) + end) diff --git a/packages/z/zpp_throwing/xmake.lua b/packages/z/zpp_throwing/xmake.lua new file mode 100644 index 000000000..10c75b4b3 --- /dev/null +++ b/packages/z/zpp_throwing/xmake.lua @@ -0,0 +1,32 @@ +package("zpp_throwing") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/eyalz800/zpp_throwing") + set_description("Using coroutines to implement C++ exceptions for freestanding environments") + set_license("MIT") + + add_urls("https://github.com/eyalz800/zpp_throwing/archive/refs/tags/$(version).tar.gz", + "https://github.com/eyalz800/zpp_throwing.git") + + add_versions("v1.0.1", "c15651ad36f9ddcb51e6244b0a78dbdebf7be8748b3e7ffe1c7339f0e41fd411") + + on_install("linux", "macosx", "bsd", "mingw", "msys", "android", "iphoneos", "cross", "wasm", function (package) + os.cp("zpp_throwing.h", package:installdir("include")) + end) + + on_test(function (package) + local cxxflags + if package:is_plat("windows") then + cxxflags = {"/EHsc-", "/GR-"} + else + cxxflags = {"-fno-exceptions", "-fno-rtti"} + end + assert(package:check_cxxsnippets({test = [[ + #include + zpp::throwing test(bool success) { + if (!success) { + co_yield std::runtime_error("My runtime error"); + } + co_return 1337; + } + ]]}, {configs = {languages = "c++20", cxxflags = cxxflags}})) + end) diff --git a/packages/z/zxing-cpp/xmake.lua b/packages/z/zxing-cpp/xmake.lua new file mode 100644 index 000000000..5f4e92b0a --- /dev/null +++ b/packages/z/zxing-cpp/xmake.lua @@ -0,0 +1,63 @@ +package("zxing-cpp") + set_homepage("https://github.com/zxing-cpp/zxing-cpp") + set_description("C++ port of ZXing") + set_license("Apache-2.0") + + add_urls("https://github.com/zxing-cpp/zxing-cpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/zxing-cpp/zxing-cpp.git") + + add_versions("v2.2.1", "02078ae15f19f9d423a441f205b1d1bee32349ddda7467e2c84e8f08876f8635") + + add_configs("c_api", {description = "Build C API", default = false, type = "boolean"}) + add_configs("experimental", {description = "Build with experimental API", default = false, type = "boolean"}) + + if is_plat("linux", "bsd") then + add_syslinks("pthread") + end + + add_deps("cmake") + + on_install(function (package) + local configs = {"-DBUILD_EXAMPLES=OFF", "-DBUILD_C_API=OFF", "-DBUILD_DEPENDENCIES=LOCAL"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_EXPERIMENTAL_API=" .. (package:config("experimental") and "ON" or "OFF")) + + local cxflags = {} + if package:is_plat("windows") then + cxflags = table.wrap(package:config("cxflags")) + table.insert(cxflags, "/utf-8") + end + import("package.tools.cmake").install(package, configs, {cxflags = cxflags}) + + if package:config("c_api") then + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + set_languages("c++17") + target("ZXing-c") + set_kind("$(kind)") + add_files("wrappers/c/zxing-c.cpp") + add_headerfiles("wrappers/c/zxing-c.h", {prefixdir = "ZXing"}) + add_includedirs("core/src") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all", {export_classes = true}) + end + ]]) + import("package.tools.xmake").install(package) + end + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + int width, height; + unsigned char* data; + auto image = ZXing::ImageView(data, width, height, ZXing::ImageFormat::Lum); + } + ]]}, {configs = {languages = "c++17"}})) + + if package:config("c_api") then + assert(package:has_cfuncs("zxing_ImageView_new", {includes = "ZXing/zxing-c.h"})) + end + end) diff --git a/packages/z/zycore-c/xmake.lua b/packages/z/zycore-c/xmake.lua index cf35cef01..a921a00ff 100644 --- a/packages/z/zycore-c/xmake.lua +++ b/packages/z/zycore-c/xmake.lua @@ -5,13 +5,19 @@ package("zycore-c") add_urls("https://github.com/zyantific/zycore-c/archive/refs/tags/$(version).tar.gz", "https://github.com/zyantific/zycore-c.git") + + add_versions("v1.5.0", "68e287cb6c95a6dede810d1e4fb2aebf7a09473089570a847e9a2b115ff96ff4") + add_versions("v1.4.1", "8f610917c4254a69ec7e0c63492e9d0be9d18f4bb8fe91a3ff6ebed917d1f0f8") + add_versions("v1.4.0", "b5ff45647c59be733e746c3a0d3c8d8a81f9e46f868af88e65b0e581b1171855") + add_versions("v1.3.0", "547ed2902332b25e5a8eeb97d0fb268cb39c156bb04e70d66c28b25712b60346") + add_versions("v1.2.0", "6389ecee0c8176de9d61d40f2d3801d2371012ba415dc899665de4949ca4b35d") add_versions("v1.1.0", "b5496779b95206763980aad30db10e36a13a10ebaf2e74574cddf2ca744ad227") add_versions("v1.0.0", "aa93d6da992953693754834c130ce193980b7d7137ea2d41c2c1f618c65e4545") add_deps("cmake") - on_install(function (package) - if package:version():eq("v1.1.0") and package:is_plat("mingw") then + on_install("!wasm", function (package) + if package:version():ge("1.1.0") and package:version():le("1.2.0") and package:is_plat("mingw") then local rc_str = io.readfile("resources/VersionInfo.rc", {encoding = "utf16le"}) io.writefile("resources/VersionInfo.rc", rc_str, {encoding = "utf8"}) end diff --git a/packages/z/zydis/patches/v4.0.0/cmake.patch b/packages/z/zydis/patches/v4.0.0/cmake.patch new file mode 100644 index 000000000..6ff1b1782 --- /dev/null +++ b/packages/z/zydis/patches/v4.0.0/cmake.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5e812fb..0de18c8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -75,7 +75,7 @@ set(ZYAN_ZYCORE_PATH + # =============================================================================================== # + + if (ZYAN_SYSTEM_ZYCORE) +- find_package(Zycore) ++ + else () + # Try to initialize the Zycore submodule using Git + if (NOT EXISTS "${ZYAN_ZYCORE_PATH}/CMakeLists.txt" AND +@@ -127,8 +127,8 @@ set_target_properties("Zydis" PROPERTIES + VERSION "${Zydis_VERSION}" + SOVERSION "${Zydis_VERSION_MAJOR}.${Zydis_VERSION_MINOR}" + DEFINE_SYMBOL "ZYDIS_SHOULD_EXPORT") +-zyan_set_common_flags("Zydis") +-zyan_maybe_enable_wpo("Zydis") ++ ++ + + if (ZYDIS_FEATURE_FORMATTER AND NOT ZYDIS_FEATURE_DECODER) + message( +@@ -237,7 +237,7 @@ if (ZYDIS_BUILD_SHARED_LIB AND WIN32) + target_sources("Zydis" PRIVATE "resources/VersionInfo.rc") + endif () + +-zyan_set_source_group("Zydis") ++ + + configure_package_config_file(cmake/zydis-config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/zydis-config.cmake" diff --git a/packages/z/zydis/patches/v4.1.0/cmake.patch b/packages/z/zydis/patches/v4.1.0/cmake.patch new file mode 100644 index 000000000..47ba68336 --- /dev/null +++ b/packages/z/zydis/patches/v4.1.0/cmake.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 62d5de6..526cf6b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -138,7 +138,7 @@ function (locate_zycore) + ) + endfunction () + +-locate_zycore() ++ + + # =============================================================================================== # + # Library configuration # +@@ -163,8 +163,8 @@ set_target_properties("Zydis" PROPERTIES + VERSION "${Zydis_VERSION}" + SOVERSION "${Zydis_VERSION_MAJOR}.${Zydis_VERSION_MINOR}" + DEFINE_SYMBOL "ZYDIS_SHOULD_EXPORT") +-zyan_set_common_flags("Zydis") +-zyan_maybe_enable_wpo("Zydis") ++ ++ + + if (ZYDIS_FEATURE_FORMATTER AND NOT ZYDIS_FEATURE_DECODER) + message( +@@ -273,7 +273,7 @@ if (ZYDIS_BUILD_SHARED_LIB AND WIN32) + target_sources("Zydis" PRIVATE "resources/VersionInfo.rc") + endif () + +-zyan_set_source_group("Zydis") ++ + + configure_package_config_file(cmake/zydis-config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/zydis-config.cmake" diff --git a/packages/z/zydis/xmake.lua b/packages/z/zydis/xmake.lua index 0f6a945f9..d47c1b4f3 100644 --- a/packages/z/zydis/xmake.lua +++ b/packages/z/zydis/xmake.lua @@ -5,36 +5,83 @@ package("zydis") add_urls("https://github.com/zyantific/zydis/archive/refs/tags/$(version).tar.gz", "https://github.com/zyantific/zydis.git") + + add_versions("v4.1.0", "31f23de8abb4cc2efa0fd0e827bbabcaa0f3d00fcaed8598e05295ba7b3806ad") + add_versions("v4.0.0", "14e991fd97b021e15c77a4726a0ae8a4196d6521ab505acb5c51fc2f9be9530a") add_versions("v3.2.1", "349a2d27270e54499b427051dd45f7b6064811b615588414b096cdeeaeb730ad") + add_patches("v3.2.1", path.join(os.scriptdir(), "patches", "v3.2.1", "cmake.patch"), "8464810921f507206b8c21618a20de0f5b96cbef7656ebc549079f941f8718fc") - + + add_configs("tools", {description = "Build tools.", default = false, type = "boolean"}) + add_configs("decoder", {description = "Enable instruction decoding functionality", default = true, type = "boolean"}) + add_configs("encoder", {description = "Enable instruction encoding functionality", default = true, type = "boolean"}) + add_configs("formatter", {description = "Enable instruction formatting functionality", default = true, type = "boolean"}) + add_configs("avx512", {description = "Enable support for AVX-512 instructions", default = true, type = "boolean"}) + add_configs("knc", {description = "Enable support for KNC instructions", default = true, type = "boolean"}) + add_configs("segment", {description = "Enable instruction segment API", default = true, type = "boolean"}) + add_deps("cmake") - add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + on_load(function (package) local zycore_c_vers = { ["v3.2.1"] = "v1.1.0", - ["v4.0.0"] = "v1.2.0" + ["v4.0.0"] = "v1.4.0", + ["v4.1.0"] = "v1.5.0", } package:add("deps", "zycore-c " .. zycore_c_vers[package:version_str()]) + + if package:is_plat("android") then + package:add("patches", "4.0.0", "patches/v4.0.0/cmake.patch", "061b2286e8e96178294f8b25e0c570bf65f8739848ea1de57dd36be710001da4") + package:add("patches", "4.1.0", "patches/v4.1.0/cmake.patch", "68f0b5d8e043503f26be441cf2f920a215cf1eb1b59205933c3653468f3ccd94") + end end) on_install("windows", "macosx", "linux", "bsd", "cross", "mingw", "android", function (package) - local configs = {} + if package:is_plat("mingw") and package:version():ge("3.2.1") then + local rc_str = io.readfile("resources/VersionInfo.rc", {encoding = "utf16le"}) + io.writefile("resources/VersionInfo.rc", rc_str, {encoding = "utf8"}) + elseif package:is_plat("macosx") then + if package:version():eq("3.2.1") then + io.replace("include/Zydis/ShortString.h", "#pragma pack(push, 1)","", {plain = true}) + io.replace("include/Zydis/ShortString.h", "#pragma pack(pop)","", {plain = true}) + elseif package:version():eq("4.0.0") then + io.replace("include/Zydis/ShortString.h", "# pragma pack(push, 1)","", {plain = true}) + io.replace("include/Zydis/ShortString.h", "# pragma pack(pop)","", {plain = true}) + end + elseif package:is_plat("windows") and package:version():ge("4.0.0") and (not package:config("shared")) then + package:add("defines", "ZYDIS_STATIC_BUILD") + end + + if package:version():ge("4.1.0") then + io.replace("CMakeLists.txt", "set(ZYDIS_ROOT_PROJECT ON)", "", {plain = true}) + end + + local configs = {"-DZYAN_SYSTEM_ZYCORE=ON"} table.insert(configs, "-DZYDIS_BUILD_EXAMPLES=OFF") table.insert(configs, "-DZYDIS_BUILD_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF")) - if package:config("shared") then - table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") + table.insert(configs, "-DZYDIS_BUILD_TOOLS=" .. (package:config("tools") and "ON" or "OFF")) + + local configs_macro = { + "ZYDIS_DISABLE_DECODER", + "ZYDIS_DISABLE_ENCODER", + "ZYDIS_DISABLE_FORMATTER", + "ZYDIS_DISABLE_AVX512", + "ZYDIS_DISABLE_KNC", + "ZYDIS_DISABLE_SEGMENT", + } + + for _, macro in ipairs(configs_macro) do + local config = macro:gsub("ZYDIS_DISABLE_", "") + if package:config(config:lower()) then + table.insert(configs, "-DZYDIS_FEATURE_" .. config .. "=ON") + else + table.insert(configs, "-DZYDIS_FEATURE_" .. config .. "=OFF") + package:add("defines", macro) + end end import("package.tools.cmake").install(package, configs, {packagedeps = "zycore-c"}) end) on_test(function (package) - assert(package:check_cxxsnippets({test = [[ - #include - #include - void test() { - ZyanU8 encoded_instruction[ZYDIS_MAX_INSTRUCTION_LENGTH]; - ZyanUSize encoded_length = sizeof(encoded_instruction); - } - ]]}, {configs = {languages = "c++11"}})) + assert(package:has_cfuncs("ZydisDecoderInit", {includes = "Zydis/Zydis.h"})) end) diff --git a/packages/z/zziplib/xmake.lua b/packages/z/zziplib/xmake.lua index 61fd1fdfb..b3b092676 100644 --- a/packages/z/zziplib/xmake.lua +++ b/packages/z/zziplib/xmake.lua @@ -6,10 +6,14 @@ package("zziplib") add_urls("https://github.com/gdraheim/zziplib/archive/refs/tags/$(version).tar.gz", "https://github.com/gdraheim/zziplib.git") + add_versions("v0.13.76", "08b0e300126329c928a41b6d68e397379fad02469e34a0855d361929968ea4c0") + add_versions("v0.13.74", "319093aa98d39453f3ea2486a86d8a2fab2d5632f6633a2665318723a908eecf") add_versions("v0.13.72", "93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc") + add_versions("v0.13.73", "2aa9d317f70060101064863e4e8fe698c32301e2d293d2b4964608cf2d5b2d8b") add_deps("cmake", "zlib") on_install("windows", "macosx", "linux", function (package) + io.replace("zzip/CMakeLists.txt", "include ( CodeCoverage )", "", {plain = true}) local configs = {"-DZZIPTEST=OFF", "-DZZIPDOCS=OFF", "-DZZIPWRAP=OFF", "-DZZIPSDL=OFF", "-DZZIPMMAPPED=OFF", "-DZZIPFSEEKO=OFF", "-DZZIPBINS=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) diff --git a/scripts/automerge.lua b/scripts/automerge.lua new file mode 100644 index 000000000..bf14b54a8 --- /dev/null +++ b/scripts/automerge.lua @@ -0,0 +1,36 @@ + +function _get_autoupdate_pr_list() + local result = {} + local list = os.iorun("gh pr list --label auto-update --state open -R xmake-io/xmake-repo") + if list then + for _, line in ipairs(list:split("\n")) do + if line:find("Auto-update", 1, true) then + local id = line:match("(%d+)%s+Auto%-update") + if id then + table.insert(result, {id = id, title = line}) + end + end + end + end + return result +end + +function _check_pr_passed(id) + local ok = os.vexecv("gh", {"pr", "checks", id, "-R", "xmake-io/xmake-repo"}, {try = true}) + if ok == 0 then + return true + end +end + +function main() + local pr_list = _get_autoupdate_pr_list() + for _, info in ipairs(pr_list) do + local id = info.id + local title = info.title + print("checking %s ...", title) + if _check_pr_passed(id) then + print("pull/%d passed, it will be merged next.", id) + os.vexec("gh pr merge %d --squash -d -R xmake-io/xmake-repo", id) + end + end +end diff --git a/scripts/autoupdate.lua b/scripts/autoupdate.lua new file mode 100644 index 000000000..7934e6c6d --- /dev/null +++ b/scripts/autoupdate.lua @@ -0,0 +1,141 @@ +import("core.package.package") +import("core.base.semver") +import("core.base.hashset") +import("devel.git") +import("packages", {alias = "packages_util"}) + +function _load_package(packagename, packagedir, packagefile) + local funcinfo = debug.getinfo(package.load_from_repository) + if funcinfo and funcinfo.nparams == 3 then -- >= 2.7.8 + return package.load_from_repository(packagename, packagedir, {packagefile = packagefile}) + else + -- deprecated + return package.load_from_repository(packagename, nil, packagedir, packagefile) + end +end + +function _get_all_packages(pattern) + local packages = _g.packages + if not packages then + packages = {} + for _, packagedir in ipairs(os.dirs(path.join("packages", "*", "*"))) do + local packagename = path.filename(packagedir) + if not pattern or packagename:match(pattern) then + local packagefile = path.join(packagedir, "xmake.lua") + local instance = _load_package(packagename, packagedir, packagefile) + local basename = instance:get("base") + if instance and basename then + local basedir = path.join("packages", basename:sub(1, 1):lower(), basename:lower()) + local basefile = path.join(basedir, "xmake.lua") + instance._BASE = _load_package(basename, basedir, basefile) + end + if instance then + table.insert(packages, instance) + end + end + end + _g.packages = packages + end + return packages +end + +function _is_pending(instance, version) + local branch = "autoupdate-" .. instance:name() .. "-" .. version + local repourl = "git@github.com:xmake-io/xmake-repo.git" + local is_pending = false + local remote_branches = os.iorun("git ls-remote --head %s", repourl) + if remote_branches then + for _, remote_branch in ipairs(remote_branches:split("\n")) do + remote_branch = remote_branch:split("%s")[2] + if remote_branch == "refs/heads/" .. branch then + is_pending = true + break + end + end + end + return is_pending +end + +function _update_version(instance, version, shasum) + local branch = "autoupdate-" .. instance:name() .. "-" .. version + local branch_current = os.iorun("git branch --show-current"):trim() + local repourl = "git@github.com:xmake-io/xmake-repo.git" + os.vexec("git reset --hard HEAD") + os.vexec("git clean -fdx") + os.execv("git", {"branch", "-D", branch}, {try = true}) + os.vexec("git checkout dev") + os.vexec("git pull %s dev", repourl) + os.vexec("git branch %s", branch) + os.vexec("git checkout %s", branch) + local inserted = false + local scriptfile = path.join(instance:scriptdir(), "xmake.lua") + local version_current + if os.isfile(scriptfile) then + io.gsub(scriptfile, "add_versions%(\"(.-)\",%s+\"(.-)\"%)", function (v, h) + if not version_current or semver.compare(v, version_current) > 0 then + version_current = v + end + if not inserted then + inserted = true + return string.format('add_versions("%s", "%s")\n add_versions("%s", "%s")', version, shasum, v, h) + end + end) + end + if not inserted then + local versionfiles = instance:get("versionfiles") + if versionfiles then + for _, versionfile in ipairs(table.wrap(versionfiles)) do + if not os.isfile(versionfile) then + versionfile = path.join(instance:scriptdir(), versionfile) + end + if os.isfile(versionfile) then + io.insert(versionfile, 1, string.format("%s %s", version, shasum)) + inserted = true + end + end + end + end + if inserted then + local body = string.format("New version of %s detected (package version: %s, last github version: %s)", + instance:name(), version_current, version) + os.vexec("git add .") + os.vexec("git commit -a -m \"Update %s to %s\"", instance:name(), version) + os.vexec("git push %s %s:%s", repourl, branch, branch) + os.vexec("gh pr create --label \"auto-update\" --title \"Auto-update %s to %s\" --body \"%s\" -R xmake-io/xmake-repo -B dev -H %s", + instance:name(), version, body, branch) + end + os.vexec("git reset --hard HEAD") + os.vexec("git checkout %s", branch_current) +end + +function main(pattern) + local count = 0 + local maxcount = 5 + local instances = _get_all_packages(pattern) + if #instances < maxcount then + maxcount = #instances + end + math.randomseed(os.time()) + while count < maxcount and #instances > 0 do + local idx = math.random(#instances) + local instance = instances[idx] + local checkupdate_filepath = path.join(instance:scriptdir(), "checkupdate.lua") + if not os.isfile(checkupdate_filepath) then + checkupdate_filepath = path.join(os.scriptdir(), "checkupdate.lua") + end + local updated = false + if os.isfile(checkupdate_filepath) then + local checkupdate = import("checkupdate", {rootdir = path.directory(checkupdate_filepath), anonymous = true}) + local version, shasum = checkupdate(instance) + if version and shasum and not _is_pending(instance, version) then + cprint("package(%s): new version ${bright}%s${clear} found, shasum: ${bright}%s", instance:name(), version, shasum) + _update_version(instance, version, shasum) + updated = true + end + end + if updated then + count = count + 1 + end + table.remove(instances, idx) + end +end diff --git a/scripts/build_artifacts.lua b/scripts/build_artifacts.lua index 3ad48b2d2..c2b01949d 100644 --- a/scripts/build_artifacts.lua +++ b/scripts/build_artifacts.lua @@ -1,6 +1,7 @@ import("core.package.package") import("core.base.semver") -import("packages") +import("core.base.hashset") +import("packages", {alias = "packages_util"}) -- load package function _load_package(packagename, packagedir, packagefile) @@ -13,7 +14,7 @@ function _load_package(packagename, packagedir, packagefile) end end -function build_artifacts(name, versions) +function _build_artifacts(name, versions) local buildinfo = {name = name, versions = versions} print(buildinfo) os.tryrm("build-artifacts") @@ -47,25 +48,121 @@ function build_artifacts(name, versions) os.cd(oldir) end -function main() +function _get_latest_modified_packages() + print("find latest modified packages ..") + local instances = {} local files = os.iorun("git diff --name-only HEAD^") - for _, file in ipairs(files:split('\n'), string.trim) do - if file:find("packages", 1, true) and path.filename(file) == "xmake.lua" then + for _, file in ipairs(files:split('\n')) do + file = file:trim() + if file:find("packages", 1, true) and path.filename(file) == "xmake.lua" then assert(file == file:lower(), "%s must be lower case!", file) local packagedir = path.directory(file) local packagename = path.filename(packagedir) if #path.filename(path.directory(packagedir)) == 1 then local instance = _load_package(packagename, packagedir, file) - if instance and packages.is_supported(instance, "windows") + if instance and packages_util.is_supported(instance, "windows") and (instance.is_headeronly and not instance:is_headeronly()) then - local versions = instance:versions() - if versions and #versions > 0 then - table.sort(versions, function (a, b) return semver.compare(a, b) > 0 end) - local version_latest = versions[1] - build_artifacts(instance:name(), table.wrap(version_latest)) - end + table.insert(instances, instance) + print(" > %s", instance:name()) end end end end + print("%d found", #instances) + return instances +end + +function _get_all_packages() + local packages = _g.packages + if not packages then + packages = {} + for _, packagedir in ipairs(os.dirs(path.join("packages", "*", "*"))) do + local packagename = path.filename(packagedir) + local packagefile = path.join(packagedir, "xmake.lua") + local instance = _load_package(packagename, packagedir, packagefile) + local basename = instance:get("base") + if instance and basename then + local basedir = path.join("packages", basename:sub(1, 1):lower(), basename:lower()) + local basefile = path.join(basedir, "xmake.lua") + instance._BASE = _load_package(basename, basedir, basefile) + end + if instance and packages_util.is_supported(instance, "windows") + and (instance.is_headeronly and not instance:is_headeronly()) then + table.insert(packages, instance) + end + end + _g.packages = packages + end + return packages +end + +function _get_packagerefs_of(instance) + local packagerefs = {} + if instance:is_library() then + local packages = _get_all_packages() + for _, packageref in ipairs(packages) do + local deps = packageref:get("deps") + if deps and table.contains(table.wrap(deps), instance:name()) then + table.insert(packagerefs, packageref) + end + end + end + return packagerefs +end + +function _get_packagerefs_in_latest_24h() + print("find packagerefs in latest 24h ..") + local instances = {} + local list = os.iorun("git log --since=\"24 hours ago\" --oneline") + local lines = list:split('\n') + if #lines > 0 then + local line = lines[#lines] + local commit = line:split(" ")[1] + if commit and #commit == 8 then + local files = os.iorun("git diff --name-only " .. commit .. "^") + for _, file in ipairs(files:split('\n')) do + file = file:trim() + if file:find("packages", 1, true) and path.filename(file) == "xmake.lua" then + assert(file == file:lower(), "%s must be lower case!", file) + local packagedir = path.directory(file) + local packagename = path.filename(packagedir) + if #path.filename(path.directory(packagedir)) == 1 then + local instance = _load_package(packagename, packagedir, file) + if instance and packages_util.is_supported(instance, "windows") + and (instance.is_headeronly and not instance:is_headeronly()) then + table.insert(instances, instance) + end + end + end + end + end + end + local packagerefs = hashset.new() + for _, instance in ipairs(instances) do + print("%s: ", instance:name()) + for _, packageref in ipairs(_get_packagerefs_of(instance)) do + packagerefs:insert(packageref) + print(" -> %s", packageref:name()) + end + end + local result = {} + for _, packageref in packagerefs:keys() do + if #result < 24 then + table.insert(result, packageref) + end + end + print("%d found", #result) + return result +end + +function main(updaterefs) + local instances = updaterefs and _get_packagerefs_in_latest_24h() or _get_latest_modified_packages() + for _, instance in ipairs(instances) do + local versions = instance:versions() + if versions and #versions > 0 then + table.sort(versions, function (a, b) return semver.compare(a, b) > 0 end) + local version_latest = versions[1] + _build_artifacts(instance:name(), table.wrap(version_latest)) + end + end end diff --git a/scripts/checkupdate.lua b/scripts/checkupdate.lua new file mode 100644 index 000000000..b43df0a84 --- /dev/null +++ b/scripts/checkupdate.lua @@ -0,0 +1,129 @@ +import("core.base.semver") +import("net.http") +import("devel.git") +import("private.action.require.impl.utils.filter") + +function shasum_of(package, url, version) + local shasum + local tmpfile = os.tmpfile() + package:version_set(version) + url = filter.handle(url, package) + local ok = try { function() http.download(url, tmpfile); return true end } + if ok and os.isfile(tmpfile) and os.filesize(tmpfile) > 1024 then + shasum = hash.sha256(tmpfile) + end + os.tryrm(tmpfile) + return shasum +end + +function _is_valid_version(version) + if not semver.is_valid(version) then + return false + end + local v = semver.new(version) + local prerelease = v:prerelease() + if prerelease and #prerelease > 0 then + return false + end + return true +end + +function _get_version_and_shasum(package, url, version_latest) + if version_latest then + local has_prefix_v = false + for _, version in ipairs(package:versions()) do + if version:startswith("v") then + has_prefix_v = true + end + if semver.compare(version, version_latest) >= 0 then + version_latest = nil + break + end + end + if version_latest then + if has_prefix_v and not version_latest:startswith("v") then + version_latest = "v" .. version_latest + elseif not has_prefix_v and version_latest:startswith("v") then + version_latest = version_latest:sub(2) + end + end + end + if version_latest then + local shasum = shasum_of(package, url, version_latest) + if shasum then + return version_latest, shasum + end + end +end + +function _check_version_from_github_tags(package, url) + local repourl = url:match("https://github%.com/.-/.-/") + if repourl then + print("checking version from github tags %s ..", repourl) + local version_latest + local tags = git.tags(repourl) + for _, tag in ipairs(tags) do + if _is_valid_version(tag) and (not version_latest or semver.compare(tag, version_latest) > 0) then + version_latest = tag + end + end + if version_latest then + return _get_version_and_shasum(package, url, version_latest) + end + end +end + +function _check_version_from_github_releases(package, url) + local repourl = url:match("https://github%.com/.-/.-/") + if repourl then + print("checking version from github releases %s ..", repourl) + local list = try {function() return os.iorunv("gh", {"release", "list", "--exclude-drafts", "--exclude-pre-releases", "-R", repourl}) end} + if not list then + list = os.iorunv("gh", {"release", "list", "-R", repourl}) + end + if list then + local version_latest + for _, line in ipairs(list:split("\n")) do + local splitinfo = line:split("%s+") + local release = splitinfo[1] + local version = splitinfo[#splitinfo - 1] + if not version or not _is_valid_version(version) and _is_valid_version(release) then + version = release + end + if version and _is_valid_version(version) then + version_latest = version + break + end + end + if version_latest then + return _get_version_and_shasum(package, url, version_latest) + end + end + end +end + +function _version_is_behind_conditions(package) + local scriptfile = path.join(package:scriptdir(), "xmake.lua") + local file = io.open(scriptfile) + for line in file:lines() do + local pos = line:find("add_versions", 1, true) or line:find("add_versionfiles", 1, true) + if pos and pos > 5 then + return true + end + end + file:close() +end + +function main(package) + local checkers = { + ["https://github%.com/.-/.-/archive/refs/tags/.*"] = _check_version_from_github_tags, + ["https://github%.com/.-/.-/releases/download/.*"] = _check_version_from_github_releases + } + for _, url in ipairs(package:urls()) do + for pattern, checker in pairs(checkers) do + if url:match(pattern) and not _version_is_behind_conditions(package) then + return checker(package, url) + end + end + end +end diff --git a/scripts/monkey.lua b/scripts/monkey.lua deleted file mode 100644 index b71ffd453..000000000 --- a/scripts/monkey.lua +++ /dev/null @@ -1,170 +0,0 @@ --- imports -import("core.base.option") -import("core.platform.platform") -import("packages", {alias = "get_packages"}) - --- the options -local options = -{ - {'v', "verbose", "k", nil, "Enable verbose information." } -, {'D', "diagnosis", "k", nil, "Enable diagnosis information." } -, {nil, "shallow", "k", nil, "Only install the root packages." } -, {'k', "kind", "kv", nil, "Enable static/shared library." } -, {'p', "plat", "kv", nil, "Set the given platform." } -, {'a', "arch", "kv", nil, "Set the given architecture." } -, {'m', "mode", "kv", nil, "Set the given mode." } -, {nil, "cflags", "kv", nil, "Set the cflags." } -, {nil, "cxxflags", "kv", nil, "Set the cxxflags." } -, {nil, "ldflags", "kv", nil, "Set the ldflags." } -, {nil, "ndk", "kv", nil, "Set the android NDK directory." } -, {nil, "sdk", "kv", nil, "Set the SDK directory of cross toolchain." } -, {nil, "vs_sdkver", "kv", nil, "Set the Windows SDK version." } -, {nil, "vs_runtime", "kv", nil, "Set the VS Runtime library." } -, {nil, "mingw", "kv", nil, "Set the MingW directory." } -, {nil, "toolchain", "kv", nil, "Set the toolchain name." } -, {nil, "packages", "vs", nil, "The package list." } -} - - --- require packages -function _require_packages(argv, packages) - local config_argv = {"f", "-c"} - if argv.verbose then - table.insert(config_argv, "-v") - end - if argv.diagnosis then - table.insert(config_argv, "-D") - end - if argv.plat then - table.insert(config_argv, "--plat=" .. argv.plat) - end - if argv.arch then - table.insert(config_argv, "--arch=" .. argv.arch) - end - if argv.mode then - table.insert(config_argv, "--mode=" .. argv.mode) - end - if argv.ndk then - table.insert(config_argv, "--ndk=" .. argv.ndk) - end - if argv.sdk then - table.insert(config_argv, "--sdk=" .. argv.sdk) - end - if argv.vs_sdkver then - table.insert(config_argv, "--vs_sdkver=" .. argv.vs_sdkver) - end - if argv.vs_runtime then - table.insert(config_argv, "--vs_runtime=" .. argv.vs_runtime) - end - if argv.mingw then - table.insert(config_argv, "--mingw=" .. argv.mingw) - end - if argv.toolchain then - table.insert(config_argv, "--toolchain=" .. argv.toolchain) - end - if argv.cflags then - table.insert(config_argv, "--cflags=" .. argv.cflags) - end - if argv.cxxflags then - table.insert(config_argv, "--cxxflags=" .. argv.cxxflags) - end - if argv.ldflags then - table.insert(config_argv, "--ldflags=" .. argv.ldflags) - end - os.vexecv("xmake", config_argv) - local require_argv = {"require", "-f", "-y"} - if argv.verbose then - table.insert(require_argv, "-v") - end - if argv.diagnosis then - table.insert(require_argv, "-D") - end - if argv.shallow then - table.insert(require_argv, "--shallow") - end - if argv.mode == "debug" and argv.kind == "shared" then - table.insert(require_argv, "--extra={debug=true,configs={shared=true}}") - elseif argv.mode == "debug" then - table.insert(require_argv, "--extra={debug=true}") - elseif argv.kind == "shared" then - table.insert(require_argv, "--extra={configs={shared=true}}") - end - table.join2(require_argv, packages) - os.vexecv("xmake", require_argv) -end - --- the given package is supported? -function _package_is_supported(argv, packagename) - local packages = get_packages() - if packages then - local plat = argv.plat or os.subhost() - local packages_plat = packages[plat] - for _, package in ipairs(packages_plat) do - if package and packagename:split("%s+")[1] == package.name then - local arch = argv.arch or platform.archs(plat)[1] or os.arch() - for _, package_arch in ipairs(package.archs) do - if arch == package_arch then - return true - end - end - end - end - end -end - --- the main entry -function main(...) - - -- parse arguments - local argv = option.parse({...}, options, "Test all the given or changed packages.") - - -- get packages - math.randomseed(os.time()) - local packages = argv.packages or {} - if #packages == 0 then - local files = os.files(path.join(os.scriptdir(), "..", "packages", "*", "*", "xmake.lua")) - local limit = is_host("bsd") and 1 or 10 - while #packages < limit do - local file = files[math.random(#files)] - if file:find("packages", 1, true) and path.filename(file) == "xmake.lua" then - assert(file == file:lower(), "%s must be lower case!", file) - local package = path.filename(path.directory(file)) - table.insert(packages, package) - end - end - end - if #packages == 0 then - table.insert(packages, "tbox dev") - end - - -- remove unsupported packages - for idx, package in irpairs(packages) do - assert(package == package:lower(), "package(%s) must be lower case!", package) - if not _package_is_supported(argv, package) then - table.remove(packages, idx) - end - end - if #packages == 0 then - print("no testable packages on %s!", argv.plat or os.subhost()) - return - end - - -- prepare test project - local repodir = os.curdir() - local workdir = path.join(os.tmpdir(), "xmake-repo") - print(packages) - os.setenv("XMAKE_STATS", "false") - os.tryrm(workdir) - os.mkdir(workdir) - os.cd(workdir) - os.exec("xmake create test") - os.cd("test") - print(os.curdir()) - os.exec("xmake repo --add local-repo %s", repodir) - os.exec("xmake repo -l") - - -- require packages - for _, package in ipairs(packages) do - _require_packages(argv, package) - end -end diff --git a/scripts/new.lua b/scripts/new.lua index fcda51a03..b6f989c75 100644 --- a/scripts/new.lua +++ b/scripts/new.lua @@ -58,6 +58,41 @@ local function get_github_data(reponame) return {data = data, host = host} end +local function get_license_spdx_id(key) + local licenses = { + ["apache-2.0"] = "Apache-2.0", + ["lgpl-2.0"] = "LGPL-2.0", + ["lgpl-2.1"] = "LGPL-2.1", + ["agpl-3.0"] = "AGPL-3.0", + ["bsd-2-clause"] = "BSD-2-Clause", + ["bsd-3-clause"] = "BSD-3-Clause", + ["bsl-1.0"] = "BSL-1.0", + ["cc0-1.0"] = "CC0-1.0", + ["epl-2.0"] = "EPL-2.0", + ["gpl-2.0"] = "GPL-2.0", + ["gpl-3.0"] = "GPL-3.0", + ["mpl-2.0"] = "MPL-2.0", + zlib = "zlib", + mit = "MIT", + } + local license = licenses[key] + if license then + return license + end + + local url = string.format("https://api.github.com/licenses/%s", key) + local tmpfile = os.tmpfile({ramdisk = false}) + local ok = try { function () http.download(url, tmpfile); return true end } + if not ok then + os.tryrm(tmpfile) + return nil + end + local license_detail = json.loadfile(tmpfile) + license = license_detail["spdx_id"] + os.tryrm(tmpfile) + return license +end + function generate_package(reponame, get_data) local repo_data = get_data(reponame) local data = repo_data.data @@ -80,14 +115,7 @@ function generate_package(reponame, get_data) -- define license if available if type(data.licenseInfo) == "table" and data.licenseInfo.key then - local licenses = { - ["apache-2.0"] = "Apache-2.0", - ["lgpl-2.0"] = "LGPL-2.0", - ["lgpl-2.1"] = "LGPL-2.1", - zlib = "zlib", - mit = "MIT", - } - local license = licenses[data.licenseInfo.key] + local license = get_license_spdx_id(data.licenseInfo.key) if license then file:print(' set_license("%s")', license) end @@ -226,9 +254,9 @@ function generate_package(reponame, get_data) -- add dependencies if build_system then - file:print('') local deps = table.wrap(build_system.deps) if deps and #deps > 0 then + file:print('') file:print(' add_deps("' .. table.concat(deps, '", "') .. '")') end end diff --git a/scripts/packages.lua b/scripts/packages.lua index a021da61c..1b9b1ce03 100644 --- a/scripts/packages.lua +++ b/scripts/packages.lua @@ -1,60 +1,22 @@ -- imports import("core.package.package") import("core.platform.platform") +import("private.core.base.select_script") -- is supported platform and architecture? function is_supported(instance, plat, arch, opt) -- ignore template package - if instance.is_template and instance:is_template() then + if instance:is_template() then return false end - -- get script + -- has install script? local script = instance:get("install") - local result = nil - if type(script) == "function" then - result = script - elseif type(script) == "table" then - - -- get plat and arch - local plat = plat or "" - local arch = arch or "" - - -- match pattern - -- - -- `@linux` - -- `@linux|x86_64` - -- `@macosx,linux` - -- `android@macosx,linux` - -- `android|armeabi-v7a@macosx,linux` - -- `android|armeabi-v7a@macosx,linux|x86_64` - -- `android|armeabi-v7a@linux|x86_64` - -- - for _pattern, _script in pairs(script) do - local hosts = {} - local hosts_spec = false - _pattern = _pattern:gsub("@(.+)", function (v) - for _, host in ipairs(v:split(',')) do - hosts[host] = true - hosts_spec = true - end - return "" - end) - if _pattern:trim() == "" and opt and opt.onlyhost then - _pattern = os.subhost() - end - if not _pattern:startswith("__") and (not hosts_spec or hosts[os.subhost() .. '|' .. os.subarch()] or hosts[os.subhost()]) - and (_pattern:trim() == "" or (plat .. '|' .. arch):find('^' .. _pattern .. '$') or plat:find('^' .. _pattern .. '$')) then - result = _script - break - end - end - - -- get generic script - result = result or script["__generic__"] + if not select_script(script, {plat = plat, arch = arch}) then + return false end - return result + return true end -- load package diff --git a/scripts/test.lua b/scripts/test.lua index 47282bd3d..71c2019bc 100644 --- a/scripts/test.lua +++ b/scripts/test.lua @@ -1,6 +1,7 @@ -- imports import("core.base.option") import("core.platform.platform") +import("core.package.package", {alias = "core_package"}) import("packages", {alias = "get_packages"}) -- the options @@ -18,6 +19,7 @@ local options = , {'d', "debugdir", "kv", nil, "Set the debug source directory." } , {nil, "fetch", "k", nil, "Fetch package only." } , {nil, "precompiled", "k", nil, "Attemp to install the precompiled package." } +, {nil, "remote", "k", nil, "Test package on the remote server." } , {nil, "linkjobs", "kv", nil, "Set the link jobs." } , {nil, "cflags", "kv", nil, "Set the cflags." } , {nil, "cxxflags", "kv", nil, "Set the cxxflags." } @@ -28,7 +30,8 @@ local options = , {nil, "vs", "kv", nil, "Set the VS Compiler version." } , {nil, "vs_sdkver", "kv", nil, "Set the Windows SDK version." } , {nil, "vs_toolset", "kv", nil, "Set the Windows Toolset version." } -, {nil, "vs_runtime", "kv", nil, "Set the VS Runtime library." } +, {nil, "vs_runtime", "kv", nil, "Set the VS Runtime library (deprecated)." } +, {nil, "runtimes", "kv", nil, "Set the Runtime libraries." } , {nil, "xcode_sdkver", "kv", nil, "The SDK Version for Xcode" } , {nil, "target_minver", "kv", nil, "The Target Minimal Version" } , {nil, "appledev", "kv", nil, "The Apple Device Type" } @@ -37,6 +40,16 @@ local options = , {nil, "packages", "vs", nil, "The package list." } } +-- check package is supported? +function _check_package_is_supported() + for _, names in pairs(core_package.apis()) do + for _, name in ipairs(names) do + if type(name) == "string" and name == "package.on_check" then + return true + end + end + end +end -- require packages function _require_packages(argv, packages) @@ -74,8 +87,13 @@ function _require_packages(argv, packages) if argv.vs_toolset then table.insert(config_argv, "--vs_toolset=" .. argv.vs_toolset) end - if argv.vs_runtime then - table.insert(config_argv, "--vs_runtime=" .. argv.vs_runtime) + local runtimes = argv.runtimes or argv.vs_runtime + if runtimes then + if is_host("windows") then + table.insert(config_argv, "--vs_runtime=" .. runtimes) + else + table.insert(config_argv, "--runtimes=" .. runtimes) + end end if argv.xcode_sdkver then table.insert(config_argv, "--xcode_sdkver=" .. argv.xcode_sdkver) @@ -103,14 +121,17 @@ function _require_packages(argv, packages) end os.vexecv("xmake", config_argv) local require_argv = {"require", "-f", "-y"} + local check_argv = {"require", "-f", "-y", "--check"} if not argv.precompiled then table.insert(require_argv, "--build") end if argv.verbose then table.insert(require_argv, "-v") + table.insert(check_argv, "-v") end if argv.diagnosis then table.insert(require_argv, "-D") + table.insert(check_argv, "-D") end local is_debug = false if argv.debugdir then @@ -150,8 +171,24 @@ function _require_packages(argv, packages) end local extra_str = string.serialize(extra, {indent = false, strip = true}) table.insert(require_argv, "--extra=" .. extra_str) - table.join2(require_argv, packages) - os.vexecv("xmake", require_argv) + table.insert(check_argv, "--extra=" .. extra_str) + + local install_packages = {} + if _check_package_is_supported() then + for _, package in ipairs(packages) do + local ok = os.vexecv("xmake", table.join(check_argv, package), {try = true}) + if ok == 0 then + table.insert(install_packages, package) + end + end + else + install_packages = packages + end + if #install_packages > 0 then + os.vexecv("xmake", table.join(require_argv, install_packages)) + else + print("no testable packages on %s or you're using lower version xmake!", argv.plat or os.subhost()) + end end -- the given package is supported? @@ -192,7 +229,7 @@ function main(...) for _, file in ipairs(files:split('\n'), string.trim) do if file:startswith("packages") then assert(file == file:lower(), "%s must be lower case!", file) - local package = file:match("packages/%w/(%S+)/") + local package = file:match("packages/%w/(%S-)/") table.insert(packages, package) end end @@ -218,12 +255,26 @@ function main(...) local workdir = path.join(os.tmpdir(), "xmake-repo") print(packages) os.setenv("XMAKE_STATS", "false") - os.tryrm(workdir) - os.mkdir(workdir) - os.cd(workdir) - os.exec("xmake create test") + if not os.isfile(path.join(workdir, "test", "xmake.lua")) then + os.tryrm(workdir) + os.mkdir(workdir) + os.cd(workdir) + os.exec("xmake create test") + else + os.cd(workdir) + end os.cd("test") print(os.curdir()) + -- do action for remote? + if os.isdir("xmake-repo") then + os.exec("xmake service --disconnect") + end + if argv.remote then + os.tryrm("xmake-repo") + os.cp(path.join(repodir, "packages"), "xmake-repo/packages") + os.exec("xmake service --connect") + repodir = "xmake-repo" + end os.exec("xmake repo --add local-repo %s", repodir) os.exec("xmake repo -l")