[Nix-dev] install4j

Marc Weber marco-oweber at gmx.de
Thu Nov 15 17:13:19 CET 2012


Excerpts from Mathijs Kwik's message of Thu Nov 15 16:27:31 +0100 2012:
> Hi all,
> 
> Has anyone come across software that is packed/distributed with install4j?
> Some software I need distributes itself as a .sh file (with a lot of
> binary data appended).
> The file extracts itself to some temp dir and wants to start a bundled JRE.
> This of course fails on nix, as the bundled JRE tries to load the
> wrong runtime loader.

Netbeans and the like almost all just worked .. you may want to to have
a look at those derivations. My older custom code looks like this:
Mabye just gtk is missing and setting LD_LIBRARY_PATH is enough?

Also consider using trying with oracle's jdk and openjdk.
The latter caused some trouble to some applications for different
reasons (allthough I think most should be fixed)

Something like this:

      netbeansRunner = pkgs.stdenv.mkDerivation {
        name = "nix-netbeans-runner-script-${stdenv.system}";

        phases = "installPhase";
        installPhase = ''
          ensureDir $out/bin
          target=$out/bin/nix-run-netbeans-${stdenv.system}
          cat > $target << EOF
          #!/bin/sh
          export PATH=${pkgs.jre}/bin:\$PATH
          export LD_LIBRARY_PATH=${pkgs.gtkLibs.glib}/lib:${pkgs.gtkLibs.gtk}/lib:${pkgs.xlibs.libXtst}/lib:${pkgs.xlibs.libXt}/lib:${pkgs.xlibs.libXi}/lib
          # If you run out of XX space try these? -vmargs -Xms512m -Xmx1024m -showLocation -XX:MaxPermSize=256m
          netbeans="\$1"; shift
          exec \$netbeans "\$@"
          EOF
          chmod +x $target
          '';

        meta = { 
          description = "provide environment to run Eclipse";
          longDescription = ''
            Is there one distribution providing support for up to date Eclipse installations?
            There are various reasons why not.
            Installing binaries just works. Get Eclipse binaries form eclipse.org/downloads
            install this wrapper then run Eclipse like this:
            nix-run-eclipse $PATH_TO_ECLIPSE/eclipse/eclipse
            and be happy. Everything works including update sites.
            '';
          maintainers = [pkgs.lib.maintainers.marcweber];
          platforms = pkgs.lib.platforms.linux;
        };
      };


More information about the nix-dev mailing list