Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openmoji-black,openmoji-color: fix hanging builds #174795

Merged
merged 1 commit into from
May 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion pkgs/data/fonts/openmoji/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, scfbuild
, fontforge
, libuninameslist
, nodejs
, nodePackages
, python3Packages
Expand All @@ -14,6 +17,34 @@ let
[ "OpenMoji-Color.ttf" "OpenMoji-Black.ttf" ]
variant;

# 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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fontforge-20201107 = fontforge.overrideAttrs (old: rec {
fontforge = fontforge.overrideAttrs (old: rec {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that infinite recursion since in nix let is recursive?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 could be. I am not sure right now.

Then normally something like the following is used

Suggested change
fontforge-20201107 = fontforge.overrideAttrs (old: rec {
fontforge' = fontforge.overrideAttrs (old: rec {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the shadowing doesn't work I would rather stick with meaningful names rather than '.

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;
});
Comment on lines +44 to +46
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scfbuild-with-fontforge-20201107 = scfbuild.override (old: {
fontforge = fontforge-20201107;
});
scfbuild = scfbuild.override (old: {
inherit fontforge;
});


in stdenv.mkDerivation rec {
pname = "openmoji";
version = "13.1.0";
Expand All @@ -26,7 +57,7 @@ in stdenv.mkDerivation rec {
};

nativeBuildInputs = [
scfbuild
scfbuild-with-fontforge-20201107
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scfbuild-with-fontforge-20201107
scfbuild

nodejs
nodePackages.glob
nodePackages.lodash
Expand Down