Merge pull request #97862 from jtojnar/emoji-inkscape-fix

This commit is contained in:
Jan Tojnar 2020-09-14 01:43:57 +02:00 committed by GitHub
commit 9763e55345
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, inkscape, imagemagick, potrace, svgo, scfbuild }:
{ stdenv, fetchFromGitHub, fetchpatch, inkscape, imagemagick, potrace, svgo, scfbuild }:
stdenv.mkDerivation rec {
pname = "emojione";
@ -11,6 +11,22 @@ stdenv.mkDerivation rec {
sha256 = "1781kxfbhnvylypbkwxc3mx6hi0gcjisfjr9cf0jdz4d1zkf09b3";
};
patches = [
# Fix build with Inkscape 1.0
# https://github.com/eosrei/twemoji-color-font/pull/82
(fetchpatch {
url = "https://github.com/eosrei/twemoji-color-font/commit/208ad63c2ceb38c528b5237abeb2b85ceedc1d37.patch";
sha256 = "7tDWIkpcdir1V6skgXSM3r0FwHy0F6PyJ07OPRsSStA=";
postFetch = ''
substituteInPlace $out \
--replace "inkscape --without-gui" "inkscape --export-png" \
--replace TWEMOJI EMOJIONE \
--replace "the assets" "the emojione assets" \
--replace twemoji emojione
'';
})
];
preBuild = ''
sed -i 's,SCFBUILD :=.*,SCFBUILD := scfbuild,' Makefile
# Shut up inkscape's warnings

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, inkscape, imagemagick, potrace, svgo, scfbuild }:
{ stdenv, fetchFromGitHub, fetchpatch, inkscape, imagemagick, potrace, svgo, scfbuild }:
stdenv.mkDerivation rec {
pname = "twemoji-color-font";
@ -10,6 +10,19 @@ stdenv.mkDerivation rec {
sha256 = "00pbgqpkq21wl8fs0q1xp49xb10m48b9sz8cdc58flkd2vqfssw2";
};
patches = [
# Fix build with Inkscape 1.0
# https://github.com/eosrei/twemoji-color-font/pull/82
(fetchpatch {
url = "https://github.com/eosrei/twemoji-color-font/commit/208ad63c2ceb38c528b5237abeb2b85ceedc1d37.patch";
sha256 = "TV8I++BEnVUQg7FNbnrEQ/MLV9n3drmspqjmDZgTGFI=";
postFetch = ''
substituteInPlace $out \
--replace "inkscape --without-gui" "inkscape --export-png"
'';
})
];
nativeBuildInputs = [ inkscape imagemagick potrace svgo scfbuild ];
# silence inkscape errors about non-writable home
preBuild = "export HOME=\"$NIX_BUILD_ROOT\"";