2017-04-17 18:00:23 +01:00
|
|
|
{ stdenv, fetchurl, bash, pharo, unzip, makeDesktopItem }:
|
2014-09-02 17:34:53 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-04-17 18:00:23 +01:00
|
|
|
version = "2017.02.28";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "pharo-launcher";
|
2014-09-02 17:34:53 +01:00
|
|
|
src = fetchurl {
|
2017-04-17 18:00:23 +01:00
|
|
|
url = "http://files.pharo.org/platform/launcher/PharoLauncher-user-stable-${version}.zip";
|
|
|
|
sha256 = "1hfwjyx0c47s6ivc1zr2sf5mk1xw2zspsv0ns8mj3kcaglzqwiq0";
|
2014-09-02 17:34:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
executable-name = "pharo-launcher";
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "Pharo";
|
2019-09-09 00:38:31 +01:00
|
|
|
exec = executable-name;
|
2014-09-02 17:34:53 +01:00
|
|
|
icon = "pharo";
|
|
|
|
comment = "Launcher for Pharo distributions";
|
|
|
|
desktopName = "Pharo";
|
|
|
|
genericName = "Pharo";
|
|
|
|
categories = "Development;";
|
|
|
|
};
|
|
|
|
|
|
|
|
# because upstream tarball has no top-level directory.
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
2017-04-17 18:00:23 +01:00
|
|
|
buildInputs = [ bash pharo unzip ];
|
2014-09-02 17:34:53 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $prefix/share/pharo-launcher
|
|
|
|
mkdir -p $prefix/bin
|
|
|
|
|
|
|
|
mv PharoLauncher.image $prefix/share/pharo-launcher/pharo-launcher.image
|
|
|
|
mv PharoLauncher.changes $prefix/share/pharo-launcher/pharo-launcher.changes
|
|
|
|
|
|
|
|
mkdir -p $prefix/share/applications
|
|
|
|
cp "${desktopItem}/share/applications/"* $out/share/applications
|
|
|
|
|
|
|
|
cat > $prefix/bin/${executable-name} <<EOF
|
|
|
|
#!${bash}/bin/bash
|
2017-06-29 19:09:06 +01:00
|
|
|
exec "${pharo}/bin/pharo" $prefix/share/pharo-launcher/pharo-launcher.image
|
2014-09-02 17:34:53 +01:00
|
|
|
EOF
|
|
|
|
chmod +x $prefix/bin/${executable-name}
|
|
|
|
'';
|
|
|
|
|
2017-04-03 15:26:33 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
# Launcher should be able to run for a few seconds without crashing.
|
|
|
|
(set +e
|
|
|
|
export HOME=. # Pharo will try to create files here
|
|
|
|
secs=5
|
|
|
|
echo -n "Running headless Pharo for $secs seconds to check for a crash... "
|
|
|
|
timeout $secs \
|
2017-09-15 17:42:39 +01:00
|
|
|
"${pharo}/bin/pharo" --nodisplay PharoLauncher.image --no-quit eval 'true'
|
2017-04-03 15:26:33 +01:00
|
|
|
test "$?" == 124 && echo "ok")
|
|
|
|
'';
|
|
|
|
|
2014-09-02 17:34:53 +01:00
|
|
|
meta = {
|
|
|
|
description = "Launcher for Pharo distributions";
|
|
|
|
longDescription = ''
|
|
|
|
|
|
|
|
Pharo's goal is to deliver a clean, innovative, free open-source
|
|
|
|
Smalltalk-inspired environment. By providing a stable and small
|
|
|
|
core system, excellent dev tools, and maintained releases, Pharo
|
|
|
|
is an attractive platform to build and deploy mission critical
|
|
|
|
applications.
|
|
|
|
|
|
|
|
The Pharo Launcher is a cross-platform application that
|
|
|
|
- lets you manage your Pharo images (launch, rename, copy and delete);
|
|
|
|
- lets you download image templates (i.e., zip archives) from many
|
|
|
|
different sources (e.g., Jenkins, files.pharo.org);
|
|
|
|
- lets you create new images from any template.
|
|
|
|
|
|
|
|
The idea behind the Pharo Launcher is that you should be able to
|
|
|
|
access it very rapidly from your OS application launcher. As a
|
|
|
|
result, launching any image is never more than 3 clicks away.
|
|
|
|
'';
|
|
|
|
homepage = http://pharo.org;
|
|
|
|
license = stdenv.lib.licenses.mit;
|
2017-04-17 18:00:23 +01:00
|
|
|
maintainers = [ ];
|
|
|
|
platforms = pharo.meta.platforms;
|
2014-09-02 17:34:53 +01:00
|
|
|
};
|
2015-02-13 11:48:32 +00:00
|
|
|
}
|