From c2eb6009260e9ff64592bd778abbf510fbafadd1 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Tue, 11 Apr 2023 07:40:59 -0400 Subject: [PATCH] +jpeg-xl (#1315) Closes #198 --- projects/jpeg.org/jpegxl/fixture.jpeg | Bin 0 -> 305 bytes projects/jpeg.org/jpegxl/fixture1.c | 11 +++++ projects/jpeg.org/jpegxl/fixture2.c | 11 +++++ projects/jpeg.org/jpegxl/package.yml | 63 ++++++++++++++++++++++++++ projects/littlecms.com/package.yml | 6 +-- 5 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 projects/jpeg.org/jpegxl/fixture.jpeg create mode 100644 projects/jpeg.org/jpegxl/fixture1.c create mode 100644 projects/jpeg.org/jpegxl/fixture2.c create mode 100644 projects/jpeg.org/jpegxl/package.yml diff --git a/projects/jpeg.org/jpegxl/fixture.jpeg b/projects/jpeg.org/jpegxl/fixture.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..9a717a0dce28c0556af26eec83ada609191fbe20 GIT binary patch literal 305 zcmex=LJ%Z3btM5{dxG z5Q+={Y5sqJL6C!ik%5t!QILU2kdaxC@&6G95ugYv;0B2bpo=nqM1ej<10YdBOwn5m UJj{$hOPB>2>>2Do)c?N;0ELMmp8x;= literal 0 HcmV?d00001 diff --git a/projects/jpeg.org/jpegxl/fixture1.c b/projects/jpeg.org/jpegxl/fixture1.c new file mode 100644 index 00000000..3e48d2f6 --- /dev/null +++ b/projects/jpeg.org/jpegxl/fixture1.c @@ -0,0 +1,11 @@ +#include +#include + +int main() { + JxlEncoder* enc = JxlEncoderCreate(NULL); + if (enc == NULL) { + return EXIT_FAILURE; + } + JxlEncoderDestroy(enc); + return EXIT_SUCCESS; +} diff --git a/projects/jpeg.org/jpegxl/fixture2.c b/projects/jpeg.org/jpegxl/fixture2.c new file mode 100644 index 00000000..9e8c7311 --- /dev/null +++ b/projects/jpeg.org/jpegxl/fixture2.c @@ -0,0 +1,11 @@ +#include +#include + +int main() { + void* runner = JxlThreadParallelRunnerCreate(NULL, 1); + if (runner == NULL) { + return EXIT_FAILURE; + } + JxlThreadParallelRunnerDestroy(runner); + return EXIT_SUCCESS; +} diff --git a/projects/jpeg.org/jpegxl/package.yml b/projects/jpeg.org/jpegxl/package.yml new file mode 100644 index 00000000..6ef76240 --- /dev/null +++ b/projects/jpeg.org/jpegxl/package.yml @@ -0,0 +1,63 @@ +distributable: + url: https://github.com/libjxl/libjxl/archive/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: libjxl/libjxl + +dependencies: + github.com/google/brotli: ^1 + littlecms.com: ^2.13 + google.com/highway: ^1 + google.com/webp: ^1 + giflib.sourceforge.io: ^5 + openexr.com: ^3 + +provides: + - bin/cjpeg_hdr + - bin/cjxl + - bin/djxl + - bin/jxlinfo + +build: + dependencies: + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + freedesktop.org/pkg-config: ^0.29 + cmake.org: ^3 + gnu.org/coreutils: '*' # deps.sh needs “realpath” + working-directory: build + script: | + GIT_DIR=$PWD ../deps.sh # † + find ../third_party -not -name sjpeg -mindepth 1 -maxdepth 1 -type d | xargs rm -rf # ‡ + + cmake .. $ARGS + make --jobs {{ hw.concurrency }} install + env: + # add any environment variables here + ARGS: + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_INSTALL_PREFIX={{prefix}} + - -DBUILD_TESTING=OFF + - -DJPEGXL_ENABLE_SKCMS=OFF + - -DJPEGXL_ENABLE_BENCHMARK=OFF + - -DJPEGXL_VERSION={{version}} + +# † we set GIT_DIR because the script assumes git if it finds git rev-parse +# works, which it does for us because we have a git checkout both locally and +# in CI/CD + +# ‡ we don’t want anything but sjpeg which is a super rare dep only used by +# this package + +test: + dependencies: + tea.xyz/gx/cc: c99 + script: | + cjxl fixture.jpeg out.jxl + + cc fixture1.c -ljxl + ./a.out + + cc fixture2.c -ljxl_threads + ./a.out diff --git a/projects/littlecms.com/package.yml b/projects/littlecms.com/package.yml index 92787f27..4717840b 100644 --- a/projects/littlecms.com/package.yml +++ b/projects/littlecms.com/package.yml @@ -4,8 +4,8 @@ distributable: strip-components: 1 versions: - github: mm2/Little-CMS/tags # reads github tags from github - strip: /^Little CMS / + github: mm2/Little-CMS/releases/tags + strip: /^lcms/ dependencies: simplesystems.org/libtiff: ^4 @@ -17,7 +17,7 @@ build: tea.xyz/gx/make: '*' script: | ./configure $ARGS - make --jobs {{ hw.concurrency }} + make --jobs {{ hw.concurrency }} make install env: ARGS: