Conversation
224fec1 to
57f691e
Compare
|
Alright @sudosubin that should do it I think |
|
Why are we not building this from source? |
|
For one, the nature of bun makes that very difficult to do. But besides that zig on Darwin is broken which would make that impossible to build for now. Additionally @sudosubin pointed out:
|
|
It's probably possible and a good idea to get it building under nix but I think that would be a not insignificant undertaking over a not insignificant amount of time. |
|
Yeah I've been playing with a source build and it's a bit of a faff |
06kellyjac
left a comment
There was a problem hiding this comment.
the vast majority of this looks shared across darwin and linux
|
Alrighty folks, hows this? |
2da35a6 to
2c47474
Compare
06kellyjac
left a comment
There was a problem hiding this comment.
Looking very good. I'd advise a handful of minor tweaks
leap0x7b
left a comment
There was a problem hiding this comment.
Can't you just build it from source instead of just downloading the binaries from GitHub releases?
|
@leapofazzam123, this was discussed previously in the resolved convos in the thread. TL;DR: it is extremely complex and difficult to build, nix doesn't have the ability to build it native on darwin right now (zig is marked broken on darwin), and the build relies on cross compilation in a way that does not lend itself to being built from source right now. Thusly @06kellyjac @sudosubin myself and other decided it was best to use the binaries for now. |
|
Yeah. We can always swap to a source build once we get it working but it is a mess getting all the pieces together |
|
Should we use the |
|
Personally I think that makes things more confusing then necessary for people looking for the bun package. Bun is a new project that will take some real for it's build system etc to get more polished. Once it becomes more possible down the line, I don't think it's that big of a deal to rewrite the derivation, but again I think it might be a bit before that's even possible and or reasonable. |
|
I dont think there's much of a standard here. I think the source provenance marking it as a binary is fine for now 🤷 |
|
@lucasew 's suggestions plus a license tweak diff --git a/pkgs/development/web/bun/default.nix b/pkgs/development/web/bun/default.nix
index 1a9c16d587b..04124379b14 100644
--- a/pkgs/development/web/bun/default.nix
+++ b/pkgs/development/web/bun/default.nix
@@ -30,16 +30,16 @@ stdenvNoCC.mkDerivation rec {
sha256 = dist.sha256;
};
- sourceRoot = ".";
- unpackCmd = "unzip bun-${dist.shortName}-${dist.arch}.zip";
+ strictDeps = true;
+ nativeBuildInputs = [ unzip ] ++ lib.optionals stdenvNoCC.isLinux [ autoPatchelfHook ];
+ buildInputs = [ openssl ];
+
dontConfigure = true;
dontBuild = true;
- nativeBuildInputs = if stdenvNoCC.isLinux then [ autoPatchelfHook ] else [];
- buildInputs = [ unzip openssl ];
installPhase = ''
runHook preInstall
- install -Dm 755 ./bun-${dist.shortName}-${dist.arch}/bun $out/bin
+ install -Dm 755 ./bun $out/bin/bun
runHook postInstall
'';
@@ -52,8 +52,8 @@ stdenvNoCC.mkDerivation rec {
All in one fast & easy-to-use tool. Instead of 1,000 node_modules for development, you only need bun.
'';
license = with licenses; [
- mit #bun core
- lgpl2 #javascriptcore and webkit
+ mit # bun core
+ lgpl21Only # javascriptcore and webkit
];
maintainers = with maintainers; [ DAlperin jk ];
platforms = builtins.attrNames dists; |
|
@06kellyjac applied the patch, thank you! @lucasew take a look. Think we can get this merged? |
|
|
||
| src = fetchurl { | ||
| url = "https://github.com/Jarred-Sumner/bun-releases-for-updater/releases/download/bun-v${version}/bun-${dist.shortName}-${dist.arch}.zip"; | ||
| sha256 = dist.sha256; |
| dist = dists.${stdenvNoCC.hostPlatform.system} or (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}"); | ||
| in | ||
| stdenvNoCC.mkDerivation rec { | ||
| version = "0.1.1"; |
There was a problem hiding this comment.
The latest version right now is 0.1.2
Mindavi
left a comment
There was a problem hiding this comment.
Whenever ofborg is happy good to go IMO. No need to update to 0.1.2 in this PR, you can do that in a follow up
|
@Mindavi ofborg seems happy. Can we go ahead and merge. I can update after in a quick follow up. |
|
Successfully created backport PR #180900 for |
Description of changes
Add a package for https://bun.sh
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes