From 6256bdb075a3add4323ccff9a858c57de781de2a Mon Sep 17 00:00:00 2001 From: Liav A Date: Sun, 26 Jun 2022 22:36:57 +0300 Subject: [PATCH] Ports: Add QOI converter and QOI benchmark utility --- Ports/AvailablePorts.md | 1 + Ports/qoi/package.sh | 11 +++++++ .../0001-Use-LibMath-frexp-function.patch | 30 +++++++++++++++++++ Ports/qoi/patches/ReadMe.md | 7 +++++ 4 files changed, 49 insertions(+) create mode 100755 Ports/qoi/package.sh create mode 100644 Ports/qoi/patches/0001-Use-LibMath-frexp-function.patch create mode 100644 Ports/qoi/patches/ReadMe.md diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 43b92a4bffe..e43175682f1 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -192,6 +192,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`pt2-clone`](pt2-clone/) | ProTracker 2 clone | 1.49 | https://github.com/8bitbubsy/pt2-clone | | [`pv`](pv/) | Pipe Viewer | 1.6.20 | http://www.ivarch.com/programs/pv.shtml | | [`python3`](python3/) | Python | 3.10.4 | https://www.python.org/ | +| [`qoi`](qoi/) | Quite OK Image Format for fast, lossless image compression | edb8d7b | https://github.com/phoboslab/qoi | | [`qt6-qtbase`](qt6-qtbase/) | Qt6 QtBase | 6.2.3 | https://qt.io | | [`qt6-serenity`](qt6-serenity/) | QSerenityPlatform | | https://github.com/SerenityPorts/QSerenityPlatform | | [`quake`](quake/) | Quake | 0.65 | https://github.com/SerenityOS/SerenityQuake | diff --git a/Ports/qoi/package.sh b/Ports/qoi/package.sh new file mode 100755 index 00000000000..e00b1b9530e --- /dev/null +++ b/Ports/qoi/package.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port='qoi' +version='edb8d7b1140be3168cc99ed87edc605c7c1cf31f' +files="https://github.com/phoboslab/qoi/archive/${version}.zip qoi-${version}.zip 3d3df95fb0b59aca2113ce45396f887eaba1be914cd54b56804efc241f93f203" +auth_type='sha256' +depends=('libpng' 'stb') + +install() { + run cp qoibench "${SERENITY_INSTALL_ROOT}/bin" + run cp qoiconv "${SERENITY_INSTALL_ROOT}/bin" +} diff --git a/Ports/qoi/patches/0001-Use-LibMath-frexp-function.patch b/Ports/qoi/patches/0001-Use-LibMath-frexp-function.patch new file mode 100644 index 00000000000..5eafea5ec82 --- /dev/null +++ b/Ports/qoi/patches/0001-Use-LibMath-frexp-function.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Liav A +Date: Thu, 7 Jul 2022 23:49:02 +0300 +Subject: [PATCH] Use LibMath frexp function + +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 4d21d41..1096a88 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + CC ?= gcc + CFLAGS_BENCH ?= -std=gnu99 -O3 +-LFLAGS_BENCH ?= -lpng ++LFLAGS_BENCH ?= -lpng -lm + CFLAGS_CONV ?= -std=c99 -O3 + + TARGET_BENCH ?= qoibench +@@ -15,7 +15,7 @@ $(TARGET_BENCH):$(TARGET_BENCH).c + + conv: $(TARGET_CONV) + $(TARGET_CONV):$(TARGET_CONV).c +- $(CC) $(CFLAGS_CONV) $(TARGET_CONV).c -o $(TARGET_CONV) ++ $(CC) $(CFLAGS_CONV) $(TARGET_CONV).c -o $(TARGET_CONV) -lm + + .PHONY: clean + clean: diff --git a/Ports/qoi/patches/ReadMe.md b/Ports/qoi/patches/ReadMe.md new file mode 100644 index 00000000000..c97c751461e --- /dev/null +++ b/Ports/qoi/patches/ReadMe.md @@ -0,0 +1,7 @@ +# Patches for qoi on SerenityOS + +## `0001-Use-LibMath-frexp-function.patch` + +Use LibMath frexp function + +