From 0c72f75785fae7f62a04989bf0f4f467426bc343 Mon Sep 17 00:00:00 2001 From: edzer Date: Mon, 12 May 2025 22:19:41 +0200 Subject: [PATCH 1/7] add abseil-cpp --- recipes/absl | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 recipes/absl diff --git a/recipes/absl b/recipes/absl new file mode 100644 index 0000000..0ab4ce1 --- /dev/null +++ b/recipes/absl @@ -0,0 +1,4 @@ +Package: absl-cpp +Version: 20250127.1 +Source-URL: https://github.com/abseil/abseil-cpp/archive/refs/tags/${ver}.tar.gz +Source-SHA256: b396401fd29e2e679cace77867481d388c807671dc2acc602a0259eeb79b7811 From 90723f9cdf551a905e35b83417c6208073fcfef6 Mon Sep 17 00:00:00 2001 From: Edzer Pebesma Date: Tue, 13 May 2025 16:23:35 +0200 Subject: [PATCH 2/7] Create main.yml --- .github/workflows/main.yml | 115 +++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..8c42e7b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,115 @@ +name: Cook from Recipes + +on: + workflow_dispatch: + inputs: + target: + description: 'Target of the final "make". Use "all" to build everything (takes a long time!)' + required: false + default: 'r-base-dev' + sdkurl: + description: 'URL of the MacOSX*.sdk.tar.xz tar ball to use. It also determines the `MACOSX_DEPLOYMENT_TARGET`. If not specified, defaults to SDKURL set in the repo.' + required: false + default: '' + bootstrap: + description: 'If "true" bootstraps freetype/harfbuzz circular dependency and r-base-dev - required for real distribution. Set to "false" if you are testing a specific recipe and want to save time.' + required: false + type: boolean + default: true + +jobs: + cook: + runs-on: ${{ matrix.os }} + + name: ${{ matrix.os }} build + + env: + CC: clang + CXX: clang++ + OBJC: clang + OBJCXX: clang++ + SDKURL: ${{ github.event.inputs.sdkurl }} + + strategy: + fail-fast: false + matrix: + os: [ 'macos-13', 'macos-14' ] + + steps: + - uses: actions/checkout@v2 + + - name: Remove local stuff + run: | + ## Remove unwanted local files + sudo mkdir /usr/local/.disabled && sudo mkdir -p /opt/R/`uname -m`/bin && sudo chown -R $USER /opt/R + sudo mv /usr/local/* /usr/local/.disabled/ && sudo rm -rf /opt/homebrew + echo /opt/R/`uname -m`/bin > .PATH && cat $GITHUB_PATH >> .PATH && cat .PATH > $GITHUB_PATH && rm .PATH + echo "ARCH=$(uname -m)" > $GITHUB_ENV + + - name: Setup toolchain + run: | + ## Setup SDK + if [ -z "$SDKURL" ]; then SDKURL="${{ secrets.SDKURL }}"; fi + if [ -n "$SDKURL" ]; then + echo Installing SDK.. + sdkname=$(curl -sfSL "$SDKURL" | sudo tar vxz -C /Library/Developer/CommandLineTools/SDKs 2>&1 | sed -n '1s:^x ::p' | sed -E 's:/*$::' ) + if ! echo $sdkname | grep ^MacOSX; then echo "::error:: SDKURL is not valid, the tar ball must contain just the MacOSX*.sdk directory" >&2; exit 1; fi + SDKROOT="/Library/Developer/CommandLineTools/SDKs/$sdkname" + MACOSX_DEPLOYMENT_TARGET="$(echo $sdkname | sed 's:MacOSX::' | sed 's:[.]sdk$::')" + OS_VER=$(echo $MACOSX_DEPLOYMENT_TARGET | awk '{ if ($1 >= 11) print int($1+9); else print int(substr($1,4))+4 }') + echo "SDKROOT=$SDKROOT" >> $GITHUB_ENV + echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" >> $GITHUB_ENV + echo "OS_VER=$OS_VER" >> $GITHUB_ENV + echo "=== Using SDK: $SDKROOT" + echo "=== Target: macOS $MACOSX_DEPLOYMENT_TARGET" + echo "=== Build: darwin$OS_VER" + sudo xcode-select -s /Library/Developer/CommandLineTools && xcode-select -p + else + echo "::warning::NOTE: no SDKURL provided, so Target/SDK are undefined!" + fi + pip3 install --user cmake ninja meson + PYLIB=$(ls -d ~/Library/Python/3.*/bin | head -n1) + echo $PYLIB >> $GITHUB_PATH + PATH="$PATH:$PYLIB" + echo "Compiler: " + clang --version + cmake --version + echo -n "ninja: " + ninja --version + echo -n "meson: " + meson --version + + - name: Setup XQuartz + run: | + ## Install XQuartz + curl -sSL https://github.com/R-macos/XQuartz/releases/download/XQuartz-2.8.1/XQuartz-2.8.1.tar.xz \ + | sudo tar fxj - -C / && sudo sh /opt/X11/libexec/postinstall + + - name: Build pkg-config + run: ./build.sh -f pkgconfig xz + + - name: Bootstrap freetype/harfbuzz circular dependency + if: ${{ inputs.bootstrap }} + run: | + ./build.sh freetype + ./build.sh harfbuzz + rm -rf build/freetype* + ./build.sh harfbuzz + + - name: Build r-base-dev + if: ${{ inputs.bootstrap }} + run: ./build.sh r-base-dev + + - name: Build ${{ github.event.inputs.target }} + run: ./build.sh ${{ github.event.inputs.target }} + + - name: Make distribution + run: perl scripts/mkdist.pl + + - name: Upload distribution as artifacts + uses: actions/upload-artifact@v4 + with: + name: dist-darwin${{ env.OS_VER }}-${{ env.ARCH }} + path: dist + compression-level: 0 + retention-days: 3 From b75b477d5c2f37e9cbacd160f318f6acbe810c62 Mon Sep 17 00:00:00 2001 From: edzer Date: Tue, 13 May 2025 17:40:19 +0200 Subject: [PATCH 3/7] rm ga --- .github/workflows/main.yml | 115 ------------------------------------- recipes/absl | 1 + 2 files changed, 1 insertion(+), 115 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 8c42e7b..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,115 +0,0 @@ -name: Cook from Recipes - -on: - workflow_dispatch: - inputs: - target: - description: 'Target of the final "make". Use "all" to build everything (takes a long time!)' - required: false - default: 'r-base-dev' - sdkurl: - description: 'URL of the MacOSX*.sdk.tar.xz tar ball to use. It also determines the `MACOSX_DEPLOYMENT_TARGET`. If not specified, defaults to SDKURL set in the repo.' - required: false - default: '' - bootstrap: - description: 'If "true" bootstraps freetype/harfbuzz circular dependency and r-base-dev - required for real distribution. Set to "false" if you are testing a specific recipe and want to save time.' - required: false - type: boolean - default: true - -jobs: - cook: - runs-on: ${{ matrix.os }} - - name: ${{ matrix.os }} build - - env: - CC: clang - CXX: clang++ - OBJC: clang - OBJCXX: clang++ - SDKURL: ${{ github.event.inputs.sdkurl }} - - strategy: - fail-fast: false - matrix: - os: [ 'macos-13', 'macos-14' ] - - steps: - - uses: actions/checkout@v2 - - - name: Remove local stuff - run: | - ## Remove unwanted local files - sudo mkdir /usr/local/.disabled && sudo mkdir -p /opt/R/`uname -m`/bin && sudo chown -R $USER /opt/R - sudo mv /usr/local/* /usr/local/.disabled/ && sudo rm -rf /opt/homebrew - echo /opt/R/`uname -m`/bin > .PATH && cat $GITHUB_PATH >> .PATH && cat .PATH > $GITHUB_PATH && rm .PATH - echo "ARCH=$(uname -m)" > $GITHUB_ENV - - - name: Setup toolchain - run: | - ## Setup SDK - if [ -z "$SDKURL" ]; then SDKURL="${{ secrets.SDKURL }}"; fi - if [ -n "$SDKURL" ]; then - echo Installing SDK.. - sdkname=$(curl -sfSL "$SDKURL" | sudo tar vxz -C /Library/Developer/CommandLineTools/SDKs 2>&1 | sed -n '1s:^x ::p' | sed -E 's:/*$::' ) - if ! echo $sdkname | grep ^MacOSX; then echo "::error:: SDKURL is not valid, the tar ball must contain just the MacOSX*.sdk directory" >&2; exit 1; fi - SDKROOT="/Library/Developer/CommandLineTools/SDKs/$sdkname" - MACOSX_DEPLOYMENT_TARGET="$(echo $sdkname | sed 's:MacOSX::' | sed 's:[.]sdk$::')" - OS_VER=$(echo $MACOSX_DEPLOYMENT_TARGET | awk '{ if ($1 >= 11) print int($1+9); else print int(substr($1,4))+4 }') - echo "SDKROOT=$SDKROOT" >> $GITHUB_ENV - echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" >> $GITHUB_ENV - echo "OS_VER=$OS_VER" >> $GITHUB_ENV - echo "=== Using SDK: $SDKROOT" - echo "=== Target: macOS $MACOSX_DEPLOYMENT_TARGET" - echo "=== Build: darwin$OS_VER" - sudo xcode-select -s /Library/Developer/CommandLineTools && xcode-select -p - else - echo "::warning::NOTE: no SDKURL provided, so Target/SDK are undefined!" - fi - pip3 install --user cmake ninja meson - PYLIB=$(ls -d ~/Library/Python/3.*/bin | head -n1) - echo $PYLIB >> $GITHUB_PATH - PATH="$PATH:$PYLIB" - echo "Compiler: " - clang --version - cmake --version - echo -n "ninja: " - ninja --version - echo -n "meson: " - meson --version - - - name: Setup XQuartz - run: | - ## Install XQuartz - curl -sSL https://github.com/R-macos/XQuartz/releases/download/XQuartz-2.8.1/XQuartz-2.8.1.tar.xz \ - | sudo tar fxj - -C / && sudo sh /opt/X11/libexec/postinstall - - - name: Build pkg-config - run: ./build.sh -f pkgconfig xz - - - name: Bootstrap freetype/harfbuzz circular dependency - if: ${{ inputs.bootstrap }} - run: | - ./build.sh freetype - ./build.sh harfbuzz - rm -rf build/freetype* - ./build.sh harfbuzz - - - name: Build r-base-dev - if: ${{ inputs.bootstrap }} - run: ./build.sh r-base-dev - - - name: Build ${{ github.event.inputs.target }} - run: ./build.sh ${{ github.event.inputs.target }} - - - name: Make distribution - run: perl scripts/mkdist.pl - - - name: Upload distribution as artifacts - uses: actions/upload-artifact@v4 - with: - name: dist-darwin${{ env.OS_VER }}-${{ env.ARCH }} - path: dist - compression-level: 0 - retention-days: 3 diff --git a/recipes/absl b/recipes/absl index 0ab4ce1..1da139f 100644 --- a/recipes/absl +++ b/recipes/absl @@ -2,3 +2,4 @@ Package: absl-cpp Version: 20250127.1 Source-URL: https://github.com/abseil/abseil-cpp/archive/refs/tags/${ver}.tar.gz Source-SHA256: b396401fd29e2e679cace77867481d388c807671dc2acc602a0259eeb79b7811 +Build-system: cmake From 59b528eaa14f5009ffeb326851acf6fcabe257b4 Mon Sep 17 00:00:00 2001 From: edzer Date: Tue, 13 May 2025 19:03:07 +0200 Subject: [PATCH 4/7] update to BDRs version; rm blosc for GA --- recipes/absl | 8 +++++--- recipes/blosc | 7 ------- recipes/blosc.patch | 11 ----------- 3 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 recipes/blosc delete mode 100644 recipes/blosc.patch diff --git a/recipes/absl b/recipes/absl index 1da139f..9fe0aaf 100644 --- a/recipes/absl +++ b/recipes/absl @@ -1,5 +1,7 @@ -Package: absl-cpp -Version: 20250127.1 -Source-URL: https://github.com/abseil/abseil-cpp/archive/refs/tags/${ver}.tar.gz +Package: absl +Version: 20250127.1 +Source.URL: https://github.com/abseil/abseil-cpp/releases/download/${ver}/abseil-cpp-${ver}.tar.gz Source-SHA256: b396401fd29e2e679cace77867481d388c807671dc2acc602a0259eeb79b7811 Build-system: cmake +Configure: -DABSL_BUILD_TESTING=ON -DABSL_USE_GOOGLETEST_HEAD=ON -DCMAKE_CXX_STANDARD=17 + diff --git a/recipes/blosc b/recipes/blosc deleted file mode 100644 index c2f3412..0000000 --- a/recipes/blosc +++ /dev/null @@ -1,7 +0,0 @@ -Package: blosc -Version: 1.21.6 -Source-URL: https://github.com/Blosc/c-blosc/archive/refs/tags/v${ver}.tar.gz -Source-SHA256: 9fcd60301aae28f97f1301b735f966cc19e7c49b6b4321b839b4579a0c156f38 -Depends: lz4, zstd -Build-system: cmake -Configure: -DBUILD_STATIC=ON -DBUILD_SHARED=OFF -DCMAKE_BUILD_TYPE="Release" -DPREFER_EXTERNAL_LZ4=ON -DPREFER_EXTERNAL_ZLIB=ON -DPREFER_EXTERNAL_ZSTD=ON -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF diff --git a/recipes/blosc.patch b/recipes/blosc.patch deleted file mode 100644 index 6cd1690..0000000 --- a/recipes/blosc.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -ru blosc-1.21.6/blosc.pc.in blosc-1.21.6-1/blosc.pc.in ---- blosc-1.21.6/blosc.pc.in 2024-06-25 03:56:17 -+++ blosc-1.21.6-1/blosc.pc.in 2025-02-03 13:51:56 -@@ -9,6 +9,6 @@ - URL: https://blosc.org/ - Version: @BLOSC_VERSION_STRING@ - --Requires: -+Requires: libzstd, liblz4, zlib - Libs: -L${libdir} -L${sharedlibdir} -lblosc - Cflags: -I${includedir} From 00b6ef17c86b15f6d25089edc4aaa18243b62e98 Mon Sep 17 00:00:00 2001 From: edzer Date: Tue, 13 May 2025 19:07:52 +0200 Subject: [PATCH 5/7] omit space --- recipes/absl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/absl b/recipes/absl index 9fe0aaf..90db95b 100644 --- a/recipes/absl +++ b/recipes/absl @@ -1,5 +1,5 @@ Package: absl -Version: 20250127.1 +Version: 20250127.1 Source.URL: https://github.com/abseil/abseil-cpp/releases/download/${ver}/abseil-cpp-${ver}.tar.gz Source-SHA256: b396401fd29e2e679cace77867481d388c807671dc2acc602a0259eeb79b7811 Build-system: cmake From 0a28850f17e6abba8429ea4f9eb18af371f7c1dd Mon Sep 17 00:00:00 2001 From: edzer Date: Tue, 13 May 2025 19:12:44 +0200 Subject: [PATCH 6/7] restore blosc, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 --- recipes/blosc | 7 +++++++ recipes/blosc.patch | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 recipes/blosc create mode 100644 recipes/blosc.patch diff --git a/recipes/blosc b/recipes/blosc new file mode 100644 index 0000000..129703b --- /dev/null +++ b/recipes/blosc @@ -0,0 +1,7 @@ +Package: blosc +Version: 1.21.6 +Source-URL: https://github.com/Blosc/c-blosc/archive/refs/tags/v${ver}.tar.gz +Source-SHA256: 9fcd60301aae28f97f1301b735f966cc19e7c49b6b4321b839b4579a0c156f38 +Depends: lz4, zstd +Build-system: cmake +Configure: -DBUILD_STATIC=ON -DBUILD_SHARED=OFF -DCMAKE_BUILD_TYPE="Release" -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DPREFER_EXTERNAL_LZ4=ON -DPREFER_EXTERNAL_ZLIB=ON -DPREFER_EXTERNAL_ZSTD=ON -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF diff --git a/recipes/blosc.patch b/recipes/blosc.patch new file mode 100644 index 0000000..6cd1690 --- /dev/null +++ b/recipes/blosc.patch @@ -0,0 +1,11 @@ +diff -ru blosc-1.21.6/blosc.pc.in blosc-1.21.6-1/blosc.pc.in +--- blosc-1.21.6/blosc.pc.in 2024-06-25 03:56:17 ++++ blosc-1.21.6-1/blosc.pc.in 2025-02-03 13:51:56 +@@ -9,6 +9,6 @@ + URL: https://blosc.org/ + Version: @BLOSC_VERSION_STRING@ + +-Requires: ++Requires: libzstd, liblz4, zlib + Libs: -L${libdir} -L${sharedlibdir} -lblosc + Cflags: -I${includedir} From 2911fd07e48cdef291d6935501f791304de55aa4 Mon Sep 17 00:00:00 2001 From: edzer Date: Tue, 13 May 2025 20:28:24 +0200 Subject: [PATCH 7/7] add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 --- recipes/openjpeg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openjpeg b/recipes/openjpeg index 60b31ea..8c23f22 100644 --- a/recipes/openjpeg +++ b/recipes/openjpeg @@ -10,4 +10,4 @@ Comment: cmake doesn't detect any flags correctly so we have to pass Note that the library itself doesn't use dependencies, but the tools do so for now we opt to build the tools and thus need the libraries. Depends: tiff, libpng -Configure: --prefix=/${prefix} -DCMAKE_EXE_LINKER_FLAGS="`pkg-config --static --libs libtiff-4`" -DCMAKE_C_FLAGS="`pkg-config --cflags libtiff-4`" +Configure: --prefix=/${prefix} -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_EXE_LINKER_FLAGS="`pkg-config --static --libs libtiff-4`" -DCMAKE_C_FLAGS="`pkg-config --cflags libtiff-4`"