diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2020-02-21 15:59:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-21 15:59:50 +0000 |
commit | bec89d1893033412f55cfc7e953c8bdd0e5a25cf (patch) | |
tree | 03442baa568e58c0b41a3f998add02b4f11472b0 /pkgs/applications/networking/instant-messengers/rambox/default.nix | |
parent | 97d19a167ada76cc31b1dfad410d90ffcc585a2e (diff) | |
parent | f5b761175fb78b47c88985503115e6ac08433d8d (diff) | |
download | nixlib-bec89d1893033412f55cfc7e953c8bdd0e5a25cf.tar nixlib-bec89d1893033412f55cfc7e953c8bdd0e5a25cf.tar.gz nixlib-bec89d1893033412f55cfc7e953c8bdd0e5a25cf.tar.bz2 nixlib-bec89d1893033412f55cfc7e953c8bdd0e5a25cf.tar.lz nixlib-bec89d1893033412f55cfc7e953c8bdd0e5a25cf.tar.xz nixlib-bec89d1893033412f55cfc7e953c8bdd0e5a25cf.tar.zst nixlib-bec89d1893033412f55cfc7e953c8bdd0e5a25cf.zip |
Merge pull request #80370 from gnidorah/rambox
rambox: don't build from sources
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/rambox/default.nix')
-rw-r--r-- | pkgs/applications/networking/instant-messengers/rambox/default.nix | 74 |
1 files changed, 36 insertions, 38 deletions
diff --git a/pkgs/applications/networking/instant-messengers/rambox/default.nix b/pkgs/applications/networking/instant-messengers/rambox/default.nix index f588c31c183d..488da12c18c2 100644 --- a/pkgs/applications/networking/instant-messengers/rambox/default.nix +++ b/pkgs/applications/networking/instant-messengers/rambox/default.nix @@ -1,52 +1,50 @@ -{ stdenv, newScope, makeWrapper -, electron, xdg_utils, makeDesktopItem -, auth0ClientID ? "0spuNKfIGeLAQ_Iki9t3fGxbfJl3k8SU" -, auth0Domain ? "nixpkgs.auth0.com" }: +{ stdenv, fetchurl, xdg_utils, dpkg, makeWrapper, autoPatchelfHook +, libXtst, libXScrnSaver, gtk3, nss, alsaLib, udev, libnotify +}: let - callPackage = newScope self; - self = { - fetchNodeModules = callPackage ./fetchNodeModules.nix {}; - rambox-bare = callPackage ./bare.nix { - inherit auth0ClientID auth0Domain; + version = "0.7.3"; +in stdenv.mkDerivation rec { + pname = "rambox"; + inherit version; + src = { + x86_64-linux = fetchurl { + url = "https://github.com/ramboxapp/community-edition/releases/download/${version}/Rambox-${version}-linux-amd64.deb"; + sha256 = "09v8zlayas906zhqy2aw4wkvyl87ykr09sjf0nmgmf69piwmjgg6"; }; - sencha = callPackage ./sencha {}; - }; - desktopItem = makeDesktopItem rec { - name = "Rambox"; - exec = "rambox"; - icon = "${self.rambox-bare}/resources/Icon.png"; - desktopName = name; - genericName = "Rambox messenger"; - categories = "Network;"; - }; -in - -with self; - -stdenv.mkDerivation { - name = "rambox-${rambox-bare.version}"; - - nativeBuildInputs = [ makeWrapper ]; + i686-linux = fetchurl { + url = "https://github.com/ramboxapp/community-edition/releases/download/${version}/Rambox-${version}-linux-i386.deb"; + sha256 = "0gv4pf3vhrw4xyccm24ivv92d9qy4zpwsh0m82ib1w764lyxmyrz"; + }; + }.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); - dontUnpack = true; + nativeBuildInputs = [ dpkg makeWrapper autoPatchelfHook ]; + buildInputs = [ libXtst libXScrnSaver gtk3 nss alsaLib ]; + runtimeDependencies = [ udev.lib libnotify ]; - dontWrapGApps = true; # we only want $gappsWrapperArgs here + unpackPhase = "dpkg-deb -x $src ."; installPhase = '' - runHook preInstall - mkdir -p $out/share/applications - ln -s ${desktopItem}/share/applications/* $out/share/applications - runHook postInstall + mkdir -p $out/bin + cp -r opt $out + ln -s $out/opt/Rambox/rambox $out/bin + + # provide resources + cp -r usr/share $out + substituteInPlace $out/share/applications/rambox.desktop \ + --replace Exec=/opt/Rambox/rambox Exec=rambox ''; postFixup = '' - makeWrapper ${electron}/bin/electron $out/bin/rambox \ - --add-flags "${rambox-bare} --without-update" \ - --prefix PATH : ${xdg_utils}/bin + wrapProgram $out/opt/Rambox/rambox --prefix PATH : ${xdg_utils}/bin ''; - meta = rambox-bare.meta // { - platforms = [ "i686-linux" "x86_64-linux" ]; + meta = with stdenv.lib; { + description = "Free and Open Source messaging and emailing app that combines common web applications into one"; + homepage = http://rambox.pro; + license = licenses.mit; + maintainers = [ maintainers.gnidorah ]; + platforms = ["i686-linux" "x86_64-linux"]; + hydraPlatforms = []; }; } |