Browse Source

add liberation truetype font package and add mkfontscale check, complete the other font checks

Waldemar Brodkorb 7 years ago
parent
commit
38419263f6
3 changed files with 84 additions and 5 deletions
  1. 8 5
      mk/image.mk
  2. 29 0
      package/liberation-fonts-ttf/Makefile
  3. 47 0
      scripts/prereq.sh

+ 8 - 5
mk/image.mk

@@ -61,11 +61,14 @@ image-prepare-post:
 	rng=/dev/arandom; test -e $$rng || rng=/dev/urandom; \
 	    dd if=$$rng bs=512 count=1 >>${TARGET_DIR}/etc/.rnd 2>/dev/null; \
 	    chmod 600 ${TARGET_DIR}/etc/.rnd
-	@-if [ -d ${TARGET_DIR}/usr/share/fonts/X11 ];then \
-		for i in $$(ls ${TARGET_DIR}/usr/share/fonts/X11/);do \
-			mkfontdir ${TARGET_DIR}/usr/share/fonts/X11/$${i}; \
-		done; \
-	fi
+	-for dir in X11 truetype; do \
+		if [ -d ${TARGET_DIR}/usr/share/fonts/$${dir} ];then \
+			for i in $$(ls ${TARGET_DIR}/usr/share/fonts/$${dir}/);do \
+				mkfontdir ${TARGET_DIR}/usr/share/fonts/$${dir}/$${i}; \
+				mkfontscale ${TARGET_DIR}/usr/share/fonts/$${dir}/$${i}; \
+			done; \
+		fi; \
+	done
 	$(SED) '/^root:/s!:/bin/sh$$!:${ROOTSH}!' ${TARGET_DIR}/etc/passwd
 	-rm -f ${TARGET_DIR}/bin/sh
 	ln -sf ${BINSH} ${TARGET_DIR}/bin/sh

+ 29 - 0
package/liberation-fonts-ttf/Makefile

@@ -0,0 +1,29 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+PKG_NAME:=		liberation-fonts-ttf
+PKG_VERSION:=		2.00.1
+PKG_RELEASE:=		1
+PKG_HASH:=		7890278a6cd17873c57d9cd785c2d230d9abdea837e96516019c5885dd271504
+PKG_DESCR:=		free fonts compatible to msttfonts
+PKG_SECTION:=		x11/fonts
+PKG_URL:=		https://fedorahosted.org/liberation-fonts/
+PKG_SITES:=		https://fedorahosted.org/releases/l/i/liberation-fonts/
+
+DISTFILES:=             $(PKG_NAME)-$(PKG_VERSION).tar.gz
+
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBERATION_FONTS_TTF,liberation-fonts-ttf,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
+
+CONFIG_STYLE:=		manual
+BUILD_STYLE:=		manual
+INSTALL_STYLE:=		manual
+
+liberation-fonts-ttf-install:
+	$(INSTALL_DIR) $(IDIR_LIBERATION_FONTS_TTF)/usr/share/fonts/truetype/liberation
+	$(CP) $(WRKSRC)/*.ttf $(IDIR_LIBERATION_FONTS_TTF)/usr/share/fonts/truetype/liberation
+
+include $(ADK_TOPDIR)/mk/pkg-bottom.mk

+ 47 - 0
scripts/prereq.sh

@@ -704,6 +704,30 @@ else
     NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
   fi
 
+  if [ -n "$ADK_PACKAGE_FONT_BH_100DPI" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-bh-100dpi"
+  fi
+
+  if [ -n "$ADK_PACKAGE_FONT_BH_75DPI" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-bh-75dpi"
+  fi
+
+  if [ -n "$ADK_PACKAGE_FONT_BH_TYPE1" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-bh-type1"
+  fi
+
+  if [ -n "$ADK_PACKAGE_FONT_BH_TTF" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-bh-ttf"
+  fi
+
+  if [ -n "$ADK_PACKAGE_FONT_BH_LUCIDATYPEWRITER_100DPI" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-bh-lucidatypewriter-100dpi"
+  fi
+
+  if [ -n "$ADK_PACKAGE_FONT_BH_LUCIDATYPEWRITER_75DPI" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-bh-lucidatypewriter-75dpi"
+  fi
+
   if [ -n "$ADK_PACKAGE_FONT_BITSTREAM_100DPI" ]; then
     NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
   fi
@@ -712,6 +736,10 @@ else
     NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
   fi
 
+  if [ -n "$ADK_PACKAGE_FONT_BITSTREAM_TYPE1" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-type1"
+  fi
+
   if [ -n "$ADK_PACKAGE_FONT_ADOBE_100DPI" ]; then
     NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
   fi
@@ -720,6 +748,18 @@ else
     NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
   fi
 
+  if [ -n "$ADK_PACKAGE_FONT_XFREE86_TYPE1" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-xfree86-type1"
+  fi
+
+  if [ -n "$ADK_PACKAGE_FONT_MISC_MISC" ]; then
+    NEED_MKFONTDIR="$NEED_MKFONTDIR font-misc-misc"
+  fi
+
+  if [ -n "$ADK_PACKAGE_LIBERATION_FONTS_TTF" ]; then
+    NEED_MKFONTSCALE="$NEED_MKFONTSCALE liberation-fonts-ttf"
+  fi
+
   if [ -n "$NEED_MKFONTDIR" ]; then
     if ! which mkfontdir >/dev/null 2>&1; then
       printf "You need mkfontdir to build $NEED_MKFONTDIR \n"
@@ -727,6 +767,13 @@ else
     fi
   fi
 
+  if [ -n "$NEED_MKFONTSCALE" ]; then
+    if ! which mkfontscale >/dev/null 2>&1; then
+      printf "You need mkfontscale to build $NEED_MKFONTSCALE \n"
+      out=1
+    fi
+  fi
+
   if [ -n "$NEED_XKBCOMP" ]; then
     if ! which xkbcomp >/dev/null 2>&1; then
       printf "You need xkbcomp to build $NEED_XKBCOMP \n"