2022-02-28 14:27:59 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, unzip
|
|
|
|
, udev
|
|
|
|
, nwjs
|
|
|
|
, gcc-unwrapped
|
|
|
|
, autoPatchelfHook
|
|
|
|
, gsettings-desktop-schemas
|
|
|
|
, gtk3
|
2022-03-24 19:10:34 +01:00
|
|
|
, makeWrapper
|
2022-02-28 14:27:59 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pinegrow";
|
2022-03-24 19:10:34 +01:00
|
|
|
version = "6.5";
|
2022-02-28 14:27:59 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://download.pinegrow.com/PinegrowLinux64.${version}.zip";
|
2022-03-24 19:10:34 +01:00
|
|
|
sha256 = "1l7cf5jgidpykaf68mzf92kywl1vxwl3fg43ibgr2rg4cnl1g82b";
|
2022-02-28 14:27:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
unzip
|
|
|
|
autoPatchelfHook
|
2022-03-24 19:10:34 +01:00
|
|
|
makeWrapper
|
2022-02-28 14:27:59 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
udev
|
|
|
|
nwjs
|
|
|
|
gcc-unwrapped
|
|
|
|
gsettings-desktop-schemas
|
|
|
|
gtk3
|
|
|
|
];
|
|
|
|
|
2022-03-24 19:10:34 +01:00
|
|
|
wrapProgramFlags = [
|
|
|
|
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gcc-unwrapped.lib gtk3 udev ]}"
|
|
|
|
"--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}"
|
|
|
|
];
|
|
|
|
|
2022-02-28 14:27:59 +01:00
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
# Extract and copy executable in $out/bin
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/share/applications $out/bin $out/opt/bin
|
|
|
|
# we can't unzip it in $out/lib, because nw.js will start with
|
|
|
|
# an empty screen. Therefore it will be unzipped in a non-typical
|
|
|
|
# folder and symlinked.
|
|
|
|
unzip $src -d $out/opt/pinegrow
|
|
|
|
substituteInPlace $out/opt/pinegrow/Pinegrow.desktop \
|
|
|
|
--replace 'Exec=sh -c "$(dirname %k)/PinegrowLibrary"' 'Exec=sh -c "$out/bin/Pinegrow"'
|
|
|
|
mv $out/opt/pinegrow/Pinegrow.desktop $out/share/applications/Pinegrow.desktop
|
|
|
|
ln -s $out/opt/pinegrow/PinegrowLibrary $out/bin/Pinegrow
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS
|
2022-03-24 19:10:34 +01:00
|
|
|
wrapProgram "$out/opt/pinegrow/PinegrowLibrary" ''${wrapProgramFlags[@]}
|
2022-02-28 14:27:59 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://pinegrow.com";
|
|
|
|
description = "UI Web Editor";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = with licenses; [ unfreeRedistributable ];
|
|
|
|
maintainers = with maintainers; [ gador ];
|
|
|
|
};
|
|
|
|
}
|