lol
1{ lib, stdenv, pkgs, fetchFromGitHub, fetchpatch, argparse, mosquitto, cmake, autoconf, automake, libtool, pkg-config, openssl }:
2
3stdenv.mkDerivation rec {
4 pname = "ebusd";
5 version = "23.3";
6
7 src = fetchFromGitHub {
8 owner = "john30";
9 repo = "ebusd";
10 rev = version;
11 sha256 = "sha256-K3gZ5OudNA92S38U1+HndxjA7OVfh2ymYf8OetB646M=";
12 };
13
14 nativeBuildInputs = [
15 cmake
16 autoconf
17 automake
18 libtool
19 pkg-config
20 ];
21
22 buildInputs = [
23 argparse
24 mosquitto
25 openssl
26 ];
27
28 patches = [
29 ./patches/ebusd-cmake.patch
30 # Upstream patch for gcc-13 copmpatibility:
31 (fetchpatch {
32 name = "gcc-13.patch";
33 url = "https://github.com/john30/ebusd/commit/3384f3780087bd6b94d46bf18cdad18201ad516c.patch";
34 hash = "sha256-+wZDHjGaIhBCqhy2zmIE8Ko3uAiw8kfKx64etCqRQjM=";
35 })
36 ];
37
38 cmakeFlags = [
39 "-DCMAKE_INSTALL_SYSCONFDIR=${placeholder "out"}/etc"
40 "-DCMAKE_INSTALL_BINDIR=${placeholder "out"}/bin"
41 "-DCMAKE_INSTALL_LOCALSTATEDIR=${placeholder "TMPDIR"}"
42 ];
43
44 postInstall = ''
45 mv $out/usr/bin $out
46 rmdir $out/usr
47 '';
48
49 meta = with lib; {
50 description = "ebusd";
51 homepage = "https://github.com/john30/ebusd";
52 license = licenses.gpl3Only;
53 maintainers = with maintainers; [ nathan-gs ];
54 platforms = platforms.linux;
55 };
56}