summary refs log tree commit diff
path: root/pkgs/build-support/mono-dll-fixer
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
parente348ecff744236ad504607da0da5699f4bb60e92 (diff)
downloadnixpkgs-9efa069a65ec128ade802613d10d80a42a178390.tar
nixpkgs-9efa069a65ec128ade802613d10d80a42a178390.tar.gz
nixpkgs-9efa069a65ec128ade802613d10d80a42a178390.tar.bz2
nixpkgs-9efa069a65ec128ade802613d10d80a42a178390.tar.lz
nixpkgs-9efa069a65ec128ade802613d10d80a42a178390.tar.xz
nixpkgs-9efa069a65ec128ade802613d10d80a42a178390.tar.zst
nixpkgs-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')
-rw-r--r--pkgs/build-support/mono-dll-fixer/builder.sh5
-rw-r--r--pkgs/build-support/mono-dll-fixer/default.nix9
-rw-r--r--pkgs/build-support/mono-dll-fixer/dll-fixer.pl32
3 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/build-support/mono-dll-fixer/builder.sh b/pkgs/build-support/mono-dll-fixer/builder.sh
new file mode 100644
index 00000000000..277a108ee7d
--- /dev/null
+++ b/pkgs/build-support/mono-dll-fixer/builder.sh
@@ -0,0 +1,5 @@
+. $stdenv/setup
+. $substituter
+
+substitute $dllFixer $out --subst-var-by perl $perl/bin/perl
+chmod +x $out
diff --git a/pkgs/build-support/mono-dll-fixer/default.nix b/pkgs/build-support/mono-dll-fixer/default.nix
new file mode 100644
index 00000000000..d1d856235da
--- /dev/null
+++ b/pkgs/build-support/mono-dll-fixer/default.nix
@@ -0,0 +1,9 @@
+{stdenv, perl}:
+
+stdenv.mkDerivation {
+  name = "mono-dll-fixer";
+  builder = ./builder.sh;
+  substituter = ../substitute/substitute.sh;
+  dllFixer = ./dll-fixer.pl;
+  inherit perl;
+}
\ No newline at end of file
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 00000000000..4a8b468692f
--- /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]";