1 { lib, stdenv, fetchFromGitHub, SDL_gfx, SDL, libjpeg, libpng, opencv
6 version = "2021-10-08";
8 src = fetchFromGitHub {
11 rev = "516d91a94d880ca1006fc1d57f318bdff8411f0d";
12 sha256 = "0jkaz5frm6jr9bxyfympvzh180nczrfvvb3z3qhk21djlas6nr5f";
15 nativeBuildInputs = [ pkg-config ];
16 buildInputs = [ SDL SDL_gfx libjpeg libpng opencv ];
18 makeFlags = [ "PREFIX=$(out)" ];
19 env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL}/include/SDL -I${SDL_gfx}/include/SDL";
21 # Disable building of linux-only demos on darwin systems
22 patches = lib.optionals stdenv.isDarwin [ ./0001-dont-build-demos.patch ];
24 buildPhase = lib.optionalString stdenv.isDarwin ''
34 # don't try to change ownership
35 sed -e 's/-[og] root//g' -i Makefile
41 mkdir -p "$out"/{bin,lib,include}
43 # install all binaries
44 find -maxdepth 1 -type f -executable ! -name '*.so.*' | xargs cp -t "$out"/bin
48 description = "A small QR code decoding library";
49 license = lib.licenses.isc;
50 maintainers = [ lib.maintainers.raskin ];
51 platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ];