Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nbb: init at 0.5.103 #173452

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0736eff
nbb: init at 0.5.103
PlumpMath May 18, 2022
57c3c4f
Merge branch 'NixOS:master' into master
PlumpMath Jun 3, 2022
cfff6ef
Merge branch 'NixOS:master' into master
PlumpMath Jun 3, 2022
e4221f6
Merge branch 'NixOS:master' into master
PlumpMath Jun 3, 2022
b0f89c9
Merge branch 'NixOS:master' into master
PlumpMath Jun 4, 2022
1505ced
Update default.nix
PlumpMath Jun 4, 2022
05b8fa7
review Changes requested
PlumpMath Jun 8, 2022
0be6155
fix sha256
PlumpMath Jun 8, 2022
e576f3c
add clojure at buildInputs
PlumpMath Jun 11, 2022
5a2a0cf
change makeWrapper
PlumpMath Jun 11, 2022
c17827c
update version
PlumpMath Jun 11, 2022
fb2d332
change sha256
PlumpMath Jun 11, 2022
ef1f044
Update default.nix
PlumpMath Jun 11, 2022
877c2d1
Update default.nix
PlumpMath Jun 11, 2022
71c4102
change jdk to graalvm11-ce
PlumpMath Jun 11, 2022
0afecc5
Update default.nix
PlumpMath Jun 11, 2022
2867ea9
Update default.nix
PlumpMath Jun 11, 2022
8077c63
Merge branch 'NixOS:master' into nbb
PlumpMath Jun 11, 2022
c51812c
add classpath
PlumpMath Jun 11, 2022
a8e5a99
addpath fetchMavenArtifact
PlumpMath Jun 11, 2022
19fbc34
Update default.nix
PlumpMath Jun 11, 2022
c728f9c
fix whitespace
PlumpMath Jun 11, 2022
3897612
Delete deps.edn
PlumpMath Jun 11, 2022
f7105ec
Add files via upload
PlumpMath Jun 11, 2022
20bccd6
Add files via upload
PlumpMath Jun 11, 2022
751361d
Update default.nix
PlumpMath Jun 11, 2022
ae3683c
Update default.nix
PlumpMath Jun 11, 2022
4061f2b
Update default.nix
PlumpMath Jun 11, 2022
704ef60
add GIT_SSL_CAINFO SSL_CERT_FILE
PlumpMath Jun 11, 2022
962f5e3
Update default.nix
PlumpMath Jun 11, 2022
53a49fc
Update default.nix
PlumpMath Jun 11, 2022
36ba3a8
change jdk to graalvm11-ce
PlumpMath Jun 11, 2022
5c1df66
change DEPS_CLJ_TOOLS_DIR
PlumpMath Jun 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10161,6 +10161,12 @@
githubId = 358550;
name = "Philip Lykke Carlsen";
};
PlumpMath = {
PlumpMath marked this conversation as resolved.
Show resolved Hide resolved
email = "[email protected]";
github = "PlumpMath";
githubId = 1218365;
name = "Lee Jong Hoon";
};
plumps = {
email = "[email protected]";
github = "plumps";
Expand Down
88 changes: 88 additions & 0 deletions pkgs/development/interpreters/clojure/nbb/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{ lib
, stdenv
, fetchurl
, babashka
, cacert
, clojure
, git
, graalvm11-ce
, nbb
, nodejs
, fetchMavenArtifact
, fetchgit
, fetchFromGitHub
, makeWrapper
, runCommand }:

stdenv.mkDerivation rec {
pname = "nbb";
version = "0.5.104";

src = fetchFromGitHub {
owner = "babashka";
repo = pname;
rev = "v${version}";
sha256 = "sha256-OCcX3WcbhllQJFlr6lM46H0194JYuhOljdmuc3TG6WA=";
};
clj-version = "1.11.1.1113";
clj-src = fetchurl {
url = "https://download.clojure.org/install/clojure-tools-${clj-version}.tar.gz";
sha256 = "sha256-DJVKVqBx8zueA5+KuQX4NypaYBoNFKMuDM8jDqdgaiI=";
};

nativeBuildInputs = [ makeWrapper ];

buildInputs = [ babashka cacert git graalvm11-ce nodejs clojure ];
GIT_SSL_CAINFO="${cacert}/etc/ssl/certs/ca-bundle.crt";
SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt";
buildPhase = ''
runHook preBuild
export JAVA_HOME="${graalvm11-ce}"
export GIT_SSL_CAINFO="${cacert}/etc/ssl/certs/ca-bundle.crt"
export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt"
mkdir -p .m2
substituteInPlace deps.edn --replace ':paths' ':mvn/local-repo "./.m2" :paths'
substituteInPlace bb.edn --replace ':paths' ':mvn/local-repo "./.m2" :paths'
tar -xzvf ${clj-src} -C $(pwd)
export DEPS_CLJ_TOOLS_DIR="$(pwd)/clojure-tools"
export DEPS_CLJ_TOOLS_VERSION=${clj-version}
mkdir .cpcache .gitlibs
export GITLIBS=.gitlibs
export CLJ_CACHE=.cpcache

mkdir -pv $out/bin
bb release
PlumpMath marked this conversation as resolved.
Show resolved Hide resolved
cp -rf ./* $out/

runHook postBuild
'';

installPhase = let
classp = (import ./deps.nix { inherit fetchMavenArtifact fetchgit lib; }).makeClasspaths {};
in ''
runHook preInstall

makeWrapper '${nodejs}/bin/node' "$out/bin/nbb" \
--add-flags "$out/lib/nbb_main.js" \
--add-flags "--classpath ${classp}"

runHook postInstall
'';

doInstallCheck = true;
installCheckPhase = ''
[ $($out/bin/nbb -e '(+ 1 2)') = '3' ]
'';

enableParallelBuilding = true;

meta = with lib; {
description = "Not babashka. Node.js babashka!? Ad-hoc CLJS scripting on Node.js.";
homepage = "https://github.com/babashka/nbb";
license = licenses.epl10;
maintainers = with maintainers; [
PlumpMath
];
platforms = platforms.unix;
};
}
15 changes: 15 additions & 0 deletions pkgs/development/interpreters/clojure/nbb/deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

{
:deps {
com.github.seancorfield/honeysql {:git/tag "v2.2.891" :git/sha "796c734"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If clojure CLI is invoked (I supposed the bb release command is invoking it), clojure will make a network request to resolve the tag. To avoid that, remove :git/tag and use the full sha

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bug and tracked upstream at https://clojure.atlassian.net/browse/TDEPS-223.

In case that makes you feel any better about doing the workaround :)

org.clojure/clojure {:mvn/version "1.11.1"}
}
:aliases {:nbb
{:replace-deps
{
com.github.seancorfield/honeysql {:git/tag "v2.2.891" :git/sha "796c734"}
org.clojure/clojure {:mvn/version "1.11.1"}
}
}
}
}
84 changes: 84 additions & 0 deletions pkgs/development/interpreters/clojure/nbb/deps.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14420,6 +14420,8 @@ with pkgs;

ngn-k = callPackage ../development/interpreters/ngn-k { };

nbb = callPackage ../development/interpreters/clojure/nbb { };

obb = callPackage ../development/interpreters/clojure/obb.nix { };

octave = callPackage ../development/interpreters/octave {
Expand Down