From 86f3bba6d26ff650f7bd8a9b16487c69d54017e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlys=20Bras=20de=20fer?= Date: Wed, 29 Mar 2023 15:03:50 +0200 Subject: [PATCH 01/22] nixos/cfs-zen-tweaks: fix service name typo --- nixos/modules/programs/cfs-zen-tweaks.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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" + ]; }; } From 18c7f6237f92ef5ef9d7cf106ec2ffb72af336fc Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 14 May 2023 22:28:31 +0200 Subject: [PATCH 02/22] lib.systems.{equals,toLosslessStringMaybe}: init --- lib/systems/default.nix | 33 ++++++++++++++++++++++ lib/tests/systems.nix | 61 +++++++++++++++++++++++++++++++++++------ 2 files changed, 86 insertions(+), 8 deletions(-) diff --git a/lib/systems/default.nix b/lib/systems/default.nix index f4784c61c675..abaad19a3e1d 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 uncomparable = { canExecute = null; emulator = null; emulatorAvailable = null; isCompatible = null; }; + in a: b: a // uncomparable == b // uncomparable; + + /* + 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/systems.nix b/lib/tests/systems.nix index 2afe128c4208..082b3549086f 100644 --- a/lib/tests/systems.nix +++ b/lib/tests/systems.nix @@ -1,10 +1,6 @@ -# 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 :). +# Run: +# [nixpkgs]$ nix-instantiate --eval --strict lib/tests/systems.nix +# Expected output: [], or the failed cases let lib = import ../default.nix; mseteq = x: y: { @@ -12,7 +8,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 +44,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 = "<>"; + 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 */) + +) From 144018541b20a0aa74ce32120b3a27660fab93dd Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 13 Jun 2023 10:22:06 +0200 Subject: [PATCH 03/22] lib.systems.equals: Ignore all function attributes reflectively Co-authored-by: Artturi --- lib/systems/default.nix | 4 ++-- lib/tests/systems.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/systems/default.nix b/lib/systems/default.nix index abaad19a3e1d..3558ce32fc8c 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -24,8 +24,8 @@ rec { both arguments have been `elaborate`-d. */ equals = - let uncomparable = { canExecute = null; emulator = null; emulatorAvailable = null; isCompatible = null; }; - in a: b: a // uncomparable == b // uncomparable; + 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, diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix index 082b3549086f..617fb0d18b12 100644 --- a/lib/tests/systems.nix +++ b/lib/tests/systems.nix @@ -69,7 +69,7 @@ lib.runTests ( let modified = assert origValue != arbitraryValue; lib.systems.elaborate "x86_64-linux" // { ${platformAttrName} = arbitraryValue; }; - arbitraryValue = "<>"; + arbitraryValue = x: "<>"; in { expr = lib.systems.equals (lib.systems.elaborate "x86_64-linux") modified; expected = { From 3150f25faa599c6c6215295144f5c6b4a87eea6e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 14 May 2023 22:29:09 +0200 Subject: [PATCH 04/22] lib/tests/release.nix: Run systems tests on OfBorg --- lib/tests/release.nix | 3 +++ lib/tests/systems.nix | 2 ++ 2 files changed, 5 insertions(+) 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 617fb0d18b12..862496313e90 100644 --- a/lib/tests/systems.nix +++ b/lib/tests/systems.nix @@ -1,6 +1,8 @@ # Run: # [nixpkgs]$ nix-instantiate --eval --strict lib/tests/systems.nix # Expected output: [], or the failed cases +# +# OfBorg runs (approximately) nix-build lib/tests/release.nix let lib = import ../default.nix; mseteq = x: y: { From 4017ae36a215fb6124d370a6bc254db595d4be77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlys=20Bras=20de=20fer?= Date: Thu, 30 Mar 2023 02:42:43 +0200 Subject: [PATCH 05/22] pkgs/cfs-zen-tweaks: fix exec permission --- pkgs/os-specific/linux/cfs-zen-tweaks/default.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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"; From cd6c817a8c6f6fc8530de54ac152b81055ffa67a Mon Sep 17 00:00:00 2001 From: datafoo <34766150+datafoo@users.noreply.github.com> Date: Wed, 14 Jun 2023 14:25:03 +0200 Subject: [PATCH 06/22] vscode-extensions.davidanson.vscode-markdownlint: 0.50.0 -> 0.51.0 --- pkgs/applications/editors/vscode/extensions/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix index 25d7012651df..426ae88e976f 100644 --- a/pkgs/applications/editors/vscode/extensions/default.nix +++ b/pkgs/applications/editors/vscode/extensions/default.nix @@ -847,8 +847,8 @@ let mktplcRef = { name = "vscode-markdownlint"; publisher = "DavidAnson"; - version = "0.50.0"; - sha256 = "sha256-F+lryIhSudDz68t1eGrfqI8EuoUUOWU5LfWj0IRCQyY="; + version = "0.51.0"; + sha256 = "sha256-Xtr8cqcPrcrKpJBxQcY1j9Gl4CC6U3ZazS4bdBtdzUk="; }; meta = { changelog = "https://marketplace.visualstudio.com/items/DavidAnson.vscode-markdownlint/changelog"; From 96d7a8de5f023fd5fda310703d4ee03b1c22f3cd Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Wed, 14 Jun 2023 18:30:25 +0200 Subject: [PATCH 07/22] sch_cake: remove --- pkgs/os-specific/linux/sch_cake/default.nix | 34 --------------------- pkgs/top-level/linux-kernels.nix | 3 +- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 pkgs/os-specific/linux/sch_cake/default.nix 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/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"; }); From 07c3776e3fe8ed1ab35f4f96d3b07382808e9534 Mon Sep 17 00:00:00 2001 From: Nicolas Benes Date: Wed, 14 Jun 2023 21:04:47 +0200 Subject: [PATCH 08/22] libxisf: 0.2.3 -> 0.2.8 --- .../libxisf/0001-Fix-pkg-config-paths.patch | 23 +++++++++++++++++++ .../science/astronomy/libxisf/default.nix | 8 +++++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/science/astronomy/libxisf/0001-Fix-pkg-config-paths.patch 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 From 6575871b37cfb51fdcc57bc22f3a838cba291874 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Thu, 15 Jun 2023 10:41:01 +0200 Subject: [PATCH 09/22] shopware-cli: 0.1.78 -> 0.2.0 --- pkgs/tools/misc/shopware-cli/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 = [ From f1f0d4fbddcec38d999fb5390f481c20f2b5fd77 Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Thu, 15 Jun 2023 06:47:49 -0400 Subject: [PATCH 10/22] nixos/test-driver: fix `timeout` option for `wait_for_console_text` --- nixos/lib/test-driver/test_driver/machine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/lib/test-driver/test_driver/machine.py b/nixos/lib/test-driver/test_driver/machine.py index 1d1d5bef9bf4..523c16523272 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( From 9fb9774d9362f455683089f7615e0bf43000431a Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Thu, 15 Jun 2023 06:48:05 -0400 Subject: [PATCH 11/22] nixos/tests/systemd-initrd-vconsole: fix test and improve reliability --- nixos/tests/systemd-initrd-vconsole.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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\") Date: Thu, 15 Jun 2023 22:03:10 +0800 Subject: [PATCH 12/22] capstone: build with cmake --- .../libraries/capstone/default.nix | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) 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"; From bc8af837c8e9b4554e23933f5389fb9881ee8530 Mon Sep 17 00:00:00 2001 From: networkException Date: Wed, 14 Jun 2023 11:28:58 +0200 Subject: [PATCH 13/22] ungoogled-chromium: 114.0.5735.106 -> 114.0.5735.133 --- .../networking/browsers/chromium/upstream-info.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/upstream-info.json b/pkgs/applications/networking/browsers/chromium/upstream-info.json index 7448cf05a97b..f9da33c40960 100644 --- a/pkgs/applications/networking/browsers/chromium/upstream-info.json +++ b/pkgs/applications/networking/browsers/chromium/upstream-info.json @@ -45,9 +45,9 @@ } }, "ungoogled-chromium": { - "version": "114.0.5735.106", - "sha256": "0jihf4gv7n2kkp78n42ha4ick8mzixb4xrfdk84iqazmifrb066z", - "sha256bin64": "1zlw9gjb2fmjf1d952adqg07cyq60yck0aarz20lcvv2jzb7s46i", + "version": "114.0.5735.133", + "sha256": "0qnj4gr4b9gmla1hbz1ir64hfmpc45vzkg0hmw9h6m72r4gfr2c2", + "sha256bin64": "0gk9l1xspbqdxv9q16zdcrrr6bxx677cnz7vv4pgg85k1pwhyw3g", "deps": { "gn": { "version": "2023-04-19", @@ -56,8 +56,8 @@ "sha256": "01xrh9m9m6x8lz0vxwdw2mrhrvnw93zpg09hwdhqakj06agf4jjk" }, "ungoogled-patches": { - "rev": "114.0.5735.106-1", - "sha256": "1aac1711mbr3jwxbnjkl5kxvb64bhwnw0ls1wj7w7pmka5gmardv" + "rev": "114.0.5735.133-1", + "sha256": "1i9ql4b2rn9jryyc3hfr9kh8ccf5a4gvpwsp9lnp9jc2gryrv70y" } } } From 2cfab788a67b8ef56ec51e5bc2a4f2fc8a3ff65e Mon Sep 17 00:00:00 2001 From: 6t8k <58048945+6t8k@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:48:31 +0200 Subject: [PATCH 14/22] tree: 2.0.4 -> 2.1.1 --- pkgs/tools/system/tree/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 = '' From b55b4151987280cfb6936522a56854183387b0d2 Mon Sep 17 00:00:00 2001 From: happysalada Date: Thu, 15 Jun 2023 12:54:03 -0400 Subject: [PATCH 15/22] lemmy: fix update script (hash + running dir) --- pkgs/servers/web-apps/lemmy/update.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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+' '') From cc3e5198707b9b5523643e791677d4135fb3aee7 Mon Sep 17 00:00:00 2001 From: Yingchi Long Date: Thu, 8 Jun 2023 22:44:51 +0800 Subject: [PATCH 16/22] nixd: init at 1.0.0 nixd: use fixed nix version (i.e. nix 2.16) nixd: address comments from @SharzyL nixd: comment https://github.com/NixOS/nixpkgs/pull/236675#discussion_r1223259634 nixd: remove "nix" from nativeBuildInputs nixd: address https://github.com/NixOS/nixpkgs/pull/236675#discussion_r1223507941 nixd: address https://github.com/NixOS/nixpkgs/pull/236675#issuecomment-1583207666 Now tests are passing nixd: disable nixd regression tests (i.e. `regression/nixd`) nixd: use `llvmPackages_16.libcxxStdenv` on darwin for C++20 `ranges` Revert "nixd: use `llvmPackages_16.libcxxStdenv` on darwin for C++20 `ranges`" This reverts commit 117d75aa2291dbf666e1ccdaecd22de78ce6617b. The complied binary SIGSEGVs on tests, looks like this is an upstream issue, I would like to mark it broken on darwin for now. nixd: mark it is broken on darwin See upstream issue: https://github.com/nix-community/nixd/issues/107 nixd: reorder inputs https://github.com/NixOS/nixpkgs/pull/236675#discussion_r1225995719 nixd: set package in `all-packages.nix` https://github.com/NixOS/nixpkgs/pull/236675#discussion_r1225995937 nixd: do not parameterize pname https://github.com/NixOS/nixpkgs/pull/236675#discussion_r1225995988 nixd: CXXFLAGS -> env.CXXFLAGS https://github.com/NixOS/nixpkgs/pull/236675#discussion_r1225996031 nixd: https://github.com/NixOS/nixpkgs/pull/236675#discussion_r1225996269 Co-authored-by: Anderson Torres nixd: https://github.com/NixOS/nixpkgs/pull/236675#discussion_r1225996546 Co-authored-by: Anderson Torres Revert "nixd: https://github.com/NixOS/nixpkgs/pull/236675#discussion_r1225996269" This reverts commit 9ee792adad17baba242b1df9da144fd4cc8df032. eval: line 1598: syntax error near unexpected token `(' nixd: https://github.com/NixOS/nixpkgs/pull/236675#discussion_r1225996400 Squashed commits: https://github.com/NixOS/nixpkgs/pull/236675#issuecomment-1587405762 --- .../tools/language-servers/nixd/default.nix | 81 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 ++ 2 files changed, 86 insertions(+) create mode 100644 pkgs/development/tools/language-servers/nixd/default.nix 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/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c13b716a0e9a..0ec85de2ffdd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17798,6 +17798,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 { }; From 7a53daed2a71fd4b7b177bc48f2f9c996a5bb4b2 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Thu, 15 Jun 2023 18:51:37 +0200 Subject: [PATCH 17/22] documentation-highlighter: less weird source filter The expansion into absolute paths caused the filter to reject all the files in some unusual circumstances (we think it's due to use of a chroot store). This works reliably no matter where nixpkgs is located. --- pkgs/misc/documentation-highlighter/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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" ]); }; } '' From 6d402731689fbeb403b03a0f486b8c8a26530d5a Mon Sep 17 00:00:00 2001 From: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com> Date: Thu, 15 Jun 2023 20:52:28 +0000 Subject: [PATCH 18/22] libuv: use finalAttrs instead of rec (#237140) Co-authored-by: figsoda --- pkgs/development/libraries/libuv/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 ]; }; -} +}) From b7d596c1409fef13d3191048c92abd4a0e18b495 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 15 Jun 2023 09:05:20 -0800 Subject: [PATCH 19/22] code-server: 4.12.0 -> 4.13.0 I replaced the commit with the actual commit instead of "none" and fixed the other replacement (`$commit` did not exist). There was at least one postinstall script in `extensions` that was not being ran so I modified the `find` command to account for lock files in that directory in addition to `node_modules`. Lastly, inject the version into the package.json otherwise it uses the placeholder version 0.0.0. --- .../code-server/build-vscode-nogit.patch | 18 ++++------- pkgs/servers/code-server/default.nix | 30 ++++++++++++++----- 2 files changed, 28 insertions(+), 20 deletions(-) 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..ae4817a7201e 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 From 5a27d7f4f292d4fc576a13ad0df639d7aa37316c Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 15 Jun 2023 13:12:17 -0800 Subject: [PATCH 20/22] maintainers: add code-asher --- maintainers/maintainer-list.nix | 9 +++++++++ pkgs/servers/code-server/default.nix | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) 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/pkgs/servers/code-server/default.nix b/pkgs/servers/code-server/default.nix index ae4817a7201e..f35ae5ca8a38 100644 --- a/pkgs/servers/code-server/default.nix +++ b/pkgs/servers/code-server/default.nix @@ -297,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" ]; }; }) From 5d486408b510035c76b31d8d880c830d773b40a4 Mon Sep 17 00:00:00 2001 From: Jake Waksbaum Date: Fri, 16 Jun 2023 00:48:42 +0300 Subject: [PATCH 21/22] opensmalltalk-vm: init at 202206021410 (#215158) * opensmalltalk-vm: init at 202206021410 * add x86-64 vms * Add meta * Use src.url * Hardcode commit hash * Inline everything * Set scriptname and mainProgram * Add comment about checkSCCSversion * Hardcode date * Hardcode hash * Use attrset instead of if-else * Remove arch-specific environment variables * Remove -msse2 flag * Rename squeak.cog.spur -> sqeak-cog-spur --- .../compilers/opensmalltalk-vm/default.nix | 184 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 3 + 2 files changed, 187 insertions(+) create mode 100644 pkgs/development/compilers/opensmalltalk-vm/default.nix diff --git a/pkgs/development/compilers/opensmalltalk-vm/default.nix b/pkgs/development/compilers/opensmalltalk-vm/default.nix new file mode 100644 index 000000000000..1f392075b94a --- /dev/null +++ b/pkgs/development/compilers/opensmalltalk-vm/default.nix @@ -0,0 +1,184 @@ +{ stdenv +, lib +, fetchFromGitHub +, fetchurl +, alsa-lib +, coreutils +, file +, freetype +, gnugrep +, libpulseaudio +, libtool +, libuuid +, openssl +, pango +, pkg-config +, xorg +}: +let + buildVM = + { + # VM-specific information, manually extracted from building///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/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0ec85de2ffdd..79afde4f7398 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; From 89afe706797a64bebddc558e7b50d2862c15a40e Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Wed, 5 Oct 2022 13:49:08 -0400 Subject: [PATCH 22/22] libraspberrypi: build all binaries on 32-bit ARM This package included a patch which accidently disabled the applications which can only be built for 32-bit ARM on all platforms (including 32-bit ARM). There is a newer version of the patch available in the upstream PR which can avoid this problem, but I don't think the patch is truly necessary at all. We can simply pass -DARM64=ON on all platforms except 32-bit ARM to get the same effect. --- .../development/libraries/libraspberrypi/default.nix | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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"}" ];