nixpkgs/pkgs/applications/graphics/avocode/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

107 lines
2.6 KiB
Nix
Raw Normal View History

{ lib, stdenv, makeDesktopItem, fetchurl, unzip
, gdk-pixbuf, glib, gtk3, atk, at-spi2-atk, pango, cairo, freetype, fontconfig, dbus, nss, nspr, alsa-lib, cups, expat, udev, gnome
2021-05-21 06:02:54 +00:00
, xorg, mozjpeg, makeWrapper, wrapGAppsHook, libuuid, at-spi2-core, libdrm, mesa, libxkbcommon
2018-05-13 14:02:51 +00:00
}:
stdenv.mkDerivation rec {
pname = "avocode";
2022-03-05 12:30:28 +00:00
version = "4.15.6";
2018-05-13 14:02:51 +00:00
src = fetchurl {
url = "https://media.avocode.com/download/avocode-app/${version}/avocode-${version}-linux.zip";
2022-03-05 12:30:28 +00:00
sha256 = "sha256-vNQT4jyMIIAk1pV3Hrp40nawFutWCv7xtwg2gU6ejy0=";
2018-05-13 14:02:51 +00:00
};
2021-01-15 13:21:58 +00:00
libPath = lib.makeLibraryPath (with xorg; [
2018-05-13 14:02:51 +00:00
stdenv.cc.cc.lib
at-spi2-core.out
2019-05-22 11:03:39 +00:00
gdk-pixbuf
2018-05-13 14:02:51 +00:00
glib
2018-10-27 08:06:41 +00:00
gtk3
2018-05-13 14:02:51 +00:00
atk
2018-10-27 08:06:41 +00:00
at-spi2-atk
2018-05-13 14:02:51 +00:00
pango
cairo
freetype
fontconfig
dbus
nss
nspr
alsa-lib
2018-05-13 14:02:51 +00:00
cups
expat
udev
libX11
libxcb
2021-05-21 06:02:54 +00:00
libxshmfence
libxkbcommon
2018-05-13 14:02:51 +00:00
libXi
libXcursor
libXdamage
libXrandr
libXcomposite
libXext
libXfixes
libXrender
libXtst
libXScrnSaver
2019-03-14 19:52:28 +00:00
libuuid
2021-01-20 15:12:02 +00:00
libdrm
mesa
2018-05-13 14:02:51 +00:00
]);
desktopItem = makeDesktopItem {
name = "Avocode";
exec = "avocode";
icon = "avocode";
desktopName = "Avocode";
genericName = "Design Inspector";
categories = [ "Development" ];
2018-05-13 14:02:51 +00:00
comment = "The bridge between designers and developers";
};
nativeBuildInputs = [makeWrapper wrapGAppsHook unzip];
buildInputs = [ gtk3 gnome.adwaita-icon-theme ];
2018-05-13 14:02:51 +00:00
# src is producing multiple folder on unzip so we must
# override unpackCmd to extract it into newly created folder
unpackCmd = ''
mkdir out
unzip $curSrc -d out
'';
installPhase = ''
substituteInPlace avocode.desktop.in \
--replace /path/to/avocode-dir/Avocode $out/bin/avocode \
--replace /path/to/avocode-dir/avocode.png avocode
mkdir -p share/applications share/pixmaps
mv avocode.desktop.in share/applications/avocode.desktop
mv avocode.png share/pixmaps/
rm resources/cjpeg
cp -av . $out
mkdir $out/bin
ln -s $out/avocode $out/bin/avocode
ln -s ${mozjpeg}/bin/cjpeg $out/resources/cjpeg
'';
postFixup = ''
2018-05-16 21:43:59 +00:00
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/avocode
2018-05-13 14:02:51 +00:00
for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do
2019-03-14 19:52:28 +00:00
patchelf --set-rpath ${libPath}:$out/ $file || true
2018-10-27 08:06:41 +00:00
done
2018-05-13 14:02:51 +00:00
'';
enableParallelBuilding = true;
meta = with lib; {
2020-03-04 17:19:28 +00:00
homepage = "https://avocode.com/";
2018-05-13 14:02:51 +00:00
description = "The bridge between designers and developers";
license = licenses.unfree;
platforms = platforms.linux;
maintainers = with maintainers; [ megheaiulian ];
};
}