spacepaste

  1.  
  2. let
  3. pkgs = import <nixpkgs> {};
  4. in pkgs.stdenv.mkDerivation {
  5. name = "withings";
  6. src = pkgs.fetchurl {
  7. url = "http://fw.withings.net/pairingwizard_Linux_x86_64";
  8. sha256 = "03dx0l8zvakarx70rmb0fdpzw9b6bgdym1s2zh0r0iazs879disp";
  9. };
  10. buildInputs = with pkgs; [ upx patchelf ];
  11. buildCommand = ''
  12. upx -d $src -o pairingwizard
  13. chmod +xw pairingwizard
  14. patchelf \
  15. --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
  16. --set-rpath ${ with pkgs; with pkgs.xorg; stdenv.lib.makeLibraryPath [ zlib libX11 libXext libXrender fontconfig freetype stdenv.cc.cc.lib libXcursor libXrandr libXfixes ] } \
  17. pairingwizard
  18. mkdir -p $out/bin
  19. mv pairingwizard $out/bin/
  20. '';
  21. }
  22.