2018-07-21 02:44:44 +02:00
|
|
|
{ stdenv, makeDesktopItem, fetchurl, unzip
|
2018-05-13 16:02:51 +02:00
|
|
|
, gdk_pixbuf, glib, gtk2, atk, pango, cairo, freetype, fontconfig, dbus, nss, nspr, alsaLib, cups, expat, udev, gnome2
|
|
|
|
, xorg, mozjpeg
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "avocode-${version}";
|
2018-07-21 08:45:38 +02:00
|
|
|
version = "3.2.0";
|
2018-05-13 16:02:51 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://media.avocode.com/download/avocode-app/${version}/avocode-${version}-linux.zip";
|
2018-07-21 08:45:38 +02:00
|
|
|
sha256 = "111kcjqm8j2v941m2ly4ahhxalylnsvy5zmclj1f490japz2h1xy";
|
2018-05-13 16:02:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
libPath = stdenv.lib.makeLibraryPath (with xorg; with gnome2; [
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
gdk_pixbuf
|
|
|
|
glib
|
|
|
|
gtk2
|
|
|
|
atk
|
|
|
|
pango
|
|
|
|
cairo
|
|
|
|
freetype
|
|
|
|
fontconfig
|
|
|
|
dbus
|
|
|
|
nss
|
|
|
|
nspr
|
|
|
|
alsaLib
|
|
|
|
cups
|
|
|
|
expat
|
|
|
|
udev
|
|
|
|
GConf
|
|
|
|
libX11
|
|
|
|
libxcb
|
|
|
|
libXi
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXrandr
|
|
|
|
libXcomposite
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libXScrnSaver
|
|
|
|
]);
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "Avocode";
|
|
|
|
exec = "avocode";
|
|
|
|
icon = "avocode";
|
|
|
|
desktopName = "Avocode";
|
|
|
|
genericName = "Design Inspector";
|
|
|
|
categories = "Application;Development;";
|
|
|
|
comment = "The bridge between designers and developers";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ unzip ];
|
|
|
|
|
|
|
|
# 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
|
2018-05-16 23:43:59 +02:00
|
|
|
patchelf --set-rpath ${libPath}:$out/ $file
|
2018-05-13 16:02:51 +02:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://avocode.com/;
|
|
|
|
description = "The bridge between designers and developers";
|
|
|
|
license = licenses.unfree;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ megheaiulian ];
|
|
|
|
};
|
|
|
|
}
|