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
kakoune.cr: init at unstable-2021-04-30 #115011
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what "could not find commit" is supposed to mean. As far as I can tell it's set up exactly like
crystal2nix
, which builds without issue.
Does it try to access git information? They are not available by default. You can either patch it or add leaveDotGit = true;
to the github fetcher.
Hm, at the very least I don't see where this might happen in crystal2nix. This is the entirety of its { lib, fetchFromGitHub, fetchgit, crystal, makeWrapper, nix-prefetch-git }:
crystal.buildCrystalPackage rec {
pname = "crystal2nix";
version = "0.1.0";
src = fetchFromGitHub {
owner = "peterhoeg";
repo = "crystal2nix";
rev = "v${version}";
sha256 = "sha256-K1ElG8VC/D0axmSRaufH3cE50xNQisAmFucDkV+5O0s=";
};
format = "shards";
shardsFile = ./shards.nix;
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
wrapProgram $out/bin/crystal2nix \
--prefix PATH : ${lib.makeBinPath [ nix-prefetch-git ]}
'';
# temporarily off. We need the checks to execute the wrapped binary
doCheck = false;
# it requires an internet connection when run
doInstallCheck = false;
meta = with lib; {
description = "Utility to convert Crystal's shard.lock files to a Nix file";
license = licenses.mit;
maintainers = with maintainers; [ manveru peterhoeg ];
};
} |
It's https://github.com/peterhoeg/crystal2nix/issues/1 - which manveru has helpfully provided a PR for but I still haven't merged...
I'll fix it this weekend.
|
Thank you! |
@peterhoeg any news? |
@@ -25,16 +25,11 @@ crystal.buildCrystalPackage rec { | |||
lockFile = ./shard.lock; | |||
|
|||
installPhase = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should copy bin
and share
to $out
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@loewenheim It is important to copy the whole
bin
andshare
directories to$out
, askcr
will look inshare
.
Do the various scripts in share
still need to be linked into bin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want nix-shell -p kakoune.cr
and have the shipped commands in your path yes.
Otherwise, Nix users will need to enter the following commands:
kcr install commands
kcr install desktop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is definitely that you don't have to run these commands after installing with nix
.
@loewenheim It is important to copy the whole |
cp $out/share/kcr/commands/fzf/kcr-fzf-* $out/bin | ||
mkdir -p $out/bin | ||
cp bin/kcr $out/bin | ||
cp share/kcr/commands/edit/kcr-edit-search $out/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can replace with cp share/kcr/commands/*/kcr-* $out/bin
.
src = fetchFromGitHub { | ||
repo = "kakoune.cr"; | ||
owner = "alexherbo2"; | ||
rev = "c1e0807e3334f9f2e7d61e22fa1fe38c208cc6a4"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated again. :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem :)
|
I suggest you use |
@pteterhoeg What do you mean by “use |
Instead of doing this: mkdir -p $out/share/icons/hicolor/scalable/apps
cp $icon $out/share/icons/hicolor/scalable/apps/kakoune.svg
mkdir -p $out/share/applications
cp share/kcr/applications/kakoune.desktop $out/share/applications You can do: install -Dm444 $icon $out/share/icons/hicolor/scalable/apps/${icon.name}
install -Dm444 t $out/share/applications share/kcr/applications/kakoune.desktop It's just less code and easier to read. |
TIL. Thank you very much for the explanation. |
Please squash the commits when appending new review feedback. |
@loewenheim |
4e0fb36
to
aefdbac
Compare
Building on my machine fails with
i suppose the problem is the |
Nix strips the .git directory to make the tarballs reproducible. Can you overwrite the version detection with the version number? Maybe we need to patch this so that the version number is hardcoded or read from an environment variable. Last option would be to leave the git directory in the download. |
Or inject a "git" script that just echoes out the version (or whatever the consumer needs).
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it building with these changes. It doesn't work as expected, but it's closer to what we need (hopefully).
For example, running kcr-fzf
gives:
/home/mihai/.nix-profile/bin/kcr-fzf: line 3: kcr-fzf-: command not found
and kcr-fzf-buffers
complains it can't find fzf
.
This concludes where I've gotten with it. It works fine, tested with |
I applied your suggested changes. Sorry for the slow response, I've been rather busy. |
This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch). Result of 1 package failed to build and are new build failure:
|
It seems like adding |
What do you mean by "disabling tests"? |
doInstallCheck = false; |
I marked this as stale due to inactivity. → More info |
@loewenheim - I appreciate that this has been a bit of a struggle, but are you still interested in getting this in? |
Interest yes, but I'm afraid I don't have the time right now :/ |
Updated PR here: #162522 |
Closing as the linked PR supersedes this. |
Motivation for this change
I would like to have kakoune.cr in
nixpkgs
.This is still a draft; it doesn't build for reasons that are a mystery to me. To be more concrete, when it gets to the building phase, this happens:
I don't understand what "could not find commit" is supposed to mean. As far as I can tell it's set up exactly like
crystal2nix
, which builds without issue.@alexherbo2 @manveru @peterhoeg
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)