From a3f918d3400e817e77685287103da3de8d7b7343 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 12 Oct 2021 09:00:15 +0000 Subject: [PATCH] libudev-zero: init at 1.0.0 libudev-zero is a daemonless reimplementation of udev, that is of additional interest to us in Nixpkgs because (currently with a small upstreamable build system patch) it's possible to build it statically, which systemd's udev is unlikely to support in the near future[1]. In future, it might be good to default to using libudev-zero in pkgsStatic, but for now let's just introduce the package, so people doing static builds can at least use it themselves using overrides or overlays. [1]: https://github.com/systemd/systemd/pull/20621#issuecomment-912014839 --- .../libraries/libudev-zero/default.nix | 38 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 40 insertions(+) create mode 100644 pkgs/development/libraries/libudev-zero/default.nix diff --git a/pkgs/development/libraries/libudev-zero/default.nix b/pkgs/development/libraries/libudev-zero/default.nix new file mode 100644 index 000000000000..9b154f34205e --- /dev/null +++ b/pkgs/development/libraries/libudev-zero/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchFromGitHub, fetchpatch }: + +stdenv.mkDerivation rec { + pname = "libudev-zero"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "illiliti"; + repo = "libudev-zero"; + rev = version; + sha256 = "0mln7iwyz7lxz8dx7bx7b47j6yws1dvfq35qsdcwg3wwmd4ngsz6"; + }; + + patches = [ + # Fix static. + # https://github.com/illiliti/libudev-zero/pull/48 + (fetchpatch { + url = "https://github.com/illiliti/libudev-zero/commit/505c61819b371a1802e054fe2601e64f2dc6d79e.patch"; + sha256 = "0y06rgjv73dd7fi3a0dlabcc8ryk3yhbsyrrhnnn3v36y1wz6m0g"; + }) + ]; + + makeFlags = [ "PREFIX=$(out)" ]; + + # Just let the installPhase build stuff, because there's no + # non-install target that builds everything anyway. + dontBuild = true; + + installTargets = lib.optionals stdenv.hostPlatform.isStatic "install-static"; + + meta = with lib; { + homepage = "https://github.com/illiliti/libudev-zero"; + description = "Daemonless replacement for libudev"; + maintainers = with maintainers; [ qyliss shamilton ]; + license = licenses.isc; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 301d5f47c8bd..0fe5edbeb6d6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18293,6 +18293,8 @@ with pkgs; libubox = callPackage ../development/libraries/libubox { }; + libudev-zero = callPackage ../development/libraries/libudev-zero { }; + libuecc = callPackage ../development/libraries/libuecc { }; libui = callPackage ../development/libraries/libui {