Merge pull request #168446 from 4825764518/quirc
quirc: 2020-04-16 -> 2021-10-08
This commit is contained in:
commit
ce75dc584d
2 changed files with 48 additions and 9 deletions
29
pkgs/tools/graphics/quirc/0001-dont-build-demos.patch
Normal file
29
pkgs/tools/graphics/quirc/0001-dont-build-demos.patch
Normal file
|
@ -0,0 +1,29 @@
|
|||
diff --git a/Makefile b/Makefile
|
||||
index 2d5b745..ecef988 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -37,7 +37,7 @@ DEMO_UTIL_OBJ = \
|
||||
|
||||
OPENCV_CFLAGS != pkg-config --cflags opencv4
|
||||
OPENCV_LIBS != 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
|
||||
|
||||
@@ -85,14 +85,11 @@ libquirc.so.$(LIB_VERSION): $(LIB_OBJ)
|
||||
.cxx.o:
|
||||
$(CXX) $(QUIRC_CXXFLAGS) -o $@ -c $<
|
||||
|
||||
-install: libquirc.a libquirc.so.$(LIB_VERSION) quirc-demo quirc-scanner
|
||||
+install: libquirc.a libquirc.so.$(LIB_VERSION)
|
||||
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
|
||||
install -o root -g root -m 0755 libquirc.so.$(LIB_VERSION) \
|
||||
$(DESTDIR)$(PREFIX)/lib
|
||||
- install -o root -g root -m 0755 quirc-demo $(DESTDIR)$(PREFIX)/bin
|
||||
- # install -o root -g root -m 0755 quirc-demo-opencv $(DESTDIR)$(PREFIX)/bin
|
||||
- install -o root -g root -m 0755 quirc-scanner $(DESTDIR)$(PREFIX)/bin
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/include/quirc.h
|
|
@ -1,24 +1,33 @@
|
|||
{ lib, stdenv, fetchFromGitHub
|
||||
, SDL_gfx, SDL, libjpeg, libpng, pkg-config
|
||||
}:
|
||||
{ lib, stdenv, fetchFromGitHub, SDL_gfx, SDL, libjpeg, libpng, opencv
|
||||
, pkg-config }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "quirc";
|
||||
version = "2020-04-16";
|
||||
version = "2021-10-08";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dlbeer";
|
||||
repo = "quirc";
|
||||
rev = "ed455904f35270888bc902b9e8c0c9b3184a8302";
|
||||
sha256 = "1kqqvcnxcaxdgls9sibw5pqjz3g1gys2v64i4kfqp8wfcgd9771q";
|
||||
rev = "516d91a94d880ca1006fc1d57f318bdff8411f0d";
|
||||
sha256 = "0jkaz5frm6jr9bxyfympvzh180nczrfvvb3z3qhk21djlas6nr5f";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ SDL SDL_gfx libjpeg libpng ];
|
||||
buildInputs = [ SDL SDL_gfx libjpeg libpng opencv ];
|
||||
|
||||
makeFlags = [ "PREFIX=$(out)" ];
|
||||
NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL -I${SDL_gfx}/include/SDL";
|
||||
|
||||
# Disable building of linux-only demos on darwin systems
|
||||
patches = lib.optionals stdenv.isDarwin [ ./0001-dont-build-demos.patch ];
|
||||
|
||||
buildPhase = lib.optionalString stdenv.isDarwin ''
|
||||
runHook preBuild
|
||||
make libquirc.so
|
||||
make qrtest
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
|
@ -27,6 +36,7 @@ stdenv.mkDerivation {
|
|||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p "$out"/{bin,lib,include}
|
||||
|
||||
|
@ -37,7 +47,7 @@ stdenv.mkDerivation {
|
|||
meta = {
|
||||
description = "A small QR code decoding library";
|
||||
license = lib.licenses.isc;
|
||||
maintainers = [lib.maintainers.raskin];
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = [ lib.maintainers.raskin ];
|
||||
platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue