diff --git a/pkgs/by-name/ar/ark-pixel-font/package.nix b/pkgs/by-name/ar/ark-pixel-font/package.nix new file mode 100644 index 000000000000..f5ffd4f9b2c6 --- /dev/null +++ b/pkgs/by-name/ar/ark-pixel-font/package.nix @@ -0,0 +1,60 @@ +{ lib +, python3Packages +, fetchFromGitHub +, nix-update-script +, ... +}: + +python3Packages.buildPythonPackage rec { + pname = "ark-pixel-font"; + version = "2023.08.15"; + + src = fetchFromGitHub { + owner = "TakWolf"; + repo = pname; + rev = version; + hash = "sha256-Qaa3uuMCPrRG0wo2AGU0v+fonY1c/KuQYTGoyvITcio="; + }; + + format = "other"; + + nativeBuildInputs = with python3Packages; [ + pixel-font-builder + unidata-blocks + character-encoding-utils + pypng + pillow + beautifulsoup4 + jinja2 + gitpython + ]; + + buildPhase = '' + runHook preBuild + + python build.py + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + install -Dm444 build/outputs/*.bdf -t $out/share/fonts/bdf + install -Dm444 build/outputs/*.otf -t $out/share/fonts/opentype + install -Dm444 build/outputs/*.ttf -t $out/share/fonts/truetype + install -Dm444 build/outputs/*.woff2 -t $out/share/fonts/woff2 + + runHook postInstall + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Open source pan-CJK pixel font"; + homepage = "https://ark-pixel-font.takwolf.com/"; + license = lib.licenses.ofl; + maintainers = with lib.maintainers; [ h7x4 ]; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/development/python-modules/bdffont/default.nix b/pkgs/development/python-modules/bdffont/default.nix new file mode 100644 index 000000000000..e9e0595f3f15 --- /dev/null +++ b/pkgs/development/python-modules/bdffont/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pythonOlder +, nix-update-script +, hatch-vcs +, hatchling +, brotli +, fonttools +}: + +buildPythonPackage rec { + pname = "bdffont"; + version = "0.0.15"; + + disabled = pythonOlder "3.11"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-aXK6zqLFfqLXa/JLmSSW3gtC2+wtutz3/lLdYPZZ/ys="; + }; + + format = "pyproject"; + + nativeBuildInputs = [ + hatch-vcs + hatchling + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + homepage = "https://github.com/TakWolf/bdffont"; + description = "A library for manipulating .bdf format fonts"; + platforms = lib.platforms.all; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ h7x4 ]; + }; +} diff --git a/pkgs/development/python-modules/character-encoding-utils/default.nix b/pkgs/development/python-modules/character-encoding-utils/default.nix new file mode 100644 index 000000000000..dd0e3b60fe1f --- /dev/null +++ b/pkgs/development/python-modules/character-encoding-utils/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pythonOlder +, nix-update-script +, hatch-vcs +, hatchling +}: + +buildPythonPackage rec { + pname = "character-encoding-utils"; + version = "0.0.6"; + + disabled = pythonOlder "3.11"; + + src = fetchPypi { + pname = "character_encoding_utils"; + inherit version; + hash = "sha256-ugzWiSpa/xxlraVyVPTSq/uxPg11kOyePgb1cmzX3ug="; + }; + + format = "pyproject"; + + nativeBuildInputs = [ + hatch-vcs + hatchling + ]; + + checkInputs = [ pytestCheckHook ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + homepage = "https://github.com/TakWolf/character-encoding-utils"; + description = "Some character encoding utils"; + platforms = lib.platforms.all; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ h7x4 ]; + }; +} diff --git a/pkgs/development/python-modules/pixel-font-builder/default.nix b/pkgs/development/python-modules/pixel-font-builder/default.nix new file mode 100644 index 000000000000..d541cd00dc5a --- /dev/null +++ b/pkgs/development/python-modules/pixel-font-builder/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pythonOlder +, nix-update-script +, hatch-vcs +, hatchling +, bdffont +, brotli +, fonttools +, pypng +}: + +buildPythonPackage rec { + pname = "pixel-font-builder"; + version = "0.0.10"; + + disabled = pythonOlder "3.11"; + + src = fetchPypi { + pname = "pixel_font_builder"; + inherit version; + hash = "sha256-evLsNRSC9sPZfhNc8tYbZ/bIrBxSbLuiGRD3ld7Jkbo="; + }; + + format = "pyproject"; + + nativeBuildInputs = [ + hatch-vcs + hatchling + ]; + + nativeCheckInputs = [ + pytestCheckHook + pypng + ]; + + propagatedBuildInputs = [ + bdffont + brotli + fonttools + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + homepage = "https://github.com/TakWolf/pixel-font-builder"; + description = "A library that helps create pixel style fonts"; + platforms = lib.platforms.all; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ h7x4 ]; + }; +} diff --git a/pkgs/development/python-modules/unidata-blocks/default.nix b/pkgs/development/python-modules/unidata-blocks/default.nix new file mode 100644 index 000000000000..cded041c46b8 --- /dev/null +++ b/pkgs/development/python-modules/unidata-blocks/default.nix @@ -0,0 +1,44 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pythonOlder +, nix-update-script +, hatch-vcs +, hatchling +, langcodes +}: + +buildPythonPackage rec { + pname = "unidata-blocks"; + version = "0.0.8"; + + disabled = pythonOlder "3.11"; + + src = fetchPypi { + pname = "unidata_blocks"; + inherit version; + hash = "sha256-Y7OSFuPHgzNc/KtmBWwdVqH7Xy4v4w2UGHBUF9pIuSU="; + }; + + format = "pyproject"; + + nativeBuildInputs = [ + hatch-vcs + hatchling + ]; + + propagatedBuildInputs = [ langcodes ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + homepage = "https://github.com/TakWolf/unidata-blocks"; + description = "A library that helps query unicode blocks by Blocks.txt"; + platforms = lib.platforms.all; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ h7x4 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bca7ede07949..c17c171bf40f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1378,6 +1378,8 @@ self: super: with self; { else callPackage ../development/python-modules/bcrypt { }; + bdffont = callPackage ../development/python-modules/bdffont { }; + beaker = callPackage ../development/python-modules/beaker { }; before-after = callPackage ../development/python-modules/before-after { }; @@ -1962,6 +1964,8 @@ self: super: with self; { characteristic = callPackage ../development/python-modules/characteristic { }; + character-encoding-utils = callPackage ../development/python-modules/character-encoding-utils { }; + chardet = callPackage ../development/python-modules/chardet { }; charset-normalizer = callPackage ../development/python-modules/charset-normalizer { }; @@ -9241,6 +9245,8 @@ self: super: with self; { pixelmatch = callPackage ../development/python-modules/pixelmatch { }; + pixel-font-builder = callPackage ../development/python-modules/pixel-font-builder { }; + pixel-ring = callPackage ../development/python-modules/pixel-ring { }; pjsua2 = (toPythonModule (pkgs.pjsip.override { @@ -15419,6 +15425,8 @@ self: super: with self; { unicrypto = callPackage ../development/python-modules/unicrypto { }; + unidata-blocks = callPackage ../development/python-modules/unidata-blocks { }; + unidecode = callPackage ../development/python-modules/unidecode { }; unidic = callPackage ../development/python-modules/unidic { };