-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
ibus-kkc engine support #34416
ibus-kkc engine support #34416
Conversation
version = "1.3.40"; | ||
name = "${pname}-${version}"; | ||
|
||
src = fetchgit { |
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.
Better use fetchFromGitHub
. This will download a tarball instead of cloning the repo.
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.
fixed
buildPythonPackage rec { | ||
pname = "marisa-python"; | ||
version = "1.3.40"; | ||
name = "${pname}-${version}"; |
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 name
.
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.
Sorry, I don't get it. Why don't you like 6th line where name
is defined?
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.
There's no need for name
. It is generated from pname
and version
by buildPythonPackage
.
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.
Got it. Thanks for advice.
buildinputs = [ marisa ]; | ||
|
||
preBuild = '' | ||
cd bindings/python |
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.
Better use sourceRoot
.
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.
fixed
{ stdenv, buildPythonPackage, fetchgit, marisa, swig }: | ||
|
||
buildPythonPackage rec { | ||
pname = "marisa-python"; |
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.
Is there another package repo that calls this marisa-python
or why did you choose that name?
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.
At first I thought that it's a good idea since there is a project named marisa-tie
which is a handwritten(?) python bindings to C++ marisa
library. And this one is the bindings generated by swig.
Now I think that you are right and it's better to rename it to marisa
especially since the same package called python2-marisa
in Arch Linux repos and we have pythonPackages
namespace.
5be2fcf
to
d360232
Compare
pname = "libkkc-data"; | ||
version = "0.2.7"; | ||
name = "${pname}-${version}"; | ||
libkkc_version = "0.3.5"; |
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.
This attribute can go in a let ... in
expression
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.
Do you mean only libkkc_version
? If so -- fixed.
sourceRoot = "${src.name}/bindings/python"; | ||
|
||
meta = with stdenv.lib; { | ||
description = "Python binding for marisa package (do not confuse with marisa-trie python bindings)"; |
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.
yet the homepage does point to marisa-trie ?
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.
Well, as I mentioned it previously (#34416 (comment)) there are two different bindings for marisa-trie C++ library: one are generated by swig (this package), so the homepage of bindings is the homepage of C++ library, other bindings (also called marisa-trie) are from the different package (you can find them here https://github.com/pytries/marisa-trie/). However, they are incompatible.
At first I packaged the bindings by pytries and called the package marisa-trie
, but then I'd found out that I need bindings from s-yata's repo, so I'd decided to give latter the name as for the C++ package.
I agree that the description is pretty misleading, do you have any suggestions for improvement?
@@ -0,0 +1,40 @@ | |||
{ stdenv, fetchurl | |||
, vala, gobjectIntrospection, intltool, pythonPackages, python, glib |
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.
either pythonPackages or python
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.
fixed
Should I fix something else? cc @FRidh |
|
||
configureFlags = [ "--disable-static" ]; | ||
|
||
buildInputs = [ libkkc ibus skk-dicts gnome3.gtk3 ]; |
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.
Don't use gnome3
as an argument; instead just use gtk3
.
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.
fixed
{ stdenv, fetchurl, pythonPackages }: | ||
|
||
let | ||
libkkc_version = "0.3.5"; |
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.
Given that you need to keep those versions synchronized with libkkc
and it's the only user why not move this directly into libkkc
instead?
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.
On another hand you could just use libkkc
as an argument and use libkkc.version
. Don't worry about circular dependencies -- libkkc.version
can be used without instantiating libkkc
derivation itself.
vala intltool pkgconfig | ||
]; | ||
|
||
configureFlags = [ "--disable-static" ]; |
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.
Shouldn't be needed.
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.
fixed
|
||
propagatedBuildInputs = [ gnome3.libgee json_glib ]; | ||
|
||
configureFlags = [ "--disable-static --disable-silent-rules" ]; |
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.
Shouldn't be needed too; static libraries are not built by default (tested by removing those and building).
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.
fixed
|
||
buildInputs = [ marisa libkkc-data ]; | ||
|
||
propagatedBuildInputs = [ gnome3.libgee json_glib ]; |
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.
Just use libgee
and inherit (gnome3) libgee;
in all-packages.nix
instead; we try to avoid using whole (sub-)package sets as arguments.
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.
fixed
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.
Built this locally but didn't verify that it works; ready to merge as soon as remaining issues are addressed. Sorry you had to wait for a long time; we are a bit short on manpower ^_^".
@@ -0,0 +1,26 @@ | |||
{ stdenv, fetchurl, pythonPackages }: |
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.
Don't use pythonPackages
; as with libgee
use inherit
instead.
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.
fixed
717cab5
to
e9fdd35
Compare
@GrahamcOfBorg build ibus-engines.kkc |
Success on x86_64-linux (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
Motivation for this change
This PR adds support for ibus-kkc IME, based on libkkc.
Things done
Added packages
pythonPackages.marisa
(python bindings, generated by swig),libkkc
,libkkc-data
andibus-kkc
.build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)