From b03feaf837b6dbf6fc4960b742bc5a77b2c7105a Mon Sep 17 00:00:00 2001 From: natto1784 Date: Fri, 20 Aug 2021 08:41:25 +0530 Subject: [PATCH] premid: init at 2.3.2 --- pkgs/applications/misc/premid/default.nix | 92 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 94 insertions(+) create mode 100644 pkgs/applications/misc/premid/default.nix diff --git a/pkgs/applications/misc/premid/default.nix b/pkgs/applications/misc/premid/default.nix new file mode 100644 index 000000000000..98ac0de32680 --- /dev/null +++ b/pkgs/applications/misc/premid/default.nix @@ -0,0 +1,92 @@ +{ autoPatchelfHook, makeDesktopItem, lib, stdenv, wrapGAppsHook, fetchurl, copyDesktopItems +, alsa-lib, at-spi2-atk, at-spi2-core, atk, cairo, cups, dbus, expat, fontconfig +, freetype, gdk-pixbuf, glib, gtk3, libcxx, libdrm, libnotify, libpulseaudio, libuuid +, libX11, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext +, libXfixes, libXi, libXrandr, libXrender, libXtst, libxcb, libxshmfence +, mesa, nspr, nss, pango, systemd, libappindicator-gtk3, libdbusmenu +}: + +stdenv.mkDerivation rec { + pname = "premid"; + version = "2.3.2"; + + src = fetchurl { + url = "https://github.com/premid/Linux/releases/download/v${version}/${pname}.tar.gz"; + sha256 = "sha256-TuID63cVZkQ2kBl2iZeuVvjRUJYBt62ppPvgffBlOXY="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + wrapGAppsHook + copyDesktopItems + ]; + + buildInputs = [ + alsa-lib + cups + libdrm + libuuid + libXdamage + libX11 + libXScrnSaver + libXtst + libxcb + libxshmfence + mesa + nss + ]; + + dontWrapGApps = true; + dontBuild = true; + dontConfigure = true; + + libPath = lib.makeLibraryPath [ + libcxx systemd libpulseaudio libdrm mesa + stdenv.cc.cc alsa-lib atk at-spi2-atk at-spi2-core cairo cups dbus expat fontconfig freetype + gdk-pixbuf glib gtk3 libnotify libX11 libXcomposite libuuid + libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender + libXtst nspr nss libxcb pango systemd libXScrnSaver + libappindicator-gtk3 libdbusmenu + ]; + + installPhase = '' + mkdir -p $out/{bin,opt/PreMiD,share/pixmaps} + mv * $out/opt/PreMiD + + chmod +x $out/opt/PreMiD/${pname} + patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \ + $out/opt/PreMiD/${pname} + + wrapProgram $out/opt/PreMiD/${pname} \ + "''${gappsWrapperArgs[@]}" \ + --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \ + --prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${pname} + + ln -s $out/opt/PreMiD/${pname} $out/bin/ + ''; + + # This is the icon used by the desktop file + postInstall = '' + ln -s $out/opt/PreMiD/assets/appIcon.png $out/share/pixmaps/${pname}.png + ''; + + desktopItems = [ + (makeDesktopItem { + name = pname; + exec = "PreMiD"; + icon = pname; + desktopName = "PreMiD"; + genericName = meta.description; + mimeType = "x-scheme-handler/premid"; + }) + ]; + + meta = with lib; { + description = "A simple, configurable utility to show your web activity as playing status on Discord"; + homepage = "https://premid.app"; + downloadPage = "https://premid.app/downloads"; + license = licenses.mpl20; + maintainers = with maintainers; [ natto1784 ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6b48b32f58e0..6d51caec5927 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26712,6 +26712,8 @@ in qiv = callPackage ../applications/graphics/qiv { }; + premid = callPackage ../applications/misc/premid { }; + processing = callPackage ../applications/graphics/processing { jdk = oraclejdk8; };