Patchwork [v2] googlefontdirectory: new package

login
register
mail settings
Submitter Simon Dawson
Date Oct. 11, 2012, 9:28 a.m.
Message ID <1349947685-7261-1-git-send-email-spdawson@gmail.com>
Download mbox | patch
Permalink /patch/190841/
State Accepted
Headers show

Comments

Simon Dawson - Oct. 11, 2012, 9:28 a.m.
From: Simon Dawson <spdawson@gmail.com>

Note that the Google code project does not provide an archive containing
just the font files. This package uses the third party archive provided at

  http://joemaller.com/1856/download-google-fonts/

Further information is available at the following URL.

  http://code.google.com/p/googlefontdirectory/issues/detail?id=2

Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
 v2: Incorporate improvements suggested by Peter Korsgaard

 package/Config.in                                  |    1 +
 package/googlefontdirectory/Config.in              |   13 +++++++++
 package/googlefontdirectory/googlefontdirectory.mk |   28 ++++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 package/googlefontdirectory/Config.in
 create mode 100644 package/googlefontdirectory/googlefontdirectory.mk
Peter Korsgaard - Oct. 11, 2012, 8:25 p.m.
>>>>> "spdawson" == spdawson  <spdawson@gmail.com> writes:

 spdawson> From: Simon Dawson <spdawson@gmail.com>
 spdawson> Note that the Google code project does not provide an archive containing
 spdawson> just the font files. This package uses the third party archive provided at

 spdawson>   http://joemaller.com/1856/download-google-fonts/

 spdawson> Further information is available at the following URL.

 spdawson>   http://code.google.com/p/googlefontdirectory/issues/detail?id=2

Thanks, looks a lot better!

 spdawson> +#############################################################
 spdawson> +#
 spdawson> +# googlefontdirectory
 spdawson> +#
 spdawson> +#############################################################
 spdawson> +GOOGLEFONTDIRECTORY_VERSION = 1.0

I don't like us inventing versions, so I dropped this line
(infrastructure then uses 'undefined' like for makedevs).

 spdawson> +GOOGLEFONTDIRECTORY_SITE = \
 spdawson> +	https://s3.amazonaws.com/joemaller_google_webfonts
 spdawson> +GOOGLEFONTDIRECTORY_SOURCE = googlewebfonts.tgz
 spdawson> +GOOGLEFONTDIRECTORY_LICENSE = OFLv1.1
 spdawson> +
 spdawson> +GOOGLEFONTDIRECTORY_FONTS = \
 spdawson> +	$(call qstrip,$(BR2_PACKAGE_GOOGLEFONTDIRECTORY_FONTS))
 spdawson> +
 spdawson> +define GOOGLEFONTDIRECTORY_INSTALL_TARGET_CMDS
 spdawson> +	for i in $(GOOGLEFONTDIRECTORY_FONTS); \
 spdawson> +	do \
 spdawson> +		$(INSTALL) -d $(TARGET_DIR)/usr/share/fonts/$$i && \
 spdawson> +		$(INSTALL) -m 0644 -t $(TARGET_DIR)/usr/share/fonts/$$i $(@D)/$$i/*.ttf \

You are missing a ';' after ttf

 spdawson> +	done
 spdawson> +endef
 spdawson> +
 spdawson> +define GOOGLEFONTDIRECTORY_UNINSTALL_TARGET_CMDS
 spdawson> +	$(RM) -r \
 spdawson> +	$(foreach i,$(GOOGLEFONTDIRECTORY_FONTS),$(TARGET_DIR)/usr/share/fonts/$(i))

We more commonly use $(addprefix
$(TARGET_DIR)/usr/share/fonts/,$(GOOGLEFONTDIRECTORY_FONTS)) instead of
foreach, so I changed it to use that instead.

Committed with those fixes, thanks.

Patch

diff --git a/package/Config.in b/package/Config.in
index fc6a26a..c56f438 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -519,6 +519,7 @@  endmenu
 menu "Miscellaneous"
 source "package/collectd/Config.in"
 source "package/empty/Config.in"
+source "package/googlefontdirectory/Config.in"
 source "package/mobile-broadband-provider-info/Config.in"
 source "package/shared-mime-info/Config.in"
 source "package/sound-theme-borealis/Config.in"
diff --git a/package/googlefontdirectory/Config.in b/package/googlefontdirectory/Config.in
new file mode 100644
index 0000000..872fe27
--- /dev/null
+++ b/package/googlefontdirectory/Config.in
@@ -0,0 +1,13 @@ 
+config BR2_PACKAGE_GOOGLEFONTDIRECTORY
+	bool "Google font directory"
+	help
+	  Google font directory
+
+	  http://code.google.com/p/googlefontdirectory/
+
+config BR2_PACKAGE_GOOGLEFONTDIRECTORY_FONTS
+	string "List of fonts to install"
+	default "droid"
+	depends on BR2_PACKAGE_GOOGLEFONTDIRECTORY
+	help
+	  Specify a space-separated list of fonts to install
diff --git a/package/googlefontdirectory/googlefontdirectory.mk b/package/googlefontdirectory/googlefontdirectory.mk
new file mode 100644
index 0000000..9377936
--- /dev/null
+++ b/package/googlefontdirectory/googlefontdirectory.mk
@@ -0,0 +1,28 @@ 
+#############################################################
+#
+# googlefontdirectory
+#
+#############################################################
+GOOGLEFONTDIRECTORY_VERSION = 1.0
+GOOGLEFONTDIRECTORY_SITE = \
+	https://s3.amazonaws.com/joemaller_google_webfonts
+GOOGLEFONTDIRECTORY_SOURCE = googlewebfonts.tgz
+GOOGLEFONTDIRECTORY_LICENSE = OFLv1.1
+
+GOOGLEFONTDIRECTORY_FONTS = \
+	$(call qstrip,$(BR2_PACKAGE_GOOGLEFONTDIRECTORY_FONTS))
+
+define GOOGLEFONTDIRECTORY_INSTALL_TARGET_CMDS
+	for i in $(GOOGLEFONTDIRECTORY_FONTS); \
+	do \
+		$(INSTALL) -d $(TARGET_DIR)/usr/share/fonts/$$i && \
+		$(INSTALL) -m 0644 -t $(TARGET_DIR)/usr/share/fonts/$$i $(@D)/$$i/*.ttf \
+	done
+endef
+
+define GOOGLEFONTDIRECTORY_UNINSTALL_TARGET_CMDS
+	$(RM) -r \
+	$(foreach i,$(GOOGLEFONTDIRECTORY_FONTS),$(TARGET_DIR)/usr/share/fonts/$(i))
+endef
+
+$(eval $(generic-package))