quirc: drop SDL dependency (#389124)

This commit is contained in:
7c6f434c
2025-03-13 12:50:34 +00:00
committed by GitHub
2 changed files with 21 additions and 56 deletions
@@ -1,33 +1,8 @@
From 7435b2e12c2004cb0c497ff313288902f2a6f39a Mon Sep 17 00:00:00 2001
From: toonn <toonn@toonn.io>
Date: Fri, 19 Jul 2024 21:53:58 +0200
Subject: [PATCH] Don't build demos
---
Makefile | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 8327b4e..7901cc5 100644
index 8327b4e..c269291 100644
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ DEMO_UTIL_OBJ = \
OPENCV_CFLAGS := $(shell pkg-config --cflags opencv4 2>&1)
OPENCV_LIBS = $(shell pkg-config --libs opencv4)
-QUIRC_CXXFLAGS = $(QUIRC_CFLAGS) $(OPENCV_CFLAGS) --std=c++17
+QUIRC_CXXFLAGS = $(QUIRC_CFLAGS) --std=c++17
.PHONY: all v4l sdl opencv install uninstall clean
@@ -93,15 +93,12 @@ libquirc.$(VERSIONED_LIB_SUFFIX): $(LIB_OBJ)
.cxx.o:
$(CXX) $(QUIRC_CXXFLAGS) -o $@ -c $<
-install: libquirc.a libquirc.$(LIB_SUFFIX) quirc-demo quirc-scanner
+install: libquirc.a libquirc.$(LIB_SUFFIX)
install -o root -g root -m 0644 lib/quirc.h $(DESTDIR)$(PREFIX)/include
install -o root -g root -m 0644 libquirc.a $(DESTDIR)$(PREFIX)/lib
@@ -99,9 +99,6 @@ install: libquirc.a libquirc.$(LIB_SUFFIX) quirc-demo quirc-scanner
install -o root -g root -m 0755 libquirc.$(VERSIONED_LIB_SUFFIX) \
$(DESTDIR)$(PREFIX)/lib
cp -d libquirc.$(LIB_SUFFIX) $(DESTDIR)$(PREFIX)/lib
@@ -37,6 +12,3 @@ index 8327b4e..7901cc5 100644
uninstall:
rm -f $(DESTDIR)$(PREFIX)/include/quirc.h
--
2.42.2
+19 -26
View File
@@ -3,12 +3,8 @@
stdenv,
fetchFromGitHub,
fetchpatch2,
SDL_gfx,
SDL,
libjpeg,
libpng,
opencv,
pkg-config,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -26,40 +22,37 @@ stdenv.mkDerivation (finalAttrs: {
# use correct pkg-config / ar / ranlib for cross
# don't try to change ownership
substituteInPlace Makefile \
--replace-fail "pkg-config " "${stdenv.cc.targetPrefix}pkg-config " \
--replace-fail "ar " "${stdenv.cc.targetPrefix}ar " \
--replace-fail "ranlib " "${stdenv.cc.targetPrefix}ranlib " \
--replace-fail "-o root" "" \
--replace-fail "-g root" ""
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [
SDL
SDL_gfx
libjpeg
libpng
opencv
];
makeFlags = [ "PREFIX=$(out)" ];
env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL}/include/SDL -I${SDL_gfx}/include/SDL";
makeFlags = [
"PREFIX=$(out)"
"SDL_CFLAGS="
"SDL_LIBS="
"-o inspect"
"-o quirc-demo"
];
patches =
[
(fetchpatch2 {
url = "https://github.com/dlbeer/quirc/commit/2c350d8aaf37246e538a2c93b2cce8c78600d2fc.patch?full_index=1";
hash = "sha256-ZTcy/EoOBoyOjtXjmT+J/JcbX8lxGKmbWer23lymbWo=";
})
(fetchpatch2 {
url = "https://github.com/dlbeer/quirc/commit/257c6c94d99960819ecabf72199e5822f60a3bc5.patch?full_index=1";
hash = "sha256-WLQK7vy34VmgJzppTnRjAcZoSGWVaXQSaGq9An8W0rw=";
})
]
++ lib.optionals (!stdenv.hostPlatform.isLinux) [
# Disable building of linux-only demos on non-linux systems
./0001-Don-t-build-demos.patch
];
patches = [
(fetchpatch2 {
url = "https://github.com/dlbeer/quirc/commit/2c350d8aaf37246e538a2c93b2cce8c78600d2fc.patch?full_index=1";
hash = "sha256-ZTcy/EoOBoyOjtXjmT+J/JcbX8lxGKmbWer23lymbWo=";
})
(fetchpatch2 {
url = "https://github.com/dlbeer/quirc/commit/257c6c94d99960819ecabf72199e5822f60a3bc5.patch?full_index=1";
hash = "sha256-WLQK7vy34VmgJzppTnRjAcZoSGWVaXQSaGq9An8W0rw=";
})
# Disable building of Demos to not pull in unwanted dependencies
./0001-Don-t-build-demos.patch
];
preInstall = ''
mkdir -p "$out"/{bin,lib,include}