aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/pharo/launcher/default.nix
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
committerMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
commitc4625b175f8200f643fd6e11010932ea44c78433 (patch)
treebce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/development/pharo/launcher/default.nix
parent49f735974dd103039ddc4cb576bb76555164a9e7 (diff)
parentd661aa56a8843e991261510c1bb28fdc2f6975ae (diff)
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7 git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/pharo/launcher/default.nix')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/pharo/launcher/default.nix83
1 files changed, 83 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/pharo/launcher/default.nix b/infra/libkookie/nixpkgs/pkgs/development/pharo/launcher/default.nix
new file mode 100644
index 000000000000..5f6deca863c3
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/pharo/launcher/default.nix
@@ -0,0 +1,83 @@
+{ stdenv, fetchurl, bash, pharo, unzip, makeDesktopItem }:
+
+stdenv.mkDerivation rec {
+ version = "2017.02.28";
+ pname = "pharo-launcher";
+ src = fetchurl {
+ url = "http://files.pharo.org/platform/launcher/PharoLauncher-user-stable-${version}.zip";
+ sha256 = "1hfwjyx0c47s6ivc1zr2sf5mk1xw2zspsv0ns8mj3kcaglzqwiq0";
+ };
+
+ executable-name = "pharo-launcher";
+
+ desktopItem = makeDesktopItem {
+ name = "Pharo";
+ exec = executable-name;
+ icon = "pharo";
+ comment = "Launcher for Pharo distributions";
+ desktopName = "Pharo";
+ genericName = "Pharo";
+ categories = "Development;";
+ };
+
+ # because upstream tarball has no top-level directory.
+ sourceRoot = ".";
+
+ buildInputs = [ bash pharo unzip ];
+
+ 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
+ exec "${pharo}/bin/pharo" $prefix/share/pharo-launcher/pharo-launcher.image
+ EOF
+ chmod +x $prefix/bin/${executable-name}
+ '';
+
+ 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 \
+ "${pharo}/bin/pharo" --nodisplay PharoLauncher.image --no-quit eval 'true'
+ test "$?" == 124 && echo "ok")
+ '';
+
+ 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;
+ maintainers = [ ];
+ platforms = pharo.meta.platforms;
+ };
+}