Skip to content

Commit

Permalink
Merge #312133: staging-next 2024-05-15 - last for 24.05
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed May 21, 2024
2 parents 7a35ba8 + 7b015fb commit e40d38e
Show file tree
Hide file tree
Showing 81 changed files with 2,770 additions and 613 deletions.
9 changes: 9 additions & 0 deletions pkgs/applications/graphics/rawtherapee/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchurl
, cmake
, pkg-config
, wrapGAppsHook3
Expand Down Expand Up @@ -37,6 +38,14 @@ stdenv.mkDerivation rec {
forceFetchGit = true;
};

# https://github.com/Beep6581/RawTherapee/issues/7074
patches = [
(fetchurl {
url = "https://github.com/Beep6581/RawTherapee/commit/6b9f45c69c1ddfc3607d3d9c1206dcf1def30295.diff";
hash = "sha256-3Rti9HV8N1ueUm5B9qxEZL7Lb9bBb+iy2AGKMpJ9YOM=";
})
];

postPatch = ''
echo "set(HG_VERSION ${version})" > ReleaseInfo.cmake
substituteInPlace tools/osx/Info.plist.in rtgui/config.h.in \
Expand Down
11 changes: 10 additions & 1 deletion pkgs/applications/networking/browsers/chromium/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
, pkgsBuildHost
# configurePhase:
, gnChromium
, symlinkJoin

# Build inputs:
, libpng
Expand Down Expand Up @@ -378,6 +379,14 @@ let
${ungoogler}/utils/domain_substitution.py apply -r ${ungoogler}/domain_regex.list -f ${ungoogler}/domain_substitution.list -c ./ungoogled-domsubcache.tar.gz .
'';

llvmCcAndBintools = symlinkJoin {
name = "llvmCcAndBintools";
paths = [
pkgsBuildTarget.${llvmPackages_attrName}.llvm
pkgsBuildTarget.${llvmPackages_attrName}.stdenv.cc
];
};

