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
uberwriter: init at 2019-11-29 (and update dependency pypandoc to unstable) #75840
uberwriter: init at 2019-11-29 (and update dependency pypandoc to unstable) #75840
Conversation
1460530
to
e362cc7
Compare
63d7897
to
f1b0f50
Compare
@GrahamcOfBorg build python2Packages.pypandoc python3Packages.pypandoc |
1 similar comment
@GrahamcOfBorg build python2Packages.pypandoc python3Packages.pypandoc |
propagatedBuildInputs = [ pip ]; | ||
# add pandoc's dependencies to PATH | ||
cat >> pypandoc/__init__.py << EOF | ||
os.environ["PATH"] = "${haskellPackages.pandoc-citeproc}/bin" + os.pathsep + "${texlive.combined.scheme-small}/bin" + os.pathsep + os.environ.get("PATH", "") |
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 want to avoid putting stuff in a user's env, if you want the executables to be available, then you should use patching to edit the source code to call the utility directly
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 understand that and I am not particularly happy about it, but these are binaries that pandoc
calls, which heavily relies on PATH
.
For pdflatex
we can use the pandoc option --pdf-engine=
, I'll look into that. There however doesn't seem to be an equivalent for pandoc-citeproc
, maybe --filter
could be used, I guess I'll try to achieve it this way.
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 it's a binary, you can also use the makeWrapper
packages, to then wrap the program.
Look for wrapProgram
utility in nixpkgs
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 way, you should not be polluting a user's env
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 am already using that approach, if you check out the most recent diff. Basically I ignore all (possible) run time dependencies except for pandoc
itself in pypandoc
and add the required run time dependencies to PATH
for uberwriter
using wrapGAppsHook
.
This is probably the simplest solution to the problem I described in my post below, athough maybe not the best one possible.
I think there is a fundamental problem with packaging First of all It is possible to work around this issue, e. g. by giving A real issue comes up concerning My last approach was to setup
I think there are multiple solutions to this problem, that don't involve going back to the previous approach: Patching
|
f1b0f50
to
727c768
Compare
Switch to an unstable version to make it work with pandoc v2. Based on NixOS#56592 by @Twey. Reworked dependency handling.
727c768
to
4988f62
Compare
Implemented my idea for the second option on my branch now. |
@GrahamcOfBorg build python2Packages.pypandoc python3Packages.pypandoc uberwriter |
@GrahamcOfBorg build uberwriter |
@sternenseemann would you like to become a maintainer of the pypandoc package as well? I'm not actively using it, and if you maintain uberwriter, you have a great way to check if it's actually working. |
@bennofs yeah sure, already had a good look into it, so it probably makes sense for me to do it |
Motivation for this change
Add uberwriter, a simple, but feature-rich markdown editor.
Changes
First I updated
pypandoc
to an unstable version to make it work with pandoc v2. I based my change on PR #56592. There's also news on thepypandoc
situation: It seems like the maintainer ofuberwriter
will maintainpypandoc
in the future.Then I added a package for
uberwriter
's current master revision. I chose to use an unstable version becauseuberwriter
recently switched build system. I had already previously tried to getuberwriter
to work, but I couldn't manage to make Nix and its custom build system to get along. Now they usemeson
andninja
which works pretty well together withwrapGAppsHook
. As they'll probably stick with this for the next major release 2.2.0, it's probably not worth it to invest any more time into the old build system. Sadly the last beta release also includes this old build system.I also delete two packages that are distributed with UberWriter:
pylocales
andpressagio
. These could probably be distributed by Nix, but would require light patching of UberWriter. However this is currently not necessary aspylocale
is never imported andpressagio
is only used in an internal module for auto correct that is in turn never imported, as this feature is not used currently.Things done
Tested the following features of UberWriter that I am aware of:
What I haven't thoroughly tested so far is Spell Checking with Gspell, as I don't have a proper Gspell dictionary set up on my system. Gspell behaves in Gedit same as in UberWriter, so it seems fine.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)