When the ghc-paths library is compiled, the paths of the
compiler it is compiled with are being hardcoded in the
library (and can then be queried from other applications
using the library).
But on Nix, packages are compiled with ghc-wrapper, and
subsequently possibly used with a special version of ghc
generated for a particular environment of packages. So
one version of ghc-paths may potentially end up being
used by lots of different instances of ghc. The hardcoding
approach fails.
As a work-around, we now patch ghc-paths so that it allows
setting the paths that can be queried via environment
variables. Specific GHC environments can then set these
environment variables in the wrapper shell script that
invokes GHC.
This should at least partially solve issue #213.
The previos version did a for loop over the output of set, which spits out _all_
defined variables and their contents. This not only is dangerous if there is a
variable starting with CONFIG_ but also can't handle whitespace, as the IFS is
set to any (horizontal _and_ vertical) whitespace by default.
So, imagine (actually don't imagine, something like this is the case in a lot of
kernel configuration files) you have the following variable:
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi ..."
A loop with for and the default IFS would result in the following variable
pieces:
0: CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi
1: -fcall-saved-rsi
2: ..."
This obviously leads to the problem that this config variable is being cut off
at the first whitespace.
Another downside of this approach is that set not only returns variables but
functions as well. This could lead to quite a lot of unexpected behaviour and
confusion.
So the new approach doesn't source the kernel configuration anymore but uses
`read` to parse the file line-by line, setting IFS to '=', thus splitting all
configuration lines into key/value pairs.
Using parameter expansion, we ensure that we only read lines starting with
"CONFIG_". This particularily has the advantage of not being bash-specific,
should we choose to change to a different default shell someday.
Now, after we got a correct "CONFIG_" line, we're using a temporary variable to
split off the first quote from the result. Particularily the reason behind this
is shell compatibility again, as ${${foo#"}%"} only works in Bash, Zsh and
whatnot but not in plain SH.
And within the next line we obviously insert the no_firstquote variable without
it's last quote removed.
But, what about escaping?
First of all, if we'd just eval the $val variable, we would correctly unescape
the value, but this has the downside that variables within the content would be
expanded, for example look at this:
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
Well, obviously this is a bad example at the Nix sense, but just to show that
variables within kernel configuration entries aren't impossible.
And second, which would have been a show stopper if \" would be within $val: It
simply would end up being an invalid Nix expression, because \" would end up as
a ploin " within a double quoted string.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Just saw Michael Raskin's GNU Chess and XBoard updates and did a short check if
Scid is already in nixpkgs. It wasn't, so I decided to add it, so thanks to
@7c6f434c :-)
The package involves a lot of patching, as usual with Tcl/Tk on NixOS. In this
case the program is written in C++ and embeds the Tcl/Wish interpreter.
Unfortunately this doesn't make it easier to inject TCLLIBPATH, as there doesn't
seem to be a direct library call (well in theory you could `lappend TCLLIBPATH`,
but that won't help with TK_LIBRARY).
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
stable: 23.0.1271.95 -> 23.0.1271.97 (tested and works)
beta: 24.0.1312.27 -> 24.0.1312.35 (tested and works)
The dev version doesn't build in its newest incarnation, so we will need to fix
and/or patch it before pushing upstream.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Quite a useful tool, especially for non English native speakers to find out what
people mean with things like "hiccup", "boink", "blugle" and whatnot.
And of course it's quite useful to convert between hex/oct/dec/bin.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
It seems that (almost?) all NixOS users start X using the services module,
because startx seems to be broken for quite some while. And it hit me while
getting to NixOS for the first time as well, so I then decided to just use the
service module.
As I'm working with multiple X servers, writing wrappers in ~/nixpkgs/config.nix
became tedious and so I decided to fix it, hopefully without breaking anything.
The fix consists of:
* Provide a default location for the Xorg log (~/.xorg.log - hope that's okay)
* Expose xauth through xinit to ensure purity and "unexpected behaviour", also
known as "simply not working", because xauth isn't in the user's environment.
* Actually provide the X binary so it doesn't have to be passed to startx every
time.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
The extension pack is needed in order to have USB 2.0, RDP and PXE boot support
and is _not_ part of the free version, so please read their conditions before
using it:
https://www.virtualbox.org/wiki/VirtualBox_PUEL
Further information and details about the extension pack is available here:
https://www.virtualbox.org/manual/ch01.html#intro-installing
I'm wimping out here and use requireFile to ask the user to fetch the extension
pack manually, simply because I'm not a lawyer. I've seen other distributions
that fetch the extension packs directly from upstream, but I'm not sure if that
is according to Oracle's PUEL.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This is a small wrapper of Git, which integrates some GitHub specific features,
especially stuff like merging or sending pull requests or attaching commits to
an issue.
I'm not quite familiar with the Nix integration of Ruby, so let's hope that I'm
not doing something horrible here.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Yet another HTTP benchmarking tool, which is really quite minimalistic and in
ANSI C.
This package maybe isn't even worth putting it in its own file and directory but
I did it for the sake of consistency.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Quite a lot of patching involved here, but the upstream package is no longer
maintained anymore. Nevertheless the tool is still useful in some environments.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Shouldn't take _that_ long to build, but I was impatient during fixing the
build and it doesn't hurt anyway, does it?
Signed-off-by: aszlig <aszlig@redmoonstudios.org>