2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, jre, makeWrapper, makeDesktopItem }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
let generic = { version, sha256 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "alloy${lib.versions.major version}";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
inherit sha256;
|
|
|
|
url = "https://github.com/AlloyTools/org.alloytools.alloy/releases/download/v${version}/org.alloytools.alloy.dist.jar";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
desktopItem = makeDesktopItem rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
name = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
exec = name;
|
|
|
|
icon = name;
|
2021-12-06 16:07:01 +00:00
|
|
|
desktopName = "Alloy ${lib.versions.major version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
genericName = "Relational modelling tool";
|
|
|
|
comment = meta.description;
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Development" "IDE" "Education" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
jar=$out/share/alloy/${pname}.jar
|
2020-04-24 23:36:52 +00:00
|
|
|
install -Dm644 ${src} $jar
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2021-12-06 16:07:01 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/${pname} --add-flags \
|
|
|
|
"-jar $jar"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
install -Dm644 ${./icon.png} $out/share/pixmaps/${pname}.png
|
2020-04-24 23:36:52 +00:00
|
|
|
cp -r ${desktopItem}/share/applications $out/share
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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.
|
|
|
|
'';
|
|
|
|
homepage = "http://alloytools.org/";
|
|
|
|
downloadPage = "http://alloytools.org/download.html";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2020-09-25 04:45:31 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ notbandali ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
alloy5 = generic rec {
|
|
|
|
version = "5.1.0";
|
|
|
|
sha256 = "02k9khs4k5nc86x9pp5k3vcb0kiwdgcin46mlap4fycnr673xd53";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
alloy6 = generic rec {
|
|
|
|
version = "6.0.0";
|
|
|
|
sha256 = "sha256-rA7mNxcu0DWkykMyfV4JwFmQqg0HOIcwjjD4jCRxNww=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
alloy = alloy5;
|
|
|
|
}
|