2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libX11, libXext, makeWrapper, ncurses, cmake }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-10-07 09:15:18 +00:00
|
|
|
# The Self wrapper stores source in $XDG_DATA_HOME/self or ~/.local/share/self
|
2020-04-24 23:36:52 +00:00
|
|
|
# so that it can be written to when using the Self transposer. Running 'Self'
|
|
|
|
# after installation runs without an image. You can then build a Self image with:
|
|
|
|
# $ cd ~/.local/share/self/objects
|
2020-10-07 09:15:18 +00:00
|
|
|
# $ Self
|
2020-04-24 23:36:52 +00:00
|
|
|
# > 'worldBuilder.self' _RunScript
|
|
|
|
#
|
|
|
|
# This image can later be started with:
|
|
|
|
# $ Self -s myimage.snap
|
|
|
|
#
|
|
|
|
pname = "self";
|
2021-01-05 17:05:55 +00:00
|
|
|
version = "2017.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "russellallen";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "C/1Q6yFmoXx2F97xuvkm8DxFmmvuBS7uYZOxq/CRNog=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper ];
|
|
|
|
buildInputs = [ ncurses libX11 libXext ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
selfWrapper = ./self;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"/bin
|
|
|
|
cp ./vm/Self "$out"/bin/Self.wrapped
|
|
|
|
mkdir -p "$out"/share/self
|
|
|
|
cp -r ../objects "$out"/share/self/
|
|
|
|
makeWrapper $selfWrapper $out/bin/Self \
|
|
|
|
--set SELF_ROOT "$out"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A prototype-based dynamic object-oriented programming language, environment, and virtual machine";
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://selflanguage.org/";
|
2021-01-05 17:05:55 +00:00
|
|
|
license = licenses.bsd3;
|
2023-02-02 18:25:31 +00:00
|
|
|
maintainers = [ ];
|
2021-01-05 17:05:55 +00:00
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|