From 37d08288c59109fae49db6906eefab62a0e35837 Mon Sep 17 00:00:00 2001 From: dragonleopardpig Date: Tue, 31 Mar 2026 21:16:56 +0800 Subject: [PATCH 1/7] devenv + direnv --- .devenv/bash-bash | 1 + .devenv/bootstrap/bootstrapLib.nix | 562 ++++ .devenv/bootstrap/default.nix | 19 + .devenv/bootstrap/resolve-lock.nix | 157 ++ .devenv/gc/shell | 1 + .../gc/task-config-devenv-config-task-config | 1 + .devenv/imports.txt | 0 .devenv/input-paths.txt | 7 + .devenv/load-exports | 1 + .devenv/nix-eval-cache.db | Bin 0 -> 114688 bytes .devenv/nix-eval-cache.db-shm | Bin 0 -> 32768 bytes .devenv/nix-eval-cache.db-wal | Bin 0 -> 197792 bytes .devenv/nixpkgs-config-c7c9559ef5bdea25.nix | 9 + .devenv/profile | 1 + .devenv/run | 1 + .devenv/shell-711baa8c896359c5.sh | 2346 +++++++++++++++++ .devenv/shell-cea9d893b2194fc0.sh | 2346 +++++++++++++++++ .devenv/state/files.json | 1 + .devenv/task-names.txt | 5 + .devenv/tasks.db | Bin 0 -> 4096 bytes .devenv/tasks.db-shm | Bin 0 -> 32768 bytes .devenv/tasks.db-wal | Bin 0 -> 86552 bytes .envrc | 11 + devenv.lock | 65 + devenv.nix | 57 + 25 files changed, 5591 insertions(+) create mode 120000 .devenv/bash-bash create mode 100644 .devenv/bootstrap/bootstrapLib.nix create mode 100644 .devenv/bootstrap/default.nix create mode 100644 .devenv/bootstrap/resolve-lock.nix create mode 120000 .devenv/gc/shell create mode 120000 .devenv/gc/task-config-devenv-config-task-config create mode 100644 .devenv/imports.txt create mode 100644 .devenv/input-paths.txt create mode 100755 .devenv/load-exports create mode 100644 .devenv/nix-eval-cache.db create mode 100644 .devenv/nix-eval-cache.db-shm create mode 100644 .devenv/nix-eval-cache.db-wal create mode 100644 .devenv/nixpkgs-config-c7c9559ef5bdea25.nix create mode 120000 .devenv/profile create mode 120000 .devenv/run create mode 100755 .devenv/shell-711baa8c896359c5.sh create mode 100755 .devenv/shell-cea9d893b2194fc0.sh create mode 100644 .devenv/state/files.json create mode 100644 .devenv/task-names.txt create mode 100644 .devenv/tasks.db create mode 100644 .devenv/tasks.db-shm create mode 100644 .devenv/tasks.db-wal create mode 100644 .envrc create mode 100644 devenv.lock create mode 100644 devenv.nix diff --git a/.devenv/bash-bash b/.devenv/bash-bash new file mode 120000 index 00000000..03b7d3a2 --- /dev/null +++ b/.devenv/bash-bash @@ -0,0 +1 @@ +/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9 \ No newline at end of file diff --git a/.devenv/bootstrap/bootstrapLib.nix b/.devenv/bootstrap/bootstrapLib.nix new file mode 100644 index 00000000..7abbb727 --- /dev/null +++ b/.devenv/bootstrap/bootstrapLib.nix @@ -0,0 +1,562 @@ +# Shared library functions for devenv evaluation +{ inputs }: + +rec { + # Helper to get overlays for a given input + getOverlays = + inputName: inputAttrs: + let + lib = inputs.nixpkgs.lib; + in + map + ( + overlay: + let + input = + inputs.${inputName} or (throw "No such input `${inputName}` while trying to configure overlays."); + in + input.overlays.${overlay} + or (throw "Input `${inputName}` has no overlay called `${overlay}`. Supported overlays: ${lib.concatStringsSep ", " (builtins.attrNames input.overlays)}") + ) inputAttrs.overlays or [ ]; + + # Main function to create devenv configuration for a specific system with profiles support + # This is the full-featured version used by default.nix + mkDevenvForSystem = + { version + , is_development_version ? false + , system + , devenv_root + , git_root ? null + , devenv_dotfile + , devenv_dotfile_path + , devenv_tmpdir + , devenv_runtime + , devenv_state ? null + , devenv_istesting ? false + , devenv_direnvrc_latest_version + , container_name ? null + , active_profiles ? [ ] + , hostname + , username + , cli_options ? [ ] + , skip_local_src ? false + , secretspec ? null + , devenv_inputs ? { } + , devenv_imports ? [ ] + , impure ? false + , nixpkgs_config ? { } + , lock_fingerprint ? null + , primops ? { } + }: + let + inherit (inputs) nixpkgs; + lib = nixpkgs.lib; + targetSystem = system; + + overlays = lib.flatten (lib.mapAttrsToList getOverlays devenv_inputs); + + # Helper to create pkgs for a given system with nixpkgs_config + mkPkgsForSystem = + evalSystem: + import nixpkgs { + system = evalSystem; + config = nixpkgs_config // { + allowUnfreePredicate = + if nixpkgs_config.allowUnfree or false then + (_: true) + else if (nixpkgs_config.permittedUnfreePackages or [ ]) != [ ] then + (pkg: builtins.elem (lib.getName pkg) (nixpkgs_config.permittedUnfreePackages or [ ])) + else + (_: false); + }; + inherit overlays; + }; + + pkgsBootstrap = mkPkgsForSystem targetSystem; + + # Helper to import a path, trying .nix first then /devenv.nix + # Returns a list of modules, including devenv.local.nix when present + tryImport = + resolvedPath: basePath: + if lib.hasSuffix ".nix" basePath then + [ (import resolvedPath) ] + else + let + devenvpath = resolvedPath + "/devenv.nix"; + localpath = resolvedPath + "/devenv.local.nix"; + in + if builtins.pathExists devenvpath then + [ (import devenvpath) ] ++ lib.optional (builtins.pathExists localpath) (import localpath) + else + throw (basePath + "/devenv.nix file does not exist"); + + importModule = + path: + if lib.hasPrefix "path:" path then + # path: prefix indicates a local filesystem path - strip it and import directly + let + actualPath = builtins.substring 5 999999 path; + in + tryImport (/. + actualPath) path + else if lib.hasPrefix "/" path then + # Absolute path - import directly (avoids input resolution and NAR hash computation) + tryImport (/. + path) path + else if lib.hasPrefix "./" path then + # Relative paths are relative to devenv_root, not bootstrap directory + let + relPath = builtins.substring 1 255 path; + in + tryImport (/. + devenv_root + relPath) path + else if lib.hasPrefix "../" path then + # Parent relative paths also relative to devenv_root + tryImport (/. + devenv_root + "/${path}") path + else + let + paths = lib.splitString "/" path; + name = builtins.head paths; + input = inputs.${name} or (throw "Unknown input ${name}"); + subpath = "/${lib.concatStringsSep "/" (builtins.tail paths)}"; + devenvpath = input + subpath; + in + tryImport devenvpath path; + + # Common modules shared between main evaluation and cross-system evaluation + mkCommonModules = + evalPkgs: + [ + ( + { config, ... }: + { + _module.args.pkgs = evalPkgs.appendOverlays (config.overlays or [ ]); + _module.args.secretspec = secretspec; + _module.args.devenvPrimops = primops; + } + ) + (inputs.devenv.modules + /top-level.nix) + ( + { options, ... }: + { + config.devenv = lib.mkMerge [ + { + root = devenv_root; + dotfile = devenv_dotfile; + } + ( + if builtins.hasAttr "cli" options.devenv then + { + cli.version = version; + cli.isDevelopment = is_development_version; + } + else + { + cliVersion = version; + } + ) + (lib.optionalAttrs (builtins.hasAttr "tmpdir" options.devenv) { + tmpdir = devenv_tmpdir; + }) + (lib.optionalAttrs (builtins.hasAttr "isTesting" options.devenv) { + isTesting = devenv_istesting; + }) + (lib.optionalAttrs (builtins.hasAttr "runtime" options.devenv) { + runtime = devenv_runtime; + }) + (lib.optionalAttrs (builtins.hasAttr "state" options.devenv && devenv_state != null) { + state = lib.mkForce devenv_state; + }) + (lib.optionalAttrs (builtins.hasAttr "direnvrcLatestVersion" options.devenv) { + direnvrcLatestVersion = devenv_direnvrc_latest_version; + }) + ]; + } + ) + ( + { options, ... }: + { + config = lib.mkMerge [ + (lib.optionalAttrs (builtins.hasAttr "git" options) { + git.root = git_root; + }) + ]; + } + ) + (lib.optionalAttrs (container_name != null) { + container.isBuilding = lib.mkForce true; + containers.${container_name}.isBuilding = true; + }) + ] + ++ (lib.flatten (map importModule devenv_imports)) + ++ (if !skip_local_src then (importModule (devenv_root + "/devenv.nix")) else [ ]) + ++ [ + ( + let + localPath = devenv_root + "/devenv.local.nix"; + in + if builtins.pathExists localPath then import localPath else { } + ) + cli_options + ]; + + # Phase 1: Base evaluation to extract profile definitions + baseProject = lib.evalModules { + specialArgs = inputs // { + inherit inputs secretspec primops; + }; + modules = mkCommonModules pkgsBootstrap; + }; + + # Phase 2: Extract and apply profiles using extendModules with priority overrides + project = + let + # Build ordered list of profile names: hostname -> user -> manual + manualProfiles = active_profiles; + currentHostname = hostname; + currentUsername = username; + hostnameProfiles = lib.optional + ( + currentHostname != null + && currentHostname != "" + && builtins.hasAttr currentHostname (baseProject.config.profiles.hostname or { }) + ) "hostname.${currentHostname}"; + userProfiles = lib.optional + ( + currentUsername != null + && currentUsername != "" + && builtins.hasAttr currentUsername (baseProject.config.profiles.user or { }) + ) "user.${currentUsername}"; + + # Ordered list of profiles to activate + orderedProfiles = hostnameProfiles ++ userProfiles ++ manualProfiles; + + # Resolve profile extends with cycle detection + resolveProfileExtends = + profileName: visited: + if builtins.elem profileName visited then + throw "Circular dependency detected in profile extends: ${lib.concatStringsSep " -> " visited} -> ${profileName}" + else + let + profile = getProfileConfig profileName; + extends = profile.extends or [ ]; + newVisited = visited ++ [ profileName ]; + extendedProfiles = lib.flatten (map (name: resolveProfileExtends name newVisited) extends); + in + extendedProfiles ++ [ profileName ]; + + # Get profile configuration by name from baseProject + getProfileConfig = + profileName: + if lib.hasPrefix "hostname." profileName then + let + name = lib.removePrefix "hostname." profileName; + in + baseProject.config.profiles.hostname.${name} + else if lib.hasPrefix "user." profileName then + let + name = lib.removePrefix "user." profileName; + in + baseProject.config.profiles.user.${name} + else + let + availableProfiles = builtins.attrNames (baseProject.config.profiles or { }); + hostnameProfiles = map (n: "hostname.${n}") ( + builtins.attrNames (baseProject.config.profiles.hostname or { }) + ); + userProfiles = map (n: "user.${n}") (builtins.attrNames (baseProject.config.profiles.user or { })); + allAvailableProfiles = availableProfiles ++ hostnameProfiles ++ userProfiles; + in + baseProject.config.profiles.${profileName} + or (throw "Profile '${profileName}' not found. Available profiles: ${lib.concatStringsSep ", " allAvailableProfiles}"); + + # Fold over ordered profiles to build final list with extends + expandedProfiles = lib.foldl' + ( + acc: profileName: + let + allProfileNames = resolveProfileExtends profileName [ ]; + in + acc ++ allProfileNames + ) [ ] + orderedProfiles; + + # Map over expanded profiles and apply priorities + allPrioritizedModules = lib.imap0 + ( + index: profileName: + let + profilePriority = (lib.modules.defaultOverridePriority - 1) - index; + profileConfig = getProfileConfig profileName; + + typeNeedsOverride = + type: + if type == null then + false + else + let + typeName = type.name or type._type or ""; + + isLeafType = builtins.elem typeName [ + "str" + "int" + "bool" + "enum" + "path" + "package" + "float" + "anything" + ]; + in + if isLeafType then + true + else if typeName == "nullOr" then + let + innerType = + type.elemType + or (if type ? nestedTypes && type.nestedTypes ? elemType then type.nestedTypes.elemType else null); + in + if innerType != null then typeNeedsOverride innerType else false + else + false; + + pathNeedsOverride = + optionPath: + let + directOption = lib.attrByPath optionPath null baseProject.options; + in + if directOption != null && lib.isOption directOption then + typeNeedsOverride directOption.type + else if optionPath != [ ] then + let + parentPath = lib.init optionPath; + parentOption = lib.attrByPath parentPath null baseProject.options; + in + if parentOption != null && lib.isOption parentOption then + let + freeformType = parentOption.type.freeformType or parentOption.type.nestedTypes.freeformType or null; + elementType = + if freeformType ? elemType then + freeformType.elemType + else if freeformType ? nestedTypes && freeformType.nestedTypes ? elemType then + freeformType.nestedTypes.elemType + else + freeformType; + in + typeNeedsOverride elementType + else + false + else + false; + + applyModuleOverride = + config: + if builtins.isFunction config then + let + wrapper = args: applyOverrideRecursive (config args) [ ]; + in + lib.mirrorFunctionArgs config wrapper + else + applyOverrideRecursive config [ ]; + + applyOverrideRecursive = + config: optionPath: + if lib.isAttrs config && config ? _type then + config + else if lib.isAttrs config then + lib.mapAttrs (name: value: applyOverrideRecursive value (optionPath ++ [ name ])) config + else if pathNeedsOverride optionPath then + lib.mkOverride profilePriority config + else + config; + + prioritizedConfig = ( + profileConfig.module + // { + imports = lib.map + ( + importItem: + importItem + // { + imports = lib.map (nestedImport: applyModuleOverride nestedImport) (importItem.imports or [ ]); + } + ) + (profileConfig.module.imports or [ ]); + } + ); + in + prioritizedConfig + ) + expandedProfiles; + in + if allPrioritizedModules == [ ] then + baseProject + else + baseProject.extendModules { modules = allPrioritizedModules; }; + + config = project.config; + + # Apply config overlays to pkgs + pkgs = pkgsBootstrap.appendOverlays (config.overlays or [ ]); + + options = pkgs.nixosOptionsDoc { + options = builtins.removeAttrs project.options [ "_module" ]; + warningsAreErrors = false; + transformOptions = + let + isDocType = + v: + builtins.elem v [ + "literalDocBook" + "literalExpression" + "literalMD" + "mdDoc" + ]; + in + lib.attrsets.mapAttrs ( + _: v: + if v ? _type && isDocType v._type then + v.text + else if v ? _type && v._type == "derivation" then + v.name + else + v + ); + }; + + build = + options: config: + lib.concatMapAttrs + ( + name: option: + if lib.isOption option then + let + typeName = option.type.name or ""; + in + if + builtins.elem typeName [ + "output" + "outputOf" + ] + then + { + ${name} = config.${name}; + } + else + { } + else if builtins.isAttrs option && !lib.isDerivation option then + let + v = build option config.${name}; + in + if v != { } then { ${name} = v; } else { } + else + { } + ) + options; + + # Helper to evaluate devenv for a specific system (for cross-compilation, e.g. macOS building Linux containers) + evalForSystem = + evalSystem: + let + evalPkgs = mkPkgsForSystem evalSystem; + evalProject = lib.evalModules { + specialArgs = inputs // { + inherit inputs secretspec primops; + }; + modules = mkCommonModules evalPkgs; + }; + in + { + config = evalProject.config; + }; + + # All supported systems for cross-compilation (lazily evaluated) + allSystems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + # Generate perSystem entries for all systems (only evaluated when accessed) + perSystemConfigs = lib.genAttrs allSystems ( + perSystem: if perSystem == targetSystem then { config = config; } else evalForSystem perSystem + ); + in + { + inherit + pkgs + config + options + project + ; + bash = pkgs.bash; + shell = config.shell; + optionsJSON = options.optionsJSON; + info = config.info; + ci = config.ciDerivation; + build = build project.options config; + devenv = { + # Backwards compatibility: wrap config in devenv attribute for code expecting devenv.config.* + config = config; + # perSystem structure for cross-compilation (e.g. macOS building Linux containers) + perSystem = perSystemConfigs; + }; + }; + + # Simplified devenv evaluation for inputs + # This is a lightweight version suitable for evaluating an input's devenv.nix + mkDevenvForInput = + { + # The input to evaluate (must have outPath and sourceInfo) + input + , # All resolved inputs (for specialArgs) + allInputs + , # System to evaluate for + system ? builtins.currentSystem + , # Nixpkgs to use (defaults to allInputs.nixpkgs) + nixpkgs ? allInputs.nixpkgs or (throw "nixpkgs input required") + , # Devenv modules (defaults to allInputs.devenv) + devenv ? allInputs.devenv or (throw "devenv input required") + , + }: + let + devenvPath = input.outPath + "/devenv.nix"; + hasDevenv = builtins.pathExists devenvPath; + in + if !hasDevenv then + throw '' + Input does not have a devenv.nix file. + Expected file at: ${devenvPath} + + To use this input's devenv configuration, the input must provide a devenv.nix file. + '' + else + let + pkgs = import nixpkgs { + inherit system; + config = { }; + }; + lib = pkgs.lib; + + project = lib.evalModules { + specialArgs = allInputs // { + inputs = allInputs; + secretspec = null; + }; + modules = [ + ( + { config, ... }: + { + _module.args.pkgs = pkgs.appendOverlays (config.overlays or [ ]); + } + ) + (devenv.outPath + "/src/modules/top-level.nix") + (import devenvPath) + ]; + }; + in + { + inherit pkgs; + config = project.config; + options = project.options; + inherit project; + }; +} diff --git a/.devenv/bootstrap/default.nix b/.devenv/bootstrap/default.nix new file mode 100644 index 00000000..7010be36 --- /dev/null +++ b/.devenv/bootstrap/default.nix @@ -0,0 +1,19 @@ +args@{ system +, # The project root (location of devenv.nix) + devenv_root +, ... +}: + +let + inherit + (import ./resolve-lock.nix { + src = devenv_root; + inherit system; + }) + inputs + ; + + bootstrapLib = import ./bootstrapLib.nix { inherit inputs; }; +in + +bootstrapLib.mkDevenvForSystem args diff --git a/.devenv/bootstrap/resolve-lock.nix b/.devenv/bootstrap/resolve-lock.nix new file mode 100644 index 00000000..fee5ebc3 --- /dev/null +++ b/.devenv/bootstrap/resolve-lock.nix @@ -0,0 +1,157 @@ +# Adapted from https://git.lix.systems/lix-project/flake-compat/src/branch/main/default.nix +{ src +, system ? builtins.currentSystem or "unknown-system" +, +}: + +let + lockFilePath = src + "/devenv.lock"; + + lockFile = builtins.fromJSON (builtins.readFile lockFilePath); + + rootSrc = { + lastModified = 0; + lastModifiedDate = formatSecondsSinceEpoch 0; + # *hacker voice*: it's definitely a store path, I promise (actually a + # nixlang path value, likely not pointing at the store). + outPath = src; + }; + + # Format number of seconds in the Unix epoch as %Y%m%d%H%M%S. + formatSecondsSinceEpoch = + t: + let + rem = x: y: x - x / y * y; + days = t / 86400; + secondsInDay = rem t 86400; + hours = secondsInDay / 3600; + minutes = (rem secondsInDay 3600) / 60; + seconds = rem t 60; + + # Courtesy of https://stackoverflow.com/a/32158604. + z = days + 719468; + era = (if z >= 0 then z else z - 146096) / 146097; + doe = z - era * 146097; + yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365; + y = yoe + era * 400; + doy = doe - (365 * yoe + yoe / 4 - yoe / 100); + mp = (5 * doy + 2) / 153; + d = doy - (153 * mp + 2) / 5 + 1; + m = mp + (if mp < 10 then 3 else -9); + y' = y + (if m <= 2 then 1 else 0); + + pad = s: if builtins.stringLength s < 2 then "0" + s else s; + in + "${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}${pad (toString minutes)}${pad (toString seconds)}"; + + allNodes = builtins.mapAttrs + ( + key: node: + let + sourceInfo = + if key == lockFile.root then + rootSrc + # Path inputs pointing to project root (path = ".") should use rootSrc + # to avoid fetchTree hashing the entire project directory + else if node.locked.type or null == "path" && node.locked.path or null == "." then + rootSrc + else + let + locked = node.locked; + isRelativePath = p: p != null && (builtins.substring 0 2 p == "./" || builtins.substring 0 3 p == "../"); + # Resolve relative paths against src + resolvedLocked = locked + // (if locked.type or null == "path" && isRelativePath (locked.path or null) + then { path = toString src + "/${locked.path}"; } + else { }) + // (if locked.type or null == "git" && isRelativePath (locked.url or null) + then { url = toString src + "/${locked.url}"; } + else { }); + in + builtins.fetchTree (node.info or { } // removeAttrs resolvedLocked [ "dir" ]); + + subdir = if key == lockFile.root then "" else node.locked.dir or ""; + + outPath = sourceInfo + ((if subdir == "" then "" else "/") + subdir); + + # Resolve a input spec into a node name. An input spec is + # either a node name, or a 'follows' path from the root + # node. + resolveInput = + inputSpec: if builtins.isList inputSpec then getInputByPath lockFile.root inputSpec else inputSpec; + + # Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the + # root node, returning the final node. + getInputByPath = + nodeName: path: + if path == [ ] then + nodeName + else + getInputByPath + # Since this could be a 'follows' input, call resolveInput. + (resolveInput lockFile.nodes.${nodeName}.inputs.${builtins.head path}) + (builtins.tail path); + + inputs = builtins.mapAttrs (inputName: inputSpec: allNodes.${resolveInput inputSpec}) ( + node.inputs or { } + ); + + # Only import flake.nix for non-root nodes (root doesn't need it) + flake = if key == lockFile.root then null else import (outPath + "/flake.nix"); + + outputs = if key == lockFile.root then { } else flake.outputs (inputs // { self = result; }); + + # Lazy devenv evaluation for this input + devenvEval = + let + bootstrapLib = import ./bootstrapLib.nix { inputs = inputs; }; + in + bootstrapLib.mkDevenvForInput { + input = { inherit outPath sourceInfo; }; + allInputs = inputs; + inherit system; + }; + + result = + outputs + // sourceInfo + // { + inherit outPath; + inherit inputs; + inherit outputs; + inherit sourceInfo; + _type = "flake"; + devenv = devenvEval; + }; + + nonFlakeResult = sourceInfo // { + inherit outPath; + inherit inputs; + inherit sourceInfo; + _type = "flake"; + devenv = devenvEval; + }; + + in + if node.flake or true && key != lockFile.root then + assert builtins.isFunction flake.outputs; + result + else + nonFlakeResult + ) + lockFile.nodes; + + result = + if !(builtins.pathExists lockFilePath) then + throw "${lockFilePath} does not exist" + else if lockFile.version >= 5 && lockFile.version <= 7 then + allNodes.${lockFile.root} + else + throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}"; + +in +{ + inputs = result.inputs or { } // { + self = result; + }; +} diff --git a/.devenv/gc/shell b/.devenv/gc/shell new file mode 120000 index 00000000..184229e4 --- /dev/null +++ b/.devenv/gc/shell @@ -0,0 +1 @@ +/nix/store/ab4k40z1sraynjijpqdlaql235f5n08j-devenv-shell \ No newline at end of file diff --git a/.devenv/gc/task-config-devenv-config-task-config b/.devenv/gc/task-config-devenv-config-task-config new file mode 120000 index 00000000..8160720b --- /dev/null +++ b/.devenv/gc/task-config-devenv-config-task-config @@ -0,0 +1 @@ +/nix/store/c2yi54kd0hnlqgm9s5vrw12hm7kar3rl-tasks.json \ No newline at end of file diff --git a/.devenv/imports.txt b/.devenv/imports.txt new file mode 100644 index 00000000..e69de29b diff --git a/.devenv/input-paths.txt b/.devenv/input-paths.txt new file mode 100644 index 00000000..586f95bd --- /dev/null +++ b/.devenv/input-paths.txt @@ -0,0 +1,7 @@ +/home/thinky/Projects/RayTracing/.devenv/bootstrap/bootstrapLib.nix +/home/thinky/Projects/RayTracing/.devenv/bootstrap/default.nix +/home/thinky/Projects/RayTracing/.devenv/bootstrap/resolve-lock.nix +/home/thinky/Projects/RayTracing/devenv.local.nix +/home/thinky/Projects/RayTracing/devenv.lock +/home/thinky/Projects/RayTracing/devenv.nix +/home/thinky/Projects/RayTracing/.env \ No newline at end of file diff --git a/.devenv/load-exports b/.devenv/load-exports new file mode 100755 index 00000000..8b137891 --- /dev/null +++ b/.devenv/load-exports @@ -0,0 +1 @@ + diff --git a/.devenv/nix-eval-cache.db b/.devenv/nix-eval-cache.db new file mode 100644 index 0000000000000000000000000000000000000000..10bf4bd3043d2cb0c343a2ecf3f1e3d4a835e56e GIT binary patch literal 114688 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 N#bWGK=fWSp=`+WcD}ew2 literal 0 HcmV?d00001 diff --git a/.devenv/nix-eval-cache.db-wal b/.devenv/nix-eval-cache.db-wal new file mode 100644 index 0000000000000000000000000000000000000000..f5bc59bf4702d1e2005d70714d07f26d89e67952 GIT binary patch literal 197792 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 K6@z~8=>G#c2P$L$ literal 0 HcmV?d00001 diff --git a/.devenv/nixpkgs-config-c7c9559ef5bdea25.nix b/.devenv/nixpkgs-config-c7c9559ef5bdea25.nix new file mode 100644 index 00000000..a5e5c1f8 --- /dev/null +++ b/.devenv/nixpkgs-config-c7c9559ef5bdea25.nix @@ -0,0 +1,9 @@ +let cfg = {}; in cfg // { + allowUnfreePredicate = + if cfg.allowUnfree or false then + (_: true) + else if (cfg.permittedUnfreePackages or []) != [] then + (pkg: builtins.elem ((builtins.parseDrvName (pkg.name or pkg.pname or pkg)).name) (cfg.permittedUnfreePackages or [])) + else + (_: false); +} \ No newline at end of file diff --git a/.devenv/profile b/.devenv/profile new file mode 120000 index 00000000..7e76cd35 --- /dev/null +++ b/.devenv/profile @@ -0,0 +1 @@ +/nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile \ No newline at end of file diff --git a/.devenv/run b/.devenv/run new file mode 120000 index 00000000..7664f62a --- /dev/null +++ b/.devenv/run @@ -0,0 +1 @@ +/run/user/1000/devenv-db47dbe \ No newline at end of file diff --git a/.devenv/shell-711baa8c896359c5.sh b/.devenv/shell-711baa8c896359c5.sh new file mode 100755 index 00000000..99a5cb2f --- /dev/null +++ b/.devenv/shell-711baa8c896359c5.sh @@ -0,0 +1,2346 @@ +if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then + source $HOME/.bashrc; +fi + +shopt -u expand_aliases +PATH=${PATH:-} +nix_saved_PATH="$PATH" +XDG_DATA_DIRS=${XDG_DATA_DIRS:-} +nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" +PATH='/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9/bin:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0/bin:/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/bin:/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin/bin:/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/bin:/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/bin:/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2/bin:/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2/bin:/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0/bin:/nix/store/sca0pf46jmxva40qahkcwys5c1lvk6n2-gcc-15.2.0/bin:/nix/store/2c48s343k15i0cmwb9cp1vi6randmzcw-glibc-2.42-51-bin/bin:/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44/bin:/nix/store/9nmzd62x45ayp4vmswvn6z45h6bzrsla-binutils-2.44/bin:/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0/bin:/nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12/bin:/nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9/bin:/nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12/bin:/nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2/bin:/nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35/bin:/nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1/bin:/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin:/nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8/bin:/nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin/bin:/nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45/bin' +export PATH +STRIP='strip' +export STRIP +NIX_LDFLAGS='-rpath /nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env/lib -L/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib -L/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib -L/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8/lib -L/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib/lib -L/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55/lib -L/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/lib -L/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/lib -L/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib -L/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib -L/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/lib -L/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib -L/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib -L/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib -L/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib -L/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/lib -L/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib -L/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib -L/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib -L/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib -L/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib -L/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8/lib -L/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib/lib -L/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55/lib -L/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/lib -L/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/lib -L/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib -L/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib -L/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/lib -L/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib -L/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib -L/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib -L/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib -L/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/lib -L/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib -L/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib -L/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib' +export NIX_LDFLAGS +SHELL='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' +export SHELL +NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningextensive libcxxhardeningfast pic relro stackclashprotection stackprotector strictoverflow zerocallusedregs' +export NIX_HARDENING_ENABLE +depsBuildBuildPropagated='' +export depsBuildBuildPropagated +system='x86_64-linux' +export system +DEVENV_PROFILE='/nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile' +export DEVENV_PROFILE +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +defaultBuildInputs='' +declare -a pkgsHostHost=() +DEVENV_TASKS='' +export DEVENV_TASKS +AS='as' +export AS +BASH='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' +HOST_PATH='/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0/bin:/nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12/bin:/nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9/bin:/nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12/bin:/nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2/bin:/nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35/bin:/nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1/bin:/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin:/nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8/bin:/nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin/bin:/nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45/bin' +export HOST_PATH +TCLLIBPATH='/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib/tk8.6' +export TCLLIBPATH +cmakeFlags='' +export cmakeFlags +depsTargetTargetPropagated='' +export depsTargetTargetPropagated +declare -a envBuildHostHooks=('addPythonPath' 'sysconfigdataHook' ) +declare -a envBuildTargetHooks=('addPythonPath' 'sysconfigdataHook' ) +declare -a pkgsBuildTarget=() +CONFIG_SHELL='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' +export CONFIG_SHELL +mesonFlags='' +export mesonFlags +PKG_CONFIG_PATH='/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/lib/pkgconfig:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib/pkgconfig:/nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/lib/pkgconfig:/nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/lib/pkgconfig:/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/share/pkgconfig:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/lib/pkgconfig:/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/share/pkgconfig:/nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/lib/pkgconfig:/nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/lib/pkgconfig:/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/lib/pkgconfig:/nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/lib/pkgconfig:/nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/lib/pkgconfig:/nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/lib/pkgconfig:/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib/pkgconfig:/nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/lib/pkgconfig:/nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/lib/pkgconfig:/nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/lib/pkgconfig:/nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/lib/pkgconfig:/nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/lib/pkgconfig' +export PKG_CONFIG_PATH +outputBin='out' +IN_NIX_SHELL='impure' +export IN_NIX_SHELL +TK_LIBRARY='/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib/tk8.6.16' +export TK_LIBRARY +declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) +outputDev='out' +__structuredAttrs='' +export __structuredAttrs +depsHostHostPropagated='' +export depsHostHostPropagated +declare -a preConfigureHooks=('_multioutConfig' ) +outputs='out' +export outputs +AR='ar' +export AR +NIX_CC='/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' +export NIX_CC +preferLocalBuild='1' +export preferLocalBuild +VENV_DIR='.devenv/state/venv' +export VENV_DIR +MACHTYPE='x86_64-pc-linux-gnu' +NIX_BINTOOLS='/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44' +export NIX_BINTOOLS +CC='gcc' +export CC +NIX_BUILD_CORES='4' +export NIX_BUILD_CORES +OPTERR='1' +PIP_DISABLE_PIP_VERSION_CHECK='1' +export PIP_DISABLE_PIP_VERSION_CHECK +TCL_LIBRARY='/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib/tcl8.6.16' +export TCL_LIBRARY +configureFlags='' +export configureFlags +NIX_STORE='/nix/store' +export NIX_STORE +declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) +CXX='g++' +export CXX +SOURCE_DATE_EPOCH='315532800' +export SOURCE_DATE_EPOCH +pkg='/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' +PKG_CONFIG='pkg-config' +export PKG_CONFIG +DEVENV_STATE='/home/thinky/Projects/RayTracing/.devenv/state' +export DEVENV_STATE +stdenv='/nix/store/zkiy4zv8wz3v95bj6fdmkqwql8x1vnhb-stdenv-linux' +export stdenv +DEVENV_RUNTIME='/run/user/1000/devenv-db47dbe' +export DEVENV_RUNTIME +declare -a pkgsHostTarget=() +declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) +NIX_ENFORCE_NO_NATIVE='1' +export NIX_ENFORCE_NO_NATIVE +out='/nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env' +export out +hardeningDisable='' +export hardeningDisable +NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +READELF='readelf' +export READELF +declare -a pkgsTargetTarget=() +declare -a envTargetTargetHooks=() +NIX_CFLAGS_COMPILE=' -frandom-seed=q5rbqaawx4 -isystem /nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/include -isystem /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/include -isystem /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/include -isystem /nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/include -isystem /nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/include -isystem /nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/include -isystem /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/include -isystem /nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/include -isystem /nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/include -isystem /nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/include -isystem /nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/include -isystem /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/include -isystem /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/include -isystem /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/include -isystem /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/include -isystem /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/include -isystem /nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/include -isystem /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/include -isystem /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/include -isystem /nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/include -isystem /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/include -isystem /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/include -isystem /nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/include -isystem /nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/include -isystem /nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/include -isystem /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/include -isystem /nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/include -isystem /nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/include -isystem /nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/include -isystem /nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/include -isystem /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/include -isystem /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/include -isystem /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/include -isystem /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/include -isystem /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/include -isystem /nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/include -isystem /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/include -isystem /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/include' +export NIX_CFLAGS_COMPILE +declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) +PYTHONPATH='/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib/python3.12/site-packages:/nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13/lib/python3.12/site-packages' +export PYTHONPATH +_PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu' +export _PYTHON_SYSCONFIGDATA_NAME +shellHook=' +export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" + +# Override temp directories that stdenv set to NIX_BUILD_TOP. +# Only reset those that still point to the Nix build dir; leave +# any user/CI-supplied value intact so child processes (e.g. +# `devenv processes wait`) compute the same runtime directory. +for var in TMP TMPDIR TEMP TEMPDIR; do + if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then + export "$var"=/tmp + fi +done +if [ -n "${NIX_BUILD_TOP-}" ]; then + unset NIX_BUILD_TOP +fi + +# set path to locales on non-NixOS Linux hosts +if [ -z "${LOCALE_ARCHIVE-}" ]; then + export LOCALE_ARCHIVE=/nix/store/q6y3frkqaq8v7va2rmgaq6jvhy1vb9q3-glibc-locales-2.42-51/lib/locale/locale-archive +fi + + +# direnv helper +if [ ! type -p direnv &>/dev/null && -f .envrc ]; then + echo "An .envrc file was detected, but the direnv command is not installed." + echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html" +fi + +mkdir -p "$DEVENV_STATE" +if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile" ] +then + ln -snf /nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile "$DEVENV_DOTFILE/profile" +fi +unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps + +mkdir -p /run/user/1000/devenv-db47dbe +ln -snf /run/user/1000/devenv-db47dbe /home/thinky/Projects/RayTracing/.devenv/run + + +echo "✨ devenv 2.0.3 is out of date. Please update to 2.0.6: https://devenv.sh/getting-started/#installation" >&2 + + +# Check whether the direnv integration is out of date. +{ + if [[ ":${DIRENV_ACTIVE-}:" == *":/home/thinky/Projects/RayTracing:"* ]]; then + if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then + if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then + direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "") + + echo "✨ The direnv integration in your .envrc is out of date." + echo "" + echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. " + if [[ -n "$direnv_line" ]]; then + echo "To enable this feature, replace the following line in your .envrc:" + echo "" + echo " $direnv_line" + echo "" + echo "with:" + echo "" + echo " eval \"\$(devenv direnvrc)\"" + else + echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:" + echo "" + echo " eval \"$(devenv direnvrc)\"" + fi + echo "" + echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/." + echo "" + echo "To disable this message:" + echo "" + echo " Add the following environment to your .envrc before \`use devenv\`:" + echo "" + echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1" + echo "" + echo " Or set the following option in your devenv configuration:" + echo "" + echo " devenv.warnOnNewVersion = false;" + echo "" + fi + fi + fi +} >&2 + +echo "RayTracing devenv" +echo "Python $(/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin/python --version | cut -d'\'' '\'' -f2)" + +if [ ! -x "$VENV_DIR/bin/python" ]; then + /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin/python -m venv --system-site-packages "$VENV_DIR" +fi + +. "$VENV_DIR/bin/activate" + +python -m ensurepip --upgrade >/dev/null 2>&1 || true +python -m pip install --upgrade pip setuptools wheel build >/dev/null +python -m pip install --upgrade -e ".[gui]" pillow basedpyright ruff >/dev/null + +export PATH="$PWD/$VENV_DIR/bin:$PATH" + +' +export shellHook +DETERMINISTIC_BUILD='1' +export DETERMINISTIC_BUILD +depsBuildTargetPropagated='' +export depsBuildTargetPropagated +STRINGS='strings' +export STRINGS +declare -a pkgsBuildHost=('/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev' '/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9' '/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13' '/nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13' '/nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev' '/nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev' '/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1' '/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev' '/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev' '/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1' '/nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev' '/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin' '/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8' '/nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev' '/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib' '/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0' '/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev' '/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55' '/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3' '/nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev' '/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin' '/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib' '/nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev' '/nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev' '/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12' '/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12' '/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9' '/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16' '/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16' '/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib' '/nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev' '/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0' '/nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev' '/nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev' '/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12' '/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7' '/nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev' '/nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev' '/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2' '/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6' '/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2' '/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2' '/nix/store/gz3rknshr1ywis4mjaqrgj3z2shp3n3v-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' '/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44' ) +declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' ) +declare -a pkgsBuildBuild=() +OSTYPE='linux-gnu' +LINENO='79' +depsHostHost='' +export depsHostHost +outputInclude='out' +PYTHONNOUSERSITE='1' +export PYTHONNOUSERSITE +OBJDUMP='objdump' +export OBJDUMP +_PYTHON_HOST_PLATFORM='linux-x86_64' +export _PYTHON_HOST_PLATFORM +NM='nm' +export NM +DEVENV_DOTFILE='/home/thinky/Projects/RayTracing/.devenv' +export DEVENV_DOTFILE +doInstallCheck='' +export doInstallCheck +name='devenv-shell-env' +export name +OBJCOPY='objcopy' +export OBJCOPY +depsBuildTarget='' +export depsBuildTarget +initialPath='/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10 /nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0 /nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12 /nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9 /nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12 /nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2 /nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35 /nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14 /nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin /nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1 /nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9 /nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8 /nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin /nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45' +outputLib='out' +strictDeps='' +export strictDeps +RANLIB='ranlib' +export RANLIB +outputDevman='out' +DEVENV_ROOT='/home/thinky/Projects/RayTracing' +export DEVENV_ROOT +outputDoc='out' +depsTargetTarget='' +export depsTargetTarget +outputDevdoc='REMOVE' +phases='buildPhase' +export phases +propagatedNativeBuildInputs='' +export propagatedNativeBuildInputs +preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' +LD_LIBRARY_PATH='/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib:/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib:/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib:/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib:/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib:/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib:/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib:/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib' +export LD_LIBRARY_PATH +outputMan='out' +PYTHONHASHSEED='0' +export PYTHONHASHSEED +declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) +declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) +PS4='+ ' +OLDPWD='' +export OLDPWD +buildInputs='' +export buildInputs +depsBuildBuild='' +export depsBuildBuild +outputInfo='out' +dontAddDisableDepTrack='1' +export dontAddDisableDepTrack +patches='' +export patches +prefix='/nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env' +NIX_NO_SELF_RPATH='1' +XDG_DATA_DIRS='/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9/share:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/share:/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/share:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/share:/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/share:/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/share:/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0/share:/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/share:/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin/share:/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/share:/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/share:/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/share:/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/share:/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/share:/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2/share:/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2/share' +export XDG_DATA_DIRS +shell='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' +export shell +declare -a unpackCmdHooks=('_defaultUnpack' ) +SIZE='size' +export SIZE +propagatedBuildInputs='' +export propagatedBuildInputs +buildPhase='{ echo "------------------------------------------------------------"; + echo " WARNING: the existence of this path is not guaranteed."; + echo " It is an internal implementation detail for pkgs.mkShell."; + echo "------------------------------------------------------------"; + echo; + # Record all build inputs as runtime dependencies + export; +} >> "$out" +' +export buildPhase +builder='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' +export builder +declare -a envBuildBuildHooks=('addPythonPath' 'sysconfigdataHook' ) +LD='ld' +export LD +IFS=' +' +_substituteStream_has_warned_replace_deprecation='false' +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +defaultNativeBuildInputs='/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2 /nix/store/gz3rknshr1ywis4mjaqrgj3z2shp3n3v-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' +HOSTTYPE='x86_64' +declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +DEVENV_TASK_FILE='/nix/store/c2yi54kd0hnlqgm9s5vrw12hm7kar3rl-tasks.json' +export DEVENV_TASK_FILE +declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +nativeBuildInputs='/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13 /nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13 /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16 /nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev /nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2' +export nativeBuildInputs +doCheck='' +export doCheck +nixVomitLog () +{ + + _nixLogWithLevel 7 "$*" +} +updateSourceDateEpoch () +{ + + local path="$1"; + [[ $path == -* ]] && path="./$path"; + local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); + local time="${res[0]//\.[0-9]*/}"; + local newestFile="${res[1]}"; + if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then + echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; + export SOURCE_DATE_EPOCH="$time"; + local now="$(date +%s)"; + if [ "$time" -gt $((now - 60)) ]; then + echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; + fi; + fi +} +substitute () +{ + + local input="$1"; + local output="$2"; + shift 2; + if [ ! -f "$input" ]; then + echo "substitute(): ERROR: file '$input' does not exist" 1>&2; + return 1; + fi; + local content; + consumeEntire content < "$input"; + if [ -e "$output" ]; then + chmod +w "$output"; + fi; + substituteStream content "file '$input'" "$@" > "$output" +} +sysconfigdataHook () +{ + + if [ "$1" = '/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13' ]; then + export _PYTHON_HOST_PLATFORM='linux-x86_64'; + export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; + fi +} +pkgConfigWrapper_addPkgConfigPath () +{ + + local role_post; + getHostRoleEnvHook; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" +} +unpackFile () +{ + + curSrc="$1"; + echo "unpacking source archive $curSrc"; + if ! runOneHook unpackCmd "$curSrc"; then + echo "do not know how to unpack source archive $curSrc"; + exit 1; + fi +} +_nixLogWithLevel () +{ + + [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; + local logLevel; + case "${1:?}" in + 0) + logLevel=ERROR + ;; + 1) + logLevel=WARN + ;; + 2) + logLevel=NOTICE + ;; + 3) + logLevel=INFO + ;; + 4) + logLevel=TALKATIVE + ;; + 5) + logLevel=CHATTY + ;; + 6) + logLevel=DEBUG + ;; + 7) + logLevel=VOMIT + ;; + *) + echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; + return 1 + ;; + esac; + local callerName="${FUNCNAME[2]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" +} +dumpVars () +{ + + if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then + local old_umask; + old_umask=$(umask); + umask 0077; + export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; + umask "$old_umask"; + fi +} +_logHook () +{ + + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + local hookKind="$1"; + local hookExpr="$2"; + shift 2; + if declare -F "$hookExpr" > /dev/null 2>&1; then + nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; + else + if type -p "$hookExpr" > /dev/null; then + nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; + else + if [[ "$hookExpr" != "_callImplicitHook"* ]]; then + local exprToOutput; + if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then + exprToOutput="$hookExpr"; + else + local hookExprLine; + while IFS= read -r hookExprLine; do + hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; + if [[ -n "$hookExprLine" ]]; then + exprToOutput+="$hookExprLine\\n "; + fi; + done <<< "$hookExpr"; + exprToOutput="${exprToOutput%%\\n }"; + fi; + nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; + fi; + fi; + fi +} +recordPropagatedDependencies () +{ + + declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); + declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); + local propagatedInputsIndex; + for propagatedInputsIndex in "${!flatVars[@]}"; + do + local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; + local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; + [[ -n "${!propagatedInputsSlice}" ]] || continue; + mkdir -p "${!outputDev}/nix-support"; + printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; + done +} +showPhaseHeader () +{ + + local phase="$1"; + echo "Running phase: $phase"; + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" +} +fixupPhase () +{ + + local output; + for output in $(getAllOutputNames); + do + if [ -e "${!output}" ]; then + chmod -R u+w,u-s,g-s "${!output}"; + fi; + done; + runHook preFixup; + local output; + for output in $(getAllOutputNames); + do + prefix="${!output}" runHook fixupOutput; + done; + recordPropagatedDependencies; + if [ -n "${setupHook:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; + fi; + if [ -n "${setupHooks:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + local hook; + for hook in ${setupHooks[@]}; + do + local content; + consumeEntire content < "$hook"; + substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; + unset -v content; + done; + unset -v hook; + fi; + if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then + mkdir -p "${!outputBin}/nix-support"; + printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; + fi; + runHook postFixup +} +getAllOutputNames () +{ + + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}"; + else + echo "$outputs"; + fi +} +buildPhase () +{ + + runHook preBuild; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom buildPhase, doing nothing"; + else + foundMakefile=1; + local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; + echoCmd 'build flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postBuild +} +getRole () +{ + + case $1 in + -1) + role_post='_FOR_BUILD' + ;; + 0) + role_post='' + ;; + 1) + role_post='_FOR_TARGET' + ;; + *) + echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +prependToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=("$@" ${nameref+"${nameref[@]}"}); + else + nameref="$* ${nameref-}"; + fi +} +getTargetRoleWrapper () +{ + + case $targetOffset in + -1) + export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 + ;; + 0) + export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 + ;; + 1) + export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 + ;; + *) + echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +_pruneLibtoolFiles () +{ + + if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then + return; + fi; + find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; +} +installPhase () +{ + + runHook preInstall; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom installPhase, doing nothing"; + runHook postInstall; + return; + else + foundMakefile=1; + fi; + if [ -n "$prefix" ]; then + mkdir -p "$prefix"; + fi; + local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; + echoCmd 'install flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + runHook postInstall +} +nixChattyLog () +{ + + _nixLogWithLevel 5 "$*" +} +_moveSbin () +{ + + if [ "${dontMoveSbin-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then + return; + fi; + echo "moving $prefix/sbin/* to $prefix/bin"; + mkdir -p $prefix/bin; + shopt -s dotglob; + for i in $prefix/sbin/*; + do + mv "$i" $prefix/bin; + done; + shopt -u dotglob; + rmdir $prefix/sbin; + ln -s bin $prefix/sbin +} +_allFlags () +{ + + export system pname name version; + while IFS='' read -r varName; do + nixTalkativeLog "@${varName}@ -> ${!varName}"; + args+=("--subst-var" "$varName"); + done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') +} +getHostRole () +{ + + getRole "$hostOffset" +} +mapOffset () +{ + + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi +} +addToSearchPathWithCustomDelimiter () +{ + + local delimiter="$1"; + local varName="$2"; + local dir="$3"; + if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then + export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; + fi +} +nixWarnLog () +{ + + _nixLogWithLevel 1 "$*" +} +_multioutDocs () +{ + + local REMOVE=REMOVE; + moveToOutput share/info "${!outputInfo}"; + moveToOutput share/doc "${!outputDoc}"; + moveToOutput share/gtk-doc "${!outputDevdoc}"; + moveToOutput share/devhelp/books "${!outputDevdoc}"; + moveToOutput share/man "${!outputMan}"; + moveToOutput share/man/man3 "${!outputDevman}" +} +_defaultUnpack () +{ + + local fn="$1"; + local destination; + if [ -d "$fn" ]; then + destination="$(stripHash "$fn")"; + if [ -e "$destination" ]; then + echo "Cannot copy $fn to $destination: destination already exists!"; + echo "Did you specify two \"srcs\" with the same \"name\"?"; + return 1; + fi; + cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; + else + case "$fn" in + *.tar.xz | *.tar.lzma | *.txz) + ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; + true ) | tar xf - --mode=+w --warning=no-timestamp + ;; + *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) + tar xf "$fn" --mode=+w --warning=no-timestamp + ;; + *) + return 1 + ;; + esac; + fi +} +getHostRoleEnvHook () +{ + + getRole "$depHostOffset" +} +distPhase () +{ + + runHook preDist; + local flagsArray=(); + concatTo flagsArray distFlags distFlagsArray distTarget=dist; + echo 'dist flags: %q' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + if [ "${dontCopyDist:-0}" != 1 ]; then + mkdir -p "$out/tarballs"; + cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; + fi; + runHook postDist +} +_multioutConfig () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then + return; + fi; + if [ -z "${shareDocName:-}" ]; then + local confScript="${configureScript:-}"; + if [ -z "$confScript" ] && [ -x ./configure ]; then + confScript=./configure; + fi; + if [ -f "$confScript" ]; then + local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; + fi; + if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then + shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; + fi; + fi; + prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; + prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal +} +nixErrorLog () +{ + + _nixLogWithLevel 0 "$*" +} +substituteAllInPlace () +{ + + local fileName="$1"; + shift; + substituteAll "$fileName" "$fileName" "$@" +} +findInputs () +{ + + local -r pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + local varVar="${pkgAccumVarVars[hostOffset + 1]}"; + local varRef="$varVar[$((targetOffset - hostOffset))]"; + local var="${!varRef}"; + unset -v varVar varRef; + local varSlice="$var[*]"; + case " ${!varSlice-} " in + *" $pkg "*) + return 0 + ;; + esac; + unset -v varSlice; + eval "$var"'+=("$pkg")'; + if ! [ -e "$pkg" ]; then + echo "build input $pkg does not exist" 1>&2; + exit 1; + fi; + function mapOffset () + { + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi + }; + local relHostOffset; + for relHostOffset in "${allPlatOffsets[@]}"; + do + local files="${propagatedDepFilesVars[relHostOffset + 1]}"; + local hostOffsetNext; + mapOffset "$relHostOffset" hostOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + local relTargetOffset; + for relTargetOffset in "${allPlatOffsets[@]}"; + do + (( "$relHostOffset" <= "$relTargetOffset" )) || continue; + local fileRef="${files}[$relTargetOffset - $relHostOffset]"; + local file="${!fileRef}"; + unset -v fileRef; + local targetOffsetNext; + mapOffset "$relTargetOffset" targetOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + [[ -f "$pkg/nix-support/$file" ]] || continue; + local pkgNext; + read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; + for pkgNext in $pkgNext; + do + findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; + done; + done; + done +} +concatStringsSep () +{ + + local sep="$1"; + local name="$2"; + local type oldifs; + if type=$(declare -p "$name" 2> /dev/null); then + local -n nameref="$name"; + case "${type#* }" in + -A*) + echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; + return 1 + ;; + -a*) + local IFS="$(printf '\036')" + ;; + *) + local IFS=" " + ;; + esac; + local ifs_separated="${nameref[*]}"; + echo -n "${ifs_separated//"$IFS"/"$sep"}"; + fi +} +isMachO () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then + return 0; + else + return 1; + fi; + fi; + fi +} +_moveToShare () +{ + + if [ -n "$__structuredAttrs" ]; then + if [ -z "${forceShare-}" ]; then + forceShare=(man doc info); + fi; + else + forceShare=(${forceShare:-man doc info}); + fi; + if [[ -z "$out" ]]; then + return; + fi; + for d in "${forceShare[@]}"; + do + if [ -d "$out/$d" ]; then + if [ -d "$out/share/$d" ]; then + echo "both $d/ and share/$d/ exist!"; + else + echo "moving $out/$d to $out/share/$d"; + mkdir -p $out/share; + mv $out/$d $out/share/; + fi; + fi; + done +} +auditTmpdir () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "checking for references to $TMPDIR/ in $dir..."; + local tmpdir elf_fifo script_fifo; + tmpdir="$(mktemp -d)"; + elf_fifo="$tmpdir/elf"; + script_fifo="$tmpdir/script"; + mkfifo "$elf_fifo" "$script_fifo"; + ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do + if isELF "$file"; then + printf '%s\0' "$file" 1>&3; + else + if isScript "$file"; then + filename=${file##*/}; + dir=${file%/*}; + if [ -e "$dir/.$filename-wrapped" ]; then + printf '%s\0' "$file" 1>&4; + fi; + fi; + fi; + done; + exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then + echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$elf_fifo" ) & local pid_elf=$!; + local pid_script; + ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if grep -q -F "$TMPDIR/" "$1"; then + echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$script_fifo" ) & local pid_script=$!; + wait "$pid_elf" || { + echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + wait "$pid_script" || { + echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + rm -r "$tmpdir" +} +concatTo () +{ + + local -; + set -o noglob; + local -n targetref="$1"; + shift; + local arg default name type; + for arg in "$@"; + do + IFS="=" read -r name default <<< "$arg"; + local -n nameref="$name"; + if [[ -z "${nameref[*]}" && -n "$default" ]]; then + targetref+=("$default"); + else + if type=$(declare -p "$name" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; + return 1 + ;; + -a*) + targetref+=("${nameref[@]}") + ;; + *) + if [[ "$name" = *"Array" ]]; then + nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; + targetref+=(${nameref+"${nameref[@]}"}); + else + targetref+=(${nameref-}); + fi + ;; + esac; + fi; + fi; + done +} +patchPhase () +{ + + runHook prePatch; + local -a patchesArray; + concatTo patchesArray patches; + local -a flagsArray; + concatTo flagsArray patchFlags=-p1; + for i in "${patchesArray[@]}"; + do + echo "applying patch $i"; + local uncompress=cat; + case "$i" in + *.gz) + uncompress="gzip -d" + ;; + *.bz2) + uncompress="bzip2 -d" + ;; + *.xz) + uncompress="xz -d" + ;; + *.lzma) + uncompress="lzma -d" + ;; + esac; + $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; + done; + runHook postPatch +} +nixLog () +{ + + [[ -z ${NIX_LOG_FD-} ]] && return 0; + local callerName="${FUNCNAME[1]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" +} +nixNoticeLog () +{ + + _nixLogWithLevel 2 "$*" +} +moveToOutput () +{ + + local patt="$1"; + local dstOut="$2"; + local output; + for output in $(getAllOutputNames); + do + if [ "${!output}" = "$dstOut" ]; then + continue; + fi; + local srcPath; + for srcPath in "${!output}"/$patt; + do + if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then + continue; + fi; + if [ "$dstOut" = REMOVE ]; then + echo "Removing $srcPath"; + rm -r "$srcPath"; + else + local dstPath="$dstOut${srcPath#${!output}}"; + echo "Moving $srcPath to $dstPath"; + if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then + rmdir "$srcPath" --ignore-fail-on-non-empty; + if [ -d "$srcPath" ]; then + mv -t "$dstPath" "$srcPath"/*; + rmdir "$srcPath"; + fi; + else + mkdir -p "$(readlink -m "$dstPath/..")"; + mv "$srcPath" "$dstPath"; + fi; + fi; + local srcParent="$(readlink -m "$srcPath/..")"; + if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then + echo "Removing empty $srcParent/ and (possibly) its parents"; + rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; + fi; + done; + done +} +noBrokenSymlinks () +{ + + local -r output="${1:?}"; + local path; + local pathParent; + local symlinkTarget; + local -i numDanglingSymlinks=0; + local -i numReflexiveSymlinks=0; + local -i numUnreadableSymlinks=0; + if [[ ! -e $output ]]; then + nixWarnLog "skipping non-existent output $output"; + return 0; + fi; + nixInfoLog "running on $output"; + while IFS= read -r -d '' path; do + pathParent="$(dirname "$path")"; + if ! symlinkTarget="$(readlink "$path")"; then + nixErrorLog "the symlink $path is unreadable"; + numUnreadableSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget == /* ]]; then + nixInfoLog "symlink $path points to absolute target $symlinkTarget"; + else + nixInfoLog "symlink $path points to relative target $symlinkTarget"; + symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; + fi; + if [[ $symlinkTarget = "$TMPDIR"/* ]]; then + nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; + numDanglingSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then + nixInfoLog "symlink $path points outside the Nix store; ignoring"; + continue; + fi; + if [[ $path == "$symlinkTarget" ]]; then + nixErrorLog "the symlink $path is reflexive"; + numReflexiveSymlinks+=1; + else + if [[ ! -e $symlinkTarget ]]; then + nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; + numDanglingSymlinks+=1; + else + nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; + fi; + fi; + done < <(find "$output" -type l -print0); + if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then + nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; + exit 1; + fi; + return 0 +} +updateAutotoolsGnuConfigScriptsPhase () +{ + + if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then + return; + fi; + for script in config.sub config.guess; + do + for f in $(find . -type f -name "$script"); + do + echo "Updating Autotools / GNU config script to a newer upstream version: $f"; + cp -f "/nix/store/s0xj50a5awma0jwgsqws61014nxzxy19-gnu-config-2024-01-01/$script" "$f"; + done; + done +} +exitHandler () +{ + + exitCode="$?"; + set +e; + if [ -n "${showBuildStats:-}" ]; then + read -r -d '' -a buildTimes < <(times); + echo "build times:"; + echo "user time for the shell ${buildTimes[0]}"; + echo "system time for the shell ${buildTimes[1]}"; + echo "user time for all child processes ${buildTimes[2]}"; + echo "system time for all child processes ${buildTimes[3]}"; + fi; + if (( "$exitCode" != 0 )); then + runHook failureHook; + if [ -n "${succeedOnFailure:-}" ]; then + echo "build failed with exit code $exitCode (ignored)"; + mkdir -p "$out/nix-support"; + printf "%s" "$exitCode" > "$out/nix-support/failed"; + exit 0; + fi; + else + runHook exitHook; + fi; + return "$exitCode" +} +appendToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=(${nameref+"${nameref[@]}"} "$@"); + else + nameref="${nameref-} $*"; + fi +} +_activatePkgs () +{ + + local hostOffset targetOffset; + local pkg; + for hostOffset in "${allPlatOffsets[@]}"; + do + local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; + for targetOffset in "${allPlatOffsets[@]}"; + do + (( hostOffset <= targetOffset )) || continue; + local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + activatePackage "$pkg" "$hostOffset" "$targetOffset"; + done; + done; + done +} +_addToTclLibPath () +{ + + local tclPkg="$1"; + if [[ -z "$tclPkg" ]]; then + return; + fi; + if [[ ! -d "$tclPkg" ]]; then + echo "can't add $tclPkg to TCLLIBPATH; that directory doesn't exist" 1>&2; + exit 1; + fi; + if [[ "$tclPkg" == *" "* ]]; then + tclPkg="{$tclPkg}"; + fi; + if [[ -z "${TCLLIBPATH-}" ]]; then + export TCLLIBPATH="$tclPkg"; + else + if [[ "$TCLLIBPATH " != *"$tclPkg "* ]]; then + export TCLLIBPATH="${TCLLIBPATH} $tclPkg"; + fi; + fi +} +bintoolsWrapper_addLDVars () +{ + + local role_post; + getHostRoleEnvHook; + if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; + fi; + if [[ -d "$1/lib" ]]; then + local -a glob=($1/lib/lib*); + if [ "${#glob[*]}" -gt 0 ]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib"; + fi; + fi +} +showPhaseFooter () +{ + + local phase="$1"; + local startTime="$2"; + local endTime="$3"; + local delta=$(( endTime - startTime )); + (( delta < 30 )) && return; + local H=$((delta/3600)); + local M=$((delta%3600/60)); + local S=$((delta%60)); + echo -n "$phase completed in "; + (( H > 0 )) && echo -n "$H hours "; + (( M > 0 )) && echo -n "$M minutes "; + echo "$S seconds" +} +substituteStream () +{ + + local var=$1; + local description=$2; + shift 2; + while (( "$#" )); do + local replace_mode="$1"; + case "$1" in + --replace) + if ! "$_substituteStream_has_warned_replace_deprecation"; then + echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; + _substituteStream_has_warned_replace_deprecation=true; + fi; + replace_mode='--replace-warn' + ;& + --replace-quiet | --replace-warn | --replace-fail) + pattern="$2"; + replacement="$3"; + shift 3; + if ! [[ "${!var}" == *"$pattern"* ]]; then + if [ "$replace_mode" == --replace-warn ]; then + printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + else + if [ "$replace_mode" == --replace-fail ]; then + printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + return 1; + fi; + fi; + fi; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var) + local varName="$2"; + shift 2; + if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; + return 1; + fi; + if [ -z ${!varName+x} ]; then + echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; + return 1; + fi; + pattern="@$varName@"; + replacement="${!varName}"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var-by) + pattern="@$2@"; + replacement="$3"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; + shift 3 + ;; + *) + echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; + return 1 + ;; + esac; + done; + printf "%s" "${!var}" +} +addToSearchPath () +{ + + addToSearchPathWithCustomDelimiter ":" "$@" +} +runOneHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook ret=1; + for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + if _eval "$hook" "$@"; then + ret=0; + break; + fi; + done; + return "$ret" +} +_moveSystemdUserUnits () +{ + + if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then + return; + fi; + if [ ! -e "${prefix:?}/lib/systemd/user" ]; then + return; + fi; + local source="$prefix/lib/systemd/user"; + local target="$prefix/share/systemd/user"; + echo "moving $source/* to $target"; + mkdir -p "$target"; + ( shopt -s dotglob; + for i in "$source"/*; + do + mv "$i" "$target"; + done ); + rmdir "$source"; + ln -s "$target" "$source" +} +substituteAll () +{ + + local input="$1"; + local output="$2"; + local -a args=(); + _allFlags; + substitute "$input" "$output" "${args[@]}" +} +toPythonPath () +{ + + local paths="$1"; + local result=; + for i in $paths; + do + p="$i/lib/python3.12/site-packages"; + result="${result}${result:+:}$p"; + done; + echo $result +} +consumeEntire () +{ + + if IFS='' read -r -d '' "$1"; then + echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; + return 1; + fi +} +printWords () +{ + + (( "$#" > 0 )) || return 0; + printf '%s ' "$@" +} +ccWrapper_addCVars () +{ + + local role_post; + getHostRoleEnvHook; + local found=; + if [ -d "$1/include" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; + found=1; + fi; + if [ -d "$1/Library/Frameworks" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; + found=1; + fi; + if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then + local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; + export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; + fi +} +checkPhase () +{ + + runHook preCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom checkPhase, doing nothing"; + runHook postCheck; + return; + fi; + if [[ -z "${checkTarget:-}" ]]; then + if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then + checkTarget="check"; + else + if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then + checkTarget="test"; + fi; + fi; + fi; + if [[ -z "${checkTarget:-}" ]]; then + echo "no check/test target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; + echoCmd 'check flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postCheck +} +substituteAllStream () +{ + + local -a args=(); + _allFlags; + substituteStream "$1" "$2" "${args[@]}" +} +printPhases () +{ + + definePhases; + local phase; + for phase in ${phases[*]}; + do + printf '%s\n' "$phase"; + done +} +genericBuild () +{ + + export GZIP_NO_TIMESTAMPS=1; + if [ -f "${buildCommandPath:-}" ]; then + source "$buildCommandPath"; + return; + fi; + if [ -n "${buildCommand:-}" ]; then + eval "$buildCommand"; + return; + fi; + definePhases; + for curPhase in ${phases[*]}; + do + runPhase "$curPhase"; + done +} +configurePhase () +{ + + runHook preConfigure; + : "${configureScript=}"; + if [[ -z "$configureScript" && -x ./configure ]]; then + configureScript=./configure; + fi; + if [ -z "${dontFixLibtool:-}" ]; then + export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; + local i; + find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do + echo "fixing libtool script $i"; + fixLibtool "$i"; + done; + CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); + find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; + rm -f "$CONFIGURE_MTIME_REFERENCE"; + fi; + if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then + local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; + if [ "${prefixKeyOrDefault: -1}" = " " ]; then + prependToVar configureFlags "$prefix"; + prependToVar configureFlags "${prefixKeyOrDefault::-1}"; + else + prependToVar configureFlags "$prefixKeyOrDefault$prefix"; + fi; + fi; + if [[ -f "$configureScript" ]]; then + if [ -z "${dontAddDisableDepTrack:-}" ]; then + if grep -q dependency-tracking "$configureScript"; then + prependToVar configureFlags --disable-dependency-tracking; + fi; + fi; + if [ -z "${dontDisableStatic:-}" ]; then + if grep -q enable-static "$configureScript"; then + prependToVar configureFlags --disable-static; + fi; + fi; + if [ -z "${dontPatchShebangsInConfigure:-}" ]; then + patchShebangs --build "$configureScript"; + fi; + fi; + if [ -n "$configureScript" ]; then + local -a flagsArray; + concatTo flagsArray configureFlags configureFlagsArray; + echoCmd 'configure flags' "${flagsArray[@]}"; + $configureScript "${flagsArray[@]}"; + unset flagsArray; + else + echo "no configure script, doing nothing"; + fi; + runHook postConfigure +} +_assignFirst () +{ + + local varName="$1"; + local _var; + local REMOVE=REMOVE; + shift; + for _var in "$@"; + do + if [ -n "${!_var-}" ]; then + eval "${varName}"="${_var}"; + return; + fi; + done; + echo; + echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; + echo " The following variables were all unset or empty:"; + echo " $*"; + if [ -z "${out:-}" ]; then + echo ' If you do not want an "out" output in your derivation, make sure to define'; + echo ' the other specific required outputs. This can be achieved by picking one'; + echo " of the above as an output."; + echo ' You do not have to remove "out" if you want to have a different default'; + echo ' output, because the first output is taken as a default.'; + echo; + fi; + return 1 +} +_doStrip () +{ + + local -ra flags=(dontStripHost dontStripTarget); + local -ra debugDirs=(stripDebugList stripDebugListTarget); + local -ra allDirs=(stripAllList stripAllListTarget); + local -ra stripCmds=(STRIP STRIP_FOR_TARGET); + local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); + stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; + stripDebugListTarget=${stripDebugListTarget[*]:-}; + stripAllList=${stripAllList[*]:-}; + stripAllListTarget=${stripAllListTarget[*]:-}; + local i; + for i in ${!stripCmds[@]}; + do + local -n flag="${flags[$i]}"; + local -n debugDirList="${debugDirs[$i]}"; + local -n allDirList="${allDirs[$i]}"; + local -n stripCmd="${stripCmds[$i]}"; + local -n ranlibCmd="${ranlibCmds[$i]}"; + if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then + continue; + fi; + stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; + stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; + done +} +_makeSymlinksRelative () +{ + + local prefixes; + prefixes=(); + for output in $(getAllOutputNames); + do + [ ! -e "${!output}" ] && continue; + prefixes+=("${!output}"); + done; + find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' + output="$1" + link="$2" + + linkTarget=$(readlink "$link") + + # only touch links that point inside the same output tree + [[ $linkTarget == "$output"/* ]] || exit 0 + + if [ ! -e "$linkTarget" ]; then + echo "the symlink $link is broken, it points to $linkTarget (which is missing)" + fi + + echo "making symlink relative: $link" + ln -snrf "$linkTarget" "$link" + ' _ +} +_addRpathPrefix () +{ + + if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then + export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; + fi +} +isELF () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [ "$magic" = 'ELF' ]; then + return 0; + else + return 1; + fi +} +nixInfoLog () +{ + + _nixLogWithLevel 3 "$*" +} +runPhase () +{ + + local curPhase="$*"; + if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then + return; + fi; + if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then + return; + fi; + if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then + return; + fi; + if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then + return; + fi; + if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then + return; + fi; + if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then + return; + fi; + showPhaseHeader "$curPhase"; + dumpVars; + local startTime endTime; + startTime=$(date +"%s"); + eval "${!curPhase:-$curPhase}"; + endTime=$(date +"%s"); + showPhaseFooter "$curPhase" "$startTime" "$endTime"; + if [ "$curPhase" = unpackPhase ]; then + [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; + cd -- "${sourceRoot:-.}"; + fi +} +_eval () +{ + + if declare -F "$1" > /dev/null 2>&1; then + "$@"; + else + eval "$1"; + fi +} +_multioutPropagateDev () +{ + + if [ "$(getAllOutputNames)" = "out" ]; then + return; + fi; + local outputFirst; + for outputFirst in $(getAllOutputNames); + do + break; + done; + local propagaterOutput="$outputDev"; + if [ -z "$propagaterOutput" ]; then + propagaterOutput="$outputFirst"; + fi; + if [ -z "${propagatedBuildOutputs+1}" ]; then + local po_dirty="$outputBin $outputInclude $outputLib"; + set +o pipefail; + propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; + set -o pipefail; + fi; + if [ -z "$propagatedBuildOutputs" ]; then + return; + fi; + mkdir -p "${!propagaterOutput}"/nix-support; + for output in $propagatedBuildOutputs; + do + echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; + done +} +activatePackage () +{ + + local pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + if [ -f "$pkg" ]; then + nixTalkativeLog "sourcing setup hook '$pkg'"; + source "$pkg"; + fi; + if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then + addToSearchPath _PATH "$pkg/bin"; + fi; + if (( hostOffset <= -1 )); then + addToSearchPath _XDG_DATA_DIRS "$pkg/share"; + fi; + if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then + addToSearchPath _HOST_PATH "$pkg/bin"; + fi; + if [[ -f "$pkg/nix-support/setup-hook" ]]; then + nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; + source "$pkg/nix-support/setup-hook"; + fi +} +compressManPages () +{ + + local dir="$1"; + if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then + return; + fi; + echo "gzipping man pages under $dir/share/man/"; + find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; + find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do + local target; + target="$(readlink -f "$f")"; + if [ -f "$target".gz ]; then + ln -sf "$target".gz "$f".gz && rm "$f"; + fi; + done +} +echoCmd () +{ + + printf "%s:" "$1"; + shift; + printf ' %q' "$@"; + echo +} +_addToEnv () +{ + + local depHostOffset depTargetOffset; + local pkg; + for depHostOffset in "${allPlatOffsets[@]}"; + do + local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; + local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; + for depTargetOffset in "${allPlatOffsets[@]}"; + do + (( depHostOffset <= depTargetOffset )) || continue; + local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; + if [[ -z "${strictDeps-}" ]]; then + local visitedPkgs=""; + for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; + do + if [[ "$visitedPkgs" = *"$pkg"* ]]; then + continue; + fi; + runHook "${!hookRef}" "$pkg"; + visitedPkgs+=" $pkg"; + done; + else + local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + runHook "${!hookRef}" "$pkg"; + done; + fi; + done; + done +} +_callImplicitHook () +{ + + local def="$1"; + local hookName="$2"; + if declare -F "$hookName" > /dev/null; then + nixTalkativeLog "calling implicit '$hookName' function hook"; + "$hookName"; + else + if type -p "$hookName" > /dev/null; then + nixTalkativeLog "sourcing implicit '$hookName' script hook"; + source "$hookName"; + else + if [ -n "${!hookName:-}" ]; then + nixTalkativeLog "evaling implicit '$hookName' string hook"; + eval "${!hookName}"; + else + return "$def"; + fi; + fi; + fi +} +_updateSourceDateEpochFromSourceRoot () +{ + + if [ -n "$sourceRoot" ]; then + updateSourceDateEpoch "$sourceRoot"; + fi +} +getTargetRole () +{ + + getRole "$targetOffset" +} +nixTalkativeLog () +{ + + _nixLogWithLevel 4 "$*" +} +installCheckPhase () +{ + + runHook preInstallCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom installCheckPhase, doing nothing"; + else + if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then + echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; + echoCmd 'installcheck flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + fi; + runHook postInstallCheck +} +addEnvHooks () +{ + + local depHostOffset="$1"; + shift; + local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; + local pkgHookVar; + for pkgHookVar in "${!pkgHookVarsSlice}"; + do + eval "${pkgHookVar}s"'+=("$@")'; + done +} +runHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook; + for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + _eval "$hook" "$@"; + done; + return 0 +} +isScript () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 2 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" =~ \#! ]]; then + return 0; + else + return 1; + fi +} +nixDebugLog () +{ + + _nixLogWithLevel 6 "$*" +} +stripHash () +{ + + local strippedName casematchOpt=0; + strippedName="$(basename -- "$1")"; + shopt -q nocasematch && casematchOpt=1; + shopt -u nocasematch; + if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then + echo "${strippedName:33}"; + else + echo "$strippedName"; + fi; + if (( casematchOpt )); then + shopt -s nocasematch; + fi +} +_multioutDevs () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then + return; + fi; + moveToOutput include "${!outputInclude}"; + moveToOutput lib/pkgconfig "${!outputDev}"; + moveToOutput share/pkgconfig "${!outputDev}"; + moveToOutput lib/cmake "${!outputDev}"; + moveToOutput share/aclocal "${!outputDev}"; + for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; + do + echo "Patching '$f' includedir to output ${!outputInclude}"; + sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; + done +} +noBrokenSymlinksInAllOutputs () +{ + + if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then + for output in $(getAllOutputNames); + do + noBrokenSymlinks "${!output}"; + done; + fi +} +definePhases () +{ + + if [ -z "${phases[*]:-}" ]; then + phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; + fi +} +fixLibtool () +{ + + local search_path; + for flag in $NIX_LDFLAGS; + do + case $flag in + -L*) + search_path+=" ${flag#-L}" + ;; + esac; + done; + sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' +} +patchShebangs () +{ + + local pathName; + local update=false; + while [[ $# -gt 0 ]]; do + case "$1" in + --host) + pathName=HOST_PATH; + shift + ;; + --build) + pathName=PATH; + shift + ;; + --update) + update=true; + shift + ;; + --) + shift; + break + ;; + -* | --*) + echo "Unknown option $1 supplied to patchShebangs" 1>&2; + return 1 + ;; + *) + break + ;; + esac; + done; + echo "patching script interpreter paths in $@"; + local f; + local oldPath; + local newPath; + local arg0; + local args; + local oldInterpreterLine; + local newInterpreterLine; + if [[ $# -eq 0 ]]; then + echo "No arguments supplied to patchShebangs" 1>&2; + return 0; + fi; + local f; + while IFS= read -r -d '' f; do + isScript "$f" || continue; + read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; + read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; + if [[ -z "${pathName:-}" ]]; then + if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then + pathName=HOST_PATH; + else + pathName=PATH; + fi; + fi; + if [[ "$oldPath" == *"/bin/env" ]]; then + if [[ $arg0 == "-S" ]]; then + arg0=${args%% *}; + [[ "$args" == *" "* ]] && args=${args#* } || args=; + newPath="$(PATH="${!pathName}" type -P "env" || true)"; + args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; + else + if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; + exit 1; + else + newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; + fi; + fi; + else + if [[ -z $oldPath ]]; then + oldPath="/bin/sh"; + fi; + newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; + args="$arg0 $args"; + fi; + newInterpreterLine="$newPath $args"; + newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; + if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then + if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then + echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; + escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; + timestamp=$(stat --printf "%y" "$f"); + tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); + sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; + local restoreReadOnly; + if [[ ! -w "$f" ]]; then + chmod +w "$f"; + restoreReadOnly=true; + fi; + cat "$tmpFile" > "$f"; + rm "$tmpFile"; + if [[ -n "${restoreReadOnly:-}" ]]; then + chmod -w "$f"; + fi; + touch --date "$timestamp" "$f"; + fi; + fi; + done < <(find "$@" -type f -perm -0100 -print0) +} +_overrideFirst () +{ + + if [ -z "${!1-}" ]; then + _assignFirst "$@"; + fi +} +printLines () +{ + + (( "$#" > 0 )) || return 0; + printf '%s\n' "$@" +} +substituteInPlace () +{ + + local -a fileNames=(); + for arg in "$@"; + do + if [[ "$arg" = "--"* ]]; then + break; + fi; + fileNames+=("$arg"); + shift; + done; + if ! [[ "${#fileNames[@]}" -gt 0 ]]; then + echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; + return 1; + fi; + for file in "${fileNames[@]}"; + do + substitute "$file" "$file" "$@"; + done +} +patchELF () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "shrinking RPATHs of ELF executables and libraries in $dir"; + local i; + while IFS= read -r -d '' i; do + if [[ "$i" =~ .build-id ]]; then + continue; + fi; + if ! isELF "$i"; then + continue; + fi; + echo "shrinking $i"; + patchelf --shrink-rpath "$i" || true; + done < <(find "$dir" -type f -print0) +} +getTargetRoleEnvHook () +{ + + getRole "$depTargetOffset" +} +unpackPhase () +{ + + runHook preUnpack; + if [ -z "${srcs:-}" ]; then + if [ -z "${src:-}" ]; then + echo 'variable $src or $srcs should point to the source'; + exit 1; + fi; + srcs="$src"; + fi; + local -a srcsArray; + concatTo srcsArray srcs; + local dirsBefore=""; + for i in *; + do + if [ -d "$i" ]; then + dirsBefore="$dirsBefore $i "; + fi; + done; + for i in "${srcsArray[@]}"; + do + unpackFile "$i"; + done; + : "${sourceRoot=}"; + if [ -n "${setSourceRoot:-}" ]; then + runOneHook setSourceRoot; + else + if [ -z "$sourceRoot" ]; then + for i in *; + do + if [ -d "$i" ]; then + case $dirsBefore in + *\ $i\ *) + + ;; + *) + if [ -n "$sourceRoot" ]; then + echo "unpacker produced multiple directories"; + exit 1; + fi; + sourceRoot="$i" + ;; + esac; + fi; + done; + fi; + fi; + if [ -z "$sourceRoot" ]; then + echo "unpacker appears to have produced no directories"; + exit 1; + fi; + echo "source root is $sourceRoot"; + if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then + chmod -R u+w -- "$sourceRoot"; + fi; + runHook postUnpack +} +patchShebangsAuto () +{ + + if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then + if [[ "$output" != out && "$output" = "$outputDev" ]]; then + patchShebangs --build "$prefix"; + else + patchShebangs --host "$prefix"; + fi; + fi +} +stripDirs () +{ + + local cmd="$1"; + local ranlibCmd="$2"; + local paths="$3"; + local stripFlags="$4"; + local excludeFlags=(); + local pathsNew=; + [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; + [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; + local pattern; + if [ -n "${stripExclude:-}" ]; then + for pattern in "${stripExclude[@]}"; + do + excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); + done; + fi; + local p; + for p in ${paths}; + do + if [ -e "$prefix/$p" ]; then + pathsNew="${pathsNew} $prefix/$p"; + fi; + done; + paths=${pathsNew}; + if [ -n "${paths}" ]; then + echo "stripping (with command $cmd and flags $stripFlags) in $paths"; + local striperr; + striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; + find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; + [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); + rm "$striperr"; + find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; + fi +} +addPythonPath () +{ + + addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.12/site-packages +} +_moveLib64 () +{ + + if [ "${dontMoveLib64-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then + return; + fi; + echo "moving $prefix/lib64/* to $prefix/lib"; + mkdir -p $prefix/lib; + shopt -s dotglob; + for i in $prefix/lib64/*; + do + mv --no-clobber "$i" $prefix/lib; + done; + shopt -u dotglob; + rmdir $prefix/lib64; + ln -s lib $prefix/lib64 +} +PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" +XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" + +eval "${shellHook:-}" +shopt -s expand_aliases + +exec /tmp/devenv-envrfkSEO/script \ No newline at end of file diff --git a/.devenv/shell-cea9d893b2194fc0.sh b/.devenv/shell-cea9d893b2194fc0.sh new file mode 100755 index 00000000..26052a64 --- /dev/null +++ b/.devenv/shell-cea9d893b2194fc0.sh @@ -0,0 +1,2346 @@ +if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then + source $HOME/.bashrc; +fi + +shopt -u expand_aliases +PATH=${PATH:-} +nix_saved_PATH="$PATH" +XDG_DATA_DIRS=${XDG_DATA_DIRS:-} +nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" +PKG_CONFIG='pkg-config' +export PKG_CONFIG +prefix='/nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env' +outputs='out' +export outputs +LD_LIBRARY_PATH='/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib:/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib:/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib:/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib:/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib:/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib:/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib:/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib' +export LD_LIBRARY_PATH +outputBin='out' +doInstallCheck='' +export doInstallCheck +outputDevman='out' +depsTargetTarget='' +export depsTargetTarget +SOURCE_DATE_EPOCH='315532800' +export SOURCE_DATE_EPOCH +DEVENV_ROOT='/home/thinky/Projects/RayTracing' +export DEVENV_ROOT +STRINGS='strings' +export STRINGS +DEVENV_DOTFILE='/home/thinky/Projects/RayTracing/.devenv' +export DEVENV_DOTFILE +pkg='/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' +propagatedBuildInputs='' +export propagatedBuildInputs +outputInclude='out' +PYTHONPATH='/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib/python3.12/site-packages:/nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13/lib/python3.12/site-packages' +export PYTHONPATH +declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) +declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) +DEVENV_RUNTIME='/run/user/1000/devenv-db47dbe' +export DEVENV_RUNTIME +PYTHONHASHSEED='0' +export PYTHONHASHSEED +CC='gcc' +export CC +preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' +PKG_CONFIG_PATH='/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/lib/pkgconfig:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib/pkgconfig:/nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/lib/pkgconfig:/nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/lib/pkgconfig:/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/share/pkgconfig:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/lib/pkgconfig:/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/share/pkgconfig:/nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/lib/pkgconfig:/nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/lib/pkgconfig:/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/lib/pkgconfig:/nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/lib/pkgconfig:/nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/lib/pkgconfig:/nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/lib/pkgconfig:/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib/pkgconfig:/nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/lib/pkgconfig:/nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/lib/pkgconfig:/nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/lib/pkgconfig:/nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/lib/pkgconfig:/nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/lib/pkgconfig' +export PKG_CONFIG_PATH +NIX_BUILD_CORES='4' +export NIX_BUILD_CORES +declare -a envBuildHostHooks=('addPythonPath' 'sysconfigdataHook' ) +PATH='/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9/bin:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0/bin:/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/bin:/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin/bin:/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/bin:/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/bin:/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2/bin:/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2/bin:/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0/bin:/nix/store/sca0pf46jmxva40qahkcwys5c1lvk6n2-gcc-15.2.0/bin:/nix/store/2c48s343k15i0cmwb9cp1vi6randmzcw-glibc-2.42-51-bin/bin:/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44/bin:/nix/store/9nmzd62x45ayp4vmswvn6z45h6bzrsla-binutils-2.44/bin:/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0/bin:/nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12/bin:/nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9/bin:/nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12/bin:/nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2/bin:/nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35/bin:/nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1/bin:/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin:/nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8/bin:/nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin/bin:/nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45/bin' +export PATH +NIX_BINTOOLS='/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44' +export NIX_BINTOOLS +OSTYPE='linux-gnu' +SHELL='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' +export SHELL +XDG_DATA_DIRS='/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9/share:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/share:/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/share:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/share:/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/share:/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/share:/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0/share:/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/share:/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin/share:/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/share:/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/share:/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/share:/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/share:/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/share:/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2/share:/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2/share' +export XDG_DATA_DIRS +strictDeps='' +export strictDeps +outputInfo='out' +DETERMINISTIC_BUILD='1' +export DETERMINISTIC_BUILD +NIX_LDFLAGS='-rpath /nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env/lib -L/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib -L/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib -L/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8/lib -L/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib/lib -L/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55/lib -L/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/lib -L/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/lib -L/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib -L/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib -L/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/lib -L/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib -L/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib -L/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib -L/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib -L/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/lib -L/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib -L/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib -L/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib -L/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib -L/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib -L/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8/lib -L/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib/lib -L/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55/lib -L/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/lib -L/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/lib -L/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib -L/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib -L/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/lib -L/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib -L/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib -L/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib -L/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib -L/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/lib -L/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib -L/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib -L/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib' +export NIX_LDFLAGS +dontAddDisableDepTrack='1' +export dontAddDisableDepTrack +LINENO='79' +DEVENV_STATE='/home/thinky/Projects/RayTracing/.devenv/state' +export DEVENV_STATE +NIX_CFLAGS_COMPILE=' -frandom-seed=q5rbqaawx4 -isystem /nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/include -isystem /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/include -isystem /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/include -isystem /nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/include -isystem /nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/include -isystem /nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/include -isystem /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/include -isystem /nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/include -isystem /nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/include -isystem /nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/include -isystem /nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/include -isystem /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/include -isystem /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/include -isystem /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/include -isystem /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/include -isystem /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/include -isystem /nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/include -isystem /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/include -isystem /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/include -isystem /nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/include -isystem /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/include -isystem /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/include -isystem /nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/include -isystem /nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/include -isystem /nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/include -isystem /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/include -isystem /nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/include -isystem /nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/include -isystem /nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/include -isystem /nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/include -isystem /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/include -isystem /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/include -isystem /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/include -isystem /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/include -isystem /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/include -isystem /nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/include -isystem /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/include -isystem /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/include' +export NIX_CFLAGS_COMPILE +OBJCOPY='objcopy' +export OBJCOPY +READELF='readelf' +export READELF +declare -a pkgsHostHost=() +declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +OPTERR='1' +depsBuildBuild='' +export depsBuildBuild +configureFlags='' +export configureFlags +TCLLIBPATH='/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib/tk8.6' +export TCLLIBPATH +OLDPWD='' +export OLDPWD +DEVENV_PROFILE='/nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile' +export DEVENV_PROFILE +cmakeFlags='' +export cmakeFlags +depsHostHost='' +export depsHostHost +system='x86_64-linux' +export system +defaultBuildInputs='' +out='/nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env' +export out +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +__structuredAttrs='' +export __structuredAttrs +outputDevdoc='REMOVE' +CONFIG_SHELL='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' +export CONFIG_SHELL +NIX_ENFORCE_NO_NATIVE='1' +export NIX_ENFORCE_NO_NATIVE +mesonFlags='' +export mesonFlags +outputMan='out' +HOSTTYPE='x86_64' +doCheck='' +export doCheck +shell='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' +export shell +nativeBuildInputs='/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13 /nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13 /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16 /nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev /nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2' +export nativeBuildInputs +IFS=' +' +depsHostHostPropagated='' +export depsHostHostPropagated +declare -a pkgsHostTarget=() +declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) +MACHTYPE='x86_64-pc-linux-gnu' +BASH='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' +PS4='+ ' +_PYTHON_HOST_PLATFORM='linux-x86_64' +export _PYTHON_HOST_PLATFORM +declare -a pkgsTargetTarget=() +propagatedNativeBuildInputs='' +export propagatedNativeBuildInputs +declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +CXX='g++' +export CXX +stdenv='/nix/store/zkiy4zv8wz3v95bj6fdmkqwql8x1vnhb-stdenv-linux' +export stdenv +hardeningDisable='' +export hardeningDisable +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +DEVENV_TASK_FILE='/nix/store/c2yi54kd0hnlqgm9s5vrw12hm7kar3rl-tasks.json' +export DEVENV_TASK_FILE +TK_LIBRARY='/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib/tk8.6.16' +export TK_LIBRARY +AS='as' +export AS +declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) +declare -a envBuildBuildHooks=('addPythonPath' 'sysconfigdataHook' ) +outputLib='out' +NIX_STORE='/nix/store' +export NIX_STORE +HOST_PATH='/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0/bin:/nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12/bin:/nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9/bin:/nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12/bin:/nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2/bin:/nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35/bin:/nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1/bin:/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin:/nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8/bin:/nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin/bin:/nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45/bin' +export HOST_PATH +STRIP='strip' +export STRIP +defaultNativeBuildInputs='/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2 /nix/store/gz3rknshr1ywis4mjaqrgj3z2shp3n3v-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' +PIP_DISABLE_PIP_VERSION_CHECK='1' +export PIP_DISABLE_PIP_VERSION_CHECK +NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningextensive libcxxhardeningfast pic relro stackclashprotection stackprotector strictoverflow zerocallusedregs' +export NIX_HARDENING_ENABLE +buildPhase='{ echo "------------------------------------------------------------"; + echo " WARNING: the existence of this path is not guaranteed."; + echo " It is an internal implementation detail for pkgs.mkShell."; + echo "------------------------------------------------------------"; + echo; + # Record all build inputs as runtime dependencies + export; +} >> "$out" +' +export buildPhase +depsBuildTargetPropagated='' +export depsBuildTargetPropagated +initialPath='/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10 /nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0 /nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12 /nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9 /nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12 /nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2 /nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35 /nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14 /nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin /nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1 /nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9 /nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8 /nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin /nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45' +RANLIB='ranlib' +export RANLIB +SIZE='size' +export SIZE +preferLocalBuild='1' +export preferLocalBuild +LD='ld' +export LD +declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) +name='devenv-shell-env' +export name +declare -a envTargetTargetHooks=() +declare -a unpackCmdHooks=('_defaultUnpack' ) +declare -a pkgsBuildHost=('/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev' '/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9' '/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13' '/nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13' '/nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev' '/nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev' '/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1' '/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev' '/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev' '/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1' '/nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev' '/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin' '/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8' '/nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev' '/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib' '/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0' '/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev' '/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55' '/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3' '/nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev' '/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin' '/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib' '/nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev' '/nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev' '/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12' '/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12' '/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9' '/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16' '/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16' '/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib' '/nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev' '/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0' '/nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev' '/nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev' '/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12' '/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7' '/nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev' '/nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev' '/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2' '/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6' '/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2' '/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2' '/nix/store/gz3rknshr1ywis4mjaqrgj3z2shp3n3v-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' '/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44' ) +phases='buildPhase' +export phases +depsBuildBuildPropagated='' +export depsBuildBuildPropagated +OBJDUMP='objdump' +export OBJDUMP +declare -a pkgsBuildBuild=() +_PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu' +export _PYTHON_SYSCONFIGDATA_NAME +NIX_NO_SELF_RPATH='1' +shellHook=' +export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" + +# Override temp directories that stdenv set to NIX_BUILD_TOP. +# Only reset those that still point to the Nix build dir; leave +# any user/CI-supplied value intact so child processes (e.g. +# `devenv processes wait`) compute the same runtime directory. +for var in TMP TMPDIR TEMP TEMPDIR; do + if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then + export "$var"=/tmp + fi +done +if [ -n "${NIX_BUILD_TOP-}" ]; then + unset NIX_BUILD_TOP +fi + +# set path to locales on non-NixOS Linux hosts +if [ -z "${LOCALE_ARCHIVE-}" ]; then + export LOCALE_ARCHIVE=/nix/store/q6y3frkqaq8v7va2rmgaq6jvhy1vb9q3-glibc-locales-2.42-51/lib/locale/locale-archive +fi + + +# direnv helper +if [ ! type -p direnv &>/dev/null && -f .envrc ]; then + echo "An .envrc file was detected, but the direnv command is not installed." + echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html" +fi + +mkdir -p "$DEVENV_STATE" +if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile" ] +then + ln -snf /nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile "$DEVENV_DOTFILE/profile" +fi +unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps + +mkdir -p /run/user/1000/devenv-db47dbe +ln -snf /run/user/1000/devenv-db47dbe /home/thinky/Projects/RayTracing/.devenv/run + + +echo "✨ devenv 2.0.3 is out of date. Please update to 2.0.6: https://devenv.sh/getting-started/#installation" >&2 + + +# Check whether the direnv integration is out of date. +{ + if [[ ":${DIRENV_ACTIVE-}:" == *":/home/thinky/Projects/RayTracing:"* ]]; then + if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then + if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then + direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "") + + echo "✨ The direnv integration in your .envrc is out of date." + echo "" + echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. " + if [[ -n "$direnv_line" ]]; then + echo "To enable this feature, replace the following line in your .envrc:" + echo "" + echo " $direnv_line" + echo "" + echo "with:" + echo "" + echo " eval \"\$(devenv direnvrc)\"" + else + echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:" + echo "" + echo " eval \"$(devenv direnvrc)\"" + fi + echo "" + echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/." + echo "" + echo "To disable this message:" + echo "" + echo " Add the following environment to your .envrc before \`use devenv\`:" + echo "" + echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1" + echo "" + echo " Or set the following option in your devenv configuration:" + echo "" + echo " devenv.warnOnNewVersion = false;" + echo "" + fi + fi + fi +} >&2 + +echo "RayTracing devenv" +echo "Python $(/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin/python --version | cut -d'\'' '\'' -f2)" + +if [ ! -x "$VENV_DIR/bin/python" ]; then + /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin/python -m venv --system-site-packages "$VENV_DIR" +fi + +. "$VENV_DIR/bin/activate" + +python -m ensurepip --upgrade >/dev/null 2>&1 || true +python -m pip install --upgrade pip setuptools wheel build >/dev/null +python -m pip install --upgrade -e ".[gui]" pillow basedpyright ruff >/dev/null + +export PATH="$PWD/$VENV_DIR/bin:$PATH" + +' +export shellHook +depsBuildTarget='' +export depsBuildTarget +IN_NIX_SHELL='impure' +export IN_NIX_SHELL +TCL_LIBRARY='/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib/tcl8.6.16' +export TCL_LIBRARY +outputDoc='out' +outputDev='out' +declare -a pkgsBuildTarget=() +NM='nm' +export NM +declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) +DEVENV_TASKS='' +export DEVENV_TASKS +VENV_DIR='.devenv/state/venv' +export VENV_DIR +depsTargetTargetPropagated='' +export depsTargetTargetPropagated +declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' ) +AR='ar' +export AR +declare -a preConfigureHooks=('_multioutConfig' ) +declare -a envBuildTargetHooks=('addPythonPath' 'sysconfigdataHook' ) +patches='' +export patches +NIX_CC='/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' +export NIX_CC +_substituteStream_has_warned_replace_deprecation='false' +buildInputs='' +export buildInputs +builder='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' +export builder +PYTHONNOUSERSITE='1' +export PYTHONNOUSERSITE +distPhase () +{ + + runHook preDist; + local flagsArray=(); + concatTo flagsArray distFlags distFlagsArray distTarget=dist; + echo 'dist flags: %q' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + if [ "${dontCopyDist:-0}" != 1 ]; then + mkdir -p "$out/tarballs"; + cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; + fi; + runHook postDist +} +nixLog () +{ + + [[ -z ${NIX_LOG_FD-} ]] && return 0; + local callerName="${FUNCNAME[1]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" +} +patchShebangsAuto () +{ + + if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then + if [[ "$output" != out && "$output" = "$outputDev" ]]; then + patchShebangs --build "$prefix"; + else + patchShebangs --host "$prefix"; + fi; + fi +} +addEnvHooks () +{ + + local depHostOffset="$1"; + shift; + local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; + local pkgHookVar; + for pkgHookVar in "${!pkgHookVarsSlice}"; + do + eval "${pkgHookVar}s"'+=("$@")'; + done +} +patchELF () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "shrinking RPATHs of ELF executables and libraries in $dir"; + local i; + while IFS= read -r -d '' i; do + if [[ "$i" =~ .build-id ]]; then + continue; + fi; + if ! isELF "$i"; then + continue; + fi; + echo "shrinking $i"; + patchelf --shrink-rpath "$i" || true; + done < <(find "$dir" -type f -print0) +} +substitute () +{ + + local input="$1"; + local output="$2"; + shift 2; + if [ ! -f "$input" ]; then + echo "substitute(): ERROR: file '$input' does not exist" 1>&2; + return 1; + fi; + local content; + consumeEntire content < "$input"; + if [ -e "$output" ]; then + chmod +w "$output"; + fi; + substituteStream content "file '$input'" "$@" > "$output" +} +echoCmd () +{ + + printf "%s:" "$1"; + shift; + printf ' %q' "$@"; + echo +} +noBrokenSymlinks () +{ + + local -r output="${1:?}"; + local path; + local pathParent; + local symlinkTarget; + local -i numDanglingSymlinks=0; + local -i numReflexiveSymlinks=0; + local -i numUnreadableSymlinks=0; + if [[ ! -e $output ]]; then + nixWarnLog "skipping non-existent output $output"; + return 0; + fi; + nixInfoLog "running on $output"; + while IFS= read -r -d '' path; do + pathParent="$(dirname "$path")"; + if ! symlinkTarget="$(readlink "$path")"; then + nixErrorLog "the symlink $path is unreadable"; + numUnreadableSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget == /* ]]; then + nixInfoLog "symlink $path points to absolute target $symlinkTarget"; + else + nixInfoLog "symlink $path points to relative target $symlinkTarget"; + symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; + fi; + if [[ $symlinkTarget = "$TMPDIR"/* ]]; then + nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; + numDanglingSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then + nixInfoLog "symlink $path points outside the Nix store; ignoring"; + continue; + fi; + if [[ $path == "$symlinkTarget" ]]; then + nixErrorLog "the symlink $path is reflexive"; + numReflexiveSymlinks+=1; + else + if [[ ! -e $symlinkTarget ]]; then + nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; + numDanglingSymlinks+=1; + else + nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; + fi; + fi; + done < <(find "$output" -type l -print0); + if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then + nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; + exit 1; + fi; + return 0 +} +substituteInPlace () +{ + + local -a fileNames=(); + for arg in "$@"; + do + if [[ "$arg" = "--"* ]]; then + break; + fi; + fileNames+=("$arg"); + shift; + done; + if ! [[ "${#fileNames[@]}" -gt 0 ]]; then + echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; + return 1; + fi; + for file in "${fileNames[@]}"; + do + substitute "$file" "$file" "$@"; + done +} +appendToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=(${nameref+"${nameref[@]}"} "$@"); + else + nameref="${nameref-} $*"; + fi +} +mapOffset () +{ + + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi +} +getTargetRoleWrapper () +{ + + case $targetOffset in + -1) + export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 + ;; + 0) + export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 + ;; + 1) + export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 + ;; + *) + echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +_callImplicitHook () +{ + + local def="$1"; + local hookName="$2"; + if declare -F "$hookName" > /dev/null; then + nixTalkativeLog "calling implicit '$hookName' function hook"; + "$hookName"; + else + if type -p "$hookName" > /dev/null; then + nixTalkativeLog "sourcing implicit '$hookName' script hook"; + source "$hookName"; + else + if [ -n "${!hookName:-}" ]; then + nixTalkativeLog "evaling implicit '$hookName' string hook"; + eval "${!hookName}"; + else + return "$def"; + fi; + fi; + fi +} +consumeEntire () +{ + + if IFS='' read -r -d '' "$1"; then + echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; + return 1; + fi +} +exitHandler () +{ + + exitCode="$?"; + set +e; + if [ -n "${showBuildStats:-}" ]; then + read -r -d '' -a buildTimes < <(times); + echo "build times:"; + echo "user time for the shell ${buildTimes[0]}"; + echo "system time for the shell ${buildTimes[1]}"; + echo "user time for all child processes ${buildTimes[2]}"; + echo "system time for all child processes ${buildTimes[3]}"; + fi; + if (( "$exitCode" != 0 )); then + runHook failureHook; + if [ -n "${succeedOnFailure:-}" ]; then + echo "build failed with exit code $exitCode (ignored)"; + mkdir -p "$out/nix-support"; + printf "%s" "$exitCode" > "$out/nix-support/failed"; + exit 0; + fi; + else + runHook exitHook; + fi; + return "$exitCode" +} +noBrokenSymlinksInAllOutputs () +{ + + if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then + for output in $(getAllOutputNames); + do + noBrokenSymlinks "${!output}"; + done; + fi +} +isELF () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [ "$magic" = 'ELF' ]; then + return 0; + else + return 1; + fi +} +addToSearchPath () +{ + + addToSearchPathWithCustomDelimiter ":" "$@" +} +_allFlags () +{ + + export system pname name version; + while IFS='' read -r varName; do + nixTalkativeLog "@${varName}@ -> ${!varName}"; + args+=("--subst-var" "$varName"); + done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') +} +_eval () +{ + + if declare -F "$1" > /dev/null 2>&1; then + "$@"; + else + eval "$1"; + fi +} +runOneHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook ret=1; + for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + if _eval "$hook" "$@"; then + ret=0; + break; + fi; + done; + return "$ret" +} +addToSearchPathWithCustomDelimiter () +{ + + local delimiter="$1"; + local varName="$2"; + local dir="$3"; + if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then + export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; + fi +} +findInputs () +{ + + local -r pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + local varVar="${pkgAccumVarVars[hostOffset + 1]}"; + local varRef="$varVar[$((targetOffset - hostOffset))]"; + local var="${!varRef}"; + unset -v varVar varRef; + local varSlice="$var[*]"; + case " ${!varSlice-} " in + *" $pkg "*) + return 0 + ;; + esac; + unset -v varSlice; + eval "$var"'+=("$pkg")'; + if ! [ -e "$pkg" ]; then + echo "build input $pkg does not exist" 1>&2; + exit 1; + fi; + function mapOffset () + { + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi + }; + local relHostOffset; + for relHostOffset in "${allPlatOffsets[@]}"; + do + local files="${propagatedDepFilesVars[relHostOffset + 1]}"; + local hostOffsetNext; + mapOffset "$relHostOffset" hostOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + local relTargetOffset; + for relTargetOffset in "${allPlatOffsets[@]}"; + do + (( "$relHostOffset" <= "$relTargetOffset" )) || continue; + local fileRef="${files}[$relTargetOffset - $relHostOffset]"; + local file="${!fileRef}"; + unset -v fileRef; + local targetOffsetNext; + mapOffset "$relTargetOffset" targetOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + [[ -f "$pkg/nix-support/$file" ]] || continue; + local pkgNext; + read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; + for pkgNext in $pkgNext; + do + findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; + done; + done; + done +} +runHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook; + for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + _eval "$hook" "$@"; + done; + return 0 +} +nixInfoLog () +{ + + _nixLogWithLevel 3 "$*" +} +addPythonPath () +{ + + addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.12/site-packages +} +activatePackage () +{ + + local pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + if [ -f "$pkg" ]; then + nixTalkativeLog "sourcing setup hook '$pkg'"; + source "$pkg"; + fi; + if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then + addToSearchPath _PATH "$pkg/bin"; + fi; + if (( hostOffset <= -1 )); then + addToSearchPath _XDG_DATA_DIRS "$pkg/share"; + fi; + if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then + addToSearchPath _HOST_PATH "$pkg/bin"; + fi; + if [[ -f "$pkg/nix-support/setup-hook" ]]; then + nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; + source "$pkg/nix-support/setup-hook"; + fi +} +_nixLogWithLevel () +{ + + [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; + local logLevel; + case "${1:?}" in + 0) + logLevel=ERROR + ;; + 1) + logLevel=WARN + ;; + 2) + logLevel=NOTICE + ;; + 3) + logLevel=INFO + ;; + 4) + logLevel=TALKATIVE + ;; + 5) + logLevel=CHATTY + ;; + 6) + logLevel=DEBUG + ;; + 7) + logLevel=VOMIT + ;; + *) + echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; + return 1 + ;; + esac; + local callerName="${FUNCNAME[2]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" +} +installCheckPhase () +{ + + runHook preInstallCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom installCheckPhase, doing nothing"; + else + if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then + echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; + echoCmd 'installcheck flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + fi; + runHook postInstallCheck +} +fixupPhase () +{ + + local output; + for output in $(getAllOutputNames); + do + if [ -e "${!output}" ]; then + chmod -R u+w,u-s,g-s "${!output}"; + fi; + done; + runHook preFixup; + local output; + for output in $(getAllOutputNames); + do + prefix="${!output}" runHook fixupOutput; + done; + recordPropagatedDependencies; + if [ -n "${setupHook:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; + fi; + if [ -n "${setupHooks:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + local hook; + for hook in ${setupHooks[@]}; + do + local content; + consumeEntire content < "$hook"; + substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; + unset -v content; + done; + unset -v hook; + fi; + if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then + mkdir -p "${!outputBin}/nix-support"; + printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; + fi; + runHook postFixup +} +_multioutDocs () +{ + + local REMOVE=REMOVE; + moveToOutput share/info "${!outputInfo}"; + moveToOutput share/doc "${!outputDoc}"; + moveToOutput share/gtk-doc "${!outputDevdoc}"; + moveToOutput share/devhelp/books "${!outputDevdoc}"; + moveToOutput share/man "${!outputMan}"; + moveToOutput share/man/man3 "${!outputDevman}" +} +isScript () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 2 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" =~ \#! ]]; then + return 0; + else + return 1; + fi +} +_makeSymlinksRelative () +{ + + local prefixes; + prefixes=(); + for output in $(getAllOutputNames); + do + [ ! -e "${!output}" ] && continue; + prefixes+=("${!output}"); + done; + find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' + output="$1" + link="$2" + + linkTarget=$(readlink "$link") + + # only touch links that point inside the same output tree + [[ $linkTarget == "$output"/* ]] || exit 0 + + if [ ! -e "$linkTarget" ]; then + echo "the symlink $link is broken, it points to $linkTarget (which is missing)" + fi + + echo "making symlink relative: $link" + ln -snrf "$linkTarget" "$link" + ' _ +} +_multioutDevs () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then + return; + fi; + moveToOutput include "${!outputInclude}"; + moveToOutput lib/pkgconfig "${!outputDev}"; + moveToOutput share/pkgconfig "${!outputDev}"; + moveToOutput lib/cmake "${!outputDev}"; + moveToOutput share/aclocal "${!outputDev}"; + for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; + do + echo "Patching '$f' includedir to output ${!outputInclude}"; + sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; + done +} +showPhaseHeader () +{ + + local phase="$1"; + echo "Running phase: $phase"; + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" +} +sysconfigdataHook () +{ + + if [ "$1" = '/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13' ]; then + export _PYTHON_HOST_PLATFORM='linux-x86_64'; + export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; + fi +} +_addToTclLibPath () +{ + + local tclPkg="$1"; + if [[ -z "$tclPkg" ]]; then + return; + fi; + if [[ ! -d "$tclPkg" ]]; then + echo "can't add $tclPkg to TCLLIBPATH; that directory doesn't exist" 1>&2; + exit 1; + fi; + if [[ "$tclPkg" == *" "* ]]; then + tclPkg="{$tclPkg}"; + fi; + if [[ -z "${TCLLIBPATH-}" ]]; then + export TCLLIBPATH="$tclPkg"; + else + if [[ "$TCLLIBPATH " != *"$tclPkg "* ]]; then + export TCLLIBPATH="${TCLLIBPATH} $tclPkg"; + fi; + fi +} +configurePhase () +{ + + runHook preConfigure; + : "${configureScript=}"; + if [[ -z "$configureScript" && -x ./configure ]]; then + configureScript=./configure; + fi; + if [ -z "${dontFixLibtool:-}" ]; then + export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; + local i; + find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do + echo "fixing libtool script $i"; + fixLibtool "$i"; + done; + CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); + find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; + rm -f "$CONFIGURE_MTIME_REFERENCE"; + fi; + if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then + local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; + if [ "${prefixKeyOrDefault: -1}" = " " ]; then + prependToVar configureFlags "$prefix"; + prependToVar configureFlags "${prefixKeyOrDefault::-1}"; + else + prependToVar configureFlags "$prefixKeyOrDefault$prefix"; + fi; + fi; + if [[ -f "$configureScript" ]]; then + if [ -z "${dontAddDisableDepTrack:-}" ]; then + if grep -q dependency-tracking "$configureScript"; then + prependToVar configureFlags --disable-dependency-tracking; + fi; + fi; + if [ -z "${dontDisableStatic:-}" ]; then + if grep -q enable-static "$configureScript"; then + prependToVar configureFlags --disable-static; + fi; + fi; + if [ -z "${dontPatchShebangsInConfigure:-}" ]; then + patchShebangs --build "$configureScript"; + fi; + fi; + if [ -n "$configureScript" ]; then + local -a flagsArray; + concatTo flagsArray configureFlags configureFlagsArray; + echoCmd 'configure flags' "${flagsArray[@]}"; + $configureScript "${flagsArray[@]}"; + unset flagsArray; + else + echo "no configure script, doing nothing"; + fi; + runHook postConfigure +} +installPhase () +{ + + runHook preInstall; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom installPhase, doing nothing"; + runHook postInstall; + return; + else + foundMakefile=1; + fi; + if [ -n "$prefix" ]; then + mkdir -p "$prefix"; + fi; + local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; + echoCmd 'install flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + runHook postInstall +} +patchPhase () +{ + + runHook prePatch; + local -a patchesArray; + concatTo patchesArray patches; + local -a flagsArray; + concatTo flagsArray patchFlags=-p1; + for i in "${patchesArray[@]}"; + do + echo "applying patch $i"; + local uncompress=cat; + case "$i" in + *.gz) + uncompress="gzip -d" + ;; + *.bz2) + uncompress="bzip2 -d" + ;; + *.xz) + uncompress="xz -d" + ;; + *.lzma) + uncompress="lzma -d" + ;; + esac; + $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; + done; + runHook postPatch +} +stripDirs () +{ + + local cmd="$1"; + local ranlibCmd="$2"; + local paths="$3"; + local stripFlags="$4"; + local excludeFlags=(); + local pathsNew=; + [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; + [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; + local pattern; + if [ -n "${stripExclude:-}" ]; then + for pattern in "${stripExclude[@]}"; + do + excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); + done; + fi; + local p; + for p in ${paths}; + do + if [ -e "$prefix/$p" ]; then + pathsNew="${pathsNew} $prefix/$p"; + fi; + done; + paths=${pathsNew}; + if [ -n "${paths}" ]; then + echo "stripping (with command $cmd and flags $stripFlags) in $paths"; + local striperr; + striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; + find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; + [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); + rm "$striperr"; + find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; + fi +} +substituteAllInPlace () +{ + + local fileName="$1"; + shift; + substituteAll "$fileName" "$fileName" "$@" +} +toPythonPath () +{ + + local paths="$1"; + local result=; + for i in $paths; + do + p="$i/lib/python3.12/site-packages"; + result="${result}${result:+:}$p"; + done; + echo $result +} +checkPhase () +{ + + runHook preCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom checkPhase, doing nothing"; + runHook postCheck; + return; + fi; + if [[ -z "${checkTarget:-}" ]]; then + if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then + checkTarget="check"; + else + if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then + checkTarget="test"; + fi; + fi; + fi; + if [[ -z "${checkTarget:-}" ]]; then + echo "no check/test target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; + echoCmd 'check flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postCheck +} +updateAutotoolsGnuConfigScriptsPhase () +{ + + if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then + return; + fi; + for script in config.sub config.guess; + do + for f in $(find . -type f -name "$script"); + do + echo "Updating Autotools / GNU config script to a newer upstream version: $f"; + cp -f "/nix/store/s0xj50a5awma0jwgsqws61014nxzxy19-gnu-config-2024-01-01/$script" "$f"; + done; + done +} +buildPhase () +{ + + runHook preBuild; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom buildPhase, doing nothing"; + else + foundMakefile=1; + local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; + echoCmd 'build flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postBuild +} +_moveToShare () +{ + + if [ -n "$__structuredAttrs" ]; then + if [ -z "${forceShare-}" ]; then + forceShare=(man doc info); + fi; + else + forceShare=(${forceShare:-man doc info}); + fi; + if [[ -z "$out" ]]; then + return; + fi; + for d in "${forceShare[@]}"; + do + if [ -d "$out/$d" ]; then + if [ -d "$out/share/$d" ]; then + echo "both $d/ and share/$d/ exist!"; + else + echo "moving $out/$d to $out/share/$d"; + mkdir -p $out/share; + mv $out/$d $out/share/; + fi; + fi; + done +} +nixNoticeLog () +{ + + _nixLogWithLevel 2 "$*" +} +getAllOutputNames () +{ + + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}"; + else + echo "$outputs"; + fi +} +getTargetRole () +{ + + getRole "$targetOffset" +} +_pruneLibtoolFiles () +{ + + if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then + return; + fi; + find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; +} +showPhaseFooter () +{ + + local phase="$1"; + local startTime="$2"; + local endTime="$3"; + local delta=$(( endTime - startTime )); + (( delta < 30 )) && return; + local H=$((delta/3600)); + local M=$((delta%3600/60)); + local S=$((delta%60)); + echo -n "$phase completed in "; + (( H > 0 )) && echo -n "$H hours "; + (( M > 0 )) && echo -n "$M minutes "; + echo "$S seconds" +} +bintoolsWrapper_addLDVars () +{ + + local role_post; + getHostRoleEnvHook; + if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; + fi; + if [[ -d "$1/lib" ]]; then + local -a glob=($1/lib/lib*); + if [ "${#glob[*]}" -gt 0 ]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib"; + fi; + fi +} +nixWarnLog () +{ + + _nixLogWithLevel 1 "$*" +} +prependToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=("$@" ${nameref+"${nameref[@]}"}); + else + nameref="$* ${nameref-}"; + fi +} +substituteAll () +{ + + local input="$1"; + local output="$2"; + local -a args=(); + _allFlags; + substitute "$input" "$output" "${args[@]}" +} +_defaultUnpack () +{ + + local fn="$1"; + local destination; + if [ -d "$fn" ]; then + destination="$(stripHash "$fn")"; + if [ -e "$destination" ]; then + echo "Cannot copy $fn to $destination: destination already exists!"; + echo "Did you specify two \"srcs\" with the same \"name\"?"; + return 1; + fi; + cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; + else + case "$fn" in + *.tar.xz | *.tar.lzma | *.txz) + ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; + true ) | tar xf - --mode=+w --warning=no-timestamp + ;; + *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) + tar xf "$fn" --mode=+w --warning=no-timestamp + ;; + *) + return 1 + ;; + esac; + fi +} +auditTmpdir () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "checking for references to $TMPDIR/ in $dir..."; + local tmpdir elf_fifo script_fifo; + tmpdir="$(mktemp -d)"; + elf_fifo="$tmpdir/elf"; + script_fifo="$tmpdir/script"; + mkfifo "$elf_fifo" "$script_fifo"; + ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do + if isELF "$file"; then + printf '%s\0' "$file" 1>&3; + else + if isScript "$file"; then + filename=${file##*/}; + dir=${file%/*}; + if [ -e "$dir/.$filename-wrapped" ]; then + printf '%s\0' "$file" 1>&4; + fi; + fi; + fi; + done; + exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then + echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$elf_fifo" ) & local pid_elf=$!; + local pid_script; + ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if grep -q -F "$TMPDIR/" "$1"; then + echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$script_fifo" ) & local pid_script=$!; + wait "$pid_elf" || { + echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + wait "$pid_script" || { + echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + rm -r "$tmpdir" +} +nixVomitLog () +{ + + _nixLogWithLevel 7 "$*" +} +unpackFile () +{ + + curSrc="$1"; + echo "unpacking source archive $curSrc"; + if ! runOneHook unpackCmd "$curSrc"; then + echo "do not know how to unpack source archive $curSrc"; + exit 1; + fi +} +_moveSystemdUserUnits () +{ + + if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then + return; + fi; + if [ ! -e "${prefix:?}/lib/systemd/user" ]; then + return; + fi; + local source="$prefix/lib/systemd/user"; + local target="$prefix/share/systemd/user"; + echo "moving $source/* to $target"; + mkdir -p "$target"; + ( shopt -s dotglob; + for i in "$source"/*; + do + mv "$i" "$target"; + done ); + rmdir "$source"; + ln -s "$target" "$source" +} +genericBuild () +{ + + export GZIP_NO_TIMESTAMPS=1; + if [ -f "${buildCommandPath:-}" ]; then + source "$buildCommandPath"; + return; + fi; + if [ -n "${buildCommand:-}" ]; then + eval "$buildCommand"; + return; + fi; + definePhases; + for curPhase in ${phases[*]}; + do + runPhase "$curPhase"; + done +} +_overrideFirst () +{ + + if [ -z "${!1-}" ]; then + _assignFirst "$@"; + fi +} +_doStrip () +{ + + local -ra flags=(dontStripHost dontStripTarget); + local -ra debugDirs=(stripDebugList stripDebugListTarget); + local -ra allDirs=(stripAllList stripAllListTarget); + local -ra stripCmds=(STRIP STRIP_FOR_TARGET); + local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); + stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; + stripDebugListTarget=${stripDebugListTarget[*]:-}; + stripAllList=${stripAllList[*]:-}; + stripAllListTarget=${stripAllListTarget[*]:-}; + local i; + for i in ${!stripCmds[@]}; + do + local -n flag="${flags[$i]}"; + local -n debugDirList="${debugDirs[$i]}"; + local -n allDirList="${allDirs[$i]}"; + local -n stripCmd="${stripCmds[$i]}"; + local -n ranlibCmd="${ranlibCmds[$i]}"; + if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then + continue; + fi; + stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; + stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; + done +} +_moveLib64 () +{ + + if [ "${dontMoveLib64-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then + return; + fi; + echo "moving $prefix/lib64/* to $prefix/lib"; + mkdir -p $prefix/lib; + shopt -s dotglob; + for i in $prefix/lib64/*; + do + mv --no-clobber "$i" $prefix/lib; + done; + shopt -u dotglob; + rmdir $prefix/lib64; + ln -s lib $prefix/lib64 +} +compressManPages () +{ + + local dir="$1"; + if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then + return; + fi; + echo "gzipping man pages under $dir/share/man/"; + find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; + find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do + local target; + target="$(readlink -f "$f")"; + if [ -f "$target".gz ]; then + ln -sf "$target".gz "$f".gz && rm "$f"; + fi; + done +} +isMachO () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then + return 0; + else + return 1; + fi; + fi; + fi +} +nixDebugLog () +{ + + _nixLogWithLevel 6 "$*" +} +_activatePkgs () +{ + + local hostOffset targetOffset; + local pkg; + for hostOffset in "${allPlatOffsets[@]}"; + do + local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; + for targetOffset in "${allPlatOffsets[@]}"; + do + (( hostOffset <= targetOffset )) || continue; + local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + activatePackage "$pkg" "$hostOffset" "$targetOffset"; + done; + done; + done +} +_assignFirst () +{ + + local varName="$1"; + local _var; + local REMOVE=REMOVE; + shift; + for _var in "$@"; + do + if [ -n "${!_var-}" ]; then + eval "${varName}"="${_var}"; + return; + fi; + done; + echo; + echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; + echo " The following variables were all unset or empty:"; + echo " $*"; + if [ -z "${out:-}" ]; then + echo ' If you do not want an "out" output in your derivation, make sure to define'; + echo ' the other specific required outputs. This can be achieved by picking one'; + echo " of the above as an output."; + echo ' You do not have to remove "out" if you want to have a different default'; + echo ' output, because the first output is taken as a default.'; + echo; + fi; + return 1 +} +nixErrorLog () +{ + + _nixLogWithLevel 0 "$*" +} +_addRpathPrefix () +{ + + if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then + export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; + fi +} +_multioutConfig () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then + return; + fi; + if [ -z "${shareDocName:-}" ]; then + local confScript="${configureScript:-}"; + if [ -z "$confScript" ] && [ -x ./configure ]; then + confScript=./configure; + fi; + if [ -f "$confScript" ]; then + local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; + fi; + if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then + shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; + fi; + fi; + prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; + prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal +} +fixLibtool () +{ + + local search_path; + for flag in $NIX_LDFLAGS; + do + case $flag in + -L*) + search_path+=" ${flag#-L}" + ;; + esac; + done; + sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' +} +dumpVars () +{ + + if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then + local old_umask; + old_umask=$(umask); + umask 0077; + export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; + umask "$old_umask"; + fi +} +printLines () +{ + + (( "$#" > 0 )) || return 0; + printf '%s\n' "$@" +} +printPhases () +{ + + definePhases; + local phase; + for phase in ${phases[*]}; + do + printf '%s\n' "$phase"; + done +} +printWords () +{ + + (( "$#" > 0 )) || return 0; + printf '%s ' "$@" +} +substituteAllStream () +{ + + local -a args=(); + _allFlags; + substituteStream "$1" "$2" "${args[@]}" +} +substituteStream () +{ + + local var=$1; + local description=$2; + shift 2; + while (( "$#" )); do + local replace_mode="$1"; + case "$1" in + --replace) + if ! "$_substituteStream_has_warned_replace_deprecation"; then + echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; + _substituteStream_has_warned_replace_deprecation=true; + fi; + replace_mode='--replace-warn' + ;& + --replace-quiet | --replace-warn | --replace-fail) + pattern="$2"; + replacement="$3"; + shift 3; + if ! [[ "${!var}" == *"$pattern"* ]]; then + if [ "$replace_mode" == --replace-warn ]; then + printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + else + if [ "$replace_mode" == --replace-fail ]; then + printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + return 1; + fi; + fi; + fi; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var) + local varName="$2"; + shift 2; + if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; + return 1; + fi; + if [ -z ${!varName+x} ]; then + echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; + return 1; + fi; + pattern="@$varName@"; + replacement="${!varName}"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var-by) + pattern="@$2@"; + replacement="$3"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; + shift 3 + ;; + *) + echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; + return 1 + ;; + esac; + done; + printf "%s" "${!var}" +} +concatStringsSep () +{ + + local sep="$1"; + local name="$2"; + local type oldifs; + if type=$(declare -p "$name" 2> /dev/null); then + local -n nameref="$name"; + case "${type#* }" in + -A*) + echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; + return 1 + ;; + -a*) + local IFS="$(printf '\036')" + ;; + *) + local IFS=" " + ;; + esac; + local ifs_separated="${nameref[*]}"; + echo -n "${ifs_separated//"$IFS"/"$sep"}"; + fi +} +nixTalkativeLog () +{ + + _nixLogWithLevel 4 "$*" +} +unpackPhase () +{ + + runHook preUnpack; + if [ -z "${srcs:-}" ]; then + if [ -z "${src:-}" ]; then + echo 'variable $src or $srcs should point to the source'; + exit 1; + fi; + srcs="$src"; + fi; + local -a srcsArray; + concatTo srcsArray srcs; + local dirsBefore=""; + for i in *; + do + if [ -d "$i" ]; then + dirsBefore="$dirsBefore $i "; + fi; + done; + for i in "${srcsArray[@]}"; + do + unpackFile "$i"; + done; + : "${sourceRoot=}"; + if [ -n "${setSourceRoot:-}" ]; then + runOneHook setSourceRoot; + else + if [ -z "$sourceRoot" ]; then + for i in *; + do + if [ -d "$i" ]; then + case $dirsBefore in + *\ $i\ *) + + ;; + *) + if [ -n "$sourceRoot" ]; then + echo "unpacker produced multiple directories"; + exit 1; + fi; + sourceRoot="$i" + ;; + esac; + fi; + done; + fi; + fi; + if [ -z "$sourceRoot" ]; then + echo "unpacker appears to have produced no directories"; + exit 1; + fi; + echo "source root is $sourceRoot"; + if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then + chmod -R u+w -- "$sourceRoot"; + fi; + runHook postUnpack +} +moveToOutput () +{ + + local patt="$1"; + local dstOut="$2"; + local output; + for output in $(getAllOutputNames); + do + if [ "${!output}" = "$dstOut" ]; then + continue; + fi; + local srcPath; + for srcPath in "${!output}"/$patt; + do + if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then + continue; + fi; + if [ "$dstOut" = REMOVE ]; then + echo "Removing $srcPath"; + rm -r "$srcPath"; + else + local dstPath="$dstOut${srcPath#${!output}}"; + echo "Moving $srcPath to $dstPath"; + if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then + rmdir "$srcPath" --ignore-fail-on-non-empty; + if [ -d "$srcPath" ]; then + mv -t "$dstPath" "$srcPath"/*; + rmdir "$srcPath"; + fi; + else + mkdir -p "$(readlink -m "$dstPath/..")"; + mv "$srcPath" "$dstPath"; + fi; + fi; + local srcParent="$(readlink -m "$srcPath/..")"; + if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then + echo "Removing empty $srcParent/ and (possibly) its parents"; + rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; + fi; + done; + done +} +_addToEnv () +{ + + local depHostOffset depTargetOffset; + local pkg; + for depHostOffset in "${allPlatOffsets[@]}"; + do + local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; + local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; + for depTargetOffset in "${allPlatOffsets[@]}"; + do + (( depHostOffset <= depTargetOffset )) || continue; + local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; + if [[ -z "${strictDeps-}" ]]; then + local visitedPkgs=""; + for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; + do + if [[ "$visitedPkgs" = *"$pkg"* ]]; then + continue; + fi; + runHook "${!hookRef}" "$pkg"; + visitedPkgs+=" $pkg"; + done; + else + local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + runHook "${!hookRef}" "$pkg"; + done; + fi; + done; + done +} +_logHook () +{ + + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + local hookKind="$1"; + local hookExpr="$2"; + shift 2; + if declare -F "$hookExpr" > /dev/null 2>&1; then + nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; + else + if type -p "$hookExpr" > /dev/null; then + nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; + else + if [[ "$hookExpr" != "_callImplicitHook"* ]]; then + local exprToOutput; + if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then + exprToOutput="$hookExpr"; + else + local hookExprLine; + while IFS= read -r hookExprLine; do + hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; + if [[ -n "$hookExprLine" ]]; then + exprToOutput+="$hookExprLine\\n "; + fi; + done <<< "$hookExpr"; + exprToOutput="${exprToOutput%%\\n }"; + fi; + nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; + fi; + fi; + fi +} +nixChattyLog () +{ + + _nixLogWithLevel 5 "$*" +} +getRole () +{ + + case $1 in + -1) + role_post='_FOR_BUILD' + ;; + 0) + role_post='' + ;; + 1) + role_post='_FOR_TARGET' + ;; + *) + echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +patchShebangs () +{ + + local pathName; + local update=false; + while [[ $# -gt 0 ]]; do + case "$1" in + --host) + pathName=HOST_PATH; + shift + ;; + --build) + pathName=PATH; + shift + ;; + --update) + update=true; + shift + ;; + --) + shift; + break + ;; + -* | --*) + echo "Unknown option $1 supplied to patchShebangs" 1>&2; + return 1 + ;; + *) + break + ;; + esac; + done; + echo "patching script interpreter paths in $@"; + local f; + local oldPath; + local newPath; + local arg0; + local args; + local oldInterpreterLine; + local newInterpreterLine; + if [[ $# -eq 0 ]]; then + echo "No arguments supplied to patchShebangs" 1>&2; + return 0; + fi; + local f; + while IFS= read -r -d '' f; do + isScript "$f" || continue; + read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; + read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; + if [[ -z "${pathName:-}" ]]; then + if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then + pathName=HOST_PATH; + else + pathName=PATH; + fi; + fi; + if [[ "$oldPath" == *"/bin/env" ]]; then + if [[ $arg0 == "-S" ]]; then + arg0=${args%% *}; + [[ "$args" == *" "* ]] && args=${args#* } || args=; + newPath="$(PATH="${!pathName}" type -P "env" || true)"; + args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; + else + if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; + exit 1; + else + newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; + fi; + fi; + else + if [[ -z $oldPath ]]; then + oldPath="/bin/sh"; + fi; + newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; + args="$arg0 $args"; + fi; + newInterpreterLine="$newPath $args"; + newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; + if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then + if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then + echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; + escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; + timestamp=$(stat --printf "%y" "$f"); + tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); + sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; + local restoreReadOnly; + if [[ ! -w "$f" ]]; then + chmod +w "$f"; + restoreReadOnly=true; + fi; + cat "$tmpFile" > "$f"; + rm "$tmpFile"; + if [[ -n "${restoreReadOnly:-}" ]]; then + chmod -w "$f"; + fi; + touch --date "$timestamp" "$f"; + fi; + fi; + done < <(find "$@" -type f -perm -0100 -print0) +} +pkgConfigWrapper_addPkgConfigPath () +{ + + local role_post; + getHostRoleEnvHook; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" +} +recordPropagatedDependencies () +{ + + declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); + declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); + local propagatedInputsIndex; + for propagatedInputsIndex in "${!flatVars[@]}"; + do + local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; + local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; + [[ -n "${!propagatedInputsSlice}" ]] || continue; + mkdir -p "${!outputDev}/nix-support"; + printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; + done +} +stripHash () +{ + + local strippedName casematchOpt=0; + strippedName="$(basename -- "$1")"; + shopt -q nocasematch && casematchOpt=1; + shopt -u nocasematch; + if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then + echo "${strippedName:33}"; + else + echo "$strippedName"; + fi; + if (( casematchOpt )); then + shopt -s nocasematch; + fi +} +runPhase () +{ + + local curPhase="$*"; + if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then + return; + fi; + if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then + return; + fi; + if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then + return; + fi; + if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then + return; + fi; + if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then + return; + fi; + if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then + return; + fi; + showPhaseHeader "$curPhase"; + dumpVars; + local startTime endTime; + startTime=$(date +"%s"); + eval "${!curPhase:-$curPhase}"; + endTime=$(date +"%s"); + showPhaseFooter "$curPhase" "$startTime" "$endTime"; + if [ "$curPhase" = unpackPhase ]; then + [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; + cd -- "${sourceRoot:-.}"; + fi +} +_updateSourceDateEpochFromSourceRoot () +{ + + if [ -n "$sourceRoot" ]; then + updateSourceDateEpoch "$sourceRoot"; + fi +} +concatTo () +{ + + local -; + set -o noglob; + local -n targetref="$1"; + shift; + local arg default name type; + for arg in "$@"; + do + IFS="=" read -r name default <<< "$arg"; + local -n nameref="$name"; + if [[ -z "${nameref[*]}" && -n "$default" ]]; then + targetref+=("$default"); + else + if type=$(declare -p "$name" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; + return 1 + ;; + -a*) + targetref+=("${nameref[@]}") + ;; + *) + if [[ "$name" = *"Array" ]]; then + nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; + targetref+=(${nameref+"${nameref[@]}"}); + else + targetref+=(${nameref-}); + fi + ;; + esac; + fi; + fi; + done +} +getHostRole () +{ + + getRole "$hostOffset" +} +ccWrapper_addCVars () +{ + + local role_post; + getHostRoleEnvHook; + local found=; + if [ -d "$1/include" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; + found=1; + fi; + if [ -d "$1/Library/Frameworks" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; + found=1; + fi; + if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then + local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; + export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; + fi +} +_moveSbin () +{ + + if [ "${dontMoveSbin-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then + return; + fi; + echo "moving $prefix/sbin/* to $prefix/bin"; + mkdir -p $prefix/bin; + shopt -s dotglob; + for i in $prefix/sbin/*; + do + mv "$i" $prefix/bin; + done; + shopt -u dotglob; + rmdir $prefix/sbin; + ln -s bin $prefix/sbin +} +_multioutPropagateDev () +{ + + if [ "$(getAllOutputNames)" = "out" ]; then + return; + fi; + local outputFirst; + for outputFirst in $(getAllOutputNames); + do + break; + done; + local propagaterOutput="$outputDev"; + if [ -z "$propagaterOutput" ]; then + propagaterOutput="$outputFirst"; + fi; + if [ -z "${propagatedBuildOutputs+1}" ]; then + local po_dirty="$outputBin $outputInclude $outputLib"; + set +o pipefail; + propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; + set -o pipefail; + fi; + if [ -z "$propagatedBuildOutputs" ]; then + return; + fi; + mkdir -p "${!propagaterOutput}"/nix-support; + for output in $propagatedBuildOutputs; + do + echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; + done +} +updateSourceDateEpoch () +{ + + local path="$1"; + [[ $path == -* ]] && path="./$path"; + local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); + local time="${res[0]//\.[0-9]*/}"; + local newestFile="${res[1]}"; + if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then + echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; + export SOURCE_DATE_EPOCH="$time"; + local now="$(date +%s)"; + if [ "$time" -gt $((now - 60)) ]; then + echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; + fi; + fi +} +definePhases () +{ + + if [ -z "${phases[*]:-}" ]; then + phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; + fi +} +getHostRoleEnvHook () +{ + + getRole "$depHostOffset" +} +getTargetRoleEnvHook () +{ + + getRole "$depTargetOffset" +} +PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" +XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" + +eval "${shellHook:-}" +shopt -s expand_aliases + +exec python - \ No newline at end of file diff --git a/.devenv/state/files.json b/.devenv/state/files.json new file mode 100644 index 00000000..b4c7443f --- /dev/null +++ b/.devenv/state/files.json @@ -0,0 +1 @@ +{"managedFiles":[]} diff --git a/.devenv/task-names.txt b/.devenv/task-names.txt new file mode 100644 index 00000000..be2db38f --- /dev/null +++ b/.devenv/task-names.txt @@ -0,0 +1,5 @@ +devenv:container:copy +devenv:enterShell +devenv:enterTest +devenv:files +devenv:files:cleanup \ No newline at end of file diff --git a/.devenv/tasks.db b/.devenv/tasks.db new file mode 100644 index 0000000000000000000000000000000000000000..159e90adb13561c0365c22e76084c658383a62f1 GIT binary patch literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYFvV#S79dK(-m98b?E5 nGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLtr!nC=3Arqf-Z% literal 0 HcmV?d00001 diff --git a/.devenv/tasks.db-shm b/.devenv/tasks.db-shm new file mode 100644 index 0000000000000000000000000000000000000000..07b4bff8322c26c00b5ab7b2a1c1cddac834fadc GIT binary patch literal 32768 zcmeI)yG;W@5C-6}u`%Xpo^lgzgPefKF>Me~4H6LuLP83l1PEyYW)MQi85wB4UmD%r zYPGlX6)^MHMO4OFgNWI2KBrlalhfz3#d7p^@^F50eKEdU-e0{uUEa=rxj&EkOr87w zBVWr=>y`X>471i&-beXecU#YzWNl>C{c7*(+Uj?15ds7V5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs zfj=!Uh?*}U1Ud=~bF#`#$Hw(cASVsgydWXaQJ`jN34xvhHAPMc^c0xJZXEP%UDxde zHe)Xi+baO*DXGl`^2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs V0RjXF5FkK+009C72oU(^0w12WCtCmj literal 0 HcmV?d00001 diff --git a/.devenv/tasks.db-wal b/.devenv/tasks.db-wal new file mode 100644 index 0000000000000000000000000000000000000000..3854b638a83b049a8e0172202b556bb0cd0d71c7 GIT binary patch literal 86552 zcmeI*eQXHIALy z=f+*Np_Gj=RsE+D|3uRSEo5T|6;K14MkK@#h(ADTDf?0@{z?|BmZvgNeF`TC~}hEEvu?d?x4N5A`mZ2s)Cd;a;> zpB9I;CSz@T;jM4Azx21}<%zK&MU{nQHa9D(f>#@DG8yg{1npdt_S2+~S>N>W&6NY~ zZ|Qn9$2ZzF8SXuMz0Llf!PI`n(0<1L;~Sks8v+O*fB*srAbC*-`8Q|9y=2$PYiNnvDE`-u(>mAjQpUKP`6IT6$Q z2ZtjQlYPSvRZkKQL=N^vhbD!A==gYKWHMGgr93=ekR&;u7y3s>ha!C=)p6xsDJ4rY z`NFKwKQ!9ErB5!(QbB*Jn5xXmmB+6vVnNN8j$>Of zV(zUi`uF;l^-q`nJ-?bS2)3O6!e18;eyvS!ET1C7009ILKmY**5I~@D z1x~eC9etg~g^p6OuaYRn=0#O2CQihXidHtQiusw?oT#R1TW#yb(t{%hB2z;BF~aDG zP&;m4>1r8qR^Bh@*X*9LS{*^{=GOW*uN~j=(f6%?%kI-Qv(?erY5YpGR1sc#;o5!6 zrb_VIo>CRKk`T1o@5lp@@vZgW)!??*e(S+*Z=KC1l%%3bm#VTWSFMy~>t)?iHlxZJ zHI@?dl8+^noGhu?+{tal;MF2>mwsw=WN<7R*~Z@59kf^+hdS$3eAfmYbJreO z7w&7aIyyRxr-w_3rI>StOyzI$CcH}P$AepcdOeP`m{()kZL0JYq-wbP@@g)rJMQc1 z%y;bcxjIvF>0)z2O9d00IagfB*sr zAbk8AJFuYKdpDtUo=T(l#A00IagfB*srAb)8%z~-GbZO>vr|}To+=Q>2ps-Ub{a1{_&wV&SjQXpLww`isYoN>VaWOdOlZr%s$q2WRuXV(O&gQ^aG=@_1)yymNhgI2;Vfp+v}? zbbI^>Pf(KmVlbHqh+-&^^mzlxL_Fvf{n}C3A4vGZNnbz;YsapDTM|W&TeID??qK^s z?(p63d{xlr5g6@D2JOX$00IagfB*srAbj#H^QoGT=zC8aWje`9dm<(I;)aNI42;;ukI^omJ2D2Jq= zD=2z`o}||=iJ?%??+du(q$?oGk~a|WNa2t_uASxy-)ZX$Om!_~dpc6@>Gc98`kC{y nXkBT3*f~bMz=s*rhX4WyAb/dev/null 2>&1 || true + python -m pip install --upgrade pip setuptools wheel build >/dev/null + python -m pip install --upgrade -e ".[gui]" pillow basedpyright ruff >/dev/null + + export PATH="$PWD/$VENV_DIR/bin:$PATH" + ''; +} From a4a18e94b7e6226fd45a74270840d2d36fd60c55 Mon Sep 17 00:00:00 2001 From: dragonleopardpig Date: Tue, 31 Mar 2026 21:17:54 +0800 Subject: [PATCH 2/7] devenv + direnv --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index f694320f..d2b1fe94 100644 --- a/.gitignore +++ b/.gitignore @@ -196,3 +196,5 @@ fabric.properties env-*/ venv/ raytracing/_version.py +.devenv/ +.direnv/ From ee01676a917ac7bc13bd44a9010667db48e2f4a9 Mon Sep 17 00:00:00 2001 From: dragonleopardpig Date: Tue, 31 Mar 2026 21:20:13 +0800 Subject: [PATCH 3/7] Stop tracking local devenv state --- .devenv/bash-bash | 1 - .devenv/bootstrap/bootstrapLib.nix | 562 ---- .devenv/bootstrap/default.nix | 19 - .devenv/bootstrap/resolve-lock.nix | 157 -- .devenv/gc/shell | 1 - .../gc/task-config-devenv-config-task-config | 1 - .devenv/imports.txt | 0 .devenv/input-paths.txt | 7 - .devenv/load-exports | 1 - .devenv/nix-eval-cache.db | Bin 114688 -> 0 bytes .devenv/nix-eval-cache.db-shm | Bin 32768 -> 0 bytes .devenv/nix-eval-cache.db-wal | Bin 197792 -> 0 bytes .devenv/nixpkgs-config-c7c9559ef5bdea25.nix | 9 - .devenv/profile | 1 - .devenv/run | 1 - .devenv/shell-711baa8c896359c5.sh | 2346 ----------------- .devenv/shell-cea9d893b2194fc0.sh | 2346 ----------------- .devenv/state/files.json | 1 - .devenv/task-names.txt | 5 - .devenv/tasks.db | Bin 4096 -> 0 bytes .devenv/tasks.db-shm | Bin 32768 -> 0 bytes .devenv/tasks.db-wal | Bin 86552 -> 0 bytes 22 files changed, 5458 deletions(-) delete mode 120000 .devenv/bash-bash delete mode 100644 .devenv/bootstrap/bootstrapLib.nix delete mode 100644 .devenv/bootstrap/default.nix delete mode 100644 .devenv/bootstrap/resolve-lock.nix delete mode 120000 .devenv/gc/shell delete mode 120000 .devenv/gc/task-config-devenv-config-task-config delete mode 100644 .devenv/imports.txt delete mode 100644 .devenv/input-paths.txt delete mode 100755 .devenv/load-exports delete mode 100644 .devenv/nix-eval-cache.db delete mode 100644 .devenv/nix-eval-cache.db-shm delete mode 100644 .devenv/nix-eval-cache.db-wal delete mode 100644 .devenv/nixpkgs-config-c7c9559ef5bdea25.nix delete mode 120000 .devenv/profile delete mode 120000 .devenv/run delete mode 100755 .devenv/shell-711baa8c896359c5.sh delete mode 100755 .devenv/shell-cea9d893b2194fc0.sh delete mode 100644 .devenv/state/files.json delete mode 100644 .devenv/task-names.txt delete mode 100644 .devenv/tasks.db delete mode 100644 .devenv/tasks.db-shm delete mode 100644 .devenv/tasks.db-wal diff --git a/.devenv/bash-bash b/.devenv/bash-bash deleted file mode 120000 index 03b7d3a2..00000000 --- a/.devenv/bash-bash +++ /dev/null @@ -1 +0,0 @@ -/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9 \ No newline at end of file diff --git a/.devenv/bootstrap/bootstrapLib.nix b/.devenv/bootstrap/bootstrapLib.nix deleted file mode 100644 index 7abbb727..00000000 --- a/.devenv/bootstrap/bootstrapLib.nix +++ /dev/null @@ -1,562 +0,0 @@ -# Shared library functions for devenv evaluation -{ inputs }: - -rec { - # Helper to get overlays for a given input - getOverlays = - inputName: inputAttrs: - let - lib = inputs.nixpkgs.lib; - in - map - ( - overlay: - let - input = - inputs.${inputName} or (throw "No such input `${inputName}` while trying to configure overlays."); - in - input.overlays.${overlay} - or (throw "Input `${inputName}` has no overlay called `${overlay}`. Supported overlays: ${lib.concatStringsSep ", " (builtins.attrNames input.overlays)}") - ) inputAttrs.overlays or [ ]; - - # Main function to create devenv configuration for a specific system with profiles support - # This is the full-featured version used by default.nix - mkDevenvForSystem = - { version - , is_development_version ? false - , system - , devenv_root - , git_root ? null - , devenv_dotfile - , devenv_dotfile_path - , devenv_tmpdir - , devenv_runtime - , devenv_state ? null - , devenv_istesting ? false - , devenv_direnvrc_latest_version - , container_name ? null - , active_profiles ? [ ] - , hostname - , username - , cli_options ? [ ] - , skip_local_src ? false - , secretspec ? null - , devenv_inputs ? { } - , devenv_imports ? [ ] - , impure ? false - , nixpkgs_config ? { } - , lock_fingerprint ? null - , primops ? { } - }: - let - inherit (inputs) nixpkgs; - lib = nixpkgs.lib; - targetSystem = system; - - overlays = lib.flatten (lib.mapAttrsToList getOverlays devenv_inputs); - - # Helper to create pkgs for a given system with nixpkgs_config - mkPkgsForSystem = - evalSystem: - import nixpkgs { - system = evalSystem; - config = nixpkgs_config // { - allowUnfreePredicate = - if nixpkgs_config.allowUnfree or false then - (_: true) - else if (nixpkgs_config.permittedUnfreePackages or [ ]) != [ ] then - (pkg: builtins.elem (lib.getName pkg) (nixpkgs_config.permittedUnfreePackages or [ ])) - else - (_: false); - }; - inherit overlays; - }; - - pkgsBootstrap = mkPkgsForSystem targetSystem; - - # Helper to import a path, trying .nix first then /devenv.nix - # Returns a list of modules, including devenv.local.nix when present - tryImport = - resolvedPath: basePath: - if lib.hasSuffix ".nix" basePath then - [ (import resolvedPath) ] - else - let - devenvpath = resolvedPath + "/devenv.nix"; - localpath = resolvedPath + "/devenv.local.nix"; - in - if builtins.pathExists devenvpath then - [ (import devenvpath) ] ++ lib.optional (builtins.pathExists localpath) (import localpath) - else - throw (basePath + "/devenv.nix file does not exist"); - - importModule = - path: - if lib.hasPrefix "path:" path then - # path: prefix indicates a local filesystem path - strip it and import directly - let - actualPath = builtins.substring 5 999999 path; - in - tryImport (/. + actualPath) path - else if lib.hasPrefix "/" path then - # Absolute path - import directly (avoids input resolution and NAR hash computation) - tryImport (/. + path) path - else if lib.hasPrefix "./" path then - # Relative paths are relative to devenv_root, not bootstrap directory - let - relPath = builtins.substring 1 255 path; - in - tryImport (/. + devenv_root + relPath) path - else if lib.hasPrefix "../" path then - # Parent relative paths also relative to devenv_root - tryImport (/. + devenv_root + "/${path}") path - else - let - paths = lib.splitString "/" path; - name = builtins.head paths; - input = inputs.${name} or (throw "Unknown input ${name}"); - subpath = "/${lib.concatStringsSep "/" (builtins.tail paths)}"; - devenvpath = input + subpath; - in - tryImport devenvpath path; - - # Common modules shared between main evaluation and cross-system evaluation - mkCommonModules = - evalPkgs: - [ - ( - { config, ... }: - { - _module.args.pkgs = evalPkgs.appendOverlays (config.overlays or [ ]); - _module.args.secretspec = secretspec; - _module.args.devenvPrimops = primops; - } - ) - (inputs.devenv.modules + /top-level.nix) - ( - { options, ... }: - { - config.devenv = lib.mkMerge [ - { - root = devenv_root; - dotfile = devenv_dotfile; - } - ( - if builtins.hasAttr "cli" options.devenv then - { - cli.version = version; - cli.isDevelopment = is_development_version; - } - else - { - cliVersion = version; - } - ) - (lib.optionalAttrs (builtins.hasAttr "tmpdir" options.devenv) { - tmpdir = devenv_tmpdir; - }) - (lib.optionalAttrs (builtins.hasAttr "isTesting" options.devenv) { - isTesting = devenv_istesting; - }) - (lib.optionalAttrs (builtins.hasAttr "runtime" options.devenv) { - runtime = devenv_runtime; - }) - (lib.optionalAttrs (builtins.hasAttr "state" options.devenv && devenv_state != null) { - state = lib.mkForce devenv_state; - }) - (lib.optionalAttrs (builtins.hasAttr "direnvrcLatestVersion" options.devenv) { - direnvrcLatestVersion = devenv_direnvrc_latest_version; - }) - ]; - } - ) - ( - { options, ... }: - { - config = lib.mkMerge [ - (lib.optionalAttrs (builtins.hasAttr "git" options) { - git.root = git_root; - }) - ]; - } - ) - (lib.optionalAttrs (container_name != null) { - container.isBuilding = lib.mkForce true; - containers.${container_name}.isBuilding = true; - }) - ] - ++ (lib.flatten (map importModule devenv_imports)) - ++ (if !skip_local_src then (importModule (devenv_root + "/devenv.nix")) else [ ]) - ++ [ - ( - let - localPath = devenv_root + "/devenv.local.nix"; - in - if builtins.pathExists localPath then import localPath else { } - ) - cli_options - ]; - - # Phase 1: Base evaluation to extract profile definitions - baseProject = lib.evalModules { - specialArgs = inputs // { - inherit inputs secretspec primops; - }; - modules = mkCommonModules pkgsBootstrap; - }; - - # Phase 2: Extract and apply profiles using extendModules with priority overrides - project = - let - # Build ordered list of profile names: hostname -> user -> manual - manualProfiles = active_profiles; - currentHostname = hostname; - currentUsername = username; - hostnameProfiles = lib.optional - ( - currentHostname != null - && currentHostname != "" - && builtins.hasAttr currentHostname (baseProject.config.profiles.hostname or { }) - ) "hostname.${currentHostname}"; - userProfiles = lib.optional - ( - currentUsername != null - && currentUsername != "" - && builtins.hasAttr currentUsername (baseProject.config.profiles.user or { }) - ) "user.${currentUsername}"; - - # Ordered list of profiles to activate - orderedProfiles = hostnameProfiles ++ userProfiles ++ manualProfiles; - - # Resolve profile extends with cycle detection - resolveProfileExtends = - profileName: visited: - if builtins.elem profileName visited then - throw "Circular dependency detected in profile extends: ${lib.concatStringsSep " -> " visited} -> ${profileName}" - else - let - profile = getProfileConfig profileName; - extends = profile.extends or [ ]; - newVisited = visited ++ [ profileName ]; - extendedProfiles = lib.flatten (map (name: resolveProfileExtends name newVisited) extends); - in - extendedProfiles ++ [ profileName ]; - - # Get profile configuration by name from baseProject - getProfileConfig = - profileName: - if lib.hasPrefix "hostname." profileName then - let - name = lib.removePrefix "hostname." profileName; - in - baseProject.config.profiles.hostname.${name} - else if lib.hasPrefix "user." profileName then - let - name = lib.removePrefix "user." profileName; - in - baseProject.config.profiles.user.${name} - else - let - availableProfiles = builtins.attrNames (baseProject.config.profiles or { }); - hostnameProfiles = map (n: "hostname.${n}") ( - builtins.attrNames (baseProject.config.profiles.hostname or { }) - ); - userProfiles = map (n: "user.${n}") (builtins.attrNames (baseProject.config.profiles.user or { })); - allAvailableProfiles = availableProfiles ++ hostnameProfiles ++ userProfiles; - in - baseProject.config.profiles.${profileName} - or (throw "Profile '${profileName}' not found. Available profiles: ${lib.concatStringsSep ", " allAvailableProfiles}"); - - # Fold over ordered profiles to build final list with extends - expandedProfiles = lib.foldl' - ( - acc: profileName: - let - allProfileNames = resolveProfileExtends profileName [ ]; - in - acc ++ allProfileNames - ) [ ] - orderedProfiles; - - # Map over expanded profiles and apply priorities - allPrioritizedModules = lib.imap0 - ( - index: profileName: - let - profilePriority = (lib.modules.defaultOverridePriority - 1) - index; - profileConfig = getProfileConfig profileName; - - typeNeedsOverride = - type: - if type == null then - false - else - let - typeName = type.name or type._type or ""; - - isLeafType = builtins.elem typeName [ - "str" - "int" - "bool" - "enum" - "path" - "package" - "float" - "anything" - ]; - in - if isLeafType then - true - else if typeName == "nullOr" then - let - innerType = - type.elemType - or (if type ? nestedTypes && type.nestedTypes ? elemType then type.nestedTypes.elemType else null); - in - if innerType != null then typeNeedsOverride innerType else false - else - false; - - pathNeedsOverride = - optionPath: - let - directOption = lib.attrByPath optionPath null baseProject.options; - in - if directOption != null && lib.isOption directOption then - typeNeedsOverride directOption.type - else if optionPath != [ ] then - let - parentPath = lib.init optionPath; - parentOption = lib.attrByPath parentPath null baseProject.options; - in - if parentOption != null && lib.isOption parentOption then - let - freeformType = parentOption.type.freeformType or parentOption.type.nestedTypes.freeformType or null; - elementType = - if freeformType ? elemType then - freeformType.elemType - else if freeformType ? nestedTypes && freeformType.nestedTypes ? elemType then - freeformType.nestedTypes.elemType - else - freeformType; - in - typeNeedsOverride elementType - else - false - else - false; - - applyModuleOverride = - config: - if builtins.isFunction config then - let - wrapper = args: applyOverrideRecursive (config args) [ ]; - in - lib.mirrorFunctionArgs config wrapper - else - applyOverrideRecursive config [ ]; - - applyOverrideRecursive = - config: optionPath: - if lib.isAttrs config && config ? _type then - config - else if lib.isAttrs config then - lib.mapAttrs (name: value: applyOverrideRecursive value (optionPath ++ [ name ])) config - else if pathNeedsOverride optionPath then - lib.mkOverride profilePriority config - else - config; - - prioritizedConfig = ( - profileConfig.module - // { - imports = lib.map - ( - importItem: - importItem - // { - imports = lib.map (nestedImport: applyModuleOverride nestedImport) (importItem.imports or [ ]); - } - ) - (profileConfig.module.imports or [ ]); - } - ); - in - prioritizedConfig - ) - expandedProfiles; - in - if allPrioritizedModules == [ ] then - baseProject - else - baseProject.extendModules { modules = allPrioritizedModules; }; - - config = project.config; - - # Apply config overlays to pkgs - pkgs = pkgsBootstrap.appendOverlays (config.overlays or [ ]); - - options = pkgs.nixosOptionsDoc { - options = builtins.removeAttrs project.options [ "_module" ]; - warningsAreErrors = false; - transformOptions = - let - isDocType = - v: - builtins.elem v [ - "literalDocBook" - "literalExpression" - "literalMD" - "mdDoc" - ]; - in - lib.attrsets.mapAttrs ( - _: v: - if v ? _type && isDocType v._type then - v.text - else if v ? _type && v._type == "derivation" then - v.name - else - v - ); - }; - - build = - options: config: - lib.concatMapAttrs - ( - name: option: - if lib.isOption option then - let - typeName = option.type.name or ""; - in - if - builtins.elem typeName [ - "output" - "outputOf" - ] - then - { - ${name} = config.${name}; - } - else - { } - else if builtins.isAttrs option && !lib.isDerivation option then - let - v = build option config.${name}; - in - if v != { } then { ${name} = v; } else { } - else - { } - ) - options; - - # Helper to evaluate devenv for a specific system (for cross-compilation, e.g. macOS building Linux containers) - evalForSystem = - evalSystem: - let - evalPkgs = mkPkgsForSystem evalSystem; - evalProject = lib.evalModules { - specialArgs = inputs // { - inherit inputs secretspec primops; - }; - modules = mkCommonModules evalPkgs; - }; - in - { - config = evalProject.config; - }; - - # All supported systems for cross-compilation (lazily evaluated) - allSystems = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - - # Generate perSystem entries for all systems (only evaluated when accessed) - perSystemConfigs = lib.genAttrs allSystems ( - perSystem: if perSystem == targetSystem then { config = config; } else evalForSystem perSystem - ); - in - { - inherit - pkgs - config - options - project - ; - bash = pkgs.bash; - shell = config.shell; - optionsJSON = options.optionsJSON; - info = config.info; - ci = config.ciDerivation; - build = build project.options config; - devenv = { - # Backwards compatibility: wrap config in devenv attribute for code expecting devenv.config.* - config = config; - # perSystem structure for cross-compilation (e.g. macOS building Linux containers) - perSystem = perSystemConfigs; - }; - }; - - # Simplified devenv evaluation for inputs - # This is a lightweight version suitable for evaluating an input's devenv.nix - mkDevenvForInput = - { - # The input to evaluate (must have outPath and sourceInfo) - input - , # All resolved inputs (for specialArgs) - allInputs - , # System to evaluate for - system ? builtins.currentSystem - , # Nixpkgs to use (defaults to allInputs.nixpkgs) - nixpkgs ? allInputs.nixpkgs or (throw "nixpkgs input required") - , # Devenv modules (defaults to allInputs.devenv) - devenv ? allInputs.devenv or (throw "devenv input required") - , - }: - let - devenvPath = input.outPath + "/devenv.nix"; - hasDevenv = builtins.pathExists devenvPath; - in - if !hasDevenv then - throw '' - Input does not have a devenv.nix file. - Expected file at: ${devenvPath} - - To use this input's devenv configuration, the input must provide a devenv.nix file. - '' - else - let - pkgs = import nixpkgs { - inherit system; - config = { }; - }; - lib = pkgs.lib; - - project = lib.evalModules { - specialArgs = allInputs // { - inputs = allInputs; - secretspec = null; - }; - modules = [ - ( - { config, ... }: - { - _module.args.pkgs = pkgs.appendOverlays (config.overlays or [ ]); - } - ) - (devenv.outPath + "/src/modules/top-level.nix") - (import devenvPath) - ]; - }; - in - { - inherit pkgs; - config = project.config; - options = project.options; - inherit project; - }; -} diff --git a/.devenv/bootstrap/default.nix b/.devenv/bootstrap/default.nix deleted file mode 100644 index 7010be36..00000000 --- a/.devenv/bootstrap/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -args@{ system -, # The project root (location of devenv.nix) - devenv_root -, ... -}: - -let - inherit - (import ./resolve-lock.nix { - src = devenv_root; - inherit system; - }) - inputs - ; - - bootstrapLib = import ./bootstrapLib.nix { inherit inputs; }; -in - -bootstrapLib.mkDevenvForSystem args diff --git a/.devenv/bootstrap/resolve-lock.nix b/.devenv/bootstrap/resolve-lock.nix deleted file mode 100644 index fee5ebc3..00000000 --- a/.devenv/bootstrap/resolve-lock.nix +++ /dev/null @@ -1,157 +0,0 @@ -# Adapted from https://git.lix.systems/lix-project/flake-compat/src/branch/main/default.nix -{ src -, system ? builtins.currentSystem or "unknown-system" -, -}: - -let - lockFilePath = src + "/devenv.lock"; - - lockFile = builtins.fromJSON (builtins.readFile lockFilePath); - - rootSrc = { - lastModified = 0; - lastModifiedDate = formatSecondsSinceEpoch 0; - # *hacker voice*: it's definitely a store path, I promise (actually a - # nixlang path value, likely not pointing at the store). - outPath = src; - }; - - # Format number of seconds in the Unix epoch as %Y%m%d%H%M%S. - formatSecondsSinceEpoch = - t: - let - rem = x: y: x - x / y * y; - days = t / 86400; - secondsInDay = rem t 86400; - hours = secondsInDay / 3600; - minutes = (rem secondsInDay 3600) / 60; - seconds = rem t 60; - - # Courtesy of https://stackoverflow.com/a/32158604. - z = days + 719468; - era = (if z >= 0 then z else z - 146096) / 146097; - doe = z - era * 146097; - yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365; - y = yoe + era * 400; - doy = doe - (365 * yoe + yoe / 4 - yoe / 100); - mp = (5 * doy + 2) / 153; - d = doy - (153 * mp + 2) / 5 + 1; - m = mp + (if mp < 10 then 3 else -9); - y' = y + (if m <= 2 then 1 else 0); - - pad = s: if builtins.stringLength s < 2 then "0" + s else s; - in - "${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}${pad (toString minutes)}${pad (toString seconds)}"; - - allNodes = builtins.mapAttrs - ( - key: node: - let - sourceInfo = - if key == lockFile.root then - rootSrc - # Path inputs pointing to project root (path = ".") should use rootSrc - # to avoid fetchTree hashing the entire project directory - else if node.locked.type or null == "path" && node.locked.path or null == "." then - rootSrc - else - let - locked = node.locked; - isRelativePath = p: p != null && (builtins.substring 0 2 p == "./" || builtins.substring 0 3 p == "../"); - # Resolve relative paths against src - resolvedLocked = locked - // (if locked.type or null == "path" && isRelativePath (locked.path or null) - then { path = toString src + "/${locked.path}"; } - else { }) - // (if locked.type or null == "git" && isRelativePath (locked.url or null) - then { url = toString src + "/${locked.url}"; } - else { }); - in - builtins.fetchTree (node.info or { } // removeAttrs resolvedLocked [ "dir" ]); - - subdir = if key == lockFile.root then "" else node.locked.dir or ""; - - outPath = sourceInfo + ((if subdir == "" then "" else "/") + subdir); - - # Resolve a input spec into a node name. An input spec is - # either a node name, or a 'follows' path from the root - # node. - resolveInput = - inputSpec: if builtins.isList inputSpec then getInputByPath lockFile.root inputSpec else inputSpec; - - # Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the - # root node, returning the final node. - getInputByPath = - nodeName: path: - if path == [ ] then - nodeName - else - getInputByPath - # Since this could be a 'follows' input, call resolveInput. - (resolveInput lockFile.nodes.${nodeName}.inputs.${builtins.head path}) - (builtins.tail path); - - inputs = builtins.mapAttrs (inputName: inputSpec: allNodes.${resolveInput inputSpec}) ( - node.inputs or { } - ); - - # Only import flake.nix for non-root nodes (root doesn't need it) - flake = if key == lockFile.root then null else import (outPath + "/flake.nix"); - - outputs = if key == lockFile.root then { } else flake.outputs (inputs // { self = result; }); - - # Lazy devenv evaluation for this input - devenvEval = - let - bootstrapLib = import ./bootstrapLib.nix { inputs = inputs; }; - in - bootstrapLib.mkDevenvForInput { - input = { inherit outPath sourceInfo; }; - allInputs = inputs; - inherit system; - }; - - result = - outputs - // sourceInfo - // { - inherit outPath; - inherit inputs; - inherit outputs; - inherit sourceInfo; - _type = "flake"; - devenv = devenvEval; - }; - - nonFlakeResult = sourceInfo // { - inherit outPath; - inherit inputs; - inherit sourceInfo; - _type = "flake"; - devenv = devenvEval; - }; - - in - if node.flake or true && key != lockFile.root then - assert builtins.isFunction flake.outputs; - result - else - nonFlakeResult - ) - lockFile.nodes; - - result = - if !(builtins.pathExists lockFilePath) then - throw "${lockFilePath} does not exist" - else if lockFile.version >= 5 && lockFile.version <= 7 then - allNodes.${lockFile.root} - else - throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}"; - -in -{ - inputs = result.inputs or { } // { - self = result; - }; -} diff --git a/.devenv/gc/shell b/.devenv/gc/shell deleted file mode 120000 index 184229e4..00000000 --- a/.devenv/gc/shell +++ /dev/null @@ -1 +0,0 @@ -/nix/store/ab4k40z1sraynjijpqdlaql235f5n08j-devenv-shell \ No newline at end of file diff --git a/.devenv/gc/task-config-devenv-config-task-config b/.devenv/gc/task-config-devenv-config-task-config deleted file mode 120000 index 8160720b..00000000 --- a/.devenv/gc/task-config-devenv-config-task-config +++ /dev/null @@ -1 +0,0 @@ -/nix/store/c2yi54kd0hnlqgm9s5vrw12hm7kar3rl-tasks.json \ No newline at end of file diff --git a/.devenv/imports.txt b/.devenv/imports.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/.devenv/input-paths.txt b/.devenv/input-paths.txt deleted file mode 100644 index 586f95bd..00000000 --- a/.devenv/input-paths.txt +++ /dev/null @@ -1,7 +0,0 @@ -/home/thinky/Projects/RayTracing/.devenv/bootstrap/bootstrapLib.nix -/home/thinky/Projects/RayTracing/.devenv/bootstrap/default.nix -/home/thinky/Projects/RayTracing/.devenv/bootstrap/resolve-lock.nix -/home/thinky/Projects/RayTracing/devenv.local.nix -/home/thinky/Projects/RayTracing/devenv.lock -/home/thinky/Projects/RayTracing/devenv.nix -/home/thinky/Projects/RayTracing/.env \ No newline at end of file diff --git a/.devenv/load-exports b/.devenv/load-exports deleted file mode 100755 index 8b137891..00000000 --- a/.devenv/load-exports +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.devenv/nix-eval-cache.db b/.devenv/nix-eval-cache.db deleted file mode 100644 index 10bf4bd3043d2cb0c343a2ecf3f1e3d4a835e56e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 114688 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 N#bWGK=fWSp=`+WcD}ew2 diff --git a/.devenv/nix-eval-cache.db-wal b/.devenv/nix-eval-cache.db-wal deleted file mode 100644 index f5bc59bf4702d1e2005d70714d07f26d89e67952..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 197792 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 K6@z~8=>G#c2P$L$ diff --git a/.devenv/nixpkgs-config-c7c9559ef5bdea25.nix b/.devenv/nixpkgs-config-c7c9559ef5bdea25.nix deleted file mode 100644 index a5e5c1f8..00000000 --- a/.devenv/nixpkgs-config-c7c9559ef5bdea25.nix +++ /dev/null @@ -1,9 +0,0 @@ -let cfg = {}; in cfg // { - allowUnfreePredicate = - if cfg.allowUnfree or false then - (_: true) - else if (cfg.permittedUnfreePackages or []) != [] then - (pkg: builtins.elem ((builtins.parseDrvName (pkg.name or pkg.pname or pkg)).name) (cfg.permittedUnfreePackages or [])) - else - (_: false); -} \ No newline at end of file diff --git a/.devenv/profile b/.devenv/profile deleted file mode 120000 index 7e76cd35..00000000 --- a/.devenv/profile +++ /dev/null @@ -1 +0,0 @@ -/nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile \ No newline at end of file diff --git a/.devenv/run b/.devenv/run deleted file mode 120000 index 7664f62a..00000000 --- a/.devenv/run +++ /dev/null @@ -1 +0,0 @@ -/run/user/1000/devenv-db47dbe \ No newline at end of file diff --git a/.devenv/shell-711baa8c896359c5.sh b/.devenv/shell-711baa8c896359c5.sh deleted file mode 100755 index 99a5cb2f..00000000 --- a/.devenv/shell-711baa8c896359c5.sh +++ /dev/null @@ -1,2346 +0,0 @@ -if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then - source $HOME/.bashrc; -fi - -shopt -u expand_aliases -PATH=${PATH:-} -nix_saved_PATH="$PATH" -XDG_DATA_DIRS=${XDG_DATA_DIRS:-} -nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" -PATH='/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9/bin:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0/bin:/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/bin:/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin/bin:/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/bin:/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/bin:/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2/bin:/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2/bin:/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0/bin:/nix/store/sca0pf46jmxva40qahkcwys5c1lvk6n2-gcc-15.2.0/bin:/nix/store/2c48s343k15i0cmwb9cp1vi6randmzcw-glibc-2.42-51-bin/bin:/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44/bin:/nix/store/9nmzd62x45ayp4vmswvn6z45h6bzrsla-binutils-2.44/bin:/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0/bin:/nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12/bin:/nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9/bin:/nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12/bin:/nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2/bin:/nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35/bin:/nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1/bin:/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin:/nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8/bin:/nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin/bin:/nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45/bin' -export PATH -STRIP='strip' -export STRIP -NIX_LDFLAGS='-rpath /nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env/lib -L/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib -L/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib -L/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8/lib -L/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib/lib -L/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55/lib -L/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/lib -L/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/lib -L/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib -L/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib -L/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/lib -L/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib -L/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib -L/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib -L/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib -L/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/lib -L/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib -L/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib -L/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib -L/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib -L/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib -L/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8/lib -L/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib/lib -L/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55/lib -L/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/lib -L/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/lib -L/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib -L/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib -L/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/lib -L/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib -L/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib -L/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib -L/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib -L/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/lib -L/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib -L/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib -L/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib' -export NIX_LDFLAGS -SHELL='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' -export SHELL -NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningextensive libcxxhardeningfast pic relro stackclashprotection stackprotector strictoverflow zerocallusedregs' -export NIX_HARDENING_ENABLE -depsBuildBuildPropagated='' -export depsBuildBuildPropagated -system='x86_64-linux' -export system -DEVENV_PROFILE='/nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile' -export DEVENV_PROFILE -NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -defaultBuildInputs='' -declare -a pkgsHostHost=() -DEVENV_TASKS='' -export DEVENV_TASKS -AS='as' -export AS -BASH='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' -HOST_PATH='/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0/bin:/nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12/bin:/nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9/bin:/nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12/bin:/nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2/bin:/nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35/bin:/nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1/bin:/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin:/nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8/bin:/nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin/bin:/nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45/bin' -export HOST_PATH -TCLLIBPATH='/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib/tk8.6' -export TCLLIBPATH -cmakeFlags='' -export cmakeFlags -depsTargetTargetPropagated='' -export depsTargetTargetPropagated -declare -a envBuildHostHooks=('addPythonPath' 'sysconfigdataHook' ) -declare -a envBuildTargetHooks=('addPythonPath' 'sysconfigdataHook' ) -declare -a pkgsBuildTarget=() -CONFIG_SHELL='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' -export CONFIG_SHELL -mesonFlags='' -export mesonFlags -PKG_CONFIG_PATH='/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/lib/pkgconfig:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib/pkgconfig:/nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/lib/pkgconfig:/nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/lib/pkgconfig:/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/share/pkgconfig:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/lib/pkgconfig:/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/share/pkgconfig:/nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/lib/pkgconfig:/nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/lib/pkgconfig:/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/lib/pkgconfig:/nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/lib/pkgconfig:/nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/lib/pkgconfig:/nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/lib/pkgconfig:/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib/pkgconfig:/nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/lib/pkgconfig:/nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/lib/pkgconfig:/nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/lib/pkgconfig:/nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/lib/pkgconfig:/nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/lib/pkgconfig' -export PKG_CONFIG_PATH -outputBin='out' -IN_NIX_SHELL='impure' -export IN_NIX_SHELL -TK_LIBRARY='/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib/tk8.6.16' -export TK_LIBRARY -declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) -outputDev='out' -__structuredAttrs='' -export __structuredAttrs -depsHostHostPropagated='' -export depsHostHostPropagated -declare -a preConfigureHooks=('_multioutConfig' ) -outputs='out' -export outputs -AR='ar' -export AR -NIX_CC='/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' -export NIX_CC -preferLocalBuild='1' -export preferLocalBuild -VENV_DIR='.devenv/state/venv' -export VENV_DIR -MACHTYPE='x86_64-pc-linux-gnu' -NIX_BINTOOLS='/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44' -export NIX_BINTOOLS -CC='gcc' -export CC -NIX_BUILD_CORES='4' -export NIX_BUILD_CORES -OPTERR='1' -PIP_DISABLE_PIP_VERSION_CHECK='1' -export PIP_DISABLE_PIP_VERSION_CHECK -TCL_LIBRARY='/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib/tcl8.6.16' -export TCL_LIBRARY -configureFlags='' -export configureFlags -NIX_STORE='/nix/store' -export NIX_STORE -declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) -CXX='g++' -export CXX -SOURCE_DATE_EPOCH='315532800' -export SOURCE_DATE_EPOCH -pkg='/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' -PKG_CONFIG='pkg-config' -export PKG_CONFIG -DEVENV_STATE='/home/thinky/Projects/RayTracing/.devenv/state' -export DEVENV_STATE -stdenv='/nix/store/zkiy4zv8wz3v95bj6fdmkqwql8x1vnhb-stdenv-linux' -export stdenv -DEVENV_RUNTIME='/run/user/1000/devenv-db47dbe' -export DEVENV_RUNTIME -declare -a pkgsHostTarget=() -declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) -NIX_ENFORCE_NO_NATIVE='1' -export NIX_ENFORCE_NO_NATIVE -out='/nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env' -export out -hardeningDisable='' -export hardeningDisable -NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -READELF='readelf' -export READELF -declare -a pkgsTargetTarget=() -declare -a envTargetTargetHooks=() -NIX_CFLAGS_COMPILE=' -frandom-seed=q5rbqaawx4 -isystem /nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/include -isystem /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/include -isystem /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/include -isystem /nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/include -isystem /nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/include -isystem /nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/include -isystem /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/include -isystem /nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/include -isystem /nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/include -isystem /nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/include -isystem /nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/include -isystem /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/include -isystem /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/include -isystem /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/include -isystem /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/include -isystem /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/include -isystem /nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/include -isystem /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/include -isystem /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/include -isystem /nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/include -isystem /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/include -isystem /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/include -isystem /nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/include -isystem /nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/include -isystem /nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/include -isystem /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/include -isystem /nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/include -isystem /nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/include -isystem /nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/include -isystem /nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/include -isystem /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/include -isystem /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/include -isystem /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/include -isystem /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/include -isystem /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/include -isystem /nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/include -isystem /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/include -isystem /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/include' -export NIX_CFLAGS_COMPILE -declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) -PYTHONPATH='/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib/python3.12/site-packages:/nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13/lib/python3.12/site-packages' -export PYTHONPATH -_PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu' -export _PYTHON_SYSCONFIGDATA_NAME -shellHook=' -export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" - -# Override temp directories that stdenv set to NIX_BUILD_TOP. -# Only reset those that still point to the Nix build dir; leave -# any user/CI-supplied value intact so child processes (e.g. -# `devenv processes wait`) compute the same runtime directory. -for var in TMP TMPDIR TEMP TEMPDIR; do - if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then - export "$var"=/tmp - fi -done -if [ -n "${NIX_BUILD_TOP-}" ]; then - unset NIX_BUILD_TOP -fi - -# set path to locales on non-NixOS Linux hosts -if [ -z "${LOCALE_ARCHIVE-}" ]; then - export LOCALE_ARCHIVE=/nix/store/q6y3frkqaq8v7va2rmgaq6jvhy1vb9q3-glibc-locales-2.42-51/lib/locale/locale-archive -fi - - -# direnv helper -if [ ! type -p direnv &>/dev/null && -f .envrc ]; then - echo "An .envrc file was detected, but the direnv command is not installed." - echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html" -fi - -mkdir -p "$DEVENV_STATE" -if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile" ] -then - ln -snf /nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile "$DEVENV_DOTFILE/profile" -fi -unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps - -mkdir -p /run/user/1000/devenv-db47dbe -ln -snf /run/user/1000/devenv-db47dbe /home/thinky/Projects/RayTracing/.devenv/run - - -echo "✨ devenv 2.0.3 is out of date. Please update to 2.0.6: https://devenv.sh/getting-started/#installation" >&2 - - -# Check whether the direnv integration is out of date. -{ - if [[ ":${DIRENV_ACTIVE-}:" == *":/home/thinky/Projects/RayTracing:"* ]]; then - if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then - if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then - direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "") - - echo "✨ The direnv integration in your .envrc is out of date." - echo "" - echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. " - if [[ -n "$direnv_line" ]]; then - echo "To enable this feature, replace the following line in your .envrc:" - echo "" - echo " $direnv_line" - echo "" - echo "with:" - echo "" - echo " eval \"\$(devenv direnvrc)\"" - else - echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:" - echo "" - echo " eval \"$(devenv direnvrc)\"" - fi - echo "" - echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/." - echo "" - echo "To disable this message:" - echo "" - echo " Add the following environment to your .envrc before \`use devenv\`:" - echo "" - echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1" - echo "" - echo " Or set the following option in your devenv configuration:" - echo "" - echo " devenv.warnOnNewVersion = false;" - echo "" - fi - fi - fi -} >&2 - -echo "RayTracing devenv" -echo "Python $(/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin/python --version | cut -d'\'' '\'' -f2)" - -if [ ! -x "$VENV_DIR/bin/python" ]; then - /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin/python -m venv --system-site-packages "$VENV_DIR" -fi - -. "$VENV_DIR/bin/activate" - -python -m ensurepip --upgrade >/dev/null 2>&1 || true -python -m pip install --upgrade pip setuptools wheel build >/dev/null -python -m pip install --upgrade -e ".[gui]" pillow basedpyright ruff >/dev/null - -export PATH="$PWD/$VENV_DIR/bin:$PATH" - -' -export shellHook -DETERMINISTIC_BUILD='1' -export DETERMINISTIC_BUILD -depsBuildTargetPropagated='' -export depsBuildTargetPropagated -STRINGS='strings' -export STRINGS -declare -a pkgsBuildHost=('/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev' '/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9' '/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13' '/nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13' '/nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev' '/nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev' '/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1' '/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev' '/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev' '/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1' '/nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev' '/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin' '/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8' '/nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev' '/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib' '/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0' '/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev' '/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55' '/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3' '/nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev' '/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin' '/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib' '/nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev' '/nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev' '/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12' '/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12' '/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9' '/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16' '/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16' '/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib' '/nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev' '/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0' '/nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev' '/nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev' '/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12' '/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7' '/nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev' '/nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev' '/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2' '/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6' '/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2' '/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2' '/nix/store/gz3rknshr1ywis4mjaqrgj3z2shp3n3v-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' '/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44' ) -declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' ) -declare -a pkgsBuildBuild=() -OSTYPE='linux-gnu' -LINENO='79' -depsHostHost='' -export depsHostHost -outputInclude='out' -PYTHONNOUSERSITE='1' -export PYTHONNOUSERSITE -OBJDUMP='objdump' -export OBJDUMP -_PYTHON_HOST_PLATFORM='linux-x86_64' -export _PYTHON_HOST_PLATFORM -NM='nm' -export NM -DEVENV_DOTFILE='/home/thinky/Projects/RayTracing/.devenv' -export DEVENV_DOTFILE -doInstallCheck='' -export doInstallCheck -name='devenv-shell-env' -export name -OBJCOPY='objcopy' -export OBJCOPY -depsBuildTarget='' -export depsBuildTarget -initialPath='/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10 /nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0 /nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12 /nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9 /nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12 /nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2 /nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35 /nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14 /nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin /nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1 /nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9 /nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8 /nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin /nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45' -outputLib='out' -strictDeps='' -export strictDeps -RANLIB='ranlib' -export RANLIB -outputDevman='out' -DEVENV_ROOT='/home/thinky/Projects/RayTracing' -export DEVENV_ROOT -outputDoc='out' -depsTargetTarget='' -export depsTargetTarget -outputDevdoc='REMOVE' -phases='buildPhase' -export phases -propagatedNativeBuildInputs='' -export propagatedNativeBuildInputs -preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' -LD_LIBRARY_PATH='/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib:/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib:/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib:/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib:/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib:/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib:/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib:/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib' -export LD_LIBRARY_PATH -outputMan='out' -PYTHONHASHSEED='0' -export PYTHONHASHSEED -declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) -declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) -PS4='+ ' -OLDPWD='' -export OLDPWD -buildInputs='' -export buildInputs -depsBuildBuild='' -export depsBuildBuild -outputInfo='out' -dontAddDisableDepTrack='1' -export dontAddDisableDepTrack -patches='' -export patches -prefix='/nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env' -NIX_NO_SELF_RPATH='1' -XDG_DATA_DIRS='/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9/share:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/share:/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/share:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/share:/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/share:/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/share:/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0/share:/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/share:/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin/share:/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/share:/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/share:/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/share:/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/share:/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/share:/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2/share:/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2/share' -export XDG_DATA_DIRS -shell='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' -export shell -declare -a unpackCmdHooks=('_defaultUnpack' ) -SIZE='size' -export SIZE -propagatedBuildInputs='' -export propagatedBuildInputs -buildPhase='{ echo "------------------------------------------------------------"; - echo " WARNING: the existence of this path is not guaranteed."; - echo " It is an internal implementation detail for pkgs.mkShell."; - echo "------------------------------------------------------------"; - echo; - # Record all build inputs as runtime dependencies - export; -} >> "$out" -' -export buildPhase -builder='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' -export builder -declare -a envBuildBuildHooks=('addPythonPath' 'sysconfigdataHook' ) -LD='ld' -export LD -IFS=' -' -_substituteStream_has_warned_replace_deprecation='false' -NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -defaultNativeBuildInputs='/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2 /nix/store/gz3rknshr1ywis4mjaqrgj3z2shp3n3v-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' -HOSTTYPE='x86_64' -declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -DEVENV_TASK_FILE='/nix/store/c2yi54kd0hnlqgm9s5vrw12hm7kar3rl-tasks.json' -export DEVENV_TASK_FILE -declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -nativeBuildInputs='/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13 /nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13 /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16 /nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev /nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2' -export nativeBuildInputs -doCheck='' -export doCheck -nixVomitLog () -{ - - _nixLogWithLevel 7 "$*" -} -updateSourceDateEpoch () -{ - - local path="$1"; - [[ $path == -* ]] && path="./$path"; - local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); - local time="${res[0]//\.[0-9]*/}"; - local newestFile="${res[1]}"; - if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then - echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; - export SOURCE_DATE_EPOCH="$time"; - local now="$(date +%s)"; - if [ "$time" -gt $((now - 60)) ]; then - echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; - fi; - fi -} -substitute () -{ - - local input="$1"; - local output="$2"; - shift 2; - if [ ! -f "$input" ]; then - echo "substitute(): ERROR: file '$input' does not exist" 1>&2; - return 1; - fi; - local content; - consumeEntire content < "$input"; - if [ -e "$output" ]; then - chmod +w "$output"; - fi; - substituteStream content "file '$input'" "$@" > "$output" -} -sysconfigdataHook () -{ - - if [ "$1" = '/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13' ]; then - export _PYTHON_HOST_PLATFORM='linux-x86_64'; - export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; - fi -} -pkgConfigWrapper_addPkgConfigPath () -{ - - local role_post; - getHostRoleEnvHook; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" -} -unpackFile () -{ - - curSrc="$1"; - echo "unpacking source archive $curSrc"; - if ! runOneHook unpackCmd "$curSrc"; then - echo "do not know how to unpack source archive $curSrc"; - exit 1; - fi -} -_nixLogWithLevel () -{ - - [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; - local logLevel; - case "${1:?}" in - 0) - logLevel=ERROR - ;; - 1) - logLevel=WARN - ;; - 2) - logLevel=NOTICE - ;; - 3) - logLevel=INFO - ;; - 4) - logLevel=TALKATIVE - ;; - 5) - logLevel=CHATTY - ;; - 6) - logLevel=DEBUG - ;; - 7) - logLevel=VOMIT - ;; - *) - echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; - return 1 - ;; - esac; - local callerName="${FUNCNAME[2]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" -} -dumpVars () -{ - - if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then - local old_umask; - old_umask=$(umask); - umask 0077; - export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; - umask "$old_umask"; - fi -} -_logHook () -{ - - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - local hookKind="$1"; - local hookExpr="$2"; - shift 2; - if declare -F "$hookExpr" > /dev/null 2>&1; then - nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; - else - if type -p "$hookExpr" > /dev/null; then - nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; - else - if [[ "$hookExpr" != "_callImplicitHook"* ]]; then - local exprToOutput; - if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then - exprToOutput="$hookExpr"; - else - local hookExprLine; - while IFS= read -r hookExprLine; do - hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; - if [[ -n "$hookExprLine" ]]; then - exprToOutput+="$hookExprLine\\n "; - fi; - done <<< "$hookExpr"; - exprToOutput="${exprToOutput%%\\n }"; - fi; - nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; - fi; - fi; - fi -} -recordPropagatedDependencies () -{ - - declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); - declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); - local propagatedInputsIndex; - for propagatedInputsIndex in "${!flatVars[@]}"; - do - local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; - local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; - [[ -n "${!propagatedInputsSlice}" ]] || continue; - mkdir -p "${!outputDev}/nix-support"; - printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; - done -} -showPhaseHeader () -{ - - local phase="$1"; - echo "Running phase: $phase"; - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" -} -fixupPhase () -{ - - local output; - for output in $(getAllOutputNames); - do - if [ -e "${!output}" ]; then - chmod -R u+w,u-s,g-s "${!output}"; - fi; - done; - runHook preFixup; - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" runHook fixupOutput; - done; - recordPropagatedDependencies; - if [ -n "${setupHook:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; - fi; - if [ -n "${setupHooks:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - local hook; - for hook in ${setupHooks[@]}; - do - local content; - consumeEntire content < "$hook"; - substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; - unset -v content; - done; - unset -v hook; - fi; - if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then - mkdir -p "${!outputBin}/nix-support"; - printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; - fi; - runHook postFixup -} -getAllOutputNames () -{ - - if [ -n "$__structuredAttrs" ]; then - echo "${!outputs[*]}"; - else - echo "$outputs"; - fi -} -buildPhase () -{ - - runHook preBuild; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom buildPhase, doing nothing"; - else - foundMakefile=1; - local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; - echoCmd 'build flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postBuild -} -getRole () -{ - - case $1 in - -1) - role_post='_FOR_BUILD' - ;; - 0) - role_post='' - ;; - 1) - role_post='_FOR_TARGET' - ;; - *) - echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -prependToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=("$@" ${nameref+"${nameref[@]}"}); - else - nameref="$* ${nameref-}"; - fi -} -getTargetRoleWrapper () -{ - - case $targetOffset in - -1) - export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 - ;; - 0) - export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 - ;; - 1) - export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 - ;; - *) - echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -_pruneLibtoolFiles () -{ - - if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; -} -installPhase () -{ - - runHook preInstall; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom installPhase, doing nothing"; - runHook postInstall; - return; - else - foundMakefile=1; - fi; - if [ -n "$prefix" ]; then - mkdir -p "$prefix"; - fi; - local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; - echoCmd 'install flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - runHook postInstall -} -nixChattyLog () -{ - - _nixLogWithLevel 5 "$*" -} -_moveSbin () -{ - - if [ "${dontMoveSbin-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then - return; - fi; - echo "moving $prefix/sbin/* to $prefix/bin"; - mkdir -p $prefix/bin; - shopt -s dotglob; - for i in $prefix/sbin/*; - do - mv "$i" $prefix/bin; - done; - shopt -u dotglob; - rmdir $prefix/sbin; - ln -s bin $prefix/sbin -} -_allFlags () -{ - - export system pname name version; - while IFS='' read -r varName; do - nixTalkativeLog "@${varName}@ -> ${!varName}"; - args+=("--subst-var" "$varName"); - done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') -} -getHostRole () -{ - - getRole "$hostOffset" -} -mapOffset () -{ - - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi -} -addToSearchPathWithCustomDelimiter () -{ - - local delimiter="$1"; - local varName="$2"; - local dir="$3"; - if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then - export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; - fi -} -nixWarnLog () -{ - - _nixLogWithLevel 1 "$*" -} -_multioutDocs () -{ - - local REMOVE=REMOVE; - moveToOutput share/info "${!outputInfo}"; - moveToOutput share/doc "${!outputDoc}"; - moveToOutput share/gtk-doc "${!outputDevdoc}"; - moveToOutput share/devhelp/books "${!outputDevdoc}"; - moveToOutput share/man "${!outputMan}"; - moveToOutput share/man/man3 "${!outputDevman}" -} -_defaultUnpack () -{ - - local fn="$1"; - local destination; - if [ -d "$fn" ]; then - destination="$(stripHash "$fn")"; - if [ -e "$destination" ]; then - echo "Cannot copy $fn to $destination: destination already exists!"; - echo "Did you specify two \"srcs\" with the same \"name\"?"; - return 1; - fi; - cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; - else - case "$fn" in - *.tar.xz | *.tar.lzma | *.txz) - ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; - true ) | tar xf - --mode=+w --warning=no-timestamp - ;; - *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) - tar xf "$fn" --mode=+w --warning=no-timestamp - ;; - *) - return 1 - ;; - esac; - fi -} -getHostRoleEnvHook () -{ - - getRole "$depHostOffset" -} -distPhase () -{ - - runHook preDist; - local flagsArray=(); - concatTo flagsArray distFlags distFlagsArray distTarget=dist; - echo 'dist flags: %q' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - if [ "${dontCopyDist:-0}" != 1 ]; then - mkdir -p "$out/tarballs"; - cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; - fi; - runHook postDist -} -_multioutConfig () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then - return; - fi; - if [ -z "${shareDocName:-}" ]; then - local confScript="${configureScript:-}"; - if [ -z "$confScript" ] && [ -x ./configure ]; then - confScript=./configure; - fi; - if [ -f "$confScript" ]; then - local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; - fi; - if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then - shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; - fi; - fi; - prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; - prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal -} -nixErrorLog () -{ - - _nixLogWithLevel 0 "$*" -} -substituteAllInPlace () -{ - - local fileName="$1"; - shift; - substituteAll "$fileName" "$fileName" "$@" -} -findInputs () -{ - - local -r pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - local varVar="${pkgAccumVarVars[hostOffset + 1]}"; - local varRef="$varVar[$((targetOffset - hostOffset))]"; - local var="${!varRef}"; - unset -v varVar varRef; - local varSlice="$var[*]"; - case " ${!varSlice-} " in - *" $pkg "*) - return 0 - ;; - esac; - unset -v varSlice; - eval "$var"'+=("$pkg")'; - if ! [ -e "$pkg" ]; then - echo "build input $pkg does not exist" 1>&2; - exit 1; - fi; - function mapOffset () - { - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi - }; - local relHostOffset; - for relHostOffset in "${allPlatOffsets[@]}"; - do - local files="${propagatedDepFilesVars[relHostOffset + 1]}"; - local hostOffsetNext; - mapOffset "$relHostOffset" hostOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - local relTargetOffset; - for relTargetOffset in "${allPlatOffsets[@]}"; - do - (( "$relHostOffset" <= "$relTargetOffset" )) || continue; - local fileRef="${files}[$relTargetOffset - $relHostOffset]"; - local file="${!fileRef}"; - unset -v fileRef; - local targetOffsetNext; - mapOffset "$relTargetOffset" targetOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - [[ -f "$pkg/nix-support/$file" ]] || continue; - local pkgNext; - read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; - for pkgNext in $pkgNext; - do - findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; - done; - done; - done -} -concatStringsSep () -{ - - local sep="$1"; - local name="$2"; - local type oldifs; - if type=$(declare -p "$name" 2> /dev/null); then - local -n nameref="$name"; - case "${type#* }" in - -A*) - echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; - return 1 - ;; - -a*) - local IFS="$(printf '\036')" - ;; - *) - local IFS=" " - ;; - esac; - local ifs_separated="${nameref[*]}"; - echo -n "${ifs_separated//"$IFS"/"$sep"}"; - fi -} -isMachO () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then - return 0; - else - return 1; - fi; - fi; - fi -} -_moveToShare () -{ - - if [ -n "$__structuredAttrs" ]; then - if [ -z "${forceShare-}" ]; then - forceShare=(man doc info); - fi; - else - forceShare=(${forceShare:-man doc info}); - fi; - if [[ -z "$out" ]]; then - return; - fi; - for d in "${forceShare[@]}"; - do - if [ -d "$out/$d" ]; then - if [ -d "$out/share/$d" ]; then - echo "both $d/ and share/$d/ exist!"; - else - echo "moving $out/$d to $out/share/$d"; - mkdir -p $out/share; - mv $out/$d $out/share/; - fi; - fi; - done -} -auditTmpdir () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "checking for references to $TMPDIR/ in $dir..."; - local tmpdir elf_fifo script_fifo; - tmpdir="$(mktemp -d)"; - elf_fifo="$tmpdir/elf"; - script_fifo="$tmpdir/script"; - mkfifo "$elf_fifo" "$script_fifo"; - ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do - if isELF "$file"; then - printf '%s\0' "$file" 1>&3; - else - if isScript "$file"; then - filename=${file##*/}; - dir=${file%/*}; - if [ -e "$dir/.$filename-wrapped" ]; then - printf '%s\0' "$file" 1>&4; - fi; - fi; - fi; - done; - exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then - echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$elf_fifo" ) & local pid_elf=$!; - local pid_script; - ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if grep -q -F "$TMPDIR/" "$1"; then - echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$script_fifo" ) & local pid_script=$!; - wait "$pid_elf" || { - echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - wait "$pid_script" || { - echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - rm -r "$tmpdir" -} -concatTo () -{ - - local -; - set -o noglob; - local -n targetref="$1"; - shift; - local arg default name type; - for arg in "$@"; - do - IFS="=" read -r name default <<< "$arg"; - local -n nameref="$name"; - if [[ -z "${nameref[*]}" && -n "$default" ]]; then - targetref+=("$default"); - else - if type=$(declare -p "$name" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; - return 1 - ;; - -a*) - targetref+=("${nameref[@]}") - ;; - *) - if [[ "$name" = *"Array" ]]; then - nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; - targetref+=(${nameref+"${nameref[@]}"}); - else - targetref+=(${nameref-}); - fi - ;; - esac; - fi; - fi; - done -} -patchPhase () -{ - - runHook prePatch; - local -a patchesArray; - concatTo patchesArray patches; - local -a flagsArray; - concatTo flagsArray patchFlags=-p1; - for i in "${patchesArray[@]}"; - do - echo "applying patch $i"; - local uncompress=cat; - case "$i" in - *.gz) - uncompress="gzip -d" - ;; - *.bz2) - uncompress="bzip2 -d" - ;; - *.xz) - uncompress="xz -d" - ;; - *.lzma) - uncompress="lzma -d" - ;; - esac; - $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; - done; - runHook postPatch -} -nixLog () -{ - - [[ -z ${NIX_LOG_FD-} ]] && return 0; - local callerName="${FUNCNAME[1]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" -} -nixNoticeLog () -{ - - _nixLogWithLevel 2 "$*" -} -moveToOutput () -{ - - local patt="$1"; - local dstOut="$2"; - local output; - for output in $(getAllOutputNames); - do - if [ "${!output}" = "$dstOut" ]; then - continue; - fi; - local srcPath; - for srcPath in "${!output}"/$patt; - do - if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then - continue; - fi; - if [ "$dstOut" = REMOVE ]; then - echo "Removing $srcPath"; - rm -r "$srcPath"; - else - local dstPath="$dstOut${srcPath#${!output}}"; - echo "Moving $srcPath to $dstPath"; - if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then - rmdir "$srcPath" --ignore-fail-on-non-empty; - if [ -d "$srcPath" ]; then - mv -t "$dstPath" "$srcPath"/*; - rmdir "$srcPath"; - fi; - else - mkdir -p "$(readlink -m "$dstPath/..")"; - mv "$srcPath" "$dstPath"; - fi; - fi; - local srcParent="$(readlink -m "$srcPath/..")"; - if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then - echo "Removing empty $srcParent/ and (possibly) its parents"; - rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; - fi; - done; - done -} -noBrokenSymlinks () -{ - - local -r output="${1:?}"; - local path; - local pathParent; - local symlinkTarget; - local -i numDanglingSymlinks=0; - local -i numReflexiveSymlinks=0; - local -i numUnreadableSymlinks=0; - if [[ ! -e $output ]]; then - nixWarnLog "skipping non-existent output $output"; - return 0; - fi; - nixInfoLog "running on $output"; - while IFS= read -r -d '' path; do - pathParent="$(dirname "$path")"; - if ! symlinkTarget="$(readlink "$path")"; then - nixErrorLog "the symlink $path is unreadable"; - numUnreadableSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget == /* ]]; then - nixInfoLog "symlink $path points to absolute target $symlinkTarget"; - else - nixInfoLog "symlink $path points to relative target $symlinkTarget"; - symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; - fi; - if [[ $symlinkTarget = "$TMPDIR"/* ]]; then - nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; - numDanglingSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then - nixInfoLog "symlink $path points outside the Nix store; ignoring"; - continue; - fi; - if [[ $path == "$symlinkTarget" ]]; then - nixErrorLog "the symlink $path is reflexive"; - numReflexiveSymlinks+=1; - else - if [[ ! -e $symlinkTarget ]]; then - nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; - numDanglingSymlinks+=1; - else - nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; - fi; - fi; - done < <(find "$output" -type l -print0); - if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then - nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; - exit 1; - fi; - return 0 -} -updateAutotoolsGnuConfigScriptsPhase () -{ - - if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then - return; - fi; - for script in config.sub config.guess; - do - for f in $(find . -type f -name "$script"); - do - echo "Updating Autotools / GNU config script to a newer upstream version: $f"; - cp -f "/nix/store/s0xj50a5awma0jwgsqws61014nxzxy19-gnu-config-2024-01-01/$script" "$f"; - done; - done -} -exitHandler () -{ - - exitCode="$?"; - set +e; - if [ -n "${showBuildStats:-}" ]; then - read -r -d '' -a buildTimes < <(times); - echo "build times:"; - echo "user time for the shell ${buildTimes[0]}"; - echo "system time for the shell ${buildTimes[1]}"; - echo "user time for all child processes ${buildTimes[2]}"; - echo "system time for all child processes ${buildTimes[3]}"; - fi; - if (( "$exitCode" != 0 )); then - runHook failureHook; - if [ -n "${succeedOnFailure:-}" ]; then - echo "build failed with exit code $exitCode (ignored)"; - mkdir -p "$out/nix-support"; - printf "%s" "$exitCode" > "$out/nix-support/failed"; - exit 0; - fi; - else - runHook exitHook; - fi; - return "$exitCode" -} -appendToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=(${nameref+"${nameref[@]}"} "$@"); - else - nameref="${nameref-} $*"; - fi -} -_activatePkgs () -{ - - local hostOffset targetOffset; - local pkg; - for hostOffset in "${allPlatOffsets[@]}"; - do - local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; - for targetOffset in "${allPlatOffsets[@]}"; - do - (( hostOffset <= targetOffset )) || continue; - local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - activatePackage "$pkg" "$hostOffset" "$targetOffset"; - done; - done; - done -} -_addToTclLibPath () -{ - - local tclPkg="$1"; - if [[ -z "$tclPkg" ]]; then - return; - fi; - if [[ ! -d "$tclPkg" ]]; then - echo "can't add $tclPkg to TCLLIBPATH; that directory doesn't exist" 1>&2; - exit 1; - fi; - if [[ "$tclPkg" == *" "* ]]; then - tclPkg="{$tclPkg}"; - fi; - if [[ -z "${TCLLIBPATH-}" ]]; then - export TCLLIBPATH="$tclPkg"; - else - if [[ "$TCLLIBPATH " != *"$tclPkg "* ]]; then - export TCLLIBPATH="${TCLLIBPATH} $tclPkg"; - fi; - fi -} -bintoolsWrapper_addLDVars () -{ - - local role_post; - getHostRoleEnvHook; - if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; - fi; - if [[ -d "$1/lib" ]]; then - local -a glob=($1/lib/lib*); - if [ "${#glob[*]}" -gt 0 ]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib"; - fi; - fi -} -showPhaseFooter () -{ - - local phase="$1"; - local startTime="$2"; - local endTime="$3"; - local delta=$(( endTime - startTime )); - (( delta < 30 )) && return; - local H=$((delta/3600)); - local M=$((delta%3600/60)); - local S=$((delta%60)); - echo -n "$phase completed in "; - (( H > 0 )) && echo -n "$H hours "; - (( M > 0 )) && echo -n "$M minutes "; - echo "$S seconds" -} -substituteStream () -{ - - local var=$1; - local description=$2; - shift 2; - while (( "$#" )); do - local replace_mode="$1"; - case "$1" in - --replace) - if ! "$_substituteStream_has_warned_replace_deprecation"; then - echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; - _substituteStream_has_warned_replace_deprecation=true; - fi; - replace_mode='--replace-warn' - ;& - --replace-quiet | --replace-warn | --replace-fail) - pattern="$2"; - replacement="$3"; - shift 3; - if ! [[ "${!var}" == *"$pattern"* ]]; then - if [ "$replace_mode" == --replace-warn ]; then - printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - else - if [ "$replace_mode" == --replace-fail ]; then - printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - return 1; - fi; - fi; - fi; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var) - local varName="$2"; - shift 2; - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; - return 1; - fi; - if [ -z ${!varName+x} ]; then - echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; - return 1; - fi; - pattern="@$varName@"; - replacement="${!varName}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var-by) - pattern="@$2@"; - replacement="$3"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - shift 3 - ;; - *) - echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; - return 1 - ;; - esac; - done; - printf "%s" "${!var}" -} -addToSearchPath () -{ - - addToSearchPathWithCustomDelimiter ":" "$@" -} -runOneHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook ret=1; - for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - if _eval "$hook" "$@"; then - ret=0; - break; - fi; - done; - return "$ret" -} -_moveSystemdUserUnits () -{ - - if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then - return; - fi; - if [ ! -e "${prefix:?}/lib/systemd/user" ]; then - return; - fi; - local source="$prefix/lib/systemd/user"; - local target="$prefix/share/systemd/user"; - echo "moving $source/* to $target"; - mkdir -p "$target"; - ( shopt -s dotglob; - for i in "$source"/*; - do - mv "$i" "$target"; - done ); - rmdir "$source"; - ln -s "$target" "$source" -} -substituteAll () -{ - - local input="$1"; - local output="$2"; - local -a args=(); - _allFlags; - substitute "$input" "$output" "${args[@]}" -} -toPythonPath () -{ - - local paths="$1"; - local result=; - for i in $paths; - do - p="$i/lib/python3.12/site-packages"; - result="${result}${result:+:}$p"; - done; - echo $result -} -consumeEntire () -{ - - if IFS='' read -r -d '' "$1"; then - echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; - return 1; - fi -} -printWords () -{ - - (( "$#" > 0 )) || return 0; - printf '%s ' "$@" -} -ccWrapper_addCVars () -{ - - local role_post; - getHostRoleEnvHook; - local found=; - if [ -d "$1/include" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; - found=1; - fi; - if [ -d "$1/Library/Frameworks" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; - found=1; - fi; - if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then - local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; - export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; - fi -} -checkPhase () -{ - - runHook preCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom checkPhase, doing nothing"; - runHook postCheck; - return; - fi; - if [[ -z "${checkTarget:-}" ]]; then - if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then - checkTarget="check"; - else - if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then - checkTarget="test"; - fi; - fi; - fi; - if [[ -z "${checkTarget:-}" ]]; then - echo "no check/test target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; - echoCmd 'check flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postCheck -} -substituteAllStream () -{ - - local -a args=(); - _allFlags; - substituteStream "$1" "$2" "${args[@]}" -} -printPhases () -{ - - definePhases; - local phase; - for phase in ${phases[*]}; - do - printf '%s\n' "$phase"; - done -} -genericBuild () -{ - - export GZIP_NO_TIMESTAMPS=1; - if [ -f "${buildCommandPath:-}" ]; then - source "$buildCommandPath"; - return; - fi; - if [ -n "${buildCommand:-}" ]; then - eval "$buildCommand"; - return; - fi; - definePhases; - for curPhase in ${phases[*]}; - do - runPhase "$curPhase"; - done -} -configurePhase () -{ - - runHook preConfigure; - : "${configureScript=}"; - if [[ -z "$configureScript" && -x ./configure ]]; then - configureScript=./configure; - fi; - if [ -z "${dontFixLibtool:-}" ]; then - export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; - local i; - find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do - echo "fixing libtool script $i"; - fixLibtool "$i"; - done; - CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); - find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; - rm -f "$CONFIGURE_MTIME_REFERENCE"; - fi; - if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; - if [ "${prefixKeyOrDefault: -1}" = " " ]; then - prependToVar configureFlags "$prefix"; - prependToVar configureFlags "${prefixKeyOrDefault::-1}"; - else - prependToVar configureFlags "$prefixKeyOrDefault$prefix"; - fi; - fi; - if [[ -f "$configureScript" ]]; then - if [ -z "${dontAddDisableDepTrack:-}" ]; then - if grep -q dependency-tracking "$configureScript"; then - prependToVar configureFlags --disable-dependency-tracking; - fi; - fi; - if [ -z "${dontDisableStatic:-}" ]; then - if grep -q enable-static "$configureScript"; then - prependToVar configureFlags --disable-static; - fi; - fi; - if [ -z "${dontPatchShebangsInConfigure:-}" ]; then - patchShebangs --build "$configureScript"; - fi; - fi; - if [ -n "$configureScript" ]; then - local -a flagsArray; - concatTo flagsArray configureFlags configureFlagsArray; - echoCmd 'configure flags' "${flagsArray[@]}"; - $configureScript "${flagsArray[@]}"; - unset flagsArray; - else - echo "no configure script, doing nothing"; - fi; - runHook postConfigure -} -_assignFirst () -{ - - local varName="$1"; - local _var; - local REMOVE=REMOVE; - shift; - for _var in "$@"; - do - if [ -n "${!_var-}" ]; then - eval "${varName}"="${_var}"; - return; - fi; - done; - echo; - echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; - echo " The following variables were all unset or empty:"; - echo " $*"; - if [ -z "${out:-}" ]; then - echo ' If you do not want an "out" output in your derivation, make sure to define'; - echo ' the other specific required outputs. This can be achieved by picking one'; - echo " of the above as an output."; - echo ' You do not have to remove "out" if you want to have a different default'; - echo ' output, because the first output is taken as a default.'; - echo; - fi; - return 1 -} -_doStrip () -{ - - local -ra flags=(dontStripHost dontStripTarget); - local -ra debugDirs=(stripDebugList stripDebugListTarget); - local -ra allDirs=(stripAllList stripAllListTarget); - local -ra stripCmds=(STRIP STRIP_FOR_TARGET); - local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); - stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; - stripDebugListTarget=${stripDebugListTarget[*]:-}; - stripAllList=${stripAllList[*]:-}; - stripAllListTarget=${stripAllListTarget[*]:-}; - local i; - for i in ${!stripCmds[@]}; - do - local -n flag="${flags[$i]}"; - local -n debugDirList="${debugDirs[$i]}"; - local -n allDirList="${allDirs[$i]}"; - local -n stripCmd="${stripCmds[$i]}"; - local -n ranlibCmd="${ranlibCmds[$i]}"; - if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then - continue; - fi; - stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; - stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; - done -} -_makeSymlinksRelative () -{ - - local prefixes; - prefixes=(); - for output in $(getAllOutputNames); - do - [ ! -e "${!output}" ] && continue; - prefixes+=("${!output}"); - done; - find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' - output="$1" - link="$2" - - linkTarget=$(readlink "$link") - - # only touch links that point inside the same output tree - [[ $linkTarget == "$output"/* ]] || exit 0 - - if [ ! -e "$linkTarget" ]; then - echo "the symlink $link is broken, it points to $linkTarget (which is missing)" - fi - - echo "making symlink relative: $link" - ln -snrf "$linkTarget" "$link" - ' _ -} -_addRpathPrefix () -{ - - if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then - export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; - fi -} -isELF () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [ "$magic" = 'ELF' ]; then - return 0; - else - return 1; - fi -} -nixInfoLog () -{ - - _nixLogWithLevel 3 "$*" -} -runPhase () -{ - - local curPhase="$*"; - if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then - return; - fi; - if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then - return; - fi; - if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then - return; - fi; - if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then - return; - fi; - if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then - return; - fi; - if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then - return; - fi; - showPhaseHeader "$curPhase"; - dumpVars; - local startTime endTime; - startTime=$(date +"%s"); - eval "${!curPhase:-$curPhase}"; - endTime=$(date +"%s"); - showPhaseFooter "$curPhase" "$startTime" "$endTime"; - if [ "$curPhase" = unpackPhase ]; then - [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; - cd -- "${sourceRoot:-.}"; - fi -} -_eval () -{ - - if declare -F "$1" > /dev/null 2>&1; then - "$@"; - else - eval "$1"; - fi -} -_multioutPropagateDev () -{ - - if [ "$(getAllOutputNames)" = "out" ]; then - return; - fi; - local outputFirst; - for outputFirst in $(getAllOutputNames); - do - break; - done; - local propagaterOutput="$outputDev"; - if [ -z "$propagaterOutput" ]; then - propagaterOutput="$outputFirst"; - fi; - if [ -z "${propagatedBuildOutputs+1}" ]; then - local po_dirty="$outputBin $outputInclude $outputLib"; - set +o pipefail; - propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; - set -o pipefail; - fi; - if [ -z "$propagatedBuildOutputs" ]; then - return; - fi; - mkdir -p "${!propagaterOutput}"/nix-support; - for output in $propagatedBuildOutputs; - do - echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; - done -} -activatePackage () -{ - - local pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - if [ -f "$pkg" ]; then - nixTalkativeLog "sourcing setup hook '$pkg'"; - source "$pkg"; - fi; - if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then - addToSearchPath _PATH "$pkg/bin"; - fi; - if (( hostOffset <= -1 )); then - addToSearchPath _XDG_DATA_DIRS "$pkg/share"; - fi; - if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then - addToSearchPath _HOST_PATH "$pkg/bin"; - fi; - if [[ -f "$pkg/nix-support/setup-hook" ]]; then - nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; - source "$pkg/nix-support/setup-hook"; - fi -} -compressManPages () -{ - - local dir="$1"; - if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then - return; - fi; - echo "gzipping man pages under $dir/share/man/"; - find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; - find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do - local target; - target="$(readlink -f "$f")"; - if [ -f "$target".gz ]; then - ln -sf "$target".gz "$f".gz && rm "$f"; - fi; - done -} -echoCmd () -{ - - printf "%s:" "$1"; - shift; - printf ' %q' "$@"; - echo -} -_addToEnv () -{ - - local depHostOffset depTargetOffset; - local pkg; - for depHostOffset in "${allPlatOffsets[@]}"; - do - local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; - local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; - for depTargetOffset in "${allPlatOffsets[@]}"; - do - (( depHostOffset <= depTargetOffset )) || continue; - local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; - if [[ -z "${strictDeps-}" ]]; then - local visitedPkgs=""; - for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; - do - if [[ "$visitedPkgs" = *"$pkg"* ]]; then - continue; - fi; - runHook "${!hookRef}" "$pkg"; - visitedPkgs+=" $pkg"; - done; - else - local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - runHook "${!hookRef}" "$pkg"; - done; - fi; - done; - done -} -_callImplicitHook () -{ - - local def="$1"; - local hookName="$2"; - if declare -F "$hookName" > /dev/null; then - nixTalkativeLog "calling implicit '$hookName' function hook"; - "$hookName"; - else - if type -p "$hookName" > /dev/null; then - nixTalkativeLog "sourcing implicit '$hookName' script hook"; - source "$hookName"; - else - if [ -n "${!hookName:-}" ]; then - nixTalkativeLog "evaling implicit '$hookName' string hook"; - eval "${!hookName}"; - else - return "$def"; - fi; - fi; - fi -} -_updateSourceDateEpochFromSourceRoot () -{ - - if [ -n "$sourceRoot" ]; then - updateSourceDateEpoch "$sourceRoot"; - fi -} -getTargetRole () -{ - - getRole "$targetOffset" -} -nixTalkativeLog () -{ - - _nixLogWithLevel 4 "$*" -} -installCheckPhase () -{ - - runHook preInstallCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom installCheckPhase, doing nothing"; - else - if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then - echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; - echoCmd 'installcheck flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - fi; - runHook postInstallCheck -} -addEnvHooks () -{ - - local depHostOffset="$1"; - shift; - local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; - local pkgHookVar; - for pkgHookVar in "${!pkgHookVarsSlice}"; - do - eval "${pkgHookVar}s"'+=("$@")'; - done -} -runHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook; - for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - _eval "$hook" "$@"; - done; - return 0 -} -isScript () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 2 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" =~ \#! ]]; then - return 0; - else - return 1; - fi -} -nixDebugLog () -{ - - _nixLogWithLevel 6 "$*" -} -stripHash () -{ - - local strippedName casematchOpt=0; - strippedName="$(basename -- "$1")"; - shopt -q nocasematch && casematchOpt=1; - shopt -u nocasematch; - if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then - echo "${strippedName:33}"; - else - echo "$strippedName"; - fi; - if (( casematchOpt )); then - shopt -s nocasematch; - fi -} -_multioutDevs () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then - return; - fi; - moveToOutput include "${!outputInclude}"; - moveToOutput lib/pkgconfig "${!outputDev}"; - moveToOutput share/pkgconfig "${!outputDev}"; - moveToOutput lib/cmake "${!outputDev}"; - moveToOutput share/aclocal "${!outputDev}"; - for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; - do - echo "Patching '$f' includedir to output ${!outputInclude}"; - sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; - done -} -noBrokenSymlinksInAllOutputs () -{ - - if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then - for output in $(getAllOutputNames); - do - noBrokenSymlinks "${!output}"; - done; - fi -} -definePhases () -{ - - if [ -z "${phases[*]:-}" ]; then - phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; - fi -} -fixLibtool () -{ - - local search_path; - for flag in $NIX_LDFLAGS; - do - case $flag in - -L*) - search_path+=" ${flag#-L}" - ;; - esac; - done; - sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' -} -patchShebangs () -{ - - local pathName; - local update=false; - while [[ $# -gt 0 ]]; do - case "$1" in - --host) - pathName=HOST_PATH; - shift - ;; - --build) - pathName=PATH; - shift - ;; - --update) - update=true; - shift - ;; - --) - shift; - break - ;; - -* | --*) - echo "Unknown option $1 supplied to patchShebangs" 1>&2; - return 1 - ;; - *) - break - ;; - esac; - done; - echo "patching script interpreter paths in $@"; - local f; - local oldPath; - local newPath; - local arg0; - local args; - local oldInterpreterLine; - local newInterpreterLine; - if [[ $# -eq 0 ]]; then - echo "No arguments supplied to patchShebangs" 1>&2; - return 0; - fi; - local f; - while IFS= read -r -d '' f; do - isScript "$f" || continue; - read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; - read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; - if [[ -z "${pathName:-}" ]]; then - if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then - pathName=HOST_PATH; - else - pathName=PATH; - fi; - fi; - if [[ "$oldPath" == *"/bin/env" ]]; then - if [[ $arg0 == "-S" ]]; then - arg0=${args%% *}; - [[ "$args" == *" "* ]] && args=${args#* } || args=; - newPath="$(PATH="${!pathName}" type -P "env" || true)"; - args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; - else - if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; - exit 1; - else - newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; - fi; - fi; - else - if [[ -z $oldPath ]]; then - oldPath="/bin/sh"; - fi; - newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; - args="$arg0 $args"; - fi; - newInterpreterLine="$newPath $args"; - newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; - if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then - if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then - echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; - escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; - timestamp=$(stat --printf "%y" "$f"); - tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); - sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; - local restoreReadOnly; - if [[ ! -w "$f" ]]; then - chmod +w "$f"; - restoreReadOnly=true; - fi; - cat "$tmpFile" > "$f"; - rm "$tmpFile"; - if [[ -n "${restoreReadOnly:-}" ]]; then - chmod -w "$f"; - fi; - touch --date "$timestamp" "$f"; - fi; - fi; - done < <(find "$@" -type f -perm -0100 -print0) -} -_overrideFirst () -{ - - if [ -z "${!1-}" ]; then - _assignFirst "$@"; - fi -} -printLines () -{ - - (( "$#" > 0 )) || return 0; - printf '%s\n' "$@" -} -substituteInPlace () -{ - - local -a fileNames=(); - for arg in "$@"; - do - if [[ "$arg" = "--"* ]]; then - break; - fi; - fileNames+=("$arg"); - shift; - done; - if ! [[ "${#fileNames[@]}" -gt 0 ]]; then - echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; - return 1; - fi; - for file in "${fileNames[@]}"; - do - substitute "$file" "$file" "$@"; - done -} -patchELF () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "shrinking RPATHs of ELF executables and libraries in $dir"; - local i; - while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if ! isELF "$i"; then - continue; - fi; - echo "shrinking $i"; - patchelf --shrink-rpath "$i" || true; - done < <(find "$dir" -type f -print0) -} -getTargetRoleEnvHook () -{ - - getRole "$depTargetOffset" -} -unpackPhase () -{ - - runHook preUnpack; - if [ -z "${srcs:-}" ]; then - if [ -z "${src:-}" ]; then - echo 'variable $src or $srcs should point to the source'; - exit 1; - fi; - srcs="$src"; - fi; - local -a srcsArray; - concatTo srcsArray srcs; - local dirsBefore=""; - for i in *; - do - if [ -d "$i" ]; then - dirsBefore="$dirsBefore $i "; - fi; - done; - for i in "${srcsArray[@]}"; - do - unpackFile "$i"; - done; - : "${sourceRoot=}"; - if [ -n "${setSourceRoot:-}" ]; then - runOneHook setSourceRoot; - else - if [ -z "$sourceRoot" ]; then - for i in *; - do - if [ -d "$i" ]; then - case $dirsBefore in - *\ $i\ *) - - ;; - *) - if [ -n "$sourceRoot" ]; then - echo "unpacker produced multiple directories"; - exit 1; - fi; - sourceRoot="$i" - ;; - esac; - fi; - done; - fi; - fi; - if [ -z "$sourceRoot" ]; then - echo "unpacker appears to have produced no directories"; - exit 1; - fi; - echo "source root is $sourceRoot"; - if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then - chmod -R u+w -- "$sourceRoot"; - fi; - runHook postUnpack -} -patchShebangsAuto () -{ - - if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then - if [[ "$output" != out && "$output" = "$outputDev" ]]; then - patchShebangs --build "$prefix"; - else - patchShebangs --host "$prefix"; - fi; - fi -} -stripDirs () -{ - - local cmd="$1"; - local ranlibCmd="$2"; - local paths="$3"; - local stripFlags="$4"; - local excludeFlags=(); - local pathsNew=; - [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; - [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; - local pattern; - if [ -n "${stripExclude:-}" ]; then - for pattern in "${stripExclude[@]}"; - do - excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); - done; - fi; - local p; - for p in ${paths}; - do - if [ -e "$prefix/$p" ]; then - pathsNew="${pathsNew} $prefix/$p"; - fi; - done; - paths=${pathsNew}; - if [ -n "${paths}" ]; then - echo "stripping (with command $cmd and flags $stripFlags) in $paths"; - local striperr; - striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; - find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; - [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); - rm "$striperr"; - find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; - fi -} -addPythonPath () -{ - - addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.12/site-packages -} -_moveLib64 () -{ - - if [ "${dontMoveLib64-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then - return; - fi; - echo "moving $prefix/lib64/* to $prefix/lib"; - mkdir -p $prefix/lib; - shopt -s dotglob; - for i in $prefix/lib64/*; - do - mv --no-clobber "$i" $prefix/lib; - done; - shopt -u dotglob; - rmdir $prefix/lib64; - ln -s lib $prefix/lib64 -} -PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" -XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" - -eval "${shellHook:-}" -shopt -s expand_aliases - -exec /tmp/devenv-envrfkSEO/script \ No newline at end of file diff --git a/.devenv/shell-cea9d893b2194fc0.sh b/.devenv/shell-cea9d893b2194fc0.sh deleted file mode 100755 index 26052a64..00000000 --- a/.devenv/shell-cea9d893b2194fc0.sh +++ /dev/null @@ -1,2346 +0,0 @@ -if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then - source $HOME/.bashrc; -fi - -shopt -u expand_aliases -PATH=${PATH:-} -nix_saved_PATH="$PATH" -XDG_DATA_DIRS=${XDG_DATA_DIRS:-} -nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" -PKG_CONFIG='pkg-config' -export PKG_CONFIG -prefix='/nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env' -outputs='out' -export outputs -LD_LIBRARY_PATH='/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib:/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib:/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib:/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib:/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib:/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib:/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib:/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib' -export LD_LIBRARY_PATH -outputBin='out' -doInstallCheck='' -export doInstallCheck -outputDevman='out' -depsTargetTarget='' -export depsTargetTarget -SOURCE_DATE_EPOCH='315532800' -export SOURCE_DATE_EPOCH -DEVENV_ROOT='/home/thinky/Projects/RayTracing' -export DEVENV_ROOT -STRINGS='strings' -export STRINGS -DEVENV_DOTFILE='/home/thinky/Projects/RayTracing/.devenv' -export DEVENV_DOTFILE -pkg='/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' -propagatedBuildInputs='' -export propagatedBuildInputs -outputInclude='out' -PYTHONPATH='/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib/python3.12/site-packages:/nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13/lib/python3.12/site-packages' -export PYTHONPATH -declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) -declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) -DEVENV_RUNTIME='/run/user/1000/devenv-db47dbe' -export DEVENV_RUNTIME -PYTHONHASHSEED='0' -export PYTHONHASHSEED -CC='gcc' -export CC -preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' -PKG_CONFIG_PATH='/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/lib/pkgconfig:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib/pkgconfig:/nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/lib/pkgconfig:/nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/lib/pkgconfig:/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/share/pkgconfig:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/lib/pkgconfig:/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/share/pkgconfig:/nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/lib/pkgconfig:/nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/lib/pkgconfig:/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/lib/pkgconfig:/nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/lib/pkgconfig:/nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/lib/pkgconfig:/nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/lib/pkgconfig:/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib/pkgconfig:/nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/lib/pkgconfig:/nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/lib/pkgconfig:/nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/lib/pkgconfig:/nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/lib/pkgconfig:/nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/lib/pkgconfig' -export PKG_CONFIG_PATH -NIX_BUILD_CORES='4' -export NIX_BUILD_CORES -declare -a envBuildHostHooks=('addPythonPath' 'sysconfigdataHook' ) -PATH='/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9/bin:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0/bin:/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/bin:/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin/bin:/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/bin:/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/bin:/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2/bin:/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2/bin:/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0/bin:/nix/store/sca0pf46jmxva40qahkcwys5c1lvk6n2-gcc-15.2.0/bin:/nix/store/2c48s343k15i0cmwb9cp1vi6randmzcw-glibc-2.42-51-bin/bin:/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44/bin:/nix/store/9nmzd62x45ayp4vmswvn6z45h6bzrsla-binutils-2.44/bin:/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0/bin:/nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12/bin:/nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9/bin:/nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12/bin:/nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2/bin:/nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35/bin:/nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1/bin:/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin:/nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8/bin:/nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin/bin:/nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45/bin' -export PATH -NIX_BINTOOLS='/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44' -export NIX_BINTOOLS -OSTYPE='linux-gnu' -SHELL='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' -export SHELL -XDG_DATA_DIRS='/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9/share:/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/share:/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/share:/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/share:/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/share:/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/share:/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0/share:/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/share:/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin/share:/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/share:/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/share:/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/share:/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/share:/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/share:/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2/share:/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2/share' -export XDG_DATA_DIRS -strictDeps='' -export strictDeps -outputInfo='out' -DETERMINISTIC_BUILD='1' -export DETERMINISTIC_BUILD -NIX_LDFLAGS='-rpath /nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env/lib -L/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib -L/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib -L/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8/lib -L/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib/lib -L/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55/lib -L/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/lib -L/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/lib -L/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib -L/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib -L/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/lib -L/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib -L/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib -L/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib -L/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib -L/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/lib -L/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib -L/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib -L/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib -L/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/lib -L/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib -L/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8/lib -L/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib/lib -L/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55/lib -L/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3/lib -L/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib/lib -L/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12/lib -L/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12/lib -L/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9/lib -L/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib -L/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib -L/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib/lib -L/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0/lib -L/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12/lib -L/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7/lib -L/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2/lib -L/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6/lib' -export NIX_LDFLAGS -dontAddDisableDepTrack='1' -export dontAddDisableDepTrack -LINENO='79' -DEVENV_STATE='/home/thinky/Projects/RayTracing/.devenv/state' -export DEVENV_STATE -NIX_CFLAGS_COMPILE=' -frandom-seed=q5rbqaawx4 -isystem /nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/include -isystem /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/include -isystem /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/include -isystem /nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/include -isystem /nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/include -isystem /nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/include -isystem /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/include -isystem /nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/include -isystem /nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/include -isystem /nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/include -isystem /nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/include -isystem /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/include -isystem /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/include -isystem /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/include -isystem /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/include -isystem /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/include -isystem /nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/include -isystem /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/include -isystem /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/include -isystem /nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/include -isystem /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/include -isystem /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev/include -isystem /nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev/include -isystem /nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1/include -isystem /nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev/include -isystem /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/include -isystem /nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev/include -isystem /nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev/include -isystem /nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev/include -isystem /nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev/include -isystem /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev/include -isystem /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev/include -isystem /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/include -isystem /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev/include -isystem /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev/include -isystem /nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev/include -isystem /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev/include -isystem /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev/include' -export NIX_CFLAGS_COMPILE -OBJCOPY='objcopy' -export OBJCOPY -READELF='readelf' -export READELF -declare -a pkgsHostHost=() -declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -OPTERR='1' -depsBuildBuild='' -export depsBuildBuild -configureFlags='' -export configureFlags -TCLLIBPATH='/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib/tk8.6' -export TCLLIBPATH -OLDPWD='' -export OLDPWD -DEVENV_PROFILE='/nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile' -export DEVENV_PROFILE -cmakeFlags='' -export cmakeFlags -depsHostHost='' -export depsHostHost -system='x86_64-linux' -export system -defaultBuildInputs='' -out='/nix/store/q5rbqaawx4bbj3xfihmxzipfvcdil8gl-devenv-shell-env' -export out -NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -__structuredAttrs='' -export __structuredAttrs -outputDevdoc='REMOVE' -CONFIG_SHELL='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' -export CONFIG_SHELL -NIX_ENFORCE_NO_NATIVE='1' -export NIX_ENFORCE_NO_NATIVE -mesonFlags='' -export mesonFlags -outputMan='out' -HOSTTYPE='x86_64' -doCheck='' -export doCheck -shell='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' -export shell -nativeBuildInputs='/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13 /nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13 /nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev /nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16 /nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib /nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev /nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev /nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev /nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev /nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev /nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev /nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev /nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2' -export nativeBuildInputs -IFS=' -' -depsHostHostPropagated='' -export depsHostHostPropagated -declare -a pkgsHostTarget=() -declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) -MACHTYPE='x86_64-pc-linux-gnu' -BASH='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' -PS4='+ ' -_PYTHON_HOST_PLATFORM='linux-x86_64' -export _PYTHON_HOST_PLATFORM -declare -a pkgsTargetTarget=() -propagatedNativeBuildInputs='' -export propagatedNativeBuildInputs -declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -CXX='g++' -export CXX -stdenv='/nix/store/zkiy4zv8wz3v95bj6fdmkqwql8x1vnhb-stdenv-linux' -export stdenv -hardeningDisable='' -export hardeningDisable -NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -DEVENV_TASK_FILE='/nix/store/c2yi54kd0hnlqgm9s5vrw12hm7kar3rl-tasks.json' -export DEVENV_TASK_FILE -TK_LIBRARY='/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16/lib/tk8.6.16' -export TK_LIBRARY -AS='as' -export AS -declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) -declare -a envBuildBuildHooks=('addPythonPath' 'sysconfigdataHook' ) -outputLib='out' -NIX_STORE='/nix/store' -export NIX_STORE -HOST_PATH='/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0/bin:/nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12/bin:/nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9/bin:/nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12/bin:/nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2/bin:/nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35/bin:/nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1/bin:/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin:/nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8/bin:/nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin/bin:/nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45/bin' -export HOST_PATH -STRIP='strip' -export STRIP -defaultNativeBuildInputs='/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2 /nix/store/gz3rknshr1ywis4mjaqrgj3z2shp3n3v-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' -PIP_DISABLE_PIP_VERSION_CHECK='1' -export PIP_DISABLE_PIP_VERSION_CHECK -NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningextensive libcxxhardeningfast pic relro stackclashprotection stackprotector strictoverflow zerocallusedregs' -export NIX_HARDENING_ENABLE -buildPhase='{ echo "------------------------------------------------------------"; - echo " WARNING: the existence of this path is not guaranteed."; - echo " It is an internal implementation detail for pkgs.mkShell."; - echo "------------------------------------------------------------"; - echo; - # Record all build inputs as runtime dependencies - export; -} >> "$out" -' -export buildPhase -depsBuildTargetPropagated='' -export depsBuildTargetPropagated -initialPath='/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10 /nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0 /nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12 /nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9 /nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12 /nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2 /nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35 /nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14 /nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin /nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1 /nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9 /nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8 /nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin /nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45' -RANLIB='ranlib' -export RANLIB -SIZE='size' -export SIZE -preferLocalBuild='1' -export preferLocalBuild -LD='ld' -export LD -declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) -name='devenv-shell-env' -export name -declare -a envTargetTargetHooks=() -declare -a unpackCmdHooks=('_defaultUnpack' ) -declare -a pkgsBuildHost=('/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev' '/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9' '/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13' '/nix/store/0hj94c3jx1wzzhb16a9fs4a6nl1fdlsl-python3.12-tkinter-3.12.13' '/nix/store/cppn39rhdflp01k3kv9ygyx9vdqifbxp-tk-8.6.16-dev' '/nix/store/4jbj6hzq9lhpjbg5h5mcvdlwzw67rxxh-libxft-2.3.9-dev' '/nix/store/qh282gd7s1vyn3f6k0p5vxax579spbw6-xorgproto-2025.1' '/nix/store/374f5mfap8y7i6rzc3qnq249ym1nxfdq-freetype-2.13.3-dev' '/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev' '/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1' '/nix/store/f2zvkh7iizs8y2r443kv9c2vk4h2y90m-bzip2-1.0.8-dev' '/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin' '/nix/store/ydpw9xwv0j5v8swa6wlz1ag2p19635mi-bzip2-1.0.8' '/nix/store/m8x59ybbd4hycpswc27vj7hjyng7q7w6-brotli-1.2.0-dev' '/nix/store/sb2rv4sivgmmgdwszyhjbsb51gs3dpai-brotli-1.2.0-lib' '/nix/store/3y8jfnbcv230kip514qh2wmfifihzvqp-brotli-1.2.0' '/nix/store/678ygbangkyc4yb5xm7qb4psfpk3vw4c-libpng-apng-1.6.55-dev' '/nix/store/bm62iznvisqil197w8g9kmivra2fv7iv-libpng-apng-1.6.55' '/nix/store/n9jq6ks3q2kkzw3davzgpsvmpb8v6siy-freetype-2.13.3' '/nix/store/n1dpdbrj2s14l02b822jql8kc238zxh7-fontconfig-2.17.1-dev' '/nix/store/g21qfm40ppq15mmz6n8l48m5k26i8ngf-fontconfig-2.17.1-bin' '/nix/store/nqx5zb6fl85lvz2mbs2rryjf8p8bhi43-fontconfig-2.17.1-lib' '/nix/store/xr8bh0qk2d1jj3yvi2k8flhdal3svy0q-libxrender-0.9.12-dev' '/nix/store/hppiap02zqbx9d3bh0xpzbmnp5ai2d11-libx11-1.8.12-dev' '/nix/store/zdbhp4571kff54fwr71laia1p5yxw330-libx11-1.8.12' '/nix/store/2gga4457ryz42kqk39s27maspnkbi41k-libxrender-0.9.12' '/nix/store/55cyrj2wpgci3sxfp8055ff12gcjyb36-libxft-2.3.9' '/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16' '/nix/store/dvmkbvfknrd07k0z9k362jd4il0qc23q-tk-8.6.16' '/nix/store/ihpdbhy4rfxaixiamyb588zfc3vj19al-gcc-15.2.0-lib' '/nix/store/3drkfkyzxfb9rcpnv1xy0nvdj78qngy8-libglvnd-1.7.0-dev' '/nix/store/wwckb31fcbwj479g7qwcb3b7cv6416pf-libglvnd-1.7.0' '/nix/store/7cxd1fc7plwpfr1k4l9d58xv46dingpw-libxext-1.3.7-dev' '/nix/store/zbhrpx2wh8cvs8k638lgrnvgjfkyn92v-libxau-1.0.12-dev' '/nix/store/68c9nshhpmv29p2wpb3yyjj2f48acaf5-libxau-1.0.12' '/nix/store/21fbccim7r77ppvnl0mgbwj16djx1qpa-libxext-1.3.7' '/nix/store/qlp5pfbir0f56d4c6liiglysx3fgcypq-libsm-1.2.6-dev' '/nix/store/bw3vsip9zynsls25j65riplxmj81ng3w-libice-1.1.2-dev' '/nix/store/5xvlm1fdqklyjc10rkcwg5m2kn4ka1m6-libice-1.1.2' '/nix/store/p9h8sdhy5mck20f7rs7i2yx45c6nv87w-libsm-1.2.6' '/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2' '/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2' '/nix/store/gz3rknshr1ywis4mjaqrgj3z2shp3n3v-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' '/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44' ) -phases='buildPhase' -export phases -depsBuildBuildPropagated='' -export depsBuildBuildPropagated -OBJDUMP='objdump' -export OBJDUMP -declare -a pkgsBuildBuild=() -_PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu' -export _PYTHON_SYSCONFIGDATA_NAME -NIX_NO_SELF_RPATH='1' -shellHook=' -export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" - -# Override temp directories that stdenv set to NIX_BUILD_TOP. -# Only reset those that still point to the Nix build dir; leave -# any user/CI-supplied value intact so child processes (e.g. -# `devenv processes wait`) compute the same runtime directory. -for var in TMP TMPDIR TEMP TEMPDIR; do - if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then - export "$var"=/tmp - fi -done -if [ -n "${NIX_BUILD_TOP-}" ]; then - unset NIX_BUILD_TOP -fi - -# set path to locales on non-NixOS Linux hosts -if [ -z "${LOCALE_ARCHIVE-}" ]; then - export LOCALE_ARCHIVE=/nix/store/q6y3frkqaq8v7va2rmgaq6jvhy1vb9q3-glibc-locales-2.42-51/lib/locale/locale-archive -fi - - -# direnv helper -if [ ! type -p direnv &>/dev/null && -f .envrc ]; then - echo "An .envrc file was detected, but the direnv command is not installed." - echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html" -fi - -mkdir -p "$DEVENV_STATE" -if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile" ] -then - ln -snf /nix/store/5fj5byxn0wrxfrswls3kmxhdhgbw2861-devenv-profile "$DEVENV_DOTFILE/profile" -fi -unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps - -mkdir -p /run/user/1000/devenv-db47dbe -ln -snf /run/user/1000/devenv-db47dbe /home/thinky/Projects/RayTracing/.devenv/run - - -echo "✨ devenv 2.0.3 is out of date. Please update to 2.0.6: https://devenv.sh/getting-started/#installation" >&2 - - -# Check whether the direnv integration is out of date. -{ - if [[ ":${DIRENV_ACTIVE-}:" == *":/home/thinky/Projects/RayTracing:"* ]]; then - if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then - if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then - direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "") - - echo "✨ The direnv integration in your .envrc is out of date." - echo "" - echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. " - if [[ -n "$direnv_line" ]]; then - echo "To enable this feature, replace the following line in your .envrc:" - echo "" - echo " $direnv_line" - echo "" - echo "with:" - echo "" - echo " eval \"\$(devenv direnvrc)\"" - else - echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:" - echo "" - echo " eval \"$(devenv direnvrc)\"" - fi - echo "" - echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/." - echo "" - echo "To disable this message:" - echo "" - echo " Add the following environment to your .envrc before \`use devenv\`:" - echo "" - echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1" - echo "" - echo " Or set the following option in your devenv configuration:" - echo "" - echo " devenv.warnOnNewVersion = false;" - echo "" - fi - fi - fi -} >&2 - -echo "RayTracing devenv" -echo "Python $(/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin/python --version | cut -d'\'' '\'' -f2)" - -if [ ! -x "$VENV_DIR/bin/python" ]; then - /nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13/bin/python -m venv --system-site-packages "$VENV_DIR" -fi - -. "$VENV_DIR/bin/activate" - -python -m ensurepip --upgrade >/dev/null 2>&1 || true -python -m pip install --upgrade pip setuptools wheel build >/dev/null -python -m pip install --upgrade -e ".[gui]" pillow basedpyright ruff >/dev/null - -export PATH="$PWD/$VENV_DIR/bin:$PATH" - -' -export shellHook -depsBuildTarget='' -export depsBuildTarget -IN_NIX_SHELL='impure' -export IN_NIX_SHELL -TCL_LIBRARY='/nix/store/jsjy1nxrpsxyp017pdv685hkl6fvcg06-tcl-8.6.16/lib/tcl8.6.16' -export TCL_LIBRARY -outputDoc='out' -outputDev='out' -declare -a pkgsBuildTarget=() -NM='nm' -export NM -declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) -DEVENV_TASKS='' -export DEVENV_TASKS -VENV_DIR='.devenv/state/venv' -export VENV_DIR -depsTargetTargetPropagated='' -export depsTargetTargetPropagated -declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' ) -AR='ar' -export AR -declare -a preConfigureHooks=('_multioutConfig' ) -declare -a envBuildTargetHooks=('addPythonPath' 'sysconfigdataHook' ) -patches='' -export patches -NIX_CC='/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' -export NIX_CC -_substituteStream_has_warned_replace_deprecation='false' -buildInputs='' -export buildInputs -builder='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash' -export builder -PYTHONNOUSERSITE='1' -export PYTHONNOUSERSITE -distPhase () -{ - - runHook preDist; - local flagsArray=(); - concatTo flagsArray distFlags distFlagsArray distTarget=dist; - echo 'dist flags: %q' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - if [ "${dontCopyDist:-0}" != 1 ]; then - mkdir -p "$out/tarballs"; - cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; - fi; - runHook postDist -} -nixLog () -{ - - [[ -z ${NIX_LOG_FD-} ]] && return 0; - local callerName="${FUNCNAME[1]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" -} -patchShebangsAuto () -{ - - if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then - if [[ "$output" != out && "$output" = "$outputDev" ]]; then - patchShebangs --build "$prefix"; - else - patchShebangs --host "$prefix"; - fi; - fi -} -addEnvHooks () -{ - - local depHostOffset="$1"; - shift; - local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; - local pkgHookVar; - for pkgHookVar in "${!pkgHookVarsSlice}"; - do - eval "${pkgHookVar}s"'+=("$@")'; - done -} -patchELF () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "shrinking RPATHs of ELF executables and libraries in $dir"; - local i; - while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if ! isELF "$i"; then - continue; - fi; - echo "shrinking $i"; - patchelf --shrink-rpath "$i" || true; - done < <(find "$dir" -type f -print0) -} -substitute () -{ - - local input="$1"; - local output="$2"; - shift 2; - if [ ! -f "$input" ]; then - echo "substitute(): ERROR: file '$input' does not exist" 1>&2; - return 1; - fi; - local content; - consumeEntire content < "$input"; - if [ -e "$output" ]; then - chmod +w "$output"; - fi; - substituteStream content "file '$input'" "$@" > "$output" -} -echoCmd () -{ - - printf "%s:" "$1"; - shift; - printf ' %q' "$@"; - echo -} -noBrokenSymlinks () -{ - - local -r output="${1:?}"; - local path; - local pathParent; - local symlinkTarget; - local -i numDanglingSymlinks=0; - local -i numReflexiveSymlinks=0; - local -i numUnreadableSymlinks=0; - if [[ ! -e $output ]]; then - nixWarnLog "skipping non-existent output $output"; - return 0; - fi; - nixInfoLog "running on $output"; - while IFS= read -r -d '' path; do - pathParent="$(dirname "$path")"; - if ! symlinkTarget="$(readlink "$path")"; then - nixErrorLog "the symlink $path is unreadable"; - numUnreadableSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget == /* ]]; then - nixInfoLog "symlink $path points to absolute target $symlinkTarget"; - else - nixInfoLog "symlink $path points to relative target $symlinkTarget"; - symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; - fi; - if [[ $symlinkTarget = "$TMPDIR"/* ]]; then - nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; - numDanglingSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then - nixInfoLog "symlink $path points outside the Nix store; ignoring"; - continue; - fi; - if [[ $path == "$symlinkTarget" ]]; then - nixErrorLog "the symlink $path is reflexive"; - numReflexiveSymlinks+=1; - else - if [[ ! -e $symlinkTarget ]]; then - nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; - numDanglingSymlinks+=1; - else - nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; - fi; - fi; - done < <(find "$output" -type l -print0); - if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then - nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; - exit 1; - fi; - return 0 -} -substituteInPlace () -{ - - local -a fileNames=(); - for arg in "$@"; - do - if [[ "$arg" = "--"* ]]; then - break; - fi; - fileNames+=("$arg"); - shift; - done; - if ! [[ "${#fileNames[@]}" -gt 0 ]]; then - echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; - return 1; - fi; - for file in "${fileNames[@]}"; - do - substitute "$file" "$file" "$@"; - done -} -appendToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=(${nameref+"${nameref[@]}"} "$@"); - else - nameref="${nameref-} $*"; - fi -} -mapOffset () -{ - - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi -} -getTargetRoleWrapper () -{ - - case $targetOffset in - -1) - export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 - ;; - 0) - export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 - ;; - 1) - export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 - ;; - *) - echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -_callImplicitHook () -{ - - local def="$1"; - local hookName="$2"; - if declare -F "$hookName" > /dev/null; then - nixTalkativeLog "calling implicit '$hookName' function hook"; - "$hookName"; - else - if type -p "$hookName" > /dev/null; then - nixTalkativeLog "sourcing implicit '$hookName' script hook"; - source "$hookName"; - else - if [ -n "${!hookName:-}" ]; then - nixTalkativeLog "evaling implicit '$hookName' string hook"; - eval "${!hookName}"; - else - return "$def"; - fi; - fi; - fi -} -consumeEntire () -{ - - if IFS='' read -r -d '' "$1"; then - echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; - return 1; - fi -} -exitHandler () -{ - - exitCode="$?"; - set +e; - if [ -n "${showBuildStats:-}" ]; then - read -r -d '' -a buildTimes < <(times); - echo "build times:"; - echo "user time for the shell ${buildTimes[0]}"; - echo "system time for the shell ${buildTimes[1]}"; - echo "user time for all child processes ${buildTimes[2]}"; - echo "system time for all child processes ${buildTimes[3]}"; - fi; - if (( "$exitCode" != 0 )); then - runHook failureHook; - if [ -n "${succeedOnFailure:-}" ]; then - echo "build failed with exit code $exitCode (ignored)"; - mkdir -p "$out/nix-support"; - printf "%s" "$exitCode" > "$out/nix-support/failed"; - exit 0; - fi; - else - runHook exitHook; - fi; - return "$exitCode" -} -noBrokenSymlinksInAllOutputs () -{ - - if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then - for output in $(getAllOutputNames); - do - noBrokenSymlinks "${!output}"; - done; - fi -} -isELF () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [ "$magic" = 'ELF' ]; then - return 0; - else - return 1; - fi -} -addToSearchPath () -{ - - addToSearchPathWithCustomDelimiter ":" "$@" -} -_allFlags () -{ - - export system pname name version; - while IFS='' read -r varName; do - nixTalkativeLog "@${varName}@ -> ${!varName}"; - args+=("--subst-var" "$varName"); - done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') -} -_eval () -{ - - if declare -F "$1" > /dev/null 2>&1; then - "$@"; - else - eval "$1"; - fi -} -runOneHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook ret=1; - for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - if _eval "$hook" "$@"; then - ret=0; - break; - fi; - done; - return "$ret" -} -addToSearchPathWithCustomDelimiter () -{ - - local delimiter="$1"; - local varName="$2"; - local dir="$3"; - if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then - export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; - fi -} -findInputs () -{ - - local -r pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - local varVar="${pkgAccumVarVars[hostOffset + 1]}"; - local varRef="$varVar[$((targetOffset - hostOffset))]"; - local var="${!varRef}"; - unset -v varVar varRef; - local varSlice="$var[*]"; - case " ${!varSlice-} " in - *" $pkg "*) - return 0 - ;; - esac; - unset -v varSlice; - eval "$var"'+=("$pkg")'; - if ! [ -e "$pkg" ]; then - echo "build input $pkg does not exist" 1>&2; - exit 1; - fi; - function mapOffset () - { - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi - }; - local relHostOffset; - for relHostOffset in "${allPlatOffsets[@]}"; - do - local files="${propagatedDepFilesVars[relHostOffset + 1]}"; - local hostOffsetNext; - mapOffset "$relHostOffset" hostOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - local relTargetOffset; - for relTargetOffset in "${allPlatOffsets[@]}"; - do - (( "$relHostOffset" <= "$relTargetOffset" )) || continue; - local fileRef="${files}[$relTargetOffset - $relHostOffset]"; - local file="${!fileRef}"; - unset -v fileRef; - local targetOffsetNext; - mapOffset "$relTargetOffset" targetOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - [[ -f "$pkg/nix-support/$file" ]] || continue; - local pkgNext; - read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; - for pkgNext in $pkgNext; - do - findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; - done; - done; - done -} -runHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook; - for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - _eval "$hook" "$@"; - done; - return 0 -} -nixInfoLog () -{ - - _nixLogWithLevel 3 "$*" -} -addPythonPath () -{ - - addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.12/site-packages -} -activatePackage () -{ - - local pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - if [ -f "$pkg" ]; then - nixTalkativeLog "sourcing setup hook '$pkg'"; - source "$pkg"; - fi; - if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then - addToSearchPath _PATH "$pkg/bin"; - fi; - if (( hostOffset <= -1 )); then - addToSearchPath _XDG_DATA_DIRS "$pkg/share"; - fi; - if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then - addToSearchPath _HOST_PATH "$pkg/bin"; - fi; - if [[ -f "$pkg/nix-support/setup-hook" ]]; then - nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; - source "$pkg/nix-support/setup-hook"; - fi -} -_nixLogWithLevel () -{ - - [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; - local logLevel; - case "${1:?}" in - 0) - logLevel=ERROR - ;; - 1) - logLevel=WARN - ;; - 2) - logLevel=NOTICE - ;; - 3) - logLevel=INFO - ;; - 4) - logLevel=TALKATIVE - ;; - 5) - logLevel=CHATTY - ;; - 6) - logLevel=DEBUG - ;; - 7) - logLevel=VOMIT - ;; - *) - echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; - return 1 - ;; - esac; - local callerName="${FUNCNAME[2]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" -} -installCheckPhase () -{ - - runHook preInstallCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom installCheckPhase, doing nothing"; - else - if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then - echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; - echoCmd 'installcheck flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - fi; - runHook postInstallCheck -} -fixupPhase () -{ - - local output; - for output in $(getAllOutputNames); - do - if [ -e "${!output}" ]; then - chmod -R u+w,u-s,g-s "${!output}"; - fi; - done; - runHook preFixup; - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" runHook fixupOutput; - done; - recordPropagatedDependencies; - if [ -n "${setupHook:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; - fi; - if [ -n "${setupHooks:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - local hook; - for hook in ${setupHooks[@]}; - do - local content; - consumeEntire content < "$hook"; - substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; - unset -v content; - done; - unset -v hook; - fi; - if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then - mkdir -p "${!outputBin}/nix-support"; - printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; - fi; - runHook postFixup -} -_multioutDocs () -{ - - local REMOVE=REMOVE; - moveToOutput share/info "${!outputInfo}"; - moveToOutput share/doc "${!outputDoc}"; - moveToOutput share/gtk-doc "${!outputDevdoc}"; - moveToOutput share/devhelp/books "${!outputDevdoc}"; - moveToOutput share/man "${!outputMan}"; - moveToOutput share/man/man3 "${!outputDevman}" -} -isScript () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 2 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" =~ \#! ]]; then - return 0; - else - return 1; - fi -} -_makeSymlinksRelative () -{ - - local prefixes; - prefixes=(); - for output in $(getAllOutputNames); - do - [ ! -e "${!output}" ] && continue; - prefixes+=("${!output}"); - done; - find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' - output="$1" - link="$2" - - linkTarget=$(readlink "$link") - - # only touch links that point inside the same output tree - [[ $linkTarget == "$output"/* ]] || exit 0 - - if [ ! -e "$linkTarget" ]; then - echo "the symlink $link is broken, it points to $linkTarget (which is missing)" - fi - - echo "making symlink relative: $link" - ln -snrf "$linkTarget" "$link" - ' _ -} -_multioutDevs () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then - return; - fi; - moveToOutput include "${!outputInclude}"; - moveToOutput lib/pkgconfig "${!outputDev}"; - moveToOutput share/pkgconfig "${!outputDev}"; - moveToOutput lib/cmake "${!outputDev}"; - moveToOutput share/aclocal "${!outputDev}"; - for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; - do - echo "Patching '$f' includedir to output ${!outputInclude}"; - sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; - done -} -showPhaseHeader () -{ - - local phase="$1"; - echo "Running phase: $phase"; - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" -} -sysconfigdataHook () -{ - - if [ "$1" = '/nix/store/ja66iyv96y1cbjhj7fl5ghqqmy9fyacj-python3-3.12.13' ]; then - export _PYTHON_HOST_PLATFORM='linux-x86_64'; - export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; - fi -} -_addToTclLibPath () -{ - - local tclPkg="$1"; - if [[ -z "$tclPkg" ]]; then - return; - fi; - if [[ ! -d "$tclPkg" ]]; then - echo "can't add $tclPkg to TCLLIBPATH; that directory doesn't exist" 1>&2; - exit 1; - fi; - if [[ "$tclPkg" == *" "* ]]; then - tclPkg="{$tclPkg}"; - fi; - if [[ -z "${TCLLIBPATH-}" ]]; then - export TCLLIBPATH="$tclPkg"; - else - if [[ "$TCLLIBPATH " != *"$tclPkg "* ]]; then - export TCLLIBPATH="${TCLLIBPATH} $tclPkg"; - fi; - fi -} -configurePhase () -{ - - runHook preConfigure; - : "${configureScript=}"; - if [[ -z "$configureScript" && -x ./configure ]]; then - configureScript=./configure; - fi; - if [ -z "${dontFixLibtool:-}" ]; then - export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; - local i; - find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do - echo "fixing libtool script $i"; - fixLibtool "$i"; - done; - CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); - find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; - rm -f "$CONFIGURE_MTIME_REFERENCE"; - fi; - if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; - if [ "${prefixKeyOrDefault: -1}" = " " ]; then - prependToVar configureFlags "$prefix"; - prependToVar configureFlags "${prefixKeyOrDefault::-1}"; - else - prependToVar configureFlags "$prefixKeyOrDefault$prefix"; - fi; - fi; - if [[ -f "$configureScript" ]]; then - if [ -z "${dontAddDisableDepTrack:-}" ]; then - if grep -q dependency-tracking "$configureScript"; then - prependToVar configureFlags --disable-dependency-tracking; - fi; - fi; - if [ -z "${dontDisableStatic:-}" ]; then - if grep -q enable-static "$configureScript"; then - prependToVar configureFlags --disable-static; - fi; - fi; - if [ -z "${dontPatchShebangsInConfigure:-}" ]; then - patchShebangs --build "$configureScript"; - fi; - fi; - if [ -n "$configureScript" ]; then - local -a flagsArray; - concatTo flagsArray configureFlags configureFlagsArray; - echoCmd 'configure flags' "${flagsArray[@]}"; - $configureScript "${flagsArray[@]}"; - unset flagsArray; - else - echo "no configure script, doing nothing"; - fi; - runHook postConfigure -} -installPhase () -{ - - runHook preInstall; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom installPhase, doing nothing"; - runHook postInstall; - return; - else - foundMakefile=1; - fi; - if [ -n "$prefix" ]; then - mkdir -p "$prefix"; - fi; - local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; - echoCmd 'install flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - runHook postInstall -} -patchPhase () -{ - - runHook prePatch; - local -a patchesArray; - concatTo patchesArray patches; - local -a flagsArray; - concatTo flagsArray patchFlags=-p1; - for i in "${patchesArray[@]}"; - do - echo "applying patch $i"; - local uncompress=cat; - case "$i" in - *.gz) - uncompress="gzip -d" - ;; - *.bz2) - uncompress="bzip2 -d" - ;; - *.xz) - uncompress="xz -d" - ;; - *.lzma) - uncompress="lzma -d" - ;; - esac; - $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; - done; - runHook postPatch -} -stripDirs () -{ - - local cmd="$1"; - local ranlibCmd="$2"; - local paths="$3"; - local stripFlags="$4"; - local excludeFlags=(); - local pathsNew=; - [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; - [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; - local pattern; - if [ -n "${stripExclude:-}" ]; then - for pattern in "${stripExclude[@]}"; - do - excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); - done; - fi; - local p; - for p in ${paths}; - do - if [ -e "$prefix/$p" ]; then - pathsNew="${pathsNew} $prefix/$p"; - fi; - done; - paths=${pathsNew}; - if [ -n "${paths}" ]; then - echo "stripping (with command $cmd and flags $stripFlags) in $paths"; - local striperr; - striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; - find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; - [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); - rm "$striperr"; - find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; - fi -} -substituteAllInPlace () -{ - - local fileName="$1"; - shift; - substituteAll "$fileName" "$fileName" "$@" -} -toPythonPath () -{ - - local paths="$1"; - local result=; - for i in $paths; - do - p="$i/lib/python3.12/site-packages"; - result="${result}${result:+:}$p"; - done; - echo $result -} -checkPhase () -{ - - runHook preCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom checkPhase, doing nothing"; - runHook postCheck; - return; - fi; - if [[ -z "${checkTarget:-}" ]]; then - if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then - checkTarget="check"; - else - if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then - checkTarget="test"; - fi; - fi; - fi; - if [[ -z "${checkTarget:-}" ]]; then - echo "no check/test target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; - echoCmd 'check flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postCheck -} -updateAutotoolsGnuConfigScriptsPhase () -{ - - if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then - return; - fi; - for script in config.sub config.guess; - do - for f in $(find . -type f -name "$script"); - do - echo "Updating Autotools / GNU config script to a newer upstream version: $f"; - cp -f "/nix/store/s0xj50a5awma0jwgsqws61014nxzxy19-gnu-config-2024-01-01/$script" "$f"; - done; - done -} -buildPhase () -{ - - runHook preBuild; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom buildPhase, doing nothing"; - else - foundMakefile=1; - local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; - echoCmd 'build flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postBuild -} -_moveToShare () -{ - - if [ -n "$__structuredAttrs" ]; then - if [ -z "${forceShare-}" ]; then - forceShare=(man doc info); - fi; - else - forceShare=(${forceShare:-man doc info}); - fi; - if [[ -z "$out" ]]; then - return; - fi; - for d in "${forceShare[@]}"; - do - if [ -d "$out/$d" ]; then - if [ -d "$out/share/$d" ]; then - echo "both $d/ and share/$d/ exist!"; - else - echo "moving $out/$d to $out/share/$d"; - mkdir -p $out/share; - mv $out/$d $out/share/; - fi; - fi; - done -} -nixNoticeLog () -{ - - _nixLogWithLevel 2 "$*" -} -getAllOutputNames () -{ - - if [ -n "$__structuredAttrs" ]; then - echo "${!outputs[*]}"; - else - echo "$outputs"; - fi -} -getTargetRole () -{ - - getRole "$targetOffset" -} -_pruneLibtoolFiles () -{ - - if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; -} -showPhaseFooter () -{ - - local phase="$1"; - local startTime="$2"; - local endTime="$3"; - local delta=$(( endTime - startTime )); - (( delta < 30 )) && return; - local H=$((delta/3600)); - local M=$((delta%3600/60)); - local S=$((delta%60)); - echo -n "$phase completed in "; - (( H > 0 )) && echo -n "$H hours "; - (( M > 0 )) && echo -n "$M minutes "; - echo "$S seconds" -} -bintoolsWrapper_addLDVars () -{ - - local role_post; - getHostRoleEnvHook; - if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; - fi; - if [[ -d "$1/lib" ]]; then - local -a glob=($1/lib/lib*); - if [ "${#glob[*]}" -gt 0 ]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib"; - fi; - fi -} -nixWarnLog () -{ - - _nixLogWithLevel 1 "$*" -} -prependToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=("$@" ${nameref+"${nameref[@]}"}); - else - nameref="$* ${nameref-}"; - fi -} -substituteAll () -{ - - local input="$1"; - local output="$2"; - local -a args=(); - _allFlags; - substitute "$input" "$output" "${args[@]}" -} -_defaultUnpack () -{ - - local fn="$1"; - local destination; - if [ -d "$fn" ]; then - destination="$(stripHash "$fn")"; - if [ -e "$destination" ]; then - echo "Cannot copy $fn to $destination: destination already exists!"; - echo "Did you specify two \"srcs\" with the same \"name\"?"; - return 1; - fi; - cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; - else - case "$fn" in - *.tar.xz | *.tar.lzma | *.txz) - ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; - true ) | tar xf - --mode=+w --warning=no-timestamp - ;; - *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) - tar xf "$fn" --mode=+w --warning=no-timestamp - ;; - *) - return 1 - ;; - esac; - fi -} -auditTmpdir () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "checking for references to $TMPDIR/ in $dir..."; - local tmpdir elf_fifo script_fifo; - tmpdir="$(mktemp -d)"; - elf_fifo="$tmpdir/elf"; - script_fifo="$tmpdir/script"; - mkfifo "$elf_fifo" "$script_fifo"; - ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do - if isELF "$file"; then - printf '%s\0' "$file" 1>&3; - else - if isScript "$file"; then - filename=${file##*/}; - dir=${file%/*}; - if [ -e "$dir/.$filename-wrapped" ]; then - printf '%s\0' "$file" 1>&4; - fi; - fi; - fi; - done; - exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then - echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$elf_fifo" ) & local pid_elf=$!; - local pid_script; - ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if grep -q -F "$TMPDIR/" "$1"; then - echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$script_fifo" ) & local pid_script=$!; - wait "$pid_elf" || { - echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - wait "$pid_script" || { - echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - rm -r "$tmpdir" -} -nixVomitLog () -{ - - _nixLogWithLevel 7 "$*" -} -unpackFile () -{ - - curSrc="$1"; - echo "unpacking source archive $curSrc"; - if ! runOneHook unpackCmd "$curSrc"; then - echo "do not know how to unpack source archive $curSrc"; - exit 1; - fi -} -_moveSystemdUserUnits () -{ - - if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then - return; - fi; - if [ ! -e "${prefix:?}/lib/systemd/user" ]; then - return; - fi; - local source="$prefix/lib/systemd/user"; - local target="$prefix/share/systemd/user"; - echo "moving $source/* to $target"; - mkdir -p "$target"; - ( shopt -s dotglob; - for i in "$source"/*; - do - mv "$i" "$target"; - done ); - rmdir "$source"; - ln -s "$target" "$source" -} -genericBuild () -{ - - export GZIP_NO_TIMESTAMPS=1; - if [ -f "${buildCommandPath:-}" ]; then - source "$buildCommandPath"; - return; - fi; - if [ -n "${buildCommand:-}" ]; then - eval "$buildCommand"; - return; - fi; - definePhases; - for curPhase in ${phases[*]}; - do - runPhase "$curPhase"; - done -} -_overrideFirst () -{ - - if [ -z "${!1-}" ]; then - _assignFirst "$@"; - fi -} -_doStrip () -{ - - local -ra flags=(dontStripHost dontStripTarget); - local -ra debugDirs=(stripDebugList stripDebugListTarget); - local -ra allDirs=(stripAllList stripAllListTarget); - local -ra stripCmds=(STRIP STRIP_FOR_TARGET); - local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); - stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; - stripDebugListTarget=${stripDebugListTarget[*]:-}; - stripAllList=${stripAllList[*]:-}; - stripAllListTarget=${stripAllListTarget[*]:-}; - local i; - for i in ${!stripCmds[@]}; - do - local -n flag="${flags[$i]}"; - local -n debugDirList="${debugDirs[$i]}"; - local -n allDirList="${allDirs[$i]}"; - local -n stripCmd="${stripCmds[$i]}"; - local -n ranlibCmd="${ranlibCmds[$i]}"; - if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then - continue; - fi; - stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; - stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; - done -} -_moveLib64 () -{ - - if [ "${dontMoveLib64-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then - return; - fi; - echo "moving $prefix/lib64/* to $prefix/lib"; - mkdir -p $prefix/lib; - shopt -s dotglob; - for i in $prefix/lib64/*; - do - mv --no-clobber "$i" $prefix/lib; - done; - shopt -u dotglob; - rmdir $prefix/lib64; - ln -s lib $prefix/lib64 -} -compressManPages () -{ - - local dir="$1"; - if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then - return; - fi; - echo "gzipping man pages under $dir/share/man/"; - find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; - find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do - local target; - target="$(readlink -f "$f")"; - if [ -f "$target".gz ]; then - ln -sf "$target".gz "$f".gz && rm "$f"; - fi; - done -} -isMachO () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then - return 0; - else - return 1; - fi; - fi; - fi -} -nixDebugLog () -{ - - _nixLogWithLevel 6 "$*" -} -_activatePkgs () -{ - - local hostOffset targetOffset; - local pkg; - for hostOffset in "${allPlatOffsets[@]}"; - do - local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; - for targetOffset in "${allPlatOffsets[@]}"; - do - (( hostOffset <= targetOffset )) || continue; - local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - activatePackage "$pkg" "$hostOffset" "$targetOffset"; - done; - done; - done -} -_assignFirst () -{ - - local varName="$1"; - local _var; - local REMOVE=REMOVE; - shift; - for _var in "$@"; - do - if [ -n "${!_var-}" ]; then - eval "${varName}"="${_var}"; - return; - fi; - done; - echo; - echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; - echo " The following variables were all unset or empty:"; - echo " $*"; - if [ -z "${out:-}" ]; then - echo ' If you do not want an "out" output in your derivation, make sure to define'; - echo ' the other specific required outputs. This can be achieved by picking one'; - echo " of the above as an output."; - echo ' You do not have to remove "out" if you want to have a different default'; - echo ' output, because the first output is taken as a default.'; - echo; - fi; - return 1 -} -nixErrorLog () -{ - - _nixLogWithLevel 0 "$*" -} -_addRpathPrefix () -{ - - if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then - export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; - fi -} -_multioutConfig () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then - return; - fi; - if [ -z "${shareDocName:-}" ]; then - local confScript="${configureScript:-}"; - if [ -z "$confScript" ] && [ -x ./configure ]; then - confScript=./configure; - fi; - if [ -f "$confScript" ]; then - local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; - fi; - if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then - shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; - fi; - fi; - prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; - prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal -} -fixLibtool () -{ - - local search_path; - for flag in $NIX_LDFLAGS; - do - case $flag in - -L*) - search_path+=" ${flag#-L}" - ;; - esac; - done; - sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' -} -dumpVars () -{ - - if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then - local old_umask; - old_umask=$(umask); - umask 0077; - export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; - umask "$old_umask"; - fi -} -printLines () -{ - - (( "$#" > 0 )) || return 0; - printf '%s\n' "$@" -} -printPhases () -{ - - definePhases; - local phase; - for phase in ${phases[*]}; - do - printf '%s\n' "$phase"; - done -} -printWords () -{ - - (( "$#" > 0 )) || return 0; - printf '%s ' "$@" -} -substituteAllStream () -{ - - local -a args=(); - _allFlags; - substituteStream "$1" "$2" "${args[@]}" -} -substituteStream () -{ - - local var=$1; - local description=$2; - shift 2; - while (( "$#" )); do - local replace_mode="$1"; - case "$1" in - --replace) - if ! "$_substituteStream_has_warned_replace_deprecation"; then - echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; - _substituteStream_has_warned_replace_deprecation=true; - fi; - replace_mode='--replace-warn' - ;& - --replace-quiet | --replace-warn | --replace-fail) - pattern="$2"; - replacement="$3"; - shift 3; - if ! [[ "${!var}" == *"$pattern"* ]]; then - if [ "$replace_mode" == --replace-warn ]; then - printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - else - if [ "$replace_mode" == --replace-fail ]; then - printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - return 1; - fi; - fi; - fi; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var) - local varName="$2"; - shift 2; - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; - return 1; - fi; - if [ -z ${!varName+x} ]; then - echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; - return 1; - fi; - pattern="@$varName@"; - replacement="${!varName}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var-by) - pattern="@$2@"; - replacement="$3"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - shift 3 - ;; - *) - echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; - return 1 - ;; - esac; - done; - printf "%s" "${!var}" -} -concatStringsSep () -{ - - local sep="$1"; - local name="$2"; - local type oldifs; - if type=$(declare -p "$name" 2> /dev/null); then - local -n nameref="$name"; - case "${type#* }" in - -A*) - echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; - return 1 - ;; - -a*) - local IFS="$(printf '\036')" - ;; - *) - local IFS=" " - ;; - esac; - local ifs_separated="${nameref[*]}"; - echo -n "${ifs_separated//"$IFS"/"$sep"}"; - fi -} -nixTalkativeLog () -{ - - _nixLogWithLevel 4 "$*" -} -unpackPhase () -{ - - runHook preUnpack; - if [ -z "${srcs:-}" ]; then - if [ -z "${src:-}" ]; then - echo 'variable $src or $srcs should point to the source'; - exit 1; - fi; - srcs="$src"; - fi; - local -a srcsArray; - concatTo srcsArray srcs; - local dirsBefore=""; - for i in *; - do - if [ -d "$i" ]; then - dirsBefore="$dirsBefore $i "; - fi; - done; - for i in "${srcsArray[@]}"; - do - unpackFile "$i"; - done; - : "${sourceRoot=}"; - if [ -n "${setSourceRoot:-}" ]; then - runOneHook setSourceRoot; - else - if [ -z "$sourceRoot" ]; then - for i in *; - do - if [ -d "$i" ]; then - case $dirsBefore in - *\ $i\ *) - - ;; - *) - if [ -n "$sourceRoot" ]; then - echo "unpacker produced multiple directories"; - exit 1; - fi; - sourceRoot="$i" - ;; - esac; - fi; - done; - fi; - fi; - if [ -z "$sourceRoot" ]; then - echo "unpacker appears to have produced no directories"; - exit 1; - fi; - echo "source root is $sourceRoot"; - if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then - chmod -R u+w -- "$sourceRoot"; - fi; - runHook postUnpack -} -moveToOutput () -{ - - local patt="$1"; - local dstOut="$2"; - local output; - for output in $(getAllOutputNames); - do - if [ "${!output}" = "$dstOut" ]; then - continue; - fi; - local srcPath; - for srcPath in "${!output}"/$patt; - do - if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then - continue; - fi; - if [ "$dstOut" = REMOVE ]; then - echo "Removing $srcPath"; - rm -r "$srcPath"; - else - local dstPath="$dstOut${srcPath#${!output}}"; - echo "Moving $srcPath to $dstPath"; - if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then - rmdir "$srcPath" --ignore-fail-on-non-empty; - if [ -d "$srcPath" ]; then - mv -t "$dstPath" "$srcPath"/*; - rmdir "$srcPath"; - fi; - else - mkdir -p "$(readlink -m "$dstPath/..")"; - mv "$srcPath" "$dstPath"; - fi; - fi; - local srcParent="$(readlink -m "$srcPath/..")"; - if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then - echo "Removing empty $srcParent/ and (possibly) its parents"; - rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; - fi; - done; - done -} -_addToEnv () -{ - - local depHostOffset depTargetOffset; - local pkg; - for depHostOffset in "${allPlatOffsets[@]}"; - do - local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; - local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; - for depTargetOffset in "${allPlatOffsets[@]}"; - do - (( depHostOffset <= depTargetOffset )) || continue; - local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; - if [[ -z "${strictDeps-}" ]]; then - local visitedPkgs=""; - for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; - do - if [[ "$visitedPkgs" = *"$pkg"* ]]; then - continue; - fi; - runHook "${!hookRef}" "$pkg"; - visitedPkgs+=" $pkg"; - done; - else - local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - runHook "${!hookRef}" "$pkg"; - done; - fi; - done; - done -} -_logHook () -{ - - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - local hookKind="$1"; - local hookExpr="$2"; - shift 2; - if declare -F "$hookExpr" > /dev/null 2>&1; then - nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; - else - if type -p "$hookExpr" > /dev/null; then - nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; - else - if [[ "$hookExpr" != "_callImplicitHook"* ]]; then - local exprToOutput; - if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then - exprToOutput="$hookExpr"; - else - local hookExprLine; - while IFS= read -r hookExprLine; do - hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; - if [[ -n "$hookExprLine" ]]; then - exprToOutput+="$hookExprLine\\n "; - fi; - done <<< "$hookExpr"; - exprToOutput="${exprToOutput%%\\n }"; - fi; - nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; - fi; - fi; - fi -} -nixChattyLog () -{ - - _nixLogWithLevel 5 "$*" -} -getRole () -{ - - case $1 in - -1) - role_post='_FOR_BUILD' - ;; - 0) - role_post='' - ;; - 1) - role_post='_FOR_TARGET' - ;; - *) - echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -patchShebangs () -{ - - local pathName; - local update=false; - while [[ $# -gt 0 ]]; do - case "$1" in - --host) - pathName=HOST_PATH; - shift - ;; - --build) - pathName=PATH; - shift - ;; - --update) - update=true; - shift - ;; - --) - shift; - break - ;; - -* | --*) - echo "Unknown option $1 supplied to patchShebangs" 1>&2; - return 1 - ;; - *) - break - ;; - esac; - done; - echo "patching script interpreter paths in $@"; - local f; - local oldPath; - local newPath; - local arg0; - local args; - local oldInterpreterLine; - local newInterpreterLine; - if [[ $# -eq 0 ]]; then - echo "No arguments supplied to patchShebangs" 1>&2; - return 0; - fi; - local f; - while IFS= read -r -d '' f; do - isScript "$f" || continue; - read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; - read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; - if [[ -z "${pathName:-}" ]]; then - if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then - pathName=HOST_PATH; - else - pathName=PATH; - fi; - fi; - if [[ "$oldPath" == *"/bin/env" ]]; then - if [[ $arg0 == "-S" ]]; then - arg0=${args%% *}; - [[ "$args" == *" "* ]] && args=${args#* } || args=; - newPath="$(PATH="${!pathName}" type -P "env" || true)"; - args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; - else - if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; - exit 1; - else - newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; - fi; - fi; - else - if [[ -z $oldPath ]]; then - oldPath="/bin/sh"; - fi; - newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; - args="$arg0 $args"; - fi; - newInterpreterLine="$newPath $args"; - newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; - if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then - if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then - echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; - escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; - timestamp=$(stat --printf "%y" "$f"); - tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); - sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; - local restoreReadOnly; - if [[ ! -w "$f" ]]; then - chmod +w "$f"; - restoreReadOnly=true; - fi; - cat "$tmpFile" > "$f"; - rm "$tmpFile"; - if [[ -n "${restoreReadOnly:-}" ]]; then - chmod -w "$f"; - fi; - touch --date "$timestamp" "$f"; - fi; - fi; - done < <(find "$@" -type f -perm -0100 -print0) -} -pkgConfigWrapper_addPkgConfigPath () -{ - - local role_post; - getHostRoleEnvHook; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" -} -recordPropagatedDependencies () -{ - - declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); - declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); - local propagatedInputsIndex; - for propagatedInputsIndex in "${!flatVars[@]}"; - do - local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; - local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; - [[ -n "${!propagatedInputsSlice}" ]] || continue; - mkdir -p "${!outputDev}/nix-support"; - printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; - done -} -stripHash () -{ - - local strippedName casematchOpt=0; - strippedName="$(basename -- "$1")"; - shopt -q nocasematch && casematchOpt=1; - shopt -u nocasematch; - if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then - echo "${strippedName:33}"; - else - echo "$strippedName"; - fi; - if (( casematchOpt )); then - shopt -s nocasematch; - fi -} -runPhase () -{ - - local curPhase="$*"; - if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then - return; - fi; - if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then - return; - fi; - if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then - return; - fi; - if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then - return; - fi; - if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then - return; - fi; - if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then - return; - fi; - showPhaseHeader "$curPhase"; - dumpVars; - local startTime endTime; - startTime=$(date +"%s"); - eval "${!curPhase:-$curPhase}"; - endTime=$(date +"%s"); - showPhaseFooter "$curPhase" "$startTime" "$endTime"; - if [ "$curPhase" = unpackPhase ]; then - [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; - cd -- "${sourceRoot:-.}"; - fi -} -_updateSourceDateEpochFromSourceRoot () -{ - - if [ -n "$sourceRoot" ]; then - updateSourceDateEpoch "$sourceRoot"; - fi -} -concatTo () -{ - - local -; - set -o noglob; - local -n targetref="$1"; - shift; - local arg default name type; - for arg in "$@"; - do - IFS="=" read -r name default <<< "$arg"; - local -n nameref="$name"; - if [[ -z "${nameref[*]}" && -n "$default" ]]; then - targetref+=("$default"); - else - if type=$(declare -p "$name" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; - return 1 - ;; - -a*) - targetref+=("${nameref[@]}") - ;; - *) - if [[ "$name" = *"Array" ]]; then - nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; - targetref+=(${nameref+"${nameref[@]}"}); - else - targetref+=(${nameref-}); - fi - ;; - esac; - fi; - fi; - done -} -getHostRole () -{ - - getRole "$hostOffset" -} -ccWrapper_addCVars () -{ - - local role_post; - getHostRoleEnvHook; - local found=; - if [ -d "$1/include" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; - found=1; - fi; - if [ -d "$1/Library/Frameworks" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; - found=1; - fi; - if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then - local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; - export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; - fi -} -_moveSbin () -{ - - if [ "${dontMoveSbin-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then - return; - fi; - echo "moving $prefix/sbin/* to $prefix/bin"; - mkdir -p $prefix/bin; - shopt -s dotglob; - for i in $prefix/sbin/*; - do - mv "$i" $prefix/bin; - done; - shopt -u dotglob; - rmdir $prefix/sbin; - ln -s bin $prefix/sbin -} -_multioutPropagateDev () -{ - - if [ "$(getAllOutputNames)" = "out" ]; then - return; - fi; - local outputFirst; - for outputFirst in $(getAllOutputNames); - do - break; - done; - local propagaterOutput="$outputDev"; - if [ -z "$propagaterOutput" ]; then - propagaterOutput="$outputFirst"; - fi; - if [ -z "${propagatedBuildOutputs+1}" ]; then - local po_dirty="$outputBin $outputInclude $outputLib"; - set +o pipefail; - propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; - set -o pipefail; - fi; - if [ -z "$propagatedBuildOutputs" ]; then - return; - fi; - mkdir -p "${!propagaterOutput}"/nix-support; - for output in $propagatedBuildOutputs; - do - echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; - done -} -updateSourceDateEpoch () -{ - - local path="$1"; - [[ $path == -* ]] && path="./$path"; - local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); - local time="${res[0]//\.[0-9]*/}"; - local newestFile="${res[1]}"; - if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then - echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; - export SOURCE_DATE_EPOCH="$time"; - local now="$(date +%s)"; - if [ "$time" -gt $((now - 60)) ]; then - echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; - fi; - fi -} -definePhases () -{ - - if [ -z "${phases[*]:-}" ]; then - phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; - fi -} -getHostRoleEnvHook () -{ - - getRole "$depHostOffset" -} -getTargetRoleEnvHook () -{ - - getRole "$depTargetOffset" -} -PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" -XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" - -eval "${shellHook:-}" -shopt -s expand_aliases - -exec python - \ No newline at end of file diff --git a/.devenv/state/files.json b/.devenv/state/files.json deleted file mode 100644 index b4c7443f..00000000 --- a/.devenv/state/files.json +++ /dev/null @@ -1 +0,0 @@ -{"managedFiles":[]} diff --git a/.devenv/task-names.txt b/.devenv/task-names.txt deleted file mode 100644 index be2db38f..00000000 --- a/.devenv/task-names.txt +++ /dev/null @@ -1,5 +0,0 @@ -devenv:container:copy -devenv:enterShell -devenv:enterTest -devenv:files -devenv:files:cleanup \ No newline at end of file diff --git a/.devenv/tasks.db b/.devenv/tasks.db deleted file mode 100644 index 159e90adb13561c0365c22e76084c658383a62f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYFvV#S79dK(-m98b?E5 nGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLtr!nC=3Arqf-Z% diff --git a/.devenv/tasks.db-shm b/.devenv/tasks.db-shm deleted file mode 100644 index 07b4bff8322c26c00b5ab7b2a1c1cddac834fadc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)yG;W@5C-6}u`%Xpo^lgzgPefKF>Me~4H6LuLP83l1PEyYW)MQi85wB4UmD%r zYPGlX6)^MHMO4OFgNWI2KBrlalhfz3#d7p^@^F50eKEdU-e0{uUEa=rxj&EkOr87w zBVWr=>y`X>471i&-beXecU#YzWNl>C{c7*(+Uj?15ds7V5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs zfj=!Uh?*}U1Ud=~bF#`#$Hw(cASVsgydWXaQJ`jN34xvhHAPMc^c0xJZXEP%UDxde zHe)Xi+baO*DXGl`^2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs V0RjXF5FkK+009C72oU(^0w12WCtCmj diff --git a/.devenv/tasks.db-wal b/.devenv/tasks.db-wal deleted file mode 100644 index 3854b638a83b049a8e0172202b556bb0cd0d71c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 86552 zcmeI*eQXHIALy z=f+*Np_Gj=RsE+D|3uRSEo5T|6;K14MkK@#h(ADTDf?0@{z?|BmZvgNeF`TC~}hEEvu?d?x4N5A`mZ2s)Cd;a;> zpB9I;CSz@T;jM4Azx21}<%zK&MU{nQHa9D(f>#@DG8yg{1npdt_S2+~S>N>W&6NY~ zZ|Qn9$2ZzF8SXuMz0Llf!PI`n(0<1L;~Sks8v+O*fB*srAbC*-`8Q|9y=2$PYiNnvDE`-u(>mAjQpUKP`6IT6$Q z2ZtjQlYPSvRZkKQL=N^vhbD!A==gYKWHMGgr93=ekR&;u7y3s>ha!C=)p6xsDJ4rY z`NFKwKQ!9ErB5!(QbB*Jn5xXmmB+6vVnNN8j$>Of zV(zUi`uF;l^-q`nJ-?bS2)3O6!e18;eyvS!ET1C7009ILKmY**5I~@D z1x~eC9etg~g^p6OuaYRn=0#O2CQihXidHtQiusw?oT#R1TW#yb(t{%hB2z;BF~aDG zP&;m4>1r8qR^Bh@*X*9LS{*^{=GOW*uN~j=(f6%?%kI-Qv(?erY5YpGR1sc#;o5!6 zrb_VIo>CRKk`T1o@5lp@@vZgW)!??*e(S+*Z=KC1l%%3bm#VTWSFMy~>t)?iHlxZJ zHI@?dl8+^noGhu?+{tal;MF2>mwsw=WN<7R*~Z@59kf^+hdS$3eAfmYbJreO z7w&7aIyyRxr-w_3rI>StOyzI$CcH}P$AepcdOeP`m{()kZL0JYq-wbP@@g)rJMQc1 z%y;bcxjIvF>0)z2O9d00IagfB*sr zAbk8AJFuYKdpDtUo=T(l#A00IagfB*srAb)8%z~-GbZO>vr|}To+=Q>2ps-Ub{a1{_&wV&SjQXpLww`isYoN>VaWOdOlZr%s$q2WRuXV(O&gQ^aG=@_1)yymNhgI2;Vfp+v}? zbbI^>Pf(KmVlbHqh+-&^^mzlxL_Fvf{n}C3A4vGZNnbz;YsapDTM|W&TeID??qK^s z?(p63d{xlr5g6@D2JOX$00IagfB*srAbj#H^QoGT=zC8aWje`9dm<(I;)aNI42;;ukI^omJ2D2Jq= zD=2z`o}||=iJ?%??+du(q$?oGk~a|WNa2t_uASxy-)ZX$Om!_~dpc6@>Gc98`kC{y nXkBT3*f~bMz=s*rhX4WyAb Date: Wed, 1 Apr 2026 17:20:13 +0800 Subject: [PATCH 4/7] ui: make element table editing clearer --- raytracing/ui/raytracing_app.py | 47 ++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/raytracing/ui/raytracing_app.py b/raytracing/ui/raytracing_app.py index 1dacf5e2..618e38f4 100644 --- a/raytracing/ui/raytracing_app.py +++ b/raytracing/ui/raytracing_app.py @@ -58,9 +58,16 @@ def create_window_widgets(self): ) self.table_group.column_resize_weight(index=0, weight=1) + self.table_hint_label = Label( + text="Double-click a cell to edit. The optical layout refreshes automatically." + ) + self.table_hint_label.grid_into( + self.table_group, row=0, column=0, pady=(5, 0), padx=5, sticky="w" + ) + self.button_group = View(width=300, height=200) self.button_group.grid_into( - self.table_group, row=1, column=0, pady=5, padx=5, sticky="nsew" + self.table_group, row=2, column=0, pady=5, padx=5, sticky="nsew" ) self.add_lens_button = Button( @@ -105,12 +112,13 @@ def create_window_widgets(self): self.tableview.grid_into( self.table_group, column=0, - row=0, + row=1, columnspan=2, pady=5, padx=5, sticky="nsew", ) + self.tableview.all_elements_are_editable = True self.tableview.displaycolumns = [ "position", "element", @@ -472,7 +480,11 @@ def refresh(self): self.coords.create_y_major_ticks() self.coords.create_y_major_ticks_labels() - self.calculate_imaging_path_results(finite_imaging_path) + image_distance = conjugate.d if isfinite(conjugate.d) else None + self.calculate_imaging_path_results( + finite_imaging_path, + image_distance=image_distance, + ) self.create_optical_path(finite_path, self.coords) @@ -544,21 +556,25 @@ def create_all_traces(self, path): principal_ray = path.principalRay() if principal_ray is not None: principal_raytrace = path.trace(principal_ray) - line_trace = self.create_line_from_raytrace( + line_traces = self.create_line_segments_from_raytrace( principal_raytrace, basis=DynamicBasis(self.coords, "basis"), color="green", ) - self.coords.place(line_trace, position=Point(0, 0)) + for line_trace in line_traces: + self.canvas.place(line_trace, position=self.coords_origin) + self.canvas.widget.tag_lower(line_trace.id) axial_ray = path.axialRay() axial_raytrace = path.trace(axial_ray) - line_trace = self.create_line_from_raytrace( + line_traces = self.create_line_segments_from_raytrace( axial_raytrace, basis=DynamicBasis(self.coords, "basis"), color="red", ) - self.coords.place(line_trace, position=Point(0, 0)) + for line_trace in line_traces: + self.canvas.place(line_trace, position=self.coords_origin) + self.canvas.widget.tag_lower(line_trace.id) else: M = int(self.number_of_heights) @@ -1030,7 +1046,7 @@ def get_path_script(self): return script - def calculate_imaging_path_results(self, imaging_path): + def calculate_imaging_path_results(self, imaging_path, image_distance=None): data_source = self.results_tableview.data_source uuids = data_source.sorted_records_uuids(field="__uuid") @@ -1041,6 +1057,12 @@ def calculate_imaging_path_results(self, imaging_path): data_source.append_record( {"property": "Imaging Path", "value": "Non-imaging/infinite conjugate"} ) + data_source.append_record( + {"property": "Image distance", "value": "Infinite"} + ) + data_source.append_record( + {"property": "Image size", "value": "Infinite [no image plane]"} + ) return """ Object and Image positions @@ -1051,6 +1073,11 @@ def calculate_imaging_path_results(self, imaging_path): data_source.append_record( {"property": "Object position", "value": f"0.0 (always)"} ) + if image_distance is None: + image_distance = imaging_path.L + data_source.append_record( + {"property": "Image distance", "value": f"{image_distance:.2f}"} + ) data_source.append_record( {"property": "Image position", "value": f"{image_position:.2f}"} ) @@ -1154,10 +1181,10 @@ def calculate_imaging_path_results(self, imaging_path): {"property": "Field of view [FOV]", "value": f"{fov:.2f}"} ) data_source.append_record( - {"property": "Object size [same as FOV]", "value": f"{fov:.2f}"} + {"property": "Image size", "value": f"{imaging_path.imageSize():.2f}"} ) data_source.append_record( - {"property": "Image size", "value": f"{imaging_path.imageSize():.2f}"} + {"property": "Object size [same as FOV]", "value": f"{fov:.2f}"} ) data_source.append_record( {"property": "Magnification [Transverse]", "value": f"{mag_tran:.2f}"} From 266664a36fc4b3574763e9cb07c2f7e054501fa5 Mon Sep 17 00:00:00 2001 From: dragonleopardpig Date: Thu, 2 Apr 2026 16:48:20 +0800 Subject: [PATCH 5/7] Improve sequential optics UI editor --- raytracing/ui/raytracing_app.py | 1562 +++++++++++++++++++++++++------ 1 file changed, 1272 insertions(+), 290 deletions(-) diff --git a/raytracing/ui/raytracing_app.py b/raytracing/ui/raytracing_app.py index 618e38f4..65f6e9bf 100644 --- a/raytracing/ui/raytracing_app.py +++ b/raytracing/ui/raytracing_app.py @@ -1,12 +1,14 @@ import sys try: - from tkinter import DoubleVar + from tkinter import DoubleVar, StringVar from tkinter import filedialog + import tkinter.ttk as ttk from mytk import * from mytk.base import BaseNotification from mytk.canvasview import * from mytk.dataviews import * + from mytk.tableview import CellEntry, TableView from mytk.vectors import Point, PointDefault, DynamicBasis from mytk.labels import Label from mytk.notificationcenter import NotificationCenter @@ -21,12 +23,252 @@ import time import ast import inspect +import traceback from numpy import linspace, isfinite from raytracing import * import colorsys import pyperclip from contextlib import suppress +ELEMENT_DEFAULTS = { + "Thin Lens": "f=50, diameter=25.4", + "Aperture": "diameter=25.4", + "CurvedMirror": "R=100, diameter=25.4", + "DielectricInterface": "n1=1.0, n2=1.5, R=100, diameter=25.4", + "ThickLens": "n=1.5, R1=100, R2=-100, thickness=10, diameter=25.4", + "DielectricSlab": "n=1.5, thickness=10, diameter=25.4", + "Axicon": "alpha=2.0, n=1.5, diameter=25.4", +} + +ELEMENT_ALIASES = { + "Thin Lens": "Lens", + "Lens": "Lens", + "AS": "Aperture", + "FS": "Aperture", + "Aperture Stop": "Aperture", + "Field Stop": "Aperture", +} + + +class ElementCellEditor(CellEntry): + def create_widget(self, master): + record = self.tableview.data_source.record(self.item_id) + + self.parent = master + self.value_variable = StringVar() + self.widget = ttk.Combobox( + master, + textvariable=self.value_variable, + values=list(ELEMENT_DEFAULTS.keys()), + state="readonly", + ) + self.widget.bind("<>", self.event_return_callback) + self.widget.bind("", self.event_focusout_callback) + self.widget.set(str(record[self.column_name])) + + def event_return_callback(self, event): + record = dict(self.tableview.data_source.record(self.item_id)) + new_element = self.value_variable.get() + old_element = record.get(self.column_name) + record[self.column_name] = new_element + + if new_element != old_element: + default_arguments = ELEMENT_DEFAULTS.get(new_element) + if default_arguments is not None: + record["arguments"] = default_arguments + + self.tableview.item_modified(item_id=self.item_id, modified_record=record) + self.event_generate("") + + def event_focusout_callback(self, event): + self.widget.destroy() + + +class ObjectThicknessCellEditor(CellEntry): + def create_widget(self, master): + record = self.tableview.data_source.record(self.item_id) + + self.parent = master + self.value_variable = StringVar() + self.widget = ttk.Combobox( + master, + textvariable=self.value_variable, + values=["Finite", "Infinity"], + state="readonly", + ) + self.widget.bind("<>", self.event_return_callback) + self.widget.bind("", self.event_focusout_callback) + current_value = str(record.get(self.column_name, "Finite")) + if current_value not in {"Finite", "Infinity"}: + current_value = "Finite" + self.widget.set(current_value) + + def event_return_callback(self, event): + record = dict(self.tableview.data_source.record(self.item_id)) + record[self.column_name] = self.value_variable.get() + self.tableview.item_modified(item_id=self.item_id, modified_record=record) + self.event_generate("") + + def event_focusout_callback(self, event): + self.widget.destroy() + + +class SmoothedPolygon(CanvasElement): + def __init__(self, points, smooth=1, **kwargs): + super().__init__(**kwargs) + self.points = points + self.smooth = smooth + + def create(self, canvas, position=None): + if position is None: + position = Point(0, 0, basis=self.basis) + + translated_points = [ + (position + point).standard_tuple() for point in self.points + ] + self.id = canvas.widget.create_polygon( + translated_points, + smooth=self.smooth, + **self._element_kwargs, + ) + return self.id + + +class ElementTableView(TableView): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.active_editor_item_id = None + self.active_editor_column_name = None + + def dismiss_active_editors(self): + for child in self.widget.winfo_children(): + with suppress(Exception): + child.destroy() + self.active_editor_item_id = None + self.active_editor_column_name = None + + def click_cell(self, item_id, column_name): + if column_name == "solve": + record = dict(self.data_source.record(item_id)) + current_value = record.get("solve", "") + new_value = "" if current_value == "*" else "*" + + for other_record in list(self.data_source.records): + other_update = {"solve": ""} + if other_record["__uuid"] == item_id: + other_update["solve"] = new_value + self.item_modified(other_record["__uuid"], {**dict(other_record), **other_update}) + return True + + if ( + self.active_editor_item_id is not None + and ( + item_id != self.active_editor_item_id + or column_name != self.active_editor_column_name + ) + ): + self.dismiss_active_editors() + return super().click_cell(item_id, column_name) + + def focus_edit_cell(self, item_id, column_name): + assert isinstance(column_name, str) + record = dict(self.data_source.record(item_id)) + if column_name == "solve": + return + if ( + record.get("element") == "Image" + and column_name == "thickness" + and record.get("solve") == "*" + ): + return + if record.get("element") in {"Object", "Image"} and column_name in {"element", "arguments"}: + return + if ( + column_name == "thickness" + and hasattr(self.delegate, "first_real_element_record") + and hasattr(self.delegate, "object_record") + ): + first_real = self.delegate.first_real_element_record() + object_record = self.delegate.object_record() + if ( + first_real is not None + and object_record is not None + and record.get("__uuid") == first_real.get("__uuid") + and str(object_record.get("thickness", "Finite")) == "Infinity" + ): + return + + self.dismiss_active_editors() + self.active_editor_item_id = item_id + self.active_editor_column_name = column_name + bbox = self.widget.bbox(item_id, column=column_name) + if record.get("element") == "Object" and column_name == "thickness": + entry_box = ObjectThicknessCellEditor( + tableview=self, + item_id=item_id, + column_name=column_name, + ) + elif column_name == "element": + entry_box = ElementCellEditor( + tableview=self, + item_id=item_id, + column_name=column_name, + ) + else: + entry_box = CellEntry( + tableview=self, + item_id=item_id, + column_name=column_name, + ) + + entry_box.place_into( + parent=self, + x=bbox[0] - 2, + y=bbox[1] - 2, + width=bbox[2] + 4, + height=bbox[3] + 4, + ) + entry_box.widget.focus() + + +class BiconcaveLens(CanvasElement): + def __init__(self, lens_width, height, basis=None, **kwargs): + super().__init__(basis=basis, **kwargs) + self.lens_width = lens_width + self.height = height + + def create(self, canvas, position=None): + if position is None: + position = Point(0, 0, basis=self.basis) + self.canvas = canvas + + half_width = self.lens_width / 2 + half_height = self.height / 2 + + outline_points = ( + position + Point(-half_width, -half_height, basis=self.basis), + position + Point(-half_width, -half_height, basis=self.basis), + position + Point(half_width, -half_height, basis=self.basis), + position + Point(half_width, -half_height, basis=self.basis), + position + Point(half_width * 0.45, -half_height * 0.45, basis=self.basis), + position + Point(half_width * 0.45, 0, basis=self.basis), + position + Point(half_width * 0.45, half_height * 0.45, basis=self.basis), + position + Point(half_width, half_height, basis=self.basis), + position + Point(half_width, half_height, basis=self.basis), + position + Point(-half_width, half_height, basis=self.basis), + position + Point(-half_width, half_height, basis=self.basis), + position + Point(-half_width * 0.45, half_height * 0.45, basis=self.basis), + position + Point(-half_width * 0.45, 0, basis=self.basis), + position + Point(-half_width * 0.45, -half_height * 0.45, basis=self.basis), + ) + + self.id = canvas.widget.create_polygon( + [point.standard_tuple() for point in outline_points], + smooth=1, + **self._element_kwargs, + ) + return self.id + class RaytracingApp(App): def __init__(self): @@ -43,14 +285,67 @@ def __init__(self): self.show_labels = True self.show_principal_rays = 1 self.show_conjugates = True + self.show_principal_planes = False self.show_intermediate_conjugates = False self.maximum_x = 60 self.initialization_completed = False self.path_has_field_stop = True + self.object_conjugate_mode = "Preset: finite object" + self.image_conjugate_mode = "Preset: finite image" + self.conjugation_status_message = "" + self.solver_status_message = "" self.create_window_widgets() self.refresh() + @staticmethod + def safe_int(value, default): + try: + if value == "": + return default + return int(value) + except (TypeError, ValueError): + return default + + @staticmethod + def safe_float(value, default): + try: + if value == "": + return default + return float(value) + except (TypeError, ValueError): + return default + + @staticmethod + def parse_thickness(value): + if isinstance(value, (int, float)): + return float(value) + text = str(value).strip() + if text == "": + return 0.0 + if text.lower() == "finite": + return 0.0 + if text.lower() in {"inf", "+inf", "infinity", "+infinity", "∞", "+∞"}: + return float("inf") + if text.lower() in {"-inf", "-infinity", "-∞"}: + return float("-inf") + return float(text) + + @staticmethod + def normalized_thickness_text(value): + try: + numeric_value = RaytracingApp.parse_thickness(value) + except (TypeError, ValueError): + return value + + if str(value).strip().lower() == "finite": + return "Finite" + if numeric_value == float("inf"): + return "Infinity" + if numeric_value == float("-inf"): + return "-Infinity" + return f"{numeric_value:g}" + def create_window_widgets(self): self.table_group = View(width=300, height=300) self.table_group.grid_into( @@ -58,16 +353,9 @@ def create_window_widgets(self): ) self.table_group.column_resize_weight(index=0, weight=1) - self.table_hint_label = Label( - text="Double-click a cell to edit. The optical layout refreshes automatically." - ) - self.table_hint_label.grid_into( - self.table_group, row=0, column=0, pady=(5, 0), padx=5, sticky="w" - ) - self.button_group = View(width=300, height=200) self.button_group.grid_into( - self.table_group, row=2, column=0, pady=5, padx=5, sticky="nsew" + self.table_group, row=1, column=0, pady=5, padx=5, sticky="nsew" ) self.add_lens_button = Button( @@ -88,55 +376,87 @@ def create_window_widgets(self): ) self.delete_button.grid_into(self.button_group, row=0, column=2, pady=5, padx=5) + self.move_up_button = Button( + "⬆", user_event_callback=self.click_table_buttons + ) + self.move_up_button.grid_into(self.button_group, row=0, column=3, pady=5, padx=5) + + self.move_down_button = Button( + "⬇", user_event_callback=self.click_table_buttons + ) + self.move_down_button.grid_into( + self.button_group, row=0, column=4, pady=5, padx=5 + ) + self.copy_code_button = Button( "Copy script", user_event_callback=self.click_copy_buttons ) self.copy_code_button.grid_into( - self.button_group, row=0, column=3, pady=5, padx=5 + self.button_group, row=0, column=5, pady=5, padx=5 ) - self.tableview = TableView( + self.solve_button = Button( + "Solve", user_event_callback=self.click_table_buttons + ) + self.solve_button.grid_into( + self.button_group, row=0, column=6, pady=5, padx=5 + ) + + self.tableview = ElementTableView( columns_labels={ + "thickness": "Thickness [mm]", "element": "Element", "arguments": "Properties", - "position": "Position [mm]", + "solve": "Variable", } ) - self.tableview.column_formats["position"] = { - "format_string": "{0:g}", - "multiplier": 1, - "anchor": "", - } - self.tableview.data_source.update_field_properties("position", {"type": float}) self.tableview.grid_into( self.table_group, column=0, - row=1, + row=0, columnspan=2, pady=5, padx=5, sticky="nsew", ) - self.tableview.all_elements_are_editable = True self.tableview.displaycolumns = [ - "position", + "thickness", "element", "arguments", + "solve", ] for column in self.tableview.displaycolumns: widths = { - "position": 5, + "thickness": 8, "element": 5, "arguments": 150, + "solve": 5, } self.tableview.widget.column(column, width=widths[column], anchor=W) self.tableview.data_source.append_record( { - "element": "Lens", - "arguments": "f=100", - "position": 200, + "element": "Object", + "arguments": "", + "thickness": "Finite", + "solve": "", + } + ) + self.tableview.data_source.append_record( + { + "element": "Thin Lens", + "arguments": "f=100, diameter=25.4", + "thickness": 0, + "solve": "", + } + ) + self.tableview.data_source.append_record( + { + "element": "Image", + "arguments": "", + "thickness": 200, + "solve": "*", } ) # self.tableview.data_source.append_record( @@ -149,6 +469,7 @@ def create_window_widgets(self): # } # ) self.tableview.delegate = self + self.update_variable_row_styles() self.results_tableview = TableView( columns_labels={ @@ -202,7 +523,9 @@ def create_window_widgets(self): self.control_input_rays, column=0, row=1, pady=5, padx=5, sticky="e" ) - self.number_heights_entry = IntEntry(minimum=1, maximum=100, width=3) + self.number_heights_entry = Entry( + value=str(self.number_of_heights), character_width=3 + ) self.number_heights_entry.grid_into( self.control_input_rays, column=1, row=1, pady=5, padx=5, sticky="w" ) @@ -212,7 +535,9 @@ def create_window_widgets(self): self.control_input_rays, column=0, row=2, pady=5, padx=5, sticky="e" ) - self.number_angles_entry = IntEntry(minimum=1, maximum=100, width=3) + self.number_angles_entry = Entry( + value=str(self.number_of_angles), character_width=3 + ) self.number_angles_entry.grid_into( self.control_input_rays, column=1, row=2, pady=5, padx=5, sticky="w" ) @@ -222,7 +547,7 @@ def create_window_widgets(self): self.control_input_rays, column=3, row=1, pady=5, padx=5, sticky="w" ) - self.max_heights_entry = Entry(character_width=3) + self.max_heights_entry = Entry(value=str(self.max_height), character_width=3) self.max_heights_entry.grid_into( self.control_input_rays, column=4, row=1, pady=5, padx=5, sticky="w" ) @@ -232,7 +557,9 @@ def create_window_widgets(self): self.control_input_rays, column=3, row=2, pady=5, padx=5, sticky="w" ) - self.fan_angles_entry = Entry(character_width=3) + self.fan_angles_entry = Entry( + value=str(self.max_fan_angle), character_width=3 + ) self.fan_angles_entry.grid_into( self.control_input_rays, column=4, row=2, pady=5, padx=5, sticky="w" ) @@ -242,6 +569,11 @@ def create_window_widgets(self): self.controls, column=0, row=1, columnspan=4, pady=5, padx=5, sticky="w" ) + self.show_principal_planes_checkbox = Checkbox(label="Show principal planes") + self.show_principal_planes_checkbox.grid_into( + self.controls, column=0, row=2, columnspan=4, pady=5, padx=5, sticky="w" + ) + self.apertures_checkbox = Checkbox( label="Show Aperture stop (AS) and field stop (FS)" ) @@ -259,25 +591,6 @@ def create_window_widgets(self): self.controls, column=0, row=5, columnspan=4, pady=5, padx=5, sticky="w" ) - self.conjugation_box = Box(label="Conjugation") - self.conjugation_box.grid_into( - self.controls, column=0, row=6, pady=5, padx=5, sticky="nsew" - ) - - self.object_conjugate = PopupMenu( - menu_items=["Finite object", "Infinite object"] - ) - self.object_conjugate.grid_into( - self.conjugation_box, column=0, row=0, pady=5, padx=5, sticky="w" - ) - self.object_conjugate.selection_changed(0) - - self.image_conjugate = PopupMenu(menu_items=["Finite image", "Infinite image"]) - self.image_conjugate.grid_into( - self.conjugation_box, column=1, row=0, pady=5, padx=5, sticky="w" - ) - self.image_conjugate.selection_changed(0) - self.canvas = CanvasView(width=1000, height=400, background="white") self.canvas.grid_into( self.window, column=0, row=1, columnspan=3, pady=5, padx=5, sticky="nsew" @@ -329,6 +642,11 @@ def create_window_widgets(self): self.bind_properties( "show_conjugates", self.show_conjugates_checkbox, "value_variable" ) + self.bind_properties( + "show_principal_planes", + self.show_principal_planes_checkbox, + "value_variable", + ) self.bind_properties("max_height", self.max_heights_entry, "value_variable") self.bind_properties("max_fan_angle", self.fan_angles_entry, "value_variable") self.number_heights_entry.bind_properties( @@ -354,12 +672,37 @@ def create_window_widgets(self): self.add_observer(self, "show_principal_rays") self.add_observer(self, "show_labels") self.add_observer(self, "show_conjugates") + self.add_observer(self, "show_principal_planes") self.initialization_completed = True def canvas_did_resize(self, notification): self.refresh() + def relabel_infinite_x_axis_ends(self): + if ( + self.object_conjugate_mode != "Preset: object at infinity" + and self.image_conjugate_mode != "Preset: image at infinity" + ): + return + + tick_label_ids = [ + item_id + for item_id in self.canvas.widget.find_withtag("tick-label") + if "x-axis" in self.canvas.widget.gettags(item_id) + ] + if len(tick_label_ids) < 2: + return + + tick_label_ids.sort(key=lambda item_id: self.canvas.widget.coords(item_id)[0]) + left_label_id = tick_label_ids[0] + right_label_id = tick_label_ids[-1] + + if self.object_conjugate_mode == "Preset: object at infinity": + self.canvas.widget.itemconfigure(left_label_id, text="−∞") + if self.image_conjugate_mode == "Preset: image at infinity": + self.canvas.widget.itemconfigure(right_label_id, text="+∞") + def observed_property_changed( self, observed_object, observed_property_name, new_value, context ): @@ -373,15 +716,182 @@ def observed_property_changed( self.refresh() def source_data_changed(self, tableview): + self.normalize_special_rows() + self.ensure_image_row_last() + self.update_variable_row_styles() + self.solver_status_message = "" self.refresh() + def ordered_table_records(self): + return [dict(self.tableview.data_source.record(item_id)) for item_id in self.tableview.items_ids()] + + def image_record(self): + for record in self.ordered_table_records(): + if record.get("element") == "Image": + return record + return None + + def object_record(self): + for record in self.ordered_table_records(): + if record.get("element") == "Object": + return record + return None + + def first_real_element_record(self): + for record in self.ordered_table_records(): + if record.get("element") not in {"Object", "Image"}: + return record + return None + + def normalize_special_rows(self): + for record in self.ordered_table_records(): + if "thickness" not in record: + continue + normalized_value = self.normalized_thickness_text(record["thickness"]) + if normalized_value != record["thickness"]: + self.tableview.data_source.update_record( + record["__uuid"], {"thickness": normalized_value} + ) + + object_record = self.object_record() + image_record = self.image_record() + self.conjugation_status_message = "" + if object_record is not None: + object_is_infinite = ( + self.parse_thickness(object_record.get("thickness", "Finite")) == float("inf") + ) + self.object_conjugate_mode = ( + "Preset: object at infinity" if object_is_infinite else "Preset: finite object" + ) + first_real_element = self.first_real_element_record() + if first_real_element is not None: + if object_is_infinite: + updates = {} + try: + first_thickness = self.parse_thickness(first_real_element.get("thickness", 0)) + except (TypeError, ValueError): + first_thickness = 0.0 + if isfinite(first_thickness): + updates["__finite_thickness_backup"] = self.normalized_thickness_text( + first_real_element.get("thickness", 0) + ) + if first_real_element.get("thickness") != "Infinity": + updates["thickness"] = "Infinity" + if updates: + self.tableview.data_source.update_record( + first_real_element["__uuid"], updates + ) + else: + if str(first_real_element.get("thickness", "")) == "Infinity": + restored_value = first_real_element.get("__finite_thickness_backup", "200") + self.tableview.data_source.update_record( + first_real_element["__uuid"], {"thickness": restored_value} + ) + if image_record is not None: + image_is_infinite = self.parse_thickness(image_record.get("thickness", 0)) == float("inf") + self.image_conjugate_mode = ( + "Preset: image at infinity" if image_is_infinite else "Preset: finite image" + ) + + def ensure_image_row_last(self): + records = self.ordered_table_records() + if not records: + return + + object_records = [record for record in records if record.get("element") == "Object"] + non_special_records = [ + record for record in records if record.get("element") not in {"Object", "Image"} + ] + image_records = [record for record in records if record.get("element") == "Image"] + if len(image_records) != 1 or len(object_records) != 1: + return + + desired_records = object_records + non_special_records + image_records + current_ids = [record["__uuid"] for record in records] + desired_ids = [record["__uuid"] for record in desired_records] + if current_ids == desired_ids: + return + + for index, record in enumerate(desired_records): + self.tableview.widget.move(record["__uuid"], "", index) + + def update_variable_row_styles(self): + bold_font = ("TkDefaultFont", 9, "bold") + self.tableview.widget.tag_configure( + "solved-variable", background="#fff2b3", font=bold_font + ) + self.tableview.widget.tag_configure( + "normal-row", background="", font=("TkDefaultFont", 9) + ) + + for item_id in self.tableview.items_ids(): + record = dict(self.tableview.data_source.record(item_id)) + if record.get("solve") == "*": + self.tableview.widget.item(item_id, tags=("solved-variable",)) + else: + self.tableview.widget.item(item_id, tags=("normal-row",)) + + def reorder_table_rows(self, tableview, dragged_item_id, target_item_id, insert_after): + records = [ + dict(tableview.data_source.record(item_id)) + for item_id in tableview.items_ids() + ] + item_ids = [record["__uuid"] for record in records] + if dragged_item_id not in item_ids or target_item_id not in item_ids: + return + + dragged_index = item_ids.index(dragged_item_id) + target_index = item_ids.index(target_item_id) + + if records[dragged_index].get("element") in {"Object", "Image"}: + return + if records[target_index].get("element") in {"Object", "Image"}: + return + if insert_after: + target_index += 1 + tableview.widget.move(dragged_item_id, "", target_index) + self.ensure_image_row_last() + + def move_selected_row(self, offset): + selected_items = list(self.tableview.widget.selection()) + if not selected_items: + return + + records = self.ordered_table_records() + item_ids = [record["__uuid"] for record in records] + selected_item_id = selected_items[0] + if selected_item_id not in item_ids: + return + selected_index = item_ids.index(selected_item_id) + if records[selected_index].get("element") in {"Object", "Image"}: + return + target_index = selected_index + offset + + if target_index < 0 or target_index >= len(records): + return + if records[target_index].get("element") in {"Object", "Image"}: + return + + target_item_id = item_ids[target_index] + insert_index = target_index + if offset > 0: + insert_index = target_index + 1 + self.tableview.widget.move(selected_item_id, "", insert_index) + self.ensure_image_row_last() + + self.tableview.widget.selection_set(selected_item_id) + def validate_source_data(self, tableview): try: - user_provided_path = self.get_path_from_ui( - without_apertures=True, max_position=None + self.get_path_from_ui( + without_apertures=True, max_position=None, include_image_plane=False ) return False except Exception as err: + if not hasattr(err, "details") or not isinstance(err.details, dict): + traceback.print_exc() + return True + mandatory_arguments = [ f"{k}=?" for k, v in err.details.items() if v is inspect._empty ] @@ -410,25 +920,72 @@ def click_copy_buttons(self, event, button): pyperclip.copy(script) def click_table_buttons(self, event, button): - path = self.get_path_from_ui(without_apertures=False) + path = self.get_path_from_ui( + without_apertures=False, include_image_plane=False + ) if button == self.delete_button: + self.tableview.dismiss_active_editors() + self.tableview.widget.focus_set() for selected_item in self.tableview.widget.selection(): - record = self.tableview.data_source.record(selected_item) - self.tableview.data_source.remove_record(selected_item) + record = dict(self.tableview.data_source.record(selected_item)) + if record.get("element") not in {"Object", "Image"}: + self.tableview.data_source.remove_record(selected_item) + self.tableview.widget.update_idletasks() elif button == self.add_lens_button: record = self.tableview.data_source.empty_record() - record["element"] = "Lens" + record["element"] = "Thin Lens" record["arguments"] = "f=50, diameter=25.4" - record["position"] = position = path.L + 50 + record["thickness"] = 50 + record["solve"] = "" self.tableview.data_source.append_record(record) + self.ensure_image_row_last() + elif button == self.move_up_button: + self.move_selected_row(-1) + elif button == self.move_down_button: + self.move_selected_row(1) + elif button == self.solve_button: + self.solve_marked_variable() elif button == self.add_aperture_button: record = self.tableview.data_source.empty_record() record["element"] = "Aperture" record["arguments"] = "diameter=25.4" - record["position"] = position = path.L + 50 + record["thickness"] = 50 + record["solve"] = "" self.tableview.data_source.append_record(record) + def solve_marked_variable(self): + variable_records = [ + record for record in self.ordered_table_records() if record.get("solve") == "*" + ] + if len(variable_records) != 1: + self.solver_status_message = "Mark exactly one variable row." + self.refresh() + return + + variable_record = variable_records[0] + if variable_record.get("element") != "Image": + self.solver_status_message = "First pass only solves Image thickness." + self.refresh() + return + + system_path = self.get_path_from_ui( + without_apertures=False, max_position=None, include_image_plane=False + ) + conjugate = system_path.forwardConjugate() + if conjugate.transferMatrix is None or conjugate.d is None or not isfinite(conjugate.d): + self.solver_status_message = "Image distance is not finite for this system." + self.refresh() + return + + solved_image_distance = conjugate.d + self.tableview.data_source.update_record( + variable_record["__uuid"], {"thickness": solved_image_distance} + ) + self.update_variable_row_styles() + self.solver_status_message = f"Solved image distance = {solved_image_distance:.4g} mm." + self.refresh() + def refresh(self): if not self.initialization_completed: return @@ -436,13 +993,12 @@ def refresh(self): if self.validate_source_data(self.tableview): return - self.tableview.sort_column(column_name="position") - self.canvas.widget.delete("ray") self.canvas.widget.delete("optics") self.canvas.widget.delete("apertures") self.canvas.widget.delete("labels") self.canvas.widget.delete("conjugates") + self.canvas.widget.delete("principal-planes") self.canvas.widget.delete("x-axis") self.canvas.widget.delete("y-axis") self.canvas.widget.delete("tick") @@ -450,57 +1006,105 @@ def refresh(self): try: user_provided_path = self.get_path_from_ui( - without_apertures=True, max_position=None + without_apertures=True, max_position=None, include_image_plane=False ) finite_imaging_path = None finite_path = None - conjugate = user_provided_path.forwardConjugate() + if ( + self.object_conjugate_mode == "Preset: finite object" + and self.image_conjugate_mode == "Preset: finite image" + ): + finite_path = self.get_path_from_ui( + without_apertures=False, max_position=None, include_image_plane=True + ) + finite_imaging_path = finite_path - if isfinite(conjugate.d): - image_position = user_provided_path.L + conjugate.d + elif ( + self.object_conjugate_mode == "Preset: object at infinity" + and self.image_conjugate_mode == "Preset: finite image" + ): + finite_path = self.get_path_from_ui( + without_apertures=False, max_position=None + ) finite_imaging_path = self.get_path_from_ui( - without_apertures=False, max_position=image_position + without_apertures=False, max_position=None + ) + back_focus = finite_imaging_path.backFocalLength() + if back_focus is not None and isfinite(back_focus) and back_focus > 0: + finite_imaging_path.append(Space(d=back_focus)) + else: + conjugate = user_provided_path.forwardConjugate() + + if isfinite(conjugate.d): + image_position = user_provided_path.L + conjugate.d + if image_position > 0: + finite_imaging_path = self.get_path_from_ui( + without_apertures=False, max_position=image_position + ) + else: + finite_imaging_path = None + + if ( + self.object_conjugate_mode == "Preset: finite object" + and self.image_conjugate_mode == "Preset: image at infinity" + ): + if finite_path is None: + finite_path = self.get_path_from_ui( + without_apertures=False, max_position=None + ) + finite_path.append( + Space(d=self.infinite_image_display_extension(finite_path)) ) - finite_path = finite_imaging_path + if finite_path is None: + finite_path = finite_imaging_path if finite_path is None: finite_path = self.get_path_from_ui( without_apertures=False, max_position=self.coords.axes_limits[0][1] ) - self.path_has_field_stop = finite_path.hasFieldStop() + display_path = finite_path + if ( + self.object_conjugate_mode == "Preset: object at infinity" + and self.image_conjugate_mode == "Preset: finite image" + and finite_imaging_path is not None + ): + display_path = finite_imaging_path - self.adjust_axes_limits(finite_path) + self.path_has_field_stop = display_path.hasFieldStop() + self.adjust_axes_limits(display_path) self.coords.create_x_axis() self.coords.create_x_major_ticks() self.coords.create_x_major_ticks_labels() self.coords.create_y_axis() self.coords.create_y_major_ticks() self.coords.create_y_major_ticks_labels() + self.relabel_infinite_x_axis_ends() - image_distance = conjugate.d if isfinite(conjugate.d) else None - self.calculate_imaging_path_results( - finite_imaging_path, - image_distance=image_distance, - ) + self.calculate_imaging_path_results(finite_imaging_path) - self.create_optical_path(finite_path, self.coords) + self.create_optical_path(display_path, self.coords) if self.show_raytraces: - self.create_all_traces(finite_path) + self.create_all_traces(display_path) if self.show_conjugates: - self.create_conjugate_planes(finite_path) + self.create_conjugate_planes( + finite_imaging_path if finite_imaging_path is not None else finite_path + ) + + if self.show_principal_planes: + self.create_principal_planes(finite_path) if self.show_apertures: - self.create_apertures_labels(finite_path) + self.create_apertures_labels(display_path) if self.show_labels: - self.create_object_labels(finite_path) - except ValueError as err: - pass + self.create_object_labels(display_path) + except Exception: + traceback.print_exc() def adjust_axes_limits(self, path): # half_diameter = ( @@ -517,84 +1121,127 @@ def adjust_axes_limits(self, path): raytraces = self.raytraces_to_display(path) y_min, y_max = self.raytraces_limits(raytraces) + x_max = max(float(path.L), 1.0) + self.coords.axes_limits = ( - (0, path.L), + (0, x_max), (min(y_min, -half_diameter) * 1.1, max(y_max, half_diameter) * 1.1), ) def raytraces_limits(self, raytraces): + if not raytraces: + return (-1.0, 1.0) ys = [] for raytrace in raytraces: ys.extend([ray.y for ray in raytrace]) + if not ys: + return (-1.0, 1.0) y_max = max(ys) y_min = min(ys) return y_min, y_max + def visible_image_size(self, path): + raytraces = self.raytraces_to_display(path) + output_ys = [ + raytrace[-1].y for raytrace in raytraces if raytrace and not raytrace[-1].isBlocked + ] + if not output_ys: + return None + return max(output_ys) - min(output_ys) + + def input_rays_to_display(self): + M = self.safe_int(self.number_of_heights, 5) + N = self.safe_int(self.number_of_angles, 5) + yMax = self.safe_float(self.max_height, 5.0) + thetaMax = self.safe_float(self.max_fan_angle, 0.1) + + if M == 1: + yMax = 0 + if N == 1: + thetaMax = 0 + + if self.object_conjugate_mode == "Preset: object at infinity": + # On-axis object at infinity: incoming rays are parallel before the first element. + return UniformRays(yMax=yMax, yMin=-yMax, thetaMax=0, thetaMin=0, M=M, N=1) + + return UniformRays(yMax=yMax, thetaMax=thetaMax, M=M, N=N) + + def infinite_image_display_extension(self, path): + if path is None: + return 100.0 + return max(100.0, path.L * 0.5) + def raytraces_to_display(self, path): - if self.show_principal_rays: + if self.show_principal_rays and self.object_conjugate_mode != "Preset: object at infinity": + raytraces = [] principal_ray = path.principalRay() if principal_ray is not None: principal_raytrace = path.trace(principal_ray) - axial_ray = path.axialRay() + raytraces.append(principal_raytrace) + axial_ray = path.axialRay() + if axial_ray is not None: axial_raytrace = path.trace(axial_ray) - return [principal_raytrace, axial_raytrace] - else: - M = int(self.number_of_heights) - N = int(self.number_of_angles) - yMax = float(self.max_height) - thetaMax = float(self.max_fan_angle) - - if M == 1: - yMax = 0 - if N == 1: - thetaMax = 0 - rays = UniformRays(yMax=yMax, thetaMax=thetaMax, M=M, N=N) - return path.traceMany(rays) + raytraces.append(axial_raytrace) + if raytraces: + return raytraces + rays = self.input_rays_to_display() + return path.traceMany(rays) def create_all_traces(self, path): - if self.show_principal_rays: + if self.show_principal_rays and self.object_conjugate_mode != "Preset: object at infinity": + line_traces = [] principal_ray = path.principalRay() if principal_ray is not None: principal_raytrace = path.trace(principal_ray) - line_traces = self.create_line_segments_from_raytrace( - principal_raytrace, - basis=DynamicBasis(self.coords, "basis"), - color="green", + line_traces.extend( + self.create_line_segments_from_raytrace( + principal_raytrace, + basis=DynamicBasis(self.coords, "basis"), + color="green", + ) ) - for line_trace in line_traces: - self.canvas.place(line_trace, position=self.coords_origin) - self.canvas.widget.tag_lower(line_trace.id) - axial_ray = path.axialRay() + axial_ray = path.axialRay() + if axial_ray is not None: axial_raytrace = path.trace(axial_ray) - line_traces = self.create_line_segments_from_raytrace( - axial_raytrace, - basis=DynamicBasis(self.coords, "basis"), - color="red", + line_traces.extend( + self.create_line_segments_from_raytrace( + axial_raytrace, + basis=DynamicBasis(self.coords, "basis"), + color="red", + ) ) - for line_trace in line_traces: - self.canvas.place(line_trace, position=self.coords_origin) - self.canvas.widget.tag_lower(line_trace.id) + + if not line_traces: + M = self.safe_int(self.number_of_heights, 5) + N = self.safe_int(self.number_of_angles, 5) + yMax = self.safe_float(self.max_height, 5.0) + thetaMax = self.safe_float(self.max_fan_angle, 0.1) + + if M == 1: + yMax = 0 + if N == 1: + thetaMax = 0 + rays = UniformRays(yMax=yMax, thetaMax=thetaMax, M=M, N=N) + self.create_raytraces_lines(path, rays) + return + + for line_trace in line_traces: + self.canvas.place(line_trace, position=self.coords_origin) + self.canvas.widget.tag_lower(line_trace.id) else: - M = int(self.number_of_heights) - N = int(self.number_of_angles) - yMax = float(self.max_height) - thetaMax = float(self.max_fan_angle) - - if M == 1: - yMax = 0 - if N == 1: - thetaMax = 0 - rays = UniformRays(yMax=yMax, thetaMax=thetaMax, M=M, N=N) + rays = self.input_rays_to_display() self.create_raytraces_lines(path, rays) def create_conjugate_planes(self, path): arrow_width = 10 object_z = 0 - object_height = float(self.max_height) * 2 + object_height = self.safe_float(self.max_height, 5.0) * 2 if self.show_principal_rays: object_height = path.fieldOfView() + if not isfinite(object_height): + object_height = self.safe_float(self.max_height, 5.0) * 2 basis = DynamicBasis(self.coords, "basis") canvas_object = Arrow( @@ -620,22 +1267,59 @@ def create_conjugate_planes(self, path): ) self.coords.place(canvas_image, position=Point(0, 0)) + def create_principal_planes(self, path): + principal_planes = path.principalPlanePositions(z=0) + y_lims = self.coords.axes_limits[1] + line_height = y_lims[1] - y_lims[0] + label_y = y_lims[1] * 1.2 + plane_labels = [] + if principal_planes.z1 is not None and isfinite(principal_planes.z1): + plane_labels.append((principal_planes.z1, "H1")) + if principal_planes.z2 is not None and isfinite(principal_planes.z2): + plane_labels.append((principal_planes.z2, "H2")) + + if len(plane_labels) == 2 and abs(plane_labels[0][0] - plane_labels[1][0]) < 1e-9: + plane_labels = [(plane_labels[0][0], "H1 = H2")] + + for z_value, label_text in plane_labels: + if z_value is None or not isfinite(z_value): + continue + + line = Line( + points=( + Point(0, -line_height / 2, basis=self.coords.basis), + Point(0, line_height / 2, basis=self.coords.basis), + ), + fill="purple", + width=2, + tag=("principal-planes"), + ) + self.coords.place(line, position=Point(z_value, 0, basis=self.coords.basis)) + self.coords.place( + CanvasLabel(text=label_text, tag=("principal-planes")), + position=Point(z_value, label_y), + ) + def create_apertures_labels(self, path): - position = path.apertureStop() y_lims = self.coords.axes_limits[1] label_position = y_lims[1] * 1.4 + aperture_labels = [] - if position.z is not None: - aperture_stop_label = CanvasLabel(text="AS", tag=("apertures")) - self.coords.place( - aperture_stop_label, position=Point(position.z, label_position) - ) + aperture_stop = path.apertureStop() + if aperture_stop.z is not None and isfinite(aperture_stop.z): + aperture_labels.append((aperture_stop.z, "AS")) - position = path.fieldStop() - if position.z is not None: - field_stop_label = CanvasLabel(text="FS", tag=("apertures")) + field_stop = path.fieldStop() + if field_stop.z is not None and isfinite(field_stop.z): + aperture_labels.append((field_stop.z, "FS")) + + if len(aperture_labels) == 2 and abs(aperture_labels[0][0] - aperture_labels[1][0]) < 1e-9: + aperture_labels = [(aperture_labels[0][0], "AS = FS")] + + for z_value, label_text in aperture_labels: self.coords.place( - field_stop_label, position=Point(position.z, label_position) + CanvasLabel(text=label_text, tag=("apertures")), + position=Point(z_value, label_position), ) def create_object_labels(self, path): @@ -665,6 +1349,12 @@ def create_raytraces_lines(self, path, rays): self.canvas.place(line_trace, position=self.coords_origin) self.canvas.widget.tag_lower(line_trace.id) + if not line_traces: + self.coords.place( + CanvasLabel(text="No drawable rays", tag=("labels")), + position=Point(10, self.coords.axes_limits[1][1] * 0.85), + ) + def fill_color_for_index(self, n): n_max = 1.6 t = (n - 1) / (n_max - 1) @@ -676,12 +1366,66 @@ def fill_color_for_index(self, n): return f"#{r:02x}{g:02x}{b:02x}" + @staticmethod + def thick_surface_sag(radius, semi_diameter, thickness): + if radius is None or not isfinite(radius) or radius == 0: + return 0.0 + + usable_height = min(abs(semi_diameter), abs(radius) * 0.98) + if usable_height <= 0: + return 0.0 + + sag = abs(radius) - (abs(radius) ** 2 - usable_height ** 2) ** 0.5 + return min(max(sag, 0.0), max(thickness * 0.45, 0.0)) + + def thick_lens_outline_points(self, element, diameter, basis): + half_height = diameter / 2 + thickness = max(element.L, 1e-6) + + front_sag = self.thick_surface_sag(element.R1, half_height, thickness) + back_sag = self.thick_surface_sag(element.R2, half_height, thickness) + + if element.R1 > 0: + front_corner_x = front_sag + front_mid_x = 0 + else: + front_corner_x = 0 + front_mid_x = front_sag + + if element.R2 < 0: + back_corner_x = thickness - back_sag + back_mid_x = thickness + else: + back_corner_x = thickness + back_mid_x = thickness - back_sag + + return ( + Point(front_corner_x, -half_height, basis=basis), + Point(front_corner_x, -half_height, basis=basis), + Point(back_corner_x, -half_height, basis=basis), + Point(back_corner_x, -half_height, basis=basis), + Point(back_mid_x, -half_height * 0.45, basis=basis), + Point(back_mid_x, 0, basis=basis), + Point(back_mid_x, half_height * 0.45, basis=basis), + Point(back_corner_x, half_height, basis=basis), + Point(back_corner_x, half_height, basis=basis), + Point(front_corner_x, half_height, basis=basis), + Point(front_corner_x, half_height, basis=basis), + Point(front_mid_x, half_height * 0.45, basis=basis), + Point(front_mid_x, 0, basis=basis), + Point(front_mid_x, -half_height * 0.45, basis=basis), + ) + def create_optical_path(self, path, coords): z = 0 - thickness = 3 + x_lims = self.coords.axes_limits[0] + x_span = max(x_lims[1] - x_lims[0], 1.0) + thickness = 0.003 * x_span + drew_optics = False for element in path: if type(element) is Lens: diameter = element.apertureDiameter + lens_half_width = 0.005 * x_span if not isfinite(diameter): y_lims = self.coords.axes_limits[1] diameter = 0.98 * (y_lims[1] - y_lims[0]) @@ -709,16 +1453,29 @@ def create_optical_path(self, path, coords): aperture_bottom, position=Point(z, 0, basis=coords.basis) ) - lens = Oval( - size=(5, diameter), - basis=coords.basis, - position_is_center=True, - fill=self.fill_color_for_index(1.5), - outline="black", - width=2, - tag=("optics"), - ) - coords.place(lens, position=Point(z, 0, basis=coords.basis)) + if getattr(element, "f", 0) < 0: + lens = BiconcaveLens( + lens_width=2 * lens_half_width, + height=diameter, + basis=coords.basis, + fill=self.fill_color_for_index(1.5), + outline="black", + width=2, + tag=("optics"), + ) + coords.place(lens, position=Point(z, 0, basis=coords.basis)) + else: + lens = Oval( + size=(2 * lens_half_width, diameter), + basis=coords.basis, + position_is_center=True, + fill=self.fill_color_for_index(1.5), + outline="black", + width=2, + tag=("optics"), + ) + coords.place(lens, position=Point(z, 0, basis=coords.basis)) + drew_optics = True elif type(element) is Aperture: diameter = element.apertureDiameter @@ -745,48 +1502,163 @@ def create_optical_path(self, path, coords): tag=("optics"), ) coords.place(aperture_bottom, position=Point(z, 0, basis=coords.basis)) + drew_optics = True - elif type(element) is ThickLens: + elif type(element) is CurvedMirror: diameter = element.apertureDiameter if not isfinite(diameter): y_lims = self.coords.axes_limits[1] diameter = 0.98 * (y_lims[1] - y_lims[0]) + + mirror_depth = 0.008 * x_span + if getattr(element, "C", 0) > 0: + points = ( + Point(0, -diameter / 2, basis=coords.basis), + Point(0, -diameter / 2, basis=coords.basis), + Point(-mirror_depth, -diameter * 0.2, basis=coords.basis), + Point(-mirror_depth, 0, basis=coords.basis), + Point(-mirror_depth, diameter * 0.2, basis=coords.basis), + Point(0, diameter / 2, basis=coords.basis), + Point(0, diameter / 2, basis=coords.basis), + ) else: - aperture_top = Line( - points=( - Point(-thickness, diameter / 2, basis=coords.basis), - Point(thickness, diameter / 2, basis=coords.basis), - ), - fill="black", - width=4, - tag=("optics"), + points = ( + Point(0, -diameter / 2, basis=coords.basis), + Point(0, -diameter / 2, basis=coords.basis), + Point(mirror_depth, -diameter * 0.2, basis=coords.basis), + Point(mirror_depth, 0, basis=coords.basis), + Point(mirror_depth, diameter * 0.2, basis=coords.basis), + Point(0, diameter / 2, basis=coords.basis), + Point(0, diameter / 2, basis=coords.basis), ) - coords.place(aperture_top, position=Point(z, 0, basis=coords.basis)) - aperture_bottom = Line( + mirror = SmoothedPolygon( + points=points, + smooth=1, + fill="", + outline="black", + width=3, + tag=("optics"), + ) + coords.place(mirror, position=Point(z, 0, basis=coords.basis)) + drew_optics = True + + elif type(element) is DielectricInterface: + diameter = element.apertureDiameter + if not isfinite(diameter): + y_lims = self.coords.axes_limits[1] + diameter = 0.98 * (y_lims[1] - y_lims[0]) + + interface_depth = 0.006 * x_span + radius = getattr(element, "R", float("inf")) + if not isfinite(radius) or radius == 0: + interface = Line( points=( - Point(-thickness, -diameter / 2, basis=coords.basis), - Point(thickness, -diameter / 2, basis=coords.basis), + Point(0, -diameter / 2, basis=coords.basis), + Point(0, diameter / 2, basis=coords.basis), ), fill="black", - width=4, + width=2, tag=("optics"), ) - coords.place( - aperture_bottom, position=Point(z, 0, basis=coords.basis) + coords.place(interface, position=Point(z, 0, basis=coords.basis)) + else: + if radius > 0: + points = ( + Point(0, -diameter / 2, basis=coords.basis), + Point(0, -diameter / 2, basis=coords.basis), + Point(interface_depth, -diameter * 0.2, basis=coords.basis), + Point(interface_depth, 0, basis=coords.basis), + Point(interface_depth, diameter * 0.2, basis=coords.basis), + Point(0, diameter / 2, basis=coords.basis), + Point(0, diameter / 2, basis=coords.basis), + ) + else: + points = ( + Point(0, -diameter / 2, basis=coords.basis), + Point(0, -diameter / 2, basis=coords.basis), + Point(-interface_depth, -diameter * 0.2, basis=coords.basis), + Point(-interface_depth, 0, basis=coords.basis), + Point(-interface_depth, diameter * 0.2, basis=coords.basis), + Point(0, diameter / 2, basis=coords.basis), + Point(0, diameter / 2, basis=coords.basis), + ) + interface = SmoothedPolygon( + points=points, + smooth=1, + fill="", + outline="black", + width=2, + tag=("optics"), ) + coords.place(interface, position=Point(z, 0, basis=coords.basis)) + drew_optics = True - lens = Oval( - size=(element.L, diameter), - basis=coords.basis, - position_is_center=True, + elif type(element) is Axicon: + diameter = element.apertureDiameter + if not isfinite(diameter): + y_lims = self.coords.axes_limits[1] + diameter = 0.98 * (y_lims[1] - y_lims[0]) + axicon_half_width = 0.006 * x_span + axicon = Line( + points=( + Point(-axicon_half_width, -diameter / 2, basis=coords.basis), + Point(0, 0, basis=coords.basis), + Point(-axicon_half_width, diameter / 2, basis=coords.basis), + Point(axicon_half_width, diameter / 2, basis=coords.basis), + Point(0, 0, basis=coords.basis), + Point(axicon_half_width, -diameter / 2, basis=coords.basis), + ), fill=self.fill_color_for_index(element.n), - outline="black", width=2, tag=("optics"), ) - coords.place( - lens, position=Point(z + element.L / 2, 0, basis=coords.basis) + coords.place(axicon, position=Point(z, 0, basis=coords.basis)) + drew_optics = True + + elif type(element) is ThickLens: + diameter = element.apertureDiameter + if not isfinite(diameter): + y_lims = self.coords.axes_limits[1] + diameter = 0.98 * (y_lims[1] - y_lims[0]) + else: + for edge_z in (z, z + element.L): + aperture_top = Line( + points=( + Point(-thickness, diameter / 2, basis=coords.basis), + Point(thickness, diameter / 2, basis=coords.basis), + ), + fill="black", + width=4, + tag=("optics"), + ) + coords.place( + aperture_top, position=Point(edge_z, 0, basis=coords.basis) + ) + aperture_bottom = Line( + points=( + Point(-thickness, -diameter / 2, basis=coords.basis), + Point(thickness, -diameter / 2, basis=coords.basis), + ), + fill="black", + width=4, + tag=("optics"), + ) + coords.place( + aperture_bottom, position=Point(edge_z, 0, basis=coords.basis) + ) + + lens = SmoothedPolygon( + points=self.thick_lens_outline_points( + element, diameter, coords.basis + ), + smooth=1, + fill=self.fill_color_for_index(element.n), + outline="black", + width=2, + tag=("optics"), ) + coords.place(lens, position=Point(z, 0, basis=coords.basis)) + drew_optics = True elif type(element) is DielectricSlab: diameter = element.apertureDiameter @@ -794,28 +1666,31 @@ def create_optical_path(self, path, coords): y_lims = self.coords.axes_limits[1] diameter = 0.98 * (y_lims[1] - y_lims[0]) else: - aperture_top = Line( - points=( - Point(-thickness, diameter / 2, basis=coords.basis), - Point(thickness, diameter / 2, basis=coords.basis), - ), - fill="black", - width=4, - tag=("optics"), - ) - coords.place(aperture_top, position=Point(z, 0, basis=coords.basis)) - aperture_bottom = Line( - points=( - Point(-thickness, -diameter / 2, basis=coords.basis), - Point(thickness, -diameter / 2, basis=coords.basis), - ), - fill="black", - width=4, - tag=("optics"), - ) - coords.place( - aperture_bottom, position=Point(z, 0, basis=coords.basis) - ) + for edge_z in (z, z + element.L): + aperture_top = Line( + points=( + Point(-thickness, diameter / 2, basis=coords.basis), + Point(thickness, diameter / 2, basis=coords.basis), + ), + fill="black", + width=4, + tag=("optics"), + ) + coords.place( + aperture_top, position=Point(edge_z, 0, basis=coords.basis) + ) + aperture_bottom = Line( + points=( + Point(-thickness, -diameter / 2, basis=coords.basis), + Point(thickness, -diameter / 2, basis=coords.basis), + ), + fill="black", + width=4, + tag=("optics"), + ) + coords.place( + aperture_bottom, position=Point(edge_z, 0, basis=coords.basis) + ) lens = Rectangle( size=(element.L, diameter), @@ -829,9 +1704,16 @@ def create_optical_path(self, path, coords): coords.place( lens, position=Point(z + element.L / 2, 0, basis=coords.basis) ) + drew_optics = True z += element.L + if not drew_optics: + self.coords.place( + CanvasLabel(text="No drawable optical elements", tag=("labels")), + position=Point(10, self.coords.axes_limits[1][1] * 0.7), + ) + def raytraces_to_lines(self, raytraces, basis): line_traces = [] @@ -856,8 +1738,15 @@ def raytraces_to_lines(self, raytraces, basis): return line_traces def create_line_segments_from_raytrace(self, raytrace, basis, color): - points = [Point(r.z, r.y, basis=basis) for r in raytrace] - return [Line(points, tag=("ray"), fill=color, width=2)] + finite_points = [] + for ray in raytrace: + if isfinite(ray.z) and isfinite(ray.y): + finite_points.append(Point(ray.z, ray.y, basis=basis)) + + if len(finite_points) < 2: + return [] + + return [Line(finite_points, tag=("ray"), fill=color, width=2)] def color_from_hue(self, hue): rgb = colorsys.hsv_to_rgb(hue, 1, 1) @@ -895,7 +1784,8 @@ def instantiate_element(class_name, class_kwargs) -> Any: # "DielectricSlab":DielectricSlab # } - cls = globals()[class_name] + class_name = ELEMENT_ALIASES.get(class_name, class_name) + cls = globals().get(class_name) # cls = allowed_classes.get(class_name) if cls is None: raise ValueError(f"Class {class_name} not allowed") @@ -920,33 +1810,57 @@ def instantiate_element(class_name, class_kwargs) -> Any: instance = cls(**filtered_class_kwargs) except Exception as err: instance = None + traceback.print_exc() return instance, signature_kwargs - def get_path_from_ui(self, without_apertures=True, max_position=None): + def get_path_from_ui(self, without_apertures=True, max_position=None, include_image_plane=True): path = ImagingPath() z = 0 - ordered_records = self.tableview.data_source.records - if without_apertures: - ordered_records = [ - record - for record in ordered_records - if "aperture" not in record["element"].lower() - ] - - ordered_records.sort(key=lambda e: float(e["position"])) - if max_position is not None: - ordered_records = [ - record - for record in ordered_records - if record["position"] <= max_position - ] + ordered_records = self.ordered_table_records() + first_real_element = self.first_real_element_record() + object_is_infinite = ( + self.object_record() is not None + and self.parse_thickness(self.object_record().get("thickness", "Finite")) == float("inf") + ) for element in ordered_records: + element_name = element["element"] + if element_name == "Image" and not include_image_plane: + continue + if without_apertures and "aperture" in element_name.lower(): + continue + + if element_name == "Object": + continue + + delta = self.parse_thickness(element["thickness"]) + if not isfinite(delta): + if ( + first_real_element is not None + and element.get("__uuid") == first_real_element.get("__uuid") + and object_is_infinite + ): + continue + if element_name == "Image": + continue + raise ValueError("Infinite thickness is only supported on Object or Image rows.") + if max_position is not None and z + delta > max_position: + delta = max_position - z + if delta > 0: + path.append(Space(d=delta)) + z += delta + if max_position is not None and z >= max_position: + break + + if element_name == "Image": + continue + path_element = None - constructor_string = f"{element['element']}({element['arguments']})" + class_name = ELEMENT_ALIASES.get(element_name, element_name) + constructor_string = f"{class_name}({element['arguments']})" class_name, class_kwargs = self.parse_element_call(constructor_string) path_element, signature_kwargs = self.instantiate_element( @@ -959,13 +1873,18 @@ def get_path_from_ui(self, without_apertures=True, max_position=None): err.details["element"] = element raise err - next_z = float(element["position"]) - - delta = next_z - z - - path.append(Space(d=delta)) path.append(path_element) - z += delta + z += path_element.L + + if self.object_conjugate_mode == "Preset: finite object" and self.image_conjugate_mode == "Preset: image at infinity": + front_focus = path.frontFocalLength() + if front_focus is not None and isfinite(front_focus) and front_focus > 0: + shifted_path = ImagingPath() + shifted_path.objectHeight = path.objectHeight + shifted_path.append(Space(d=front_focus)) + for element in path: + shifted_path.append(element) + path = shifted_path if max_position is not None: if path.L < max_position: @@ -974,38 +1893,17 @@ def get_path_from_ui(self, without_apertures=True, max_position=None): return path def get_path_script(self): - z = 0 - ordered_records = self.tableview.data_source.records - ordered_records.sort(key=lambda e: float(e["position"])) - script = "from raytracing import *\n\npath = ImagingPath()\n" - for element in ordered_records: - if element["element"] == "Lens": - focal_length = float(element["focal_length"]) - label = element["label"] - next_z = float(element["position"]) - diameter = float("+inf") - if element["diameter"] != "": - diameter = float(element["diameter"]) - script_line = f"path.append(Lens(f={focal_length}, diameter={diameter}, label='{label}'))\n" - elif element["element"] == "Aperture": - label = element["label"] - next_z = float(element["position"]) - diameter = float("+inf") - if element["diameter"] != "": - diameter = float(element["diameter"]) - path_element = Aperture(diameter=diameter, label=label) - script_line = ( - f"path.append(Aperture(diameter={diameter}, label='{label}'))\n" - ) - else: - print(f"Unable to include unknown element {element['element']}") + for element in self.ordered_table_records(): + thickness = self.parse_thickness(element["thickness"]) + if isfinite(thickness) and thickness > 0: + script += f"path.append(Space(d={thickness}))\n" + if element["element"] in {"Object", "Image"}: + continue - delta = next_z - z - script += f"path.append(Space(d={delta}))\n" - script += script_line - z += delta + class_name = ELEMENT_ALIASES.get(element["element"], element["element"]) + script += f"path.append({class_name}({element['arguments']}))\n" script += "\n" @@ -1046,22 +1944,24 @@ def get_path_script(self): return script - def calculate_imaging_path_results(self, imaging_path, image_distance=None): + def calculate_imaging_path_results(self, imaging_path): data_source = self.results_tableview.data_source uuids = data_source.sorted_records_uuids(field="__uuid") for uid in uuids: data_source.remove_record(uid) - if imaging_path is None: - data_source.append_record( - {"property": "Imaging Path", "value": "Non-imaging/infinite conjugate"} - ) + if self.solver_status_message: data_source.append_record( - {"property": "Image distance", "value": "Infinite"} + { + "property": "Solve status", + "value": self.solver_status_message, + } ) + + if imaging_path is None: data_source.append_record( - {"property": "Image size", "value": "Infinite [no image plane]"} + {"property": "Imaging Path", "value": "Non-imaging or virtual-image case"} ) return """ @@ -1069,18 +1969,36 @@ def calculate_imaging_path_results(self, imaging_path, image_distance=None): """ image_position = imaging_path.L + principal_planes = imaging_path.principalPlanePositions(z=0) - data_source.append_record( - {"property": "Object position", "value": f"0.0 (always)"} + object_position_value = "Infinity" if self.object_conjugate_mode == "Preset: object at infinity" else "0.0" + image_position_value = ( + "Infinity" + if self.image_conjugate_mode == "Preset: image at infinity" + else f"{image_position:.2f}" ) - if image_distance is None: - image_distance = imaging_path.L data_source.append_record( - {"property": "Image distance", "value": f"{image_distance:.2f}"} + {"property": "Object position", "value": object_position_value} ) data_source.append_record( - {"property": "Image position", "value": f"{image_position:.2f}"} + {"property": "Image position", "value": image_position_value} ) + if principal_planes.z1 is not None and isfinite(principal_planes.z1): + data_source.append_record( + {"property": "H1 position", "value": f"{principal_planes.z1:.2f}"} + ) + else: + data_source.append_record( + {"property": "H1 position", "value": "Inexistent"} + ) + if principal_planes.z2 is not None and isfinite(principal_planes.z2): + data_source.append_record( + {"property": "H2 position", "value": f"{principal_planes.z2:.2f}"} + ) + else: + data_source.append_record( + {"property": "H2 position", "value": "Inexistent"} + ) """ Aperture Stop and Axial ray @@ -1100,19 +2018,33 @@ def calculate_imaging_path_results(self, imaging_path, image_distance=None): ) axial_ray = imaging_path.axialRay() - NA = imaging_path.NA() - data_source.append_record( - { - "property": "Axial ray θ_max", - "value": f"{axial_ray.theta:.2f} rad / {axial_ray.theta*180/3.1416:.2f}°", - } - ) - data_source.append_record( - { - "property": "NA", - "value": f"{NA:.1f}", - } - ) + if axial_ray is not None: + NA = imaging_path.NA() + data_source.append_record( + { + "property": "Axial ray θ_max", + "value": f"{axial_ray.theta:.2f} rad / {axial_ray.theta*180/3.1416:.2f}°", + } + ) + data_source.append_record( + { + "property": "NA", + "value": f"{NA:.1f}", + } + ) + else: + data_source.append_record( + { + "property": "Axial ray θ_max", + "value": "Inexistent", + } + ) + data_source.append_record( + { + "property": "NA", + "value": "Inexistent", + } + ) else: data_source.append_record( {"property": "AS position", "value": f"Inexistent"} @@ -1153,9 +2085,14 @@ def calculate_imaging_path_results(self, imaging_path, image_distance=None): {"property": "Has vignetting [FS before image]", "value": f"False"} ) principal_ray = imaging_path.principalRay() - data_source.append_record( - {"property": "Principal ray y_max", "value": f"{principal_ray.y:.2f}"} - ) + if principal_ray is not None: + data_source.append_record( + {"property": "Principal ray y_max", "value": f"{principal_ray.y:.2f}"} + ) + else: + data_source.append_record( + {"property": "Principal ray y_max", "value": "Inexistent"} + ) else: data_source.append_record( {"property": "FS position", "value": f"Inexistent"} @@ -1173,41 +2110,86 @@ def calculate_imaging_path_results(self, imaging_path, image_distance=None): Object [FOV] and Image Sizes, dicated by finite FOV """ fov = imaging_path.fieldOfView() + mag_tran, mag_angle = imaging_path.magnification() + has_numeric_magnification = mag_tran is not None and mag_angle is not None + visible_image_size = self.visible_image_size(imaging_path) if isfinite(fov): - mag_tran, mag_angle = imaging_path.magnification() - data_source.append_record( {"property": "Field of view [FOV]", "value": f"{fov:.2f}"} ) - data_source.append_record( - {"property": "Image size", "value": f"{imaging_path.imageSize():.2f}"} - ) data_source.append_record( {"property": "Object size [same as FOV]", "value": f"{fov:.2f}"} ) + image_size_value = imaging_path.imageSize() + if visible_image_size is not None: + image_size_value = visible_image_size data_source.append_record( - {"property": "Magnification [Transverse]", "value": f"{mag_tran:.2f}"} - ) - data_source.append_record( - {"property": "Magnification [Angular]", "value": f"{mag_angle:.2f}"} + {"property": "Image size", "value": f"{image_size_value:.2f}"} ) + if has_numeric_magnification: + data_source.append_record( + {"property": "Magnification [Transverse]", "value": f"{mag_tran:.2f}"} + ) + data_source.append_record( + {"property": "Magnification [Angular]", "value": f"{mag_angle:.2f}"} + ) + else: + data_source.append_record( + {"property": "Magnification [Transverse]", "value": "Inexistent"} + ) + data_source.append_record( + {"property": "Magnification [Angular]", "value": "Inexistent"} + ) else: data_source.append_record( {"property": "Field of view [FOV]", "value": f"Infinite [no FS]"} ) data_source.append_record( - {"property": "Object size [same as FOV]", "value": f"Infinite [no FS]"} - ) - data_source.append_record( - {"property": "Image size", "value": f"Infinite [no FS]"} - ) - data_source.append_record( - {"property": "Magnification [Transverse]", "value": f"Inexistent"} - ) - data_source.append_record( - {"property": "Magnification [Angular]", "value": f"Inexistent"} + { + "property": "Object size [current object height]", + "value": f"{imaging_path.objectHeight:.2f}", + } ) + image_size = imaging_path.imageSize(useObject=True) + if isfinite(image_size): + image_size_value = image_size + if visible_image_size is not None: + image_size_value = visible_image_size + data_source.append_record( + { + "property": "Image size", + "value": f"{image_size_value:.2f}", + } + ) + else: + data_source.append_record( + { + "property": "Image size", + "value": f"Inexistent", + } + ) + + if has_numeric_magnification: + data_source.append_record( + { + "property": "Magnification [Transverse]", + "value": f"{mag_tran:.2f}", + } + ) + data_source.append_record( + { + "property": "Magnification [Angular]", + "value": f"{mag_angle:.2f}", + } + ) + else: + data_source.append_record( + {"property": "Magnification [Transverse]", "value": f"Inexistent"} + ) + data_source.append_record( + {"property": "Magnification [Angular]", "value": f"Inexistent"} + ) self.results_tableview.sort_column(column_name="property") From 10122c26b5b7d2f0096096d5fd24fdfa83182ecc Mon Sep 17 00:00:00 2001 From: dragonleopardpig Date: Fri, 3 Apr 2026 12:02:38 +0800 Subject: [PATCH 6/7] Fix infinity object plotting in UI editor --- raytracing/ui/raytracing_app.py | 247 ++++++++++++++++++++++++++------ 1 file changed, 205 insertions(+), 42 deletions(-) diff --git a/raytracing/ui/raytracing_app.py b/raytracing/ui/raytracing_app.py index 65f6e9bf..b687a67f 100644 --- a/raytracing/ui/raytracing_app.py +++ b/raytracing/ui/raytracing_app.py @@ -679,6 +679,25 @@ def create_window_widgets(self): def canvas_did_resize(self, notification): self.refresh() + def infinite_object_axis_offset(self, x_reference=None): + if x_reference is None: + x_reference = max(self.coords.axes_limits[0][1], 1.0) + return max(20.0, min(60.0, x_reference * 0.18)) + + def infinite_object_axis_x(self, x_reference=None): + x_min, _x_max = self.coords.axes_limits[0] + try: + negative_ticks = [tick for tick in self.coords.x_major_ticks() if tick < 0] + except Exception: + negative_ticks = [] + if negative_ticks: + return max(negative_ticks) + return x_min + + def infinite_object_plot_min_x(self, x_reference=None): + offset = self.infinite_object_axis_offset(x_reference) + return -offset + def relabel_infinite_x_axis_ends(self): if ( self.object_conjugate_mode != "Preset: object at infinity" @@ -686,22 +705,57 @@ def relabel_infinite_x_axis_ends(self): ): return - tick_label_ids = [ + for item_id in [ item_id for item_id in self.canvas.widget.find_withtag("tick-label") if "x-axis" in self.canvas.widget.gettags(item_id) - ] - if len(tick_label_ids) < 2: - return + ]: + self.canvas.widget.delete(item_id) - tick_label_ids.sort(key=lambda item_id: self.canvas.widget.coords(item_id)[0]) - left_label_id = tick_label_ids[0] - right_label_id = tick_label_ids[-1] + origin = self.coords.reference_point + y_lims = self.coords.axes_limits[1] + if self.coords.x_axis_at_bottom: + origin = origin + Point(0, y_lims[0], basis=self.coords.basis) - if self.object_conjugate_mode == "Preset: object at infinity": - self.canvas.widget.itemconfigure(left_label_id, text="−∞") - if self.image_conjugate_mode == "Preset: image at infinity": - self.canvas.widget.itemconfigure(right_label_id, text="+∞") + tick_basis = Basis(e0=self.coords.basis.e0, e1=self.coords.basis.e1.normalized()) + tick_values = list(self.coords.x_major_ticks()) + width = self.coords._element_kwargs.get("width", 1) + + for tick_value in tick_values: + label_text = self.coords.x_format.format(tick_value) + if ( + self.object_conjugate_mode == "Preset: object at infinity" + and abs(tick_value - self.infinite_object_axis_x()) < 1e-9 + ): + label_text = "−∞" + elif ( + self.image_conjugate_mode == "Preset: image at infinity" + and tick_value == max(tick_values) + ): + label_text = "+∞" + + tick_start = Point(tick_value, 0, basis=tick_basis) + tick_start = tick_start + Vector( + 0, + self.coords.major_length * width * self.coords.tick_value_offset, + tick_basis, + ) + + value = CanvasLabel( + text=label_text, + font_size=self.coords.tick_text_size * width, + anchor="center", + ) + value.create(self.canvas, position=origin + tick_start) + value.add_tag(f"group-{self.coords.id}") + value.add_tag("x-axis") + value.add_tag("tick-label") + + def reposition_y_axis_for_infinite_object(self): + return + + def add_infinite_object_x_marker(self): + return def observed_property_changed( self, observed_object, observed_property_name, new_value, context @@ -768,14 +822,18 @@ def normalize_special_rows(self): if object_is_infinite: updates = {} try: - first_thickness = self.parse_thickness(first_real_element.get("thickness", 0)) + first_thickness = self.parse_thickness( + first_real_element.get("thickness", 0) + ) except (TypeError, ValueError): first_thickness = 0.0 if isfinite(first_thickness): - updates["__finite_thickness_backup"] = self.normalized_thickness_text( - first_real_element.get("thickness", 0) + updates["__finite_thickness_backup"] = ( + self.normalized_thickness_text( + first_real_element.get("thickness", 0) + ) ) - if first_real_element.get("thickness") != "Infinity": + if str(first_real_element.get("thickness", "")) != "Infinity": updates["thickness"] = "Infinity" if updates: self.tableview.data_source.update_record( @@ -783,9 +841,12 @@ def normalize_special_rows(self): ) else: if str(first_real_element.get("thickness", "")) == "Infinity": - restored_value = first_real_element.get("__finite_thickness_backup", "200") + restored_value = first_real_element.get( + "__finite_thickness_backup", "200" + ) self.tableview.data_source.update_record( - first_real_element["__uuid"], {"thickness": restored_value} + first_real_element["__uuid"], + {"thickness": restored_value}, ) if image_record is not None: image_is_infinite = self.parse_thickness(image_record.get("thickness", 0)) == float("inf") @@ -842,11 +903,28 @@ def reorder_table_rows(self, tableview, dragged_item_id, target_item_id, insert_ dragged_index = item_ids.index(dragged_item_id) target_index = item_ids.index(target_item_id) + first_real_element = self.first_real_element_record() + object_is_infinite = ( + self.object_record() is not None + and self.parse_thickness(self.object_record().get("thickness", "Finite")) == float("inf") + ) if records[dragged_index].get("element") in {"Object", "Image"}: return + if ( + object_is_infinite + and first_real_element is not None + and records[dragged_index].get("__uuid") == first_real_element.get("__uuid") + ): + return if records[target_index].get("element") in {"Object", "Image"}: return + if ( + object_is_infinite + and first_real_element is not None + and records[target_index].get("__uuid") == first_real_element.get("__uuid") + ): + return if insert_after: target_index += 1 tableview.widget.move(dragged_item_id, "", target_index) @@ -863,14 +941,31 @@ def move_selected_row(self, offset): if selected_item_id not in item_ids: return selected_index = item_ids.index(selected_item_id) + first_real_element = self.first_real_element_record() + object_is_infinite = ( + self.object_record() is not None + and self.parse_thickness(self.object_record().get("thickness", "Finite")) == float("inf") + ) if records[selected_index].get("element") in {"Object", "Image"}: return + if ( + object_is_infinite + and first_real_element is not None + and records[selected_index].get("__uuid") == first_real_element.get("__uuid") + ): + return target_index = selected_index + offset if target_index < 0 or target_index >= len(records): return if records[target_index].get("element") in {"Object", "Image"}: return + if ( + object_is_infinite + and first_real_element is not None + and records[target_index].get("__uuid") == first_real_element.get("__uuid") + ): + return target_item_id = item_ids[target_index] insert_index = target_index @@ -969,16 +1064,11 @@ def solve_marked_variable(self): self.refresh() return - system_path = self.get_path_from_ui( - without_apertures=False, max_position=None, include_image_plane=False - ) - conjugate = system_path.forwardConjugate() - if conjugate.transferMatrix is None or conjugate.d is None or not isfinite(conjugate.d): + solved_image_distance = self.solved_image_thickness() + if solved_image_distance is None or not isfinite(solved_image_distance): self.solver_status_message = "Image distance is not finite for this system." self.refresh() return - - solved_image_distance = conjugate.d self.tableview.data_source.update_record( variable_record["__uuid"], {"thickness": solved_image_distance} ) @@ -1025,14 +1115,9 @@ def refresh(self): and self.image_conjugate_mode == "Preset: finite image" ): finite_path = self.get_path_from_ui( - without_apertures=False, max_position=None - ) - finite_imaging_path = self.get_path_from_ui( - without_apertures=False, max_position=None + without_apertures=False, max_position=None, include_image_plane=True ) - back_focus = finite_imaging_path.backFocalLength() - if back_focus is not None and isfinite(back_focus) and back_focus > 0: - finite_imaging_path.append(Space(d=back_focus)) + finite_imaging_path = finite_path else: conjugate = user_provided_path.forwardConjugate() @@ -1082,6 +1167,8 @@ def refresh(self): self.coords.create_y_major_ticks() self.coords.create_y_major_ticks_labels() self.relabel_infinite_x_axis_ends() + self.reposition_y_axis_for_infinite_object() + self.add_infinite_object_x_marker() self.calculate_imaging_path_results(finite_imaging_path) @@ -1101,11 +1188,43 @@ def refresh(self): if self.show_apertures: self.create_apertures_labels(display_path) + if self.object_conjugate_mode == "Preset: object at infinity": + self.canvas.widget.tag_raise("conjugates") + if self.show_labels: self.create_object_labels(display_path) except Exception: traceback.print_exc() + def system_path_without_image_plane(self): + return self.get_path_from_ui( + without_apertures=False, max_position=None, include_image_plane=False + ) + + def solved_image_axis_position(self): + system_path = self.system_path_without_image_plane() + if self.object_conjugate_mode == "Preset: object at infinity": + back_focus = system_path.backFocalLength() + if back_focus is None or not isfinite(back_focus): + return None + return system_path.L + back_focus + + conjugate = system_path.forwardConjugate() + if ( + conjugate.transferMatrix is None + or conjugate.d is None + or not isfinite(conjugate.d) + ): + return None + return system_path.L + conjugate.d + + def solved_image_thickness(self): + system_path = self.system_path_without_image_plane() + image_axis_position = self.solved_image_axis_position() + if image_axis_position is None or not isfinite(image_axis_position): + return None + return image_axis_position - system_path.L + def adjust_axes_limits(self, path): # half_diameter = ( # max( @@ -1123,8 +1242,22 @@ def adjust_axes_limits(self, path): x_max = max(float(path.L), 1.0) + solved_image_position = self.solved_image_axis_position() + if solved_image_position is not None and isfinite(solved_image_position): + x_max = max(x_max, solved_image_position) + + x_min = 0.0 + if self.object_conjugate_mode == "Preset: object at infinity": + x_min = self.infinite_object_plot_min_x(x_max) + if solved_image_position is not None and solved_image_position < x_min: + x_min = min(x_min, solved_image_position * 1.1) + + x_span = max(x_max - x_min, 1.0) + left_padding = max(90.0, min(260.0, x_span * 0.48)) + right_padding = max(35.0, min(110.0, x_span * 0.18)) + self.coords.axes_limits = ( - (0, x_max), + (x_min - left_padding, x_max + right_padding), (min(y_min, -half_diameter) * 1.1, max(y_max, half_diameter) * 1.1), ) @@ -1172,7 +1305,7 @@ def infinite_image_display_extension(self, path): return max(100.0, path.L * 0.5) def raytraces_to_display(self, path): - if self.show_principal_rays and self.object_conjugate_mode != "Preset: object at infinity": + if self.show_principal_rays: raytraces = [] principal_ray = path.principalRay() if principal_ray is not None: @@ -1188,7 +1321,7 @@ def raytraces_to_display(self, path): return path.traceMany(rays) def create_all_traces(self, path): - if self.show_principal_rays and self.object_conjugate_mode != "Preset: object at infinity": + if self.show_principal_rays: line_traces = [] principal_ray = path.principalRay() if principal_ray is not None: @@ -1236,7 +1369,11 @@ def create_all_traces(self, path): def create_conjugate_planes(self, path): arrow_width = 10 - object_z = 0 + object_z = ( + self.infinite_object_axis_x() + if self.object_conjugate_mode == "Preset: object at infinity" + else 0 + ) object_height = self.safe_float(self.max_height, 5.0) * 2 if self.show_principal_rays: object_height = path.fieldOfView() @@ -1253,11 +1390,26 @@ def create_conjugate_planes(self, path): ) self.coords.place(canvas_object, position=Point(0, 0)) - conjugate = path.forwardConjugate() - if conjugate.transferMatrix is not None: - image_z = conjugate.transferMatrix.L - magnification = conjugate.transferMatrix.magnification().transverse - image_height = magnification * object_height + if self.object_conjugate_mode == "Preset: object at infinity": + if self.image_conjugate_mode == "Preset: finite image": + image_z = path.L + image_height = object_height + else: + image_z = self.solved_image_axis_position() + if image_z is not None and isfinite(image_z): + image_height = object_height + else: + image_z = None + else: + conjugate = path.forwardConjugate() + if conjugate.transferMatrix is not None: + image_z = conjugate.transferMatrix.L + magnification = conjugate.transferMatrix.magnification().transverse + image_height = magnification * object_height + else: + image_z = None + + if image_z is not None: canvas_image = Arrow( start=Point(image_z, -image_height / 2, basis=basis), end=Point(image_z, image_height / 2, basis=basis), @@ -1746,6 +1898,12 @@ def create_line_segments_from_raytrace(self, raytrace, basis, color): if len(finite_points) < 2: return [] + if self.object_conjugate_mode == "Preset: object at infinity": + left_x = self.infinite_object_axis_x() + first_point = finite_points[0] + if left_x < first_point.c0: + finite_points.insert(0, Point(left_x, first_point.c1, basis=basis)) + return [Line(finite_points, tag=("ray"), fill=color, width=2)] def color_from_hue(self, hue): @@ -1842,10 +2000,11 @@ def get_path_from_ui(self, without_apertures=True, max_position=None, include_im and element.get("__uuid") == first_real_element.get("__uuid") and object_is_infinite ): - continue + delta = 0.0 if element_name == "Image": continue - raise ValueError("Infinite thickness is only supported on Object or Image rows.") + if not isfinite(delta): + raise ValueError("Infinite thickness is only supported on Object or Image rows.") if max_position is not None and z + delta > max_position: delta = max_position - z if delta > 0: @@ -1969,6 +2128,10 @@ def calculate_imaging_path_results(self, imaging_path): """ image_position = imaging_path.L + if self.image_conjugate_mode == "Preset: image at infinity": + solved_image_position = self.solved_image_axis_position() + if solved_image_position is not None: + image_position = solved_image_position principal_planes = imaging_path.principalPlanePositions(z=0) object_position_value = "Infinity" if self.object_conjugate_mode == "Preset: object at infinity" else "0.0" From 0c1d99aa0e6d3cdc229cdcc40975a4433434e72f Mon Sep 17 00:00:00 2001 From: dragonleopardpig Date: Fri, 3 Apr 2026 13:30:26 +0800 Subject: [PATCH 7/7] Refine infinity object ray plotting --- raytracing/ui/raytracing_app.py | 38 +++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/raytracing/ui/raytracing_app.py b/raytracing/ui/raytracing_app.py index b687a67f..cbba5cd5 100644 --- a/raytracing/ui/raytracing_app.py +++ b/raytracing/ui/raytracing_app.py @@ -667,6 +667,8 @@ def create_window_widgets(self): self.add_observer(self, "number_of_heights") self.add_observer(self, "number_of_angles") + self.add_observer(self, "max_height") + self.add_observer(self, "max_fan_angle") self.add_observer(self, "dont_show_blocked_rays") self.add_observer(self, "show_apertures") self.add_observer(self, "show_principal_rays") @@ -1346,16 +1348,7 @@ def create_all_traces(self, path): ) if not line_traces: - M = self.safe_int(self.number_of_heights, 5) - N = self.safe_int(self.number_of_angles, 5) - yMax = self.safe_float(self.max_height, 5.0) - thetaMax = self.safe_float(self.max_fan_angle, 0.1) - - if M == 1: - yMax = 0 - if N == 1: - thetaMax = 0 - rays = UniformRays(yMax=yMax, thetaMax=thetaMax, M=M, N=N) + rays = self.input_rays_to_display() self.create_raytraces_lines(path, rays) return @@ -1367,6 +1360,19 @@ def create_all_traces(self, path): rays = self.input_rays_to_display() self.create_raytraces_lines(path, rays) + def displayed_image_height(self, path, default_height): + image_height = self.visible_image_size(path) + if image_height is None: + image_height = path.imageSize() + if image_height is None: + return default_height + try: + if isfinite(image_height): + return image_height + except TypeError: + pass + return default_height + def create_conjugate_planes(self, path): arrow_width = 10 object_z = ( @@ -1393,11 +1399,11 @@ def create_conjugate_planes(self, path): if self.object_conjugate_mode == "Preset: object at infinity": if self.image_conjugate_mode == "Preset: finite image": image_z = path.L - image_height = object_height + image_height = self.displayed_image_height(path, object_height) else: image_z = self.solved_image_axis_position() if image_z is not None and isfinite(image_z): - image_height = object_height + image_height = self.displayed_image_height(path, object_height) else: image_z = None else: @@ -1869,12 +1875,16 @@ def create_optical_path(self, path, coords): def raytraces_to_lines(self, raytraces, basis): line_traces = [] - all_initial_y = [raytrace[0].y for raytrace in raytraces] + nonempty_raytraces = [raytrace for raytrace in raytraces if raytrace] + if not nonempty_raytraces: + return line_traces + + all_initial_y = [raytrace[0].y for raytrace in nonempty_raytraces] max_y = max(all_initial_y) min_y = min(all_initial_y) with PointDefault(basis=basis): - for raytrace in raytraces: + for raytrace in nonempty_raytraces: initial_y = raytrace[0].y if float(max_y - min_y) != 0: hue = (initial_y - min_y) / float(max_y - min_y)