cleverca22
9/17/2016 - 2:20 PM

nixpatch.nix

{ runCommand, fetchurl, makeFontsConf, makeWrapper
, cairo, coreutils, fontconfig, freefont_ttf
, glib, gmp, gtk2, libffi, libjpeg, libpng
, libtool, mpfr, openssl, pango, poppler
, readline, sqlite
}:

let

  fontsConf = makeFontsConf {
    fontDirectories = [ freefont_ttf ];
  };

  libPath = stdenv.lib.makeLibraryPath [
    cairo
    fontconfig
    glib
    gmp
    gtk2
    libjpeg
    libpng
    mpfr
    openssl
    pango
    poppler
    readline
    sqlite
  ];

in
runCommand "graket" { } ''
  mkdir -p $out/bin
  cp -vi ${./gracket} $out/bin/gracket
   patchelf $out/bin/gracket --set-rpath "${libPath}" --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)";
'';



### Gives:
### these derivations will be built:
###  /nix/store/34nc78kgk5b02iqh4sqpyy22zb28n7h8-patch-gracket.drv
### building path(s) ‘/nix/store/jrmh5fvcjsywijh0lgsvqv8xws0vqzwz-patch-gracket’
### unpacking sources
### variable $src or $srcs should point to the source
### builder for ‘/nix/store/34nc78kgk5b02iqh4sqpyy22zb28n7h8-patch-gracket.drv’ failed with exit code 1
### error: build of ‘/nix/store/34nc78kgk5b02iqh4sqpyy22zb28n7h8-patch-gracket.drv’ failed