Commit 638f56df authored by Gaetan Lepage's avatar Gaetan Lepage
Browse files

python3Packages.lupa: build from source

parent 03de9fe8
Loading
Loading
Loading
Loading
+27 −6
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  cython,
  fetchPypi,
  setuptools,
}:

  # nativeBuildInputs
  pkg-config,

  # buildInputs
  luajit,
}:
buildPythonPackage (finalAttrs: {
  pname = "lupa";
  version = "2.8";
  pyproject = true;

  src = fetchPypi {
    inherit (finalAttrs) pname version;
    hash = "sha256-2AImQbnsjs8sXsvp9H5acOC4fEta6SG5LLAqY44KzQg=";
  src = fetchFromGitHub {
    owner = "scoder";
    repo = "lupa";
    tag = "lupa-${finalAttrs.version}";
    hash = "sha256-JlKxisVd0sbLcmVjzyFEkbUDAornAoCWekpASl6qeY4=";
  };

  build-system = [
@@ -21,12 +30,24 @@ buildPythonPackage (finalAttrs: {
    setuptools
  ];

  nativeBuildInputs = [
    pkg-config
  ];

  env = {
    LUPA_NO_BUNDLE = "true";
  };

  buildInputs = [
    luajit
  ];

  pythonImportsCheck = [ "lupa" ];

  meta = {
    description = "Lua in Python";
    homepage = "https://github.com/scoder/lupa";
    changelog = "https://github.com/scoder/lupa/blob/lupa-${finalAttrs.version}/CHANGES.rst";
    changelog = "https://github.com/scoder/lupa/blob/${finalAttrs.src.tag}/CHANGES.rst";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };