nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

quirc: fix darwin build

Some linux-only samples prevented this package from building on x86_64 and aarch64 darwin systems.

+44 -5
+29
pkgs/tools/graphics/quirc/0001-dont-build-demos.patch
··· 1 + diff --git a/Makefile b/Makefile 2 + index 2d5b745..ecef988 100644 3 + --- a/Makefile 4 + +++ b/Makefile 5 + @@ -37,7 +37,7 @@ DEMO_UTIL_OBJ = \ 6 + 7 + OPENCV_CFLAGS != pkg-config --cflags opencv4 8 + OPENCV_LIBS != pkg-config --libs opencv4 9 + -QUIRC_CXXFLAGS = $(QUIRC_CFLAGS) $(OPENCV_CFLAGS) --std=c++17 10 + +QUIRC_CXXFLAGS = $(QUIRC_CFLAGS) --std=c++17 11 + 12 + .PHONY: all v4l sdl opencv install uninstall clean 13 + 14 + @@ -85,14 +85,11 @@ libquirc.so.$(LIB_VERSION): $(LIB_OBJ) 15 + .cxx.o: 16 + $(CXX) $(QUIRC_CXXFLAGS) -o $@ -c $< 17 + 18 + -install: libquirc.a libquirc.so.$(LIB_VERSION) quirc-demo quirc-scanner 19 + +install: libquirc.a libquirc.so.$(LIB_VERSION) 20 + install -o root -g root -m 0644 lib/quirc.h $(DESTDIR)$(PREFIX)/include 21 + install -o root -g root -m 0644 libquirc.a $(DESTDIR)$(PREFIX)/lib 22 + install -o root -g root -m 0755 libquirc.so.$(LIB_VERSION) \ 23 + $(DESTDIR)$(PREFIX)/lib 24 + - install -o root -g root -m 0755 quirc-demo $(DESTDIR)$(PREFIX)/bin 25 + - # install -o root -g root -m 0755 quirc-demo-opencv $(DESTDIR)$(PREFIX)/bin 26 + - install -o root -g root -m 0755 quirc-scanner $(DESTDIR)$(PREFIX)/bin 27 + 28 + uninstall: 29 + rm -f $(DESTDIR)$(PREFIX)/include/quirc.h
+15 -5
pkgs/tools/graphics/quirc/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub 2 - , SDL_gfx, SDL, libjpeg, libpng, opencv, pkg-config 3 - }: 1 + { lib, stdenv, fetchFromGitHub, SDL_gfx, SDL, libjpeg, libpng, opencv 2 + , pkg-config }: 4 3 5 4 stdenv.mkDerivation { 6 5 pname = "quirc"; ··· 18 19 makeFlags = [ "PREFIX=$(out)" ]; 19 20 NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL -I${SDL_gfx}/include/SDL"; 20 21 22 + # Disable building of linux-only demos on darwin systems 23 + patches = lib.optionals stdenv.isDarwin [ ./0001-dont-build-demos.patch ]; 24 + 25 + buildPhase = lib.optionalString stdenv.isDarwin '' 26 + runHook preBuild 27 + make libquirc.so 28 + make qrtest 29 + runHook postBuild 30 + ''; 31 + 21 32 configurePhase = '' 22 33 runHook preConfigure 23 34 ··· 36 27 37 28 runHook postConfigure 38 29 ''; 30 + 39 31 preInstall = '' 40 32 mkdir -p "$out"/{bin,lib,include} 41 33 ··· 47 37 meta = { 48 38 description = "A small QR code decoding library"; 49 39 license = lib.licenses.isc; 50 - maintainers = [lib.maintainers.raskin]; 51 - platforms = lib.platforms.linux; 40 + maintainers = [ lib.maintainers.raskin ]; 41 + platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ]; 52 42 }; 53 43 }