diff --git a/lib/systems/default.nix b/lib/systems/default.nix index f4784c61c675..3558ce32fc8c 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -9,6 +9,39 @@ rec { examples = import ./examples.nix { inherit lib; }; architectures = import ./architectures.nix { inherit lib; }; + /* + Elaborated systems contain functions, which means that they don't satisfy + `==` for a lack of reflexivity. + + They might *appear* to satisfy `==` reflexivity when the same exact value is + compared to itself, because object identity is used as an "optimization"; + compare the value with a reconstruction of itself, e.g. with `f == a: f a`, + or perhaps calling `elaborate` twice, and one will see reflexivity fail as described. + + Hence a custom equality test. + + Note that this does not canonicalize the systems, so you'll want to make sure + both arguments have been `elaborate`-d. + */ + equals = + let removeFunctions = a: lib.filterAttrs (_: v: !builtins.isFunction v) a; + in a: b: removeFunctions a == removeFunctions b; + + /* + Try to convert an elaborated system back to a simple string. If not possible, + return null. So we have the property: + + sys: _valid_ sys -> + sys == elaborate (toLosslessStringMaybe sys) + + NOTE: This property is not guaranteed when `sys` was elaborated by a different + version of Nixpkgs. + */ + toLosslessStringMaybe = sys: + if lib.isString sys then sys + else if equals sys (elaborate sys.system) then sys.system + else null; + /* List of all Nix system doubles the nixpkgs flake will expose the package set for. All systems listed here must be supported by nixpkgs as `localSystem`. diff --git a/lib/tests/release.nix b/lib/tests/release.nix index c3bf58db241f..5bade7112f19 100644 --- a/lib/tests/release.nix +++ b/lib/tests/release.nix @@ -53,6 +53,9 @@ let echo "Running lib/tests/sources.sh" TEST_LIB=$PWD/lib bash lib/tests/sources.sh + echo "Running lib/tests/systems.nix" + [[ $(nix-instantiate --eval --strict lib/tests/systems.nix | tee /dev/stderr) == '[ ]' ]]; + mkdir $out echo success > $out/${nix.version} ''; diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix index 2afe128c4208..862496313e90 100644 --- a/lib/tests/systems.nix +++ b/lib/tests/systems.nix @@ -1,10 +1,8 @@ -# We assert that the new algorithmic way of generating these lists matches the -# way they were hard-coded before. +# Run: +# [nixpkgs]$ nix-instantiate --eval --strict lib/tests/systems.nix +# Expected output: [], or the failed cases # -# One might think "if we exhaustively test, what's the point of procedurally -# calculating the lists anyway?". The answer is one can mindlessly update these -# tests as new platforms become supported, and then just give the diff a quick -# sanity check before committing :). +# OfBorg runs (approximately) nix-build lib/tests/release.nix let lib = import ../default.nix; mseteq = x: y: { @@ -12,7 +10,16 @@ let expected = lib.sort lib.lessThan y; }; in -with lib.systems.doubles; lib.runTests { +lib.runTests ( +# We assert that the new algorithmic way of generating these lists matches the +# way they were hard-coded before. +# +# One might think "if we exhaustively test, what's the point of procedurally +# calculating the lists anyway?". The answer is one can mindlessly update these +# tests as new platforms become supported, and then just give the diff a quick +# sanity check before committing :). + +(with lib.systems.doubles; { testall = mseteq all (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ wasi ++ windows ++ embedded ++ mmix ++ js ++ genode ++ redox); testarm = mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv6l-netbsd" "armv6l-none" "armv7a-linux" "armv7a-netbsd" "armv7l-linux" "armv7l-netbsd" "arm-none" "armv7a-darwin" ]; @@ -39,4 +46,44 @@ with lib.systems.doubles; lib.runTests { testopenbsd = mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ]; testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "i686-windows" "x86_64-windows" ]; testunix = mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ cygwin ++ redox); +}) + +// { + test_equals_example_x86_64-linux = { + expr = lib.systems.equals (lib.systems.elaborate "x86_64-linux") (lib.systems.elaborate "x86_64-linux"); + expected = true; + }; + + test_toLosslessStringMaybe_example_x86_64-linux = { + expr = lib.systems.toLosslessStringMaybe (lib.systems.elaborate "x86_64-linux"); + expected = "x86_64-linux"; + }; + test_toLosslessStringMaybe_fail = { + expr = lib.systems.toLosslessStringMaybe (lib.systems.elaborate "x86_64-linux" // { something = "extra"; }); + expected = null; + }; } + +# Generate test cases to assert that a change in any non-function attribute makes a platform unequal +// lib.concatMapAttrs (platformAttrName: origValue: { + + ${"test_equals_unequal_${platformAttrName}"} = + let modified = + assert origValue != arbitraryValue; + lib.systems.elaborate "x86_64-linux" // { ${platformAttrName} = arbitraryValue; }; + arbitraryValue = x: "<>"; + in { + expr = lib.systems.equals (lib.systems.elaborate "x86_64-linux") modified; + expected = { + # Changes in these attrs are not detectable because they're function. + # The functions should be derived from the data, so this is not a problem. + canExecute = null; + emulator = null; + emulatorAvailable = null; + isCompatible = null; + }?${platformAttrName}; + }; + +}) (lib.systems.elaborate "x86_64-linux" /* arbitrary choice, just to get all the elaborated attrNames */) + +) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 1bcc00c334bb..33a76819b8e9 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3098,6 +3098,15 @@ githubId = 34317; name = "Corey O'Connor"; }; + code-asher = { + email = "ash@coder.com"; + github = "code-asher"; + githubId = 45609798; + name = "Asher"; + keys = [{ + fingerprint = "6E3A FA6D 915C C2A4 D26F C53E 7BB4 BA9C 783D 2BBC"; + }]; + }; CodeLongAndProsper90 = { github = "CodeLongAndProsper90"; githubId = 50145141; diff --git a/nixos/lib/test-driver/test_driver/machine.py b/nixos/lib/test-driver/test_driver/machine.py index ff2cbe4109bc..81d3e19084ed 100644 --- a/nixos/lib/test-driver/test_driver/machine.py +++ b/nixos/lib/test-driver/test_driver/machine.py @@ -868,7 +868,7 @@ class Machine: # to match multiline regexes. console = io.StringIO() - def console_matches() -> bool: + def console_matches(_: Any) -> bool: nonlocal console try: # This will return as soon as possible and @@ -884,7 +884,7 @@ class Machine: if timeout is not None: retry(console_matches, timeout) else: - while not console_matches(): + while not console_matches(False): pass def send_key( diff --git a/nixos/modules/programs/cfs-zen-tweaks.nix b/nixos/modules/programs/cfs-zen-tweaks.nix index 97c2570475c4..fc05bcd11ecb 100644 --- a/nixos/modules/programs/cfs-zen-tweaks.nix +++ b/nixos/modules/programs/cfs-zen-tweaks.nix @@ -23,6 +23,12 @@ in config = mkIf cfg.enable { systemd.packages = [ pkgs.cfs-zen-tweaks ]; - systemd.services.set-cfs-tweak.wantedBy = [ "multi-user.target" "suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target" ]; + systemd.services.set-cfs-tweaks.wantedBy = [ + "multi-user.target" + "suspend.target" + "hibernate.target" + "hybrid-sleep.target" + "suspend-then-hibernate.target" + ]; }; } diff --git a/nixos/tests/systemd-initrd-vconsole.nix b/nixos/tests/systemd-initrd-vconsole.nix index b74df410c422..d4c2a57680c1 100644 --- a/nixos/tests/systemd-initrd-vconsole.nix +++ b/nixos/tests/systemd-initrd-vconsole.nix @@ -2,7 +2,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: { name = "systemd-initrd-vconsole"; nodes.machine = { pkgs, ... }: { - boot.kernelParams = [ "rd.systemd.unit=rescue.target" ]; + boot.kernelParams = lib.mkAfter [ "rd.systemd.unit=rescue.target" "loglevel=3" "udev.log_level=3" "systemd.log_level=warning" ]; boot.initrd.systemd = { enable = true; @@ -20,14 +20,23 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: { machine.start() machine.wait_for_console_text("Press Enter for maintenance") machine.send_console("\n") - machine.wait_for_console_text("Logging in with home") + + # Wait for shell to become ready + for _ in range(300): + machine.send_console("printf '%s to receive commands:\\n' Ready\n") + try: + machine.wait_for_console_text("Ready to receive commands:", timeout=1) + break + except Exception: + continue + else: + raise RuntimeError("Rescue shell never became ready") # Check keymap - machine.send_console("(printf '%s to receive text: \\n' Ready && read text && echo \"$text\") //build/mvm + platformDir + , vmName + , scriptName + , configureFlagsArray + , configureFlags + }: + let + src = fetchFromGitHub { + owner = "OpenSmalltalk"; + repo = "opensmalltalk-vm"; + rev = "202206021410"; + hash = "sha256-QqElPiJuqD5svFjWrLz1zL0Tf+pHxQ2fPvkVRn2lyBI="; + }; + in + stdenv.mkDerivation { + pname = + let vmNameNoDots = builtins.replaceStrings [ "." ] [ "-" ] vmName; + in "opensmalltalk-vm-${platformDir}-${vmNameNoDots}"; + version = src.rev; + + inherit src; + + postPatch = + '' + vmVersionFiles=$(sed -n 's/^versionfiles="\(.*\)"/\1/p' ./scripts/updateSCCSVersions) + for vmVersionFile in $vmVersionFiles; do + substituteInPlace "$vmVersionFile" \ + --replace "\$Date\$" "\$Date: Thu Jan 1 00:00:00 1970 +0000 \$" \ + --replace "\$URL\$" "\$URL: ${src.url} \$" \ + --replace "\$Rev\$" "\$Rev: ${src.rev} \$" \ + --replace "\$CommitHash\$" "\$CommitHash: 000000000000 \$" + done + patchShebangs --build ./building/${platformDir} scripts + substituteInPlace ./platforms/unix/config/mkmf \ + --replace "/bin/rm" "rm" + substituteInPlace ./platforms/unix/config/configure \ + --replace "/usr/bin/file" "file" \ + --replace "/usr/bin/pkg-config" "pkg-config" \ + ''; + + preConfigure = '' + cd building/${platformDir}/${vmName}/build + # Exits with non-zero code if the check fails, counterintuitively + ../../../../scripts/checkSCCSversion && exit 1 + cp ../plugins.int ../plugins.ext . + configureFlagsArray=${configureFlagsArray} + ''; + + configureScript = "../../../../platforms/unix/config/configure"; + + configureFlags = [ "--with-scriptname=${scriptName}" ] ++ configureFlags; + + buildFlags = "all"; + + enableParallelBuilding = true; + + nativeBuildInputs = [ + file + pkg-config + ]; + + buildInputs = [ + alsa-lib + freetype + libpulseaudio + libtool + libuuid + openssl + pango + xorg.libX11 + xorg.libXrandr + ]; + + postInstall = '' + rm "$out/squeak" + cd "$out/bin" + BIN="$(find ../lib -type f -name squeak)" + for f in $(find . -type f); do + rm "$f" + ln -s "$BIN" "$f" + done + ''; + + meta = { + description = "The cross-platform virtual machine for Squeak, Pharo, Cuis, and Newspeak."; + mainProgram = scriptName; + homepage = "https://opensmalltalk.org/"; + license = with lib.licenses; [ mit ]; + maintainers = with lib.maintainers; [ jakewaksbaum ]; + platforms = [ stdenv.targetPlatform.system ]; + }; + }; + + vmsByPlatform = { + "aarch64-linux" = { + "squeak-cog-spur" = buildVM { + platformDir = "linux64ARMv8"; + vmName = "squeak.cog.spur"; + scriptName = "squeak"; + configureFlagsArray = ''( + CFLAGS="-DNDEBUG -DDEBUGVM=0 -DMUSL -D_GNU_SOURCE -DUSEEVDEV -DCOGMTVM=0 -DDUAL_MAPPED_CODE_ZONE=1" + LIBS="-lrt" + )''; + configureFlags = [ + "--with-vmversion=5.0" + "--with-src=src/spur64.cog" + "--without-npsqueak" + "--enable-fast-bitblt" + ]; + }; + + "squeak-stack-spur" = buildVM { + platformDir = "linux64ARMv8"; + vmName = "squeak.stack.spur"; + scriptName = "squeak"; + configureFlagsArray = ''( + CFLAGS="-DNDEBUG -DDEBUGVM=0 -DMUSL -D_GNU_SOURCE -DUSEEVDEV -D__ARM_ARCH_ISA_A64 -DARM64 -D__arm__ -D__arm64__ -D__aarch64__" + )''; + configureFlags = [ + "--with-vmversion=5.0" + "--with-src=src/spur64.stack" + "--disable-cogit" + "--without-npsqueak" + ]; + }; + }; + + "x86_64-linux" = { + "newspeak-cog-spur" = buildVM { + platformDir = "linux64x64"; + vmName = "newspeak.cog.spur"; + scriptName = "newspeak"; + configureFlagsArray = ''( + CFLAGS="-DNDEBUG -DDEBUGVM=0" + )''; + configureFlags = [ + "--with-vmversion=5.0" + "--with-src=src/spur64.cog.newspeak" + "--without-vm-display-fbdev" + "--without-npsqueak" + ]; + }; + + "squeak-cog-spur" = buildVM { + platformDir = "linux64x64"; + vmName = "squeak.cog.spur"; + scriptName = "squeak"; + configureFlagsArray = ''( + CFLAGS="-DNDEBUG -DDEBUGVM=0 -DCOGMTVM=0" + )''; + configureFlags = [ + "--with-vmversion=5.0" + "--with-src=src/spur64.cog" + "--without-npsqueak" + ]; + }; + }; + }; + + platform = stdenv.targetPlatform.system; +in + vmsByPlatform.${platform} or + (throw "Unsupported platform ${platform}: only the following platforms are supported: ${builtins.attrNames vmsByPlatform}") diff --git a/pkgs/development/libraries/capstone/default.nix b/pkgs/development/libraries/capstone/default.nix index a2ace544b7c9..ff33c7bd0979 100644 --- a/pkgs/development/libraries/capstone/default.nix +++ b/pkgs/development/libraries/capstone/default.nix @@ -1,7 +1,7 @@ { lib , stdenv +, cmake , fetchFromGitHub -, pkg-config , fixDarwinDylibNames }: @@ -16,31 +16,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-XMwQ7UaPC8YYu4yxsE4bbR3leYPfBHu5iixSLz05r3g="; }; - # replace faulty macos detection - postPatch = lib.optionalString stdenv.isDarwin '' - sed -i 's/^IS_APPLE := .*$/IS_APPLE := 1/' Makefile - ''; - - configurePhase = "patchShebangs make.sh "; - buildPhase = "PREFIX=$out ./make.sh"; - - doCheck = true; - checkPhase = '' - # first remove fuzzing steps from check target - substituteInPlace Makefile --replace "fuzztest fuzzallcorp" "" - make check - ''; - - installPhase = (lib.optionalString stdenv.isDarwin "HOMEBREW_CAPSTONE=1 ") - + "PREFIX=$out ./make.sh install"; - nativeBuildInputs = [ - pkg-config + cmake ] ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ]; - enableParallelBuilding = true; + doCheck = true; meta = { description = "Advanced disassembly library"; diff --git a/pkgs/development/libraries/libraspberrypi/default.nix b/pkgs/development/libraries/libraspberrypi/default.nix index bc0ae86aec35..14f02d8481e9 100644 --- a/pkgs/development/libraries/libraspberrypi/default.nix +++ b/pkgs/development/libraries/libraspberrypi/default.nix @@ -16,17 +16,11 @@ stdenv.mkDerivation rec { hash = "sha512-f7tBgIykcIdkwcFjBKk5ooD/5Bsyrd/0OFr7LNCwWFYeE4DH3XA7UR7YjArkwqUVCVBByr82EOaacw0g1blOkw=="; }; - patches = [ - (fetchpatch { - # https://github.com/raspberrypi/userland/pull/670 - url = "https://github.com/raspberrypi/userland/commit/37cb44f314ab1209fe2a0a2449ef78893b1e5f62.patch"; - sha256 = "1fbrbkpc4cc010ji8z4ll63g17n6jl67kdy62m74bhlxn72gg9rw"; - }) - ]; - nativeBuildInputs = [ cmake pkg-config ]; cmakeFlags = [ - (if (stdenv.hostPlatform.isAarch64) then "-DARM64=ON" else "-DARM64=OFF") + # -DARM64=ON disables all targets that only build on 32-bit ARM; this allows + # the package to build on aarch64 and other architectures + "-DARM64=${if stdenv.hostPlatform.isAarch32 then "OFF" else "ON"}" "-DVMCS_INSTALL_PREFIX=${placeholder "out"}" ]; diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix index 544ad5377291..3f9a0e6f4bb9 100644 --- a/pkgs/development/libraries/libuv/default.nix +++ b/pkgs/development/libraries/libuv/default.nix @@ -22,14 +22,14 @@ , python3 }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { version = "1.45.0"; pname = "libuv"; src = fetchFromGitHub { - owner = pname; - repo = pname; - rev = "v${version}"; + owner = "libuv"; + repo = "libuv"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-qKw9QFR24Uw7pVA9isPH8Va+9/5DYuqXz6l6jWcXn+4="; }; @@ -76,7 +76,7 @@ stdenv.mkDerivation rec { "shutdown_close_pipe" ]; tdRegexp = lib.concatStringsSep "\\|" toDisable; - in lib.optionalString doCheck '' + in lib.optionalString (finalAttrs.doCheck) '' sed '/${tdRegexp}/d' -i test/test-list.h ''; @@ -112,10 +112,10 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A multi-platform support library with a focus on asynchronous I/O"; homepage = "https://libuv.org/"; - changelog = "https://github.com/libuv/libuv/blob/v${version}/ChangeLog"; + changelog = "https://github.com/libuv/libuv/blob/v${finalAttrs.version}/ChangeLog"; maintainers = with maintainers; [ cstrahan ]; platforms = platforms.all; license = with licenses; [ mit isc bsd2 bsd3 cc-by-40 ]; }; -} +}) diff --git a/pkgs/development/libraries/science/astronomy/libxisf/0001-Fix-pkg-config-paths.patch b/pkgs/development/libraries/science/astronomy/libxisf/0001-Fix-pkg-config-paths.patch new file mode 100644 index 000000000000..c26a2bbc8814 --- /dev/null +++ b/pkgs/development/libraries/science/astronomy/libxisf/0001-Fix-pkg-config-paths.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nicolas Benes +Date: Mon, 22 May 2023 09:25:27 +0200 +Subject: [PATCH] Fix pkg-config paths + + +diff --git a/libxisf.pc.in b/libxisf.pc.in +index b0b8b53..944b068 100644 +--- a/libxisf.pc.in ++++ b/libxisf.pc.in +@@ -1,7 +1,7 @@ + prefix="@CMAKE_INSTALL_PREFIX@" + exec_prefix="${prefix}" +-libdir="${exec_prefix}/@CMAKE_INSTALL_LIBDIR@" +-includedir="${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" ++libdir="@CMAKE_INSTALL_FULL_LIBDIR@" ++includedir="@CMAKE_INSTALL_FULL_INCLUDEDIR@" + + Name: @PROJECT_NAME@ + Description: @CMAKE_PROJECT_DESCRIPTION@ +-- +2.38.5 + diff --git a/pkgs/development/libraries/science/astronomy/libxisf/default.nix b/pkgs/development/libraries/science/astronomy/libxisf/default.nix index e7e4bc98b0d8..a1fcd4da7b3d 100644 --- a/pkgs/development/libraries/science/astronomy/libxisf/default.nix +++ b/pkgs/development/libraries/science/astronomy/libxisf/default.nix @@ -10,16 +10,20 @@ stdenv.mkDerivation (finalAttrs: { pname = "libxisf"; - version = "0.2.3"; + version = "0.2.8"; src = fetchFromGitea { domain = "gitea.nouspiro.space"; owner = "nou"; repo = "libXISF"; rev = "v${finalAttrs.version}"; - hash = "sha256-u5EYnRO2rUV8ofLL9qfACeVvVbWXEXpkqh2Q4OOxpaQ="; + hash = "sha256-YB97vMz2+cFRYq8x2Su3Eh952U6kGIVLYV7kDEd5S8g="; }; + patches = [ + ./0001-Fix-pkg-config-paths.patch + ]; + nativeBuildInputs = [ cmake pkg-config diff --git a/pkgs/development/tools/language-servers/nixd/default.nix b/pkgs/development/tools/language-servers/nixd/default.nix new file mode 100644 index 000000000000..4bf1af6a01c7 --- /dev/null +++ b/pkgs/development/tools/language-servers/nixd/default.nix @@ -0,0 +1,81 @@ +{ lib +, stdenv +, fetchFromGitHub +, boost182 +, gtest +, libbacktrace +, lit +, llvmPackages +, meson +, ninja +, nix +, nixpkgs-fmt +, pkg-config +}: + +stdenv.mkDerivation rec { + pname = "nixd"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "nix-community"; + repo = "nixd"; + rev = version; + hash = "sha256-kTDPbsQi9gzFAFkiAPF+V3yI1WBmILEnnsqdgHMqXJA="; + }; + + mesonBuildType = "release"; + + nativeBuildInputs = [ + meson + ninja + pkg-config + ]; + + nativeCheckInputs = [ + lit + nixpkgs-fmt + ]; + + buildInputs = [ + libbacktrace + nix + gtest + boost182 + llvmPackages.llvm + ]; + + env.CXXFLAGS = "-include ${nix.dev}/include/nix/config.h"; + + doCheck = true; + + checkPhase = '' + runHook preCheck + dirs=(store var var/nix var/log/nix etc home) + + for dir in $dirs; do + mkdir -p "$TMPDIR/$dir" + done + + export NIX_STORE_DIR=$TMPDIR/store + export NIX_LOCALSTATE_DIR=$TMPDIR/var + export NIX_STATE_DIR=$TMPDIR/var/nix + export NIX_LOG_DIR=$TMPDIR/var/log/nix + export NIX_CONF_DIR=$TMPDIR/etc + export HOME=$TMPDIR/home + + # Disable nixd regression tests, because it uses some features provided by + # nix, and does not correctly work in the sandbox + meson test --print-errorlogs server regression/nix-ast-dump + runHook postCheck + ''; + + meta = { + description = "Nix language server"; + homepage = "https://github.com/nix-community/nixd"; + license = lib.licenses.lgpl3Plus; + maintainers = with lib.maintainers; [ inclyc ]; + platforms = lib.platforms.unix; + broken = stdenv.isDarwin; + }; +} diff --git a/pkgs/misc/documentation-highlighter/default.nix b/pkgs/misc/documentation-highlighter/default.nix index 22ea3a5f86e3..3a7f5b21c69e 100644 --- a/pkgs/misc/documentation-highlighter/default.nix +++ b/pkgs/misc/documentation-highlighter/default.nix @@ -9,12 +9,12 @@ runCommand "documentation-highlighter" { }; src = lib.sources.cleanSourceWith { src = ./.; - filter = path: type: lib.elem path (map toString [ - ./highlight.pack.js - ./LICENSE - ./loader.js - ./mono-blue.css - ./README.md + filter = path: type: lib.elem (baseNameOf path) ([ + "highlight.pack.js" + "LICENSE" + "loader.js" + "mono-blue.css" + "README.md" ]); }; } '' diff --git a/pkgs/os-specific/linux/cfs-zen-tweaks/default.nix b/pkgs/os-specific/linux/cfs-zen-tweaks/default.nix index a894e0bd4b69..ef5dfe8e2e06 100644 --- a/pkgs/os-specific/linux/cfs-zen-tweaks/default.nix +++ b/pkgs/os-specific/linux/cfs-zen-tweaks/default.nix @@ -17,21 +17,16 @@ stdenv.mkDerivation rec { sha256 = "HRR2tdjNmWyrpbcMlihSdb/7g/tHma3YyXogQpRCVyo="; }; - postPatch = '' - patchShebangs set-cfs-zen-tweaks.bash - chmod +x set-cfs-zen-tweaks.bash + preConfigure = '' substituteInPlace set-cfs-zen-tweaks.bash \ --replace '$(gawk' '$(${gawk}/bin/gawk' ''; - buildInputs = [ - gawk - ]; + preFixup = '' + chmod +x $out/lib/cfs-zen-tweaks/set-cfs-zen-tweaks.bash + ''; - nativeBuildInputs = [ - cmake - makeWrapper - ]; + nativeBuildInputs = [ cmake ]; meta = with lib; { description = "Tweak Linux CPU scheduler for desktop responsiveness"; diff --git a/pkgs/os-specific/linux/sch_cake/default.nix b/pkgs/os-specific/linux/sch_cake/default.nix deleted file mode 100644 index f93713344efb..000000000000 --- a/pkgs/os-specific/linux/sch_cake/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ stdenv, lib, fetchFromGitHub, kernel }: - -stdenv.mkDerivation { - pname = "sch_cake"; - version = "unstable-2017-07-16"; - - src = fetchFromGitHub { - owner = "dtaht"; - repo = "sch_cake"; - rev = "e641a56f27b6848736028f87eda65ac3df9f99f7"; - sha256 = "08582jy01j32b3mj8hf6m8687qrcz64zv2m236j24inlkmd94q21"; - }; - - hardeningDisable = [ "pic" ]; - - makeFlags = [ - "KERNEL_VERSION=${kernel.version}" - "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" - ]; - - installPhase = '' - install -v -m 644 -D sch_cake.ko \ - $out/lib/modules/${kernel.modDirVersion}/kernel/net/sched/sch_cake.ko - ''; - - meta = with lib; { - description = "The cake qdisc scheduler"; - homepage = "https://www.bufferbloat.net/projects/codel/wiki/Cake/"; - license = with licenses; [ bsd3 gpl2 ]; - maintainers = with maintainers; [ fpletz ]; - platforms = platforms.linux; - broken = lib.versionAtLeast kernel.version "4.13"; - }; -} diff --git a/pkgs/servers/code-server/build-vscode-nogit.patch b/pkgs/servers/code-server/build-vscode-nogit.patch index aee2a033a80b..ec726c68d438 100644 --- a/pkgs/servers/code-server/build-vscode-nogit.patch +++ b/pkgs/servers/code-server/build-vscode-nogit.patch @@ -1,14 +1,8 @@ ---- ./ci/build/build-vscode.sh -+++ ./ci/build/build-vscode.sh -@@ -45,14 +45,12 @@ - # Set the commit Code will embed into the product.json. We need to do this - # since Code tries to get the commit from the `.git` directory which will fail - # as it is a submodule. -- export VSCODE_DISTRO_COMMIT -- VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD) -+ export VSCODE_DISTRO_COMMIT=none - - # Add the date, our name, links, and enable telemetry (this just makes +diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh +index a72549fb..3aed1ad5 100755 +--- a/ci/build/build-vscode.sh ++++ b/ci/build/build-vscode.sh +@@ -58,7 +58,6 @@ main() { # telemetry available; telemetry can still be disabled by flag or setting). # This needs to be done before building as Code will read this file and embed # it into the client-side code. @@ -16,7 +10,7 @@ cp product.json product.original.json # Since jq has no inline edit. jq --slurp '.[0] * .[1]' product.original.json <( cat << EOF -@@ -99,7 +97,6 @@ +@@ -105,7 +104,6 @@ EOF # Reset so if you develop after building you will not be stuck with the wrong # commit (the dev client will use `oss-dev` but the dev server will still use # product.json which will have `stable-$commit`). diff --git a/pkgs/servers/code-server/default.nix b/pkgs/servers/code-server/default.nix index 8a07218ece48..f35ae5ca8a38 100644 --- a/pkgs/servers/code-server/default.nix +++ b/pkgs/servers/code-server/default.nix @@ -54,17 +54,19 @@ let sed -i 's/${version}/${esbuild'.version}/g' ${path}/node_modules/esbuild/lib/main.js ln -s -f ${esbuild'}/bin/esbuild ${path}/node_modules/esbuild/bin/esbuild ''; + + commit = "2798322b03e7f446f59c5142215c11711ed7a427"; in stdenv.mkDerivation (finalAttrs: { pname = "code-server"; - version = "4.12.0"; + version = "4.13.0"; src = fetchFromGitHub { owner = "coder"; repo = "code-server"; rev = "v${finalAttrs.version}"; fetchSubmodules = true; - hash = "sha256-PQp5dji2Ynp+LJRWBka41umwe1/IR76C+at/wyOWGcI="; + hash = "sha256-4hkKGQU9G3CllD+teWXnYoHaY3YdDz25fwaMUS5OlfM="; }; yarnCache = stdenv.mkDerivation { @@ -92,7 +94,7 @@ stdenv.mkDerivation (finalAttrs: { outputHashMode = "recursive"; outputHashAlgo = "sha256"; - outputHash = "sha256-4Vr9u3+W/IhbbTc39jyDyDNQODlmdF+M/N8oJn0Z4+w="; + outputHash = "sha256-xLcrOVhKC0cOPcS5XwIMyv1KiEE0azZ1z+wS9PPKjAQ="; }; nativeBuildInputs = [ @@ -120,7 +122,8 @@ stdenv.mkDerivation (finalAttrs: { ]; patches = [ - # remove git calls from vscode build script + # Remove all git calls from the VS Code build script except `git rev-parse + # HEAD` which is replaced in postPatch with the commit. ./build-vscode-nogit.patch ]; @@ -130,8 +133,10 @@ stdenv.mkDerivation (finalAttrs: { patchShebangs ./ci # inject git commit - substituteInPlace ci/build/build-release.sh \ - --replace '$(git rev-parse HEAD)' "$commit" + substituteInPlace ./ci/build/build-vscode.sh \ + --replace '$(git rev-parse HEAD)' "${commit}" + substituteInPlace ./ci/build/build-release.sh \ + --replace '$(git rev-parse HEAD)' "${commit}" ''; configurePhase = '' @@ -232,8 +237,8 @@ stdenv.mkDerivation (finalAttrs: { -execdir ln -s ${ripgrep}/bin/rg {}/bin/rg \; # run postinstall scripts after patching - find ./lib/vscode -path "*node_modules" -prune -o \ - -path "./*/*/*/*/*" -name "yarn.lock" -printf "%h\n" | \ + find ./lib/vscode \( -path "*/node_modules/*" -or -path "*/extensions/*" \) \ + -and -type f -name "yarn.lock" -printf "%h\n" | \ xargs -I {} sh -c 'jq -e ".scripts.postinstall" {}/package.json >/dev/null && yarn --cwd {} postinstall --frozen-lockfile --offline || true' # build code-server @@ -242,6 +247,15 @@ stdenv.mkDerivation (finalAttrs: { # build vscode VERSION=${finalAttrs.version} yarn build:vscode + # inject version into package.json + jq --slurp '.[0] * .[1]' ./package.json <( + cat << EOF + { + "version": "${finalAttrs.version}" + } + EOF + ) | sponge ./package.json + # create release yarn release @@ -283,7 +297,7 @@ stdenv.mkDerivation (finalAttrs: { ''; homepage = "https://github.com/coder/code-server"; license = lib.licenses.mit; - maintainers = with lib.maintainers; [ offline henkery ]; + maintainers = with lib.maintainers; [ offline henkery code-asher ]; platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ]; }; }) diff --git a/pkgs/servers/web-apps/lemmy/update.sh b/pkgs/servers/web-apps/lemmy/update.sh index 6b18221e2672..8de7a8640d8f 100755 --- a/pkgs/servers/web-apps/lemmy/update.sh +++ b/pkgs/servers/web-apps/lemmy/update.sh @@ -24,9 +24,9 @@ if ("$latest_version" === "$current_version") { const package_json = $(curl -qf $source/package.json) echo $package_json > $directory/package.json - const server_tarball_meta = $(nix-prefetch-github $owner $server_repo --rev $latest_rev) + const server_tarball_meta = $(nix-prefetch-github $owner $server_repo --rev $latest_rev --fetch-submodules) const server_tarball_hash = "sha256-$(echo $server_tarball_meta | jq -r '.sha256')" - const ui_tarball_meta = $(nix-prefetch-github $owner $ui_repo --rev $latest_rev) + const ui_tarball_meta = $(nix-prefetch-github $owner $ui_repo --rev $latest_rev --fetch-submodules) const ui_tarball_hash = "sha256-$(echo $ui_tarball_meta | jq -r '.sha256')" jq ".version = \"$latest_version\" | \ @@ -35,12 +35,12 @@ if ("$latest_version" === "$current_version") { .\"serverCargoSha256\" = \"\" | \ .\"uiYarnDepsSha256\" = \"\"" $directory/pin.json | sponge $directory/pin.json - const new_cargo_sha256 = $(nix-build -A lemmy-server 2>&1 | \ + const new_cargo_sha256 = $(nix-build $directory/../../../.. -A lemmy-server 2>&1 | \ tail -n 2 | \ head -n 1 | \ sd '\s+got:\s+' '') - const new_offline_cache_sha256 = $(nix-build -A lemmy-ui 2>&1 | \ + const new_offline_cache_sha256 = $(nix-build $directory/../../../.. -A lemmy-ui 2>&1 | \ tail -n 2 | \ head -n 1 | \ sd '\s+got:\s+' '') diff --git a/pkgs/tools/misc/shopware-cli/default.nix b/pkgs/tools/misc/shopware-cli/default.nix index e30ea8e5526e..4eb442d05f1c 100644 --- a/pkgs/tools/misc/shopware-cli/default.nix +++ b/pkgs/tools/misc/shopware-cli/default.nix @@ -3,22 +3,22 @@ , fetchFromGitHub , installShellFiles , makeWrapper -, dart-sass-embedded +, dart-sass }: buildGoModule rec { pname = "shopware-cli"; - version = "0.1.78"; + version = "0.2.0"; src = fetchFromGitHub { repo = "shopware-cli"; owner = "FriendsOfShopware"; rev = version; - hash = "sha256-IJOT4hnh/ufF8x9EXAJ6TaXVD3qoyv+NqDXqH9XB9C4="; + hash = "sha256-IWp4cgZd6td2hOMd2r4v3MI5kY1PqLhLGAIJ3VLvgEA="; }; nativeBuildInputs = [ installShellFiles makeWrapper ]; - vendorHash = "sha256-MoqLxEPxApxMyGKGiPfdehdmKacpwL0BqRP7rEC0TdY="; + vendorHash = "sha256-JTjz39zw5Il37V6V7mOQuCYiPJnnizBhkBHBAg2DvSU="; postInstall = '' export HOME="$(mktemp -d)" @@ -30,7 +30,7 @@ buildGoModule rec { preFixup = '' wrapProgram $out/bin/shopware-cli \ - --prefix PATH : ${lib.makeBinPath [ dart-sass-embedded ]} + --prefix PATH : ${lib.makeBinPath [ dart-sass ]} ''; ldflags = [ diff --git a/pkgs/tools/system/tree/default.nix b/pkgs/tools/system/tree/default.nix index 25610757ef8f..87333dd1c89c 100644 --- a/pkgs/tools/system/tree/default.nix +++ b/pkgs/tools/system/tree/default.nix @@ -2,7 +2,7 @@ let # These settings are found in the Makefile, but there seems to be no - # way to select one ore the other setting other than editing the file + # way to select one or the other setting other than editing the file # manually, so we have to duplicate the know how here. systemFlags = lib.optionalString stdenv.isDarwin '' CFLAGS="-O2 -Wall -fomit-frame-pointer -no-cpp-precomp" @@ -18,13 +18,13 @@ let in stdenv.mkDerivation rec { pname = "tree"; - version = "2.0.4"; + version = "2.1.1"; src = fetchFromGitLab { owner = "OldManProgrammer"; repo = "unix-tree"; rev = version; - sha256 = "sha256-2voXL31JHh09yBBLuHhYyZsUapiPVF/cgRmTU6wSXk4="; + sha256 = "sha256-aPz1ROUeAKDmMjEtAaL2AguF54/CbIYWpL4Qovv2ftQ="; }; preConfigure = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f5fb3dd5a4d2..91c311d4d0ec 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16672,7 +16672,10 @@ with pkgs; ograc = callPackage ../development/tools/rust/ograc { }; + opensmalltalk-vm = callPackage ../development/compilers/opensmalltalk-vm { }; + ravedude = callPackage ../development/tools/rust/ravedude { }; + rhack = callPackage ../development/tools/rust/rhack { }; roogle = callPackage ../development/tools/rust/roogle { }; rustfmt = rustPackages.rustfmt; @@ -17798,6 +17801,11 @@ with pkgs; nil = callPackage ../development/tools/language-servers/nil { }; + nixd = callPackage ../development/tools/language-servers/nixd { + llvmPackages = llvmPackages_16; + nix = nixVersions.nix_2_16; + }; + nls = callPackage ../development/tools/language-servers/nls { }; pylyzer = callPackage ../development/tools/language-servers/pylyzer { }; diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index 18967e28651a..fc6f2288349a 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -482,8 +482,6 @@ in { prl-tools = callPackage ../os-specific/linux/prl-tools { }; - sch_cake = callPackage ../os-specific/linux/sch_cake { }; - isgx = callPackage ../os-specific/linux/isgx { }; rr-zen_workaround = callPackage ../development/tools/analysis/rr/zen_workaround.nix { }; @@ -563,6 +561,7 @@ in { } // lib.optionalAttrs config.allowAliases { ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18; + sch_cake = throw "sch_cake was added in mainline kernel version 4.19"; # Added 2023-06-14 xmm7360-pci = throw "Support for the XMM7360 WWAN card was added to the iosm kmod in mainline kernel version 5.18"; });