about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAmin Bandali <aminb@gnu.org>2018-09-26 12:46:58 -0400
committerJörg Thalheim <Mic92@users.noreply.github.com>2018-09-26 17:46:58 +0100
commit4586ff73955a761db6f05a66ff40d40dfa317e73 (patch)
treef2a0389b1ecce3d0c94b83957095ed4e849ab66f
parente7ca9af4cc7ad9c1c980ba4694cc9edaedcfda19 (diff)
downloadnixlib-4586ff73955a761db6f05a66ff40d40dfa317e73.tar
nixlib-4586ff73955a761db6f05a66ff40d40dfa317e73.tar.gz
nixlib-4586ff73955a761db6f05a66ff40d40dfa317e73.tar.bz2
nixlib-4586ff73955a761db6f05a66ff40d40dfa317e73.tar.lz
nixlib-4586ff73955a761db6f05a66ff40d40dfa317e73.tar.xz
nixlib-4586ff73955a761db6f05a66ff40d40dfa317e73.tar.zst
nixlib-4586ff73955a761db6f05a66ff40d40dfa317e73.zip
alloy: add alloy5 and take maintainership (#47262)
Add alloy5 (currently, 5.0.0.1), update homepage and downloadPage, and
take maintainership of the package.
-rw-r--r--maintainers/maintainer-list.nix5
-rw-r--r--pkgs/development/tools/alloy/default.nix106
-rw-r--r--pkgs/top-level/all-packages.nix5
3 files changed, 69 insertions, 47 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index f3b0772faa86..e6bf0bace1d7 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -221,6 +221,11 @@
     github = "amiloradovsky";
     name = "Andrew Miloradovsky";
   };
+  aminb = {
+    email = "amin@aminb.org";
+    github = "aminb";
+    name = "Amin Bandali";
+  };
   aminechikhaoui = {
     email = "amine.chikhaoui91@gmail.com";
     github = "AmineChikhaoui";
diff --git a/pkgs/development/tools/alloy/default.nix b/pkgs/development/tools/alloy/default.nix
index c965e5a937a4..7ff5633072e1 100644
--- a/pkgs/development/tools/alloy/default.nix
+++ b/pkgs/development/tools/alloy/default.nix
@@ -1,58 +1,72 @@
-{ stdenv, fetchurl, jre, makeDesktopItem }:
+{ stdenv, fetchurl, jre, makeWrapper, makeDesktopItem }:
 
-stdenv.mkDerivation rec {
-  name = "alloy-${version}";
-  version = "4.2_2015-02-22";
+let generic = { major, version, src }:
 
-  src = fetchurl {
-    sha256 = "0p93v8jwx9prijpikkgmfdzb9qn8ljmvga5d9wvrkxddccjx9k28";
-    url = "http://alloy.mit.edu/alloy/downloads/alloy${version}.jar";
-  };
-
-  desktopItem = makeDesktopItem rec {
-    name = "alloy";
-    exec = name;
-    icon = name;
-    desktopName = "Alloy";
-    genericName = "Relational modelling tool";
-    comment = meta.description;
-    categories = "Development;IDE;Education;";
-  };
+  stdenv.mkDerivation rec {
+    name = "${nameMajor}-${version}";
+    nameMajor = "alloy${major}";
 
-  buildInputs = [ jre ];
+    desktopItem = makeDesktopItem rec {
+      name = "${nameMajor}";
+      exec = name;
+      icon = name;
+      desktopName = "Alloy ${major}";
+      genericName = "Relational modelling tool";
+      comment = meta.description;
+      categories = "Development;IDE;Education;";
+    };
 
-  phases = [ "installPhase" ];
+    nativeBuildInputs = [ makeWrapper ];
 
-  installPhase = ''
-    jar=$out/share/alloy/alloy${version}.jar
+    buildCommand = ''
+      jar=$out/share/alloy/${nameMajor}.jar
+      install -Dm644 ${src} $jar
 
-    install -Dm644 ${src} $jar
+      mkdir -p $out/bin
+      makeWrapper ${jre}/bin/java $out/bin/${nameMajor} --add-flags \
+       "-jar $jar"
 
-    cat << EOF > alloy
-    #!${stdenv.shell}
-    exec ${jre}/bin/java -jar $jar "\''${@}"
-    EOF
+      install -Dm644 ${./icon.png} $out/share/pixmaps/${nameMajor}.png
+      cp -r ${desktopItem}/share/applications $out/share
+    '';
 
-    install -Dm755 alloy $out/bin/alloy
+    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.
+      '';
+      homepage = http://alloytools.org/;
+      downloadPage = http://alloytools.org/download.html;
+      license = licenses.mit;
+      platforms = platforms.linux;
+      maintainers = with maintainers; [ aminb ];
+    };
+  };
 
-    install -Dm644 ${./icon.png} $out/share/pixmaps/alloy.png
-    cp -r ${desktopItem}/share/applications $out/share
-  '';
+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";
+    };
+  };
 
-  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.
-    '';
-    homepage = http://alloy.mit.edu/;
-    downloadPage = http://alloy.mit.edu/alloy/download.html;
-    license = licenses.mit;
-    platforms = platforms.linux;
+  alloy5 = let version = "5.0.0.1"; in generic {
+    major = "5";
+    inherit version;
+    src = fetchurl {
+      sha256 = "0kz6i9av9ksjk62lx0dxx8xr542iqvbqd14m1f9h8xpf72c25xw4";
+      url = "https://github.com/AlloyTools/org.alloytools.alloy/releases/download/v${version}/Alloy-${version}.jar";
+    };
   };
+
+  alloy = alloy4;
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 56c3606368d7..87983bcf3433 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7932,7 +7932,10 @@ with pkgs;
     for more information.
   '';
 
-  alloy = callPackage ../development/tools/alloy { };
+  inherit (callPackage ../development/tools/alloy { })
+    alloy4
+    alloy5
+    alloy;
 
   adtool = callPackage ../tools/admin/adtool { };