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

cudatext: init at 1.111.0 #97063

Merged
merged 2 commits into from Sep 8, 2020
Merged

cudatext: init at 1.111.0 #97063

merged 2 commits into from Sep 8, 2020

Conversation

sikmir
Copy link
Member

@sikmir sikmir commented Sep 4, 2020

Motivation for this change

CudaText is a cross-platform text editor, written in Lazarus.
Resolves #56339.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@davidak davidak left a comment

Choose a reason for hiding this comment

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

looks good
works basically

some things don't work like install plugins, scroll tab left/right buttons, maybe more
but it seems already usable

Screenshot from 2020-09-04 05-15-10

@sikmir
Copy link
Member Author

sikmir commented Sep 5, 2020

FYI @Alexey-T

@Alexey-T
Copy link

Alexey-T commented Sep 5, 2020

some things don't work like install plugins,

It works, after you configure the "pylib__linux" option
https://wiki.freepascal.org/CudaText#Python_on_Linux.2C_BSD.2C_Solaris

scroll tab left/right buttons,

It works. on your screen, we have little count of tabs so they don't scroll.

@sikmir
Copy link
Member Author

sikmir commented Sep 5, 2020

It works, after you configure the "pylib__linux" option

Before build, I set full path to libpython3.so in https://github.com/Alexey-T/CudaText/blob/3cbe36fb8aa3ee67262fc6079335259c0589edeb/app/proc_globdata.pas#L976
Am I right that after that it's not needed to specify full path in settings_default?

$ grep "\"pylib__linux\":" result/share/cudatext/settings_default/default.json
  "pylib__linux": "libpython3.so",

@sikmir
Copy link
Member Author

sikmir commented Sep 5, 2020

Steps to reproduce:

  1. Plugins -> Addons Manager -> Install (Nix lexer) - "Package installed", no errors.
  2. Open some flake.nix file, dialog "Lexer(s) for flake.nix", choose "Download lexer: Nix", no errors, nothing happens, no highlighting.

It looks like Nix lexer was not actually installed.

@sikmir
Copy link
Member Author

sikmir commented Sep 5, 2020

I've just found the root cause, CudaText on first start copy data folder from nix store into ~/.config/cudatext/data with 555 permissions, instead of 755.

@Alexey-T
Copy link

Alexey-T commented Sep 5, 2020

It works, after you configure the "pylib__linux" option

Before build, I set full path to libpython3.so in https://github.com/Alexey-T/CudaText/blob/3cbe36fb8aa3ee67262fc6079335259c0589edeb/app/proc_globdata.pas#L976
Am I right that after that it's not needed to specify full path in settings_default?

IMO yes, it should work.

$ grep "\"pylib__linux\":" result/share/cudatext/settings_default/default.json
  "pylib__linux": "libpython3.so",

but default.json is not read by program, it's only for user reference.

@Alexey-T
Copy link

Alexey-T commented Sep 5, 2020

I've just found the root cause, CudaText on first start copy data folder from nix store into ~/.config/cudatext/data with 555 permissions, instead of 755.

Cud runs this:

  {$ifdef linux}
  if OpDirLocal<>OpDirExe then
    if IsDistroUpdateNeeded then
      if DirectoryExistsUTF8(OpDirPrecopy) then
        RunCommand('cp', ['-R', '-u', '-t',
          OpDirLocal,
          '/usr/share/cudatext/py',
          '/usr/share/cudatext/data',
          '/usr/share/cudatext/settings_default'
          ], S);
  {$endif}  

so permissions 555 is copy from your dir, which is 555.

@sikmir
Copy link
Member Author

sikmir commented Sep 5, 2020

so permissions 555 is copy from your dir, which is 555.

Indeed, folder in nix store have 555 permissions. IMHO, It would be good if CudaText would make no assumption about source permissions and force 755 while copying. What do you think?

@Alexey-T
Copy link

Alexey-T commented Sep 5, 2020

Yes, agree. Will try to change that code part.

@Alexey-T
Copy link

Alexey-T commented Sep 5, 2020

Made this change. do you need new linux build?

@sikmir
Copy link
Member Author

sikmir commented Sep 5, 2020

Made this change.

Thanks!

do you need new linux build?

No, nix package doesn't use binary CudaText packages, but build it from sources. So I can just apply your patch.

@sikmir
Copy link
Member Author

sikmir commented Sep 5, 2020

Nix lexer is now installed by default, just for convenience of Nix users.

@davidak
Copy link
Member

davidak commented Sep 5, 2020

I built it again, but can't see the changes. Plugins still don't appear and Nix is not known.

