diff --git a/pkgs/development/python-modules/pycangjie/default.nix b/pkgs/development/python-modules/pycangjie/default.nix index 65768bdc806f..d35d0b40943f 100644 --- a/pkgs/development/python-modules/pycangjie/default.nix +++ b/pkgs/development/python-modules/pycangjie/default.nix @@ -1,47 +1,56 @@ { lib, - fetchFromGitHub, - bash, - autoconf, - automake, - libtool, + fetchFromGitLab, pkg-config, libcangjie, sqlite, buildPythonPackage, cython, + meson, + ninja, + cmake, }: -buildPythonPackage { +buildPythonPackage rec { pname = "pycangjie"; - version = "unstable-2015-05-03"; + version = "1.5.0"; + format = "other"; - src = fetchFromGitHub { - owner = "Cangjians"; + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "cangjie"; repo = "pycangjie"; - rev = "361bb413203fd43bab624d98edf6f7d20ce6bfd3"; - hash = "sha256-sS0Demzm89WtEIN4Efz0OTsUQ/c3gIX+/koekQGOca4="; + rev = version; + hash = "sha256-REWX6u3Rc72+e5lIImBwV5uFoBBUTMM5BOfYdKIFL4k="; }; + preConfigure = '' + ( + cd subprojects + set -x + cp -R --no-preserve=mode,ownership ${libcangjie.src} libcangjie + ) + ''; + nativeBuildInputs = [ pkg-config - libtool - autoconf - automake + meson + ninja cython + cmake ]; + buildInputs = [ - libcangjie sqlite ]; - preConfigure = '' - find . -name '*.sh' -exec sed -e 's@#!/bin/bash@${bash}/bin/bash@' -i '{}' ';' - sed -i 's@/usr@${libcangjie}@' tests/__init__.py - ''; + pythonImportCheck = [ "cangjie" ]; - configureScript = "./autogen.sh"; + # `buildPythonApplication` skips checkPhase + postInstallCheck = '' + mesonCheckPhase + ''; meta = with lib; { description = "Python wrapper to libcangjie"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0390abd70eb4..b1871a7bfc32 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11198,7 +11198,9 @@ self: super: with self; { py = callPackage ../development/python-modules/py { }; - pycangjie = callPackage ../development/python-modules/pycangjie { }; + pycangjie = callPackage ../development/python-modules/pycangjie { + inherit (pkgs.buildPackages) meson; + }; pycapnp = callPackage ../development/python-modules/pycapnp { };