summary refs log tree commit diff
path: root/pkgs/data
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2019-10-31 11:23:49 +0100
committerLassulus <github@lassul.us>2019-12-08 10:40:31 +0100
commita8db8ddfe347dee899e495deea08c0bace8ccdcb (patch)
tree2661de6d18bc4f04a6a77fbc36f0c9e7fe7f3548 /pkgs/data
parent182a8799c5f63214a5c32265f8cd5532c1f3f4eb (diff)
downloadnixpkgs-a8db8ddfe347dee899e495deea08c0bace8ccdcb.tar
nixpkgs-a8db8ddfe347dee899e495deea08c0bace8ccdcb.tar.gz
nixpkgs-a8db8ddfe347dee899e495deea08c0bace8ccdcb.tar.bz2
nixpkgs-a8db8ddfe347dee899e495deea08c0bace8ccdcb.tar.lz
nixpkgs-a8db8ddfe347dee899e495deea08c0bace8ccdcb.tar.xz
nixpkgs-a8db8ddfe347dee899e495deea08c0bace8ccdcb.tar.zst
nixpkgs-a8db8ddfe347dee899e495deea08c0bace8ccdcb.zip
uw-ttyp0: init at 1.3
Diffstat (limited to 'pkgs/data')
-rw-r--r--pkgs/data/fonts/uw-ttyp0/default.nix78
-rw-r--r--pkgs/data/fonts/uw-ttyp0/determinism.patch13
2 files changed, 91 insertions, 0 deletions
diff --git a/pkgs/data/fonts/uw-ttyp0/default.nix b/pkgs/data/fonts/uw-ttyp0/default.nix
new file mode 100644
index 00000000000..eae820fb0d1
--- /dev/null
+++ b/pkgs/data/fonts/uw-ttyp0/default.nix
@@ -0,0 +1,78 @@
+{ stdenv, fetchurl, perl
+, bdftopcf, bdf2psf, mkfontdir
+, fonttosfnt
+, targetsDat  ? null
+, variantsDat ? null
+}:
+
+stdenv.mkDerivation rec {
+  pname = "uw-ttyp0";
+  version = "1.3";
+
+  src = fetchurl {
+    url = "https://people.mpi-inf.mpg.de/~uwe/misc/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "1vp053bwv8sr40p3pn4sjaiq570zp7knh99z9ynk30v7ml4cz2i8";
+  };
+
+  # remove for version >1.3
+  patches = [ ./determinism.patch ];
+
+  nativeBuildInputs = [ perl bdftopcf bdf2psf fonttosfnt mkfontdir ];
+
+  outputHashAlgo = "sha256";
+  outputHashMode = "recursive";
+  outputHash     = "0hzhaakbbcnz5ksi5p8mavw9578rsqlqadkrirrkhfnyqqlrii4j";
+
+  # configure sizes, encodings and variants
+  preConfigure =
+    (if targetsDat == null
+      then ''
+        cat << EOF > TARGETS.dat
+        SIZES = 11 12 13 14 15 16 17 18 22 \
+        11b 12b 13b 14b 15b 16b 17b 18b 22b 15i 16i 17i 18i
+        ENCODINGS = uni
+        EOF
+      ''
+      else ''cp "${targetsDat}" TARGETS.dat'') +
+    (if variantsDat == null
+      then ''
+        cat << EOF > VARIANTS.dat
+        COPYTO AccStress PApostropheAscii
+        COPYTO PAmComma AccGraveAscii
+        COPYTO Digit0Slashed Digit0
+        EOF
+      ''
+      else ''cp "${variantsDat}" VARIANTS.dat'');
+
+  postBuild = ''
+    # convert bdf to psf and otb fonts
+    build=$(pwd)
+    mkdir {psf,otb}
+    cd ${bdf2psf}/share/bdf2psf
+    for i in $build/genbdf/*.bdf; do
+      name="$(basename $i .bdf)"
+      bdf2psf \
+        --fb "$i" standard.equivalents \
+        ascii.set+useful.set+linux.set 512 \
+        "$build/psf/$name.psf"
+      fonttosfnt -v -o "$build/otb/$name.otb" "$i"
+    done
+    cd $build
+  '';
+
+  postInstall = ''
+    # install psf fonts
+    fontDir="$out/share/consolefonts"
+    mkdir -p "$fontDir"
+    mv -t "$fontDir" psf/*.psf
+    mv -t "$out/share/fonts/X11/misc" otb/*.otb
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Monospace bitmap screen fonts for X11";
+    homepage = https://people.mpi-inf.mpg.de/~uwe/misc/uw-ttyp0/;
+    license = with licenses; [ free mit ];
+    maintainers = with maintainers; [ rnhmjoj ];
+  };
+
+}
diff --git a/pkgs/data/fonts/uw-ttyp0/determinism.patch b/pkgs/data/fonts/uw-ttyp0/determinism.patch
new file mode 100644
index 00000000000..8546ad35933
--- /dev/null
+++ b/pkgs/data/fonts/uw-ttyp0/determinism.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile.in b/Makefile.in
+index b9736cd..5740412 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -76,7 +76,7 @@ bdf : $(bdf)
+ 
+ genpcf/%.pcf.gz : genbdf/%.bdf
+ 	$(BDFTOPCF) $< > $(@:.pcf.gz=.pcf)
+-	gzip -9 -f $(@:.pcf.gz=.pcf)
++	gzip -n -9 -f $(@:.pcf.gz=.pcf)
+ 
+ genbdf/t0-11-uni.bdf : bdf/t0-11.bdf bdf/t0-12.bdf VARIANTS.dat mgl/unicode.mgl
+ 	$(MKSHALLOW) bdf/t0-12.bdf | cat - bdf/t0-11.bdf | $(BDFMANGLE) - VARIANTS.dat mgl/unicode.mgl > $@