quirc: 2021-10-08 -> 1.2

Diff: https://github.com/dlbeer/quirc/compare/v2021-10-08...v1.2
This commit is contained in:
Robert Schütz 2024-03-09 12:29:15 -08:00 committed by Weijia Wang
parent 32146f3161
commit 6b0feb7fcd
2 changed files with 21 additions and 16 deletions

View File

@ -4,8 +4,8 @@ index 2d5b745..ecef988 100644
+++ b/Makefile
@@ -37,7 +37,7 @@ DEMO_UTIL_OBJ = \
OPENCV_CFLAGS != pkg-config --cflags opencv4
OPENCV_LIBS != pkg-config --libs opencv4
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

View File

@ -1,17 +1,24 @@
{ lib, stdenv, fetchFromGitHub, SDL_gfx, SDL, libjpeg, libpng, opencv
, pkg-config }:
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "quirc";
version = "2021-10-08";
version = "1.2";
src = fetchFromGitHub {
owner = "dlbeer";
repo = "quirc";
rev = "516d91a94d880ca1006fc1d57f318bdff8411f0d";
sha256 = "0jkaz5frm6jr9bxyfympvzh180nczrfvvb3z3qhk21djlas6nr5f";
rev = "v${finalAttrs.version}";
hash = "sha256-zdq/YKL33jJXa10RqmQIl06rRYnrthWG+umT4dipft0=";
};
postPatch = ''
# don't try to change ownership
substituteInPlace Makefile \
--replace-fail "-o root" "" \
--replace-fail "-g root" ""
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [ SDL SDL_gfx libjpeg libpng opencv ];
@ -28,15 +35,6 @@ stdenv.mkDerivation {
runHook postBuild
'';
configurePhase = ''
runHook preConfigure
# don't try to change ownership
sed -e 's/-[og] root//g' -i Makefile
runHook postConfigure
'';
preInstall = ''
mkdir -p "$out"/{bin,lib,include}
@ -44,10 +42,17 @@ stdenv.mkDerivation {
find -maxdepth 1 -type f -executable ! -name '*.so.*' | xargs cp -t "$out"/bin
'';
postInstall = ''
# don't install static library
rm $out/lib/libquirc.a
ln -s $out/lib/libquirc.so.* $out/lib/libquirc.so
'';
meta = {
description = "A small QR code decoding library";
license = lib.licenses.isc;
maintainers = [ lib.maintainers.raskin ];
platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ];
};
}
})