Applefont : Format.

This commit is contained in:
Dmitry Voronin 2024-02-25 22:42:25 +03:00
parent c40c9115d7
commit 002ab52c75

View file

@ -1,76 +1,75 @@
{
description = "Apple fonts.";
outputs = { nixpkgs, system } @inputs:
let
pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.lib;
in {
packages.${system}.default = pkgs.stdenv.mkDerivation rec {
pname = "applefonts";
version = "1";
outputs = { nixpkgs, system } @inputs: let
pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.lib;
in {
packages.${system}.default = pkgs.stdenv.mkDerivation rec {
pname = "applefonts";
version = "1";
pro = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg";
sha256 = "sha256-Mu0pmx3OWiKBmMEYLNg+u2MxFERK07BQGe3WAhEec5Q=";
};
pro = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg";
sha256 = "sha256-Mu0pmx3OWiKBmMEYLNg+u2MxFERK07BQGe3WAhEec5Q=";
};
compact = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg";
sha256 = "sha256-Mkf+GK4iuUhZdUdzMW0VUOmXcXcISejhMeZVm0uaRwY=";
};
compact = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg";
sha256 = "sha256-Mkf+GK4iuUhZdUdzMW0VUOmXcXcISejhMeZVm0uaRwY=";
};
mono = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg";
sha256 = "sha256-tZHV6g427zqYzrNf3wCwiCh5Vjo8PAai9uEvayYPsjM=";
};
mono = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg";
sha256 = "sha256-tZHV6g427zqYzrNf3wCwiCh5Vjo8PAai9uEvayYPsjM=";
};
ny = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/NY.dmg";
sha256 = "sha256-tn1QLCSjgo5q4PwE/we80pJavr3nHVgFWrZ8cp29qBk=";
};
ny = pkgs.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/NY.dmg";
sha256 = "sha256-tn1QLCSjgo5q4PwE/we80pJavr3nHVgFWrZ8cp29qBk=";
};
nativeBuildInputs = with pkgs; [ p7zip ];
nativeBuildInputs = with pkgs; [ p7zip ];
sourceRoot = ".";
sourceRoot = ".";
dontUnpack = true;
dontUnpack = true;
installPhase = ''
7z x ${pro}
cd SFProFonts
7z x 'SF Pro Fonts.pkg'
7z x 'Payload~'
mkdir -p $out/fontfiles
mv Library/Fonts/* $out/fontfiles
cd ..
7z x ${mono}
cd SFMonoFonts
7z x 'SF Mono Fonts.pkg'
7z x 'Payload~'
mv Library/Fonts/* $out/fontfiles
cd ..
7z x ${compact}
cd SFCompactFonts
7z x 'SF Compact Fonts.pkg'
7z x 'Payload~'
mv Library/Fonts/* $out/fontfiles
cd ..
7z x ${ny}
cd NYFonts
7z x 'NY Fonts.pkg'
7z x 'Payload~'
mv Library/Fonts/* $out/fontfiles
mkdir -p $out/usr/share/fonts/OTF $out/usr/share/fonts/TTF
mv $out/fontfiles/*.otf $out/usr/share/fonts/OTF
mv $out/fontfiles/*.ttf $out/usr/share/fonts/TTF
rm -rf $out/fontfiles
'';
installPhase = ''
7z x ${pro}
cd SFProFonts
7z x 'SF Pro Fonts.pkg'
7z x 'Payload~'
mkdir -p $out/fontfiles
mv Library/Fonts/* $out/fontfiles
cd ..
7z x ${mono}
cd SFMonoFonts
7z x 'SF Mono Fonts.pkg'
7z x 'Payload~'
mv Library/Fonts/* $out/fontfiles
cd ..
7z x ${compact}
cd SFCompactFonts
7z x 'SF Compact Fonts.pkg'
7z x 'Payload~'
mv Library/Fonts/* $out/fontfiles
cd ..
7z x ${ny}
cd NYFonts
7z x 'NY Fonts.pkg'
7z x 'Payload~'
mv Library/Fonts/* $out/fontfiles
mkdir -p $out/usr/share/fonts/OTF $out/usr/share/fonts/TTF
mv $out/fontfiles/*.otf $out/usr/share/fonts/OTF
mv $out/fontfiles/*.ttf $out/usr/share/fonts/TTF
rm -rf $out/fontfiles
'';
meta = {
description = "Apple San Francisco, New York fonts.";
homepage = "https://developer.apple.com/fonts/";
};
meta = {
description = "Apple San Francisco, New York fonts.";
homepage = "https://developer.apple.com/fonts/";
};
};
};
}