gnFlags = mkGnFlags ({
# Main build and toolchain settings:
# Create an official and optimized release build (only official builds
Expand Down Expand Up @@ -445,7 +454,7 @@ let
rtc_use_pipewire = true;
# Disable PGO because the profile data requires a newer compiler version (LLVM 14 isn't sufficient):
chrome_pgo_phase = 0;
clang_base_path = "${pkgsBuildTarget.${llvmPackages_attrName}.stdenv.cc}";
clang_base_path = "${llvmCcAndBintools}";
use_qt = false;
# To fix the build as we don't provide libffi_pic.a
# (ld.lld: error: unable to find library -l:libffi_pic.a):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, nodejs, python3, callPackage, removeReferencesTo
{ lib, stdenv, fetchFromGitHub, nodejs, python3, removeReferencesTo
, pkg-config, libsecret, xcbuild, Security, AppKit, fetchNpmDeps, npmHooks }:

let
Expand Down Expand Up @@ -31,6 +31,17 @@ in stdenv.mkDerivation rec {

doCheck = false;

postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
pkg-config() { "''${PKG_CONFIG}" "$@"; }
export -f pkg-config
'';

# https://nodejs.org/api/os.html#osarch
npmFlagsArray = [ "--arch=${if stdenv.hostPlatform.parsed.cpu.name == "i686" then "ia32"
else if stdenv.hostPlatform.parsed.cpu.name == "x86_64" then "x64"
else if stdenv.hostPlatform.parsed.cpu.name == "aarch64" then "arm64"
else stdenv.hostPlatform.parsed.cpu.name}" ];

installPhase = ''
runHook preInstall
shopt -s extglob
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, rustPlatform, fetchFromGitHub, callPackage, sqlcipher, nodejs, python3, yarn, fixup-yarn-lock, CoreServices, fetchYarnDeps, removeReferencesTo }:
{ lib, stdenv, rustPlatform, fetchFromGitHub, rust, sqlcipher, nodejs, python3, yarn, fixup-yarn-lock, CoreServices, fetchYarnDeps, removeReferencesTo }:

let
pinData = lib.importJSON ./pin.json;
Expand Down Expand Up @@ -36,7 +36,7 @@ in rustPlatform.buildRustPackage rec {
fixup-yarn-lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
node_modules/.bin/neon build --release
node_modules/.bin/neon build --release -- --target ${rust.toRustTargetSpec stdenv.hostPlatform} -Z unstable-options --out-dir target/release
runHook postBuild
'';

Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/version-management/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ assert sendEmailSupport -> perlSupport;
assert svnSupport -> perlSupport;

let
version = "2.44.0";
version = "2.44.1";
svn = subversionClient.override { perlBindings = perlSupport; };
gitwebPerlLibs = with perlPackages; [ CGI HTMLParser CGIFast FCGI FCGIProcManager HTMLTagCloud ];
in
Expand All @@ -42,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: {

src = fetchurl {
url = "https://www.kernel.org/pub/software/scm/git/git-${version}.tar.xz";
hash = "sha256-41hzjctbXqNAzpAKABXAOuhugE5/9k5HqkYx3e5oHeM=";
hash = "sha256-e2CmJMD3AJoWuFYlBiGq/c3YXrjUS7AgYXtlJbhyYeQ=";
};

outputs = [ "out" ] ++ lib.optional withManual "doc";
Expand Down
28 changes: 28 additions & 0 deletions pkgs/by-name/li/libcamera/ipa-priv-key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCocmtyzPPjv+52
JiZrpZFfaZ0eeUgugc8gV+0+2Q9GEkl/xxqjiDVg31gBO3iwQov2NmGuPbXr+vwZ
QcUqNQakmmdi22tBaTtd6hMuhu9OfbP8sIFaf0dToZRHkPgf63+WCF6w0O9enEz4
zjW3kPa1eVRVekiYCXGML/VhN+h5WwWouNWgEOw5JH39ZuGmhsGN5XekkHtyMkwq
Vr+JodoSizhYs9VBYNA1J4PlyiS4BYr4pLiLffzPwRjcSS777x33g+nWNr1lsFxB
nDoVvVnq0E7fiXxlmCtAr/7dv0Ug5ixuNfZ9yoT0f+mfUiG/anmfodHujIm2Db37
jvmfxaq1AgMBAAECggEAFhJKBHSY92xod0g37A55fiZFTV8oZ1mgdXU386522yBd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vP4cpd8rKOCRs9nSXFJFXCedTLy
ojSVfjTyJMTVJxab/c/Qugkxb/TqGfEnZF2yoTsfPYp2pXRd6DvyKlDQzlSOj933
FrqeSe1QKapuPRsujVwLZDU=
-----END PRIVATE KEY-----
30 changes: 17 additions & 13 deletions pkgs/by-name/li/libcamera/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ stdenv
, fetchgit
, lib
, fetchpatch
, meson
, ninja
, pkg-config
Expand Down Expand Up @@ -33,12 +32,24 @@ stdenv.mkDerivation rec {
hash = "sha256-x0Im9m9MoACJhQKorMI34YQ+/bd62NdAPc2nWwaJAvM=";
};

outputs = [ "out" "dev" "doc" ];
outputs = [ "out" "dev" ];

postPatch = ''
patchShebangs utils/
'';

# 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. For reproducibility, we use a static private key.
#
# 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).
preBuild = ''
ninja src/ipa-priv-key.pem
install -D ${./ipa-priv-key.pem} src/ipa-priv-key.pem
'';

strictDeps = true;

buildInputs = [
Expand Down Expand Up @@ -86,6 +97,10 @@ stdenv.mkDerivation rec {
# Avoid blanket -Werror to evade build failures on less
# tested compilers.
"-Dwerror=false"
# Documentation breaks binary compatibility.
# Given that upstream also provides public documentation,
# we can disable it here.
"-Ddocumentation=disabled"
];

# Fixes error on a deprecated declaration
Expand All @@ -94,17 +109,6 @@ stdenv.mkDerivation rec {
# 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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@

stdenv.mkDerivation (finalAttrs: {
pname = "unbound";
version = "1.19.3";
version = "1.20.0";

src = fetchurl {
url = "https://nlnetlabs.nl/downloads/unbound/unbound-${finalAttrs.version}.tar.gz";
hash = "sha256-OuMivn3C+DFgPksDkUNVM61YYcIyLjSnYAap+2XrVrk=";
hash = "sha256-VrTO7TNjlSIAD9lndVdt34eCuzYXYQcV1/Hnd8XsHb8=";
};

outputs = [ "out" "lib" "man" ]; # "dev" would only split ~20 kB
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/vu/vulkan-volk/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

stdenv.mkDerivation (finalAttrs: {
pname = "volk";
version = "1.3.280.0";
version = "1.3.283.0";

src = fetchFromGitHub {
owner = "zeux";
repo = "volk";
rev = "vulkan-sdk-${finalAttrs.version}";
hash = "sha256-e4TLGRqn0taYeiRVxc9WevURjO5dsVq3RpOwZBGDknQ=";
hash = "sha256-AoUStYeSTu6YmdyKgx0n3O+p3asb39GU6HSHgOhhFhQ=";
};

nativeBuildInputs = [ cmake ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/glslang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
}:
stdenv.mkDerivation rec {
pname = "glslang";
version = "14.1.0";
version = "14.2.0";

src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "glslang";
rev = version;
hash = "sha256-trm5bR3/2w+oQppHQBB+b6l0N0sLjTk5+rRGDfnGb+8=";
hash = "sha256-B6jVCeoFjd2H6+7tIses+Kj8DgHS6E2dkVzQAIzDHEc=";
};

# These get set at all-packages, keep onto them for child drvs
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/go/1.22.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "go";
version = "1.22.2";
version = "1.22.3";

src = fetchurl {
url = "https://go.dev/dl/go${finalAttrs.version}.src.tar.gz";
hash = "sha256-N06oKyiexzjpaCZ8rFnH1f8YD5SSJQJUeEsgROkN9ak=";
hash = "sha256-gGSO80+QMZPXKlnA3/AZ9fmK4MmqE63gsOy/+ZGnb2g=";
};

strictDeps = true;
Expand Down
31 changes: 31 additions & 0 deletions pkgs/development/compilers/llvm/common/libcxx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ let

cxxCMakeFlags = [
"-DLIBCXX_CXX_ABI=${cxxabiName}"
] ++ lib.optionals (cxxabi == null && lib.versionAtLeast release_version "16") [
# Note: llvm < 16 doesn't support this flag (or it's broken); handled in postInstall instead.
# Include libc++abi symbols within libc++.a for static linking libc++;
# dynamic linking includes them through libc++.so being a linker script
# which includes both shared objects.
"-DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON"
] ++ lib.optionals (cxxabi != null) [
"-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${lib.getDev cxxabi}/include"
] ++ lib.optionals (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) [
Expand Down Expand Up @@ -126,6 +132,31 @@ stdenv.mkDerivation (rec {
postInstall = lib.optionalString (cxxabi != null) ''
lndir ${lib.getDev cxxabi}/include $dev/include/c++/v1
lndir ${lib.getLib cxxabi}/lib $out/lib
libcxxabi=$out/lib/lib${cxxabi.libName}.a
''
# LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON doesn't work for LLVM < 16 or
# external cxxabi libraries so merge libc++abi.a into libc++.a ourselves.

# GNU binutils emits objects in LIFO order in MRI scripts so after the merge
# the objects are in reversed order so a second MRI script is required so the
# objects in the archive are listed in proper order (libc++.a, libc++abi.a)
+ lib.optionalString (cxxabi != null || lib.versionOlder release_version "16") ''
libcxxabi=''${libcxxabi-$out/lib/libc++abi.a}
if [[ -f $out/lib/libc++.a && -e $libcxxabi ]]; then
$AR -M <<MRI
create $out/lib/libc++.a
addlib $out/lib/libc++.a
addlib $libcxxabi
save
end
MRI
$AR -M <<MRI
create $out/lib/libc++.a
addlib $out/lib/libc++.a
save
end
MRI
fi
'';

passthru = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import collections
import sys
import os
from typing import Dict, List, Tuple
from typing import Dict, List, Set, Tuple
do_abort: bool = False
packages: Dict[str, Dict[str, List[Dict[str, List[str]]]]] = collections.defaultdict(list)
packages: Dict[str, Dict[str, Dict[str, List[str]]]] = collections.defaultdict(dict)
found_paths: Set[Path] = set()
out_path: Path = Path(os.getenv("out"))
version: Tuple[int, int] = sys.version_info
site_packages_path: str = f'lib/python{version[0]}.{version[1]}/site-packages'
Expand All @@ -31,21 +32,23 @@ def describe_parents(parents: List[str]) -> str:

# inserts an entry into 'packages'
def add_entry(name: str, version: str, store_path: str, parents: List[str]) -> None:
if name not in packages:
packages[name] = {}
if store_path not in packages[name]:
packages[name][store_path] = []
packages[name][store_path].append(dict(
packages[name][store_path] = dict(
version=version,
parents=parents,
))
)


# transitively discover python dependencies and store them in 'packages'
def find_packages(store_path: Path, site_packages_path: str, parents: List[str]) -> None:
site_packages: Path = (store_path / site_packages_path)
propagated_build_inputs: Path = (store_path / "nix-support/propagated-build-inputs")

# only visit each path once, to avoid exponential complexity with highly
# connected dependency graphs
if store_path in found_paths:
return
found_paths.add(store_path)

# add the current package to the list
if site_packages.exists():
for dist_info in site_packages.glob("*.dist-info"):
Expand All @@ -55,10 +58,9 @@ def find_packages(store_path: Path, site_packages_path: str, parents: List[str])
# recursively add dependencies
if propagated_build_inputs.exists():
with open(propagated_build_inputs, "r") as f:
build_inputs: List[str] = f.read().strip().split(" ")
build_inputs: List[str] = f.read().split()
for build_input in build_inputs:
if build_input not in parents:
find_packages(Path(build_input), site_packages_path, parents + [build_input])
find_packages(Path(build_input), site_packages_path, parents + [build_input])


find_packages(out_path, site_packages_path, [f"this derivation: {out_path}"])
Expand All @@ -68,10 +70,9 @@ def find_packages(store_path: Path, site_packages_path: str, parents: List[str])
if len(store_paths) > 1:
do_abort = True
print("Found duplicated packages in closure for dependency '{}': ".format(name))
for store_path, candidates in store_paths.items():
for candidate in candidates:
print(f" {name} {candidate['version']} ({store_path})")
print(describe_parents(candidate['parents']))
for store_path, candidate in store_paths.items():
print(f" {name} {candidate['version']} ({store_path})")
print(describe_parents(candidate['parents']))

# fail if duplicates were found
if do_abort:
Expand Down
Loading

0 comments on commit e40d38e

Please sign in to comment.