Unverified Commit bfbf05a8 authored by 7c6f434c's avatar 7c6f434c Committed by GitHub
Browse files

Merge pull request #294589 from dotlambda/quirc-1.2

quirc: 2021-10-08 -> 1.2
parents 444f009a 6b0feb7f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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
 
+19 −14
Original line number Diff line number Diff line
{ 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" ];
  };
}
})