Merge master into staging-next
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
, fetchPypi
|
||||
, alsa-utils
|
||||
, gobject-introspection
|
||||
, libappindicator-gtk3
|
||||
, libnotify
|
||||
, wlrctl
|
||||
, gtk3
|
||||
@@ -18,11 +17,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 = ''
|
||||
@@ -36,7 +35,6 @@ buildPythonApplication rec {
|
||||
|
||||
buildInputs = [
|
||||
gtk3
|
||||
libappindicator-gtk3
|
||||
libnotify
|
||||
];
|
||||
|
||||
|
||||
@@ -35,14 +35,14 @@ https://github.com/NixOS/nixpkgs/issues/199596#issuecomment-1310136382 */
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
version = "1.5.5";
|
||||
version = "1.6.0";
|
||||
pname = "syncthingtray";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Martchus";
|
||||
repo = "syncthingtray";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-NfFB+4cqe1rHqc+w0Enl9h33gPjJ3CfrFpyOhysmz0Q=";
|
||||
hash = "sha256-tbtSISWBNHxuF2T1XK5JnkiPMYzgP4fyw5t6z91P2p8=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
stable = {
|
||||
chromedriver = {
|
||||
hash_darwin = "sha256-BW83pgPJiKxdQ1K4+8KMDGBqvR+J3i+8AZmKfnYSmWk=";
|
||||
hash_darwin = "sha256-Evz39J4o3FJdJbYsFxmnLiZ9QiMeZttcbTtZ6wAVXoQ=";
|
||||
hash_darwin_aarch64 =
|
||||
"sha256-ZGZy4VDNRXJBMLtAhRUybssWRXSfEUWVRsF+etfhdzQ=";
|
||||
hash_linux = "sha256-1gM4KqzacJ13X5NmBn2hW6L/a7zN21rSZBk6a0IjCow=";
|
||||
version = "127.0.6533.88";
|
||||
"sha256-4Dkdi5C6dcuEewYvy60F5m4ynzb5lGWrJFs1Q+4vapI=";
|
||||
hash_linux = "sha256-Lls/gwyA28G8X41wXEIKlgNdmKWgWnPf6iHZGrU8e54=";
|
||||
version = "127.0.6533.99";
|
||||
};
|
||||
deps = {
|
||||
gn = {
|
||||
@@ -15,8 +15,8 @@
|
||||
version = "2024-06-06";
|
||||
};
|
||||
};
|
||||
hash = "sha256-nZZ2yrVu+0TloMaM455bmyeoeVnfeGR3EGubAf8snNU=";
|
||||
version = "127.0.6533.88";
|
||||
hash = "sha256-VKPlcBfS6iw4E1nz0nYJLg273XmJ+RcGGktRbqQTTwQ=";
|
||||
version = "127.0.6533.99";
|
||||
};
|
||||
ungoogled-chromium = {
|
||||
deps = {
|
||||
|
||||
@@ -19,20 +19,21 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "jujutsu";
|
||||
version = "0.19.0";
|
||||
version = "0.20.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "martinvonz";
|
||||
repo = "jj";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-coASwU7nMalqvtqukhuRWz52My4e2Zl/7tqHNEvS1Nk=";
|
||||
hash = "sha256-1lONtpataRi0yE6LpN6oNnC3OAW918v8GFCUwinYJWI=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-9SYjC3xL8OGGT56Q/yhH1oWeRT0Z956Yms6DGvCzlUY=";
|
||||
cargoHash = "sha256-dRbOTxlFXfmeHUKH2UeN84OwlQ1urCND/Nfk9vSeLwA=";
|
||||
|
||||
cargoBuildFlags = [ "--bin" "jj" ]; # don't install the fake editors
|
||||
useNextest = false; # nextest is the upstream integration framework, but is problematic for test skipping
|
||||
ZSTD_SYS_USE_PKG_CONFIG = "1"; # disable vendored zlib
|
||||
LIBGIT2_NO_VENDOR = "1"; # disable vendored libgit2
|
||||
LIBSSH2_SYS_USE_PKG_CONFIG = "1"; # disable vendored libssh2
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
@@ -1,222 +1,260 @@
|
||||
{ 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
|
||||
# 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:
|
||||
# <ProjectReference Include="../foo/bar.fsproj" />
|
||||
# To enable discovery through `projectReferences` you would need to add a line:
|
||||
# <ProjectReference Include="../foo/bar.fsproj" />
|
||||
# <PackageReference Include="bar" Version="*" Condition=" '$(ContinuousIntegrationBuild)'=='true' "/>
|
||||
, 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:
|
||||
# <ProjectReference Include="../foo/bar.fsproj" />
|
||||
# To enable discovery through `projectReferences` you would need to add a line:
|
||||
# <ProjectReference Include="../foo/bar.fsproj" />
|
||||
# <PackageReference Include="bar" Version="*" Condition=" '$(ContinuousIntegrationBuild)'=='true' "/>
|
||||
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
|
||||
|
||||
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 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 [ ]));
|
||||
|
||||
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;
|
||||
});
|
||||
|
||||
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
|
||||
_nugetDeps =
|
||||
if (nugetDeps != null) then
|
||||
if lib.isDerivation nugetDeps then
|
||||
nugetDeps
|
||||
else
|
||||
''$(mktemp -t "${pname}-deps-XXXXXX.nix")'';
|
||||
nugetToNix = (nuget-to-nix.override { inherit dotnet-sdk; });
|
||||
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
|
||||
# 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;
|
||||
|
||||
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
|
||||
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 [ ])
|
||||
);
|
||||
|
||||
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;
|
||||
}
|
||||
);
|
||||
|
||||
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 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
|
||||
)
|
||||
|
||||
@@ -38,7 +38,13 @@ python3.pkgs.buildPythonApplication rec {
|
||||
"tests"
|
||||
];
|
||||
|
||||
disabledTests = [ "test_datafile_download" ];
|
||||
# Disable tests that are problematic with pytest
|
||||
# Check NixOS/nixpkgs#333019 for more info about these
|
||||
disabledTests = [
|
||||
"test_datafile_download"
|
||||
"test_display_get_input_str"
|
||||
"test_display_get_y_n"
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"castero"
|
||||
|
||||
@@ -8,16 +8,16 @@
|
||||
let
|
||||
argset = {
|
||||
pname = "chezmoi";
|
||||
version = "2.51.0";
|
||||
version = "2.52.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "twpayne";
|
||||
repo = "chezmoi";
|
||||
rev = "v${argset.version}";
|
||||
hash = "sha256-18y1AmCCoxu365bsLwUrPTUqT/Hy6e2WC2xt0o4K8/8=";
|
||||
hash = "sha256-RhzFIG93LglHd462e9ZdUYLGGlWn2EkJcEbk9EPrlfA=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-wWvvNc7W+7/Hwy4/hwCyY0k/Qm5M7Z6PPCa9DXbXY0E=";
|
||||
vendorHash = "sha256-3RJk8Pf445lF2C7kQsj0eOXcFBWCHwLx8+GrqO7nAPM=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
|
||||
@@ -30,6 +30,12 @@ buildGoModule {
|
||||
subPackages = [ "cmd/incus" ];
|
||||
|
||||
postInstall = ''
|
||||
# Needed for builds on systems with auto-allocate-uids to pass.
|
||||
# Incus tries to read ~/.config/incus while generating completions
|
||||
# to resolve user aliases.
|
||||
export HOME="$(mktemp -d)"
|
||||
mkdir -p "$HOME/.config/incus"
|
||||
|
||||
installShellCompletion --cmd incus \
|
||||
--bash <($out/bin/incus completion bash) \
|
||||
--fish <($out/bin/incus completion fish) \
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
|
||||
buildNpmPackage rec {
|
||||
pname = "textlint";
|
||||
version = "14.0.4";
|
||||
version = "14.0.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "textlint";
|
||||
repo = "textlint";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-u8BRzfvpZ8xggJwH8lsu+hqsql6s4SZVlkFzLBe6zvE=";
|
||||
hash = "sha256-W2ySdd1ADqEpEBFgwRvzAzAivL//pj2PSlg7Kfcbspg=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
@@ -42,7 +42,7 @@ buildNpmPackage rec {
|
||||
./remove-workspaces.patch
|
||||
];
|
||||
|
||||
npmDepsHash = "sha256-rmRtCP51rt/wd/ef0iwMMI6eCGF1KNN7kJqomitMJ+w=";
|
||||
npmDepsHash = "sha256-IMXcdR9WqSvBwk3/0qihVr3OraJAwrsCMUVnTbx9z+Q=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoconf
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "uxn";
|
||||
version = "1.0-unstable-2024-07-26";
|
||||
version = "1.0-unstable-2024-08-05";
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~rabbits";
|
||||
repo = "uxn";
|
||||
rev = "bf10311d5aad4184098c84a96845e30b1f53634d";
|
||||
hash = "sha256-OVITP8AbWchcFaVOHkck8hwGlEl/TgtbtkApoKex4ig=";
|
||||
rev = "a9d7ff23a533ee354fcbc5a1260296a6b0ecfefa";
|
||||
hash = "sha256-VPIgS127ewX5yTZEZZgUZYAXqbCfSa+AMtFMufdQMWo=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "projects" ];
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -75,13 +75,13 @@ let
|
||||
|
||||
in stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "yosys";
|
||||
version = "0.43";
|
||||
version = "0.44";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "YosysHQ";
|
||||
repo = "yosys";
|
||||
rev = "refs/tags/yosys-${finalAttrs.version}";
|
||||
hash = "sha256-MJTtQvHsHvuo4aNNYSPxSMbeXCty66q83/sbp1Yiiv4=";
|
||||
hash = "sha256-aMVWmryMbVlEm1RNj1ENpLHOpuKRQTJMFZCn+WuaR04=";
|
||||
fetchSubmodules = true;
|
||||
leaveDotGit = true;
|
||||
postFetch = ''
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "cpp-utilities";
|
||||
version = "5.25.0";
|
||||
version = "5.26.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Martchus";
|
||||
repo = "cpp-utilities";
|
||||
rev = "v${finalAttrs.version}";
|
||||
sha256 = "sha256-ECTtKx/N5MfWwYSwOycs6FXxDR56DT9tkdRxrhX4fVU=";
|
||||
sha256 = "sha256-PU3Cn+T/ngbK2/3cBkvI1pCHKnYTWP4JepMMAmWNK1k=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "qtutilities";
|
||||
version = "6.14.1";
|
||||
version = "6.14.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Martchus";
|
||||
repo = "qtutilities";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-WUrxBlSS1Z3+tQGmAi+d3wpqutqNjPrVOxmpUy01aqU=";
|
||||
hash = "sha256-Ugnnebts9+fUlxwjT9qpxV558PcJiHHhY5BzburR+EI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
@@ -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";
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
From: =?utf-8?q?Cristi=C3=A1n_Maureira-Fredes?=
|
||||
<Cristian.Maureira-Fredes@qt.io>
|
||||
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 <Friedemann.Kleint@qt.io>
|
||||
(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.
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From: Dmitry Shachnev <mitya57@debian.org>
|
||||
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 @@
|
||||
<object-type name="QAspectJob"/>
|
||||
<object-type name="QBackendNode">
|
||||
<enum-type name="Mode"/>
|
||||
+ <modify-function signature="sendCommand(const QString&,const QVariant&,unsigned long long)">
|
||||
+ <modify-argument index="3">
|
||||
+ <replace-default-expression with="0"/>
|
||||
+ </modify-argument>
|
||||
+ </modify-function>
|
||||
</object-type>
|
||||
<!-- TODO: Solve issues related to windows and a unresolved
|
||||
external symbol
|
||||
@@ -82,6 +87,11 @@
|
||||
</object-type>
|
||||
<object-type name="QNode">
|
||||
<enum-type name="PropertyTrackingMode"/>
|
||||
+ <modify-function signature="sendCommand(const QString&,const QVariant&,unsigned long long)">
|
||||
+ <modify-argument index="3">
|
||||
+ <replace-default-expression with="0"/>
|
||||
+ </modify-argument>
|
||||
+ </modify-function>
|
||||
</object-type>
|
||||
<object-type name="QNodeCommand" since="5.10"/>
|
||||
<object-type name="QNodeCreatedChangeBase"/>
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
From: Christian Tismer <tismer@stackless.com>
|
||||
Date: Tue, 14 Feb 2023 14:46:22 +0100
|
||||
Subject: Python 3.12: Fix the structure of class property
|
||||
|
||||
There is a PySide bug in Python 3.10 already: The structure for
|
||||
classproperty derives from the property structure. This was extended
|
||||
in Python 3.10, already, but the type generation check was made more
|
||||
exhaustive in Python 3.12 and recognized that.
|
||||
|
||||
This change is only for making the compiler/C API happy.
|
||||
In order to use the extension field, it is necessary to do a runtime
|
||||
check because of the Limited API.
|
||||
|
||||
Task-number: PYSIDE-2230
|
||||
Change-Id: I88dcaa11589ff41852f08fa2defa5200a0dd4eb6
|
||||
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
||||
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
||||
(cherry picked from commit edfd9a5ad174a48f8d7da511dc6a1c69e931a418)
|
||||
---
|
||||
sources/pyside2/libpyside/feature_select.cpp | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/sources/pyside2/libpyside/feature_select.cpp b/sources/pyside2/libpyside/feature_select.cpp
|
||||
index 3011b35..b9e1470 100644
|
||||
--- a/sources/pyside2/libpyside/feature_select.cpp
|
||||
+++ b/sources/pyside2/libpyside/feature_select.cpp
|
||||
@@ -671,6 +671,11 @@ typedef struct {
|
||||
PyObject *prop_set;
|
||||
PyObject *prop_del;
|
||||
PyObject *prop_doc;
|
||||
+#if PY_VERSION_HEX >= 0x030A0000
|
||||
+ // Note: This is a problem with Limited API: We have no direct access.
|
||||
+ // You need to pick it from runtime info.
|
||||
+ PyObject *prop_name;
|
||||
+#endif
|
||||
int getter_doc;
|
||||
} propertyobject;
|
||||
@@ -0,0 +1,298 @@
|
||||
From: Christian Tismer <tismer@stackless.com>
|
||||
Date: Tue, 14 Feb 2023 14:46:22 +0100
|
||||
Subject: Support running PySide on Python 3.12
|
||||
|
||||
Builtin types no longer have tp_dict set. We need to
|
||||
use PyType_GetDict, instead. This works without Limited API
|
||||
at the moment.
|
||||
|
||||
With some great cheating, this works with Limited API, too.
|
||||
We emulate PyType_GetDict by tp_dict if that is not 0.
|
||||
Otherwise we create an empty dict.
|
||||
|
||||
Some small changes to Exception handling and longer
|
||||
warm-up in leaking tests were found, too.
|
||||
|
||||
Pick-to: 6.6 6.5 6.2
|
||||
Task-number: PYSIDE-2230
|
||||
Change-Id: I8a56de6208ec00979255b39b5784dfc9b4b92def
|
||||
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
||||
(cherry picked from commit 441ffbd4fc622e67acd81e9c1c6d3a0b0fbcacf0)
|
||||
---
|
||||
build_scripts/config.py | 3 +-
|
||||
sources/pyside2/PySide2/support/generate_pyi.py | 8 ++++--
|
||||
sources/pyside2/libpyside/feature_select.cpp | 10 ++++---
|
||||
sources/pyside2/libpyside/pysideproperty.cpp | 4 +--
|
||||
sources/pyside2/libpyside/pysidesignal.cpp | 4 +--
|
||||
sources/pyside2/tests/QtWidgets/bug_662.py | 3 +-
|
||||
sources/pyside2/tests/signals/bug_79.py | 5 ++++
|
||||
sources/shiboken2/libshiboken/pep384impl.cpp | 33 ++++++++++++++++++++++
|
||||
sources/shiboken2/libshiboken/pep384impl.h | 8 ++++++
|
||||
.../shiboken2/libshiboken/signature/signature.cpp | 2 +-
|
||||
.../libshiboken/signature/signature_helper.cpp | 6 ++--
|
||||
.../shibokensupport/signature/errorhandler.py | 6 ++++
|
||||
sources/shiboken2/tests/samplebinding/enum_test.py | 2 +-
|
||||
13 files changed, 78 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/build_scripts/config.py b/build_scripts/config.py
|
||||
index f2b4c40..5fc23d4 100644
|
||||
--- a/build_scripts/config.py
|
||||
+++ b/build_scripts/config.py
|
||||
@@ -94,7 +94,8 @@ class Config(object):
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
- 'Programming Language :: Python :: 3.11'
|
||||
+ 'Programming Language :: Python :: 3.11',
|
||||
+ 'Programming Language :: Python :: 3.12',
|
||||
]
|
||||
|
||||
self.setup_script_dir = None
|
||||
diff --git a/sources/pyside2/PySide2/support/generate_pyi.py b/sources/pyside2/PySide2/support/generate_pyi.py
|
||||
index 1956533..fd05b1f 100644
|
||||
--- a/sources/pyside2/PySide2/support/generate_pyi.py
|
||||
+++ b/sources/pyside2/PySide2/support/generate_pyi.py
|
||||
@@ -116,8 +116,12 @@ class Formatter(Writer):
|
||||
"""
|
||||
def _typevar__repr__(self):
|
||||
return "typing." + self.__name__
|
||||
- typing.TypeVar.__repr__ = _typevar__repr__
|
||||
-
|
||||
+ # This is no longer necessary for modern typing versions.
|
||||
+ # Ignore therefore if the repr is read-only and cannot be changed.
|
||||
+ try:
|
||||
+ typing.TypeVar.__repr__ = _typevar__repr__
|
||||
+ except TypeError:
|
||||
+ pass
|
||||
# Adding a pattern to substitute "Union[T, NoneType]" by "Optional[T]"
|
||||
# I tried hard to replace typing.Optional by a simple override, but
|
||||
# this became _way_ too much.
|
||||
diff --git a/sources/pyside2/libpyside/feature_select.cpp b/sources/pyside2/libpyside/feature_select.cpp
|
||||
index b9e1470..533c09d 100644
|
||||
--- a/sources/pyside2/libpyside/feature_select.cpp
|
||||
+++ b/sources/pyside2/libpyside/feature_select.cpp
|
||||
@@ -358,7 +358,8 @@ static bool SelectFeatureSetSubtype(PyTypeObject *type, PyObject *select_id)
|
||||
* This is the selector for one sublass. We need to call this for
|
||||
* every subclass until no more subclasses or reaching the wanted id.
|
||||
*/
|
||||
- if (Py_TYPE(type->tp_dict) == Py_TYPE(PyType_Type.tp_dict)) {
|
||||
+ static const auto *pyTypeType_tp_dict = PepType_GetDict(&PyType_Type);
|
||||
+ if (Py_TYPE(type->tp_dict) == Py_TYPE(pyTypeType_tp_dict)) {
|
||||
// On first touch, we initialize the dynamic naming.
|
||||
// The dict type will be replaced after the first call.
|
||||
if (!replaceClassDict(type)) {
|
||||
@@ -385,7 +386,8 @@ static inline PyObject *SelectFeatureSet(PyTypeObject *type)
|
||||
* Generated functions call this directly.
|
||||
* Shiboken will assign it via a public hook of `basewrapper.cpp`.
|
||||
*/
|
||||
- if (Py_TYPE(type->tp_dict) == Py_TYPE(PyType_Type.tp_dict)) {
|
||||
+ static const auto *pyTypeType_tp_dict = PepType_GetDict(&PyType_Type);
|
||||
+ if (Py_TYPE(type->tp_dict) == Py_TYPE(pyTypeType_tp_dict)) {
|
||||
// We initialize the dynamic features by using our own dict type.
|
||||
if (!replaceClassDict(type))
|
||||
return nullptr;
|
||||
@@ -721,11 +723,11 @@ static bool patch_property_impl()
|
||||
// Turn `__doc__` into a computed attribute without changing writability.
|
||||
auto gsp = property_getset;
|
||||
auto type = &PyProperty_Type;
|
||||
- auto dict = type->tp_dict;
|
||||
+ AutoDecRef dict(PepType_GetDict(type));
|
||||
AutoDecRef descr(PyDescr_NewGetSet(type, gsp));
|
||||
if (descr.isNull())
|
||||
return false;
|
||||
- if (PyDict_SetItemString(dict, gsp->name, descr) < 0)
|
||||
+ if (PyDict_SetItemString(dict.object(), gsp->name, descr) < 0)
|
||||
return false;
|
||||
// Replace property_descr_get/set by slightly changed versions
|
||||
return true;
|
||||
diff --git a/sources/pyside2/libpyside/pysideproperty.cpp b/sources/pyside2/libpyside/pysideproperty.cpp
|
||||
index 86909d3..d2e2c68 100644
|
||||
--- a/sources/pyside2/libpyside/pysideproperty.cpp
|
||||
+++ b/sources/pyside2/libpyside/pysideproperty.cpp
|
||||
@@ -445,8 +445,8 @@ namespace {
|
||||
|
||||
static PyObject *getFromType(PyTypeObject *type, PyObject *name)
|
||||
{
|
||||
- PyObject *attr = nullptr;
|
||||
- attr = PyDict_GetItem(type->tp_dict, name);
|
||||
+ AutoDecRef tpDict(PepType_GetDict(type));
|
||||
+ auto *attr = PyDict_GetItem(tpDict.object(), name);
|
||||
if (!attr) {
|
||||
PyObject *bases = type->tp_bases;
|
||||
int size = PyTuple_GET_SIZE(bases);
|
||||
diff --git a/sources/pyside2/libpyside/pysidesignal.cpp b/sources/pyside2/libpyside/pysidesignal.cpp
|
||||
index 6824a71..f15d7aa 100644
|
||||
--- a/sources/pyside2/libpyside/pysidesignal.cpp
|
||||
+++ b/sources/pyside2/libpyside/pysidesignal.cpp
|
||||
@@ -670,8 +670,8 @@ void updateSourceObject(PyObject *source)
|
||||
Py_ssize_t pos = 0;
|
||||
PyObject *value;
|
||||
PyObject *key;
|
||||
-
|
||||
- while (PyDict_Next(objType->tp_dict, &pos, &key, &value)) {
|
||||
+ Shiboken::AutoDecRef tpDict(PepType_GetDict(objType));
|
||||
+ while (PyDict_Next(tpDict, &pos, &key, &value)) {
|
||||
if (PyObject_TypeCheck(value, PySideSignalTypeF())) {
|
||||
Shiboken::AutoDecRef signalInstance(reinterpret_cast<PyObject *>(PyObject_New(PySideSignalInstance, PySideSignalInstanceTypeF())));
|
||||
instanceInitialize(signalInstance.cast<PySideSignalInstance *>(), key, reinterpret_cast<PySideSignal *>(value), source, 0);
|
||||
diff --git a/sources/pyside2/tests/QtWidgets/bug_662.py b/sources/pyside2/tests/QtWidgets/bug_662.py
|
||||
index 7fb97de..ec0e6f9 100644
|
||||
--- a/sources/pyside2/tests/QtWidgets/bug_662.py
|
||||
+++ b/sources/pyside2/tests/QtWidgets/bug_662.py
|
||||
@@ -40,7 +40,8 @@ from PySide2.QtWidgets import QTextEdit, QApplication
|
||||
import sys
|
||||
|
||||
class testQTextBlock(unittest.TestCase):
|
||||
- def tesIterator(self):
|
||||
+
|
||||
+ def testIterator(self):
|
||||
edit = QTextEdit()
|
||||
cursor = edit.textCursor()
|
||||
fmt = QTextCharFormat()
|
||||
diff --git a/sources/pyside2/tests/signals/bug_79.py b/sources/pyside2/tests/signals/bug_79.py
|
||||
index ca25fb3..b70c8c5 100644
|
||||
--- a/sources/pyside2/tests/signals/bug_79.py
|
||||
+++ b/sources/pyside2/tests/signals/bug_79.py
|
||||
@@ -60,6 +60,11 @@ class ConnectTest(unittest.TestCase):
|
||||
gc.collect()
|
||||
# if this is no debug build, then we check at least that
|
||||
# we do not crash any longer.
|
||||
+ for idx in range(200):
|
||||
+ # PYSIDE-2230: Warm-up is necessary before measuring, because
|
||||
+ # the code changes the constant parts after some time.
|
||||
+ o.selectionModel().destroyed.connect(self.callback)
|
||||
+ o.selectionModel().destroyed.disconnect(self.callback)
|
||||
if not skiptest:
|
||||
total = gettotalrefcount()
|
||||
for idx in range(1000):
|
||||
diff --git a/sources/shiboken2/libshiboken/pep384impl.cpp b/sources/shiboken2/libshiboken/pep384impl.cpp
|
||||
index d12dae3..fed2716 100644
|
||||
--- a/sources/shiboken2/libshiboken/pep384impl.cpp
|
||||
+++ b/sources/shiboken2/libshiboken/pep384impl.cpp
|
||||
@@ -810,6 +810,39 @@ init_PepRuntime()
|
||||
PepRuntime_38_flag = 1;
|
||||
}
|
||||
|
||||
+#ifdef Py_LIMITED_API
|
||||
+static PyObject *emulatePyType_GetDict(PyTypeObject *type)
|
||||
+{
|
||||
+ if (_PepRuntimeVersion() < 0x030C00 || type->tp_dict) {
|
||||
+ auto *res = type->tp_dict;
|
||||
+ Py_XINCREF(res);
|
||||
+ return res;
|
||||
+ }
|
||||
+ // PYSIDE-2230: Here we are really cheating. We don't know how to
|
||||
+ // access an internal dict, and so we simply pretend
|
||||
+ // it were an empty dict. This works great for our types.
|
||||
+ // This was an unexpectedly simple solution :D
|
||||
+ return PyDict_New();
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+// PyType_GetDict: replacement for <static type>.tp_dict, which is
|
||||
+// zero for builtin types since 3.12.
|
||||
+PyObject *PepType_GetDict(PyTypeObject *type)
|
||||
+{
|
||||
+#if !defined(Py_LIMITED_API)
|
||||
+# if PY_VERSION_HEX >= 0x030C0000
|
||||
+ return PyType_GetDict(type);
|
||||
+# else
|
||||
+ // pre 3.12 fallback code, mimicking the addref-behavior.
|
||||
+ Py_XINCREF(type->tp_dict);
|
||||
+ return type->tp_dict;
|
||||
+# endif
|
||||
+#else
|
||||
+ return emulatePyType_GetDict(type);
|
||||
+#endif // Py_LIMITED_API
|
||||
+}
|
||||
+
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Module Initialization
|
||||
diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h
|
||||
index a870d6b..440784e 100644
|
||||
--- a/sources/shiboken2/libshiboken/pep384impl.h
|
||||
+++ b/sources/shiboken2/libshiboken/pep384impl.h
|
||||
@@ -567,6 +567,14 @@ extern LIBSHIBOKEN_API PyObject *PepMapping_Items(PyObject *o);
|
||||
|
||||
extern LIBSHIBOKEN_API int PepRuntime_38_flag;
|
||||
|
||||
+/*****************************************************************************
|
||||
+ *
|
||||
+ * Runtime support for Python 3.12 incompatibility
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+LIBSHIBOKEN_API PyObject *PepType_GetDict(PyTypeObject *type);
|
||||
+
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Module Initialization
|
||||
diff --git a/sources/shiboken2/libshiboken/signature/signature.cpp b/sources/shiboken2/libshiboken/signature/signature.cpp
|
||||
index 191af3d..f817e47 100644
|
||||
--- a/sources/shiboken2/libshiboken/signature/signature.cpp
|
||||
+++ b/sources/shiboken2/libshiboken/signature/signature.cpp
|
||||
@@ -482,7 +482,7 @@ static PyObject *adjustFuncName(const char *func_name)
|
||||
|
||||
// Find the feature flags
|
||||
auto type = reinterpret_cast<PyTypeObject *>(obtype.object());
|
||||
- auto dict = type->tp_dict;
|
||||
+ AutoDecRef dict(PepType_GetDict(type));
|
||||
int id = SbkObjectType_GetReserved(type);
|
||||
id = id < 0 ? 0 : id; // if undefined, set to zero
|
||||
auto lower = id & 0x01;
|
||||
diff --git a/sources/shiboken2/libshiboken/signature/signature_helper.cpp b/sources/shiboken2/libshiboken/signature/signature_helper.cpp
|
||||
index 0246ec6..05eaa14 100644
|
||||
--- a/sources/shiboken2/libshiboken/signature/signature_helper.cpp
|
||||
+++ b/sources/shiboken2/libshiboken/signature/signature_helper.cpp
|
||||
@@ -105,7 +105,8 @@ int add_more_getsets(PyTypeObject *type, PyGetSetDef *gsp, PyObject **doc_descr)
|
||||
*/
|
||||
assert(PyType_Check(type));
|
||||
PyType_Ready(type);
|
||||
- PyObject *dict = type->tp_dict;
|
||||
+ AutoDecRef tpDict(PepType_GetDict(type));
|
||||
+ auto *dict = tpDict.object();
|
||||
for (; gsp->name != nullptr; gsp++) {
|
||||
PyObject *have_descr = PyDict_GetItemString(dict, gsp->name);
|
||||
if (have_descr != nullptr) {
|
||||
@@ -346,7 +347,8 @@ static int _build_func_to_type(PyObject *obtype)
|
||||
* We also check for hidden methods, see below.
|
||||
*/
|
||||
auto *type = reinterpret_cast<PyTypeObject *>(obtype);
|
||||
- PyObject *dict = type->tp_dict;
|
||||
+ AutoDecRef tpDict(PepType_GetDict(type));
|
||||
+ auto *dict = tpDict.object();
|
||||
PyMethodDef *meth = type->tp_methods;
|
||||
|
||||
if (meth == nullptr)
|
||||
diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
|
||||
index 47ab89a..3e1266c 100644
|
||||
--- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
|
||||
+++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
|
||||
@@ -113,6 +113,12 @@ def seterror_argument(args, func_name, info):
|
||||
msg = "{func_name}(): {info}".format(**locals())
|
||||
err = AttributeError
|
||||
return err, msg
|
||||
+ if isinstance(info, Exception):
|
||||
+ # PYSIDE-2230: Python 3.12 seems to always do normalization.
|
||||
+ err = type(info)
|
||||
+ info = info.args[0]
|
||||
+ msg = f"{func_name}(): {info}"
|
||||
+ return err, msg
|
||||
if info and type(info) is dict:
|
||||
keyword = tuple(info)[0]
|
||||
msg = "{func_name}(): unsupported keyword '{keyword}'".format(**locals())
|
||||
diff --git a/sources/shiboken2/tests/samplebinding/enum_test.py b/sources/shiboken2/tests/samplebinding/enum_test.py
|
||||
index 0beb720..f2606a4 100644
|
||||
--- a/sources/shiboken2/tests/samplebinding/enum_test.py
|
||||
+++ b/sources/shiboken2/tests/samplebinding/enum_test.py
|
||||
@@ -95,7 +95,7 @@ class EnumTest(unittest.TestCase):
|
||||
|
||||
def testEnumConstructorWithTooManyParameters(self):
|
||||
'''Calling the constructor of non-extensible enum with the wrong number of parameters.'''
|
||||
- self.assertRaises(TypeError, SampleNamespace.InValue, 13, 14)
|
||||
+ self.assertRaises((TypeError, ValueError), SampleNamespace.InValue, 13, 14)
|
||||
|
||||
def testEnumConstructorWithNonNumberParameter(self):
|
||||
'''Calling the constructor of non-extensible enum with a string.'''
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
python,
|
||||
pythonAtLeast,
|
||||
fetchurl,
|
||||
lib,
|
||||
stdenv,
|
||||
@@ -11,18 +12,51 @@
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pyside2";
|
||||
version = "5.15.11";
|
||||
version = "5.15.14";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/pyside-setup-opensource-src-${version}.tar.xz";
|
||||
sha256 = "sha256-2lZ807eFTSegtK/j6J3osvmLem1XOTvlbx/BP3cPryk=";
|
||||
hash = "sha256-MmURlPamt7zkLwTmixQBrSCH5HiaTI8/uGSehhicY3I=";
|
||||
};
|
||||
|
||||
patches = [ ./dont_ignore_optional_modules.patch ];
|
||||
patches = [
|
||||
./nix_compile_cflags.patch
|
||||
./Final-details-to-enable-3.12-wheel-compatibility.patch
|
||||
./Python-3.12-Fix-the-structure-of-class-property.patch
|
||||
./Support-running-PySide-on-Python-3.12.patch
|
||||
./shiboken2-clang-Fix-and-simplify-resolveType-helper.patch
|
||||
./shiboken2-clang-Fix-build-with-clang-16.patch
|
||||
./shiboken2-clang-Fix-clashes-between-type-name-and-enumera.patch
|
||||
./shiboken2-clang-Record-scope-resolution-of-arguments-func.patch
|
||||
./shiboken2-clang-Remove-typedef-expansion.patch
|
||||
./shiboken2-clang-Suppress-class-scope-look-up-for-paramete.patch
|
||||
./shiboken2-clang-Write-scope-resolution-for-all-parameters.patch
|
||||
./dont_ignore_optional_modules.patch
|
||||
./Modify-sendCommand-signatures.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
cd sources/pyside2
|
||||
'';
|
||||
postPatch =
|
||||
(lib.optionalString (pythonAtLeast "3.12") ''
|
||||
substituteInPlace \
|
||||
ez_setup.py \
|
||||
build_scripts/main.py \
|
||||
build_scripts/options.py \
|
||||
build_scripts/utils.py \
|
||||
build_scripts/wheel_override.py \
|
||||
build_scripts/wheel_utils.py \
|
||||
sources/pyside2/CMakeLists.txt \
|
||||
--replace-fail "from distutils" "import setuptools; from distutils"
|
||||
substituteInPlace \
|
||||
build_scripts/config.py \
|
||||
build_scripts/main.py \
|
||||
build_scripts/options.py \
|
||||
build_scripts/setup_runner.py \
|
||||
build_scripts/utils.py \
|
||||
--replace-fail "import distutils" "import setuptools; import distutils"
|
||||
'')
|
||||
+ ''
|
||||
cd sources/pyside2
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_TESTS=OFF"
|
||||
@@ -36,6 +70,7 @@ stdenv.mkDerivation rec {
|
||||
ninja
|
||||
qt5.qmake
|
||||
python
|
||||
python.pkgs.setuptools
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
diff --git a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
|
||||
index add278a..2626eb6 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
|
||||
@@ -349,11 +349,15 @@ QByteArrayList emulatedCompilerOptions()
|
||||
|
||||
// Append the c++ include paths since Clang is unable to find
|
||||
// <type_traits> etc (g++ 11.3).
|
||||
- const HeaderPaths gppPaths = gppInternalIncludePaths(compilerFromCMake(QStringLiteral("g++")));
|
||||
+ const HeaderPaths gppPaths = gppInternalIncludePaths(QStringLiteral("g++"));
|
||||
for (const HeaderPath &h : gppPaths) {
|
||||
- if (h.path.contains("c++")
|
||||
- || h.path.contains("sysroot")) { // centOS
|
||||
+ // PySide2 requires that Qt headers are not -isystem
|
||||
+ // https://bugreports.qt.io/browse/PYSIDE-787
|
||||
+ if (!h.path.contains("-qt")) {
|
||||
+ // add using -isystem
|
||||
headerPaths.append(h);
|
||||
+ } else {
|
||||
+ headerPaths.append({h.path, HeaderType::Standard});
|
||||
}
|
||||
}
|
||||
#else
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
||||
Date: Tue, 25 Apr 2023 10:00:39 +0200
|
||||
Subject: shiboken2/clang: Fix and simplify resolveType() helper
|
||||
|
||||
The function had a bug which only manifested with clang 16:
|
||||
"type" should have been assigned the type of the cursor
|
||||
obtained from clang_getTypeDeclaration(). With this, the complicated
|
||||
lookup code in getBaseClass() can be removed.
|
||||
|
||||
Task-number: PYSIDE-2288
|
||||
Pick-to: 6.5
|
||||
Change-Id: I861e30451b3f4af2ec0c2e4ffa4179a429854533
|
||||
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
||||
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
||||
---
|
||||
.../ApiExtractor/clangparser/clangbuilder.cpp | 39 ++++++++++------------
|
||||
1 file changed, 18 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
index e8e5bcf..1b4c81c 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
@@ -627,6 +627,9 @@ long clang_EnumDecl_isScoped4(BaseVisitor *bv, const CXCursor &cursor)
|
||||
#endif // CLANG_NO_ENUMDECL_ISSCOPED
|
||||
|
||||
// Resolve declaration and type of a base class
|
||||
+// Note: TypeAliasTemplateDecl ("using QVector<T>=QList<T>") is automatically
|
||||
+// resolved by clang_getTypeDeclaration(), but it stops at
|
||||
+// TypeAliasDecl / TypedefDecl.
|
||||
|
||||
struct TypeDeclaration
|
||||
{
|
||||
@@ -634,19 +637,23 @@ struct TypeDeclaration
|
||||
CXCursor declaration;
|
||||
};
|
||||
|
||||
+static inline bool isTypeAliasDecl(const CXCursor &cursor)
|
||||
+{
|
||||
+ const auto kind = clang_getCursorKind(cursor);
|
||||
+ return kind == CXCursor_TypeAliasDecl || kind == CXCursor_TypedefDecl;
|
||||
+}
|
||||
+
|
||||
static TypeDeclaration resolveBaseSpecifier(const CXCursor &cursor)
|
||||
{
|
||||
Q_ASSERT(clang_getCursorKind(cursor) == CXCursor_CXXBaseSpecifier);
|
||||
CXType inheritedType = clang_getCursorType(cursor);
|
||||
CXCursor decl = clang_getTypeDeclaration(inheritedType);
|
||||
- if (inheritedType.kind != CXType_Unexposed) {
|
||||
- while (true) {
|
||||
- auto kind = clang_getCursorKind(decl);
|
||||
- if (kind != CXCursor_TypeAliasDecl && kind != CXCursor_TypedefDecl)
|
||||
- break;
|
||||
- inheritedType = clang_getTypedefDeclUnderlyingType(decl);
|
||||
- decl = clang_getTypeDeclaration(inheritedType);
|
||||
- }
|
||||
+ auto resolvedType = clang_getCursorType(decl);
|
||||
+ if (resolvedType.kind != CXType_Invalid && resolvedType.kind != inheritedType.kind)
|
||||
+ inheritedType = resolvedType;
|
||||
+ while (isTypeAliasDecl(decl)) {
|
||||
+ inheritedType = clang_getTypedefDeclUnderlyingType(decl);
|
||||
+ decl = clang_getTypeDeclaration(inheritedType);
|
||||
}
|
||||
return {inheritedType, decl};
|
||||
}
|
||||
@@ -656,20 +663,10 @@ void BuilderPrivate::addBaseClass(const CXCursor &cursor)
|
||||
{
|
||||
Q_ASSERT(clang_getCursorKind(cursor) == CXCursor_CXXBaseSpecifier);
|
||||
// Note: spelling has "struct baseClass", use type
|
||||
- QString baseClassName;
|
||||
const auto decl = resolveBaseSpecifier(cursor);
|
||||
- if (decl.type.kind == CXType_Unexposed) {
|
||||
- // The type is unexposed when the base class is a template type alias:
|
||||
- // "class QItemSelection : public QList<X>" where QList is aliased to QVector.
|
||||
- // Try to resolve via code model.
|
||||
- TypeInfo info = createTypeInfo(decl.type);
|
||||
- auto parentScope = m_scopeStack.at(m_scopeStack.size() - 2); // Current is class.
|
||||
- auto resolved = TypeInfo::resolveType(info, parentScope);
|
||||
- if (resolved != info)
|
||||
- baseClassName = resolved.toString();
|
||||
- }
|
||||
- if (baseClassName.isEmpty())
|
||||
- baseClassName = getTypeName(decl.type);
|
||||
+ QString baseClassName = getTypeName(decl.type);
|
||||
+ if (baseClassName.startsWith(u"std::")) // Simplify "std::" types
|
||||
+ baseClassName = createTypeInfo(decl.type).toString();
|
||||
|
||||
auto it = m_cursorClassHash.constFind(decl.declaration);
|
||||
const CodeModel::AccessPolicy access = accessPolicy(clang_getCXXAccessSpecifier(cursor));
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
||||
Date: Tue, 25 Apr 2023 14:01:45 +0200
|
||||
Subject: shiboken2/clang: Fix build with clang 16
|
||||
|
||||
clang 16 returns more elaborated types instead of fully qualified type
|
||||
names. Qualify elaborated types when retrieving the type name.
|
||||
|
||||
[ChangeLog][shiboken6] Support for libclang version 16 has been added.
|
||||
|
||||
Task-number: PYSIDE-2288
|
||||
Pick-to: 6.5 5.15
|
||||
Change-Id: Ibd428280180967f11d82a72159e744c016afc927
|
||||
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
||||
(cherry picked from commit 44ef1859214c66861a251d4a0faf5c38dc050850)
|
||||
---
|
||||
.../ApiExtractor/clangparser/clangbuilder.cpp | 2 +-
|
||||
.../ApiExtractor/clangparser/clangutils.cpp | 23 ++++++++++++++++++++++
|
||||
.../ApiExtractor/clangparser/clangutils.h | 1 +
|
||||
.../shiboken2/ApiExtractor/tests/testtemplates.cpp | 3 +--
|
||||
4 files changed, 26 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
index 332f1da..ed1e15d 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
@@ -524,7 +524,7 @@ TypeInfo BuilderPrivate::createTypeInfoHelper(const CXType &type) const
|
||||
typeInfo.setConstant(clang_isConstQualifiedType(nestedType) != 0);
|
||||
typeInfo.setVolatile(clang_isVolatileQualifiedType(nestedType) != 0);
|
||||
|
||||
- QString typeName = getTypeName(nestedType);
|
||||
+ QString typeName = getResolvedTypeName(nestedType);
|
||||
while (TypeInfo::stripLeadingConst(&typeName)
|
||||
|| TypeInfo::stripLeadingVolatile(&typeName)) {
|
||||
}
|
||||
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp
|
||||
index 57271ef..295ede3 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp
|
||||
@@ -130,6 +130,23 @@ QString getCursorDisplayName(const CXCursor &cursor)
|
||||
return result;
|
||||
}
|
||||
|
||||
+static inline bool isBuiltinType(CXTypeKind kind)
|
||||
+{
|
||||
+ return kind >= CXType_FirstBuiltin && kind <= CXType_LastBuiltin;
|
||||
+}
|
||||
+
|
||||
+// Resolve elaborated types occurring with clang 16
|
||||
+static CXType resolveType(const CXType &type)
|
||||
+{
|
||||
+ if (!isBuiltinType(type.kind)) {
|
||||
+ CXCursor decl = clang_getTypeDeclaration(type);
|
||||
+ auto resolvedType = clang_getCursorType(decl);
|
||||
+ if (resolvedType.kind != CXType_Invalid && resolvedType.kind != type.kind)
|
||||
+ return resolvedType;
|
||||
+ }
|
||||
+ return type;
|
||||
+}
|
||||
+
|
||||
QString getTypeName(const CXType &type)
|
||||
{
|
||||
CXString typeSpelling = clang_getTypeSpelling(type);
|
||||
@@ -138,6 +155,12 @@ QString getTypeName(const CXType &type)
|
||||
return result;
|
||||
}
|
||||
|
||||
+// Resolve elaborated types occurring with clang 16
|
||||
+QString getResolvedTypeName(const CXType &type)
|
||||
+{
|
||||
+ return getTypeName(resolveType(type));
|
||||
+}
|
||||
+
|
||||
Diagnostic::Diagnostic(const QString &m, const CXCursor &c, CXDiagnosticSeverity s)
|
||||
: message(m), source(Other), severity(s)
|
||||
{
|
||||
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h
|
||||
index f7c230a..aacaf63 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h
|
||||
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h
|
||||
@@ -52,6 +52,7 @@ QString getCursorKindName(CXCursorKind cursorKind);
|
||||
QString getCursorSpelling(const CXCursor &cursor);
|
||||
QString getCursorDisplayName(const CXCursor &cursor);
|
||||
QString getTypeName(const CXType &type);
|
||||
+QString getResolvedTypeName(const CXType &type);
|
||||
inline QString getCursorTypeName(const CXCursor &cursor)
|
||||
{ return getTypeName(clang_getCursorType(cursor)); }
|
||||
inline QString getCursorResultTypeName(const CXCursor &cursor)
|
||||
diff --git a/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp b/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp
|
||||
index 9f929c4..fbc5c4c 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp
|
||||
@@ -236,7 +236,6 @@ struct List {
|
||||
const AbstractMetaFunction *erase = list->findFunction(QStringLiteral("erase"));
|
||||
QVERIFY(erase);
|
||||
QCOMPARE(erase->arguments().size(), 1);
|
||||
- QEXPECT_FAIL("", "Clang: Some other code changes the parameter type", Abort);
|
||||
QCOMPARE(erase->arguments().at(0)->type()->cppSignature(), QLatin1String("List::Iterator"));
|
||||
}
|
||||
|
||||
@@ -389,7 +388,7 @@ typedef BaseTemplateClass<TypeOne> TypeOneClass;
|
||||
const ComplexTypeEntry* oneType = one->typeEntry();
|
||||
const ComplexTypeEntry* baseType = base->typeEntry();
|
||||
QCOMPARE(oneType->baseContainerType(), baseType);
|
||||
- QCOMPARE(one->baseClassNames(), QStringList(QLatin1String("BaseTemplateClass<TypeOne>")));
|
||||
+ QCOMPARE(one->baseClassNames(), QStringList(QLatin1String("NSpace::BaseTemplateClass<NSpace::TypeOne>")));
|
||||
|
||||
QVERIFY(one->hasTemplateBaseClassInstantiations());
|
||||
AbstractMetaTypeList instantiations = one->templateBaseClassInstantiations();
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
||||
Date: Tue, 25 Apr 2023 15:30:30 +0200
|
||||
Subject: shiboken2/clang: Fix clashes between type name and enumeration
|
||||
values
|
||||
|
||||
Remove all constant and enum value type entries found in the type lookup
|
||||
unless it is looking for template arguments; where it may be a
|
||||
non-type template argument.
|
||||
|
||||
Task-number: PYSIDE-2288
|
||||
Pick-to: 6.5 5.15
|
||||
Change-Id: If0609ce0d0223f551ed6dee1d1e0ea3ef49d6917
|
||||
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
||||
(cherry picked from commit e22f717153a5e9855531f45c0bf82ff2461a3f7e)
|
||||
---
|
||||
.../shiboken2/ApiExtractor/abstractmetabuilder.cpp | 21 +++++++++++++++++++--
|
||||
.../shiboken2/ApiExtractor/abstractmetabuilder.h | 3 ++-
|
||||
.../shiboken2/ApiExtractor/typesystem_typedefs.h | 1 +
|
||||
3 files changed, 22 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
|
||||
index 5a413ec..2f34e16 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
|
||||
@@ -2144,6 +2144,13 @@ static bool isNumber(const QString &s)
|
||||
[](QChar c) { return c.isDigit(); });
|
||||
}
|
||||
|
||||
+// A type entry relevant only for non type template "X<5>"
|
||||
+static bool isNonTypeTemplateArgument(const TypeEntryCPtr &te)
|
||||
+{
|
||||
+ const auto type = te->type();
|
||||
+ return type == TypeEntry::EnumValue || type == TypeEntry::ConstantValueType;
|
||||
+}
|
||||
+
|
||||
AbstractMetaType *AbstractMetaBuilderPrivate::translateTypeStatic(const TypeInfo &_typei,
|
||||
AbstractMetaClass *currentClass,
|
||||
AbstractMetaBuilderPrivate *d,
|
||||
@@ -2271,7 +2278,15 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateTypeStatic(const TypeInfo
|
||||
typeInfo.clearInstantiations();
|
||||
}
|
||||
|
||||
- const TypeEntries types = findTypeEntries(qualifiedName, name, currentClass, d);
|
||||
+ TypeEntries types = findTypeEntries(qualifiedName, name, currentClass, d);
|
||||
+ if (!flags.testFlag(AbstractMetaBuilder::TemplateArgument)) {
|
||||
+ // Avoid clashes between QByteArray and enum value QMetaType::QByteArray
|
||||
+ // unless we are looking for template arguments.
|
||||
+ auto end = std::remove_if(types.begin(), types.end(),
|
||||
+ isNonTypeTemplateArgument);
|
||||
+ types.erase(end, types.end());
|
||||
+ }
|
||||
+
|
||||
if (types.isEmpty()) {
|
||||
if (errorMessageIn) {
|
||||
*errorMessageIn =
|
||||
@@ -2293,7 +2308,9 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateTypeStatic(const TypeInfo
|
||||
const auto &templateArguments = typeInfo.instantiations();
|
||||
for (int t = 0, size = templateArguments.size(); t < size; ++t) {
|
||||
const TypeInfo &ti = templateArguments.at(t);
|
||||
- AbstractMetaType *targType = translateTypeStatic(ti, currentClass, d, flags, &errorMessage);
|
||||
+ AbstractMetaType *targType = translateTypeStatic(ti, currentClass, d,
|
||||
+ flags | AbstractMetaBuilder::TemplateArgument,
|
||||
+ &errorMessage);
|
||||
// For non-type template parameters, create a dummy type entry on the fly
|
||||
// as is done for classes.
|
||||
if (!targType) {
|
||||
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.h b/sources/shiboken2/ApiExtractor/abstractmetabuilder.h
|
||||
index d2dc080..8916eaf 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.h
|
||||
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.h
|
||||
@@ -93,7 +93,8 @@ public:
|
||||
void setSkipDeprecated(bool value);
|
||||
|
||||
enum TranslateTypeFlag {
|
||||
- DontResolveType = 0x1
|
||||
+ DontResolveType = 0x1,
|
||||
+ TemplateArgument = 0x2
|
||||
};
|
||||
Q_DECLARE_FLAGS(TranslateTypeFlags, TranslateTypeFlag);
|
||||
|
||||
diff --git a/sources/shiboken2/ApiExtractor/typesystem_typedefs.h b/sources/shiboken2/ApiExtractor/typesystem_typedefs.h
|
||||
index 73f92b2..5dcc65c 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/typesystem_typedefs.h
|
||||
+++ b/sources/shiboken2/ApiExtractor/typesystem_typedefs.h
|
||||
@@ -48,6 +48,7 @@ using CodeSnipList = QVector<CodeSnip>;
|
||||
using DocModificationList = QVector<DocModification>;
|
||||
using FieldModificationList = QVector<FieldModification>;
|
||||
using FunctionModificationList = QVector<FunctionModification>;
|
||||
+using TypeEntryCPtr = const TypeEntry *;
|
||||
using TypeEntries = QVector<const TypeEntry *>;
|
||||
|
||||
#endif // TYPESYSTEM_TYPEDEFS_H
|
||||
+178
@@ -0,0 +1,178 @@
|
||||
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
||||
Date: Thu, 27 Apr 2023 12:44:10 +0200
|
||||
Subject: shiboken2/clang: Record scope resolution of arguments/function
|
||||
return
|
||||
|
||||
Add a flag indicating whether a type was specified with a leading "::"
|
||||
(scope resolution). Such parameters previously caused the function to
|
||||
rejected due to the "::TypeName" not being found. The type resolution
|
||||
added for clang 16 strips these qualifiers though, so, the information
|
||||
needs to be stored.
|
||||
|
||||
Task-number: PYSIDE-2288
|
||||
Pick-to: 6.5 5.15
|
||||
Change-Id: I27d27c94ec43bcc4cb3b79e6e9ce6706c749a1e9
|
||||
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
||||
(cherry picked from commit 075d8ad4660f05e6d2583ff1c05e9987ad624bfe)
|
||||
---
|
||||
.../ApiExtractor/clangparser/clangbuilder.cpp | 8 ++++++--
|
||||
.../ApiExtractor/clangparser/clangutils.cpp | 11 ++++++++++
|
||||
.../ApiExtractor/clangparser/clangutils.h | 1 +
|
||||
.../shiboken2/ApiExtractor/parser/codemodel.cpp | 24 ++++++++++++++++++++++
|
||||
sources/shiboken2/ApiExtractor/parser/codemodel.h | 8 ++++++++
|
||||
5 files changed, 50 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
index ed1e15d..1b5cc5c 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
@@ -294,7 +294,9 @@ FunctionModelItem BuilderPrivate::createFunction(const CXCursor &cursor,
|
||||
name = fixTypeName(name);
|
||||
FunctionModelItem result(new _FunctionModelItem(m_model, name));
|
||||
setFileName(cursor, result.data());
|
||||
- result->setType(createTypeInfoHelper(clang_getCursorResultType(cursor)));
|
||||
+ const auto type = clang_getCursorResultType(cursor);
|
||||
+ result->setType(createTypeInfoHelper(type));
|
||||
+ result->setScopeResolution(hasScopeResolution(type));
|
||||
result->setFunctionType(t);
|
||||
result->setScope(m_scope);
|
||||
result->setStatic(clang_Cursor_getStorageClass(cursor) == CX_SC_Static);
|
||||
@@ -1031,7 +1033,9 @@ BaseVisitor::StartTokenResult Builder::startToken(const CXCursor &cursor)
|
||||
if (d->m_currentArgument.isNull() && !d->m_currentFunction.isNull()) {
|
||||
const QString name = getCursorSpelling(cursor);
|
||||
d->m_currentArgument.reset(new _ArgumentModelItem(d->m_model, name));
|
||||
- d->m_currentArgument->setType(d->createTypeInfo(cursor));
|
||||
+ const auto type = clang_getCursorType(cursor);
|
||||
+ d->m_currentArgument->setScopeResolution(hasScopeResolution(type));
|
||||
+ d->m_currentArgument->setType(d->createTypeInfo(type));
|
||||
d->m_currentFunction->addArgument(d->m_currentArgument);
|
||||
QString defaultValueExpression = d->cursorValueExpression(this, cursor);
|
||||
if (!defaultValueExpression.isEmpty()) {
|
||||
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp
|
||||
index 295ede3..ec6d228 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp
|
||||
@@ -155,6 +155,17 @@ QString getTypeName(const CXType &type)
|
||||
return result;
|
||||
}
|
||||
|
||||
+// Quick check for "::Type"
|
||||
+bool hasScopeResolution(const CXType &type)
|
||||
+{
|
||||
+ CXString typeSpelling = clang_getTypeSpelling(type);
|
||||
+ const QString spelling = QString::fromUtf8(clang_getCString(typeSpelling));
|
||||
+ const bool result = spelling.startsWith(QLatin1String("::"))
|
||||
+ || spelling.contains(QLatin1String(" ::"));
|
||||
+ clang_disposeString(typeSpelling);
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
// Resolve elaborated types occurring with clang 16
|
||||
QString getResolvedTypeName(const CXType &type)
|
||||
{
|
||||
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h
|
||||
index aacaf63..33f362c 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h
|
||||
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h
|
||||
@@ -52,6 +52,7 @@ QString getCursorKindName(CXCursorKind cursorKind);
|
||||
QString getCursorSpelling(const CXCursor &cursor);
|
||||
QString getCursorDisplayName(const CXCursor &cursor);
|
||||
QString getTypeName(const CXType &type);
|
||||
+bool hasScopeResolution(const CXType &type);
|
||||
QString getResolvedTypeName(const CXType &type);
|
||||
inline QString getCursorTypeName(const CXCursor &cursor)
|
||||
{ return getTypeName(clang_getCursorType(cursor)); }
|
||||
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
|
||||
index dea0812..ba07a01 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
|
||||
@@ -1121,11 +1121,23 @@ void _ArgumentModelItem::setDefaultValue(bool defaultValue)
|
||||
m_defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
+bool _ArgumentModelItem::scopeResolution() const
|
||||
+{
|
||||
+ return m_scopeResolution;
|
||||
+}
|
||||
+
|
||||
+void _ArgumentModelItem::setScopeResolution(bool v)
|
||||
+{
|
||||
+ m_scopeResolution = v;
|
||||
+}
|
||||
+
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
void _ArgumentModelItem::formatDebug(QDebug &d) const
|
||||
{
|
||||
_CodeModelItem::formatDebug(d);
|
||||
d << ", type=" << m_type;
|
||||
+ if (m_scopeResolution)
|
||||
+ d << ", [m_scope resolution]";
|
||||
if (m_defaultValue)
|
||||
d << ", defaultValue=\"" << m_defaultValueExpression << '"';
|
||||
}
|
||||
@@ -1200,6 +1212,16 @@ void _FunctionModelItem::setVariadics(bool isVariadics)
|
||||
m_isVariadics = isVariadics;
|
||||
}
|
||||
|
||||
+bool _FunctionModelItem::scopeResolution() const
|
||||
+{
|
||||
+ return m_scopeResolution;
|
||||
+}
|
||||
+
|
||||
+void _FunctionModelItem::setScopeResolution(bool v)
|
||||
+{
|
||||
+ m_scopeResolution = v;
|
||||
+}
|
||||
+
|
||||
bool _FunctionModelItem::isNoExcept() const
|
||||
{
|
||||
return m_exceptionSpecification == ExceptionSpecification::NoExcept;
|
||||
@@ -1343,6 +1365,8 @@ void _FunctionModelItem::formatDebug(QDebug &d) const
|
||||
d << " [explicit]";
|
||||
if (m_isInvokable)
|
||||
d << " [invokable]";
|
||||
+ if (m_scopeResolution)
|
||||
+ d << " [scope resolution]";
|
||||
formatModelItemList(d, ", arguments=", m_arguments);
|
||||
if (m_isVariadics)
|
||||
d << ",...";
|
||||
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.h b/sources/shiboken2/ApiExtractor/parser/codemodel.h
|
||||
index b990ad9..85f298c 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/parser/codemodel.h
|
||||
+++ b/sources/shiboken2/ApiExtractor/parser/codemodel.h
|
||||
@@ -499,6 +499,10 @@ public:
|
||||
QString defaultValueExpression() const { return m_defaultValueExpression; }
|
||||
void setDefaultValueExpression(const QString &expr) { m_defaultValueExpression = expr; }
|
||||
|
||||
+ // Argument type has scope resolution "::ArgumentType"
|
||||
+ bool scopeResolution() const;
|
||||
+ void setScopeResolution(bool v);
|
||||
+
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
void formatDebug(QDebug &d) const override;
|
||||
#endif
|
||||
@@ -507,6 +511,7 @@ private:
|
||||
TypeInfo m_type;
|
||||
QString m_defaultValueExpression;
|
||||
bool m_defaultValue = false;
|
||||
+ bool m_scopeResolution = false;
|
||||
};
|
||||
|
||||
class _MemberModelItem: public _CodeModelItem
|
||||
@@ -623,6 +628,8 @@ public:
|
||||
bool isVariadics() const;
|
||||
void setVariadics(bool isVariadics);
|
||||
|
||||
+ bool scopeResolution() const; // Return type has scope resolution "::ReturnType"
|
||||
+ void setScopeResolution(bool v);
|
||||
|
||||
bool isSimilar(const FunctionModelItem &other) const;
|
||||
|
||||
@@ -652,6 +659,7 @@ private:
|
||||
uint m_isExplicit: 1;
|
||||
uint m_isVariadics: 1;
|
||||
uint m_isInvokable : 1; // Qt
|
||||
+ uint m_scopeResolution: 1;
|
||||
};
|
||||
uint m_flags;
|
||||
};
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
||||
Date: Thu, 20 Apr 2023 11:16:15 +0200
|
||||
Subject: shiboken2/clang: Remove typedef expansion
|
||||
|
||||
The functionality will be re-added by a subsequent change
|
||||
expanding elaborated types.
|
||||
|
||||
Task-number: PYSIDE-2288
|
||||
Pick-to: 6.5 5.15
|
||||
Change-Id: I3245c6dccba7de0ed1ce0e7820e1edb4567ca3c2
|
||||
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
||||
(cherry picked from commit 24742dca014109bd3c2a9775fc15ca306ab22c9c)
|
||||
---
|
||||
.../ApiExtractor/clangparser/clangbuilder.cpp | 39 ----------------------
|
||||
1 file changed, 39 deletions(-)
|
||||
|
||||
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
index 1b4c81c..332f1da 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
|
||||
@@ -140,7 +140,6 @@ static bool isSigned(CXTypeKind kind)
|
||||
class BuilderPrivate {
|
||||
public:
|
||||
using CursorClassHash = QHash<CXCursor, ClassModelItem>;
|
||||
- using CursorTypedefHash = QHash<CXCursor, TypeDefModelItem>;
|
||||
using TypeInfoHash = QHash<CXType, TypeInfo>;
|
||||
|
||||
explicit BuilderPrivate(BaseVisitor *bv) : m_baseVisitor(bv), m_model(new CodeModel)
|
||||
@@ -197,9 +196,6 @@ public:
|
||||
QString cursorValueExpression(BaseVisitor *bv, const CXCursor &cursor) const;
|
||||
void addBaseClass(const CXCursor &cursor);
|
||||
|
||||
- template <class Item>
|
||||
- void qualifyTypeDef(const CXCursor &typeRefCursor, const QSharedPointer<Item> &item) const;
|
||||
-
|
||||
bool visitHeader(const char *cFileName) const;
|
||||
|
||||
void setFileName(const CXCursor &cursor, _CodeModelItem *item);
|
||||
@@ -213,7 +209,6 @@ public:
|
||||
// classes can be correctly parented in case of forward-declared inner classes
|
||||
// (QMetaObject::Connection)
|
||||
CursorClassHash m_cursorClassHash;
|
||||
- CursorTypedefHash m_cursorTypedefHash;
|
||||
|
||||
mutable TypeInfoHash m_typeInfoHash; // Cache type information
|
||||
mutable QHash<QString, TemplateTypeAliasModelItem> m_templateTypeAliases;
|
||||
@@ -561,7 +556,6 @@ void BuilderPrivate::addTypeDef(const CXCursor &cursor, const CXType &cxType)
|
||||
item->setType(createTypeInfo(cxType));
|
||||
item->setScope(m_scope);
|
||||
m_scopeStack.back()->addTypeDef(item);
|
||||
- m_cursorTypedefHash.insert(cursor, item);
|
||||
}
|
||||
|
||||
void BuilderPrivate::startTemplateTypeAlias(const CXCursor &cursor)
|
||||
@@ -703,31 +697,6 @@ static inline CXCursor definitionFromTypeRef(const CXCursor &typeRefCursor)
|
||||
return clang_getTypeDeclaration(clang_getCursorType(typeRefCursor));
|
||||
}
|
||||
|
||||
-// Qualify function arguments or fields that are typedef'ed from another scope:
|
||||
-// enum ConversionFlag {};
|
||||
-// typedef QFlags<ConversionFlag> ConversionFlags;
|
||||
-// class QTextCodec {
|
||||
-// enum ConversionFlag {};
|
||||
-// typedef QFlags<ConversionFlag> ConversionFlags;
|
||||
-// struct ConverterState {
|
||||
-// explicit ConverterState(ConversionFlags);
|
||||
-// ^^ qualify to QTextCodec::ConversionFlags
|
||||
-// ConversionFlags m_flags;
|
||||
-// ^^ ditto
|
||||
-
|
||||
-template <class Item> // ArgumentModelItem, VariableModelItem
|
||||
-void BuilderPrivate::qualifyTypeDef(const CXCursor &typeRefCursor, const QSharedPointer<Item> &item) const
|
||||
-{
|
||||
- TypeInfo type = item->type();
|
||||
- if (type.qualifiedName().size() == 1) { // item's type is unqualified.
|
||||
- const auto it = m_cursorTypedefHash.constFind(definitionFromTypeRef(typeRefCursor));
|
||||
- if (it != m_cursorTypedefHash.constEnd() && !it.value()->scope().isEmpty()) {
|
||||
- type.setQualifiedName(it.value()->scope() + type.qualifiedName());
|
||||
- item->setType(type);
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-
|
||||
void BuilderPrivate::setFileName(const CXCursor &cursor, _CodeModelItem *item)
|
||||
{
|
||||
const SourceRange range = getCursorRange(cursor);
|
||||
@@ -1120,14 +1089,6 @@ BaseVisitor::StartTokenResult Builder::startToken(const CXCursor &cursor)
|
||||
}
|
||||
break;
|
||||
case CXCursor_TypeRef:
|
||||
- if (!d->m_currentFunction.isNull()) {
|
||||
- if (d->m_currentArgument.isNull())
|
||||
- d->qualifyTypeDef(cursor, d->m_currentFunction); // return type
|
||||
- else
|
||||
- d->qualifyTypeDef(cursor, d->m_currentArgument);
|
||||
- } else if (!d->m_currentField.isNull()) {
|
||||
- d->qualifyTypeDef(cursor, d->m_currentField);
|
||||
- }
|
||||
break;
|
||||
case CXCursor_CXXFinalAttr:
|
||||
if (!d->m_currentFunction.isNull())
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
||||
Date: Thu, 27 Apr 2023 13:00:37 +0200
|
||||
Subject: shiboken2/clang: Suppress class scope look up for parameters with
|
||||
scope resolution
|
||||
|
||||
Add a flag to AbstractMetaBuilderPrivate::findTypeEntriesHelper()
|
||||
to suppress the class scope look in case scope resolution.
|
||||
|
||||
Task-number: PYSIDE-2288
|
||||
Pick-to: 6.5 5.15
|
||||
Change-Id: I04a4810d03845fb48393c5efed3641220bd12d87
|
||||
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
||||
---
|
||||
sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 16 ++++++++++++----
|
||||
sources/shiboken2/ApiExtractor/abstractmetabuilder.h | 3 ++-
|
||||
sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h | 1 +
|
||||
3 files changed, 15 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
|
||||
index 2f34e16..4bf4ab4 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
|
||||
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
|
||||
@@ -1845,7 +1845,10 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
- AbstractMetaType *type = translateType(returnType, currentClass, {}, &errorMessage);
|
||||
+ TranslateTypeFlags flags;
|
||||
+ if (functionItem->scopeResolution())
|
||||
+ flags.setFlag(AbstractMetaBuilder::NoClassScopeLookup);
|
||||
+ AbstractMetaType *type = translateType(returnType, currentClass, flags, &errorMessage);
|
||||
if (!type) {
|
||||
const QString reason = msgUnmatchedReturnType(functionItem, errorMessage);
|
||||
qCWarning(lcShiboken, "%s",
|
||||
@@ -1880,7 +1883,10 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
- AbstractMetaType *metaType = translateType(arg->type(), currentClass, {}, &errorMessage);
|
||||
+ TranslateTypeFlags flags;
|
||||
+ if (arg->scopeResolution())
|
||||
+ flags.setFlag(AbstractMetaBuilder::NoClassScopeLookup);
|
||||
+ AbstractMetaType *metaType = translateType(arg->type(), currentClass, flags, &errorMessage);
|
||||
if (!metaType) {
|
||||
// If an invalid argument has a default value, simply remove it
|
||||
// unless the function is virtual (since the override in the
|
||||
@@ -2073,11 +2079,13 @@ static const TypeEntry* findTypeEntryUsingContext(const AbstractMetaClass* metaC
|
||||
// Helper for translateTypeStatic()
|
||||
TypeEntries AbstractMetaBuilderPrivate::findTypeEntries(const QString &qualifiedName,
|
||||
const QString &name,
|
||||
+ TranslateTypeFlags flags,
|
||||
AbstractMetaClass *currentClass,
|
||||
AbstractMetaBuilderPrivate *d)
|
||||
{
|
||||
// 5.1 - Try first using the current scope
|
||||
- if (currentClass) {
|
||||
+ if (currentClass != nullptr
|
||||
+ && !flags.testFlag(AbstractMetaBuilder::NoClassScopeLookup)) {
|
||||
if (auto type = findTypeEntryUsingContext(currentClass, qualifiedName))
|
||||
return {type};
|
||||
|
||||
@@ -2278,7 +2286,7 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateTypeStatic(const TypeInfo
|
||||
typeInfo.clearInstantiations();
|
||||
}
|
||||
|
||||
- TypeEntries types = findTypeEntries(qualifiedName, name, currentClass, d);
|
||||
+ TypeEntries types = findTypeEntries(qualifiedName, name, flags, currentClass, d);
|
||||
if (!flags.testFlag(AbstractMetaBuilder::TemplateArgument)) {
|
||||
// Avoid clashes between QByteArray and enum value QMetaType::QByteArray
|
||||
// unless we are looking for template arguments.
|
||||
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.h b/sources/shiboken2/ApiExtractor/abstractmetabuilder.h
|
||||
index 8916eaf..f333ad5 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.h
|
||||
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.h
|
||||
@@ -94,7 +94,8 @@ public:
|
||||
|
||||
enum TranslateTypeFlag {
|
||||
DontResolveType = 0x1,
|
||||
- TemplateArgument = 0x2
|
||||
+ TemplateArgument = 0x2,
|
||||
+ NoClassScopeLookup = 0x4
|
||||
};
|
||||
Q_DECLARE_FLAGS(TranslateTypeFlags, TranslateTypeFlag);
|
||||
|
||||
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h b/sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h
|
||||
index 8468950..8ddd369 100644
|
||||
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h
|
||||
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h
|
||||
@@ -154,6 +154,7 @@ public:
|
||||
TranslateTypeFlags flags = {},
|
||||
QString *errorMessageIn = nullptr);
|
||||
static TypeEntries findTypeEntries(const QString &qualifiedName, const QString &name,
|
||||
+ TranslateTypeFlags flags = {},
|
||||
AbstractMetaClass *currentClass = nullptr,
|
||||
AbstractMetaBuilderPrivate *d = nullptr);
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
||||
Date: Thu, 27 Apr 2023 12:18:39 +0200
|
||||
Subject: shiboken2/clang: Write scope resolution for all parameters of native
|
||||
wrappers
|
||||
|
||||
Make sure types are correct for cases like:
|
||||
|
||||
- QtDBusHelper::QDBusReply::QDBusReply(::QDBusReply<void>)
|
||||
- Qt3DInput*Event constructors taking the equivalent QtGui classes
|
||||
(Qt3DInput::QMouseEvent(::QMouseEvent *);
|
||||
|
||||
[ChangeLog][shiboken6] Support for parameters/function return
|
||||
types with scope resolution has been improved.
|
||||
|
||||
Fixes: PYSIDE-2288
|
||||
Pick-to: 6.5 5.15
|
||||
Change-Id: Id29758fceb88188f4cd834fbd5a7cc0ab511fb1a
|
||||
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
||||
(cherry picked from commit dd863857436bbeeba4c0a1077f5ad16653296277)
|
||||
---
|
||||
sources/shiboken2/generator/generator.cpp | 24 +++++++++++++-----------
|
||||
1 file changed, 13 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/sources/shiboken2/generator/generator.cpp b/sources/shiboken2/generator/generator.cpp
|
||||
index 6028282..6147b8a 100644
|
||||
--- a/sources/shiboken2/generator/generator.cpp
|
||||
+++ b/sources/shiboken2/generator/generator.cpp
|
||||
@@ -899,21 +899,23 @@ QString Generator::translateType(const AbstractMetaType *cType,
|
||||
if (index >= (s.size() - (constLen + 1))) // (VarType const) or (VarType const[*|&])
|
||||
s = s.remove(index, constLen);
|
||||
}
|
||||
- } else if (options & Generator::ExcludeConst || options & Generator::ExcludeReference) {
|
||||
+ } else {
|
||||
AbstractMetaType *copyType = cType->copy();
|
||||
+ if (options & Generator::ExcludeConst || options & Generator::ExcludeReference) {
|
||||
+ if (options & Generator::ExcludeConst)
|
||||
+ copyType->setConstant(false);
|
||||
|
||||
- if (options & Generator::ExcludeConst)
|
||||
- copyType->setConstant(false);
|
||||
-
|
||||
- if (options & Generator::ExcludeReference)
|
||||
- copyType->setReferenceType(NoReference);
|
||||
-
|
||||
+ if (options & Generator::ExcludeReference)
|
||||
+ copyType->setReferenceType(NoReference);
|
||||
+ }
|
||||
s = copyType->cppSignature();
|
||||
- if (!copyType->typeEntry()->isVoid() && !copyType->typeEntry()->isCppPrimitive())
|
||||
- s.prepend(QLatin1String("::"));
|
||||
+ const auto te = copyType->typeEntry();
|
||||
+ if (!te->isVoid() && !te->isCppPrimitive()) { // Add scope resolution
|
||||
+ const auto pos = s.indexOf(te->qualifiedCppName()); // Skip const/volatile
|
||||
+ Q_ASSERT(pos >= 0);
|
||||
+ s.insert(pos, QLatin1String("::"));
|
||||
+ }
|
||||
delete copyType;
|
||||
- } else {
|
||||
- s = cType->cppSignature();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
python,
|
||||
pythonAtLeast,
|
||||
lib,
|
||||
stdenv,
|
||||
pyside2,
|
||||
@@ -7,28 +8,47 @@
|
||||
qt5,
|
||||
libxcrypt,
|
||||
llvmPackages_15,
|
||||
pythonAtLeast,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "shiboken2";
|
||||
|
||||
inherit (pyside2) version src;
|
||||
inherit (pyside2) version src patches;
|
||||
|
||||
patches = [ ./nix_compile_cflags.patch ];
|
||||
|
||||
postPatch = ''
|
||||
cd sources/shiboken2
|
||||
'';
|
||||
postPatch =
|
||||
(lib.optionalString (pythonAtLeast "3.12") ''
|
||||
substituteInPlace \
|
||||
ez_setup.py \
|
||||
build_scripts/main.py \
|
||||
build_scripts/options.py \
|
||||
build_scripts/utils.py \
|
||||
build_scripts/wheel_override.py \
|
||||
build_scripts/wheel_utils.py \
|
||||
sources/shiboken2/CMakeLists.txt \
|
||||
sources/shiboken2/data/shiboken_helpers.cmake \
|
||||
--replace-fail "from distutils" "import setuptools; from distutils"
|
||||
substituteInPlace \
|
||||
build_scripts/config.py \
|
||||
build_scripts/main.py \
|
||||
build_scripts/options.py \
|
||||
build_scripts/setup_runner.py \
|
||||
build_scripts/utils.py \
|
||||
--replace-fail "import distutils" "import setuptools; import distutils"
|
||||
'')
|
||||
+ ''
|
||||
cd sources/shiboken2
|
||||
'';
|
||||
|
||||
CLANG_INSTALL_DIR = llvmPackages_15.libclang.out;
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
(python.withPackages (ps: with ps; [ setuptools ]))
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
llvmPackages_15.libclang
|
||||
python
|
||||
python.pkgs.setuptools
|
||||
qt5.qtbase
|
||||
qt5.qtxmlpatterns
|
||||
@@ -59,6 +79,5 @@ stdenv.mkDerivation {
|
||||
];
|
||||
homepage = "https://wiki.qt.io/Qt_for_Python";
|
||||
maintainers = with maintainers; [ gebner ];
|
||||
broken = pythonAtLeast "3.12";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
--- pyside-setup-everywhere-src-5.12.6/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp~ 2020-07-08 14:37:13.022476435 -0700
|
||||
+++ pyside-setup-everywhere-src-5.12.6/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp 2020-07-08 14:37:18.271484269 -0700
|
||||
@@ -330,17 +330,15 @@
|
||||
}
|
||||
#endif // NEED_CLANG_BUILTIN_INCLUDES
|
||||
|
||||
- // Append the c++ include paths since Clang is unable to find <list> etc
|
||||
- // on RHEL 7 with g++ 6.3 or CentOS 7.2.
|
||||
- // A fix for this has been added to Clang 5.0, so, the code can be removed
|
||||
- // once Clang 5.0 is the minimum version.
|
||||
- if (needsGppInternalHeaders()) {
|
||||
- const HeaderPaths gppPaths = gppInternalIncludePaths(compilerFromCMake(QStringLiteral("g++")));
|
||||
- for (const HeaderPath &h : gppPaths) {
|
||||
- if (h.path.contains("c++")
|
||||
- || h.path.contains("sysroot")) { // centOS
|
||||
- headerPaths.append(h);
|
||||
- }
|
||||
+ const HeaderPaths gppPaths = gppInternalIncludePaths(QStringLiteral("g++"));
|
||||
+ for (const HeaderPath &h : gppPaths) {
|
||||
+ // PySide2 requires that Qt headers are not -isystem
|
||||
+ // https://bugreports.qt.io/browse/PYSIDE-787
|
||||
+ if (!h.path.contains("-qt")) {
|
||||
+ // add using -isystem
|
||||
+ headerPaths.append(h);
|
||||
+ } else {
|
||||
+ headerPaths.append({h.path, HeaderType::Standard});
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
python,
|
||||
isPyPy,
|
||||
pythonAtLeast,
|
||||
pythonOlder,
|
||||
sip-module ? "sip",
|
||||
setuptools,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@@ -14,8 +16,7 @@ buildPythonPackage rec {
|
||||
version = "4.19.25";
|
||||
format = "other";
|
||||
|
||||
# relies on distutils
|
||||
disabled = isPyPy || pythonAtLeast "3.12";
|
||||
disabled = isPyPy;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.riverbankcomputing.com/static/Downloads/sip/${version}/sip-${version}.tar.gz";
|
||||
@@ -30,6 +31,12 @@ buildPythonPackage rec {
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = lib.optionalString (pythonAtLeast "3.12") ''
|
||||
substituteInPlace configure.py --replace-fail "from distutils" "from setuptools._distutils"
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = lib.optional (pythonAtLeast "3.12") setuptools;
|
||||
|
||||
configurePhase = ''
|
||||
${python.executable} ./configure.py \
|
||||
--sip-module ${sip-module} \
|
||||
@@ -40,7 +47,13 @@ buildPythonPackage rec {
|
||||
enableParallelBuilding = true;
|
||||
|
||||
pythonImportsCheck = [
|
||||
sip-module
|
||||
# https://www.riverbankcomputing.com/pipermail/pyqt/2023-January/045094.html
|
||||
# the import check for "sip" will fail, as it segfaults as the interperter is shutting down.
|
||||
# This is an upstream bug with sip4 on python3.12, and happens in the ubuntu packages version as well.
|
||||
# As the pacakge works fine until exit, just remove the import check for now.
|
||||
# See discussion at https://github.com/NixOS/nixpkgs/pull/327976#discussion_r1706488319
|
||||
(lib.optional (pythonOlder "3.12") sip-module)
|
||||
|
||||
"sipconfig"
|
||||
];
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -49,11 +49,11 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "xwayland";
|
||||
version = "24.1.1";
|
||||
version = "24.1.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://xorg/individual/xserver/${pname}-${version}.tar.xz";
|
||||
hash = "sha256-cSW+4LEDNYBdf1ulffqjWaeFCvGmhSTx2Xs2J0GlGDI=";
|
||||
hash = "sha256-FB63bn5CKjZhwIeCxwvkCTEIR1UELARQbg2X3UY+99I=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
|
||||
@@ -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 { });
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
}
|
||||
@@ -341,8 +341,6 @@ in rec {
|
||||
graphviz
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
buildInputs = cryptoLibsMap.${cryptoStr} ++ [
|
||||
arrow-cpp
|
||||
babeltrace
|
||||
@@ -450,6 +448,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})"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchgit, cmake, pkg-config, libftdi1, popt}:
|
||||
{ lib, stdenv, fetchgit, cmake, pkg-config, installShellFiles, libftdi1, popt}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sd-mux-ctrl-unstable";
|
||||
@@ -10,19 +10,21 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "0fxl8m1zkkyxkc2zi8930m0njfgnd04a22acny6vljnzag2shjvg";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
nativeBuildInputs = [ cmake pkg-config installShellFiles ];
|
||||
|
||||
buildInputs = [ libftdi1 popt ];
|
||||
|
||||
postInstall = ''
|
||||
install -D -m 644 ../doc/man/sd-mux-ctrl.1 $out/share/man/man1/sd-mux-ctrl.1
|
||||
installShellCompletion --cmd sd-mux-ctrl \
|
||||
--bash ../etc/bash_completion.d/sd-mux-ctrl
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Tool for controlling multiple sd-mux devices";
|
||||
homepage = "https://wiki.tizen.org/SD_MUX";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ sarcasticadmin ];
|
||||
maintainers = with maintainers; [ newam sarcasticadmin ];
|
||||
platforms = platforms.unix;
|
||||
mainProgram = "sd-mux-ctrl";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user