gren: 0.4.5 -> 0.6.1 (#401729)
This commit is contained in:
@@ -21728,6 +21728,12 @@
|
||||
githubId = 521306;
|
||||
name = "Rob Glossop";
|
||||
};
|
||||
robinheghan = {
|
||||
email = "git@heghan.org";
|
||||
github = "robinheghan";
|
||||
githubId = 854889;
|
||||
name = "Robin Heggelund Hansen";
|
||||
};
|
||||
robinkrahl = {
|
||||
email = "nix@ireas.org";
|
||||
github = "robinkrahl";
|
||||
|
||||
+19
-35
@@ -2,7 +2,6 @@
|
||||
# Update via ./update.sh
|
||||
{
|
||||
mkDerivation,
|
||||
ansi-terminal,
|
||||
ansi-wl-pprint,
|
||||
base,
|
||||
base64-bytestring,
|
||||
@@ -12,7 +11,6 @@
|
||||
directory,
|
||||
edit-distance,
|
||||
fetchgit,
|
||||
filelock,
|
||||
filepath,
|
||||
ghc-prim,
|
||||
haskeline,
|
||||
@@ -21,28 +19,26 @@
|
||||
indexed-traversable,
|
||||
lib,
|
||||
mtl,
|
||||
prettyprint-avh4,
|
||||
prettyprinter,
|
||||
process,
|
||||
raw-strings-qq,
|
||||
scientific,
|
||||
text,
|
||||
time,
|
||||
utf8-string,
|
||||
vector,
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "gren";
|
||||
version = "0.5.2";
|
||||
version = "0.6.1";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/gren-lang/compiler.git";
|
||||
sha256 = "1mksfma6c1dn091ab4x794hs71v44bx294wbn80qfc5kgrrl5lf4";
|
||||
rev = "ee19481f5715b78cad8be09e29e56dcb82d65f4f";
|
||||
sha256 = "0h7mm3y62l3j190sd25db4bifp65xmyc4rc16jhyphp6yzyjcpcl";
|
||||
rev = "b54f0343c8015c777e4fbb74e843181e6f3cb214";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
isLibrary = false;
|
||||
isExecutable = true;
|
||||
executableHaskellDepends = [
|
||||
ansi-terminal
|
||||
libraryHaskellDepends = [
|
||||
ansi-wl-pprint
|
||||
base
|
||||
base64-bytestring
|
||||
@@ -51,51 +47,39 @@ mkDerivation {
|
||||
containers
|
||||
directory
|
||||
edit-distance
|
||||
filelock
|
||||
filepath
|
||||
ghc-prim
|
||||
haskeline
|
||||
indexed-traversable
|
||||
mtl
|
||||
prettyprint-avh4
|
||||
process
|
||||
prettyprinter
|
||||
raw-strings-qq
|
||||
scientific
|
||||
text
|
||||
time
|
||||
utf8-string
|
||||
vector
|
||||
];
|
||||
executableHaskellDepends = [
|
||||
base
|
||||
bytestring
|
||||
containers
|
||||
directory
|
||||
filepath
|
||||
haskeline
|
||||
mtl
|
||||
process
|
||||
utf8-string
|
||||
];
|
||||
testHaskellDepends = [
|
||||
ansi-terminal
|
||||
ansi-wl-pprint
|
||||
base
|
||||
base64-bytestring
|
||||
binary
|
||||
bytestring
|
||||
containers
|
||||
directory
|
||||
edit-distance
|
||||
filelock
|
||||
filepath
|
||||
ghc-prim
|
||||
haskeline
|
||||
hspec
|
||||
indexed-traversable
|
||||
mtl
|
||||
prettyprint-avh4
|
||||
process
|
||||
raw-strings-qq
|
||||
scientific
|
||||
text
|
||||
time
|
||||
utf8-string
|
||||
vector
|
||||
];
|
||||
testToolDepends = [ hspec-discover ];
|
||||
doHaddock = false;
|
||||
jailbreak = true;
|
||||
homepage = "https://gren-lang.org";
|
||||
description = "`gren` command line interface";
|
||||
description = "The `gren` command line interface";
|
||||
license = lib.licenses.bsd3;
|
||||
mainProgram = "gren";
|
||||
}
|
||||
@@ -1,21 +1,63 @@
|
||||
{
|
||||
lib,
|
||||
haskell,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
makeBinaryWrapper,
|
||||
nodejs,
|
||||
git,
|
||||
haskellPackages,
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (haskell.lib.compose) overrideCabal;
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "gren";
|
||||
version = "0.6.1";
|
||||
|
||||
raw-pkg = (haskellPackages.callPackage ./generated-package.nix { }).overrideScope (
|
||||
final: prev: {
|
||||
ansi-wl-pprint = final.ansi-wl-pprint_0_6_9;
|
||||
}
|
||||
);
|
||||
|
||||
overrides = {
|
||||
maintainers = with lib.maintainers; [ tomasajt ];
|
||||
passthru.updateScript = ./update.sh;
|
||||
src = fetchFromGitHub {
|
||||
owner = "gren-lang";
|
||||
repo = "compiler";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-lF0m/ffmwuuhNIFlwnztxVwXF1mtiKZBCnJQYfyo9UA=";
|
||||
};
|
||||
in
|
||||
overrideCabal overrides raw-pkg
|
||||
|
||||
buildInputs = [
|
||||
nodejs
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeBinaryWrapper
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
# install the precompiled frontend into the proper location
|
||||
install -Dm755 bin/compiler $out/bin/gren
|
||||
|
||||
wrapProgram $out/bin/gren \
|
||||
--set-default GREN_BIN ${lib.getExe finalAttrs.passthru.backend} \
|
||||
--suffix PATH : ${lib.makeBinPath [ git ]}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
versionCheckProgram = "${placeholder "out"}/bin/gren";
|
||||
versionCheckProgramArg = "--version";
|
||||
|
||||
passthru = {
|
||||
backend = haskellPackages.callPackage ./generated-backend-package.nix { };
|
||||
updateScript = ./update.sh;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Compiler for the Gren programming language";
|
||||
homepage = "https://gren-lang.org";
|
||||
license = lib.licenses.bsd3;
|
||||
mainProgram = "gren";
|
||||
maintainers = with lib.maintainers; [
|
||||
robinheghan
|
||||
tomasajt
|
||||
];
|
||||
};
|
||||
})
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p cabal2nix curl jq
|
||||
#!nix-shell -i bash -p cabal2nix curl jq nixfmt-rfc-style
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# This is the directory of this update.sh script.
|
||||
script_dir="$(dirname "${BASH_SOURCE[0]}")"
|
||||
derivation_file="${script_dir}/generated-package.nix"
|
||||
|
||||
backend_derivation_file="${script_dir}/generated-backend-package.nix"
|
||||
|
||||
latest_version="$(curl --silent 'https://api.github.com/repos/gren-lang/compiler/releases/latest' | jq --raw-output '.tag_name')"
|
||||
|
||||
echo "Updating gren to version ${latest_version}."
|
||||
echo "Running cabal2nix and outputting to ${derivation_file}..."
|
||||
echo "Updating gren backend to version ${latest_version}."
|
||||
echo "Running cabal2nix and outputting to ${backend_derivation_file}..."
|
||||
|
||||
cat > "${derivation_file}" << EOF
|
||||
cat > "${backend_derivation_file}" << EOF
|
||||
# This file has been autogenerated with cabal2nix.
|
||||
# Update via ./update.sh
|
||||
EOF
|
||||
|
||||
cabal2nix 'https://github.com/gren-lang/compiler.git' --revision "${latest_version}" --jailbreak >> "${derivation_file}"
|
||||
nixfmt "${derivation_file}"
|
||||
cabal2nix 'https://github.com/gren-lang/compiler.git' --revision "${latest_version}" --jailbreak >> "${backend_derivation_file}"
|
||||
nixfmt "${backend_derivation_file}"
|
||||
|
||||
echo 'Finished.'
|
||||
echo 'Finished backend generation.'
|
||||
|
||||
Reference in New Issue
Block a user