install -> Makefile. flake upgrade

This commit is contained in:
Denis Knauf 2025-01-17 22:00:37 +01:00
parent 1b77b1af54
commit 09763cfcb4
4 changed files with 25 additions and 60 deletions

View file

@ -13,11 +13,28 @@ CACHES := $(patsubst %,%.fc,$(FONTS))
all: fonts caches all: fonts caches
.PHONY: all .PHONY: all
install:
mkdir -p $(D)/share/{doc/$(name),fonts/{opentype,truetype,WOFF,WOFF2}{,/.fc}}
find . -name \*.otf -exec cp {} $(D)/share/fonts/opentype \;
find . -name \*.ttf -exec cp {} $(D)/share/fonts/truetype \;
find . -name \*.woff -exec cp {} $(D)/share/fonts/WOFF \;
find . -name \*.woff2 -exec cp {} $(D)/share/fonts/WOFF2 \;
find . -name \*.otf.fc -exec cp {} $(D)/share/fonts/opentype/.fc \;
find . -name \*.ttf.fc -exec cp {} $(D)/share/fonts/truetype/.fc \;
find . -name \*.woff.fc -exec cp {} $(D)/share/fonts/WOFF/.fc \;
find . -name \*.woff2.fc -exec cp {} $(D)/share/fonts/WOFF2/.fc \;
find "$(S)" -name \*.txt -exec cp {} $(D)/share/doc/$(name) \;
find "$(S)" -name \*.md -exec cp {} $(D)/share/doc/$(name) \;
find "$(S)" -name \*.adoc -exec cp {} $(D)/share/doc/$(name) \;
find "$(S)" -name \*.html -exec cp {} $(D)/share/doc/$(name) \;
find "$(S)" -name \*.css -exec cp {} $(D)/share/doc/$(name) \;
.PHONY: install
fonts: $(FONTS) fonts: $(FONTS)
.PHONY: all .PHONY: fonts
caches: $(CACHES) caches: $(CACHES)
.PHONY: all .PHONY: caches
%.woff: %.otf %.woff: %.otf
sfnt2woff-zopfli "$<" sfnt2woff-zopfli "$<"

View file

@ -41,60 +41,8 @@
done done
make -j all make -j all
''; '';
# for s in *.otf *.ttf
# do
# bn="''${s%.otf}"
# bn="''${bn%.ttf}"
# if ! [ -e "$bn.woff" ]
# then
# echo "sfnt2woff-zopfli $s => $bn.woff"
# sfnt2woff-zopfli "$s"
# fi
# if ! [ -e "$bn.woff2" ]
# then
# echo "woff2_compress $s => $bn.woff2"
# woff2_compress "$s"
# fi
# done
#
# for s in *.otf *.ttf *.woff
# do
# fc="`dirname "$s"`/`basename "$s"`.fc"
# echo "fc-scan $s"
# LANG=C LC_NUMERIC=C fc-scan --format 'family=%{family}
#fullname=%{fullname}
#postscriptname=%{postscriptname}
#variable=%{variable}
#slant=%{slant}
#style=%{style}
#weight=%{weight}
#width=%{width}
#
#' "$s" > "$fc"
# done
# for s in *.woff2
# do
# o="`dirname "$s"`/`basename "$s" .woff2`.woff.fc"
# fc="`dirname "$s"`/`basename "$s"`.fc"
# cp "$o" "$fc"
# done
# '';
installPhase = '' installPhase = ''
cd "$TMPDIR" make -j install D=$out name=${name_} S=$source_dir
mkdir -p $out/share/{doc/${name_},fonts/{opentype,truetype,WOFF,WOFF2}{,/.fc}}
find "$build_dir" -name \*.otf -exec cp \{\} $out/share/fonts/opentype \;
find "$build_dir" -name \*.ttf -exec cp \{\} $out/share/fonts/truetype \;
find "$build_dir" -name \*.woff -exec cp \{\} $out/share/fonts/WOFF \;
find "$build_dir" -name \*.woff2 -exec cp \{\} $out/share/fonts/WOFF2 \;
find "$build_dir" -name \*.otf.fc -exec cp \{\} $out/share/fonts/opentype/.fc \;
find "$build_dir" -name \*.ttf.fc -exec cp \{\} $out/share/fonts/truetype/.fc \;
find "$build_dir" -name \*.woff.fc -exec cp \{\} $out/share/fonts/WOFF/.fc \;
find "$build_dir" -name \*.woff2.fc -exec cp \{\} $out/share/fonts/WOFF2/.fc \;
find "$source_dir" -name \*.txt -exec cp \{\} $out/share/doc/${name_} \;
find "$source_dir" -name \*.md -exec cp \{\} $out/share/doc/${name_} \;
find "$source_dir" -name \*.adoc -exec cp \{\} $out/share/doc/${name_} \;
find "$source_dir" -name \*.html -exec cp \{\} $out/share/doc/${name_} \;
find "$source_dir" -name \*.css -exec cp \{\} $out/share/doc/${name_} \;
''; '';
} // ( } // (
if null != src if null != src

8
flake.lock generated
View file

@ -2,16 +2,16 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1724316499, "lastModified": 1737041218,
"narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=", "narHash": "sha256-LOFldh08l0DN1zZoDZRYODQ6874FH6RJ9Im8dO19Uhg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841", "rev": "3355599fa13a9bfb29f9b875bd5991ff0bf9b2a1",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-24.05-small", "ref": "nixos-24.11-small",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -1,7 +1,7 @@
# vim: set et sw=2 ts=2 sts=2: # vim: set et sw=2 ts=2 sts=2:
{ {
description = "fonts"; description = "fonts";
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-24.05-small; inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-24.11-small;
outputs = { self, nixpkgs }: outputs = { self, nixpkgs }:
let let
allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];