nixpkgs/pkgs/tools/graphics/quirc/default.nix

44 lines
1 KiB
Nix
Raw Normal View History

2021-05-02 09:30:04 +00:00
{ lib, stdenv, fetchFromGitHub
, SDL_gfx, SDL, libjpeg, libpng, pkg-config
}:
2017-10-10 15:22:48 +00:00
stdenv.mkDerivation {
2021-05-02 09:30:04 +00:00
pname = "quirc";
version = "2020-04-16";
src = fetchFromGitHub {
owner = "dlbeer";
repo = "quirc";
rev = "ed455904f35270888bc902b9e8c0c9b3184a8302";
sha256 = "1kqqvcnxcaxdgls9sibw5pqjz3g1gys2v64i4kfqp8wfcgd9771q";
2014-11-27 20:20:09 +00:00
};
2021-05-02 09:30:04 +00:00
nativeBuildInputs = [ pkg-config ];
buildInputs = [ SDL SDL_gfx libjpeg libpng ];
makeFlags = [ "PREFIX=$(out)" ];
NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL -I${SDL_gfx}/include/SDL";
2014-11-27 20:20:09 +00:00
configurePhase = ''
2021-05-02 09:30:04 +00:00
runHook preConfigure
# don't try to change ownership
2014-11-27 20:20:09 +00:00
sed -e 's/-[og] root//g' -i Makefile
2021-05-02 09:30:04 +00:00
runHook postConfigure
2014-11-27 20:20:09 +00:00
'';
preInstall = ''
mkdir -p "$out"/{bin,lib,include}
2021-05-02 09:30:04 +00:00
# install all binaries
find -maxdepth 1 -type f -executable ! -name '*.so.*' | xargs cp -t "$out"/bin
2014-11-27 20:20:09 +00:00
'';
2021-05-02 09:30:04 +00:00
2014-11-27 20:20:09 +00:00
meta = {
description = "A small QR code decoding library";
2021-01-15 09:19:50 +00:00
license = lib.licenses.isc;
maintainers = [lib.maintainers.raskin];
platforms = lib.platforms.linux;
2014-11-27 20:20:09 +00:00
};
}