nixpkgs/pkgs/tools/networking/uqmi/default.nix
Artturin f9fdf2d402 treewide: move NIX_CFLAGS_COMPILE to the env attrset
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper

this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
2023-02-22 21:23:04 +02:00

34 lines
1003 B
Nix

{ stdenv, lib, fetchgit, cmake, perl, libubox, json_c }:
stdenv.mkDerivation {
pname = "uqmi";
version = "unstable-2019-06-27";
src = fetchgit {
url = "https://git.openwrt.org/project/uqmi.git";
rev = "1965c713937495a5cb029165c16acdb6572c3f87";
sha256 = "1gn8sdcl4lwfs3lwabmnjbvdhhk1l42bwbajwds7j4936fpbklx0";
};
postPatch = ''
substituteInPlace data/gen-header.pl --replace /usr/bin/env ""
patchShebangs .
'';
nativeBuildInputs = [ cmake perl ];
buildInputs = [ libubox json_c ];
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc
"-Wno-error=dangling-pointer"
];
meta = with lib; {
description = "Tiny QMI command line utility";
homepage = "https://git.openwrt.org/?p=project/uqmi.git;a=summary";
license = licenses.gpl2Plus;
platforms = platforms.all;
maintainers = with maintainers; [ fpletz ];
};
}