1 { lib, stdenv, fetchurl, jre, makeWrapper, makeDesktopItem }:
3 let generic = { version, sha256 }:
4 stdenv.mkDerivation rec {
5 pname = "alloy${lib.versions.major version}";
10 url = "https://github.com/AlloyTools/org.alloytools.alloy/releases/download/v${version}/org.alloytools.alloy.dist.jar";
13 desktopItem = makeDesktopItem rec {
17 desktopName = "Alloy ${lib.versions.major version}";
18 genericName = "Relational modelling tool";
19 comment = meta.description;
20 categories = [ "Development" "IDE" "Education" ];
23 nativeBuildInputs = [ makeWrapper ];
26 jar=$out/share/alloy/${pname}.jar
27 install -Dm644 ${src} $jar
30 makeWrapper ${jre}/bin/java $out/bin/${pname} --add-flags \
33 install -Dm644 ${./icon.png} $out/share/pixmaps/${pname}.png
34 cp -r ${desktopItem}/share/applications $out/share
38 description = "Language & tool for relational models";
40 Alloy is a language for describing structures and a tool for exploring
41 them. An Alloy model is a collection of constraints that describes a set
42 of structures, e.g. all the possible security configurations of a web
43 application, or all the possible topologies of a switching network. The
44 Alloy Analyzer is a solver that takes the constraints of a model and
45 finds structures that satisfy them. Structures are displayed graphically,
46 and their appearance can be customized for the domain at hand.
48 homepage = "http://alloytools.org/";
49 downloadPage = "http://alloytools.org/download.html";
50 sourceProvenance = with sourceTypes; [ binaryBytecode ];
51 license = licenses.mit;
52 platforms = platforms.unix;
53 maintainers = with maintainers; [ notbandali ];
58 alloy5 = generic rec {
60 sha256 = "02k9khs4k5nc86x9pp5k3vcb0kiwdgcin46mlap4fycnr673xd53";
63 alloy6 = generic rec {
65 sha256 = "sha256-rA7mNxcu0DWkykMyfV4JwFmQqg0HOIcwjjD4jCRxNww=";