From 6813f200b9378b4d55cba78c216529394531fc2b Mon Sep 17 00:00:00 2001 From: Samuel Rounce Date: Fri, 13 Jan 2023 14:45:50 +0000 Subject: [PATCH] oversteer: init at 0.7.2 Add Oversteer - Steering Wheel Manager for Linux at version [0.7.2](https://github.com/berarma/oversteer/releases/tag/0.7.2). --- pkgs/applications/misc/oversteer/default.nix | 76 +++++++++++++++++++ .../misc/oversteer/fix-install-dir.patch | 13 ++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 91 insertions(+) create mode 100644 pkgs/applications/misc/oversteer/default.nix create mode 100644 pkgs/applications/misc/oversteer/fix-install-dir.patch diff --git a/pkgs/applications/misc/oversteer/default.nix b/pkgs/applications/misc/oversteer/default.nix new file mode 100644 index 00000000000..87c49c2cf7a --- /dev/null +++ b/pkgs/applications/misc/oversteer/default.nix @@ -0,0 +1,76 @@ +{ lib, stdenv, fetchFromGitHub, pkg-config, gettext, python3, python3Packages +, meson, cmake, ninja, udev, appstream, appstream-glib, desktop-file-utils, gtk3 +, wrapGAppsHook, gobject-introspection, bash, }: +let + python = python3.withPackages (p: + with p; [ + pygobject3 + pyudev + pyxdg + evdev + matplotlib + scipy + gtk3 + pygobject3 + ]); + + version = "0.7.2"; +in stdenv.mkDerivation { + inherit version; + + pname = "oversteer"; + + src = fetchFromGitHub { + owner = "berarma"; + repo = "oversteer"; + rev = version; + sha256 = "sha256-9MWRb0NXUbB8c+pH0mjUzsz849PmEjsZMhQr4wsmlKI="; + }; + + buildInputs = [ bash gtk3 ]; + + nativeBuildInputs = [ + pkg-config + gettext + python + wrapGAppsHook + gobject-introspection + meson + udev + ninja + appstream + appstream-glib + desktop-file-utils + ]; + + dontUseCmakeConfigure = true; + + propagatedBuildInputs = [ python gtk3 python3Packages.pygobject3 ]; + + mesonFlags = [ + "--prefix" + (placeholder "out") + "-Dudev_rules_dir=${placeholder "out"}/lib/udev/rules.d/" + ]; + + preFixup = '' + gappsWrapperArgs+=( + --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}" + ) + ''; + + postInstall = '' + substituteInPlace $out/lib/udev/rules.d/* \ + --replace /bin/sh ${bash}/bin/sh + ''; + + patches = [ ./fix-install-dir.patch ]; + + meta = with lib; { + homepage = "https://github.com/berarma/oversteer"; + description = "Steering Wheel Manager for Linux"; + license = licenses.gpl3; + maintainers = [ maintainers.srounce ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/applications/misc/oversteer/fix-install-dir.patch b/pkgs/applications/misc/oversteer/fix-install-dir.patch new file mode 100644 index 00000000000..0d5fdec6898 --- /dev/null +++ b/pkgs/applications/misc/oversteer/fix-install-dir.patch @@ -0,0 +1,13 @@ +diff --git a/meson.build b/meson.build +index 239acf9..6a06c83 100644 +--- a/meson.build ++++ b/meson.build +@@ -8,7 +8,7 @@ pymod = import('python') + prefix = get_option('prefix') + pkgdatadir = join_paths(prefix, get_option('datadir'), meson.project_name()) + py_installation = pymod.find_installation(get_option('python')) +-py_path = py_installation.get_path('purelib') ++py_path = py_installation.get_install_dir() + + python3_required_modules = ['gi', 'pyudev', 'xdg', 'evdev', 'gettext', 'matplotlib', 'scipy', 'numpy'] + foreach p : python3_required_modules diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1df342fa13d..1ebe7976790 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -38695,4 +38695,6 @@ with pkgs; tubekit-unwrapped = callPackage ../applications/networking/cluster/tubekit { }; resgate = callPackage ../servers/resgate { }; + + oversteer = callPackage ../applications/misc/oversteer { }; }