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
remarkable-mouse: init at 5.2.1 #85899
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.
Thanks for packaging this. Some comments - also, you might want to restrict this to py3k only.
substituteInPlace screeninfo/enumerators/xinerama.py \ | ||
--replace "load_library(\"X11\")" "ctypes.cdll.LoadLibrary(\"${libX11}/lib/libX11.so\")" \ | ||
--replace "load_library(\"Xinerama\")" "ctypes.cdll.LoadLibrary(\"${libXinerama}/lib/libXinerama.so\")" | ||
substituteInPlace screeninfo/enumerators/xrandr.py \ | ||
--replace "load_library(\"X11\")" "ctypes.cdll.LoadLibrary(\"${libX11}/lib/libX11.so\")" \ | ||
--replace "load_library(\"Xrandr\")" "ctypes.cdll.LoadLibrary(\"${libXrandr}/lib/libXrandr.so\")" | ||
''; |
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.
load_library
is defined in utils.py
, and is basically just a wrapper around
path = ctypes.util.find_library(name)
return ctypes.cdll.LoadLibrary(path)
On Linux, this uses dlopen
, so if you just wrapProgram
the binaries to add libX11
and libXrandr
's lib path to LD_LIBRARY_PATH
, these libraries should be found even without patching the source.
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 do not like using LD_LIBRARY_PATH
since it can lead to weird and difficult to diagnose error when it loads a different version of library than the program is compiled against. Remember environment variables are inherited by child processes and LD_LIBRARY_PATH
has higher priority than DT_RUNPATH
ELF entry we use to locate libraries.
For a concrete example when this occurs: If you have a URL hyperlink in the application and click it, it will open a browser child process, which will inherit these X libraries. If you use browser from a different channel, it will likely crash.
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.
Fair enough - Can we still add the two library paths into utils.py
, instead of hunting for each and every occurence?
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 could patch the load_library
function in utils.py
, but it felt neater to me to just use substituteInPlace
as those libraries are highly unlikely to appear anywhere except in the files which get patched
sha256 = "10gwj08kn2rs4waq7807mq34cbavgkpg8fpir8mvnba601b8q4r4"; | ||
}; | ||
|
||
doCheck = false; |
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.
Why were the tests disabled?
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.
They crash because they can't find libraries.
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.
Can you add a small comment with an example? Maybe s.o can find time to debug it.
It's preferrable to run the tests if possible, so breakages caused by other python package bumps are more likely to be noticed.
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.
crashing isn't a good sign, could mean that it's broken in a sandbox, thus nixpkgs
sha256 = "10gwj08kn2rs4waq7807mq34cbavgkpg8fpir8mvnba601b8q4r4"; | ||
}; | ||
|
||
doCheck = false; |
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.
crashing isn't a good sign, could mean that it's broken in a sandbox, thus nixpkgs
Please follow CONTRIBUTING.md and manual#submitting-changes-making-patches and squash the fixup commits. |
Squashed and rebased @jonringer |
@GrahamcOfBorg build remarkable-mouse |
Sorry I took so long to get around to this! Seems to work, will fix the conflicts and merge. |
Motivation for this change
Add remarkable-mouse, a
tool to use the reMarkable as a graphics tablet, and its dependencies.
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)