summary refs log tree commit diff
path: root/pkgs/build-support/mono-dll-fixer/dll-fixer.pl
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2005-03-03 17:19:58 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2005-03-03 17:19:58 +0000
commit9efa069a65ec128ade802613d10d80a42a178390 (patch)
treec730019a2b58cd5521c87221ed2f4a7e386b36d9 /pkgs/build-support/mono-dll-fixer/dll-fixer.pl
parente348ecff744236ad504607da0da5699f4bb60e92 (diff)
downloadnixlib-9efa069a65ec128ade802613d10d80a42a178390.tar
nixlib-9efa069a65ec128ade802613d10d80a42a178390.tar.gz
nixlib-9efa069a65ec128ade802613d10d80a42a178390.tar.bz2
nixlib-9efa069a65ec128ade802613d10d80a42a178390.tar.lz
nixlib-9efa069a65ec128ade802613d10d80a42a178390.tar.xz
nixlib-9efa069a65ec128ade802613d10d80a42a178390.tar.zst
nixlib-9efa069a65ec128ade802613d10d80a42a178390.zip
* Added a tool `mono-dll-fixer' to absolutise the DLL maps in the
  `*.dll.config' files corresponding to CLR assemblies.  I.e., the
  full path to native libraries is included in the maps.  In effect
  this allows us to set the equivalent of an RPATH for assemblies.

* gtk-sharp: use the DLL fixer.  It's not perfect yet: I still have to
  set the LD_LIBRARY_PATH for monodoc to include the gtk-sharp lib
  directory itself, so that it can find the `*sharpglue.so' files.
  This seems to be gtk-sharp's fault; it doesn't have an entry for
  those libraries in its DLL maps.

svn path=/nixpkgs/trunk/; revision=2330
Diffstat (limited to 'pkgs/build-support/mono-dll-fixer/dll-fixer.pl')
-rw-r--r--pkgs/build-support/mono-dll-fixer/dll-fixer.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/build-support/mono-dll-fixer/dll-fixer.pl b/pkgs/build-support/mono-dll-fixer/dll-fixer.pl
new file mode 100644
index 000000000000..4a8b468692f0
--- /dev/null
+++ b/pkgs/build-support/mono-dll-fixer/dll-fixer.pl
@@ -0,0 +1,32 @@
+#! @perl@ -w
+
+use strict;
+
+my @paths = split ' ', $ENV{"ALL_INPUTS"};
+
+open IN, "<$ARGV[0]" or die;
+open OUT, ">$ARGV[0].tmp" or die;
+
+while (<IN>) {
+    # !!! should use a real XML library here.
+    if (!/<dllmap dll="(.*)" target="(.*)"\/>/) {
+        print OUT;
+        next;
+    }
+    my $dll = $1;
+    my $target = $2;
+
+    foreach my $path (@paths) {
+        my $fullPath = "$path/lib/$target";
+        if (-e "$fullPath") {
+            $target = $fullPath;
+            last;
+        }
+    }
+
+    print OUT "  <dllmap dll=\"$dll\" target=\"$target\"/>\n";
+}
+
+close IN;
+
+rename "$ARGV[0].tmp", "$ARGV[0]" or die "cannot rename $ARGV[0]";