From ac252fab01be15f6b8236f9dfb14babb3ce86ea0 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Sat, 31 Aug 2024 13:36:30 -0400 Subject: [PATCH] Add GitHub Workflows to test changes --- .github/workflows/build.yml | 97 ++++ collections/clamav_deps-1.1.yaml | 109 ---- ...mav_deps-1.2.yaml => clamav_deps-1.5.yaml} | 2 +- ..._deps-1.1.yaml => libclamav_deps-1.5.yaml} | 2 +- recipes/clamav-1.1.yaml | 532 ------------------ recipes/{clamav-1.2.yaml => clamav-1.5.yaml} | 57 +- .../CMAKE_TOOLCHAIN_ARM64.patch | 25 + 7 files changed, 180 insertions(+), 644 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 collections/clamav_deps-1.1.yaml rename collections/{clamav_deps-1.2.yaml => clamav_deps-1.5.yaml} (99%) rename collections/{libclamav_deps-1.1.yaml => libclamav_deps-1.5.yaml} (99%) delete mode 100644 recipes/clamav-1.1.yaml rename recipes/{clamav-1.2.yaml => clamav-1.5.yaml} (90%) create mode 100644 recipes/clamav-patches/CMAKE_TOOLCHAIN_ARM64.patch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8cd6ace --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,97 @@ +name: ClamAV Build Test + +on: + pull_request: + branches: + - master + +jobs: + build-windows: + runs-on: windows-2019 + + steps: + - name: Remove link.exe to avoid conflict with Visual Studio linker + run: rm /usr/bin/link.exe + shell: bash + + - uses: actions/checkout@v4 + + - name: Install Choco Things + uses: crazy-max/ghaction-chocolatey@v3 + with: + args: install nasm + + - name: Install Python Things + run: python3 -m pip install pytest mussels + + - name: Install Rust for cross-compiling to arm64 + run: rustup target add aarch64-pc-windows-msvc + + - uses: lukka/get-cmake@v3.30.3 + + - name: Build for x64 + shell: bash + run: msl build -r clamav -t x64 + + - name: Build for x86 + shell: bash + run: msl build -r clamav -t x86 + + - name: Build for arm64 + shell: bash + run: msl build -r clamav -t arm64 + + # TODO: add test step that clones clamav, sets environment variables, and runs tests + + build-macos: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Brew Things + run: brew install bison flex pipx + + - name: Install Python Things + run: | + python3 -m pip install setuptools --break-system-packages + pipx install pytest mussels + + - uses: lukka/get-cmake@v3.30.3 + + - name: Build for using static libraries for host platform + shell: bash + run: msl build -r clamav -t host-static + + - name: Build for using dynamic libraries for host platform + shell: bash + run: msl build -r clamav -t host + + # TODO: add test step that clones clamav, sets environment variables, and runs tests + + build-ubuntu: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Update package listings + run: sudo apt-get update + + - name: Install Apt-get Things + run: sudo apt-get install -y bison flex valgrind pipx + + - name: Install Python Things + run: pipx install pytest mussels + + - uses: lukka/get-cmake@v3.30.3 + + - name: Build for using static libraries for host platform + shell: bash + run: msl build -r clamav -t host-static + + - name: Build for using dynamic libraries for host platform + shell: bash + run: msl build -r clamav -t host + + # TODO: add test step that clones clamav, sets environment variables, and runs tests diff --git a/collections/clamav_deps-1.1.yaml b/collections/clamav_deps-1.1.yaml deleted file mode 100644 index 49de7ea..0000000 --- a/collections/clamav_deps-1.1.yaml +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright (C) 2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: clamav_deps -version: "1.1" -mussels_version: "0.2" -type: collection -platforms: - Linux: - host: - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - host-static: - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - libcheck - - ncurses - Freebsd: - host: - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - host-static: - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - libcheck - - ncurses - Darwin: - host: - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - libcheck - - ncurses - host-static: - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - libcheck - - ncurses - Windows: - x64: - dependencies: - - libz - - libcurl - - libjson_c - - pthreads_win32 - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - pdcurses - - libcheck - x86: - dependencies: - - libz - - libcurl - - libjson_c - - pthreads_win32 - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - pdcurses - - libcheck diff --git a/collections/clamav_deps-1.2.yaml b/collections/clamav_deps-1.5.yaml similarity index 99% rename from collections/clamav_deps-1.2.yaml rename to collections/clamav_deps-1.5.yaml index 2f5f0b2..7d38233 100644 --- a/collections/clamav_deps-1.2.yaml +++ b/collections/clamav_deps-1.5.yaml @@ -13,7 +13,7 @@ # limitations under the License. name: clamav_deps -version: "1.2" +version: "1.5" mussels_version: "0.2" type: collection platforms: diff --git a/collections/libclamav_deps-1.1.yaml b/collections/libclamav_deps-1.5.yaml similarity index 99% rename from collections/libclamav_deps-1.1.yaml rename to collections/libclamav_deps-1.5.yaml index cc06052..0ca3d0f 100644 --- a/collections/libclamav_deps-1.1.yaml +++ b/collections/libclamav_deps-1.5.yaml @@ -13,7 +13,7 @@ # limitations under the License. name: libclamav_deps -version: "1.1" +version: "1.5" mussels_version: "0.2" type: collection platforms: diff --git a/recipes/clamav-1.1.yaml b/recipes/clamav-1.1.yaml deleted file mode 100644 index 7332baa..0000000 --- a/recipes/clamav-1.1.yaml +++ /dev/null @@ -1,532 +0,0 @@ -# Copyright (C) 2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO: Rewrite this to use the new CMake build system, when unit test support is complete. -name: clamav -version: "1.1.0" -url: https://github.com/Cisco-Talos/clamav/archive/rel/1.1.zip -archive_name_change: - - "1.1.0" - - clamav-rel-1.1 -mussels_version: "0.2" -type: recipe -platforms: - Darwin: - host: - build_script: - configure: | - mkdir build - cd build - cmake .. \ - -D CMAKE_INSTALL_PREFIX="{install}" \ - -D CMAKE_MODULE_PATH={install}/lib/cmake \ - -D CMAKE_BUILD_TYPE=Release \ - -D ENABLE_EXAMPLES=OFF \ - -D JSONC_INCLUDE_DIR="{install}/include/json-c" \ - -D JSONC_LIBRARY="{install}/lib/libjson-c.a" \ - -D ENABLE_JSON_SHARED=OFF \ - -D BZIP2_INCLUDE_DIR="{install}/include" \ - -D BZIP2_LIBRARY_RELEASE="{install}/lib/libbz2.a" \ - -D CURL_INCLUDE_DIR="{install}/include" \ - -D CURL_LIBRARY="{install}/lib/libcurl.dylib" \ - -D OPENSSL_ROOT_DIR="{install}" \ - -D OPENSSL_INCLUDE_DIR="{install}/include" \ - -D OPENSSL_CRYPTO_LIBRARY="{install}/lib/libcrypto.dylib" \ - -D OPENSSL_SSL_LIBRARY="{install}/lib/libssl.dylib" \ - -D LIBXML2_INCLUDE_DIR="{install}/include/libxml2" \ - -D LIBXML2_LIBRARY="{install}/lib/libxml2.dylib" \ - -D PCRE2_INCLUDE_DIR="{install}/include" \ - -D PCRE2_LIBRARY="{install}/lib/libpcre2-8.dylib" \ - -D CURSES_INCLUDE_DIR="{install}/include" \ - -D CURSES_LIBRARY="{install}/lib/libncurses.a" \ - -D ZLIB_INCLUDE_DIR="{install}/include" \ - -D ZLIB_LIBRARY="{install}/lib/libz.dylib" \ - -D LIBCHECK_INCLUDE_DIR="{install}/include" \ - -D LIBCHECK_LIBRARY="{install}/lib/libcheck.dylib" - make: | - cd build - cmake --build . - install: | - cd build - cmake --build . --target install - install_name_tool -add_rpath @executable_path/../lib "{install}/lib/libclamunrar_iface.so" - install_name_tool -add_rpath @executable_path/../lib "{install}/lib/libfreshclam.dylib" - install_name_tool -add_rpath @executable_path/../lib "{install}/lib/libclamav.dylib" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/clambc" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/clamconf" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/clamdscan" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/clamscan" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/clamsubmit" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/freshclam" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/sigtool" - install_name_tool -add_rpath @executable_path/../lib "{install}/sbin/clamd" - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - libcheck - - ncurses - install_paths: - license/clamav: - - COPYING* - required_tools: - - make - - clang - - pkgconfig - - cmake - host-static: - build_script: - configure: | - mkdir build - cd build - cmake .. \ - -D CMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE \ - -D CMAKE_PREFIX_PATH={install} \ - -D CMAKE_INSTALL_PREFIX="{install}" \ - -D CMAKE_MODULE_PATH={install}/lib/cmake \ - -D CMAKE_BUILD_TYPE=Release \ - -D ENABLE_EXAMPLES=OFF \ - -D JSONC_INCLUDE_DIR="{install}/include/json-c" \ - -D JSONC_LIBRARY="{install}/lib/libjson-c.a" \ - -D ENABLE_JSON_SHARED=OFF \ - -D BZIP2_INCLUDE_DIR="{install}/include" \ - -D BZIP2_LIBRARY_RELEASE="{install}/lib/libbz2.a" \ - -D OPENSSL_ROOT_DIR="{install}" \ - -D OPENSSL_INCLUDE_DIR="{install}/include" \ - -D OPENSSL_CRYPTO_LIBRARY="{install}/lib/libcrypto.a" \ - -D OPENSSL_SSL_LIBRARY="{install}/lib/libssl.a" \ - -D LIBXML2_INCLUDE_DIR="{install}/include/libxml2" \ - -D LIBXML2_LIBRARY="{install}/lib/libxml2.a" \ - -D PCRE2_INCLUDE_DIR="{install}/include" \ - -D PCRE2_LIBRARY="{install}/lib/libpcre2-8.a" \ - -D CURSES_INCLUDE_DIR="{install}/include" \ - -D CURSES_LIBRARY="{install}/lib/libncurses.a" \ - -D ZLIB_INCLUDE_DIR="{install}/include" \ - -D ZLIB_LIBRARY="{install}/lib/libz.a" \ - -D LIBCHECK_INCLUDE_DIR="{install}/include" \ - -D LIBCHECK_LIBRARY="{install}/lib/libcheck.a" - make: | - cd build - cmake --build . - install: | - cd build - cmake --build . --target install - install_name_tool -add_rpath @executable_path/../lib "{install}/lib/libclamunrar_iface.so" - install_name_tool -add_rpath @executable_path/../lib "{install}/lib/libfreshclam.dylib" - install_name_tool -add_rpath @executable_path/../lib "{install}/lib/libclamav.dylib" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/clambc" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/clamconf" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/clamdscan" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/clamscan" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/clamsubmit" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/freshclam" - install_name_tool -add_rpath @executable_path/../lib "{install}/bin/sigtool" - install_name_tool -add_rpath @executable_path/../lib "{install}/sbin/clamd" - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2 - - libcheck - - ncurses - install_paths: - license/clamav: - - COPYING* - required_tools: - - make - - clang - - pkgconfig - - cmake - Linux: - host: - build_script: - configure: | - mkdir build - cd build - cmake .. \ - -D CMAKE_INSTALL_PREFIX="{install}" \ - -D CMAKE_MODULE_PATH={install}/lib/cmake \ - -D CMAKE_BUILD_TYPE=Release \ - -D ENABLE_EXAMPLES=OFF \ - -D ENABLE_SYSTEMD=OFF \ - -D JSONC_INCLUDE_DIR="{install}/include/json-c" \ - -D JSONC_LIBRARY="{install}/lib/libjson-c.a" \ - -D ENABLE_JSON_SHARED=OFF \ - -D BZIP2_INCLUDE_DIR="{install}/include" \ - -D BZIP2_LIBRARY_RELEASE="{install}/lib/libbz2.a" \ - -D CURL_INCLUDE_DIR="{install}/include" \ - -D CURL_LIBRARY="{install}/lib/libcurl.so" \ - -D OPENSSL_ROOT_DIR="{install}" \ - -D OPENSSL_INCLUDE_DIR="{install}/include" \ - -D OPENSSL_CRYPTO_LIBRARY="{install}/lib/libcrypto.so" \ - -D OPENSSL_SSL_LIBRARY="{install}/lib/libssl.so" \ - -D LIBXML2_INCLUDE_DIR="{install}/include/libxml2" \ - -D LIBXML2_LIBRARY="{install}/lib/libxml2.so" \ - -D PCRE2_INCLUDE_DIR="{install}/include" \ - -D PCRE2_LIBRARY="{install}/lib/libpcre2-8.so" \ - -D CURSES_INCLUDE_DIR="{install}/include" \ - -D CURSES_LIBRARY="{install}/lib/libncurses.a" \ - -D ZLIB_INCLUDE_DIR="{install}/include" \ - -D ZLIB_LIBRARY="{install}/lib/libz.so" \ - -D LIBCHECK_INCLUDE_DIR="{install}/include" \ - -D LIBCHECK_LIBRARY="{install}/lib/libcheck.so" - make: | - cd build - cmake --build . - install: | - cd build - cmake --build . --target install - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libclamunrar_iface.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libfreshclam.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libclamav.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clambc" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamconf" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamdscan" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamscan" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamsubmit" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/freshclam" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/sigtool" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/sbin/clamd" - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - libcheck - - ncurses - install_paths: - license/clamav: - - COPYING* - required_tools: - - make - - gcc - - patchelf - - pkgconfig - - cmake - host-static: - build_script: - configure: | - mkdir build - cd build - cmake .. \ - -D CMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE \ - -D CMAKE_PREFIX_PATH={install} \ - -D CMAKE_INSTALL_PREFIX="{install}" \ - -D CMAKE_MODULE_PATH={install}/lib/cmake \ - -D CMAKE_BUILD_TYPE=Release \ - -D ENABLE_EXAMPLES=OFF \ - -D JSONC_INCLUDE_DIR="{install}/include/json-c" \ - -D JSONC_LIBRARY="{install}/lib/libjson-c.a" \ - -D ENABLE_JSON_SHARED=OFF \ - -D BZIP2_INCLUDE_DIR="{install}/include" \ - -D BZIP2_LIBRARY_RELEASE="{install}/lib/libbz2.a" \ - -D OPENSSL_ROOT_DIR="{install}" \ - -D OPENSSL_INCLUDE_DIR="{install}/include" \ - -D OPENSSL_CRYPTO_LIBRARY="{install}/lib/libcrypto.a" \ - -D OPENSSL_SSL_LIBRARY="{install}/lib/libssl.a" \ - -D LIBXML2_INCLUDE_DIR="{install}/include/libxml2" \ - -D LIBXML2_LIBRARY="{install}/lib/libxml2.a" \ - -D PCRE2_INCLUDE_DIR="{install}/include" \ - -D PCRE2_LIBRARY="{install}/lib/libpcre2-8.a" \ - -D CURSES_INCLUDE_DIR="{install}/include" \ - -D CURSES_LIBRARY="{install}/lib/libncurses.a" \ - -D ZLIB_INCLUDE_DIR="{install}/include" \ - -D ZLIB_LIBRARY="{install}/lib/libz.a" \ - -D LIBCHECK_INCLUDE_DIR="{install}/include" \ - -D LIBCHECK_LIBRARY="{install}/lib/libcheck.a" - make: | - cd build - cmake --build . - install: | - cd build - cmake --build . --target install - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libclamunrar_iface.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libfreshclam.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libclamav.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clambc" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamconf" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamdscan" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamscan" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamsubmit" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/freshclam" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/sigtool" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/sbin/clamd" - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2 - - libcheck - - ncurses - install_paths: - license/clamav: - - COPYING* - required_tools: - - make - - gcc - - patchelf - - pkgconfig - - cmake - Freebsd: - host: - build_script: - configure: | - mkdir build - cd build - cmake .. \ - -D CMAKE_INSTALL_PREFIX="{install}" \ - -D CMAKE_MODULE_PATH={install}/lib/cmake \ - -D CMAKE_BUILD_TYPE=Release \ - -D ENABLE_EXAMPLES=OFF \ - -D ENABLE_SYSTEMD=OFF \ - -D JSONC_INCLUDE_DIR="{install}/include/json-c" \ - -D JSONC_LIBRARY="{install}/lib/libjson-c.a" \ - -D ENABLE_JSON_SHARED=OFF \ - -D BZIP2_INCLUDE_DIR="{install}/include" \ - -D BZIP2_LIBRARY_RELEASE="{install}/lib/libbz2.a" \ - -D CURL_INCLUDE_DIR="{install}/include" \ - -D CURL_LIBRARY="{install}/lib/libcurl.so" \ - -D OPENSSL_ROOT_DIR="{install}" \ - -D OPENSSL_INCLUDE_DIR="{install}/include" \ - -D OPENSSL_CRYPTO_LIBRARY="{install}/lib/libcrypto.so" \ - -D OPENSSL_SSL_LIBRARY="{install}/lib/libssl.so" \ - -D LIBXML2_INCLUDE_DIR="{install}/include/libxml2" \ - -D LIBXML2_LIBRARY="{install}/lib/libxml2.so" \ - -D PCRE2_INCLUDE_DIR="{install}/include" \ - -D PCRE2_LIBRARY="{install}/lib/libpcre2-8.so" \ - -D CURSES_INCLUDE_DIR="{install}/include" \ - -D CURSES_LIBRARY="{install}/lib/libncurses.a" \ - -D ZLIB_INCLUDE_DIR="{install}/include" \ - -D ZLIB_LIBRARY="{install}/lib/libz.so" \ - -D LIBCHECK_INCLUDE_DIR="{install}/include" \ - -D LIBCHECK_LIBRARY="{install}/lib/libcheck.so" - make: | - cd build - cmake --build . - install: | - cd build - cmake --build . --target install - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libclamunrar_iface.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libfreshclam.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libclamav.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clambc" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamconf" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamdscan" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamscan" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamsubmit" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/freshclam" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/sigtool" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/sbin/clamd" - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - libcheck - - ncurses - install_paths: - license/clamav: - - COPYING* - required_tools: - - gmake - - clang - - patchelf - - pkgconfig - - cmake - host-static: - build_script: - configure: | - mkdir build - cd build - cmake .. \ - -D CMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE \ - -D CMAKE_PREFIX_PATH={install} \ - -D CMAKE_INSTALL_PREFIX="{install}" \ - -D CMAKE_MODULE_PATH={install}/lib/cmake \ - -D CMAKE_BUILD_TYPE=Release \ - -D ENABLE_EXAMPLES=OFF \ - -D JSONC_INCLUDE_DIR="{install}/include/json-c" \ - -D JSONC_LIBRARY="{install}/lib/libjson-c.a" \ - -D ENABLE_JSON_SHARED=OFF \ - -D BZIP2_INCLUDE_DIR="{install}/include" \ - -D BZIP2_LIBRARY_RELEASE="{install}/lib/libbz2.a" \ - -D OPENSSL_ROOT_DIR="{install}" \ - -D OPENSSL_INCLUDE_DIR="{install}/include" \ - -D OPENSSL_CRYPTO_LIBRARY="{install}/lib/libcrypto.a" \ - -D OPENSSL_SSL_LIBRARY="{install}/lib/libssl.a" \ - -D LIBXML2_INCLUDE_DIR="{install}/include/libxml2" \ - -D LIBXML2_LIBRARY="{install}/lib/libxml2.a" \ - -D PCRE2_INCLUDE_DIR="{install}/include" \ - -D PCRE2_LIBRARY="{install}/lib/libpcre2-8.a" \ - -D CURSES_INCLUDE_DIR="{install}/include" \ - -D CURSES_LIBRARY="{install}/lib/libncurses.a" \ - -D ZLIB_INCLUDE_DIR="{install}/include" \ - -D ZLIB_LIBRARY="{install}/lib/libz.a" \ - -D LIBCHECK_INCLUDE_DIR="{install}/include" \ - -D LIBCHECK_LIBRARY="{install}/lib/libcheck.a" - make: | - cd build - cmake --build . - install: | - cd build - cmake --build . --target install - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libclamunrar_iface.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libfreshclam.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/lib/libclamav.so" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clambc" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamconf" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamdscan" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamscan" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/clamsubmit" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/freshclam" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/bin/sigtool" - patchelf --set-rpath '$ORIGIN/../lib' "{install}/sbin/clamd" - dependencies: - - libz - - libcurl - - libjson_c - - libxml2 - - libopenssl - - libpcre2 - - libbz2 - - libcheck - - ncurses - install_paths: - license/clamav: - - COPYING* - required_tools: - - gmake - - clang - - patchelf - - pkgconfig - - cmake - Windows: - x64: - build_script: - configure: | - mkdir build - cd build - CALL cmake.exe .. -G "{visualstudio.cmake_generator}" -A x64 \ - -D CMAKE_INSTALL_PREFIX="{install}" \ - -D ENABLE_EXAMPLES=OFF \ - -D JSONC_INCLUDE_DIR="{install}\include\json-c" \ - -D JSONC_LIBRARY="{install}\lib\json-c.lib" \ - -D ENABLE_JSON_SHARED=OFF \ - -D BZIP2_INCLUDE_DIR="{install}\include" \ - -D BZIP2_LIBRARY_RELEASE="{install}\lib\libbz2.lib" \ - -D CURL_INCLUDE_DIR="{install}\include" \ - -D CURL_LIBRARY="{install}\lib\libcurl_imp.lib" \ - -D OPENSSL_ROOT_DIR="{install}" \ - -D OPENSSL_INCLUDE_DIR="{install}\include" \ - -D OPENSSL_CRYPTO_LIBRARY="{install}\lib\libcrypto.lib" \ - -D OPENSSL_SSL_LIBRARY="{install}\lib\libssl.lib" \ - -D LIBXML2_INCLUDE_DIR="{install}\include\libxml2" \ - -D LIBXML2_LIBRARY="{install}\lib\libxml2.lib" \ - -D PCRE2_INCLUDE_DIR="{install}\include" \ - -D PCRE2_LIBRARY="{install}\lib\pcre2-8.lib" \ - -D CURSES_INCLUDE_DIR="{install}\include" \ - -D CURSES_LIBRARY="{install}\lib\pdcurses.lib" \ - -D PThreadW32_INCLUDE_DIR="{install}\include" \ - -D PThreadW32_LIBRARY="{install}\lib\pthreadVC3.lib" \ - -D ZLIB_INCLUDE_DIR="{install}\include" \ - -D ZLIB_LIBRARY="{install}\lib\zlibstatic.lib" \ - -D LIBCHECK_INCLUDE_DIR="{install}\include" \ - -D LIBCHECK_LIBRARY="{install}\lib\checkDynamic.lib" - make: | - cd build - cmake --build . --config Release - install: | - cd build - cmake --build . --config Release --target install - dependencies: - - libz - - libcurl - - libjson_c - - pthreads_win32 - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - pdcurses - - libcheck - required_tools: - - cmake - - visualstudio>=2017 - x86: - build_script: - configure: | - mkdir build - cd build - CALL cmake.exe .. -G "{visualstudio.cmake_generator}" -A Win32 \ - -D CMAKE_INSTALL_PREFIX="{install}" \ - -D ENABLE_EXAMPLES=OFF \ - -D JSONC_INCLUDE_DIR="{install}\include\json-c" \ - -D JSONC_LIBRARY="{install}\lib\json-c.lib" \ - -D ENABLE_JSON_SHARED=OFF \ - -D BZIP2_INCLUDE_DIR="{install}\include" \ - -D BZIP2_LIBRARY_RELEASE="{install}\lib\libbz2.lib" \ - -D CURL_INCLUDE_DIR="{install}\include" \ - -D CURL_LIBRARY="{install}\lib\libcurl_imp.lib" \ - -D OPENSSL_ROOT_DIR="{install}" \ - -D OPENSSL_INCLUDE_DIR="{install}\include" \ - -D OPENSSL_CRYPTO_LIBRARY="{install}\lib\libcrypto.lib" \ - -D OPENSSL_SSL_LIBRARY="{install}\lib\libssl.lib" \ - -D LIBXML2_INCLUDE_DIR="{install}\include\libxml2" \ - -D LIBXML2_LIBRARY="{install}\lib\libxml2.lib" \ - -D PCRE2_INCLUDE_DIR="{install}\include" \ - -D PCRE2_LIBRARY="{install}\lib\pcre2-8.lib" \ - -D CURSES_INCLUDE_DIR="{install}\include" \ - -D CURSES_LIBRARY="{install}\lib\pdcurses.lib" \ - -D PThreadW32_INCLUDE_DIR="{install}\include" \ - -D PThreadW32_LIBRARY="{install}\lib\pthreadVC2.lib" \ - -D ZLIB_INCLUDE_DIR="{install}\include" \ - -D ZLIB_LIBRARY="{install}\lib\zlibstatic.lib" \ - -D LIBCHECK_INCLUDE_DIR="{install}\include" \ - -D LIBCHECK_LIBRARY="{install}\lib\checkDynamic.lib" - make: | - cd build - cmake --build . --config Release - install: | - cd build - cmake --build . --config Release --target install - dependencies: - - libz - - libcurl - - libjson_c - - pthreads_win32 - - libxml2 - - libopenssl - - libpcre2 - - libbz2<1.1.0 - - pdcurses - - libcheck - required_tools: - - cmake - - visualstudio>=2017 diff --git a/recipes/clamav-1.2.yaml b/recipes/clamav-1.5.yaml similarity index 90% rename from recipes/clamav-1.2.yaml rename to recipes/clamav-1.5.yaml index d738f8f..d7d3138 100644 --- a/recipes/clamav-1.2.yaml +++ b/recipes/clamav-1.5.yaml @@ -14,7 +14,7 @@ # TODO: Rewrite this to use the new CMake build system, when unit test support is complete. name: clamav -version: "1.2.0" +version: "1.5.0" url: https://github.com/Cisco-Talos/clamav/archive/main.zip archive_name_change: - "main" @@ -428,6 +428,61 @@ platforms: - pkgconfig - cmake Windows: + arm64: + build_script: + configure: | + mkdir build + cd build + CALL cmake.exe .. -G "{visualstudio.cmake_generator}" -A arm64 \ + -D CMAKE_INSTALL_PREFIX="{install}" \ + -D ENABLE_EXAMPLES=OFF \ + -D JSONC_INCLUDE_DIR="{install}\include\json-c" \ + -D JSONC_LIBRARY="{install}\lib\json-c.lib" \ + -D ENABLE_JSON_SHARED=OFF \ + -D BZIP2_INCLUDE_DIR="{install}\include" \ + -D BZIP2_LIBRARY_RELEASE="{install}\lib\libbz2.lib" \ + -D CURL_INCLUDE_DIR="{install}\include" \ + -D CURL_LIBRARY="{install}\lib\libcurl_imp.lib" \ + -D OPENSSL_ROOT_DIR="{install}" \ + -D OPENSSL_INCLUDE_DIR="{install}\include" \ + -D OPENSSL_CRYPTO_LIBRARY="{install}\lib\libcrypto.lib" \ + -D OPENSSL_SSL_LIBRARY="{install}\lib\libssl.lib" \ + -D LIBXML2_INCLUDE_DIR="{install}\include\libxml2" \ + -D LIBXML2_LIBRARY="{install}\lib\libxml2.lib" \ + -D PCRE2_INCLUDE_DIR="{install}\include" \ + -D PCRE2_LIBRARY="{install}\lib\pcre2-8.lib" \ + -D CURSES_INCLUDE_DIR="{install}\include" \ + -D CURSES_LIBRARY="{install}\lib\pdcurses.lib" \ + -D PThreadW32_INCLUDE_DIR="{install}\include" \ + -D PThreadW32_LIBRARY="{install}\lib\pthreadVC3.lib" \ + -D ZLIB_INCLUDE_DIR="{install}\include" \ + -D ZLIB_LIBRARY="{install}\lib\zlibstatic.lib" \ + -D LIBCHECK_INCLUDE_DIR="{install}\include" \ + -D LIBCHECK_LIBRARY="{install}\lib\checkDynamic.lib" \ + -D CMAKE_TOOLCHAIN_FILE="..\CMAKE_TOOLCHAIN_ARM64.cmake" \ + -D HAVE_PRAGMA_PACK=1 \ + -D HAVE_SAR=1 + make: | + cd build + cmake --build . --config Release + install: | + cd build + cmake --build . --config Release --target install + dependencies: + - libz + - libcurl + - libjson_c + - pthreads_win32 + - libxml2 + - libopenssl + - libpcre2 + - libbz2<1.1.0 + - pdcurses + - libcheck + patches: clamav-patches + required_tools: + - cmake + - visualstudio>=2017 x64: build_script: configure: | diff --git a/recipes/clamav-patches/CMAKE_TOOLCHAIN_ARM64.patch b/recipes/clamav-patches/CMAKE_TOOLCHAIN_ARM64.patch new file mode 100644 index 0000000..0031175 --- /dev/null +++ b/recipes/clamav-patches/CMAKE_TOOLCHAIN_ARM64.patch @@ -0,0 +1,25 @@ +diff --git a/CMAKE_TOOLCHAIN_ARM64.cmake b/CMAKE_TOOLCHAIN_ARM64.cmake +new file mode 100644 +index 000000000..f84a5022f +--- /dev/null ++++ b/CMAKE_TOOLCHAIN_ARM64.cmake +@@ -0,0 +1,18 @@ ++# Platform ++set(CMAKE_SYSTEM_NAME Windows) ++set(CMAKE_SYSTEM_PROCESSOR arm64) ++set(RUST_COMPILER_TARGET "aarch64-pc-windows-msvc") ++ ++# Project Variables needed to cross compile ++set(HAVE_PRAGMA_PACK 1) ++set(HAVE_SAR 1) ++set(MMAP_FOR_CROSSCOMPILING OFF) ++set(ENABLE_SYSTEMD OFF) ++ ++set( test_run_result ++ "PLEASE_FILL_OUT-FAILED_TO_RUN" ++ CACHE STRING "Result from try_run" FORCE) ++ ++set( test_run_result__TRYRUN_OUTPUT ++ "PLEASE_FILL_OUT-NOTFOUND" ++ CACHE STRING "Output from try_run" FORCE) +