Merge remote-tracking branch 'origin/master' into haskell-updates

This commit is contained in:
sternenseemann 2022-11-10 13:56:56 +01:00
commit 5c044644a6
152 changed files with 1898 additions and 710 deletions

View file

@ -22,6 +22,7 @@
<xi:include href="./libxml2.section.xml" />
<xi:include href="./meson.section.xml" />
<xi:include href="./ninja.section.xml" />
<xi:include href="./patch-rc-path-hooks.section.xml" />
<xi:include href="./perl.section.xml" />
<xi:include href="./pkg-config.section.xml" />
<xi:include href="./postgresql-test-hook.section.xml" />

View file

@ -0,0 +1,50 @@
# `patchRcPath` hooks {#sec-patchRcPathHooks}
These hooks provide shell-specific utilities (with the same name as the hook) to patch shell scripts meant to be sourced by software users.
The typical usage is to patch initialisation or [rc](https://unix.stackexchange.com/questions/3467/what-does-rc-in-bashrc-stand-for) scripts inside `$out/bin` or `$out/etc`.
Such scripts, when being sourced, would insert the binary locations of certain commands into `PATH`, modify other environment variables or run a series of start-up commands.
When shipped from the upstream, they sometimes use commands that might not be available in the environment they are getting sourced in.
The compatible shells for each hook are:
- `patchRcPathBash`: [Bash](https://www.gnu.org/software/bash/), [ksh](http://www.kornshell.org/), [zsh](https://www.zsh.org/) and other shells supporting the Bash-like parameter expansions.
- `patchRcPathCsh`: Csh scripts, such as those targeting [tcsh](https://www.tcsh.org/).
- `patchRcPathFish`: [Fish](https://fishshell.com/) scripts.
- `patchRcPathPosix`: POSIX-conformant shells supporting the limited parameter expansions specified by the POSIX standard. Current implementation uses the parameter expansion `${foo-}` only.
For each supported shell, it modifies the script with a `PATH` prefix that is later removed when the script ends.
It allows nested patching, which guarantees that a patched script may source another patched script.
Syntax to apply the utility to a script:
```sh
patchRcPath<shell> <file> <PATH-prefix>
```
Example usage:
Given a package `foo` containing an init script `this-foo.fish` that depends on `coreutils`, `man` and `which`,
patch the init script for users to source without having the above dependencies in their `PATH`:
```nix
{ lib, stdenv, patchRcPathFish}:
stdenv.mkDerivation {
# ...
nativeBuildInputs = [
patchRcPathFish
];
postFixup = ''
patchRcPathFish $out/bin/this-foo.fish ${lib.makeBinPath [ coreutils man which ]}
'';
}
```
::: {.note}
`patchRcPathCsh` and `patchRcPathPosix` implementation depends on `sed` to do the string processing.
The others are in vanilla shell and have no third-party dependencies.
:::

View file

@ -1140,6 +1140,13 @@ Here are some more packages that provide a setup hook. Since the list of hooks i
Many other packages provide hooks, that are not part of `stdenv`. You can find
these in the [Hooks Reference](#chap-hooks).
### Compiler and Linker wrapper hooks {#compiler-linker-wrapper-hooks}
If the file `${cc}/nix-support/cc-wrapper-hook` exists, it will be run at the end of the [compiler wrapper](#cc-wrapper).
If the file `${binutils}/nix-support/post-link-hook` exists, it will be run at the end of the linker wrapper.
These hooks allow a user to inject code into the wrappers.
As an example, these hooks can be used to extract `extraBefore`, `params` and `extraAfter` which store all the command line arguments passed to the compiler and linker respectively.
## Purity in Nixpkgs {#sec-purity-in-nixpkgs}
*Measures taken to prevent dependencies on packages outside the store, and what you can do to prevent them.*

View file

@ -2773,6 +2773,12 @@
githubId = 40290417;
name = "Seb Blair";
};
considerate = {
email = "viktor.kronvall@gmail.com";
github = "considerate";
githubId = 217918;
name = "Viktor Kronvall";
};
copumpkin = {
email = "pumpkingod@gmail.com";
github = "copumpkin";
@ -4442,6 +4448,12 @@
githubId = 1276854;
name = "Florian Peter";
};
farnoy = {
email = "jakub@okonski.org";
github = "farnoy";
githubId = 345808;
name = "Jakub Okoński";
};
fbeffa = {
email = "beffa@fbengineering.ch";
github = "fedeinthemix";

View file

@ -1248,6 +1248,19 @@ signald -d /var/lib/signald/db \
Add udev rules for the Teensy family of microcontrollers.
</para>
</listitem>
<listitem>
<para>
The Qt QML disk cache is now disabled by default. This fixes a
long-standing issue where updating Qt/KDE apps would sometimes
cause them to crash or behave strangely without explanation.
Those concerned about the small (~10%) performance hit to
application startup can re-enable the cache (and expose
themselves to gremlins) by setting the envrionment variable
<literal>QML_FORCE_DISK_CACHE</literal> to
<literal>1</literal> using e.g. the
<literal>environment.sessionVariables</literal> NixOS option.
</para>
</listitem>
<listitem>
<para>
systemd-oomd is enabled by default. Depending on which systemd
@ -1354,10 +1367,20 @@ signald -d /var/lib/signald/db \
</listitem>
<listitem>
<para>
boot.kernel.sysctl is defined as a freeformType and adds a
custom merge option for <quote>net.core.rmem_max</quote>
(taking the highest value defined to avoid conflicts between 2
services trying to set that value)
<literal>boot.kernel.sysctl</literal> is defined as a
freeformType and adds a custom merge option for
<quote>net.core.rmem_max</quote> (taking the highest value
defined to avoid conflicts between 2 services trying to set
that value).
</para>
</listitem>
<listitem>
<para>
The <literal>mame</literal> package does not ship with its
tools anymore in the default output. They were moved to a
separate <literal>tools</literal> output instead. For
convenience, <literal>mame-tools</literal> package was added
for those who want to use it.
</para>
</listitem>
</itemizedlist>

View file

@ -377,6 +377,14 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
- Add udev rules for the Teensy family of microcontrollers.
- The Qt QML disk cache is now disabled by default. This fixes a
long-standing issue where updating Qt/KDE apps would sometimes cause
them to crash or behave strangely without explanation. Those concerned
about the small (~10%) performance hit to application startup can
re-enable the cache (and expose themselves to gremlins) by setting the
envrionment variable `QML_FORCE_DISK_CACHE` to `1` using e.g. the
`environment.sessionVariables` NixOS option.
- systemd-oomd is enabled by default. Depending on which systemd units have
`ManagedOOMSwap=kill` or `ManagedOOMMemoryPressure=kill`, systemd-oomd will
SIGKILL all the processes under the appropriate descendant cgroups when the
@ -406,6 +414,8 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
- The `nodePackages` package set now defaults to the LTS release in the `nodejs` package again, instead of being pinned to `nodejs-14_x`. Several updates to node2nix have been made for compatibility with newer Node.js and npm versions and a new `postRebuild` hook has been added for packages to perform extra build steps before the npm install step prunes dev dependencies.
- boot.kernel.sysctl is defined as a freeformType and adds a custom merge option for "net.core.rmem_max" (taking the highest value defined to avoid conflicts between 2 services trying to set that value)
- `boot.kernel.sysctl` is defined as a freeformType and adds a custom merge option for "net.core.rmem_max" (taking the highest value defined to avoid conflicts between 2 services trying to set that value).
- The `mame` package does not ship with its tools anymore in the default output. They were moved to a separate `tools` output instead. For convenience, `mame-tools` package was added for those who want to use it.
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->

View file

@ -16,5 +16,10 @@ in
calamares-nixos-extensions
# Needed for calamares QML module packagechooserq
libsForQt5.full
# Get list of locales
glibcLocales
];
# Support choosing from any locale
i18n.supportedLocales = [ "all" ];
}

View file

@ -269,20 +269,5 @@ in
# To enable user switching, allow sddm to allocate TTYs/displays dynamically.
services.xserver.tty = null;
services.xserver.display = null;
systemd.tmpfiles.rules = [
# Prior to Qt 5.9.2, there is a QML cache invalidation bug which sometimes
# strikes new Plasma 5 releases. If the QML cache is not invalidated, SDDM
# will segfault without explanation. We really tore our hair out for awhile
# before finding the bug:
# https://bugreports.qt.io/browse/QTBUG-62302
# We work around the problem by deleting the QML cache before startup.
# This was supposedly fixed in Qt 5.9.2 however it has been reported with
# 5.10 and 5.11 as well. The initial workaround was to delete the directory
# in the Xsetup script but that doesn't do anything.
# Instead we use tmpfiles.d to ensure it gets wiped.
# This causes a small but perceptible delay when SDDM starts.
"e ${config.users.users.sddm.home}/.cache - - - 0"
];
};
}

View file

@ -138,6 +138,8 @@ let
fi
''}
export SYSTEMD_NSPAWN_UNIFIED_HIERARCHY=1
# Run systemd-nspawn without startup notification (we'll
# wait for the container systemd to signal readiness)
# Kill signal handling means systemd-nspawn will pass a system-halt signal

View file

@ -143,6 +143,7 @@ in {
containers-reloadable = handleTest ./containers-reloadable.nix {};
containers-restart_networking = handleTest ./containers-restart_networking.nix {};
containers-tmpfs = handleTest ./containers-tmpfs.nix {};
containers-unified-hierarchy = handleTest ./containers-unified-hierarchy.nix {};
convos = handleTest ./convos.nix {};
corerad = handleTest ./corerad.nix {};
coturn = handleTest ./coturn.nix {};

View file

@ -0,0 +1,21 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "containers-unified-hierarchy";
meta = {
maintainers = with lib.maintainers; [ farnoy ];
};
nodes.machine = { ... }: {
containers = {
test-container = {
autoStart = true;
config = { };
};
};
};
testScript = ''
machine.wait_for_unit("default.target")
machine.succeed("echo 'stat -fc %T /sys/fs/cgroup/ | grep cgroup2fs' | nixos-container root-login test-container")
'';
})

View file

