2020-12-03 09:49:04 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2019-10-01 13:43:42 +00:00
|
|
|
, fetchFromGitHub
|
2022-05-26 20:15:38 +00:00
|
|
|
, fetchpatch
|
2019-10-01 13:43:42 +00:00
|
|
|
, scfbuild
|
2022-05-26 20:15:38 +00:00
|
|
|
, fontforge
|
|
|
|
, libuninameslist
|
2021-08-12 15:14:19 +00:00
|
|
|
, nodejs
|
|
|
|
, nodePackages
|
2020-07-06 10:21:48 +00:00
|
|
|
, python3Packages
|
2019-10-01 13:43:42 +00:00
|
|
|
, variant ? "color" # "color" or "black"
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
filename = builtins.replaceStrings
|
|
|
|
[ "color" "black" ]
|
|
|
|
[ "OpenMoji-Color.ttf" "OpenMoji-Black.ttf" ]
|
|
|
|
variant;
|
|
|
|
|
2022-05-26 20:15:38 +00:00
|
|
|
# With newer fontforge the build hangs, see
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/167869
|
|
|
|
# Patches etc taken from
|
|
|
|
# https://github.com/NixOS/nixpkgs/commit/69da642a5a9bb433138ba1b13c8d56fb5bb6ec05
|
|
|
|
fontforge-20201107 = fontforge.overrideAttrs (old: rec {
|
|
|
|
version = "20201107";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fontforge";
|
|
|
|
repo = "fontforge";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-Rl/5lbXaPgIndANaD0IakaDus6T53FjiBb45FIuGrvc=";
|
|
|
|
};
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://salsa.debian.org/fonts-team/fontforge/raw/76bffe6ccf8ab20a0c81476a80a87ad245e2fd1c/debian/patches/0001-add-extra-cmake-install-rules.patch";
|
|
|
|
sha256 = "u3D9od2xLECNEHhZ+8dkuv9818tPkdP6y/Tvd9CADJg=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/fontforge/fontforge/commit/69e263b2aff29ad22f97f13935cfa97a1eabf207.patch";
|
|
|
|
sha256 = "06yyf90605aq6ppfiz83mqkdmnaq5418axp9jgsjyjq78b00xb29";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
buildInputs = old.buildInputs ++ [ libuninameslist ];
|
|
|
|
});
|
|
|
|
scfbuild-with-fontforge-20201107 = scfbuild.override (old: {
|
|
|
|
fontforge = fontforge-20201107;
|
|
|
|
});
|
|
|
|
|
2019-10-01 13:43:42 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "openmoji";
|
2020-12-03 09:49:04 +00:00
|
|
|
version = "13.1.0";
|
2019-10-01 13:43:42 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hfg-gmuend";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-12-03 09:49:04 +00:00
|
|
|
sha256 = "sha256-7G6a+LFq79njyPhnDhhSJ98Smw5fWlfcsFj6nWBPsSk=";
|
2019-10-01 13:43:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-05-26 20:15:38 +00:00
|
|
|
scfbuild-with-fontforge-20201107
|
2021-08-12 15:14:19 +00:00
|
|
|
nodejs
|
|
|
|
nodePackages.glob
|
|
|
|
nodePackages.lodash
|
2019-10-01 13:43:42 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
2021-08-12 15:14:19 +00:00
|
|
|
runHook preBuild
|
2019-10-01 13:43:42 +00:00
|
|
|
|
2021-08-12 15:14:19 +00:00
|
|
|
node helpers/generate-font-glyphs.js
|
2019-10-01 13:43:42 +00:00
|
|
|
|
|
|
|
cd font
|
2020-09-16 09:24:54 +00:00
|
|
|
scfbuild -c scfbuild-${variant}.yml
|
2021-08-12 15:14:19 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
2019-10-01 13:43:42 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm644 ${filename} $out/share/fonts/truetype/${filename}
|
|
|
|
'';
|
|
|
|
|
2020-12-03 09:49:04 +00:00
|
|
|
meta = with lib; {
|
2019-10-01 13:43:42 +00:00
|
|
|
license = licenses.cc-by-sa-40;
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
homepage = "https://openmoji.org/";
|
|
|
|
downloadPage = "https://github.com/hfg-gmuend/openmoji/releases";
|
|
|
|
description = "Open-source emojis for designers, developers and everyone else";
|
|
|
|
};
|
|
|
|
}
|