1{ lib
2, stdenv
3, buildPythonPackage
4, pythonOlder
5, fetchFromGitHub
6, pillow
7, libX11
8, libXcursor
9, libpng
10, python
11, pytestCheckHook
12}:
13
14buildPythonPackage rec {
15 pname = "clickgen";
16 version = "1.2.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "ful1e5";
23 repo = "clickgen";
24 rev = "v${version}";
25 sha256 = "sha256-01c8SVy+J004dq5KCUe62w7i/xUTxTfl/IpvUtGQgw0=";
26 };
27
28 buildInputs = [ libXcursor libX11 libpng ];
29
30 propagatedBuildInputs = [ pillow ];
31
32 checkInputs = [ pytestCheckHook ];
33
34 postBuild = ''
35 # Needs to build xcursorgen.so
36 cd src/xcursorgen
37 make
38 cd ../..
39 '';
40
41 postInstall = ''
42 install -m644 src/xcursorgen/xcursorgen.so $out/${python.sitePackages}/clickgen/xcursorgen.so
43 # Copying scripts directory needed by clickgen script at $out/bin/
44 cp -R src/clickgen/scripts $out/${python.sitePackages}/clickgen/scripts
45 '';
46
47 pythonImportsCheck = [ "clickgen" ];
48
49 meta = with lib; {
50 homepage = "https://github.com/ful1e5/clickgen";
51 description = "The hassle-free cursor building toolbox";
52 longDescription = ''
53 clickgen is API for building X11 and Windows Cursors from
54 .png files. clickgen is using anicursorgen and xcursorgen under the hood.
55 '';
56 license = licenses.mit;
57 maintainers = with maintainers; [ AdsonCicilioti ];
58 # fails with:
59 # ld: unknown option: -zdefs
60 broken = stdenv.isDarwin;
61 };
62}