diff --git a/pkgs/additional/eg25-manager/default.nix b/pkgs/additional/eg25-manager/default.nix index 09660f3d..7e5db514 100644 --- a/pkgs/additional/eg25-manager/default.nix +++ b/pkgs/additional/eg25-manager/default.nix @@ -3,6 +3,7 @@ { lib , stdenv +, callPackage , fetchFromGitLab , gnugrep , meson @@ -11,12 +12,19 @@ , scdoc , curl , glib -, libgpiod , libgudev , libusb1 , modemmanager }: +let + # eg25-manager needs to be made compatible with libgpiod 2.0 API. see: + # - + # - + # nixpkgs libgpiod was bumped 2023-07-29: + # - + libgpiod1 = callPackage ./libgpiod1.nix { }; +in stdenv.mkDerivation rec { pname = "eg25-manager"; version = "0.4.6"; @@ -48,22 +56,20 @@ stdenv.mkDerivation rec { buildInputs = [ curl glib - libgpiod + libgpiod1 libgudev libusb1 modemmanager ]; + passthru = { + inherit libgpiod1; + }; + meta = with lib; { description = "Manager daemon for the Quectel EG25 mobile broadband modem"; homepage = "https://gitlab.com/mobian1/eg25-manager"; license = licenses.gpl3Plus; platforms = platforms.linux; - # needs to be made compatible with libgpiod 2.0 API. see: - # - - # - - # nixpkgs libgpiod was bumped 2023-07-29: - # - - broken = true; }; } diff --git a/pkgs/additional/eg25-manager/libgpiod1.nix b/pkgs/additional/eg25-manager/libgpiod1.nix new file mode 100644 index 00000000..8fc4238e --- /dev/null +++ b/pkgs/additional/eg25-manager/libgpiod1.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchurl, autoreconfHook, autoconf-archive, pkg-config, kmod +, enable-tools ? true +, enablePython ? false, python3, ncurses }: + +stdenv.mkDerivation rec { + pname = "libgpiod"; + version = "1.6.4"; + + src = fetchurl { + url = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-${version}.tar.gz"; + hash = "sha256-gp1KwmjfB4U2CdZ8/H9HbpqnNssqaKYwvpno+tGXvgo="; + }; + + buildInputs = [ kmod ] ++ lib.optionals enablePython [ python3 ncurses ]; + nativeBuildInputs = [ + autoconf-archive + pkg-config + autoreconfHook + ]; + + configureFlags = [ + "--enable-tools=${if enable-tools then "yes" else "no"}" + "--enable-bindings-cxx" + "--prefix=${placeholder "out"}" + ] ++ lib.optional enablePython "--enable-bindings-python"; + + meta = with lib; { + description = "C library and tools for interacting with the linux GPIO character device"; + longDescription = '' + Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use + the character device instead. This library encapsulates the ioctl calls and + data structures behind a straightforward API. + ''; + homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/"; + license = licenses.lgpl2; + maintainers = [ maintainers.expipiplus1 ]; + platforms = platforms.linux; + }; +}