summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-10-31 14:41:47 +0000
committerGitHub <noreply@github.com>2019-10-31 14:41:47 +0000
commitc613d705500de6312f20bc2e00f665e2ee783332 (patch)
treee025e70a5b359311a7979a6c2189748347148e63 /pkgs/tools
parentbb86d34842ad3129a182b7e6c40b8242fb8fb85a (diff)
parentfc1a7289ed86b8e1f04fdd8827ddd198ecbb64b8 (diff)
downloadnixpkgs-c613d705500de6312f20bc2e00f665e2ee783332.tar
nixpkgs-c613d705500de6312f20bc2e00f665e2ee783332.tar.gz
nixpkgs-c613d705500de6312f20bc2e00f665e2ee783332.tar.bz2
nixpkgs-c613d705500de6312f20bc2e00f665e2ee783332.tar.lz
nixpkgs-c613d705500de6312f20bc2e00f665e2ee783332.tar.xz
nixpkgs-c613d705500de6312f20bc2e00f665e2ee783332.tar.zst
nixpkgs-c613d705500de6312f20bc2e00f665e2ee783332.zip
Merge pull request #72313 from worldofpeace/fixup-twitter-font
twitter-color-emoji: use noto-fonts-emoji’s src
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/misc/scfbuild/default.nix16
-rw-r--r--pkgs/tools/misc/scfbuild/python-3.patch46
2 files changed, 59 insertions, 3 deletions
diff --git a/pkgs/tools/misc/scfbuild/default.nix b/pkgs/tools/misc/scfbuild/default.nix
index f66567798ff..7fbe13fd44e 100644
--- a/pkgs/tools/misc/scfbuild/default.nix
+++ b/pkgs/tools/misc/scfbuild/default.nix
@@ -4,26 +4,36 @@ buildPythonApplication {
   pname = "scfbuild";
   version = "1.0.3";
 
+  format = "other";
+
   src = fetchFromGitHub {
-    owner = "eosrei";
+    owner = "13rac1";
     repo = "scfbuild";
     rev = "9acc7fc5fedbf48683d8932dd5bd7583bf922bae";
     sha256 = "1zlqsxkpg7zvmhdjgbqwwc9qgac2b8amzq8c5kwyh5cv95zcp6qn";
   };
 
-  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
+  patches = [
+    # Convert to Python 3
+    # https://github.com/13rac1/scfbuild/pull/19
+    ./python-3.patch
+  ];
 
   propagatedBuildInputs = [ pyyaml fonttools fontforge ];
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out/${python.sitePackages}
     cp -r scfbuild $out/${python.sitePackages}
     cp -r bin $out
+
+    runHook postInstall
   '';
 
   meta = with lib; {
     description = "SVGinOT color font builder";
-    homepage = https://github.com/eosrei/scfbuild;
+    homepage = https://github.com/13rac1/scfbuild;
     license = licenses.gpl3;
     maintainers = with maintainers; [ abbradar ];
   };
diff --git a/pkgs/tools/misc/scfbuild/python-3.patch b/pkgs/tools/misc/scfbuild/python-3.patch
new file mode 100644
index 00000000000..5a0178ad8c8
--- /dev/null
+++ b/pkgs/tools/misc/scfbuild/python-3.patch
@@ -0,0 +1,46 @@
+--- a/bin/scfbuild
++++ b/bin/scfbuild
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ 
+ from __future__ import (absolute_import, division, print_function,
+--- a/scfbuild/builder.py
++++ b/scfbuild/builder.py
+@@ -287,8 +287,8 @@ def _add_name_record(self, text, name_id, platform_id, plat_enc_id, lang_id):
+         # TODO: The installed version of fontTools doesn't have
+         # table__n_a_m_e.setName().
+         record = NameRecord()
+-        # PyYAML creates strings, force to Unicode
+-        record.string = unicode(text)
++        # PyYAML creates strings, which are unicode as of Python3
++        record.string = text
+         record.nameID = name_id
+         record.platformID = platform_id
+         record.platEncID = plat_enc_id
+--- a/scfbuild/fforge.py
++++ b/scfbuild/fforge.py
+@@ -84,7 +84,7 @@ def add_glyphs(font, svg_filepaths, conf):
+             u_ids = [int(u_id, 16) for u_id in filename.split("-")]
+             # Example: (0x1f441, 0x1f5e8)
+ 
+-            u_str = ''.join(map(unichr, u_ids))
++            u_str = ''.join(map(chr, u_ids))
+             # Example: "U\0001f441U\0001f5e8"
+ 
+             # Replace sequences with correct ZWJ/VS16 versions as needed
+--- a/scfbuild/main.py
++++ b/scfbuild/main.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ 
+ # SCFBuild is released under the GNU General Public License v3.
+index 0000000..99418b5
+--- /dev/null
++++ b/scfbuild/requirements.txt
+@@ -0,0 +1,2 @@
++fonttools>=3.41.2
++PyYAML>=5.1