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