nix-config/nixpkgs-overlay/bmxd.nix

32 lines
951 B
Nix
Raw Normal View History

2021-02-26 20:22:15 +01:00
{ stdenv, fetchgit, fetchpatch, }:
2020-04-05 02:31:57 +02:00
let
2021-02-26 20:22:15 +01:00
src = fetchgit {
url = "https://gitlab.freifunk-dresden.de/firmware-developer/firmware.git";
sha256 = "sha256-3sV59uqFp+TZKrDf7kmksLvz+5ZKriwFyXZMBH2Sdws=";
};
2021-01-06 18:24:57 +01:00
path = "feeds/19.07/feeds-own/bmxd";
makefile = builtins.readFile "${src}/${path}/Makefile";
2020-04-05 02:31:57 +02:00
makeDef = name:
2021-02-22 11:45:12 +01:00
builtins.elemAt (builtins.match ''
.*?${name}:=([^
]+).*?'' makefile) 0;
2020-04-05 02:31:57 +02:00
name = makeDef "PKG_NAME";
version = makeDef "PKG_VERSION";
release = makeDef "PKG_RELEASE";
2021-02-26 20:22:15 +01:00
patch = fetchpatch {
name = "timercpy.patch";
2021-02-22 11:45:12 +01:00
url =
"https://gitlab.freifunk-dresden.de/firmware-developer/firmware/merge_requests/36.patch";
2021-02-26 20:22:15 +01:00
sha256 = "sha256-40BbcCZ10cQzvkfsAi8ApCgmC4hGMh2J8xU6gjD3cng=";
2021-01-06 18:24:57 +01:00
};
2020-04-05 02:31:57 +02:00
in stdenv.mkDerivation {
name = "${name}-${version}-${release}";
2021-01-06 18:24:57 +01:00
inherit src;
patches = [ patch ];
buildPhase = "cd ${path}/sources";
2020-04-05 02:31:57 +02:00
installPhase = ''
make install SBINDIR=$out/sbin
'';
}