davidak@gaming:~/code/nixpkgs]$ nix-shell -p nixpkgs-review --run "nixpkgs-review pr 97063"

@Alexey-T
Copy link

Alexey-T commented Sep 5, 2020

Check that file Nix.lcf exists in the .config/cudatext/data/lexlib.

@Alexey-T
Copy link

Alexey-T commented Sep 5, 2020

Plugins don't appear? But python console panel input works OK? press Ctrl+tilde - input works ok?

@sikmir
Copy link
Member Author

sikmir commented Sep 5, 2020

I built it again, but can't see the changes. Plugins still don't appear and Nix is not known.

davidak@gaming:~/code/nixpkgs]$ nix-shell -p nixpkgs-review --run "nixpkgs-review pr 97063"

I've not commited yet, wait a bit...

@sikmir
Copy link
Member Author

sikmir commented Sep 5, 2020

@davidak Check it now, it works for me.

@Alexey-T
Copy link

Alexey-T commented Sep 5, 2020

Just note that currrent version is 1.111.0.

@sikmir
Copy link
Member Author

sikmir commented Sep 5, 2020

Just note that currrent version is 1.111.0.

I don't see 1.111.0 in https://github.com/Alexey-T/CudaText/tags.

@Alexey-T
Copy link

Alexey-T commented Sep 5, 2020

Ah, "tag" will be little later, in 1-2 days.

@sikmir
Copy link
Member Author

sikmir commented Sep 6, 2020

@Alexey-T Just in case, is there any repo where I can find CudaText translations other than https://sourceforge.net/projects/cudatext/files/addons/translations/? I can't find it in https://github.com/CudaText-addons as well. I want to allow users to optionally install more languages by default, like it's done for libreoffice:

, langs ? [ "ca" "cs" "da" "de" "en-GB" "en-US" "eo" "es" "fr" "hu" "it" "ja" "nl" "pl" "pt" "pt-BR" "ro" "ru" "sl" "zh-CN" ]

The problem is that we need somehow versioned permanent links, but sourceforge files are not (after translations files update, links will be the same, but sha256 will be changed).

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/295

@sikmir
Copy link
Member Author

sikmir commented Sep 6, 2020

@davidak I've added libqt5pas, so now CudaText can be built with qt5 widgetset as well. And I've switched default widgetset from gtk2 to qt5, it looks a bit better for me.

@sikmir sikmir force-pushed the cudatext branch 3 times, most recently from fa60eb8 to 9d32d5d Compare September 6, 2020 11:32
@sikmir sikmir requested a review from 7c6f434c September 6, 2020 11:36
@sikmir sikmir force-pushed the cudatext branch 2 times, most recently from ace9e78 to 94ccb49 Compare September 6, 2020 12:16
@davidak
Copy link
Member

davidak commented Sep 6, 2020

With the dark theme "sub", the menu text is now black on dark grey.

Screenshot from 2020-09-06 23-35-15

terminal output:

[nix-shell:~/.cache/nixpkgs-review/pr-97063-7]$ cudatext
QApplication: invalid style override 'adwaita' passed, ignoring it.
	Available styles: Breeze, Windows, Fusion

@sikmir
Copy link
Member Author

sikmir commented Sep 6, 2020

Hmm, here is my (qt5, there is no errors in terminal):
scr1
Maybe it makes sense to switch default option back to gtk2.

@davidak
Copy link
Member

davidak commented Sep 6, 2020

I'm using the GTK-based Pantheon desktop.

@7c6f434c
Copy link
Member

7c6f434c commented Sep 8, 2020

@davidak Maybe you need to install the Adwaita theme files?

@sikmir do you think this is ready to merge as it is (mention me once you have a follow-up PR with more improvements), or is it better to wait for some soon-to-happen debugging/polishing?

@sikmir
Copy link
Member Author

sikmir commented Sep 8, 2020

@sikmir do you think this is ready to merge as it is (mention me once you have a follow-up PR with more improvements), or is it better to wait for some soon-to-happen debugging/polishing?

1.111.0 is out meanwhile (fixes problem with permissions, so we can remove patching), so let me to update and I thnk we are ready to proceed.

@sikmir sikmir changed the title cudatext: init at 1.110.0 cudatext: init at 1.111.0 Sep 8, 2020
@sikmir
Copy link
Member Author

sikmir commented Sep 8, 2020

@7c6f434c Update to 1.111.0 is done and verified, feel free to proceed with merge.

@7c6f434c 7c6f434c merged commit 49e694a into NixOS:master Sep 8, 2020
@sikmir sikmir deleted the cudatext branch September 8, 2020 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please package CudaText
5 participants