2021-02-19 19:06:45 +00:00
|
|
|
{ lib, stdenv, fetchurl, dpkg, wrapGAppsHook, autoPatchelfHook
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib, atk, at-spi2-atk, at-spi2-core, cairo, cups, dbus, expat, fontconfig, freetype
|
2021-08-18 13:19:15 +00:00
|
|
|
, gdk-pixbuf, glib, gtk3, libcxx, libdrm, libnotify, libpulseaudio, libuuid, libX11, libxcb
|
|
|
|
, libXcomposite, libXcursor, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender
|
2022-04-15 01:41:22 +00:00
|
|
|
, libXScrnSaver, libXtst, mesa, nspr, nss, openssl, pango, systemd }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "upwork";
|
2022-04-15 01:41:22 +00:00
|
|
|
version = "5.6.10.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-04-15 01:41:22 +00:00
|
|
|
url = "https://upwork-usw2-desktopapp.upwork.com/binaries/v5_6_10_7_f806fd1250954801/${pname}_${version}_amd64.deb";
|
|
|
|
sha256 = "6fe11cd53ffb66a02aa771153c4f58af34fea25847ee5bc13802fec9b0db0280";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
nativeBuildInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
dpkg
|
|
|
|
wrapGAppsHook
|
|
|
|
autoPatchelfHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libcxx systemd libpulseaudio
|
2021-08-18 13:19:15 +00:00
|
|
|
stdenv.cc.cc alsa-lib atk at-spi2-atk at-spi2-core cairo cups
|
|
|
|
dbus expat fontconfig freetype gdk-pixbuf glib gtk3 libdrm libnotify
|
|
|
|
libuuid libX11 libxcb libXcomposite libXcursor libXdamage libXext libXfixes
|
|
|
|
libXi libXrandr libXrender libXScrnSaver libXtst mesa nspr nss pango systemd
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
libPath = lib.makeLibraryPath buildInputs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
dontWrapGApps = true;
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
unpackPhase = ''
|
|
|
|
dpkg-deb -x ${src} ./
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-02-19 19:06:45 +00:00
|
|
|
runHook preInstall
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mv usr $out
|
|
|
|
mv opt $out
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
# Now it requires lib{ssl,crypto}.so.1.0.0. Fix based on Spotify pkg.
|
|
|
|
# https://github.com/NixOS/nixpkgs/blob/efea022d6fe0da84aa6613d4ddeafb80de713457/pkgs/applications/audio/spotify/default.nix#L129
|
|
|
|
mkdir -p $out/lib/upwork
|
|
|
|
ln -s ${lib.getLib openssl}/lib/libssl.so $out/lib/upwork/libssl.so.1.0.0
|
|
|
|
ln -s ${lib.getLib openssl}/lib/libcrypto.so $out/lib/upwork/libcrypto.so.1.0.0
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -e "s|/opt/Upwork|$out/bin|g" -i $out/share/applications/upwork.desktop
|
|
|
|
makeWrapper $out/opt/Upwork/upwork \
|
|
|
|
$out/bin/upwork \
|
|
|
|
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${libPath}
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Online freelancing platform desktop application for time tracking";
|
|
|
|
homepage = "https://www.upwork.com/ab/downloads/";
|
|
|
|
license = licenses.unfree;
|
2020-10-16 20:44:37 +00:00
|
|
|
maintainers = with maintainers; [ zakkor wolfangaukang ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-10-16 20:44:37 +00:00
|
|
|
}
|