@ -10,12 +10,12 @@
stdenv.mkDerivation rec {
pname = "flac";
version = "1.4.1";
version = "1.4.2";
src = fetchurl {
url = "http://downloads.xiph.org/releases/flac/${pname}-${version}.tar.xz";
# Official checksum is published at https://github.com/xiph/flac/releases/tag/${version}
sha256 = "91303c3e5dfde52c3e94e75976c0ab3ee14ced278ab8f60033a3a12db9209ae6";
sha256 = "sha256-4yLVih9I0j2d049DJnKGX2955zpvnMWl9X/KqD61qOQ=";
};
nativeBuildInputs = [
@ -43,6 +43,7 @@ stdenv.mkDerivation rec {
meta = with lib; {
homepage = "https://xiph.org/flac/";
description = "Library and tools for encoding and decoding the FLAC lossless audio file format";
changelog = "https://xiph.org/flac/changelog.html";
platforms = platforms.all;
license = licenses.bsd3;
maintainers = with maintainers; [ ruuda ];

View file

@ -18,17 +18,17 @@ let
archive_fmt = if stdenv.isDarwin then "zip" else "tar.gz";
sha256 = {
x86_64-linux = "1dcp6r78kaq3wzcw7dfra59kfpdzqy9qnlyp1ywayxh610ryjyfc";
x86_64-darwin = "0ypxjh5z0v83y0wb22m942qqlvx5df7k4dk8ip9wqd4p7h8540q8";
aarch64-linux = "1qq4zg0j3rpx06cqaic7a1x7ckk5wf8w1gp5y8hwhvkym4s8g4i7";
aarch64-darwin = "18hrsvr7hgmlpi64dbk581i516my6c5zwz6g8awp4fhxilk0wbrg";
armv7l-linux = "1y357ci4gllxg26m5qdv9652i5rra5vj972l7kdnxiimfgm6h83b";
x86_64-linux = "1m5mz6wdrivqrw699iivvh62bdn4yzm6hmph455sdyvk5icq59dq";
x86_64-darwin = "1zn0h9p05kb3fcn816fpxh8asaglycjmpiwkrmxd0s8jwjq7m4gn";
aarch64-linux = "1gs810iz08jxqfhcgi6ab41m46ib5h3m7i3pnyvlimxx99r5lirf";
aarch64-darwin = "1dvasr1h28snxi33m6yx95pp3jd4irwy6yav4ilwrcl22cf6ybvi";
armv7l-linux = "1j5vrpdaqihcr02pdsd5nz07zsk0027xmkfp30npnjy1gjrjvnim";
}.${system} or throwSystem;
in
callPackage ./generic.nix rec {
# Please backport all compatible updates to the stable release.
# This is important for the extension ecosystem.
version = "1.73.0";
version = "1.73.1";
pname = "vscode";
executableName = "code" + lib.optionalString isInsiders "-insiders";

View file

@ -53,6 +53,8 @@ stdenv.mkDerivation rec {
sha256 = "sha256-im6y/E0pQxruX2kNXZLE3fHq+zXfsstnOoC1QvH4fd4=";
};
outputs = [ "out" "tools" ];
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"CXX=${stdenv.cc.targetPrefix}c++"
@ -138,21 +140,33 @@ stdenv.mkDerivation rec {
runHook preInstall
make -f dist.mak PTR64=${lib.optionalString stdenv.is64bit "1"}
# mame
mkdir -p ${dest}
mv build/release/*/Release/mame/* ${dest}
mkdir -p $out/bin
find ${dest} -maxdepth 1 -executable -type f -exec mv -t $out/bin {} \;
install -Dm755 src/osd/sdl/taputil.sh $out/bin/taputil.sh
installManPage ${dest}/docs/man/*.1 ${dest}/docs/man/*.6
find ${dest} -maxdepth 1 -executable -type f -delete;
install -Dm755 mame -t $out/bin
install -Dm644 ${icon} $out/share/icons/hicolor/scalable/apps/mame.svg
installManPage ${dest}/docs/man/*.1 ${dest}/docs/man/*.6
mv artwork plugins samples ${dest}
# mame-tools
for _i in castool chdman floptool imgtool jedutil ldresample ldverify nltool nlwav pngcmp regrep romcmp \
split srcclean testkeys unidasm; do
install -Dm755 $_i -t $tools/bin
done
mv $tools/bin/{,mame-}split
runHook postInstall
'';
postFixup = ''
mkdir -p $tools/share/man
mv {$out,$tools}/share/man/man1
'';
enableParallelBuilding = true;
passthru.updateScript = writeScript "mame-update-script" ''

View file

@ -3,7 +3,7 @@
, fetchFromGitHub
, nix-update-script
, fetchpatch
, vala_0_54
, vala
, meson
, ninja
, pkg-config
@ -50,6 +50,11 @@ stdenv.mkDerivation rec {
url = "https://git.alpinelinux.org/aports/plain/community/tootle/0003-make-app-entries-private.patch?id=c973e68e3cba855f1601ef010afa9a14578b9499";
sha256 = "sha256-zwU0nxf/haBZl4tOYDmMzwug+HC6lLDT8/12Wt62+S4=";
})
# https://github.com/flathub/com.github.bleakgrey.tootle/pull/22
(fetchpatch {
url = "https://github.com/flathub/com.github.bleakgrey.tootle/raw/6b524dc13143e4827f67628e33dcf161d862af29/Fix-construct-prop.patch";
sha256 = "sha256-zOIMy9+rY2aRcPHcGWU/x6kf/xb7VnuHdsKQ0FO1Cyc=";
})
];
nativeBuildInputs = [
@ -57,11 +62,7 @@ stdenv.mkDerivation rec {
ninja
pkg-config
python3
# Does not build with Vala 0.56.1:
# ../src/Widgets/Status.vala:8.43-8.56: error: construct
# properties not supported for specified property type
# public API.NotificationType? kind { get; construct set; }
vala_0_54
vala
wrapGAppsHook
];
@ -93,6 +94,6 @@ stdenv.mkDerivation rec {
homepage = "https://github.com/bleakgrey/tootle";
license = licenses.gpl3;
maintainers = with maintainers; [ dtzWill ];
broken = true;
platforms = platforms.linux;
};
}

View file

@ -375,13 +375,13 @@
"version": "0.41.0"
},
"external": {
"hash": "sha256-gImRxsDUgBHmw/5DeKcO9BzB906JB8dUcSGKQj+Vcy0=",
"hash": "sha256-o9vCr3ayqg9Ehi39FgR6vJFZYF1iTcVD4QfYHcs+YbQ=",
"owner": "hashicorp",
"provider-source-address": "registry.terraform.io/hashicorp/external",
"repo": "terraform-provider-external",
"rev": "v2.2.2",
"vendorHash": "sha256-1BUFg8epcEsCf6yyJr4E4CdX2o6/3R384opRTxwrsng=",
"version": "2.2.2"
"rev": "v2.2.3",
"vendorHash": "sha256-0t+2ixMSsgDK9zzst3s0YWdnS6p7jO0stHnaKio5lvY=",
"version": "2.2.3"
},
"fastly": {
"hash": "sha256-WxFkJBi87IvO4a/8bmftMKCc/JcfoQILCtklvr9bcuc=",
@ -487,13 +487,13 @@
"version": "1.16.2"
},
"hcloud": {
"hash": "sha256-DWDM3yWKkRV9FJMzKK7JJQdI0WvFILF/bsZFv2CjrvM=",
"hash": "sha256-d/qLN5ev8ywiJr97rrlS9rwfvsEheBD2n8I6D9a7krQ=",
"owner": "hetznercloud",
"provider-source-address": "registry.terraform.io/hetznercloud/hcloud",
"repo": "terraform-provider-hcloud",
"rev": "v1.35.2",
"vendorHash": "sha256-LKngOmB3jfC/wFX398LETSZ8HllfOQA/kGg4uUNlN5A=",
"version": "1.35.2"
"rev": "v1.36.0",
"vendorHash": "sha256-HsWkHoFs/77b5+6HSV7YgLOwpE2BZyxbGNty8p+OBSM=",
"version": "1.36.0"
},
"helm": {
"hash": "sha256-s8ZOzTG3qux+4Yh1wj3ArjB1uJ32bdGhxY9iSL5LOK8=",
@ -623,13 +623,13 @@
"version": "4.0.1"
},
"ksyun": {
"hash": "sha256-62ylxBt5F3J2n7BW8qD5ukE8OJa63E6Qyuuf8dPo9FQ=",
"hash": "sha256-Rye7gKARdbrB6KDEygEJy9m7VqlGw6QeE2F1oa3n8as=",
"owner": "kingsoftcloud",
"provider-source-address": "registry.terraform.io/kingsoftcloud/ksyun",
"repo": "terraform-provider-ksyun",
"rev": "v1.3.57",
"rev": "v1.3.58",
"vendorHash": "sha256-miHKAz+ONXtuC1DNukcyZbbaYReY69dz9Zk6cJdORdQ=",
"version": "1.3.57"
"version": "1.3.58"
},
"kubectl": {
"hash": "sha256-UkUwWi7Z9cSMyZakD6JxMl+qdczAYfZQgwroCUjFIUM=",
@ -795,13 +795,13 @@
"version": "1.4.19"
},
"ns1": {
"hash": "sha256-vw3n1EBKwOThoJ+2hFa4rsMzvWCOnhoYOmJpX8LQKy8=",
"hash": "sha256-qHR3KJa1y10B+iQPgH6lTt/JUqTmiK/60rPCa3gQDP8=",
"owner": "ns1-terraform",
"provider-source-address": "registry.terraform.io/ns1-terraform/ns1",
"repo": "terraform-provider-ns1",
"rev": "v1.12.8",
"vendorHash": "sha256-MaJHCxvD9BM5G8wJbSo06+TIPvJTlXzQ+l9Kdbg0QQw=",
"version": "1.12.8"
"rev": "v1.13.0",
"vendorHash": "sha256-6ePPxdULuTzLdVzzr12BjLu/lBN+5yIUq8U8FVUw/PM=",
"version": "1.13.0"
},
"nsxt": {
"hash": "sha256-TOoRtCKdR1fBjk39dbMgBd7pDJGfjvkQAqfpJzWRwRg=",
@ -1120,13 +1120,13 @@
"version": "0.13.5"
},
"tencentcloud": {
"hash": "sha256-DvH8+Be2AVwsNoDrNlCG8/Uve2EKcuan3qUsJynreHw=",
"hash": "sha256-vVwfKzA6qK6VzRRlYPEqL1QPlpiruD8JZRL6oF/u62w=",
"owner": "tencentcloudstack",
"provider-source-address": "registry.terraform.io/tencentcloudstack/tencentcloud",
"repo": "terraform-provider-tencentcloud",
"rev": "v1.78.8",
"rev": "v1.78.9",
"vendorHash": null,
"version": "1.78.8"
"version": "1.78.9"
},
"tfe": {
"hash": "sha256-MDlRwB2iVi/Rv7/UtukI6mIDImz8Gnpm5Qv5R6EDpiU=",

View file

@ -1,7 +1,7 @@
{
"version": "1.11.13",
"desktopSrcHash": "E8jpv7cJf8qdR4I3n7id5hUysAiMVvwyqUqHzGnVUJE=",
"desktopYarnHash": "1scp9y2lmah3n20f1kpc9paspd3qgslg129diis7g11cz4h0wyi5",
"webSrcHash": "985nxLIOZvrUX11AJDXYRMwC76/aP9ruSCqL47c7ZRM=",
"webYarnHash": "0bmjg9qhd89bdnh398lp257mxdgdd88wj5g3fmc3cavyd6hmgzbn"
"version": "1.11.14",
"desktopSrcHash": "91WCtb+ylVz9gSqOHb5GuSC1YZjDS3M8gdFIZYVls3c=",
"desktopYarnHash": "1ng9fwpwxsw91bzgd2kb2pdq927rkjv5rrrkmszvn55bj6ry7sqi",
"webSrcHash": "ss7Pmjg205EE/V/xIV7nvfZFRyyJfuB8MDM9dCnPckQ=",
"webYarnHash": "1v6qlk58msam9dglal4jzcyqcsrspa6idsdb8acjnscdkj26bkps"
}

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "clingo";
version = "5.6.1";
version = "5.6.2";
src = fetchFromGitHub {
owner = "potassco";
repo = "clingo";
rev = "v${version}";
sha256 = "sha256-blr2GPa/ZwVfvot6wUcQmdN/mLEox6tjIWtr0geeoDI=";
sha256 = "sha256-2vOscD5jengY3z9gHoY9y9y6RLfdzUj7BNKLyppNRac=";
};
nativeBuildInputs = [ cmake ];

View file

@ -1,14 +1,18 @@
{ stdenv
, lib
, callPackage
, fetchFromGitHub
, fetchpatch
, makeWrapper
, cmake
, coreutils
, git
, davix
, ftgl
, gl2ps
, glew
, gnugrep
, gnused
, gsl
, lapack
, libX11
@ -20,14 +24,18 @@
, libxcrypt
, libxml2
, llvm_9
, lsof
, lz4
, xz
, man
, openblas
, openssl
, pcre
, nlohmann_json
, pkg-config
, procps
, python
, which
, xxHash
, zlib
, zstd
@ -36,6 +44,9 @@
, libjpeg
, libtiff
, libpng
, patchRcPathCsh
, patchRcPathFish
, patchRcPathPosix
, tbb
, Cocoa
, CoreSymbolication
@ -61,6 +72,10 @@ stdenv.mkDerivation rec {
pname = "root";
version = "6.26.08";
passthru = {
tests = import ./tests { inherit callPackage; };
};
src = fetchFromGitHub {
owner = "root-project";
repo = "root";
@ -93,6 +108,9 @@ stdenv.mkDerivation rec {
libtiff
libpng
nlohmann_json
patchRcPathCsh
patchRcPathFish
patchRcPathPosix
python.pkgs.numpy
tbb
]
@ -195,6 +213,45 @@ stdenv.mkDerivation rec {
--set PYTHONPATH "$out/lib" \
--set ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH "$out/lib"
done
# Make ldd and sed available to the ROOT executable
wrapProgram "$out/bin/root" --prefix PATH : "${lib.makeBinPath [
gnused # sed
stdenv.cc # c++ ld etc.
stdenv.cc.libc # ldd
]}"
# Patch thisroot.{sh,csh,fish}
# The main target of `thisroot.sh` is "bash-like shells",
# but it also need to support Bash-less POSIX shell like dash,
# as they are mentioned in `thisroot.sh`.
# `thisroot.sh` would include commands `lsof` and `procps` since ROOT 6.28.
# See https://github.com/root-project/root/pull/10332
patchRcPathPosix "$out/bin/thisroot.sh" "${lib.makeBinPath [
coreutils # dirname tail
gnugrep # grep
gnused # sed
lsof # lsof # for ROOT (>=6.28)
man # manpath
procps # ps # for ROOT (>=6.28)
which # which
]}"
patchRcPathCsh "$out/bin/thisroot.csh" "${lib.makeBinPath [
coreutils
gnugrep
gnused
lsof # lsof # for ROOT (>=6.28)
man
which
]}"
patchRcPathFish "$out/bin/thisroot.fish" "${lib.makeBinPath [
coreutils
man
which
]}"
'';
setupHook = ./setup-hook.sh;

View file

@ -0,0 +1,4 @@
{ callPackage }:
{
test-thisroot = callPackage ./test-thisroot.nix { };
}

View file

@ -0,0 +1,49 @@
{ lib
, runCommand
, root
, bash
, fish
, ksh
, tcsh
, zsh
}: runCommand "test-thisroot"
{
meta = with lib; {
description = "Test for root thisroot.* sourcing";
maintainers = unique ((with maintainers; [ ShamrockLee ]) ++ root.meta.maintainers);
};
}
''
set -eu -o pipefail
declare -a shellNameArray shellOutpathArray sourcefileNameArray sourceCommandArray
shellNameArray=( bash zsh tcsh fish )
shellOutpathArray=( "${bash}" "${zsh}" "${tcsh}" "${fish}")
sourcefileNameArray=( thisroot.sh thisroot.sh thisroot.csh thisroot.fish )
sourceCommandArray=( "source" "source" "source" "source" )
debugFlagstrArray=( "-e" "-e" "-e" "" )
nShellToTest="''${#shellNameArray[@]}"
if [[ "''${#shellOutpathArray[@]}" -ne "$nShellToTest" ]] \
|| [[ "''${#sourcefileNameArray[@]}" -ne "$nShellToTest" ]] \
|| [[ "''${#sourceCommandArray[@]}" -ne "$nShellToTest" ]] \
|| [[ "''${#debugFlagstrArray[@]}" -ne "$nShellToTest" ]]
then
echo "error: Lengths of test parameter arrays doesn't match." >&2
exit 1
fi
typePExpect="${root}/bin/root"
for ((i=0; i<$nShellToTest; ++i)); do
tryCommand="''${sourceCommandArray[$i]} \"${root}/bin/''${sourcefileNameArray[$i]}\""
echo "Testing ''${shellNameArray[$i]} $tryCommand"
# Home directory for Fish
HOME_TEMP="$(mktemp -d temporary_home_XXXXXX)"
binPATHGot="$(PATH="''${shellOutpathArray[$i]}/bin" HOME=$HOME_TEMP "''${shellNameArray[$i]}" ''${debugFlagstrArray[$i]} -c "$tryCommand && echo \"\$PATH\"")"
rm -r "$HOME_TEMP"
typePGot="$(PATH="$binPATHGot" type -p root)"
if [[ "$typePGot" != "$typePExpect" ]]; then
echo "error: Got PATH \"$binPATHGot\", in which the root executable path is \"$typePGot\". Expect root executable path \"$typePExpect\"." >&2
exit 1
fi
done
echo "test-thisroot pass!"
touch "$out"
''

View file

@ -0,0 +1,31 @@
{ capnproto
, lib
, fetchFromGitHub
, protobuf
, rustPlatform
}:
rustPlatform.buildRustPackage rec {
pname = "conmon-rs";
version = "0.4.0";
src = fetchFromGitHub {
owner = "containers";
repo = pname;
rev = "v${version}";
sha256 = "sha256-VwVJWf9tKZ5rVF8tXDf35zsS2PipqC8FPbXUpOzsw/Y=";
};
nativeBuildInputs = [ capnproto protobuf ];
doCheck = false;
cargoSha256 = "sha256-zY9fsZK1C3HnCxeNA5dCbQQHYx3IVDMHCHYwFh5ev2k=";
meta = with lib; {
description = "An OCI container runtime monitor written in Rust";
homepage = "https://github.com/containers/conmon-rs";
license = licenses.asl20;
maintainers = with maintainers; [ ] ++ teams.podman.members;
platforms = platforms.linux;
};
}

View file

@ -2,16 +2,16 @@
rustPlatform.buildRustPackage rec {
pname = "nixpacks";
version = "0.12.3";
version = "0.13.0";
src = fetchFromGitHub {
owner = "railwayapp";
repo = pname;
rev = "v${version}";
sha256 = "sha256-Hy2QRGuXSidUrJ7kb1AhkaLeaevhhleGE8QvnNZf/L0=";
sha256 = "sha256-uxy0/Ngzzh96YZDR9whLVYNnQOlj3wkCEuuJTQjT6GE=";
};
cargoSha256 = "sha256-5EJGUi74hrd3vifJ3r2vO0Qq2YEt0stXSi+RAGTme2I=";
cargoSha256 = "sha256-99J4ucjE0yTPQSdM6PDTWEjBltJdIU6yEDqhgSfOaJU=";
# skip test due FHS dependency
doCheck = false;

View file

@ -219,6 +219,12 @@ fi
PATH="$path_backup"
# Old bash workaround, see above.
# if a cc-wrapper-hook exists, run it.
if [[ -e @out@/nix-support/cc-wrapper-hook ]]; then
compiler=@prog@
source @out@/nix-support/cc-wrapper-hook
fi
if (( "${NIX_CC_USE_RESPONSE_FILE:-@use_response_file_by_default@}" >= 1 )); then
exec @prog@ @<(printf "%q\n" \
${extraBefore+"${extraBefore[@]}"} \

View file

@ -27,7 +27,7 @@ cargoSetupPostUnpackHook() {
cat ${tmp_config} >> .cargo/config
cat >> .cargo/config <<'EOF'
@rustTarget@
@cargoConfig@
EOF
echo "Finished cargoSetupPostUnpackHook"

View file

@ -68,15 +68,37 @@ in {
# The `.nativeDrv` stanza works like nativeBuildInputs and ensures cross-compiling has the right version available.
diff = "${diffutils.nativeDrv or diffutils}/bin/diff";
# Target platform
rustTarget = ''
[target."${rust.toRustTarget stdenv.buildPlatform}"]
# We want to specify the correct crt-static flag for both
# the build and host platforms. This is important when the wanted
# value for crt-static does not match the defaults in the rustc target,
# like for pkgsMusl or pkgsCross.musl64; Upstream rustc still assumes
# that musl = static[1].
#
# By default, Cargo doesn't apply RUSTFLAGS when building build.rs
# if --target is passed, so the only good way to set crt-static for
# build.rs files is to use the unstable -Zhost-config Cargo feature.
# This allows us to specify flags that should be passed to rustc
# when building for the build platform. We also need to use
# -Ztarget-applies-to-host, because using -Zhost-config requires it.
#
# When doing this, we also have to specify the linker, or cargo
# won't pass a -C linker= argument to rustc. This will make rustc
# try to use its default value of "cc", which won't be available
# when cross-compiling.
#
# [1]: https://github.com/rust-lang/compiler-team/issues/422
cargoConfig = ''
[host]
"linker" = "${ccForBuild}"
${lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) ''
[target."${shortTarget}"]
"linker" = "${ccForHost}"
''}
"rustflags" = [ "-C", "target-feature=${if stdenv.buildPlatform.isStatic then "+" else "-"}crt-static" ]
[target."${shortTarget}"]
"linker" = "${ccForHost}"
"rustflags" = [ "-C", "target-feature=${if stdenv.hostPlatform.isStatic then "+" else "-"}crt-static" ]
[unstable]
host-config = true
target-applies-to-host = true
'';
};
} ./cargo-setup-hook.sh) {};

View file

@ -0,0 +1,60 @@
{ lib
, callPackage
, makeSetupHook
, gnused
}:
let
tests = import ./test { inherit callPackage; };
in
{
patchRcPathBash = makeSetupHook
{
name = "patch-rc-path-bash";
meta = with lib; {
description = "Setup-hook to inject source-time PATH prefix to a Bash/Ksh/Zsh script";
maintainers = with maintainers; [ ShamrockLee ];
};
passthru.tests = {
inherit (tests) test-bash;
};
} ./patch-rc-path-bash.sh;
patchRcPathCsh = makeSetupHook
{
name = "patch-rc-path-csh";
substitutions = {
sed = "${gnused}/bin/sed";
};
meta = with lib; {
description = "Setup-hook to inject source-time PATH prefix to a Csh script";
maintainers = with maintainers; [ ShamrockLee ];
};
passthru.tests = {
inherit (tests) test-csh;
};
} ./patch-rc-path-csh.sh;
patchRcPathFish = makeSetupHook
{
name = "patch-rc-path-fish";
meta = with lib; {
description = "Setup-hook to inject source-time PATH prefix to a Fish script";
maintainers = with maintainers; [ ShamrockLee ];
};
passthru.tests = {
inherit (tests) test-fish;
};
} ./patch-rc-path-fish.sh;
patchRcPathPosix = makeSetupHook
{
name = "patch-rc-path-posix";
substitutions = {
sed = "${gnused}/bin/sed";
};
meta = with lib; {
description = "Setup-hook to inject source-time PATH prefix to a POSIX shell script";
maintainers = with maintainers; [ ShamrockLee ];
};
passthru.tests = {
inherit (tests) test-posix;
};
} ./patch-rc-path-posix.sh;
}

View file

@ -0,0 +1,50 @@
patchRcPathBash(){
local FILE_TO_PATCH="$1"
local SOURCETIME_PATH="$2"
local FILE_TO_WORK_ON="$(mktemp "$(basename "$FILE_TO_PATCH").XXXXXX.tmp")"
cat <<EOF >> "$FILE_TO_WORK_ON"
# Lines to add to PATH the source-time utilities for Nixpkgs packaging
if [[ -n "\${NIXPKGS_SOURCETIME_PATH-}" ]]; then
NIXPKGS_SOURCETIME_PATH_OLD="\$NIXPKGS_SOURCETIME_PATH;\${NIXPKGS_SOURCETIME_PATH_OLD-}"
fi
NIXPKGS_SOURCETIME_PATH="$SOURCETIME_PATH"
if [[ -n "\$PATH" ]]; then
PATH="\$NIXPKGS_SOURCETIME_PATH:\$PATH"
else
PATH="\$NIXPKGS_SOURCETIME_PATH"
fi
export PATH
# End of lines to add to PATH source-time utilities for Nixpkgs packaging
EOF
cat "$FILE_TO_PATCH" >> "$FILE_TO_WORK_ON"
cat <<EOF >> "$FILE_TO_WORK_ON"
# Lines to clean up inside PATH the source-time utilities for Nixpkgs packaging
if [[ -n "\${PATH-}" ]]; then
# Remove the inserted section
PATH="\${PATH/\$NIXPKGS_SOURCETIME_PATH}"
# Remove the duplicated colons
PATH="\${PATH//::/:}"
# Remove the prefixing colon
if [[ -n "\$PATH" && "\${PATH:0:1}" == ":" ]]; then
PATH="\${PATH:1}"
fi
# Remove the trailing colon
if [[ -n "\$PATH" && "\${PATH:\${#PATH}-1}" == ":" ]]; then
PATH="\${PATH::}"
fi
export PATH
fi
if [[ -n "\${NIXPKGS_SOURCETIME_PATH_OLD-}" ]]; then
IFS="" read -r -d ";" NIXPKGS_SOURCETIME_PATH <<< "\$NIXPKGS_SOURCETIME_PATH_OLD"
NIXPKGS_SOURCETIME_PATH_OLD="\${NIXPKGS_SOURCETIME_PATH_OLD:\${#NIXPKGS_SOURCETIME_PATH}+1}"
else
unset NIXPKGS_SOURCETIME_PATH
fi
if [[ -z "\${NIXPKGS_SOURCETIME_PATH_OLD-}" ]]; then
unset NIXPKGS_SOURCETIME_PATH_OLD
fi
# End of lines to clean up inside PATH the source-time utilities for Nixpkgs packaging
EOF
cat "$FILE_TO_WORK_ON" > "$FILE_TO_PATCH"
rm "$FILE_TO_WORK_ON"
}

View file

@ -0,0 +1,57 @@
patchRcPathCsh(){
local FILE_TO_PATCH="$1"
local SOURCETIME_PATH="$2"
local FILE_TO_WORK_ON="$(mktemp "$(basename "$FILE_TO_PATCH").XXXXXX.tmp")"
cat <<EOF >> "$FILE_TO_WORK_ON"
# Lines to add to PATH the source-time utilities for Nixpkgs packaging
if (\$?NIXPKGS_SOURCETIME_PATH) then
if ("\$NIXPKGS_SOURCETIME_PATH" != "") then
if (\$?NIXPKGS_SOURCETIME_PATH_OLD) then
if ("\$NIXPKGS_SOURCETIME_PATH_OLD" != "")
set NIXPKGS_SOURCETIME_PATH_OLD = (\$NIXPKGS_SOURCETIME_PATH \$NIXPKGS_SOURCETIME_PATH_OLD)
else
set NIXPKGS_SOURCETIME_PATH_OLD = \$NIXPKGS_SOURCETIME_PATH
endif
else
set NIXPKGS_SOURCETIME_PATH_OLD = \$NIXPKGS_SOURCETIME_PATH
endif
endif
endif
set NIXPKGS_SOURCETIME_PATH = "$SOURCETIME_PATH"
if (! \$?PATH) then
setenv PATH ""
endif
if ("\$PATH" != "") then
setenv PATH "\${NIXPKGS_SOURCETIME_PATH}:\$PATH"
else
setenv PATH "\$NIXPKGS_SOURCETIME_PATH"
endif
# End of lines to add to PATH source-time utilities for Nixpkgs packaging
EOF
cat "$FILE_TO_PATCH" >> "$FILE_TO_WORK_ON"
cat <<EOF >> "$FILE_TO_WORK_ON"
# Lines to clean up inside PATH the source-time utilities for Nixpkgs packaging
if (\$?PATH) then
if ("\$PATH" != "") then
# Remove the inserted section, the duplicated colons, and the leading and trailing colon
setenv PATH \`echo "\$PATH" | @sed@ "s#\${NIXPKGS_SOURCETIME_PATH}##" | @sed@ "s#::#:#g" | @sed@ "s#^:##" | @sed@ 's#:\$##'\`
endif
endif
if (\$?NIXPKGS_SOURCETIME_PATH_OLD) then
if ("\$NIXPKGS_SOURCETIME_PATH_OLD" != "") then
set NIXPKGS_SOURCETIME_PATH = \$NIXPKGS_SOURCETIME_PATH_OLD[1]
set NIXPKGS_SOURCETIME_PATH_OLD = \$NIXPKGS_SOURCETIME_PATH_OLD[2-]
else
unset NIXPKGS_SOURCETIME_PATH
endif
if (NIXPKGS_SOURCETIME_PATH_OLD == "") then
unset NIXPKGS_SOURCETIME_PATH_OLD
endif
else
unset NIXPKGS_SOURCETIME_PATH
endif
# End of lines to clean up inside PATH the source-time utilities for Nixpkgs packaging
EOF
cat "$FILE_TO_WORK_ON" > "$FILE_TO_PATCH"
rm "$FILE_TO_WORK_ON"
}

View file

@ -0,0 +1,50 @@
patchRcPathFish(){
local FILE_TO_PATCH="$1"
local SOURCETIME_PATH="$2"
local FILE_TO_WORK_ON="$(mktemp "$(basename "$FILE_TO_PATCH").XXXXXX.tmp")"
cat <<EOF >> "$FILE_TO_WORK_ON"
# Lines to add to PATH the source-time utilities for Nixpkgs packaging
if set -q NIXPKGS_SOURCETIME_PATH && test (count \$NIXPKGS_SOURCETIME_PATH) -gt 0
set --unpath NIXPKGS_SOURCETIME_PATH_OLD "\$NIXPKGS_SOURCETIME_PATH" \$NIXPKGS_SOURCETIME_PATH_OLD
end
set --path NIXPKGS_SOURCETIME_PATH $SOURCETIME_PATH
set -g --path PATH \$NIXPKGS_SOURCETIME_PATH \$PATH
# End of lines to add to PATH source-time utilities for Nixpkgs packaging
EOF
cat "$FILE_TO_PATCH" >> "$FILE_TO_WORK_ON"
cat <<EOF >> "$FILE_TO_WORK_ON"
# Lines to clean up inside PATH the source-time utilities for Nixpkgs packaging
if set -q PATH && test "\$PATH" != "" && test (count \$PATH) -ge (count \$NIXPKGS_SOURCETIME_PATH)
# Remove the inserted section
for i in (seq 0 (math (count \$PATH) - (count \$NIXPKGS_SOURCETIME_PATH)))
for j in (seq 1 (count \$NIXPKGS_SOURCETIME_PATH))
if test \$PATH[(math \$i + \$j)] != \$NIXPKGS_SOURCETIME_PATH[\$j]
set i -1
break
end
end
if test \$i -eq -1
continue
end
if test \$i -eq 0
set -g --path PATH \$PATH[(math (count \$NIXPKGS_SOURCETIME_PATH) + 1)..]
else
set -g --path PATH \$PATH[..\$i] \$PATH[(math (count \$NIXPKGS_SOURCETIME_PATH) + 1 + \$i)..]
end
break
end
end
if set -q NIXPKGS_SOURCETIME_PATH_OLD && test (count \$NIXPKGS_SOURCETIME_PATH_OLD) -gt 0
set --path NIXPKGS_SOURCETIME_PATH \$NIXPKGS_SOURCETIME_PATH_OLD[1]
set --unpath NIXPKGS_SOURCETIME_PATH_OLD \$NIXPKGS_SOURCETIME_PATH_OLD[2..]
else
set -e NIXPKGS_SOURCETIME_PATH
end
if set -q NIXPKGS_SOURCETIME_PATH_OLD && test (count \$NIXPKGS_SOURCETIME_PATH_OLD) -eq 0
set -e NIXPKGS_SOURCETIME_PATH_OLD
end
# End of lines to clean up inside PATH the source-time utilities for Nixpkgs packaging
EOF
cat "$FILE_TO_WORK_ON" > "$FILE_TO_PATCH"
rm "$FILE_TO_WORK_ON"
}

View file

@ -0,0 +1,39 @@
patchRcPathPosix(){
local FILE_TO_PATCH="$1"
local SOURCETIME_PATH="$2"
local FILE_TO_WORK_ON="$(mktemp "$(basename "$FILE_TO_PATCH").XXXXXX.tmp")"
cat <<EOF >> "$FILE_TO_WORK_ON"
# Lines to add to PATH the source-time utilities for Nixpkgs packaging
if [ -n "\${NIXPKGS_SOURCETIME_PATH-}" ]; then
NIXPKGS_SOURCETIME_PATH_OLD="\$NIXPKGS_SOURCETIME_PATH;\${NIXPKGS_SOURCETIME_PATH_OLD-}"
fi
NIXPKGS_SOURCETIME_PATH="$SOURCETIME_PATH"
if [ -n "\$PATH" ]; then
PATH="\$NIXPKGS_SOURCETIME_PATH:\$PATH";
else
PATH="\$NIXPKGS_SOURCETIME_PATH"
fi
export PATH
# End of lines to add to PATH source-time utilities for Nixpkgs packaging
EOF
cat "$FILE_TO_PATCH" >> "$FILE_TO_WORK_ON"
cat <<EOF >> "$FILE_TO_WORK_ON"
# Lines to clean up inside PATH the source-time utilities for Nixpkgs packaging
if [ -n "\${PATH-}" ]; then
PATH="\$(echo "\$PATH" | @sed@ "s#\$NIXPKGS_SOURCETIME_PATH##" | @sed@ "s#::#:#g" | @sed@ "s#^:##" | @sed@ "s#:\\\$##")"
export PATH
fi
if [ -n "\${NIXPKGS_SOURCETIME_PATH_OLD-}" ]; then
NIXPKGS_SOURCETIME_PATH="\$(echo "\$NIXPKGS_SOURCETIME_PATH_OLD" | @sed@ "s#\\([^;]\\);.*#\\1#")"
NIXPKGS_SOURCETIME_PATH_OLD="\$(echo "\$NIXPKGS_SOURCETIME_PATH_OLD" | @sed@ "s#[^;];\\(.*\\)#\\1#")"
else
unset NIXPKGS_SOURCETIME_PATH
fi
if [ -z "\${NIXPKGS_SOURCETIME_PATH_OLD-}" ]; then
unset NIXPKGS_SOURCETIME_PATH_OLD
fi
# End of lines to clean up inside PATH the source-time utilities for Nixpkgs packaging
EOF
cat "$FILE_TO_WORK_ON" > "$FILE_TO_PATCH"
rm "$FILE_TO_WORK_ON"
}

View file

@ -0,0 +1,442 @@
{ callPackage }:
{
test-bash = callPackage
(
{ lib
, runCommandLocal
, bash
, hello
, ksh
, patchRcPathBash
, shellcheck
, zsh
}:
runCommandLocal "patch-rc-path-bash-test"
{
nativeBuildInputs = [
bash
ksh
patchRcPathBash
shellcheck
zsh
];
meta = {
description = "Package test of patchActivateBash";
inherit (patchRcPathBash.meta) maintainers;
};
}
''
set -eu -o pipefail
# Check the setup hook script
echo "Running shellcheck against ${./test-sourcing-bash}"
shellcheck -s bash --exclude SC1090 ${./test-sourcing-bash}
shellcheck -s ksh --exclude SC1090 ${./test-sourcing-bash}
# Test patching a blank file
echo > blank.bash
echo "Generating blank_patched.bash from blank.bash"
cp blank.bash blank_patched.bash
patchRcPathBash blank_patched.bash "$PWD/delta:$PWD/foxtrot"
echo "Running shellcheck against blank_patched.bash"
shellcheck -s bash blank_patched.bash
shellcheck -s ksh blank_patched.bash
echo "Testing in Bash if blank.bash and blank_patched.bash modifies PATH the same way"
bash ${./test-sourcing-bash} ./blank.bash ./blank_patched.bash
echo "Testing in Ksh if blank.bash and blank_patched.bash modifies PATH the same way"
ksh ${./test-sourcing-bash} "$PWD/blank.bash" "$PWD/blank_patched.bash"
echo "Testing in Zsh if blank.bash and blank_patched.bash modifies PATH the same way"
zsh ${./test-sourcing-bash} ./blank.bash ./blank_patched.bash
# Test patching silent_hello
echo "hello > /dev/null" > silent_hello.bash
echo "Generating silent_hello_patched.bash from silent_hello.bash"
cp silent_hello.bash silent_hello_patched.bash
patchRcPathBash silent_hello_patched.bash "${hello}/bin"
echo "Running shellcheck against silent_hello_patched.bash"
shellcheck -s bash silent_hello_patched.bash
echo "Testing in Bash if silent_hello_patched.bash get sourced without error"
bash -eu -o pipefail -c ". ./silent_hello_patched.bash"
echo "Testing in Ksh if silent_hello_patched.bash get sourced without error"
ksh -eu -o pipefail -c ". ./silent_hello_patched.bash"
echo "Testing in Zsh if silent_hello_patched.bash get sourced without error"
zsh -eu -o pipefail -c ". ./silent_hello_patched.bash"
# Check the sample source
echo "Running shellcheck against sample_source.bash"
shellcheck -s bash ${./sample_source.bash}
shellcheck -s ksh ${./sample_source.bash}
# Test patching the sample source
cp ${./sample_source.bash} sample_source_patched.bash
chmod u+w sample_source_patched.bash
echo "Generating sample_source_patched.bash from ./sample_source.bash"
patchRcPathBash sample_source_patched.bash "$PWD/delta:$PWD/foxtrot"
echo "Running shellcheck against sample_source_patched.bash"
shellcheck -s bash sample_source_patched.bash
echo "Testing in Bash if sample_source.bash and sample_source_patched.bash modifies PATH the same way"
bash ${./test-sourcing-bash} ${./sample_source.bash} ./sample_source_patched.bash
echo "Testing in Ksh if sample_source.bash and sample_source_patched.bash modifies PATH the same way"
ksh ${./test-sourcing-bash} ${./sample_source.bash} "$PWD/sample_source_patched.bash"
echo "Testing in Zsh if sample_source.bash and sample_source_patched.bash modifies PATH the same way"
zsh ${./test-sourcing-bash} ${./sample_source.bash} ./sample_source_patched.bash
# Test double-patching the sample source
echo "Patching again sample_source_patched.bash"
patchRcPathBash sample_source_patched.bash "$PWD/foxtrot:$PWD/golf"
echo "Running shellcheck against sample_source_patched.bash"
shellcheck -s bash sample_source_patched.bash
shellcheck -s ksh sample_source_patched.bash
echo "Testing in Bash if sample_source.bash and sample_source_patched.bash modifies PATH the same way"
bash ${./test-sourcing-bash} ${./sample_source.bash} ./sample_source_patched.bash
echo "Testing in Ksh if sample_source.bash and sample_source_patched.bash modifies PATH the same way"
ksh ${./test-sourcing-bash} ${./sample_source.bash} "$PWD/sample_source_patched.bash"
echo "Testing in Zsh if sample_source.bash and sample_source_patched.bash modifies PATH the same way"
zsh ${./test-sourcing-bash} ${./sample_source.bash} ./sample_source_patched.bash
# Create a dummy output
touch "$out"
''
)
{ };
test-csh = callPackage
(
{ lib
, runCommandLocal
, gnused
, hello
, patchRcPathCsh
, tcsh
}:
runCommandLocal "patch-rc-path-csh-test"
{
nativeBuildInputs = [
patchRcPathCsh
tcsh
];
meta = {
description = "Package test of patchActivateCsh";
inherit (patchRcPathCsh.meta) maintainers;
};
}
''
set -eu -o pipefail
# Test patching a blank file
echo > blank.csh
echo "Generating blank_patched.csh from blank.csh"
cp blank.csh blank_patched.csh
patchRcPathCsh blank_patched.csh "$PWD/delta:$PWD/foxtrot"
echo "Testing in Csh if blank.csh and blank_patched.csh modifies PATH the same way"
tcsh -e ${./test-sourcing-csh} blank.csh blank_patched.csh
# Test patching silent_hello file
echo "hello > /dev/null" > silent_hello.csh
echo "Generating silent_hello_patched.csh from silent_hello.csh"
cp silent_hello.csh silent_hello_patched.csh
patchRcPathCsh silent_hello_patched.csh "${hello}/bin"
echo "Testing in Csh if silent_hello_patched.csh get sourced without errer"
tcsh -e -c "source silent_hello_patched.csh"
# Generate the sample source
substitute ${./sample_source.csh.in} sample_source.csh --replace @sed@ ${gnused}/bin/sed
chmod u+rw sample_source.csh
# Test patching the sample source
echo "Generating sample_source_patched.csh from sample_source.csh"
cp sample_source.csh sample_source_patched.csh
chmod u+w sample_source_patched.csh
patchRcPathCsh sample_source_patched.csh "$PWD/delta:$PWD/foxtrot"
echo "Testing in Csh if sample_source.csh and sample_source_patched.csh modifies PATH the same way"
tcsh -e ${./test-sourcing-csh} sample_source.csh sample_source_patched.csh
# Test double-patching the sample source
echo "Patching again sample_source_patched.csh from sample_source.csh"
patchRcPathCsh sample_source_patched.csh "$PWD/foxtrot:$PWD/golf"
echo "Testing in Csh if sample_source.csh and sample_source_patched.csh modifies PATH the same way"
tcsh -e ${./test-sourcing-csh} sample_source.csh sample_source_patched.csh
# Create a dummy output
touch "$out"
''
)
{ };
test-fish = callPackage
(
{ lib
, runCommandLocal
, fish
, hello
, patchRcPathFish
}:
runCommandLocal "patch-rc-path-fish-test"
{
nativeBuildInputs = [
fish
patchRcPathFish
];
meta = {
description = "Package test of patchActivateFish";
inherit (patchRcPathFish.meta) maintainers;
};
}
''
set -eu -o pipefail
# Test patching a blank file
echo > blank.fish
echo "Generating blank_patched.fish from blank.fish"
cp blank.fish blank_patched.fish
patchRcPathFish blank_patched.fish "$PWD/delta:$PWD/foxtrot"
echo "Testing in Fish if blank.fish and blank_patched.fish modifies PATH the same way"
HOME_TEMP="$(mktemp -d temporary_home_XXXXXX)"
HOME="$HOME_TEMP" fish ${./test-sourcing-fish} blank.fish blank_patched.fish
rm -r "$HOME_TEMP"
# Test patching silent_hello file
echo "hello > /dev/null" > silent_hello.fish
echo "Generating silent_hello_patched.fish from silent_hello.fish"
cp silent_hello.fish silent_hello_patched.fish
patchRcPathFish silent_hello_patched.fish "${hello}/bin"
echo "Testing in Fish if silent_hello_patched.fish get sourced without error"
HOME_TEMP="$(mktemp -d temporary_home_XXXXXX)"
HOME="$HOME_TEMP" fish -c "source silent_hello_patched.fish"
rm -r "$HOME_TEMP"
# Test patching the sample source
cp ${./sample_source.fish} sample_source_patched.fish
chmod u+w sample_source_patched.fish
echo "Generating sample_source_patched.fish from ${./sample_source.fish}"
patchRcPathFish sample_source_patched.fish "$PWD/delta:$PWD/foxtrot"
echo "Testing in Fish if sample_source.fish and sample_source_patched.fish modifies PATH the same way"
HOME_TEMP="$(mktemp -d temporary_home_XXXXXX)"
HOME="$HOME_TEMP" fish ${./test-sourcing-fish} ${./sample_source.fish} sample_source_patched.fish
rm -r "$HOME_TEMP"
# Test double-patching the sample source
echo "Patching again sample_source_patched.fish from ${./sample_source.fish}"
patchRcPathFish sample_source_patched.fish "$PWD/foxtrot:$PWD/golf"
echo "Testing in Fish if sample_source.fish and sample_source_patched.fish modifies PATH the same way"
HOME_TEMP="$(mktemp -d temporary_home_XXXXXX)"
HOME="$HOME_TEMP" fish ${./test-sourcing-fish} ${./sample_source.fish} sample_source_patched.fish
rm -r "$HOME_TEMP"
# Create a dummy output
touch "$out"
''
)
{ };
test-posix = callPackage
(
{ lib
, runCommandLocal
, bash
, dash
, gnused
, hello
, ksh
, patchRcPathPosix
, shellcheck
}:
runCommandLocal "patch-rc-path-posix-test"
{
nativeBuildInputs = [
bash
dash
ksh
patchRcPathPosix
shellcheck
];
meta = {
description = "Package test of patchActivatePosix";
inherit (patchRcPathPosix.meta) maintainers;
};
}
''
set -eu -o pipefail
# Check the setup hook script
echo "Running shellcheck against ${./test-sourcing-posix}"
shellcheck -s sh --exclude SC1090 ${./test-sourcing-posix}
shellcheck -s dash --exclude SC1090 ${./test-sourcing-posix}
# Test patching a blank file
echo > blank.sh
echo "Generating blank_patched.sh from blank.sh"
cp blank.sh blank_patched.sh
patchRcPathPosix blank_patched.sh "$PWD/delta:$PWD/foxtrot"
echo "Running shellcheck against blank_patched.sh"
shellcheck -s sh blank_patched.sh
shellcheck -s dash blank_patched.sh
echo "Testing in Bash if blank.sh and blank_patched.sh modifies PATH the same way"
bash --posix ${./test-sourcing-posix} ./blank.sh ./blank_patched.sh
echo "Testing in Dash if blank.sh and blank_patched.sh modifies PATH the same way"
dash ${./test-sourcing-posix} ./blank.sh ./blank_patched.sh
echo "Testing in Ksh if ./blank.sh and ./blank_patched.sh modifies PATH the same way"
ksh ${./test-sourcing-posix} "$PWD/blank.sh" "$PWD/blank_patched.sh"
# Test patching silent_hello file
echo "hello > /dev/null" > silent_hello.sh
echo "Generating silent_hello_patched.sh from silent_hello.sh"
cp silent_hello.sh silent_hello_patched.sh
patchRcPathPosix silent_hello_patched.sh "${hello}/bin"
echo "Running shellcheck against silent_hello_patched.sh"
shellcheck -s sh silent_hello_patched.sh
shellcheck -s dash silent_hello_patched.sh
echo "Testing in Bash if silent_hello_patched.sh get sourced without error"
bash --posix -eu -c ". ./silent_hello_patched.sh"
echo "Testing in Dash if silent_hello_patched.sh get sourced without error"
dash -eu -c ". ./silent_hello_patched.sh"
echo "Testing in Ksh if silent_hello_patched.sh get sourced without error"
ksh -eu -c ". $PWD/silent_hello_patched.sh"
# Generate the sample source "$PWD/delta:$PWD/foxtrot" "$PWD/delta:$PWD/foxtrot"
substitute ${./sample_source.sh.in} sample_source.sh --replace @sed@ ${gnused}/bin/sed
chmod u+rw sample_source.sh
# Check the sample source
echo "Running shellcheck against sample_source.sh"
shellcheck -s sh sample_source.sh
shellcheck -s dash sample_source.sh
# Test patching the sample source
echo "Generating sample_source_patched.sh from sample_source.sh"
cp sample_source.sh sample_source_patched.sh
chmod u+w sample_source_patched.sh
patchRcPathPosix sample_source_patched.sh "$PWD/delta:$PWD/foxtrot"
echo "Running shellcheck against sample_source_patched.sh"
shellcheck -s sh sample_source_patched.sh
shellcheck -s dash sample_source_patched.sh
echo "Testing in Bash if sample_source.bash and sample_source_patched.bash modifies PATH the same way"
bash --posix ${./test-sourcing-posix} "./sample_source.sh" "./sample_source_patched.sh"
echo "Testing in Dash if sample_source.sh and sample_source_patched.sh modifies PATH the same way"
dash ${./test-sourcing-posix} "./sample_source.sh" "./sample_source_patched.sh"
echo "Testing in Ksh if sample_source.sh and sample_source_patched.sh modifies PATH the same way"
ksh ${./test-sourcing-posix} "$PWD/sample_source.sh" "$PWD/sample_source_patched.sh"
# Test double-patching the sample source
echo "Patching again sample_source_patched.sh"
patchRcPathPosix sample_source_patched.sh "$PWD/foxtrot:$PWD/golf"
echo "Running shellcheck against sample_source_patched.sh"
shellcheck -s sh sample_source_patched.sh
shellcheck -s dash sample_source_patched.sh
echo "Testing in Bash if sample_source.bash and sample_source_patched.bash modifies PATH the same way"
bash --posix ${./test-sourcing-posix} "./sample_source.sh" "./sample_source_patched.sh"
echo "Testing in Dash if sample_source.sh and sample_source_patched.sh modifies PATH the same way"
dash ${./test-sourcing-posix} "./sample_source.sh" "./sample_source_patched.sh"
echo "Testing in Ksh if sample_source.sh and sample_source_patched.sh modifies PATH the same way"
ksh ${./test-sourcing-posix} "$PWD/sample_source.sh" "$PWD/sample_source_patched.sh"
# Create a dummy output
touch "$out"
''
)
{ };
}

View file

@ -0,0 +1,2 @@
PATH="$PWD/charlie:${PATH/:$PWD\/bravo}"
export PATH

View file

@ -0,0 +1 @@
setenv PATH $PWD/charlie:`echo "$PATH" | @sed@ "s#:$PWD/bravo##"`

View file

@ -0,0 +1,9 @@
begin
for p in $PATH
if test $p != "$PWD/bravo"
set TEMPORARY_PATH $TEMPORARY_PATH $p
end
end
set -g PATH $TEMPORARY_PATH
end
set PATH "$PWD/charlie" $PATH

View file

@ -0,0 +1,2 @@
PATH="$PWD/charlie:$(echo "$PATH" | @sed@ "s#:$PWD/bravo##")"
export PATH

View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -eu -o pipefail
UNPATCHED_SOURCE_FILE="$1"
PATCHED_SOURCE_FILE="$2"
ORIG_PATH="$PWD/alfa:$PWD/bravo"
RESULT_PATH_FROM_UNPATCHED="$(
PATH="$ORIG_PATH"; export PATH
. "$UNPATCHED_SOURCE_FILE"
echo "$PATH"
)"
RESULT_PATH_FROM_PATCHED="$(
PATH="$ORIG_PATH"; export PATH
. "$PATCHED_SOURCE_FILE"
echo "$PATH"
)"
if [[ "$RESULT_PATH_FROM_UNPATCHED" != "$RESULT_PATH_FROM_PATCHED" ]]; then
echo "Result path mismatched: $UNPATCHED_SOURCE_FILE ($RESULT_PATH_FROM_UNPATCHED) and $PATCHED_SOURCE_FILE ($RESULT_PATH_FROM_PATCHED)" >&2
exit 1
fi

View file

@ -0,0 +1,13 @@
#/usr/bin/env tcsh
set UNPATCHED_SOURCE_FILE = "$1"
set PATCHED_SOURCE_FILE = "$2"
set ORIG_PATH = "${PWD}/alfa:${PWD}/bravo"
set RESULT_PATH_FROM_UNPATCHED = `setenv PATH "$ORIG_PATH"; source $UNPATCHED_SOURCE_FILE; echo $PATH`
set RESULT_PATH_FROM_PATCHED = `setenv PATH "$ORIG_PATH"; source $PATCHED_SOURCE_FILE; echo $PATH`
if ($RESULT_PATH_FROM_UNPATCHED != $RESULT_PATH_FROM_PATCHED) then
echo "Result path mismatched: $UNPATCHED_SOURCE_FILE ($RESULT_PATH_FROM_UNPATCHED) and $PATCHED_SOURCE_FILE ($RESULT_PATH_FROM_PATCHED)" > /dev/stderr
exit 1
endif

View file

@ -0,0 +1,13 @@
#/usr/bin/env fish
set UNPATCHED_SOURCE_FILE $argv[1]
set PATCHED_SOURCE_FILE $argv[2]
set ORIG_PATH "$PWD/alfa:$PWD/bravo"
set RESULT_PATH_FROM_UNPATCHED (fish -c "set -g PATH \"$ORIG_PATH\"; source $UNPATCHED_SOURCE_FILE; echo \"\$PATH\"")
set RESULT_PATH_FROM_PATCHED (fish -c "set -g PATH \"$ORIG_PATH\"; source $PATCHED_SOURCE_FILE; echo \"\$PATH\"")
if test "$RESULT_PATH_FROM_UNPATCHED" != "$RESULT_PATH_FROM_PATCHED"
echo "Result path mismatched: $UNPATCHED_SOURCE_FILE ($RESULT_PATH_FROM_UNPATCHED) and $PATCHED_SOURCE_FILE ($RESULT_PATH_FROM_PATCHED)" >&2
exit 1
end

View file

@ -0,0 +1,21 @@
#!/bin/sh
set -eu
UNPATCHED_SOURCE_FILE="$1"
PATCHED_SOURCE_FILE="$2"
ORIG_PATH="$PWD/alfa:$PWD/bravo"
RESULT_PATH_FROM_UNPATCHED="$(
PATH="$ORIG_PATH"; export PATH
. "$UNPATCHED_SOURCE_FILE"
echo "$PATH"
)"
RESULT_PATH_FROM_PATCHED="$(
PATH="$ORIG_PATH"; export PATH
. "$PATCHED_SOURCE_FILE"
echo "$PATH"
)"
if [ "$RESULT_PATH_FROM_UNPATCHED" != "$RESULT_PATH_FROM_PATCHED" ]; then
echo "Result path mismatched: $UNPATCHED_SOURCE_FILE ($RESULT_PATH_FROM_UNPATCHED) and $PATCHED_SOURCE_FILE ($RESULT_PATH_FROM_PATCHED)" > /dev/stderr
exit 1
fi

View file

@ -1,6 +1,8 @@
{ lib
, stdenvNoCC
, fetchFromGitHub
, adwaita-icon-theme
, breeze-icons
, gtk3
, hicolor-icon-theme
, jdupes
@ -13,17 +15,17 @@
let
pname = "tela-circle-icon-theme";
in
lib.checkListOfEnum "${pname}: color variants" [ "standard" "black" "blue" "brown" "green" "grey" "orange" "pink" "purple" "red" "yellow" "manjaro" "ubuntu" ] colorVariants
lib.checkListOfEnum "${pname}: color variants" [ "standard" "black" "blue" "brown" "green" "grey" "orange" "pink" "purple" "red" "yellow" "manjaro" "ubuntu" "dracula" "nord" ] colorVariants
stdenvNoCC.mkDerivation rec {
inherit pname;
version = "2022-03-07";
version = "2022-11-06";
src = fetchFromGitHub {
owner = "vinceliuice";
repo = pname;
rev = version;
sha256 = "vQeWGZmurvT/UQJ1dx6t+ZeKdJ1Oq9TdHBADw64x18g=";
sha256 = "ybp+r0Ru2lJg1WipFHIowvRO5XjppI0cUxKc6kPn0lM=";
};
nativeBuildInputs = [
@ -32,6 +34,8 @@ stdenvNoCC.mkDerivation rec {
];
propagatedBuildInputs = [
adwaita-icon-theme
breeze-icons
hicolor-icon-theme
];
@ -42,16 +46,18 @@ stdenvNoCC.mkDerivation rec {
dontPatchELF = true;
dontRewriteSymlinks = true;
postPatch = ''
patchShebangs install.sh
'';
installPhase = ''
runHook preInstall
patchShebangs install.sh
./install.sh -d $out/share/icons \
${lib.optionalString circularFolder "-c"} \
${if allColorVariants then "-a" else builtins.toString colorVariants}
jdupes --link-soft --recurse $out/share
jdupes --quiet --link-soft --recurse $out/share
runHook postInstall
'';

View file

@ -1,17 +1,17 @@
{ lib, stdenv, fetchurl, buildPackages }:
{ lib, stdenv, fetchurl, fetchpatch, buildPackages }:
stdenv.mkDerivation rec {
pname = "tzdata";
version = "2022e";
version = "2022f";
srcs = [
(fetchurl {
url = "https://data.iana.org/time-zones/releases/tzdata${version}.tar.gz";
hash = "sha256-jeTCaG3OPRqukDBxnmgUkxwhai1eiR7D0zLm9lFq7M0=";
hash = "sha256-mZDXH2ddISVnuTH+iq4cq3An+J/vuKedgIppM6Z68AA=";
})
(fetchurl {
url = "https://data.iana.org/time-zones/releases/tzcode${version}.tar.gz";
hash = "sha256-1AKAJTmA6JFo5r5CdahSv5UhUk1HaE3jE1uaXKOHcQs=";
hash = "sha256-5FQ+kPhPkfqCgJ6piTAFL9vBOIDIpiPuOk6qQvimTBU=";
})
];
@ -19,6 +19,17 @@ stdenv.mkDerivation rec {
patches = lib.optionals stdenv.hostPlatform.isWindows [
./0001-Add-exe-extension-for-MS-Windows-binaries.patch
] ++ [
(fetchpatch {
name = "fix-get-random-on-osx-1.patch";
url = "https://github.com/eggert/tz/commit/5db8b3ba4816ccb8f4ffeb84f05b99e87d3b1be6.patch";
hash = "sha256-FevGjiSahYwEjRUTvRY0Y6/jUO4YHiTlAAPixzEy5hw=";
})
(fetchpatch {
name = "fix-get-random-on-osx-2.patch";
url = "https://github.com/eggert/tz/commit/841183210311b1d4ffb4084bfde8fa8bdf3e6757.patch";
hash = "sha256-1tUTZBMT7V463P7eygpFS6/k5gTeeXumk5+V4gdKpEI=";
})
];
outputs = [ "out" "bin" "man" "dev" ];

View file

@ -1,26 +1,41 @@
{ lib
, stdenv
, stdenvNoCC
, fetchFromGitHub
, gnome-shell
, gtk-engine-murrine
, gtk_engines
, jdupes
, sassc
, gitUpdater
, themeVariants ? [] # default: doder (blue)
, colorVariants ? [] # default: all
, sizeVariants ? [] # default: standard
, tweaks ? []
}:
stdenv.mkDerivation rec {
let
pname = "vimix-gtk-themes";
version = "2022-04-24";
in
lib.checkListOfEnum "${pname}: theme variants" [ "doder" "beryl" "ruby" "amethyst" "grey" ] themeVariants
lib.checkListOfEnum "${pname}: color variants" [ "standard" "light" "dark" ] colorVariants
lib.checkListOfEnum "${pname}: size variants" [ "standard" "compact" ] sizeVariants
lib.checkListOfEnum "${pname}: tweaks" [ "flat" "grey" "mix" "translucent" ] tweaks
stdenvNoCC.mkDerivation rec {
inherit pname;
version = "2022-10-30";
src = fetchFromGitHub {
owner = "vinceliuice";
repo = pname;
rev = version;
sha256 = "0q0ahm060qvr7r9j3x9lxidjnwf032c2g1pcqw9mz93iy7vfn358";
sha256 = "QGKh2Md25VNVqy58w/LBzNnEM+g4gBMUjj0W0IuVZ1U=";
};
nativeBuildInputs = [
gnome-shell # needed to determine the gnome-shell version
jdupes
sassc
];
@ -39,8 +54,14 @@ stdenv.mkDerivation rec {
installPhase = ''
runHook preInstall
mkdir -p $out/share/themes
name= HOME="$TMPDIR" ./install.sh --all --dest $out/share/themes
name= HOME="$TMPDIR" ./install.sh \
${lib.optionalString (themeVariants != []) "--theme " + builtins.toString themeVariants} \
${lib.optionalString (colorVariants != []) "--color " + builtins.toString colorVariants} \
${lib.optionalString (sizeVariants != []) "--size " + builtins.toString sizeVariants} \
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
--dest $out/share/themes
rm $out/share/themes/*/{AUTHORS,LICENSE}
jdupes --quiet --link-soft --recurse $out/share
runHook postInstall
'';

View file

@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, gitUpdater
, glib
, gnome-shell
, gnome-themes-extra
@ -32,13 +33,13 @@ lib.checkListOfEnum "${pname}: panel size" [ "default" "smaller" "bigger" ] (sin
stdenv.mkDerivation rec {
pname = "whitesur-gtk-theme";
version = "2022-08-26";
version = "2022-10-27";
src = fetchFromGitHub {
owner = "vinceliuice";
repo = pname;
rev = version;
sha256 = "sha256-kvu6Zv5vmyDasBt6eOBqexv0n5vi6OzpG5We1eSbW0o=";
sha256 = "sha256-jOrTasnkNExCgvST+09JOQ0iosjoEu3aoj3C1pNHTgY=";
};
nativeBuildInputs = [
@ -83,11 +84,13 @@ stdenv.mkDerivation rec {
${lib.optionalString (panelSize != null) ("--panel-size " + panelSize)} \
--dest $out/share/themes
jdupes --link-soft --recurse $out/share
jdupes --quiet --link-soft --recurse $out/share
runHook postInstall
'';
passthru.updateScript = gitUpdater { };
meta = with lib; {
description = "MacOS Big Sur like theme for Gnome desktops";
homepage = "https://github.com/vinceliuice/WhiteSur-gtk-theme";

View file

@ -1,6 +1,7 @@
{ stdenv
, lib
, fetchurl
, fetchpatch
, meson
, ninja
, gettext
@ -65,6 +66,14 @@ stdenv.mkDerivation rec {
libsoup_3
];
patches = [
(fetchpatch {
name = "timeTest.patch";
url = "https://gitlab.gnome.org/GNOME/gnome-maps/-/commit/bec3d2f26de1b3a8c8b7e603f6d6a46c853426fa.diff";
sha256 = "sha256-7/ogIDG0piZOPaCPX4nUA3jHI7RGTd2KMZsp8z0XLcc=";
})
];
postPatch = ''
# The .service file isn't wrapped with the correct environment
# so misses GIR files when started. By re-pointing from the gjs

View file

@ -18,13 +18,13 @@
stdenv.mkDerivation rec {
pname = "elementary-iconbrowser";
version = "2.0.0";
version = "2.1.1";
src = fetchFromGitHub {
owner = "elementary";
repo = "iconbrowser";
rev = version;
sha256 = "sha256-aXFgL5l9jnOZJJgMOYwiE7W//1sq23CbLEDmhYFJT38=";
sha256 = "sha256-xooZfQmeB4rvlO8zKWnUuXPCFQNCTdjd7C53/j9EoHg=";
};
nativeBuildInputs = [

View file

@ -25,7 +25,7 @@ stdenv.mkDerivation {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (haveLibc && !isMusl) [
] ++ lib.optionals (haveLibc && stdenv.hostPlatform.isGnu) [
"-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include"
] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"

View file

@ -26,7 +26,7 @@ stdenv.mkDerivation {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (haveLibc && !isMusl) [
] ++ lib.optionals (haveLibc && stdenv.hostPlatform.isGnu) [
"-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include"
] ++ lib.optionals (useLLVM || bareMetal || isMusl || isNewDarwinBootstrap) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"

View file

@ -26,7 +26,7 @@ stdenv.mkDerivation {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (haveLibc && !isMusl) [
] ++ lib.optionals (haveLibc && stdenv.hostPlatform.isGnu) [
"-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include"
] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"

View file

@ -28,7 +28,7 @@ stdenv.mkDerivation {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (haveLibc && !isMusl) [
] ++ lib.optionals (haveLibc && stdenv.hostPlatform.isGnu) [
"-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include"
] ++ lib.optionals (useLLVM || bareMetal || isMusl || isAarch64) [
"-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"

View file

@ -38,7 +38,7 @@ stdenv.mkDerivation {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (haveLibc && !isMusl) [
] ++ lib.optionals (haveLibc && stdenv.hostPlatform.isGnu) [
"-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include"
] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"

View file

@ -75,7 +75,5 @@ rustPlatform.buildRustPackage {
maintainers = with maintainers; [ retrry ];
license = [ licenses.mit licenses.asl20 ];
platforms = platforms.unix;
# weird segfault in a build script
broken = stdenv.targetPlatform.isMusl && !stdenv.targetPlatform.isStatic;
};
}

View file

@ -25,6 +25,7 @@
, fftwSinglePrec
, zlib
, curl
, rapidjson
, blas, lapack
# These two should use the same lapack and blas as the above
, qrupdate, arpack, suitesparse ? null
@ -130,6 +131,7 @@ let
fltk
zlib
curl
rapidjson
blas'
lapack'
libsndfile

View file

@ -8,7 +8,7 @@
, openssl
, readline
, sqlite
, tcl ? null, tk ? null, tix ? null, xlibsWrapper ? null, libX11 ? null, x11Support ? false
, tcl ? null, tk ? null, tix ? null, libX11 ? null, x11Support ? false
, zlib
, self
, configd, coreutils
@ -36,7 +36,6 @@
assert x11Support -> tcl != null
&& tk != null
&& xlibsWrapper != null
&& libX11 != null;
assert lib.assertMsg (enableOptimizations -> (!stdenv.cc.isClang))
@ -234,7 +233,7 @@ let
++ optional (stdenv.hostPlatform.isCygwin || stdenv.hostPlatform.isAarch64) libffi
++ optional stdenv.hostPlatform.isCygwin expat
++ [ db gdbm ncurses sqlite readline ]
++ optionals x11Support [ tcl tk xlibsWrapper libX11 ]
++ optionals x11Support [ tcl tk libX11 ]
++ optional (stdenv.isDarwin && configd != null) configd;
nativeBuildInputs =
[ autoreconfHook ]

View file

@ -22,6 +22,24 @@
# # pythonRemoveDeps = true;
# …
# }
#
# IMPLEMENTATION NOTES:
#
# The "Requires-Dist" dependency specification format is described in PEP 508.
# Examples that the regular expressions in this hook needs to support:
#
# Requires-Dist: foo
# -> foo
# Requires-Dist: foo[optional]
# -> foo[optional]
# Requires-Dist: foo[optional]~=1.2.3
# -> foo[optional]
# Requires-Dist: foo[optional, xyz] (~=1.2.3)
# -> foo[optional, xyz]
# Requires-Dist: foo[optional]~=1.2.3 ; os_name = "posix"
# -> foo[optional] ; os_name = "posix"
#
# Currently unsupported: URL specs (foo @ https://example.com/a.zip).
_pythonRelaxDeps() {
local -r metadata_file="$1"
@ -30,11 +48,11 @@ _pythonRelaxDeps() {
return
elif [[ "$pythonRelaxDeps" == 1 ]]; then
sed -i "$metadata_file" -r \
-e 's/(Requires-Dist: \S*) \(.*\)/\1/'
-e 's/(Requires-Dist: [a-zA-Z0-9_.-]+\s*(\[[^]]+\])?)[^;]*(;.*)?/\1\3/'
else
for dep in $pythonRelaxDeps; do
sed -i "$metadata_file" -r \
-e "s/(Requires-Dist: $dep) \(.*\)/\1/"
-e "s/(Requires-Dist: $dep\s*(\[[^]]+\])?)[^;]*(;.*)?/\1\3/"
done
fi
}

View file

@ -59,11 +59,11 @@ with lib;
stdenv.mkDerivation rec {
pname = "SDL2";
version = "2.24.0";
version = "2.24.2";
src = fetchurl {
url = "https://www.libsdl.org/release/${pname}-${version}.tar.gz";
sha256 = "sha256-keTDSxdo+S05mweOFxRIxq8Yyv2nQ5h+0gZKKJVNbZc=";
sha256 = "sha256-s17wqAKwnZDtOt0NysDpWCCAQgKRT1u3sP63EPGhMp8=";
};
dontDisableStatic = if withStatic then 1 else 0;
outputs = [ "out" "dev" ];

View file

@ -45,6 +45,11 @@ stdenv.mkDerivation rec {
];
postPatch = ''
# Avoid blanket -Werror to evade build failures on less
# tested compilers.
substituteInPlace cmake/compiler_settings.cmake \
--replace '"-Werror"' ' '
# Missing includes for GCC11
sed '5i#include <thread>' -i \
aws-cpp-sdk-cloudfront-integration-tests/CloudfrontOperationTest.cpp \

View file

@ -9,6 +9,10 @@ stdenv.mkDerivation rec {
sha256 = "19qpqzy66bq76wcyadmi3zahk5v1ll2kig1nvg96zx9padkcdic9";
};
# Avoid blanket -Werror to evade build failures on less
# tested compilers.
configureFlags = [ "--disable-werror" ];
meta = with lib; {
homepage = "https://freedesktop.org/wiki/Software/cppunit/";
description = "C++ unit testing framework";

View file

@ -16,11 +16,11 @@
stdenv.mkDerivation rec {
pname = "expat";
version = "2.4.9";
version = "2.5.0";
src = fetchurl {
url = "https://github.com/libexpat/libexpat/releases/download/R_${lib.replaceStrings ["."] ["_"] version}/${pname}-${version}.tar.xz";
sha256 = "sha256-bowHKP5cfNP5OmrM5DBGxeRzbHtLaOAy6TUNqg78A1Q=";
sha256 = "1gnwihpfz4x18rwd6cbrdggmfqjzwsdfh1gpmc0ph21c4gq2097g";
};
strictDeps = true;

View file

@ -7,11 +7,9 @@
# this is just for tests (not in the closure of any regular package)
, coreutils, dbus, libxml2, tzdata
, desktop-file-utils, shared-mime-info
, darwin, fetchpatch
, darwin
}:
with lib;
assert stdenv.isLinux -> util-linuxMinimal != null;
# TODO:
@ -40,20 +38,22 @@ let
done
ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
'';
buildDocs = stdenv.hostPlatform == stdenv.buildPlatform && !stdenv.hostPlatform.isStatic;
in
stdenv.mkDerivation (finalAttrs: {
pname = "glib";
version = "2.74.0";
version = "2.74.1";
src = fetchurl {
url = "mirror://gnome/sources/glib/${lib.versions.majorMinor finalAttrs.version}/glib-${finalAttrs.version}.tar.xz";
sha256 = "NlLH8HLXsDGmte3WI/d+vF3NKuaYWYq8yJ/znKda3TA=";
sha256 = "CrmBYY0dtHhF5WQXsNfBI/gaNCeyuck/Wkb/W7uWSWQ=";
};
patches = optionals stdenv.isDarwin [
patches = lib.optionals stdenv.isDarwin [
./darwin-compilation.patch
] ++ optionals stdenv.hostPlatform.isMusl [
] ++ lib.optionals stdenv.hostPlatform.isMusl [
./quark_init_on_demand.patch
./gobject_init_on_demand.patch
] ++ [
@ -90,29 +90,8 @@ stdenv.mkDerivation (finalAttrs: {
# * gio-launch-desktop
./split-dev-programs.patch
# Fix build on Darwin
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2914
(fetchpatch {
name = "gio-properly-guard-use-of-utimensat.patch";
url = "https://gitlab.gnome.org/GNOME/glib/-/commit/7f7171e68a420991b537d3e9e63263a0b2871618.patch";
sha256 = "kKEqmBqx/RlvFT3eixu+NnM7JXhHb34b9NLRfAt+9h0=";
})
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2866
(fetchpatch {
name = "tests-skip-g-file-info-test-if-atime-unsupported.patch";
url = "https://gitlab.gnome.org/qyliss/glib/-/commit/339a06d66685107280ca6bdca5da5d96b8222fb5.patch";
sha256 = "sha256-/NdFkuiJvyass3jTDEJPeciA2Lwe53IUd3kAnKAvTaw=";
})
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2867
./tests-skip-shared-libs-if-default_library-static.patch
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2921
(fetchpatch {
url = "https://gitlab.gnome.org/GNOME/glib/-/commit/f0dd96c28751f15d0703b384bfc7c314af01caa8.patch";
sha256 = "sha256-8ucHS6ZnJuP6ajGb4/L8QfhC49FTQG1kAGHVdww/YYE=";
})
# Disable flaky test.
# https://gitlab.gnome.org/GNOME/glib/-/issues/820
./skip-timer-test.patch
];
@ -124,14 +103,14 @@ stdenv.mkDerivation (finalAttrs: {
libelf
finalAttrs.setupHook
pcre2
] ++ optionals (!stdenv.hostPlatform.isWindows) [
] ++ lib.optionals (!stdenv.hostPlatform.isWindows) [
bash gnum4 # install glib-gettextize and m4 macros for other apps to use
] ++ optionals stdenv.isLinux [
] ++ lib.optionals stdenv.isLinux [
libselinux
util-linuxMinimal # for libmount
] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
AppKit Carbon Cocoa CoreFoundation CoreServices Foundation
]) ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
]) ++ lib.optionals buildDocs [
# Note: this needs to be both in buildInputs and nativeBuildInputs. The
# Meson gtkdoc module uses find_program to look it up (-> build dep), but
# glib's own Meson configuration uses the host pkg-config to find its
@ -147,10 +126,18 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true;
nativeBuildInputs = [
(buildPackages.meson.override {
withDarwinFrameworksGtkDocPatch = stdenv.isDarwin;
})
ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2 libxslt
meson
ninja
pkg-config
perl
python3
gettext
] ++ lib.optionals buildDocs [
gtk-doc
docbook_xsl
docbook_xml_dtd_45
libxml2
libxslt
];
propagatedBuildInputs = [ zlib libffi gettext libiconv ];
@ -158,10 +145,10 @@ stdenv.mkDerivation (finalAttrs: {
mesonFlags = [
# Avoid the need for gobject introspection binaries in PATH in cross-compiling case.
# Instead we just copy them over from the native output.
"-Dgtk_doc=${boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}"
"-Dgtk_doc=${lib.boolToString buildDocs}"
"-Dnls=enabled"
"-Ddevbindir=${placeholder "dev"}/bin"
] ++ optionals (!stdenv.isDarwin) [
] ++ lib.optionals (!stdenv.isDarwin) [
"-Dman=true" # broken on Darwin
];
@ -215,7 +202,7 @@ stdenv.mkDerivation (finalAttrs: {
for i in $dev/bin/*; do
moveToOutput "share/bash-completion/completions/''${i##*/}" "$dev"
done
'' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
'' + lib.optionalString (!buildDocs) ''
cp -r ${buildPackages.glib.devdoc} $devdoc
'';
@ -230,7 +217,7 @@ stdenv.mkDerivation (finalAttrs: {
checkInputs = [ tzdata desktop-file-utils shared-mime-info ];
preCheck = optionalString finalAttrs.doCheck or config.doCheckByDefault or false ''
preCheck = lib.optionalString finalAttrs.doCheck or config.doCheckByDefault or false ''
export LD_LIBRARY_PATH="$NIX_BUILD_TOP/glib-${finalAttrs.version}/glib/.libs''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
export TZDIR="${tzdata}/share/zoneinfo"
export XDG_CACHE_HOME="$TMP"

View file

@ -1,141 +0,0 @@
From b804e4b82cd8e85631112d935543c62ef56783e5 Mon Sep 17 00:00:00 2001
From: Alyssa Ross <hi@alyssa.is>
Date: Tue, 23 Aug 2022 13:13:44 +0000
Subject: [PATCH] tests: skip shared libs if default_library=static
Otherwise, the build will fail when the toolchain is static-only, even
with -Ddefault_library=static. I talked to a Meson developer in their
IRC channel, who told me that the correct fix was to ensure that
shared_library is only used if default_library != static.
Part-of: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2867
[Backported to 2.72.3]
---
gio/tests/meson.build | 43 +++++++++++++++++++++++-------------------
glib/tests/meson.build | 2 +-
gmodule/tests/meson.build | 30 +++++++++++++++--------------
3 files changed, 41 insertions(+), 34 deletions(-)
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 3ed23a5f2..7b1aba80d 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -203,7 +203,7 @@ if host_machine.system() != 'windows'
}
# LD_PRELOAD modules don't work so well with AddressSanitizer
- if have_rtld_next and get_option('b_sanitize') == 'none'
+ if have_rtld_next and get_option('default_library') != 'static' and get_option('b_sanitize') == 'none'
gio_tests += {
'gsocketclient-slow' : {
'depends' : [
@@ -607,24 +607,26 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
compiler_type = '--compiler=@0@'.format(cc.get_id())
- plugin_resources_c = custom_target('plugin-resources.c',
- input : 'test4.gresource.xml',
- output : 'plugin-resources.c',
- command : [glib_compile_resources,
- compiler_type,
- '--target=@OUTPUT@',
- '--sourcedir=' + meson.current_source_dir(),
- '--internal',
- '--generate-source',
- '--c-name', '_g_plugin',
- '@INPUT@'])
+ if get_option('default_library') != 'static'
+ plugin_resources_c = custom_target('plugin-resources.c',
+ input : 'test4.gresource.xml',
+ output : 'plugin-resources.c',
+ command : [glib_compile_resources,
+ compiler_type,
+ '--target=@OUTPUT@',
+ '--sourcedir=' + meson.current_source_dir(),
+ '--internal',
+ '--generate-source',
+ '--c-name', '_g_plugin',
+ '@INPUT@'])
- shared_module('resourceplugin', 'resourceplugin.c', plugin_resources_c,
- link_args : export_dynamic_ldflags,
- dependencies : common_gio_tests_deps,
- install_dir : installed_tests_execdir,
- install : installed_tests_enabled
- )
+ shared_module('resourceplugin', 'resourceplugin.c', plugin_resources_c,
+ link_args : export_dynamic_ldflags,
+ dependencies : common_gio_tests_deps,
+ install_dir : installed_tests_execdir,
+ install : installed_tests_enabled
+ )
+ endif
# referenced by test2.gresource.xml
big_test_resource = custom_target(
@@ -917,4 +919,7 @@ if installed_tests_enabled
endif
subdir('services')
-subdir('modules')
+
+if get_option('default_library') != 'static'
+ subdir('modules')
+endif
diff --git a/glib/tests/meson.build b/glib/tests/meson.build
index 301158e0f..6203ff45e 100644
--- a/glib/tests/meson.build
+++ b/glib/tests/meson.build
@@ -172,7 +172,7 @@ else
'include' : {},
'unix' : {},
}
- if have_rtld_next
+ if have_rtld_next and get_option('default_library') != 'static'
glib_tests += {
'gutils-user-database' : {
'depends' : [
diff --git a/gmodule/tests/meson.build b/gmodule/tests/meson.build
index c95fa1d00..25144c941 100644
--- a/gmodule/tests/meson.build
+++ b/gmodule/tests/meson.build
@@ -72,20 +72,22 @@ if ['darwin', 'ios'].contains(host_machine.system())
module_suffix = 'so'
endif
-foreach module : ['moduletestplugin_a', 'moduletestplugin_b']
- shared_module(module + '_plugin', 'lib@0@.c'.format(module),
- dependencies : [libglib_dep, libgmodule_dep],
- install_dir : installed_tests_execdir,
- install : installed_tests_enabled,
- name_suffix : module_suffix
- )
- shared_library(module + '_library', 'lib@0@.c'.format(module),
- dependencies : [libglib_dep, libgmodule_dep],
- install_dir : installed_tests_execdir,
- install : installed_tests_enabled,
- name_suffix : module_suffix
- )
-endforeach
+if get_option('default_library') != 'static'
+ foreach module : ['moduletestplugin_a', 'moduletestplugin_b']
+ shared_module(module + '_plugin', 'lib@0@.c'.format(module),
+ dependencies : [libglib_dep, libgmodule_dep],
+ install_dir : installed_tests_execdir,
+ install : installed_tests_enabled,
+ name_suffix : module_suffix
+ )
+ shared_library(module + '_library', 'lib@0@.c'.format(module),
+ dependencies : [libglib_dep, libgmodule_dep],
+ install_dir : installed_tests_execdir,
+ install : installed_tests_enabled,
+ name_suffix : module_suffix
+ )
+ endforeach
+endif
common_c_args = test_cargs + ['-DGLIB_DISABLE_DEPRECATION_WARNINGS']
common_deps = [libm, thread_dep, libglib_dep]
--
2.37.1

View file

@ -64,8 +64,9 @@ callPackage ./common.nix { inherit stdenv; } {
installPhase =
''
mkdir -p "$out/lib/locale"
mkdir -p "$out/lib/locale" "$out/share/i18n"
cp -v "$TMPDIR/$NIX_STORE/"*"/lib/locale/locale-archive" "$out/lib/locale"
cp -v ../glibc-2*/localedata/SUPPORTED "$out/share/i18n/SUPPORTED"
'';
setupHook = writeText "locales-setup-hook.sh"

View file

@ -0,0 +1,4 @@
import ./base.nix {
version = "72.1";
sha256 = "sha256-otLTghcJKn7VZjXjRGf5L5drNw4gGCrTJe3qZoGnHWg=";
}

View file

@ -19,14 +19,14 @@
, systemd # for libudev
}:
stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "libcamera";
version = "unstable-2022-09-15";
version = "0.0.1";
src = fetchgit {
url = "https://git.libcamera.org/libcamera/libcamera.git";
rev = "74ab3f778c848b20cbf8fe299170756ff6ebab1a";
hash = "sha256-w0I4L6xXTBUdqj30LpVW/KZW6bdoUeoW9lnMOW0OLJY=";
rev = "v${version}";
hash = "sha256-u5FnfXBCjwSp8QBrH8KIkVGV32/9pff41ZWjWXOwuMI=";
};
postPatch = ''
@ -77,6 +77,9 @@ stdenv.mkDerivation {
"-Dv4l2=true"
"-Dqcam=disabled"
"-Dlc-compliance=disabled" # tries unconditionally to download gtest when enabled
# Avoid blanket -Werror to evade build failures on less
# tested compilers.
"-Dwerror=false"
];
# Fixes error on a deprecated declaration
@ -85,6 +88,17 @@ stdenv.mkDerivation {
# Silence fontconfig warnings about missing config
FONTCONFIG_FILE = makeFontsConf { fontDirectories = []; };
# libcamera signs the IPA module libraries at install time, but they are then
# modified by stripping and RPATH fixup. Therefore, we need to generate the
# signatures again ourselves.
#
# If this is not done, libcamera will still try to load them, but it will
# isolate them in separate processes, which can cause crashes for IPA modules
# that are not designed for this (notably ipa_rpi.so).
postFixup = ''
../src/ipa/ipa-sign-install.sh src/ipa-priv-key.pem $out/lib/libcamera/ipa_*.so
'';
meta = with lib; {
description = "An open source camera stack and framework for Linux, Android, and ChromeOS";
homepage = "https://libcamera.org";

View file

@ -1,12 +1,12 @@
{ lib, stdenv, fetchFromGitHub, zlib, openssl }:
stdenv.mkDerivation rec {
version = "2.8.0";
version = "2.9.0";
pname = "libre";
src = fetchFromGitHub {
owner = "baresip";
repo = "re";
rev = "v${version}";
sha256 = "sha256-mbPFaq49EI2BdhdQJwFaBxjAh2aKlcuFwoCTwhXRbUg=";
sha256 = "sha256-YNAfHmohMqGGF8N/VdndJJ32PF/GMBoNtjo/t2lt6HA=";
};
buildInputs = [ zlib openssl ];
makeFlags = [ "USE_ZLIB=1" "USE_OPENSSL=1" "PREFIX=$(out)" ]

View file

@ -1,12 +1,12 @@
{ lib, stdenv, fetchFromGitHub, zlib, openssl, libre }:
stdenv.mkDerivation rec {
version = "2.8.0";
version = "2.9.0";
pname = "librem";
src = fetchFromGitHub {
owner = "baresip";
repo = "rem";
rev = "v${version}";
sha256 = "sha256-/DAJMudEEB/8IYl27SFRlD57dfhZrPA5I1ycL4lFXy8=";
sha256 = "sha256-HiVM/opZuR7Gkt421ps+nKiiKERG8sUD8qBLIMGNCJI=";
};
buildInputs = [ zlib openssl libre ];
makeFlags = [

View file

@ -55,6 +55,9 @@ stdenv.mkDerivation rec {
strictDeps = true;
# https://gitlab.com/libvirt/libvirt-glib/-/issues/4
NIX_CFLAGS_COMPILE = [ "-Wno-error=pointer-sign" ];
meta = with lib; {
description = "Library for working with virtual machines";
longDescription = ''

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "libxcrypt";
version = "4.4.28";
version = "4.4.30";
src = fetchurl {
url = "https://github.com/besser82/libxcrypt/releases/download/v${version}/libxcrypt-${version}.tar.xz";
sha256 = "sha256-npNoEfn60R28ozyhm9l8VcUus8oVkB8nreBGzHnmnoc=";
sha256 = "sha256-s2Z/C6hdqtavJGukCQ++UxY62TyLaioSV9IqeLt87ro=";
};
outputs = [
@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
doCheck = !stdenv.hostPlatform.isMusl;
doCheck = true;
passthru.tests = {
inherit (nixosTests) login shadow;

View file

@ -11,11 +11,11 @@ assert (ch4backend.pname == "ucx" || ch4backend.pname == "libfabric");
stdenv.mkDerivation rec {
pname = "mpich";
version = "4.0.2";
version = "4.0.3";
src = fetchurl {
url = "https://www.mpich.org/static/downloads/${version}/mpich-${version}.tar.gz";
sha256 = "0hnxvqhhscp3h70zf538dhqz9jwmqpwwnj3fqabdk8nli6lg2hjs";
sha256 = "sha256-F0BuqQpu1OzVvjnJ3cv6yTQ+arT3esToxevko+O2xQE=";
};
configureFlags = [

View file

@ -1,56 +0,0 @@
From cef404f1e7a598166cbc2fd2e0048f7e2d752ad5 Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen@gmail.com>
Date: Tue, 24 Aug 2021 22:40:14 +0100
Subject: [PATCH] Darwin platform allows to build on releases before
Yosemite/ios 8.
issue #16407 #16408
---
crypto/rand/rand_unix.c | 5 +----
include/crypto/rand.h | 10 ++++++++++
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c
index 43f1069d151d..0f4525106af7 100644
--- a/crypto/rand/rand_unix.c
+++ b/crypto/rand/rand_unix.c
@@ -34,9 +34,6 @@
#if defined(__OpenBSD__)
# include <sys/param.h>
#endif
-#if defined(__APPLE__)
-# include <CommonCrypto/CommonRandom.h>
-#endif
#if defined(OPENSSL_SYS_UNIX) || defined(__DJGPP__)
# include <sys/types.h>
@@ -381,7 +378,7 @@ static ssize_t syscall_random(void *buf, size_t buflen)
if (errno != ENOSYS)
return -1;
}
-# elif defined(__APPLE__)
+# elif defined(OPENSSL_APPLE_CRYPTO_RANDOM)
if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
return (ssize_t)buflen;
diff --git a/include/crypto/rand.h b/include/crypto/rand.h
index 5350d3a93119..674f840fd13c 100644
--- a/include/crypto/rand.h
+++ b/include/crypto/rand.h
@@ -20,6 +20,16 @@
# include <openssl/rand.h>
+# if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
+# include <Availability.h>
+# if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000) || \
+ (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000)
+# define OPENSSL_APPLE_CRYPTO_RANDOM 1
+# include <CommonCrypto/CommonCryptoError.h>
+# include <CommonCrypto/CommonRandom.h>
+# endif
+# endif
+
/* forward declaration */
typedef struct rand_pool_st RAND_POOL;

View file

@ -214,17 +214,15 @@ let
in {
openssl_1_1 = common rec {
version = "1.1.1q";
sha256 = "sha256-15Oc5hQCnN/wtsIPDi5XAxWKSJpyslB7i9Ub+Mj9EMo=";
openssl_1_1 = common {
version = "1.1.1s";
sha256 = "sha256-xawB52Dub/Dath1rK70wFGck0GPrMiGAxvGKb3Tktqo=";
patches = [
./1.1/nix-ssl-cert-file.patch
(if stdenv.hostPlatform.isDarwin
then ./use-etc-ssl-certs-darwin.patch
else ./use-etc-ssl-certs.patch)
] ++ lib.optionals (stdenv.isDarwin && (builtins.substring 5 5 version) < "m") [
./1.1/macos-yosemite-compat.patch
];
withDocs = true;
};

View file

@ -16,11 +16,14 @@
stdenv.mkDerivation rec {
pname = "pixman";
version = "0.38.4";
version = "0.42.2";
src = fetchurl {
url = "mirror://xorg/individual/lib/${pname}-${version}.tar.bz2";
sha256 = "0l0m48lnmdlmnaxn2021qi5cj366d9fzfjxkqgcj9bs14pxbgaw4";
urls = [
"mirror://xorg/individual/lib/${pname}-${version}.tar.gz"
"https://cairographics.org/releases/${pname}-${version}.tar.gz"
];
hash = "sha256-6hSA762i/ZSLx1Nm98NJ4cltMpfQmj/mJibjjiNKYl4=";
};
separateDebugInfo = !stdenv.hostPlatform.isStatic;
@ -29,7 +32,9 @@ stdenv.mkDerivation rec {
buildInputs = [ libpng ];
configureFlags = lib.optional stdenv.isAarch32 "--disable-arm-iwmmxt";
configureFlags = lib.optional stdenv.isAarch32 "--disable-arm-iwmmxt"
# Disable until https://gitlab.freedesktop.org/pixman/pixman/-/issues/46 is resolved
++ lib.optional (stdenv.isAarch64 && !stdenv.cc.isGNU) "--disable-arm-a64-neon";
preConfigure = ''
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/62

View file

@ -81,7 +81,11 @@ let
sha256 = "0crkw3j1iwdc1pbf5dhar0b4q3h5gs2q1sika8m12y02yk3ns697";
})
];
qtdeclarative = [ ./qtdeclarative.patch ];
qtdeclarative = [
./qtdeclarative.patch
# prevent headaches from stale qmlcache data
./qtdeclarative-default-disable-qmlcache.patch
];
qtlocation = [ ./qtlocation-gcc-9.patch ];
qtscript = [ ./qtscript.patch ];
qtserialport = [ ./qtserialport.patch ];

View file

@ -0,0 +1,40 @@
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 9e5bc0b0..9219def6 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -2151,7 +2151,7 @@ void QQmlTypeData::unregisterCallback(TypeDataCallback *callback)
bool QQmlTypeData::tryLoadFromDiskCache()
{
- if (disableDiskCache() && !forceDiskCache())
+ if (!forceDiskCache())
return false;
if (isDebugging())
@@ -2658,7 +2658,7 @@ void QQmlTypeData::compile(const QQmlRefPointer<QQmlTypeNameCache> &typeNameCach
return;
}
- const bool trySaveToDisk = (!disableDiskCache() || forceDiskCache()) && !m_document->jsModule.debugMode && !typeRecompilation;
+ const bool trySaveToDisk = (forceDiskCache()) && !m_document->jsModule.debugMode && !typeRecompilation;
if (trySaveToDisk) {
QString errorString;
if (m_compiledData->saveToDisk(url(), &errorString)) {
@@ -3014,7 +3014,7 @@ QQmlRefPointer<QQmlScriptData> QQmlScriptBlob::scriptData() const
void QQmlScriptBlob::dataReceived(const SourceCodeData &data)
{
- if (!disableDiskCache() || forceDiskCache()) {
+ if (forceDiskCache()) {
QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit = QV4::Compiler::Codegen::createUnitForLoading();
QString error;
if (unit->loadFromDisk(url(), data.sourceTimeStamp(), &error)) {
@@ -3077,7 +3077,7 @@ void QQmlScriptBlob::dataReceived(const SourceCodeData &data)
qmlGenerator.generate(irUnit);
}
- if ((!disableDiskCache() || forceDiskCache()) && !isDebugging()) {
+ if ((forceDiskCache()) && !isDebugging()) {
QString errorString;
if (unit->saveToDisk(url(), &errorString)) {
QString error;

View file

@ -68,7 +68,11 @@ let
./qtbase.patch.d/0010-qtbase-assert.patch
./qtbase.patch.d/0011-fix-header_module.patch
];
qtdeclarative = [ ./qtdeclarative.patch ];
qtdeclarative = [
./qtdeclarative.patch
# prevent headaches from stale qmlcache data
./qtdeclarative-default-disable-qmlcache.patch
];
qtlocation = [ ./qtlocation-gcc-9.patch ];
qtscript = [ ./qtscript.patch ];
qtserialport = [ ./qtserialport.patch ];

View file

@ -0,0 +1,13 @@
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 6c12de92..fc67dc07 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -705,7 +705,7 @@ bool QQmlTypeLoader::Blob::isDebugging() const
bool QQmlTypeLoader::Blob::diskCacheEnabled() const
{
- return (!disableDiskCache() || forceDiskCache()) && !isDebugging();
+ return (forceDiskCache()) && !isDebugging();
}
bool QQmlTypeLoader::Blob::qmldirDataAvailable(const QQmlRefPointer<QQmlQmldirData> &data, QList<QQmlError> *errors)

View file

@ -56,7 +56,11 @@ let
./qtbase.patch.d/0010-qtbase-assert.patch
./qtbase.patch.d/0011-fix-header_module.patch
];
qtdeclarative = [ ./qtdeclarative.patch ];
qtdeclarative = [
./qtdeclarative.patch
# prevent headaches from stale qmlcache data
./qtdeclarative-default-disable-qmlcache.patch
];
qtscript = [ ./qtscript.patch ];
qtserialport = [ ./qtserialport.patch ];
qtwebengine = lib.optionals stdenv.isDarwin [

View file

@ -0,0 +1,13 @@
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 1d66e75..827567a 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -727,7 +727,7 @@ bool QQmlTypeLoader::Blob::isDebugging() const
bool QQmlTypeLoader::Blob::diskCacheEnabled() const
{
- return (!disableDiskCache() && !isDebugging()) || forceDiskCache();
+ return forceDiskCache();
}
bool QQmlTypeLoader::Blob::qmldirDataAvailable(const QQmlRefPointer<QQmlQmldirData> &data, QList<QQmlError> *errors)

View file

@ -16,6 +16,10 @@ qtModule {
"-DQT6_INSTALL_PREFIX=${placeholder "out"}"
"-DQT_INSTALL_PREFIX=${placeholder "out"}"
];
patches = [
# prevent headaches from stale qmlcache data
../patches/qtdeclarative-default-disable-qmlcache.patch
];
postInstall = ''
substituteInPlace "$out/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake" \
--replace ''\'''${QT6_INSTALL_PREFIX}' "$dev"

View file

@ -0,0 +1,13 @@
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 852cde9e..165f1b57 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -2093,7 +2093,7 @@ void ExecutionEngine::registerModule(const QString &_name, const QJSValue &modul
bool ExecutionEngine::diskCacheEnabled() const
{
- return (!disableDiskCache() && !debugger()) || forceDiskCache();
+ return forceDiskCache();
}
void ExecutionEngine::callInContext(QV4::Function *function, QObject *self,

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "spglib";
version = "2.0.1"; # N.B: if you change this, please update: pythonPackages.spglib
version = "2.0.2"; # N.B: if you change this, please update: pythonPackages.spglib
src = fetchFromGitHub {
owner = "spglib";
repo = "spglib";
rev = "v${version}";
sha256 = "sha256-0M3GSnNvBNmE4ShW8NNkVrOBGEF9A0C5wd++xnyrcdI=";
sha256 = "sha256-8Voepj35CMbboL3Dc55Gc4+OLPTTSgqVQuvNcRQsqmU=";
};
nativeBuildInputs = [ cmake ];

View file

@ -7,13 +7,13 @@
stdenv.mkDerivation rec {
pname = "taglib";
version = "1.12";
version = "1.13";
src = fetchFromGitHub {
owner = "taglib";
repo = "taglib";
rev = "v${version}";
sha256 = "sha256-omErajnYgxbflsbe6pS2KsexZcXisso0WGYnmIud7WA=";
sha256 = "sha256-DRALRH+/7c2lBvCpLp8hop3Xxsf76F1q8L7F9qehqQA=";
};
nativeBuildInputs = [ cmake ];

View file

@ -29,13 +29,13 @@
stdenv.mkDerivation rec {
pname = "tracker";
version = "3.4.0";
version = "3.4.1";
outputs = [ "out" "dev" "devdoc" ];
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "s7OAyVcdfHQjtfQB5KLy143kcUOwNessEoHiQjxZIYs=";
sha256 = "6p1BqfucK0KtgPwsgjJ7XHE9WUyWmwnhpJvmP7dPT64=";
};
postPatch = ''

View file

@ -48,8 +48,20 @@ in buildPythonPackage rec {
# trashcan support is needed to avoid stack overflows during object deallocation in sage (https://trac.sagemath.org/ticket/27267)
(fetchpatch {
name = "trashcan.patch";
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/cython/patches/trashcan.patch?id=4569a839f070a1a38d5dbce2a4d19233d25aeed2";
sha256 = "sha256-+pOF1XNTEtNseLpqPzrc1Jfwt5hGx7doUoccIhNneYY=";
url = "https://github.com/cython/cython/commit/f781880b6780117660b2026caadf4a6d7905722f.patch";
sha256 = "sha256-SnjaJdBZxm3O5gJ5Dxut6+eeVtZv+ygUUNwAwgoiFxg=";
})
# The above commit introduces custom trashcan macros, as well as
# compiler changes to use them in Cython-emitted code. The latter
# change is still useful, but the former has been upstreamed as of
# Python 3.8, and the patch below makes Cython use the upstream
# trashcan macros whenever available. This is needed for Python
# 3.11 support, because the API used in Cython's implementation
# changed: https://github.com/cython/cython/pull/4475
(fetchpatch {
name = "disable-trashcan.patch";
url = "https://github.com/cython/cython/commit/e337825cdcf5e94d38ba06a0cb0188e99ce0cc92.patch";
sha256 = "sha256-q0f63eetKrDpmP5Z4v8EuGxg26heSyp/62OYqhRoSso=";
})
];

View file

@ -7,7 +7,7 @@
buildPythonPackage rec {
pname = "adafruit-platformdetect";
version = "3.32.0";
version = "3.33.0";
format = "setuptools";
disabled = pythonOlder "3.7";
@ -15,7 +15,7 @@ buildPythonPackage rec {
src = fetchPypi {
pname = "Adafruit-PlatformDetect";
inherit version;
hash = "sha256-MbrRf7kcPNYb1i+5cSkCvO9SJbvrPAeKGWxtfi1FmaQ=";
hash = "sha256-Fj+LUTovZm6t0YRCa8QtoTBal+PefCvTIl9OeBoac6U=";
};
nativeBuildInputs = [

View file

@ -18,7 +18,7 @@
buildPythonPackage rec {
pname = "aiohomekit";
version = "2.2.18";
version = "2.2.19";
format = "pyproject";
disabled = pythonOlder "3.9";
@ -27,7 +27,7 @@ buildPythonPackage rec {
owner = "Jc2k";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-yE3+1dhgqgqmoBhBVsivXvn7MTKaY8FYiyqBRkg3h1U=";
hash = "sha256-x1Cah47EupdqLxwoJBLmN3AtC7zYqGZTP0nbLLsC3a0=";
};
nativeBuildInputs = [

View file

@ -29,12 +29,12 @@
buildPythonPackage rec {
pname = "aiohttp";
version = "3.8.1";
version = "3.8.3";
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
sha256 = "fc5471e1a54de15ef71c1bc6ebe80d4dc681ea600e68bfd1cbce40427f0b7578";
sha256 = "3828fb41b7203176b82fe5d699e0d845435f2374750a44b480ea6b930f6be269";
};
postPatch = ''

View file

@ -10,15 +10,15 @@
buildPythonPackage rec {
pname = "azure-eventgrid";
version = "4.9.0";
version = "4.9.1";
format = "setuptools";
disabled = pythonOlder "3.6";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
extension = "zip";
hash = "sha256-ueuOxhNATK6o/Vue+x5vtP0ac3CQellkuyQmSrq7tqQ=";
hash = "sha256-zRiS5XsinEQoyYsg2PSso3Y2pC7QwB1fbVkCF1OeQ3U=";
};
propagatedBuildInputs = [

View file

@ -11,7 +11,7 @@
buildPythonPackage rec {
pname = "azure-mgmt-containerservice";
version = "20.6.0";
version = "20.7.0";
format = "setuptools";
disabled = pythonOlder "3.7";
@ -19,7 +19,7 @@ buildPythonPackage rec {
src = fetchPypi {
inherit pname version;
extension = "zip";
hash = "sha256-zQ3Lg45rO1vgtsjQnokNFjWt6qnrNQ2CnElGJ0Dksew=";
hash = "sha256-tNuBIfObCWd8JXq49CDLOzMl1pw7ulTQJua7CNJjRuo=";
};
propagatedBuildInputs = [

View file

@ -17,14 +17,14 @@
buildPythonPackage rec {
pname = "bellows";
version = "0.34.2";
version = "0.34.3";
format = "setuptools";
src = fetchFromGitHub {
owner = "zigpy";
repo = "bellows";
rev = "refs/tags/${version}";
sha256 = "sha256-78LUQBFV4TFPDLiSHBG+RLnQLaCPX4LZpow9aszQAQA=";
sha256 = "sha256-7jaXNz7i+kF64T+5/QWKGpxHCkg/M9U2hbWrVB2tjH8=";
};
propagatedBuildInputs = [

View file

@ -18,7 +18,7 @@
buildPythonPackage rec {
pname = "build";
version = "0.8.0";
version = "0.9.0";
format = "pyproject";
disabled = pythonOlder "3.6";
@ -27,7 +27,7 @@ buildPythonPackage rec {
owner = "pypa";
repo = pname;
rev = version;
hash = "sha256-P0DFBYsL2Ce/JwfYss64+CY/IvzYZEiz9wuEslij+oU=";
hash = "sha256-iQvfZC/h9SbagExoG8dJ2A8G8gVRdMaRvEy9QcQIN5I=";
};
nativeBuildInputs = [

View file

@ -2,7 +2,6 @@
, attrs
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, exceptiongroup
, hypothesis
, immutables
@ -21,7 +20,7 @@
buildPythonPackage rec {
pname = "cattrs";
version = "22.1.0";
version = "22.2.0";
format = "pyproject";
disabled = pythonOlder "3.7";
@ -30,17 +29,9 @@ buildPythonPackage rec {
owner = "python-attrs";
repo = pname;
rev = "v${version}";
hash = "sha256-C8uIsewpgJfB1yYckWTwF5K32+2AAOrxFKB9I18RENg=";
hash = "sha256-Qnrq/mIA/t0mur6IAen4vTmMIhILWS6v5nuf+Via2hA=";
};
patches = [
(fetchpatch {
url = "https://github.com/python-attrs/cattrs/commit/290d162a589acf10ea63b825b7b283e23ca7698a.diff";
excludes = [ "poetry.lock" ];
hash = "sha256-n6c3qVg9umGKAxeTALq3QTJgO9DIj3SY0ZHhtsDeW94=";
})
];
nativeBuildInputs = [
poetry-core
];

View file

@ -8,14 +8,14 @@
buildPythonPackage rec {
pname = "exceptiongroup";
version = "1.0.0rc9";
version = "1.0.0";
format = "flit";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-kIakoh75sxxyGBx3wECgdLoIie5Wp7KJ/wr7DZdlX5Y=";
hash = "sha256-r/ur8T+26YmIw42cVlDnAVaf48HeMjPPthxfM3dGkK0=";
};
nativeBuildInputs = [

View file

@ -1,42 +1,44 @@
{ lib
, buildPythonPackage
, fetchPypi
, isPy3k
, fetchpatch
, python
, ipython
, pythonOlder
, fetchFromGitHub
, hatchling
, traitlets
, glibcLocales
, mock
, pytestCheckHook
, nose
}:
buildPythonPackage rec {
pname = "jupyter_core";
version = "4.9.2";
disabled = !isPy3k;
version = "4.11.2";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-1puuuf+xKLjNJlf88nA/icdp0Wc8hRgSEZ46Kg6TrZo=";
format = "pyproject";
src = fetchFromGitHub {
owner = "jupyter";
repo = "jupyter_core";
rev = version;
hash = "sha256-lDhwvhsOxLHBC6CQjCW/rmtHSuMRPC2yaurBd5K3FLc=";
};
checkInputs = [ pytestCheckHook mock glibcLocales nose ];
propagatedBuildInputs = [ ipython traitlets ];
patches = [
# install jupyter_core/*.py files
(fetchpatch {
url = "https://github.com/jupyter/jupyter_core/pull/253/commits/3bbeaebec0a53520523162d5e8d5c6ca02b1b782.patch";
sha256 = "sha256-QeAfj7wLz4egVUPMAgrZ9Wn/Tv60LrIXLgHGVoH41wQ=";
})
./tests_respect_pythonpath.patch
];
nativeBuildInputs = [
hatchling
];
propagatedBuildInputs = [
traitlets
];
checkInputs = [
pytestCheckHook
];
preCheck = ''
export HOME=$TMPDIR
export LC_ALL=en_US.utf8
'';
disabledTests = [
@ -51,7 +53,7 @@ buildPythonPackage rec {
pythonImportsCheck = [ "jupyter_core" ];
meta = with lib; {
description = "Jupyter core package. A base package on which Jupyter projects rely";
description = "Base package on which Jupyter projects rely";
homepage = "https://jupyter.org/";
license = licenses.bsd3;
maintainers = with maintainers; [ fridh ];

View file

@ -1,20 +1,22 @@
diff --git a/jupyter_core/tests/test_command.py b/jupyter_core/tests/test_command.py
index 4ef38cd..08fba22 100644
--- a/jupyter_core/tests/test_command.py
+++ b/jupyter_core/tests/test_command.py
@@ -131,7 +131,7 @@ def test_not_on_path(tmpdir):
witness_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS ME")')
@@ -174,7 +174,7 @@ def test_not_on_path(tmpdir):
witness_src = "#!{}\n{}\n".format(sys.executable, 'print("WITNESS ME")')
write_executable(witness, witness_src)
- env = {'PATH': ''}
+ env = {'PATH': '', 'PYTHONPATH': os.environ['PYTHONPATH']}
if 'SYSTEMROOT' in os.environ: # Windows http://bugs.python.org/issue20614
env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT']
if sys.platform == 'win32':
@@ -157,7 +157,7 @@ def test_path_priority(tmpdir):
witness_b_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS B")')
- env = {"PATH": ""}
+ env = {"PATH": "", "PYTHONPATH": os.environ["PYTHONPATH"]}
if "SYSTEMROOT" in os.environ: # Windows http://bugs.python.org/issue20614
env["SYSTEMROOT"] = os.environ["SYSTEMROOT"]
if sys.platform == "win32":
@@ -198,7 +198,7 @@ def test_path_priority(tmpdir):
witness_b_src = "#!{}\n{}\n".format(sys.executable, 'print("WITNESS B")')
write_executable(witness_b, witness_b_src)
- env = {'PATH': str(b)}
+ env = {'PATH': str(b), 'PYTHONPATH': os.environ['PYTHONPATH']}
if 'SYSTEMROOT' in os.environ: # Windows http://bugs.python.org/issue20614
env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT']
if sys.platform == 'win32':
- env = {"PATH": str(b)}
+ env = {"PATH": str(b), "PYTHONPATH": os.environ["PYTHONPATH"]}
if "SYSTEMROOT" in os.environ: # Windows http://bugs.python.org/issue20614
env["SYSTEMROOT"] = os.environ["SYSTEMROOT"]
if sys.platform == "win32":

View file

@ -2,6 +2,7 @@
, stdenv
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, GitPython
, isort
, jupyter-client
@ -31,6 +32,13 @@ buildPythonPackage rec {
sha256 = "sha256-DDF4aTLkhEl4xViYh/E0/y6swcwZ9KbeS0qKm+HdFz8=";
};
patches = [
(fetchpatch {
url = "https://github.com/mwouts/jupytext/commit/be9b65b03600227b737b5f10ea259a7cdb762b76.patch";
hash = "sha256-3klx8I+T560EVfsKe/FlrSjF6JzdKSCt6uhAW2cSwtc=";
})
];
buildInputs = [
jupyter-packaging
jupyterlab

View file

@ -21,6 +21,8 @@ buildPythonPackage rec {
};
postPatch = ''
substituteInPlace setup.py \
--replace "nbconvert>=6.2.0,<7.0.0" "nbconvert>=6.2.0"
substituteInPlace mkdocs_jupyter/tests/test_base_usage.py \
--replace "[\"mkdocs\"," "[\"${mkdocs.out}/bin/mkdocs\","
'';

View file

@ -4,78 +4,80 @@
, defusedxml
, fetchPypi
, fetchpatch
, fetchurl
, hatchling
, importlib-metadata
, ipywidgets
, jinja2
, jupyter_core
, jupyterlab-pygments
, lib
, markupsafe
, mistune
, nbclient
, packaging
, pandocfilters
, pygments
, pyppeteer
, pytestCheckHook
, pythonOlder
, tinycss2
, traitlets
}:
buildPythonPackage rec {
let
# see https://github.com/jupyter/nbconvert/issues/1896
style-css = fetchurl {
url = "https://cdn.jupyter.org/notebook/5.4.0/style/style.min.css";
hash = "sha256-WGWmCfRDewRkvBIc1We2GQdOVAoFFaO4LyIvdk61HgE=";
};
in buildPythonPackage rec {
pname = "nbconvert";
version = "6.5.3";
format = "setuptools";
version = "7.2.3";
disabled = pythonOlder "3.7";
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-EO1pPEz9PGNYPIfKXDovbth0FFEDWV84JO/Mjfy3Uiw=";
hash = "sha256-eufMxoSVtWXasVNFnufmUDmXCRPrEVBw2m4sZzzw6fg=";
};
# Add $out/share/jupyter to the list of paths that are used to search for
# various exporter templates
patches = [
./templates.patch
# Use mistune 2.x
(fetchpatch {
name = "support-mistune-2.x.patch";
url = "https://github.com/jupyter/nbconvert/commit/e870d9a4a61432a65bee5466c5fa80c9ee28966e.patch";
hash = "sha256-kdOmE7BnkRy2lsNQ2OVrEXXZntJUPJ//b139kSsfKmI=";
excludes = [ "pyproject.toml" ];
})
# patch nbconvert/filters/markdown_mistune.py
(fetchpatch {
name = "clean-up-markdown-parsing.patch";
url = "https://github.com/jupyter/nbconvert/commit/4df1f5451c9c3e8121036dfbc7e07f0095f4d524.patch";
hash = "sha256-O+VWUaQi8UMCpE9/h/IsrenmEuJ2ac/kBkUBq7GFJTY";
})
(fetchpatch {
name = "fix-markdown-table.patch";
url = "https://github.com/jupyter/nbconvert/commit/d3900ed4527f024138dc3a8658c6a1b1dfc43c09.patch";
hash = "sha256-AFE1Zhw29JMLB0Sj17zHcOfy7VEFqLekO8NYbyMLrdI=";
})
];
postPatch = ''
substituteAllInPlace ./nbconvert/exporters/templateexporter.py
# Use mistune 2.x
substituteInPlace setup.py \
--replace "mistune>=0.8.1,<2" "mistune>=2.0.3,<3"
# Equivalent of the upstream patch https://github.com/jupyter/nbconvert/commit/aec39288c9a6c614d659bcaf9f5cb36634d6b37b.patch
substituteInPlace share/jupyter/nbconvert/templates/lab/base.html.j2 \
--replace "{{ output.data['image/svg+xml'] | clean_html }}" "{{ output.data['image/svg+xml'].encode(\"utf-8\") | clean_html }}"
mkdir -p share/templates/classic/static
cp ${style-css} share/templates/classic/static/style.css
'';
nativeBuildInputs = [
hatchling
];
propagatedBuildInputs = [
beautifulsoup4
bleach
defusedxml
jinja2
jupyter_core
jupyterlab-pygments
markupsafe
mistune
nbclient
packaging
pandocfilters
pygments
tinycss2
traitlets
] ++ lib.optionals (pythonOlder "3.10") [
importlib-metadata
];
preCheck = ''
@ -88,15 +90,13 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [
# DeprecationWarning: Support for bleach <5 will be removed in a future version of nbconvert
"-W ignore::DeprecationWarning"
];
disabledTests = [
# Attempts network access (Failed to establish a new connection: [Errno -3] Temporary failure in name resolution)
"test_export"
"test_webpdf_with_chromium"
# ModuleNotFoundError: No module named 'nbconvert.tests'
"test_convert_full_qualified_name"
"test_post_processor"
];
# Some of the tests use localhost networking.

View file

@ -1,50 +1,48 @@
{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
, hatchling
, hatch-nodejs-version
, fastjsonschema
, flit-core
, pytestCheckHook
, glibcLocales
, ipython_genutils
, traitlets
, testpath
, jsonschema
, jupyter_core
, traitlets
, pep440
, pytestCheckHook
, testpath
}:
buildPythonPackage rec {
pname = "nbformat";
version = "5.5.0";
version = "5.7.0";
disabled = pythonOlder "3.7";
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-nr4w5sOz5bR9Of8KOJehrPUj0r+vy04tBM23D4pmxQc=";
sha256 = "1d4760c15c1a04269ef5caf375be8b98dd2f696e5eb9e603ec2bf091f9b0d3f3";
};
nativeBuildInputs = [
flit-core
hatchling
hatch-nodejs-version
];
LC_ALL="en_US.utf8";
propagatedBuildInputs = [
fastjsonschema
ipython_genutils
jsonschema
jupyter_core
pep440
testpath
traitlets
];
checkInputs = [ pytestCheckHook glibcLocales ];
preCheck = ''
mkdir tmp
export HOME=tmp
'';
checkInputs = [
pep440
pytestCheckHook
testpath
];
# Some of the tests use localhost networking.
__darwinAllowLocalNetworking = true;

View file

@ -6,15 +6,29 @@
, isPyPy
}:
let
versionMajor = lib.versions.major protobuf.version;
versionMinor = lib.versions.minor protobuf.version;
versionPatch = lib.versions.patch protobuf.version;
in
buildPythonPackage {
inherit (protobuf) pname src version;
inherit (protobuf) pname src;
# protobuf 3.21 coresponds with its python library 4.21
version =
if lib.versionAtLeast protobuf.version "3.21"
then "${toString (lib.toInt versionMajor + 1)}.${versionMinor}.${versionPatch}"
else protobuf.version;
disabled = isPyPy;
sourceRoot = "source/python";
prePatch = ''
while [ ! -d python ]; do
cd *
done
cd python
if [[ "$(<../version.json)" != *'"python": "'"$version"'"'* ]]; then
echo "Python library version mismatch. Derivation version: $version, actual: $(<../version.json)"
exit 1
fi
'';
nativeBuildInputs = [ pyext ];

Some files were not shown because too many files have changed in this diff Show more