From bb956740199683aa6be7e8f9e899f3327d4cb5b6 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Tue, 13 Jan 2015 16:18:26 +0000 Subject: [PATCH] Refresh dh_monoaot to work from a manifest file, debian/installmonoaot, into $PREFIX/mono/lib/aot-cache/$ARCH Former-commit-id: ededb551d3f504a906f74f62b979a0fabe70bf7e --- debian/dh_monoaot | 56 ++++++++++++--------- debian/libmono-corlib4.5-cil.installmonoaot | 1 + debian/mono-mcs.installmonoaot | 1 + debian/postinst-monoaot | 4 +- debian/prerm-monoaot | 2 +- debian/rules | 2 +- 6 files changed, 40 insertions(+), 26 deletions(-) create mode 100644 debian/libmono-corlib4.5-cil.installmonoaot create mode 100644 debian/mono-mcs.installmonoaot diff --git a/debian/dh_monoaot b/debian/dh_monoaot index 60122baf6f..30fbb1d955 100755 --- a/debian/dh_monoaot +++ b/debian/dh_monoaot @@ -47,31 +47,40 @@ init(); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp = tmpdir($package); - my @files; - - # find binaries - find (sub { - return unless -f and /\.(exe|dll)$/; - return unless $File::Find::dir =~ m!^$tmp/usr/lib!; - - my $fullfilename = $File::Find::name; - - my $filename = $fullfilename; - $filename =~ s/^$tmp//; - - verbose_print("fullfilename: $fullfilename"); - verbose_print("filename: $filename"); - push(@files, $filename); - }, $tmp); - - if (! $dh{NOSCRIPTS}) { - foreach my $file (@files) { - autoscript($package, "postinst", "postinst-monoaot", - "s!#FILE#!$file!"); - autoscript($package, "prerm", "prerm-monoaot", - "s!#FILE#!$file.so!"); + my $monoaot = pkgfile($package, "installmonoaot"); + + if ($monoaot ne '') { + # sanity check: do all files listed in the installcligac file exist? + open MONOAOT, "<$monoaot" or + die "E: Can't open $monoaot\n"; + while () + { + chomp; + if (! -f "$tmp$_") { + die "E: Can't find file $tmp$_!\n"; + } } + close MONOAOT; + + if (! $dh{NOSCRIPTS}) { + open MONOAOT, "<$monoaot" or + die "E: Can't open $monoaot\n"; + while () + { + chomp; + foreach my $file ($_) { + autoscript($package, "postinst", "postinst-monoaot", + "s!#FILE#!$file!g"); + autoscript($package, "prerm", "prerm-monoaot", + "s!#FILE#!$file.so!"); + } + } + close MONOAOT; + + } + } + } =head1 SEE ALSO @@ -83,5 +92,6 @@ This program is a part of cli-common-dev. =head1 AUTHOR Mirco 'meebey' Bauer +Jo Shields =cut diff --git a/debian/libmono-corlib4.5-cil.installmonoaot b/debian/libmono-corlib4.5-cil.installmonoaot new file mode 100644 index 0000000000..78d6ac169d --- /dev/null +++ b/debian/libmono-corlib4.5-cil.installmonoaot @@ -0,0 +1 @@ +/usr/lib/mono/4.5/mscorlib.dll diff --git a/debian/mono-mcs.installmonoaot b/debian/mono-mcs.installmonoaot new file mode 100644 index 0000000000..faebbbf812 --- /dev/null +++ b/debian/mono-mcs.installmonoaot @@ -0,0 +1 @@ +/usr/lib/mono/4.5/mcs.exe diff --git a/debian/postinst-monoaot b/debian/postinst-monoaot index 0074e62b65..88ac5ad2e1 100644 --- a/debian/postinst-monoaot +++ b/debian/postinst-monoaot @@ -1,4 +1,6 @@ if [ "$1" = "configure" ] then - /usr/bin/mono --aot -O=all,shared #FILE# > /dev/null 2>&1 + MONOARCH=`mono --version | grep Architecture | sed 's/.*: //'` + mkdir -p /usr/lib/mono/aot-cache/${MONOARCH}/ + /usr/bin/mono --aot=outfile=/usr/lib/mono/aot-cache/${MONOARCH}/`basename #FILE#.so` -O=all,shared #FILE# > /dev/null 2>&1 fi diff --git a/debian/prerm-monoaot b/debian/prerm-monoaot index 4f49bd2210..aff8cb2a50 100644 --- a/debian/prerm-monoaot +++ b/debian/prerm-monoaot @@ -1 +1 @@ -rm -f #FILE# +rm -f /usr/lib/mono/aot-cache/`mono --version | grep Architecture | sed 's/.*: //'`/`basename #FILE#` diff --git a/debian/rules b/debian/rules index 0879e4b954..e64fccd79c 100755 --- a/debian/rules +++ b/debian/rules @@ -230,8 +230,8 @@ binary-indep: build-stamp install-stamp dh_fixperms -i debian/dh_clifixperms -i + DH_AUTOSCRIPTDIR=$(CURDIR)/debian debian/dh_monoaot -i dh_installdeb -i - #DH_VERBOSE=1 DH_AUTOSCRIPTDIR=$(CURDIR)/debian debian/dh_monoaot -i debian/dh_makeclilibs -i -m 1.0 $(DH_INTERNAL_MONO_PARAM) debian/dh_makeclilibs -p libmono2.0-cil -m 3.6.0 $(DH_INTERNAL_MONO_PARAM) debian/dh_makeclilibs -p libmono-cairo2.0-cil -m 3.2.1 $(DH_INTERNAL_MONO_PARAM)