#!/usr/bin/make -f

PKGS = flutter flutter-web-plugins flutter-localizations flutter-test \
       flutter-goldens fuchsia-remote-debug-protocol

%:
	dh $@

# The source tree's directory mtimes are checkout times, not release times.
override_dh_install:
	dh_install
	find $(addprefix debian/,$(PKGS)) -type d -exec touch -d "@$${SOURCE_DATE_EPOCH}" {} +
# "resolution: workspace" only makes sense inside the upstream monorepo.
	sed -i '/^resolution: workspace$$/d' \
		debian/flutter/usr/share/dart/packages/flutter/pubspec.yaml \
		debian/flutter-web-plugins/usr/share/dart/packages/flutter_web_plugins/pubspec.yaml \
		debian/flutter-localizations/usr/share/dart/packages/flutter_localizations/pubspec.yaml \
		debian/flutter-test/usr/share/dart/packages/flutter_test/pubspec.yaml \
		debian/flutter-goldens/usr/share/dart/packages/flutter_goldens/pubspec.yaml \
		debian/fuchsia-remote-debug-protocol/usr/share/dart/packages/fuchsia_remote_debug_protocol/pubspec.yaml
