2018-09-26 17:46:58 +01:00
|
|
|
{ stdenv, fetchurl, jre, makeWrapper, makeDesktopItem }:
|
2015-05-09 00:23:30 +01:00
|
|
|
|
2018-09-26 17:46:58 +01:00
|
|
|
let generic = { major, version, src }:
|
2015-05-09 00:23:30 +01:00
|
|
|
|
2018-09-26 17:46:58 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "${nameMajor}-${version}";
|
|
|
|
nameMajor = "alloy${major}";
|
2015-05-09 00:23:30 +01:00
|
|
|
|
2018-09-26 17:46:58 +01:00
|
|
|
desktopItem = makeDesktopItem rec {
|
2019-09-09 00:38:31 +01:00
|
|
|
name = nameMajor;
|
2018-09-26 17:46:58 +01:00
|
|
|
exec = name;
|
|
|
|
icon = name;
|
|
|
|
desktopName = "Alloy ${major}";
|
|
|
|
genericName = "Relational modelling tool";
|
|
|
|
comment = meta.description;
|
|
|
|
categories = "Development;IDE;Education;";
|
|
|
|
};
|
2015-05-09 00:23:30 +01:00
|
|
|
|
2018-09-26 17:46:58 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2015-05-09 02:17:33 +01:00
|
|
|
|
2018-09-26 17:46:58 +01:00
|
|
|
buildCommand = ''
|
|
|
|
jar=$out/share/alloy/${nameMajor}.jar
|
|
|
|
install -Dm644 ${src} $jar
|
2015-05-09 02:17:33 +01:00
|
|
|
|
2018-09-26 17:46:58 +01:00
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/${nameMajor} --add-flags \
|
|
|
|
"-jar $jar"
|
2015-05-09 02:17:33 +01:00
|
|
|
|
2018-09-26 17:46:58 +01:00
|
|
|
install -Dm644 ${./icon.png} $out/share/pixmaps/${nameMajor}.png
|
|
|
|
cp -r ${desktopItem}/share/applications $out/share
|
|
|
|
'';
|
2015-05-09 02:17:33 +01:00
|
|
|
|
2018-09-26 17:46:58 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Language & tool for relational models";
|
|
|
|
longDescription = ''
|
|
|
|
Alloy is a language for describing structures and a tool for exploring
|
|
|
|
them. An Alloy model is a collection of constraints that describes a set
|
|
|
|
of structures, e.g. all the possible security configurations of a web
|
|
|
|
application, or all the possible topologies of a switching network. The
|
|
|
|
Alloy Analyzer is a solver that takes the constraints of a model and
|
|
|
|
finds structures that satisfy them. Structures are displayed graphically,
|
|
|
|
and their appearance can be customized for the domain at hand.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://alloytools.org/";
|
|
|
|
downloadPage = "http://alloytools.org/download.html";
|
2018-09-26 17:46:58 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
2020-03-19 00:49:25 +00:00
|
|
|
maintainers = with maintainers; [ notbandali ];
|
2018-09-26 17:46:58 +01:00
|
|
|
};
|
|
|
|
};
|
2015-05-09 00:23:30 +01:00
|
|
|
|
2018-09-26 17:46:58 +01:00
|
|
|
in rec {
|
|
|
|
alloy4 = let version = "4.2_2015-02-22"; in generic {
|
|
|
|
major = "4";
|
|
|
|
inherit version;
|
|
|
|
src = fetchurl {
|
|
|
|
sha256 = "0p93v8jwx9prijpikkgmfdzb9qn8ljmvga5d9wvrkxddccjx9k28";
|
|
|
|
url = "http://alloytools.org/download/alloy${version}.jar";
|
|
|
|
};
|
|
|
|
};
|
2016-01-24 19:31:44 +00:00
|
|
|
|
2019-11-23 03:03:23 +00:00
|
|
|
alloy5 = let version = "5.1.0"; in generic {
|
2018-09-26 17:46:58 +01:00
|
|
|
major = "5";
|
|
|
|
inherit version;
|
|
|
|
src = fetchurl {
|
2019-11-23 03:03:23 +00:00
|
|
|
sha256 = "02k9khs4k5nc86x9pp5k3vcb0kiwdgcin46mlap4fycnr673xd53";
|
|
|
|
url = "https://github.com/AlloyTools/org.alloytools.alloy/releases/download/v${version}/org.alloytools.alloy.dist.jar";
|
2018-09-26 17:46:58 +01:00
|
|
|
};
|
2016-01-24 19:31:44 +00:00
|
|
|
};
|
2018-09-26 17:46:58 +01:00
|
|
|
|
2019-11-23 03:03:23 +00:00
|
|
|
alloy = alloy5;
|
2015-05-09 00:23:30 +01:00
|
|
|
}
|