diff options
author | Ingolf Wagner <contact@ingolf-wagner.de> | 2018-06-18 02:16:52 +0200 |
---|---|---|
committer | Ingolf Wagner <contact@ingolf-wagner.de> | 2018-06-18 18:00:42 +0200 |
commit | a669574a908561737eeac2ba7eb05c505bc02a79 (patch) | |
tree | c3138d4f751b14cb8ff2722794cd0458f8618c16 /pkgs/applications/networking/ssb | |
parent | bf6974648ecb0ef7d81eed2a38766ba008996abb (diff) |
patchwork-classic : init at 2.12.0
Diffstat (limited to 'pkgs/applications/networking/ssb')
-rw-r--r-- | pkgs/applications/networking/ssb/patchwork-classic/default.nix | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/pkgs/applications/networking/ssb/patchwork-classic/default.nix b/pkgs/applications/networking/ssb/patchwork-classic/default.nix new file mode 100644 index 0000000000000..361aac4f122c5 --- /dev/null +++ b/pkgs/applications/networking/ssb/patchwork-classic/default.nix @@ -0,0 +1,106 @@ +{ stdenv, fetchurl, lib, makeWrapper, + # build dependencies + alsaLib, atk, cairo, cups, dbus, expat, fontconfig, + freetype, gdk_pixbuf, glib, gnome2, nspr, nss, xorg, + glibc, systemd +}: + +stdenv.mkDerivation rec { + + version = "2.12.0"; + + name = "patchwork-clasic-${version}"; + + src = fetchurl { + url = "https://github.com/ssbc/patchwork-classic-electron/releases/download/v2.12.0/ssb-patchwork-electron_2.12.0_linux-amd64.deb"; + sha256 = "1rvp07cgqwv7ac319p0qwpfxd7l8f53m1rlvvig7qf7q23fnmbsj"; + }; + + sourceRoot = "."; + + unpackCmd = '' + ar p "$src" data.tar.xz | tar xJ + ''; + + dontBuild = true; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -p $out/bin + cp -R usr/share opt $out/ + + # fix the path in the desktop file + substituteInPlace \ + $out/share/applications/ssb-patchwork-electron.desktop \ + --replace /opt/ $out/opt/ + + # symlink the binary to bin/ + ln -s $out/opt/ssb-patchwork-electron/ssb-patchwork-electron $out/bin/patchwork-classic + ''; + + + preFixup = let + packages = [ + alsaLib + atk + cairo + cups + dbus + expat + fontconfig + freetype + gdk_pixbuf + glib + gnome2.GConf + gnome2.gtk + gnome2.pango + nspr + nss + xorg.libX11 + xorg.libXScrnSaver + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXtst + stdenv.cc.cc.lib + stdenv.cc.cc + glibc + ]; + libPathNative = lib.makeLibraryPath packages; + libPath64 = lib.makeSearchPathOutput "lib" "lib64" packages; + libPath = "${libPathNative}:${libPath64}"; + in '' + # patch executable + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${libPath}:$out/opt/ssb-patchwork-electron" \ + $out/opt/ssb-patchwork-electron/ssb-patchwork-electron + + # patch libnode + patchelf \ + --set-rpath "${libPath}" \ + $out/opt/ssb-patchwork-electron/libnode.so + + # libffmpeg is for some reason not executable + chmod a+x $out/opt/ssb-patchwork-electron/libffmpeg.so + + # fix missing libudev + ln -s ${systemd.lib}/lib/libudev.so.1 $out/opt/ssb-patchwork-electron/libudev.so.1 + wrapProgram $out/opt/ssb-patchwork-electron/ssb-patchwork-electron \ + --prefix LD_LIBRARY_PATH : $out/opt/ssb-patchwork-electron + ''; + + meta = with stdenv.lib; { + description = "Electron wrapper for Patchwork Classic: run as a desktop app outside the browser"; + homepage = "https://github.com/ssbc/patchwork-classic-electron"; + license = licenses.gpl3; + maintainers = with maintainers; [ mrVanDalo ]; + platforms = platforms.linux; + }; +} |