about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/qr/qrcodegencpp/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/qr/qrcodegencpp/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/qr/qrcodegencpp/package.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/qr/qrcodegencpp/package.nix b/nixpkgs/pkgs/by-name/qr/qrcodegencpp/package.nix
new file mode 100644
index 000000000000..655b948e81e1
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/qr/qrcodegencpp/package.nix
@@ -0,0 +1,32 @@
+{ lib
+, stdenv
+, qrcodegen
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "qrcodegencpp";
+  version = qrcodegen.version;
+
+  src = qrcodegen.src;
+
+  sourceRoot = "${finalAttrs.src.name}/cpp";
+
+  nativeBuildInputs = lib.optionals stdenv.cc.isClang [
+    stdenv.cc.cc.libllvm.out
+  ];
+
+  makeFlags = lib.optionals stdenv.cc.isClang [ "AR=llvm-ar" ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dt $out/lib/ libqrcodegencpp.a
+    install -Dt $out/include/qrcodegen/ qrcodegen.hpp
+
+    runHook postInstall
+  '';
+
+  meta = {
+    inherit (qrcodegen.meta) description homepage license maintainers platforms;
+  };
+})