2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, makeDesktopItem, fetchurl, unzip
|
2020-04-24 23:36:52 +00:00
|
|
|
, gdk-pixbuf, glib, gtk3, atk, at-spi2-atk, pango, cairo, freetype, fontconfig, dbus, nss, nspr, alsaLib, cups, expat, udev, gnome3
|
2021-02-05 17:12:51 +00:00
|
|
|
, xorg, mozjpeg, makeWrapper, wrapGAppsHook, libuuid, at-spi2-core, libdrm, mesa
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "avocode";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "4.12.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://media.avocode.com/download/avocode-app/${version}/avocode-${version}-linux.zip";
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "sha256-qbG0Ii3Xmj1UGGS+n+LdiNPAHBkpQZMGEzrDvOcaUNA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
libPath = lib.makeLibraryPath (with xorg; [
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.cc.cc.lib
|
|
|
|
at-spi2-core.out
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
atk
|
|
|
|
at-spi2-atk
|
|
|
|
pango
|
|
|
|
cairo
|
|
|
|
freetype
|
|
|
|
fontconfig
|
|
|
|
dbus
|
|
|
|
nss
|
|
|
|
nspr
|
|
|
|
alsaLib
|
|
|
|
cups
|
|
|
|
expat
|
|
|
|
udev
|
|
|
|
libX11
|
|
|
|
libxcb
|
|
|
|
libXi
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXrandr
|
|
|
|
libXcomposite
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libXScrnSaver
|
|
|
|
libuuid
|
2021-02-05 17:12:51 +00:00
|
|
|
libdrm
|
|
|
|
mesa
|
2020-04-24 23:36:52 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "Avocode";
|
|
|
|
exec = "avocode";
|
|
|
|
icon = "avocode";
|
|
|
|
desktopName = "Avocode";
|
|
|
|
genericName = "Design Inspector";
|
2020-07-18 16:06:22 +00:00
|
|
|
categories = "Development;";
|
2020-04-24 23:36:52 +00:00
|
|
|
comment = "The bridge between designers and developers";
|
|
|
|
};
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [makeWrapper wrapGAppsHook unzip];
|
|
|
|
buildInputs = [ gtk3 gnome3.adwaita-icon-theme ];
|
2020-04-24 23:36:52 +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 = ''
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/avocode
|
|
|
|
for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do
|
|
|
|
patchelf --set-rpath ${libPath}:$out/ $file || true
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://avocode.com/";
|
|
|
|
description = "The bridge between designers and developers";
|
|
|
|
license = licenses.unfree;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ megheaiulian ];
|
|
|
|
};
|
|
|
|
}
|