From b41e59ef28735566ec63164abafec8a2f42d778f Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Wed, 17 Jul 2024 23:25:28 +0200 Subject: [PATCH 01/23] tailscale: only generate shell completions if possible --- pkgs/servers/tailscale/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/tailscale/default.nix b/pkgs/servers/tailscale/default.nix index de407fb44325..5d6b31659328 100644 --- a/pkgs/servers/tailscale/default.nix +++ b/pkgs/servers/tailscale/default.nix @@ -64,15 +64,14 @@ buildGoModule { wrapProgram $out/bin/tailscaled \ --prefix PATH : ${lib.makeBinPath [ iproute2 iptables getent shadow ]} \ --suffix PATH : ${lib.makeBinPath [ procps ]} - + sed -i -e "s#/usr/sbin#$out/bin#" -e "/^EnvironmentFile/d" ./cmd/tailscaled/tailscaled.service + install -D -m0444 -t $out/lib/systemd/system ./cmd/tailscaled/tailscaled.service + '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' local INSTALL="$out/bin/tailscale" installShellCompletion --cmd tailscale \ --bash <($out/bin/tailscale completion bash) \ --fish <($out/bin/tailscale completion fish) \ --zsh <($out/bin/tailscale completion zsh) - - sed -i -e "s#/usr/sbin#$out/bin#" -e "/^EnvironmentFile/d" ./cmd/tailscaled/tailscaled.service - install -D -m0444 -t $out/lib/systemd/system ./cmd/tailscaled/tailscaled.service ''; passthru.tests = { From 63faf31b1ecd74dd0743b2ba782eff67a44cf8e9 Mon Sep 17 00:00:00 2001 From: Tobias Mayer Date: Sun, 21 Jul 2024 09:03:58 +0200 Subject: [PATCH 02/23] ceph: Fix race in parallel build --- pkgs/tools/filesystems/ceph/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/filesystems/ceph/default.nix b/pkgs/tools/filesystems/ceph/default.nix index e116304f07b4..a8ed7611546e 100644 --- a/pkgs/tools/filesystems/ceph/default.nix +++ b/pkgs/tools/filesystems/ceph/default.nix @@ -340,8 +340,6 @@ in rec { graphviz ]; - enableParallelBuilding = true; - buildInputs = cryptoLibsMap.${cryptoStr} ++ [ arrow-cpp babeltrace @@ -449,6 +447,14 @@ in rec { ''-DWITH_XFS=${if optLibxfs != null then "ON" else "OFF"}'' ] ++ lib.optional stdenv.isLinux "-DWITH_SYSTEM_LIBURING=ON"; + preBuild = + # The legacy-option-headers target is not correctly empbedded in the build graph. + # It also contains some internal race conditions that we work around by building with `-j 1`. + # Upstream discussion for additional context at https://tracker.ceph.com/issues/63402. + '' + cmake --build . --target legacy-option-headers -j 1 + ''; + postFixup = '' wrapPythonPrograms wrapProgram $out/bin/ceph-mgr --prefix PYTHONPATH ":" "$(toPythonPath ${placeholder "out"}):$(toPythonPath ${ceph-python-env})" From 77a13aa9add226603b5225df6fb01168bc13cad3 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Thu, 1 Aug 2024 13:58:28 +0100 Subject: [PATCH 03/23] buildDotnetModule: format with nixfmt --- .../dotnet/build-dotnet-module/default.nix | 337 ++++++++++-------- 1 file changed, 184 insertions(+), 153 deletions(-) diff --git a/pkgs/build-support/dotnet/build-dotnet-module/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/default.nix index 2ba801231f38..6cdd4f5e40db 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-module/default.nix @@ -1,52 +1,54 @@ -{ lib -, runtimeShell -, stdenvNoCC -, callPackage -, substituteAll -, writeShellScript -, makeWrapper -, dotnetCorePackages -, mkNugetDeps -, nuget-to-nix -, cacert -, unzip -, yq -, nix +{ + lib, + runtimeShell, + stdenvNoCC, + callPackage, + substituteAll, + writeShellScript, + makeWrapper, + dotnetCorePackages, + mkNugetDeps, + nuget-to-nix, + cacert, + unzip, + yq, + nix, }: -{ name ? "${_args.pname}-${_args.version}" -, pname ? name -, enableParallelBuilding ? true -, doCheck ? false +{ + name ? "${_args.pname}-${_args.version}", + pname ? name, + enableParallelBuilding ? true, + doCheck ? false, # Flags to pass to `makeWrapper`. This is done to avoid double wrapping. -, makeWrapperArgs ? [ ] + makeWrapperArgs ? [ ], # Flags to pass to `dotnet restore`. -, dotnetRestoreFlags ? [ ] + dotnetRestoreFlags ? [ ], # Flags to pass to `dotnet build`. -, dotnetBuildFlags ? [ ] + dotnetBuildFlags ? [ ], # Flags to pass to `dotnet test`, if running tests is enabled. -, dotnetTestFlags ? [ ] + dotnetTestFlags ? [ ], # Flags to pass to `dotnet install`. -, dotnetInstallFlags ? [ ] + dotnetInstallFlags ? [ ], # Flags to pass to `dotnet pack`. -, dotnetPackFlags ? [ ] + dotnetPackFlags ? [ ], # Flags to pass to dotnet in all phases. -, dotnetFlags ? [ ] + dotnetFlags ? [ ], # The path to publish the project to. When unset, the directory "$out/lib/$pname" is used. -, installPath ? null + installPath ? null, # The binaries that should get installed to `$out/bin`, relative to `$installPath/`. These get wrapped accordingly. # Unfortunately, dotnet has no method for doing this automatically. # If unset, all executables in the projects root will get installed. This may cause bloat! -, executables ? null + executables ? null, # Packs a project as a `nupkg`, and installs it to `$out/share`. If set to `true`, the derivation can be used as a dependency for another dotnet project by adding it to `projectReferences`. -, packNupkg ? false + packNupkg ? false, # The packages project file, which contains instructions on how to compile it. This can be an array of multiple project files as well. -, projectFile ? null + projectFile ? null, # The NuGet dependency file. This locks all NuGet dependency versions, as otherwise they cannot be deterministically fetched. # This can be generated by running the `passthru.fetch-deps` script. -, nugetDeps ? null + nugetDeps ? null, # A list of derivations containing nupkg packages for local project references. # Referenced derivations can be built with `buildDotnetModule` with `packNupkg=true` flag. # Since we are sharing them as nugets they must be added to csproj/fsproj files as `PackageReference` as well. @@ -55,168 +57,197 @@ # To enable discovery through `projectReferences` you would need to add a line: # # -, projectReferences ? [ ] + projectReferences ? [ ], # Libraries that need to be available at runtime should be passed through this. # These get wrapped into `LD_LIBRARY_PATH`. -, runtimeDeps ? [ ] + runtimeDeps ? [ ], # The dotnet runtime ID. If null, fetch-deps will gather dependencies for all # platforms in meta.platforms which are supported by the sdk. -, runtimeId ? null + runtimeId ? null, # Tests to disable. This gets passed to `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all frameworks. # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#filter-option-details for more details. -, disabledTests ? [ ] + disabledTests ? [ ], # The project file to run unit tests against. This is usually referenced in the regular project file, but sometimes it needs to be manually set. # It gets restored and build, but not installed. You may need to regenerate your nuget lockfile after setting this. -, testProjectFile ? null + testProjectFile ? null, # The type of build to perform. This is passed to `dotnet` with the `--configuration` flag. Possible values are `Release`, `Debug`, etc. -, buildType ? "Release" + buildType ? "Release", # If set to true, builds the application as a self-contained - removing the runtime dependency on dotnet -, selfContainedBuild ? false + selfContainedBuild ? false, # Whether to use an alternative wrapper, that executes the application DLL using the dotnet runtime from the user environment. `dotnet-runtime` is provided as a default in case no .NET is installed # This is useful for .NET tools and applications that may need to run under different .NET runtimes -, useDotnetFromEnv ? false + useDotnetFromEnv ? false, # Whether to explicitly enable UseAppHost when building. This is redundant if useDotnetFromEnv is enabled -, useAppHost ? true + useAppHost ? true, # The dotnet SDK to use. -, dotnet-sdk ? dotnetCorePackages.sdk_6_0 + dotnet-sdk ? dotnetCorePackages.sdk_6_0, # The dotnet runtime to use. -, dotnet-runtime ? dotnetCorePackages.runtime_6_0 -, ... -} @ _args: + dotnet-runtime ? dotnetCorePackages.runtime_6_0, + ... +}@_args: let args = removeAttrs _args [ "nugetDeps" ]; - projectFiles = - lib.optionals (projectFile != null) (lib.toList projectFile); - testProjectFiles = - lib.optionals (testProjectFile != null) (lib.toList testProjectFile); + projectFiles = lib.optionals (projectFile != null) (lib.toList projectFile); + testProjectFiles = lib.optionals (testProjectFile != null) (lib.toList testProjectFile); platforms = - if args ? meta.platforms - then lib.intersectLists args.meta.platforms dotnet-sdk.meta.platforms - else dotnet-sdk.meta.platforms; + if args ? meta.platforms then + lib.intersectLists args.meta.platforms dotnet-sdk.meta.platforms + else + dotnet-sdk.meta.platforms; - inherit (callPackage ./hooks { - inherit dotnet-sdk dotnet-runtime; - }) dotnetConfigureHook dotnetBuildHook dotnetCheckHook dotnetInstallHook dotnetFixupHook; - - _nugetDeps = - if (nugetDeps != null) then - if lib.isDerivation nugetDeps - then nugetDeps - else mkNugetDeps { - inherit name; - sourceFile = nugetDeps; - } - else throw "Defining the `nugetDeps` attribute is required, as to lock the NuGet dependencies. This file can be generated by running the `passthru.fetch-deps` script."; - - nugetDepsFile = _nugetDeps.sourceFile; - - inherit (dotnetCorePackages) systemToDotnetRid; -in -stdenvNoCC.mkDerivation (finalAttrs: args // { - dotnetInstallPath = installPath; - dotnetExecutables = executables; - dotnetBuildType = buildType; - dotnetProjectFiles = projectFiles; - dotnetTestProjectFiles = testProjectFiles; - dotnetDisabledTests = disabledTests; - dotnetRuntimeIds = lib.singleton ( - if runtimeId != null - then runtimeId - else systemToDotnetRid stdenvNoCC.hostPlatform.system); - dotnetRuntimeDeps = map lib.getLib runtimeDeps; - dotnetSelfContainedBuild = selfContainedBuild; - dotnetUseAppHost = useAppHost; - inherit useDotnetFromEnv; - - nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [ + inherit (callPackage ./hooks { inherit dotnet-sdk dotnet-runtime; }) dotnetConfigureHook dotnetBuildHook dotnetCheckHook dotnetInstallHook dotnetFixupHook + ; - cacert - makeWrapper - dotnet-sdk - unzip - yq - ]; + _nugetDeps = + if (nugetDeps != null) then + if lib.isDerivation nugetDeps then + nugetDeps + else + mkNugetDeps { + inherit name; + sourceFile = nugetDeps; + } + else + throw "Defining the `nugetDeps` attribute is required, as to lock the NuGet dependencies. This file can be generated by running the `passthru.fetch-deps` script."; - buildInputs = args.buildInputs or [] ++ [ - dotnet-sdk.packages - _nugetDeps - ] ++ projectReferences; + nugetDepsFile = _nugetDeps.sourceFile; - # Parse the version attr into a format acceptable for the Version msbuild property - # The actual version attr is saved in InformationalVersion, which accepts an arbitrary string - versionForDotnet = if !(lib.hasAttr "version" args) || args.version == null - then null else let - components = lib.pipe args.version [ - lib.splitVersion - (lib.filter (x: (lib.strings.match "[0-9]+" x) != null)) - (lib.filter (x: (lib.toIntBase10 x) < 65535)) # one version component in dotnet has to fit in 16 bits + inherit (dotnetCorePackages) systemToDotnetRid; +in +stdenvNoCC.mkDerivation ( + finalAttrs: + args + // { + dotnetInstallPath = installPath; + dotnetExecutables = executables; + dotnetBuildType = buildType; + dotnetProjectFiles = projectFiles; + dotnetTestProjectFiles = testProjectFiles; + dotnetDisabledTests = disabledTests; + dotnetRuntimeIds = lib.singleton ( + if runtimeId != null then runtimeId else systemToDotnetRid stdenvNoCC.hostPlatform.system + ); + dotnetRuntimeDeps = map lib.getLib runtimeDeps; + dotnetSelfContainedBuild = selfContainedBuild; + dotnetUseAppHost = useAppHost; + inherit useDotnetFromEnv; + + nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [ + dotnetConfigureHook + dotnetBuildHook + dotnetCheckHook + dotnetInstallHook + dotnetFixupHook + + cacert + makeWrapper + dotnet-sdk + unzip + yq ]; - in if (lib.length components) == 0 - then null - else lib.concatStringsSep "." ((lib.take 4 components) - ++ (if (lib.length components) < 4 - then lib.replicate (4 - (lib.length components)) "0" - else [ ])); - makeWrapperArgs = args.makeWrapperArgs or [ ] ++ [ - "--prefix" "LD_LIBRARY_PATH" ":" "${dotnet-sdk.icu}/lib" - ]; + buildInputs = + args.buildInputs or [ ] + ++ [ + dotnet-sdk.packages + _nugetDeps + ] + ++ projectReferences; - # Stripping breaks the executable - dontStrip = args.dontStrip or true; + # Parse the version attr into a format acceptable for the Version msbuild property + # The actual version attr is saved in InformationalVersion, which accepts an arbitrary string + versionForDotnet = + if !(lib.hasAttr "version" args) || args.version == null then + null + else + let + components = lib.pipe args.version [ + lib.splitVersion + (lib.filter (x: (lib.strings.match "[0-9]+" x) != null)) + (lib.filter (x: (lib.toIntBase10 x) < 65535)) # one version component in dotnet has to fit in 16 bits + ]; + in + if (lib.length components) == 0 then + null + else + lib.concatStringsSep "." ( + (lib.take 4 components) + ++ (if (lib.length components) < 4 then lib.replicate (4 - (lib.length components)) "0" else [ ]) + ); - # gappsWrapperArgs gets included when wrapping for dotnet, as to avoid double wrapping - dontWrapGApps = args.dontWrapGApps or true; + makeWrapperArgs = args.makeWrapperArgs or [ ] ++ [ + "--prefix" + "LD_LIBRARY_PATH" + ":" + "${dotnet-sdk.icu}/lib" + ]; - # propagate the runtime sandbox profile since the contents apply to published - # executables - propagatedSandboxProfile = toString dotnet-runtime.__propagatedSandboxProfile; + # Stripping breaks the executable + dontStrip = args.dontStrip or true; - passthru = { - nugetDeps = _nugetDeps; - } // lib.optionalAttrs (!lib.isDerivation nugetDeps) { - fetch-deps = let - pkg = finalAttrs.finalPackage.overrideAttrs (old: { - buildInputs = lib.remove _nugetDeps old.buildInputs; - keepNugetConfig = true; - } // lib.optionalAttrs (runtimeId == null) { - dotnetRuntimeIds = map (system: systemToDotnetRid system) platforms; - }); + # gappsWrapperArgs gets included when wrapping for dotnet, as to avoid double wrapping + dontWrapGApps = args.dontWrapGApps or true; - drv = builtins.unsafeDiscardOutputDependency pkg.drvPath; + # propagate the runtime sandbox profile since the contents apply to published + # executables + propagatedSandboxProfile = toString dotnet-runtime.__propagatedSandboxProfile; - innerScript = substituteAll { - src = ./fetch-deps.sh; - isExecutable = true; - defaultDepsFile = - # Wire in the nugetDeps file such that running the script with no args - # runs it agains the correct deps file by default. - # Note that toString is necessary here as it results in the path at - # eval time (i.e. to the file in your local Nixpkgs checkout) rather - # than the Nix store path of the path after it's been imported. - if lib.isPath nugetDepsFile - && !lib.hasPrefix "${builtins.storeDir}/" (toString nugetDepsFile) then - toString nugetDepsFile - else - ''$(mktemp -t "${pname}-deps-XXXXXX.nix")''; - nugetToNix = (nuget-to-nix.override { inherit dotnet-sdk; }); - }; + passthru = + { + nugetDeps = _nugetDeps; + } + // lib.optionalAttrs (!lib.isDerivation nugetDeps) { + fetch-deps = + let + pkg = finalAttrs.finalPackage.overrideAttrs ( + old: + { + buildInputs = lib.remove _nugetDeps old.buildInputs; + keepNugetConfig = true; + } + // lib.optionalAttrs (runtimeId == null) { + dotnetRuntimeIds = map (system: systemToDotnetRid system) platforms; + } + ); - in writeShellScript "${name}-fetch-deps" '' - NIX_BUILD_SHELL="${runtimeShell}" exec ${nix}/bin/nix-shell \ - --pure --run 'source "${innerScript}"' "${drv}" - ''; - } // args.passthru or { }; + drv = builtins.unsafeDiscardOutputDependency pkg.drvPath; - meta = (args.meta or { }) // { inherit platforms; }; -}) + innerScript = substituteAll { + src = ./fetch-deps.sh; + isExecutable = true; + defaultDepsFile = + # Wire in the nugetDeps file such that running the script with no args + # runs it agains the correct deps file by default. + # Note that toString is necessary here as it results in the path at + # eval time (i.e. to the file in your local Nixpkgs checkout) rather + # than the Nix store path of the path after it's been imported. + if lib.isPath nugetDepsFile && !lib.hasPrefix "${builtins.storeDir}/" (toString nugetDepsFile) then + toString nugetDepsFile + else + ''$(mktemp -t "${pname}-deps-XXXXXX.nix")''; + nugetToNix = (nuget-to-nix.override { inherit dotnet-sdk; }); + }; + + in + writeShellScript "${name}-fetch-deps" '' + NIX_BUILD_SHELL="${runtimeShell}" exec ${nix}/bin/nix-shell \ + --pure --run 'source "${innerScript}"' "${drv}" + ''; + } + // args.passthru or { }; + + meta = (args.meta or { }) // { + inherit platforms; + }; + } +) From 79d26048de8e908826c2a1acb60188df69f19112 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Thu, 1 Aug 2024 01:18:03 +0100 Subject: [PATCH 04/23] buildDotnetModule: add `finalAttrs` support Allow users to pass arguments to `buildDotnetModule` in the form: ```nix buildDotnetModule (finalAttrs: { # Args }) ``` Exposing the behaviour of the underlying `mkDerivation` and allowing packages to be defined in a recursive way that works correctly even when the package is overridden, e.g. using `overrideAttrs`. Added some simple test cases that piggyback on the existing `structured-attrs` test. --- .../dotnet/build-dotnet-module/default.nix | 439 +++++++++--------- pkgs/test/dotnet/default.nix | 1 + pkgs/test/dotnet/final-attrs/default.nix | 76 +++ 3 files changed, 300 insertions(+), 216 deletions(-) create mode 100644 pkgs/test/dotnet/final-attrs/default.nix diff --git a/pkgs/build-support/dotnet/build-dotnet-module/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/default.nix index 6cdd4f5e40db..c8ad6a174ce5 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-module/default.nix @@ -14,240 +14,247 @@ yq, nix, }: - -{ - name ? "${_args.pname}-${_args.version}", - pname ? name, - enableParallelBuilding ? true, - doCheck ? false, - # Flags to pass to `makeWrapper`. This is done to avoid double wrapping. - makeWrapperArgs ? [ ], - - # Flags to pass to `dotnet restore`. - dotnetRestoreFlags ? [ ], - # Flags to pass to `dotnet build`. - dotnetBuildFlags ? [ ], - # Flags to pass to `dotnet test`, if running tests is enabled. - dotnetTestFlags ? [ ], - # Flags to pass to `dotnet install`. - dotnetInstallFlags ? [ ], - # Flags to pass to `dotnet pack`. - dotnetPackFlags ? [ ], - # Flags to pass to dotnet in all phases. - dotnetFlags ? [ ], - - # The path to publish the project to. When unset, the directory "$out/lib/$pname" is used. - installPath ? null, - # The binaries that should get installed to `$out/bin`, relative to `$installPath/`. These get wrapped accordingly. - # Unfortunately, dotnet has no method for doing this automatically. - # If unset, all executables in the projects root will get installed. This may cause bloat! - executables ? null, - # Packs a project as a `nupkg`, and installs it to `$out/share`. If set to `true`, the derivation can be used as a dependency for another dotnet project by adding it to `projectReferences`. - packNupkg ? false, - # The packages project file, which contains instructions on how to compile it. This can be an array of multiple project files as well. - projectFile ? null, - # The NuGet dependency file. This locks all NuGet dependency versions, as otherwise they cannot be deterministically fetched. - # This can be generated by running the `passthru.fetch-deps` script. - nugetDeps ? null, - # A list of derivations containing nupkg packages for local project references. - # Referenced derivations can be built with `buildDotnetModule` with `packNupkg=true` flag. - # Since we are sharing them as nugets they must be added to csproj/fsproj files as `PackageReference` as well. - # For example, your project has a local dependency: - # - # To enable discovery through `projectReferences` you would need to add a line: - # - # - projectReferences ? [ ], - # Libraries that need to be available at runtime should be passed through this. - # These get wrapped into `LD_LIBRARY_PATH`. - runtimeDeps ? [ ], - # The dotnet runtime ID. If null, fetch-deps will gather dependencies for all - # platforms in meta.platforms which are supported by the sdk. - runtimeId ? null, - - # Tests to disable. This gets passed to `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all frameworks. - # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#filter-option-details for more details. - disabledTests ? [ ], - # The project file to run unit tests against. This is usually referenced in the regular project file, but sometimes it needs to be manually set. - # It gets restored and build, but not installed. You may need to regenerate your nuget lockfile after setting this. - testProjectFile ? null, - - # The type of build to perform. This is passed to `dotnet` with the `--configuration` flag. Possible values are `Release`, `Debug`, etc. - buildType ? "Release", - # If set to true, builds the application as a self-contained - removing the runtime dependency on dotnet - selfContainedBuild ? false, - # Whether to use an alternative wrapper, that executes the application DLL using the dotnet runtime from the user environment. `dotnet-runtime` is provided as a default in case no .NET is installed - # This is useful for .NET tools and applications that may need to run under different .NET runtimes - useDotnetFromEnv ? false, - # Whether to explicitly enable UseAppHost when building. This is redundant if useDotnetFromEnv is enabled - useAppHost ? true, - # The dotnet SDK to use. - dotnet-sdk ? dotnetCorePackages.sdk_6_0, - # The dotnet runtime to use. - dotnet-runtime ? dotnetCorePackages.runtime_6_0, - ... -}@_args: - let - args = removeAttrs _args [ "nugetDeps" ]; + transformArgs = + finalAttrs: + { + name ? "${args.pname}-${args.version}", + pname ? name, + enableParallelBuilding ? true, + doCheck ? false, + # Flags to pass to `makeWrapper`. This is done to avoid double wrapping. + makeWrapperArgs ? [ ], - projectFiles = lib.optionals (projectFile != null) (lib.toList projectFile); - testProjectFiles = lib.optionals (testProjectFile != null) (lib.toList testProjectFile); + # Flags to pass to `dotnet restore`. + dotnetRestoreFlags ? [ ], + # Flags to pass to `dotnet build`. + dotnetBuildFlags ? [ ], + # Flags to pass to `dotnet test`, if running tests is enabled. + dotnetTestFlags ? [ ], + # Flags to pass to `dotnet install`. + dotnetInstallFlags ? [ ], + # Flags to pass to `dotnet pack`. + dotnetPackFlags ? [ ], + # Flags to pass to dotnet in all phases. + dotnetFlags ? [ ], - platforms = - if args ? meta.platforms then - lib.intersectLists args.meta.platforms dotnet-sdk.meta.platforms - else - dotnet-sdk.meta.platforms; + # The path to publish the project to. When unset, the directory "$out/lib/$pname" is used. + installPath ? null, + # The binaries that should get installed to `$out/bin`, relative to `$installPath/`. These get wrapped accordingly. + # Unfortunately, dotnet has no method for doing this automatically. + # If unset, all executables in the projects root will get installed. This may cause bloat! + executables ? null, + # Packs a project as a `nupkg`, and installs it to `$out/share`. If set to `true`, the derivation can be used as a dependency for another dotnet project by adding it to `projectReferences`. + packNupkg ? false, + # The packages project file, which contains instructions on how to compile it. This can be an array of multiple project files as well. + projectFile ? null, + # The NuGet dependency file. This locks all NuGet dependency versions, as otherwise they cannot be deterministically fetched. + # This can be generated by running the `passthru.fetch-deps` script. + nugetDeps ? null, + # A list of derivations containing nupkg packages for local project references. + # Referenced derivations can be built with `buildDotnetModule` with `packNupkg=true` flag. + # Since we are sharing them as nugets they must be added to csproj/fsproj files as `PackageReference` as well. + # For example, your project has a local dependency: + # + # To enable discovery through `projectReferences` you would need to add a line: + # + # + projectReferences ? [ ], + # Libraries that need to be available at runtime should be passed through this. + # These get wrapped into `LD_LIBRARY_PATH`. + runtimeDeps ? [ ], + # The dotnet runtime ID. If null, fetch-deps will gather dependencies for all + # platforms in meta.platforms which are supported by the sdk. + runtimeId ? null, - inherit (callPackage ./hooks { inherit dotnet-sdk dotnet-runtime; }) - dotnetConfigureHook - dotnetBuildHook - dotnetCheckHook - dotnetInstallHook - dotnetFixupHook - ; + # Tests to disable. This gets passed to `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all frameworks. + # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#filter-option-details for more details. + disabledTests ? [ ], + # The project file to run unit tests against. This is usually referenced in the regular project file, but sometimes it needs to be manually set. + # It gets restored and build, but not installed. You may need to regenerate your nuget lockfile after setting this. + testProjectFile ? null, - _nugetDeps = - if (nugetDeps != null) then - if lib.isDerivation nugetDeps then - nugetDeps - else - mkNugetDeps { - inherit name; - sourceFile = nugetDeps; - } - else - throw "Defining the `nugetDeps` attribute is required, as to lock the NuGet dependencies. This file can be generated by running the `passthru.fetch-deps` script."; + # The type of build to perform. This is passed to `dotnet` with the `--configuration` flag. Possible values are `Release`, `Debug`, etc. + buildType ? "Release", + # If set to true, builds the application as a self-contained - removing the runtime dependency on dotnet + selfContainedBuild ? false, + # Whether to use an alternative wrapper, that executes the application DLL using the dotnet runtime from the user environment. `dotnet-runtime` is provided as a default in case no .NET is installed + # This is useful for .NET tools and applications that may need to run under different .NET runtimes + useDotnetFromEnv ? false, + # Whether to explicitly enable UseAppHost when building. This is redundant if useDotnetFromEnv is enabled + useAppHost ? true, + # The dotnet SDK to use. + dotnet-sdk ? dotnetCorePackages.sdk_6_0, + # The dotnet runtime to use. + dotnet-runtime ? dotnetCorePackages.runtime_6_0, + ... + }@args: + let + projectFiles = lib.optionals (projectFile != null) (lib.toList projectFile); + testProjectFiles = lib.optionals (testProjectFile != null) (lib.toList testProjectFile); - nugetDepsFile = _nugetDeps.sourceFile; + platforms = + if args ? meta.platforms then + lib.intersectLists args.meta.platforms dotnet-sdk.meta.platforms + else + dotnet-sdk.meta.platforms; - inherit (dotnetCorePackages) systemToDotnetRid; -in -stdenvNoCC.mkDerivation ( - finalAttrs: - args - // { - dotnetInstallPath = installPath; - dotnetExecutables = executables; - dotnetBuildType = buildType; - dotnetProjectFiles = projectFiles; - dotnetTestProjectFiles = testProjectFiles; - dotnetDisabledTests = disabledTests; - dotnetRuntimeIds = lib.singleton ( - if runtimeId != null then runtimeId else systemToDotnetRid stdenvNoCC.hostPlatform.system - ); - dotnetRuntimeDeps = map lib.getLib runtimeDeps; - dotnetSelfContainedBuild = selfContainedBuild; - dotnetUseAppHost = useAppHost; - inherit useDotnetFromEnv; + inherit (callPackage ./hooks { inherit dotnet-sdk dotnet-runtime; }) + dotnetConfigureHook + dotnetBuildHook + dotnetCheckHook + dotnetInstallHook + dotnetFixupHook + ; - nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [ - dotnetConfigureHook - dotnetBuildHook - dotnetCheckHook - dotnetInstallHook - dotnetFixupHook + _nugetDeps = + if (nugetDeps != null) then + if lib.isDerivation nugetDeps then + nugetDeps + else + mkNugetDeps { + inherit name; + sourceFile = nugetDeps; + } + else + throw "Defining the `nugetDeps` attribute is required, as to lock the NuGet dependencies. This file can be generated by running the `passthru.fetch-deps` script."; - cacert - makeWrapper - dotnet-sdk - unzip - yq - ]; + nugetDepsFile = _nugetDeps.sourceFile; - buildInputs = - args.buildInputs or [ ] - ++ [ - dotnet-sdk.packages - _nugetDeps - ] - ++ projectReferences; + inherit (dotnetCorePackages) systemToDotnetRid; + in + # Not all args need to be passed through to mkDerivation + # TODO: We should probably filter out even more attrs + removeAttrs args [ "nugetDeps" ] + // { + dotnetInstallPath = installPath; + dotnetExecutables = executables; + dotnetBuildType = buildType; + dotnetProjectFiles = projectFiles; + dotnetTestProjectFiles = testProjectFiles; + dotnetDisabledTests = disabledTests; + dotnetRuntimeIds = lib.singleton ( + if runtimeId != null then runtimeId else systemToDotnetRid stdenvNoCC.hostPlatform.system + ); + dotnetRuntimeDeps = map lib.getLib runtimeDeps; + dotnetSelfContainedBuild = selfContainedBuild; + dotnetUseAppHost = useAppHost; + inherit useDotnetFromEnv; - # Parse the version attr into a format acceptable for the Version msbuild property - # The actual version attr is saved in InformationalVersion, which accepts an arbitrary string - versionForDotnet = - if !(lib.hasAttr "version" args) || args.version == null then - null - else - let - components = lib.pipe args.version [ - lib.splitVersion - (lib.filter (x: (lib.strings.match "[0-9]+" x) != null)) - (lib.filter (x: (lib.toIntBase10 x) < 65535)) # one version component in dotnet has to fit in 16 bits - ]; - in - if (lib.length components) == 0 then + nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [ + dotnetConfigureHook + dotnetBuildHook + dotnetCheckHook + dotnetInstallHook + dotnetFixupHook + + cacert + makeWrapper + dotnet-sdk + unzip + yq + ]; + + buildInputs = + args.buildInputs or [ ] + ++ [ + dotnet-sdk.packages + _nugetDeps + ] + ++ projectReferences; + + # Parse the version attr into a format acceptable for the Version msbuild property + # The actual version attr is saved in InformationalVersion, which accepts an arbitrary string + versionForDotnet = + if !(lib.hasAttr "version" args) || args.version == null then null else - lib.concatStringsSep "." ( - (lib.take 4 components) - ++ (if (lib.length components) < 4 then lib.replicate (4 - (lib.length components)) "0" else [ ]) - ); - - makeWrapperArgs = args.makeWrapperArgs or [ ] ++ [ - "--prefix" - "LD_LIBRARY_PATH" - ":" - "${dotnet-sdk.icu}/lib" - ]; - - # Stripping breaks the executable - dontStrip = args.dontStrip or true; - - # gappsWrapperArgs gets included when wrapping for dotnet, as to avoid double wrapping - dontWrapGApps = args.dontWrapGApps or true; - - # propagate the runtime sandbox profile since the contents apply to published - # executables - propagatedSandboxProfile = toString dotnet-runtime.__propagatedSandboxProfile; - - passthru = - { - nugetDeps = _nugetDeps; - } - // lib.optionalAttrs (!lib.isDerivation nugetDeps) { - fetch-deps = let - pkg = finalAttrs.finalPackage.overrideAttrs ( - old: - { - buildInputs = lib.remove _nugetDeps old.buildInputs; - keepNugetConfig = true; - } - // lib.optionalAttrs (runtimeId == null) { - dotnetRuntimeIds = map (system: systemToDotnetRid system) platforms; - } + components = lib.pipe args.version [ + lib.splitVersion + (lib.filter (x: (lib.strings.match "[0-9]+" x) != null)) + (lib.filter (x: (lib.toIntBase10 x) < 65535)) # one version component in dotnet has to fit in 16 bits + ]; + in + if (lib.length components) == 0 then + null + else + lib.concatStringsSep "." ( + (lib.take 4 components) + ++ (if (lib.length components) < 4 then lib.replicate (4 - (lib.length components)) "0" else [ ]) ); - drv = builtins.unsafeDiscardOutputDependency pkg.drvPath; + makeWrapperArgs = args.makeWrapperArgs or [ ] ++ [ + "--prefix" + "LD_LIBRARY_PATH" + ":" + "${dotnet-sdk.icu}/lib" + ]; - innerScript = substituteAll { - src = ./fetch-deps.sh; - isExecutable = true; - defaultDepsFile = - # Wire in the nugetDeps file such that running the script with no args - # runs it agains the correct deps file by default. - # Note that toString is necessary here as it results in the path at - # eval time (i.e. to the file in your local Nixpkgs checkout) rather - # than the Nix store path of the path after it's been imported. - if lib.isPath nugetDepsFile && !lib.hasPrefix "${builtins.storeDir}/" (toString nugetDepsFile) then - toString nugetDepsFile - else - ''$(mktemp -t "${pname}-deps-XXXXXX.nix")''; - nugetToNix = (nuget-to-nix.override { inherit dotnet-sdk; }); - }; + # Stripping breaks the executable + dontStrip = args.dontStrip or true; - in - writeShellScript "${name}-fetch-deps" '' - NIX_BUILD_SHELL="${runtimeShell}" exec ${nix}/bin/nix-shell \ - --pure --run 'source "${innerScript}"' "${drv}" - ''; - } - // args.passthru or { }; + # gappsWrapperArgs gets included when wrapping for dotnet, as to avoid double wrapping + dontWrapGApps = args.dontWrapGApps or true; - meta = (args.meta or { }) // { - inherit platforms; + # propagate the runtime sandbox profile since the contents apply to published + # executables + propagatedSandboxProfile = toString dotnet-runtime.__propagatedSandboxProfile; + + passthru = + { + nugetDeps = _nugetDeps; + } + // lib.optionalAttrs (!lib.isDerivation nugetDeps) { + fetch-deps = + let + pkg = finalAttrs.finalPackage.overrideAttrs ( + old: + { + buildInputs = lib.remove _nugetDeps old.buildInputs; + keepNugetConfig = true; + } + // lib.optionalAttrs (runtimeId == null) { + dotnetRuntimeIds = map (system: systemToDotnetRid system) platforms; + } + ); + + drv = builtins.unsafeDiscardOutputDependency pkg.drvPath; + + innerScript = substituteAll { + src = ./fetch-deps.sh; + isExecutable = true; + defaultDepsFile = + # Wire in the nugetDeps file such that running the script with no args + # runs it agains the correct deps file by default. + # Note that toString is necessary here as it results in the path at + # eval time (i.e. to the file in your local Nixpkgs checkout) rather + # than the Nix store path of the path after it's been imported. + if lib.isPath nugetDepsFile && !lib.hasPrefix "${builtins.storeDir}/" (toString nugetDepsFile) then + toString nugetDepsFile + else + ''$(mktemp -t "${pname}-deps-XXXXXX.nix")''; + nugetToNix = (nuget-to-nix.override { inherit dotnet-sdk; }); + }; + + in + writeShellScript "${name}-fetch-deps" '' + NIX_BUILD_SHELL="${runtimeShell}" exec ${nix}/bin/nix-shell \ + --pure --run 'source "${innerScript}"' "${drv}" + ''; + } + // args.passthru or { }; + + meta = (args.meta or { }) // { + inherit platforms; + }; }; - } +in +fnOrAttrs: +stdenvNoCC.mkDerivation ( + finalAttrs: + let + args = if lib.isFunction fnOrAttrs then fnOrAttrs (args // finalAttrs) else fnOrAttrs; + in + transformArgs finalAttrs args ) diff --git a/pkgs/test/dotnet/default.nix b/pkgs/test/dotnet/default.nix index d70850c05fdb..72c2f5a64def 100644 --- a/pkgs/test/dotnet/default.nix +++ b/pkgs/test/dotnet/default.nix @@ -4,4 +4,5 @@ project-references = callPackage ./project-references { }; use-dotnet-from-env = lib.recurseIntoAttrs (callPackage ./use-dotnet-from-env { }); structured-attrs = lib.recurseIntoAttrs (callPackage ./structured-attrs { }); + final-attrs = lib.recurseIntoAttrs (callPackage ./final-attrs { }); } diff --git a/pkgs/test/dotnet/final-attrs/default.nix b/pkgs/test/dotnet/final-attrs/default.nix new file mode 100644 index 000000000000..cfc476361157 --- /dev/null +++ b/pkgs/test/dotnet/final-attrs/default.nix @@ -0,0 +1,76 @@ +{ + lib, + dotnet-sdk, + buildPackages, # buildDotnetModule + testers, + runCommand, +}: +let + copyrightString = "Original Copyright"; + originalCopyright = builtins.toFile "original-copyright.txt" copyrightString; + overridenCopyright = builtins.toFile "overridden-copyright.txt" ( + copyrightString + " with override!" + ); + + inherit (buildPackages) buildDotnetModule; + + app-recursive = buildDotnetModule (finalAttrs: { + name = "final-attrs-rec-test-application"; + src = ../structured-attrs/src; + nugetDeps = ../structured-attrs/nuget-deps.nix; + dotnetFlags = [ "--property:Copyright=${finalAttrs.passthru.copyrightString}" ]; + env.TargetFramework = "net${lib.versions.majorMinor (lib.getVersion dotnet-sdk)}"; + __structuredAttrs = true; + passthru = { + inherit copyrightString; + }; + }); + + app-const = buildDotnetModule { + name = "final-attrs-const-test-application"; + src = ../structured-attrs/src; + nugetDeps = ../structured-attrs/nuget-deps.nix; + dotnetFlags = [ "--property:Copyright=${copyrightString}" ]; + env.TargetFramework = "net${lib.versions.majorMinor (lib.getVersion dotnet-sdk)}"; + __structuredAttrs = true; + passthru = { + inherit copyrightString; + }; + }; + + override = + app: + app.overrideAttrs (previousAttrs: { + passthru = previousAttrs.passthru // { + copyrightString = previousAttrs.passthru.copyrightString + " with override!"; + }; + }); + + run = + name: app: + runCommand name { } '' + ${app}/bin/Application >"$out" + ''; +in +{ + check-output = testers.testEqualContents { + assertion = "buildDotnetModule produces the expected output when called with a recursive function"; + expected = originalCopyright; + actual = run "dotnet-final-attrs-test-rec-output" app-recursive; + }; + output-matches-const = testers.testEqualContents { + assertion = "buildDotnetModule produces the same output when called with attrs or a recursive function"; + expected = run "dotnet-final-attrs-test-const" app-const; + actual = run "dotnet-final-attrs-test-rec" app-recursive; + }; + override-has-no-effect = testers.testEqualContents { + assertion = "buildDotnetModule produces the expected output when called with a recursive function"; + expected = originalCopyright; + actual = run "dotnet-final-attrs-test-override-const-output" (override app-const); + }; + override-modifies-output = testers.testEqualContents { + assertion = "buildDotnetModule produces the expected output when called with a recursive function"; + expected = overridenCopyright; + actual = run "dotnet-final-attrs-test-override-rec-output" (override app-recursive); + }; +} From 8a53bb5e8bff11914858bae8317d2cae3449b8b7 Mon Sep 17 00:00:00 2001 From: Tom Bereknyei Date: Tue, 6 Aug 2024 14:48:31 -0400 Subject: [PATCH 05/23] python3Packages.aiohttp-remotes: fix build on darwin --- pkgs/development/python-modules/aiohttp-remotes/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/aiohttp-remotes/default.nix b/pkgs/development/python-modules/aiohttp-remotes/default.nix index ac73417b348c..568c3888af76 100644 --- a/pkgs/development/python-modules/aiohttp-remotes/default.nix +++ b/pkgs/development/python-modules/aiohttp-remotes/default.nix @@ -45,6 +45,8 @@ buildPythonPackage rec { "--asyncio-mode=auto" ]; + __darwinAllowLocalNetworking = true; + meta = with lib; { description = "Set of useful tools for aiohttp.web server"; homepage = "https://github.com/wikibusiness/aiohttp-remotes"; From ed646be3541c7ca9e411ae0c5ba2f908ed489057 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 7 Aug 2024 06:05:53 +0000 Subject: [PATCH 06/23] xarcan: 0-unstable-2024-05-23 -> 0-unstable-2024-08-04 --- pkgs/by-name/xa/xarcan/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/xa/xarcan/package.nix b/pkgs/by-name/xa/xarcan/package.nix index 2ecf6e3173c4..bcb42f0414fa 100644 --- a/pkgs/by-name/xa/xarcan/package.nix +++ b/pkgs/by-name/xa/xarcan/package.nix @@ -39,13 +39,13 @@ stdenv.mkDerivation (finalPackages: { pname = "xarcan"; - version = "0-unstable-2024-05-23"; + version = "0-unstable-2024-08-04"; src = fetchFromGitHub { owner = "letoram"; repo = "xarcan"; - rev = "ebb46609315d95fb286009310de11b03f7333022"; - hash = "sha256-XXA5c/yV6QaPiz1LHWkb+Tm6Wmead8EndkSk3onvrcs="; + rev = "7644616b3bd0ff2b5708e93acc990cd757b20ae9"; + hash = "sha256-iKYTuJ/1iwm449ZOBOzi+LkrTTio7aaIHUn+M+Sbzc8="; }; nativeBuildInputs = [ From b361684c722b0b78a1058e2492381eb22d2e147d Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 7 Aug 2024 08:03:40 +0000 Subject: [PATCH 07/23] safeeyes: 2.2.1 -> 2.2.2 --- pkgs/applications/misc/safeeyes/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/safeeyes/default.nix b/pkgs/applications/misc/safeeyes/default.nix index 42dbdbd0f6b6..b7492100794c 100644 --- a/pkgs/applications/misc/safeeyes/default.nix +++ b/pkgs/applications/misc/safeeyes/default.nix @@ -18,11 +18,11 @@ with python3.pkgs; buildPythonApplication rec { pname = "safeeyes"; - version = "2.2.1"; + version = "2.2.2"; src = fetchPypi { inherit pname version; - hash = "sha256-Ub/KcNG2jg4revtfOpr0vDyHzw3vCy+bqLeXX4Po+cw="; + hash = "sha256-k/CNxLScZDCXiwJhP5qh5HD5VUKlOLaYV8ICYgz6NKI="; }; postPatch = '' From b65dfc3161077ba476c9db3a13629d7fc055eda5 Mon Sep 17 00:00:00 2001 From: Mitchell Pleune Date: Tue, 16 Jul 2024 13:09:15 -0400 Subject: [PATCH 08/23] Update pyside2/shiboken2 and sip4 to Python 3.12 These are both Python QT 5 modules, which have issues with Python 3.12 that are fixed in never versions, yet many packages depend on them. Sip4 was as simple as installing and switching over to setuptools (to replace the now removed distutils). pyside/shiboken was much more involved. I ended up pulling the required patches from the Ubuntu release repositories. The existing patch to fix clang's include headers needed an update as well, but was still required. There is some unsightly find-and-replace going on to replace distutils with setuptools. This is because, although setuptools now creates the "distutils" import module, it has to be itself imported first before that can happen. I Used this widespread find-and-replace as it does function properly, and should be extremly flexable for future versions (no needing to update patches on each release). --- ...s-to-enable-3.12-wheel-compatibility.patch | 28 ++ .../Modify-sendCommand-signatures.patch | 41 +++ ...-Fix-the-structure-of-class-property.patch | 37 +++ ...upport-running-PySide-on-Python-3.12.patch | 298 ++++++++++++++++++ .../python-modules/pyside2/default.nix | 47 ++- .../pyside2/nix_compile_cflags.patch | 23 ++ ...-Fix-and-simplify-resolveType-helper.patch | 88 ++++++ ...boken2-clang-Fix-build-with-clang-16.patch | 108 +++++++ ...lashes-between-type-name-and-enumera.patch | 92 ++++++ ...d-scope-resolution-of-arguments-func.patch | 178 +++++++++++ ...oken2-clang-Remove-typedef-expansion.patch | 101 ++++++ ...ess-class-scope-look-up-for-paramete.patch | 96 ++++++ ...-scope-resolution-for-all-parameters.patch | 62 ++++ .../python-modules/shiboken2/default.nix | 39 ++- .../shiboken2/nix_compile_cflags.patch | 30 -- pkgs/development/python-modules/sip/4.x.nix | 19 +- 16 files changed, 1238 insertions(+), 49 deletions(-) create mode 100644 pkgs/development/python-modules/pyside2/Final-details-to-enable-3.12-wheel-compatibility.patch create mode 100644 pkgs/development/python-modules/pyside2/Modify-sendCommand-signatures.patch create mode 100644 pkgs/development/python-modules/pyside2/Python-3.12-Fix-the-structure-of-class-property.patch create mode 100644 pkgs/development/python-modules/pyside2/Support-running-PySide-on-Python-3.12.patch create mode 100644 pkgs/development/python-modules/pyside2/nix_compile_cflags.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Fix-and-simplify-resolveType-helper.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Fix-build-with-clang-16.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Fix-clashes-between-type-name-and-enumera.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Record-scope-resolution-of-arguments-func.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Remove-typedef-expansion.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Suppress-class-scope-look-up-for-paramete.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Write-scope-resolution-for-all-parameters.patch delete mode 100644 pkgs/development/python-modules/shiboken2/nix_compile_cflags.patch diff --git a/pkgs/development/python-modules/pyside2/Final-details-to-enable-3.12-wheel-compatibility.patch b/pkgs/development/python-modules/pyside2/Final-details-to-enable-3.12-wheel-compatibility.patch new file mode 100644 index 000000000000..beab48c54ad1 --- /dev/null +++ b/pkgs/development/python-modules/pyside2/Final-details-to-enable-3.12-wheel-compatibility.patch @@ -0,0 +1,28 @@ +From: =?utf-8?q?Cristi=C3=A1n_Maureira-Fredes?= + +Date: Tue, 10 Oct 2023 15:52:09 +0200 +Subject: Final details to enable 3.12 wheel compatibility + +Change-Id: I0252c4e73e8c214ef8aa418ddf88bc452c0fdf53 +Pick-to: 6.6 +Task-number: PYSIDE-2230 +Reviewed-by: Friedemann Kleint +(cherry picked from commit 6c7bb7b6e1008909e49bc04d2a48024309a784cc) +--- + build_scripts/config.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build_scripts/config.py b/build_scripts/config.py +index 5fc23d4..fb27394 100644 +--- a/build_scripts/config.py ++++ b/build_scripts/config.py +@@ -138,7 +138,7 @@ class Config(object): + setup_kwargs['zip_safe'] = False + setup_kwargs['cmdclass'] = cmd_class_dict + setup_kwargs['version'] = package_version +- setup_kwargs['python_requires'] = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.12" ++ setup_kwargs['python_requires'] = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.13" + + if quiet: + # Tells distutils / setuptools to be quiet, and only print warnings or errors. + diff --git a/pkgs/development/python-modules/pyside2/Modify-sendCommand-signatures.patch b/pkgs/development/python-modules/pyside2/Modify-sendCommand-signatures.patch new file mode 100644 index 000000000000..7465b109f8a4 --- /dev/null +++ b/pkgs/development/python-modules/pyside2/Modify-sendCommand-signatures.patch @@ -0,0 +1,41 @@ +From: Dmitry Shachnev +Date: Sun, 4 Feb 2024 00:29:00 +0300 +Subject: Modify sendCommand signatures to use 0 as default value + +The original default value was QNodeCommand::CommandId(), and shiboken +copies it verbatim from the header file, however it does not work because +we do not generate "using namespace Qt3DCore;". + +0 is the same as QNodeCommand::CommandId(). +--- + sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml b/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml +index 8696a12..310595f 100644 +--- a/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml ++++ b/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml +@@ -58,6 +58,11 @@ + + + ++ ++ ++ ++ ++ + +