Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bb86d34842ad
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c613d705500d
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Oct 30, 2019

  1. twitter-color-emoji: use noto-fonts-emoji’s src

    Continues #72272
    worldofpeace authored and jtojnar committed Oct 30, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    JeanMertz Jean Mertz
    Copy the full SHA
    5cef7b4 View commit details

Commits on Oct 31, 2019

  1. scfbuild: switch to Python 3

    Needed to drop phases @#$% to be able to use this at all.
    
    Fixes emojione and twemoji-color-font
    jtojnar committed Oct 31, 2019
    Copy the full SHA
    fc1a728 View commit details
  2. Merge pull request #72313 from worldofpeace/fixup-twitter-font

    twitter-color-emoji: use noto-fonts-emoji’s src
    worldofpeace authored Oct 31, 2019
    Copy the full SHA
    c613d70 View commit details
Showing with 68 additions and 31 deletions.
  1. +8 −27 pkgs/data/fonts/twitter-color-emoji/default.nix
  2. +13 −3 pkgs/tools/misc/scfbuild/default.nix
  3. +46 −0 pkgs/tools/misc/scfbuild/python-3.patch
  4. +1 −1 pkgs/top-level/all-packages.nix
35 changes: 8 additions & 27 deletions pkgs/data/fonts/twitter-color-emoji/default.nix
Original file line number Diff line number Diff line change
@@ -3,29 +3,20 @@

{ stdenv
, fetchFromGitHub
, fetchpatch
, cairo
, graphicsmagick
, pkg-config
, pngquant
, python3
, which
, zopfli
, fetchpatch
, noto-fonts-emoji
}:

let
version = "12.1.2";

# Cannot use noto-fonts-emoji.src since it is too old
# and still tries to use vendored pngquant.
notoSrc = fetchFromGitHub {
name = "noto";
owner = "googlefonts";
repo = "noto-emoji";
rev = "833a43d03246a9325e748a2d783006454d76ff66";
sha256 = "1g6ikzk8banm3ihqm9g27ggjq2mn1b1hq3zhpl13lxid6mp60s4a";
};

twemojiSrc = fetchFromGitHub {
name = "twemoji";
owner = "twitter";
@@ -34,46 +25,36 @@ let
sha256 = "0vzmlp83vnk4njcfkn03jcc1vkg2rf12zf5kj3p3a373xr4ds1zn";
};

python = python3.withPackages (pp: with pp; [
nototools
]);
in
stdenv.mkDerivation rec {
pname = "twitter-color-emoji";
inherit version;

srcs = [
notoSrc
noto-fonts-emoji.src
twemojiSrc
];

sourceRoot = notoSrc.name;
sourceRoot = noto-fonts-emoji.src.name;

postUnpack = ''
chmod -R +w ${twemojiSrc.name}
mv ${twemojiSrc.name} ${notoSrc.name}
mv ${twemojiSrc.name} ${noto-fonts-emoji.src.name}
'';

nativeBuildInputs = [
cairo
graphicsmagick
pkg-config
pngquant
python
python3
python3.pkgs.nototools
which
zopfli
];

patches = [
# Port to python3
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/twitter-twemoji-fonts/raw/3bc176c10ced2824fe03da5ff561e22a36bf8ccd/f/noto-emoji-port-to-python3.patch";
sha256 = "1b91abd050phxlxq7322i74nkx16fkhpw14yh97r2j4c7fqarr2q";
})
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/twitter-twemoji-fonts/raw/3bc176c10ced2824fe03da5ff561e22a36bf8ccd/f/noto-emoji-python3.patch";
sha256 = "0mw2c748izb6h9a19jwc0qxlb6l1kj6k8gc345lpf7lfcxfl7l59";
})
# ImageMagick -> GrahphicsMagick
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/twitter-twemoji-fonts/raw/3bc176c10ced2824fe03da5ff561e22a36bf8ccd/f/noto-emoji-use-gm.patch";
sha256 = "0yfmfzaaiq5163c06172g4r734aysiqyv1s28siv642vqzsqh4i2";
16 changes: 13 additions & 3 deletions pkgs/tools/misc/scfbuild/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
46 changes: 46 additions & 0 deletions pkgs/tools/misc/scfbuild/python-3.patch
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -6117,7 +6117,7 @@ in
qtbase = qt4;
};

scfbuild = python2.pkgs.callPackage ../tools/misc/scfbuild { };
scfbuild = python3.pkgs.callPackage ../tools/misc/scfbuild { };

scriptaculous = callPackage ../development/libraries/scriptaculous { };