Unverified Commit 35eb5a6b authored by kirillrdy's avatar kirillrdy Committed by GitHub
Browse files

python3Packages.tilequant: fix build, cleanup (#455612)

parents 2ce32a62 ff7d6c7e
Loading
Loading
Loading
Loading
+21 −9
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchPypi,
  fetchFromGitHub,

  # build-system
  setuptools,

  # tests
  nose2,
  pytestCheckHook,
  setuptools,
}:

buildPythonPackage rec {
@@ -12,10 +17,11 @@ buildPythonPackage rec {
  version = "2.12.2";
  pyproject = true;

  src = fetchPypi {
    pname = "setuptools_dso";
    inherit version;
    hash = "sha256-evt2+T0Tzp2iRQJnbY8tTbw9o1xiRflfJ9+fp0RQeaQ=";
  src = fetchFromGitHub {
    owner = "epics-base";
    repo = "setuptools_dso";
    tag = version;
    hash = "sha256-YYm3mTA443vcD/4vHa7EgPzvDDzBic64NWWJDQYQHKs=";
  };

  build-system = [ setuptools ];
@@ -25,10 +31,16 @@ buildPythonPackage rec {
    pytestCheckHook
  ];

  meta = with lib; {
  disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
    # distutils.compilers.C.errors.CompileError: command '/nix/store/...-clang-wrapper-21.1.2/bin/clang' failed with exit code 1
    # fatal error: 'string' file not found
    "test_cxx"
  ];

  meta = {
    description = "Setuptools extension for building non-Python Dynamic Shared Objects";
    homepage = "https://github.com/mdavidsaver/setuptools_dso";
    license = licenses.bsd3;
    maintainers = with maintainers; [ marius851000 ];
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ marius851000 ];
  };
}
+21 −14
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,
  setuptools-dso,

  # dependencies
  click,
  fetchPypi,
  ordered-set,
  pillow,
  pythonOlder,
  setuptools,
  setuptools-dso,
  sortedcollections,
}:

@@ -16,19 +19,23 @@ buildPythonPackage rec {
  version = "1.2.0";
  pyproject = true;

  disabled = pythonOlder "3.9";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-0i7brL/hn8SOj3q/rpOcOQ9QW/4Mew2fr0Y42k4K9UI=";
  src = fetchFromGitHub {
    owner = "SkyTemple";
    repo = "tilequant";
    tag = version;
    # Fetch tilequant source files
    fetchSubmodules = true;
    hash = "sha256-MgyKLwVdL2DRR8J88q7Q57rQiX4FTOlQ5rTY3UuhaJM=";
  };

  pythonRelaxDeps = [ "pillow" ];

  build-system = [
    setuptools
    setuptools-dso
  ];

  pythonRelaxDeps = [
    "click"
  ];
  dependencies = [
    click
    ordered-set
@@ -41,12 +48,12 @@ buildPythonPackage rec {

  pythonImportsCheck = [ "tilequant" ];

  meta = with lib; {
  meta = {
    description = "Tool for quantizing image colors using tile-based palette restrictions";
    homepage = "https://github.com/SkyTemple/tilequant";
    changelog = "https://github.com/SkyTemple/tilequant/releases/tag/${version}";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ marius851000 ];
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ marius851000 ];
    mainProgram = "tilequant";
  };
}