Skip to content

Instantly share code, notes, and snippets.

@cdepillabout
Created April 13, 2019 03:25
Show Gist options
  • Save cdepillabout/3d8cf8f36682e8e483de4c1a496d2be1 to your computer and use it in GitHub Desktop.
Save cdepillabout/3d8cf8f36682e8e483de4c1a496d2be1 to your computer and use it in GitHub Desktop.
nix file for stretchly
with (import ~/git/nixpkgs {});
let
libs = [
alsaLib
at-spi2-atk
atk
cairo
cups
dbus
expat
fontconfig
gdk_pixbuf
glib
gnome2.GConf
gtk2
gtk3
libappindicator
libdrm
libnotify
libpng12
pango
pciutils
pulseaudio
nspr
nss
stdenv.cc.cc.lib
udev
xorg.libpciaccess
xorg.libX11
xorg.libxcb
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXScrnSaver
xorg.libXtst
];
libPath = lib.makeLibraryPath libs;
in
stdenv.mkDerivation {
pname = "stretchly";
version = "0.19.1";
src = ./.;
nativeBuildInputs = [
wrapGAppsHook
];
buildInputs = libs;
dontPatchELF = true;
dontBuild = true;
dontConfigure = true;
installPhase = ''
mkdir -p $out/bin $out/lib/stretchly
cp -r ./* $out/lib/stretchly/
ln -s $out/lib/stretchly/libffmpeg.so $out/lib/
ln -s $out/lib/stretchly/libnode.so $out/lib/
ln -s $out/lib/stretchly/stretchly $out/bin/
'';
preFixup = ''
patchelf --set-rpath "${libPath}" $out/lib/stretchly/libffmpeg.so
patchelf --set-rpath "${libPath}" $out/lib/stretchly/libnode.so
patchelf \
--set-rpath "$out/lib/stretchly:${libPath}" \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$out/lib/stretchly/stretchly
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment