From 53f7b857611a7ab2931d1cabb4ed68ef3106e67a Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 29 Oct 2024 18:50:14 +0800 Subject: [PATCH 1/3] geis: move to by-name --- .../libraries/geis/default.nix => by-name/ge/geis/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{development/libraries/geis/default.nix => by-name/ge/geis/package.nix} (100%) diff --git a/pkgs/development/libraries/geis/default.nix b/pkgs/by-name/ge/geis/package.nix similarity index 100% rename from pkgs/development/libraries/geis/default.nix rename to pkgs/by-name/ge/geis/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 766fadbf06197..86425fe9a01a9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17557,8 +17557,6 @@ with pkgs; flexcpp = callPackage ../development/tools/parsing/flexc++ { }; - geis = callPackage ../development/libraries/geis { }; - gi-docgen = callPackage ../development/tools/documentation/gi-docgen { }; git2-cpp = callPackage ../development/libraries/git2-cpp { }; From 57e2661b9c431455d3db4dc6352e049283e8578d Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 29 Oct 2024 18:56:08 +0800 Subject: [PATCH 2/3] geis: nixfmt --- pkgs/by-name/ge/geis/package.nix | 61 +++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/pkgs/by-name/ge/geis/package.nix b/pkgs/by-name/ge/geis/package.nix index 17266481b27a3..62a9343915475 100644 --- a/pkgs/by-name/ge/geis/package.nix +++ b/pkgs/by-name/ge/geis/package.nix @@ -1,21 +1,23 @@ -{ lib, stdenv, fetchurl -, pkg-config -, python3Packages -, wrapGAppsHook3 -, atk -, dbus -, evemu -, frame -, gdk-pixbuf -, gobject-introspection -, grail -, gtk3 -, xorg -, pango -, xorgserver +{ + lib, + stdenv, + fetchurl, + pkg-config, + python3Packages, + wrapGAppsHook3, + atk, + dbus, + evemu, + frame, + gdk-pixbuf, + gobject-introspection, + grail, + gtk3, + xorg, + pango, + xorgserver, }: - stdenv.mkDerivation rec { pname = "geis"; version = "2.2.17"; @@ -29,12 +31,29 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - pythonPath = with python3Packages; - [ pygobject3 ]; + pythonPath = with python3Packages; [ pygobject3 ]; - nativeBuildInputs = [ pkg-config wrapGAppsHook3 python3Packages.wrapPython gobject-introspection ]; - buildInputs = [ atk dbus evemu frame gdk-pixbuf grail - gtk3 xorg.libX11 xorg.libXext xorg.libXi xorg.libXtst pango python3Packages.python xorgserver + nativeBuildInputs = [ + pkg-config + wrapGAppsHook3 + python3Packages.wrapPython + gobject-introspection + ]; + buildInputs = [ + atk + dbus + evemu + frame + gdk-pixbuf + grail + gtk3 + xorg.libX11 + xorg.libXext + xorg.libXi + xorg.libXtst + pango + python3Packages.python + xorgserver ]; patchPhase = '' From 98cf19e7ad6d0a4474adad6fc8b10982f0fc2f52 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 29 Oct 2024 19:58:19 +0800 Subject: [PATCH 3/3] geis: fix build --- pkgs/by-name/ge/geis/package.nix | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ge/geis/package.nix b/pkgs/by-name/ge/geis/package.nix index 62a9343915475..8446cb446a179 100644 --- a/pkgs/by-name/ge/geis/package.nix +++ b/pkgs/by-name/ge/geis/package.nix @@ -16,15 +16,17 @@ xorg, pango, xorgserver, + testers, + validatePkgConfig, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "geis"; version = "2.2.17"; src = fetchurl { - url = "https://launchpad.net/geis/trunk/${version}/+download/${pname}-${version}.tar.xz"; - sha256 = "1svhbjibm448ybq6gnjjzj0ak42srhihssafj0w402aj71lgaq4a"; + url = "https://launchpad.net/geis/trunk/${finalAttrs.version}/+download/geis-${finalAttrs.version}.tar.xz"; + hash = "sha256-imD1aDhSCUA4kE5pDSPMWpCpgPxS2mfw8oiQuqJccOs="; }; env.NIX_CFLAGS_COMPILE = "-Wno-error=misleading-indentation -Wno-error=pointer-compare"; @@ -38,7 +40,9 @@ stdenv.mkDerivation rec { wrapGAppsHook3 python3Packages.wrapPython gobject-introspection + validatePkgConfig ]; + buildInputs = [ atk dbus @@ -56,9 +60,13 @@ stdenv.mkDerivation rec { xorgserver ]; - patchPhase = '' - substituteInPlace python/geis/geis_v2.py --replace \ + prePatch = '' + substituteInPlace python/geis/geis_v2.py --replace-fail \ "ctypes.util.find_library(\"geis\")" "'$out/lib/libgeis.so'" + substituteInPlace config.aux/py-compile \ + --replace-fail "import sys, os, py_compile, imp" "import sys, os, py_compile, importlib" \ + --replace-fail "imp." "importlib." \ + --replace-fail "hasattr(imp" "hasattr(importlib" ''; preFixup = '' @@ -66,10 +74,16 @@ stdenv.mkDerivation rec { gappsWrapperArgs+=(--set PYTHONPATH "$program_PYTHONPATH") ''; - meta = with lib; { + passthru.tests.pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + versionCheck = true; + }; + + meta = { description = "Library for input gesture recognition"; homepage = "https://launchpad.net/geis"; - license = licenses.gpl2; - platforms = platforms.linux; + license = lib.licenses.gpl2; + platforms = lib.platforms.linux; + pkgConfigModules = [ "libgeis" ]; }; -} +})