#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/GNUstep/debian/config.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-undefined
d_app := $(CURDIR)/debian/textedit.app

%:
	dh $@

override_dh_auto_build:
	dh_auto_build -- $(optim) $(verbose) \
	  $(shell dpkg-buildflags --export=cmdline)

execute_before_dh_link:
	gsdh_gnustep --app
# Extract a .png icon for the .desktop file (GNUstep GUI will load the
# .icns directly).  The file is actually of larger size because there
# are no 48x48 and 64x64 icons, but at least GNOME/MATE will scale and
# display it properly.
	icns2png --extract --size 128 --depth 32 \
	  --output=$(d_app)/usr/share/GNUstep/TextEdit.app \
	  accessories-text-editor.icns
