From a18ceb42152e65def0cc6213773be821c1941dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=B0=D1=80=D0=B8=D0=BA?= <65870+suhr@users.noreply.github.com> Date: Wed, 10 Nov 2021 07:24:19 +0300 Subject: [PATCH] alloy: add alloy 6 --- pkgs/development/tools/alloy/default.nix | 44 +++++++++++------------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/pkgs/development/tools/alloy/default.nix b/pkgs/development/tools/alloy/default.nix index 1dade32ac64d..92f7e8095128 100644 --- a/pkgs/development/tools/alloy/default.nix +++ b/pkgs/development/tools/alloy/default.nix @@ -1,16 +1,20 @@ { lib, stdenv, fetchurl, jre, makeWrapper, makeDesktopItem }: -let generic = { major, version, src }: - +let generic = { version, sha256 }: stdenv.mkDerivation rec { - name = "${nameMajor}-${version}"; - nameMajor = "alloy${major}"; + 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"; + }; desktopItem = makeDesktopItem rec { - name = nameMajor; + name = pname; exec = name; icon = name; - desktopName = "Alloy ${major}"; + desktopName = "Alloy ${lib.versions.major version}"; genericName = "Relational modelling tool"; comment = meta.description; categories = "Development;IDE;Education;"; @@ -19,14 +23,14 @@ let generic = { major, version, src }: nativeBuildInputs = [ makeWrapper ]; buildCommand = '' - jar=$out/share/alloy/${nameMajor}.jar + jar=$out/share/alloy/${pname}.jar install -Dm644 ${src} $jar mkdir -p $out/bin - makeWrapper ${jre}/bin/java $out/bin/${nameMajor} --add-flags \ - "-jar $jar" + makeWrapper ${jre}/bin/java $out/bin/${pname} --add-flags \ + "-jar $jar" - install -Dm644 ${./icon.png} $out/share/pixmaps/${nameMajor}.png + install -Dm644 ${./icon.png} $out/share/pixmaps/${pname}.png cp -r ${desktopItem}/share/applications $out/share ''; @@ -50,22 +54,14 @@ let generic = { major, version, src }: }; 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"; - }; + alloy5 = generic rec { + version = "5.1.0"; + sha256 = "02k9khs4k5nc86x9pp5k3vcb0kiwdgcin46mlap4fycnr673xd53"; }; - alloy5 = let version = "5.1.0"; in generic { - major = "5"; - inherit version; - src = fetchurl { - sha256 = "02k9khs4k5nc86x9pp5k3vcb0kiwdgcin46mlap4fycnr673xd53"; - url = "https://github.com/AlloyTools/org.alloytools.alloy/releases/download/v${version}/org.alloytools.alloy.dist.jar"; - }; + alloy6 = generic rec { + version = "6.0.0"; + sha256 = "sha256-rA7mNxcu0DWkykMyfV4JwFmQqg0HOIcwjjD4jCRxNww="; }; alloy = alloy5; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ce0e680125bc..46874715ed32 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13777,8 +13777,8 @@ with pkgs; inherit (callPackage ../development/tools/alloy { jre = jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731 }) - alloy4 alloy5 + alloy6 alloy; altair = callPackage ../development/tools/altair-graphql-client { };