Open sifat06 opened 2 years ago
I haven't used nixOS yet, so I don't know the details about the system much. At first glance it seems nixOS is restricting network access which is needed to download required dependencies. Are there any options to permit network access to the build process?
I don't think internet can be accessed in the buildphase. But I have found some resources about using rust dependencies for building nix packages https://nixos.org/manual/nixpkgs/stable/#compiling-rust-applications-with-cargo. Although, I have no idea how rust and cargo work.
Would it not be possible to package riti
itself, then maybe patch the makefile? Or even just create a custom build phase?
I suggest trying to package this in nixpkgs and some maintainer will guide you through the PR.
@sifat06 see PR https://github.com/NixOS/nixpkgs/pull/181871.
Also, if you are open to it, would it be possible to add the Cargo.lock
to riti
and bump the submodule?
I can upload a vendored tar archive containing every dependencies included, so no network access will be required. I will do so in the coming weekend.
Thanks. But I think that might be a bit excessive since just having the Cargo.lock file would tell cargo
the exact version (and hash) of each dependency to use while building. Plus it is more easily tracked by version control. In either case it is okay. Thanks again
@hqurve Thanks for your help! With your instructions, it built successfully, but I can't seem to find any way to add it to system configuration. Can you also help with that?
No problem. You should just have to add the Cargo.lock file and the default.nix file to some directory and reference it in your config file. For example, you can have the following directory structure
/etc/nixos
|- configuration.nix
.....
|- pkgs
|- open-bangla
|- default.nix
|- Cargo.lock
then just add it to systemPackages as such
environment.systemPackages = [
....
( pkgs.callPackage ./pkgs/open-bangla {}) # the parenthesis are important
]
Thanks. That's installs it as as an application. But I can't seem to find it as a input method either in gnome-settings or in output of ibus list-engine
. But if I run /nix/store/wvq1ba86mw6inw5dkzij7sk670jhy561-openbangla-keyboard-2.0.0/share/openbangla-keyboard/ibus-openbangla
it works, until I again change the input method. Probably what I think is ibus is not looking for xml files in the /nix/store/wvq1ba86mw6inw5dkzij7sk670jhy561-openbangla-keyboard-2.0.0/share/ibus/component/
directory. Do you have any solutions for this? What I tried is setting IBUS_COMPONENT_DIR
to /nix/store/wvq1ba86mw6inw5dkzij7sk670jhy561-openbangla-keyboard-2.0.0/share/ibus/component/
, but it didn't worked.
Sorry, I just added the package and launched the executable without fully knowing how it should be integrated. But the nixos wiki has a good article on using ibus. In the end, I added the following entries to my config and rebooted.
i18n.inputMethod = {
enabled = "ibus";
ibus.engines = [ (pkgs.libsForQt5.callpackage ./pkgs/openbangla) ]; # sorry, I forgot that it depended on qt stuff
ibus.panel = "${pkgs.plasma5Packages.plasma-desktop}/lib/libexec/kimpanel-ibus-panel"; # I tested it on kde
};
Also, please add isIbusEngine=true
to the meta section of the openbangla-package.
... I'll make a pr to fix it
Thanks! Now it works perfectly! But I forgot to mention that clicking on "OpenBangla Keyboard" icon does nothing. Instead, I had to type openbangla-gui
in the terminal to open it as an application. Sorry for that.
Thanks. But I think that might be a bit excessive since just having the Cargo.lock file would tell
cargo
the exact version (and hash) of each dependency to use while building. Plus it is more easily tracked by version control. In either case it is okay. Thanks again
@hqurve Okay, I'll make sure Cargo.lock
file is included in the git repository in the following versions then! Currently, development happens in thedevelop
branch, I'll make a PR to unignore Cargo.lock
file.
@hqurve... fcitx5-openbangla-keyboard does not work in the new stable release of NixOS. However, ibus-engines.openbangla-keyboard works fine.
I built openbangla from the develop branch using overlay in nixos. It does not work also. fcitx5 crashes the x11 session and in wayland d-bus stops working. Even fcitx5 is forcefully run, it says openbangla keyboard not available.
@mominul @hqurve
My nix pkg overlay to built develop version of openbangla keyboard:
{ config, pkgs, ... }:
let
openbangla-keyboard-overlay = final: prev: {
openbangla-keyboard = prev.fcitx5-openbangla-keyboard.overrideAttrs
(old: {
version = "develop-2023-11-05";
src = final.fetchFromGitHub {
owner = "openbangla";
repo = "openbangla-keyboard";
rev = "7586ea9fef16a5eb69ddb06343de76bae445c729"; # Tip of `develop` as of 2023-11-28
hash = "sha256-hPywabhWho7Gi3Y01bK7mvi08edKsmb9EbHu7dc69mo=";
fetchSubmodules = true;
};
});
};
in
{
nixpkgs.overlays = [ openbangla-keyboard-overlay ];
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-m17n
openbangla-keyboard
];
};
}
fcitx5 crash log:
=========================
Fcitx 5.1.5 -- Get Signal No.: 11
Date: try "date -d @1702802244" if you are using GNU date ***
ProcessID: 1816
fcitx5[0x411d1d]
/nix/store/qn3ggz5sf3hkjs2c797xf7nan3amdxmp-glibc-2.38-27/lib/libc.so.6(+0x3da70)[0x7f058c775a70]
/nix/store/fp3gj9rvxypnxm6s69mldialxfbdkdq5-fcitx5-5.1.5/lib/libFcitx5Core.so.7(_ZN5fcitx19InputContextManager18unregisterPropertyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x11c)[0x7f058cee9d6c]
/nix/store/fp3gj9rvxypnxm6s69mldialxfbdkdq5-fcitx5-5.1.5/lib/libFcitx5Core.so.7(_ZN5fcitx27InputContextPropertyFactoryD1Ev+0x1c)[0x7f058ceed29c]
/nix/store/jjayw7x8fx3n5pizrhclpa6zmiz7wrfq-fcitx5-with-addons-5.1.5/lib/fcitx5/openbangla.so(+0x10aa92)[0x7f058850aa92]
/nix/store/jjayw7x8fx3n5pizrhclpa6zmiz7wrfq-fcitx5-with-addons-5.1.5/lib/fcitx5/openbangla.so(+0x11eb39)[0x7f058851eb39]
/nix/store/fp3gj9rvxypnxm6s69mldialxfbdkdq5-fcitx5-5.1.5/lib/libFcitx5Core.so.7(+0x97ccb)[0x7f058cf05ccb]
/nix/store/fp3gj9rvxypnxm6s69mldialxfbdkdq5-fcitx5-5.1.5/lib/libFcitx5Core.so.7(+0x9b120)[0x7f058cf09120]
/nix/store/fp3gj9rvxypnxm6s69mldialxfbdkdq5-fcitx5-5.1.5/lib/libFcitx5Core.so.7(+0x9c21d)[0x7f058cf0a21d]
/nix/store/fp3gj9rvxypnxm6s69mldialxfbdkdq5-fcitx5-5.1.5/lib/libFcitx5Core.so.7(_ZN5fcitx12AddonManager5addonERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x8f)[0x7f058cf07c6f]
/nix/store/fp3gj9rvxypnxm6s69mldialxfbdkdq5-fcitx5-5.1.5/lib/libFcitx5Core.so.7(+0x4a62f)[0x7f058ceb862f]
/nix/store/fp3gj9rvxypnxm6s69mldialxfbdkdq5-fcitx5-5.1.5/lib/libFcitx5Utils.so.2(+0x4cad2)[0x7f058cdcbad2]
/nix/store/i0sdqs34r68if9s4sfmpixnnj36npiwj-systemd-254.6/lib/libsystemd.so.0(+0x8d374)[0x7f058c6b8374]
/nix/store/i0sdqs34r68if9s4sfmpixnnj36npiwj-systemd-254.6/lib/libsystemd.so.0(sd_event_dispatch+0xc8)[0x7f058c6b87c8]
/nix/store/i0sdqs34r68if9s4sfmpixnnj36npiwj-systemd-254.6/lib/libsystemd.so.0(sd_event_run+0xc0)[0x7f058c6b92d0]
/nix/store/i0sdqs34r68if9s4sfmpixnnj36npiwj-systemd-254.6/lib/libsystemd.so.0(sd_event_loop+0x7f)[0x7f058c6b953f]
/nix/store/fp3gj9rvxypnxm6s69mldialxfbdkdq5-fcitx5-5.1.5/lib/libFcitx5Utils.so.2(_ZN5fcitx9EventLoop4execEv+0x11)[0x7f058cdcbc71]
/nix/store/fp3gj9rvxypnxm6s69mldialxfbdkdq5-fcitx5-5.1.5/lib/libFcitx5Core.so.7(_ZN5fcitx8Instance4execEv+0x54)[0x7f058cece434]
fcitx5[0x410547]
/nix/store/qn3ggz5sf3hkjs2c797xf7nan3amdxmp-glibc-2.38-27/lib/libc.so.6(+0x27fce)[0x7f058c75ffce]
/nix/store/qn3ggz5sf3hkjs2c797xf7nan3amdxmp-glibc-2.38-27/lib/libc.so.6(__libc_start_main+0x89)[0x7f058c760089]
fcitx5[0x410cc5]
I am not familiar with Nix environment, so I can't be helpful that much. @hqurve would be the most knowledgeable here.
About the fcitx crash, can you report it to the fcitx's bug tracker?
@mominul ... I will report the crash. But When I install fcitx5-m17n only without openbangla keyboard, it works just fine. I can add m17n languages like Probhat, National and even Bijoy Keyboard layouts.
I encountered the same problem in Arch Linux with fcitx5 once. I was trying to install openbangla keyboard from AUR with openbangla-keyboard-git to work with fcitx5 and it crashed the system. But when I installed fcitx5-openbangla-git from AUR, it worked fine again.
P.S. - In my practical experience, manually building openbangla keyboard from develop branch works completely fine in almost all other distros ( Debian, Fedora, Arch, Void etc).
@hqurve @eclairevoyant as #364 has landed, can you update the Nix installation script?
@mominul .... This error shows up now in Nix if built from develop version.
[ 14%] running cargo
error: failed to select a version for the requirement `ahash = "^0.8"`
candidate versions found which didn't match: 0.7.6
location searched: directory source `/build/cargo-deps-vendor.tar.gz` (which is replacing registry `crates-io`)
required by package `riti v0.1.0 (/build/source/src/engine/riti)`
perhaps a crate was updated and forgotten to be re-vendored?
There are new crate updates in the riti
library, so the libraries(crate) needs to be re-vendored. You can request the nix pkg maintainers to revendor the crates on their issues page.
@mominul ... I forked the develop branch and changed the files as advised from fcitx5 issue. Now i have built from my forked repo and atlast it is working!!! আমার আফসোস মিটলো শেষ পর্যন্ত!
বি.দ্র. - আমি একটা কাস্টম লোগো ব্যবহার করেছি এবং এজন্যে আন্তরিকভাবে ক্ষমাপ্রার্থী।
That's great :tada:
I was trying to install openbangla-keyboard in nixos 22.05. As there is no official package for nixos, I was trying to build it myself. I made a script that looks like this:
However, it wasn't successfully built.
It would be great if there were official build instructions for nixos.