2021-01-17 09:17:16 +00:00
|
|
|
{lib, stdenv, fetchgit, SDL_gfx, SDL, libjpeg, libpng, pkg-config}:
|
2014-11-27 20:20:09 +00:00
|
|
|
let
|
|
|
|
s =
|
|
|
|
rec {
|
2016-08-26 13:07:54 +00:00
|
|
|
date = "2016-08-16";
|
2014-11-27 20:20:09 +00:00
|
|
|
version = "git-${date}";
|
|
|
|
baseName = "quirc";
|
|
|
|
name = "${baseName}-${version}";
|
|
|
|
url = "https://github.com/dlbeer/quirc";
|
2016-08-26 13:07:54 +00:00
|
|
|
rev = "5b262480091d5f84a67a4a56c728fc8b39844339";
|
|
|
|
sha256 = "1w5qvjafn14s6jjs7kiwsqirlsqbgv0p152hrsq463pm34hp0lzy";
|
2014-11-27 20:20:09 +00:00
|
|
|
};
|
2017-10-10 15:22:48 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit (s) name version;
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2014-11-27 20:20:09 +00:00
|
|
|
buildInputs = [
|
2017-09-14 19:24:37 +00:00
|
|
|
SDL SDL_gfx libjpeg libpng
|
2014-11-27 20:20:09 +00:00
|
|
|
];
|
|
|
|
src = fetchgit {
|
|
|
|
inherit (s) url sha256 rev;
|
|
|
|
};
|
2016-08-26 13:07:54 +00:00
|
|
|
NIX_CFLAGS_COMPILE="-I${SDL.dev}/include/SDL -I${SDL_gfx}/include/SDL";
|
2014-11-27 20:20:09 +00:00
|
|
|
configurePhase = ''
|
|
|
|
sed -e 's/-[og] root//g' -i Makefile
|
|
|
|
'';
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out"/{bin,lib,include}
|
2015-09-06 08:21:43 +00:00
|
|
|
find . -maxdepth 1 -type f -perm -0100 -exec cp '{}' "$out"/bin ';'
|
2014-11-27 20:20:09 +00:00
|
|
|
'';
|
2019-10-27 13:03:25 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2014-11-27 20:20:09 +00:00
|
|
|
meta = {
|
|
|
|
inherit (s) version;
|
2021-01-24 09:19:10 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|