---
Function {
    argument: None,
    arguments: FunctionArguments {
        arguments: [
            FunctionArgument {
                identifier: "root",
                default: None,
            },
            FunctionArgument {
                identifier: "python",
                default: None,
            },
            FunctionArgument {
                identifier: "coreutils",
                default: None,
            },
            FunctionArgument {
                identifier: "cmake",
                default: None,
            },
            FunctionArgument {
                identifier: "fetchurl",
                default: None,
            },
            FunctionArgument {
                identifier: "stdenv",
                default: None,
            },
            FunctionArgument {
                identifier: "lib",
                default: None,
            },
        ],
        ellipsis: false,
    },
    definition: LetIn {
        bindings: [
            KeyValue(
                AttributePath {
                    attributes: [
                        Raw {
                            content: "pythonVersion",
                            position: (4, 3),
                        },
                    ],
                },
                With {
                    expression: PropertyAccess {
                        expression: Variable {
                            identifier: "lib",
                            position: (4, 24),
                        },
                        attribute_path: AttributePath {
                            attributes: [
                                Raw {
                                    content: "versions",
                                    position: (4, 28),
                                },
                            ],
                        },
                        default: None,
                    },
                    target: String {
                        parts: [
                            Expression {
                                expression: FunctionApplication {
                                    function: Variable {
                                        identifier: "major",
                                        position: (4, 41),
                                    },
                                    arguments: [
                                        PropertyAccess {
                                            expression: Variable {
                                                identifier: "python",
                                                position: (4, 47),
                                            },
                                            attribute_path: AttributePath {
                                                attributes: [
                                                    Raw {
                                                        content: "version",
                                                        position: (4, 54),
                                                    },
                                                ],
                                            },
                                            default: None,
                                        },
                                    ],
                                },
                            },
                            Expression {
                                expression: FunctionApplication {
                                    function: Variable {
                                        identifier: "minor",
                                        position: (4, 64),
                                    },
                                    arguments: [
                                        PropertyAccess {
                                            expression: Variable {
                                                identifier: "python",
                                                position: (4, 70),
                                            },
                                            attribute_path: AttributePath {
                                                attributes: [
                                                    Raw {
                                                        content: "version",
                                                        position: (4, 77),
                                                    },
                                                ],
                                            },
                                            default: None,
                                        },
                                    ],
                                },
                            },
                        ],
                    },
                },
            ),
            KeyValue(
                AttributePath {
                    attributes: [
                        Raw {
                            content: "withPython",
                            position: (5, 3),
                        },
                    ],
                },
                BinaryOperation {
                    operator: NotEqualTo,
                    operands: [
                        Variable {
                            identifier: "python",
                            position: (5, 16),
                        },
                        Variable {
                            identifier: "null",
                            position: (5, 26),
                        },
                    ],
                },
            ),
            KeyValue(
                AttributePath {
                    attributes: [
                        Raw {
                            content: "root_py",
                            position: (7, 3),
                        },
                    ],
                },
                IfThenElse {
                    predicate: Variable {
                        identifier: "withPython",
                        position: (7, 16),
                    },
                    then: FunctionApplication {
                        function: PropertyAccess {
                            expression: Variable {
                                identifier: "root",
                                position: (7, 32),
                            },
                            attribute_path: AttributePath {
                                attributes: [
                                    Raw {
                                        content: "override",
                                        position: (7, 37),
                                    },
                                ],
                            },
                            default: None,
                        },
                        arguments: [
                            Map {
                                bindings: [
                                    Inherit(
                                        None,
                                        [
                                            Raw {
                                                content: "python",
                                                position: (7, 56),
                                            },
                                        ],
                                    ),
                                ],
                                recursive: false,
                            },
                        ],
                    },
                    else_: Variable {
                        identifier: "root",
                        position: (7, 71),
                    },
                },
            ),
        ],
        target: FunctionApplication {
            function: PropertyAccess {
                expression: Variable {
                    identifier: "stdenv",
                    position: (10, 1),
                },
                attribute_path: AttributePath {
                    attributes: [
                        Raw {
                            content: "mkDerivation",
                            position: (10, 8),
                        },
                    ],
                },
                default: None,
            },
            arguments: [
                Map {
                    bindings: [
                        KeyValue(
                            AttributePath {
                                attributes: [
                                    Raw {
                                        content: "pname",
                                        position: (11, 3),
                                    },
                                ],
                            },
                            String {
                                parts: [
                                    Raw {
                                        content: "hepmc3",
                                        position: (11, 12),
                                    },
                                ],
                            },
                        ),
                        KeyValue(
                            AttributePath {
                                attributes: [
                                    Raw {
                                        content: "version",
                                        position: (12, 3),
                                    },
                                ],
                            },
                            String {
                                parts: [
                                    Raw {
                                        content: "3.2.5",
                                        position: (12, 14),
                                    },
                                ],
                            },
                        ),
                        KeyValue(
                            AttributePath {
                                attributes: [
                                    Raw {
                                        content: "src",
                                        position: (14, 3),
                                    },
                                ],
                            },
                            FunctionApplication {
                                function: Variable {
                                    identifier: "fetchurl",
                                    position: (14, 9),
                                },
                                arguments: [
                                    Map {
                                        bindings: [
                                            KeyValue(
                                                AttributePath {
                                                    attributes: [
                                                        Raw {
                                                            content: "url",
                                                            position: (15, 5),
                                                        },
                                                    ],
                                                },
                                                String {
                                                    parts: [
                                                        Raw {
                                                            content: "http://hepmc.web.cern.ch/hepmc/releases/HepMC3-",
                                                            position: (15, 12),
                                                        },
                                                        Expression {
                                                            expression: Variable {
                                                                identifier: "version",
                                                                position: (15, 61),
                                                            },
                                                        },
                                                        Raw {
                                                            content: ".tar.gz",
                                                            position: (15, 69),
                                                        },
                                                    ],
                                                },
                                            ),
                                            KeyValue(
                                                AttributePath {
                                                    attributes: [
                                                        Raw {
                                                            content: "sha256",
                                                            position: (16, 5),
                                                        },
                                                    ],
                                                },
                                                String {
                                                    parts: [
                                                        Raw {
                                                            content: "sha256-zQ91yA91VJxZzCqCns52Acd96Xyypat1eQysjh1YUDI=",
                                                            position: (16, 15),
                                                        },
                                                    ],
                                                },
                                            ),
                                        ],
                                        recursive: false,
                                    },
                                ],
                            },
                        ),
                        KeyValue(
                            AttributePath {
                                attributes: [
                                    Raw {
                                        content: "nativeBuildInputs",
                                        position: (19, 3),
                                    },
                                ],
                            },
                            List {
                                elements: [
                                    Variable {
                                        identifier: "cmake",
                                        position: (19, 25),
                                    },
                                ],
                            },
                        ),
                        KeyValue(
                            AttributePath {
                                attributes: [
                                    Raw {
                                        content: "buildInputs",
                                        position: (20, 3),
                                    },
                                ],
                            },
                            BinaryOperation {
                                operator: Concatenation,
                                operands: [
                                    List {
                                        elements: [
                                            Variable {
                                                identifier: "root_py",
                                                position: (20, 19),
                                            },
                                        ],
                                    },
                                    FunctionApplication {
                                        function: PropertyAccess {
                                            expression: Variable {
                                                identifier: "lib",
                                                position: (21, 8),
                                            },
                                            attribute_path: AttributePath {
                                                attributes: [
                                                    Raw {
                                                        content: "optional",
                                                        position: (21, 12),
                                                    },
                                                ],
                                            },
                                            default: None,
                                        },
                                        arguments: [
                                            Variable {
                                                identifier: "withPython",
                                                position: (21, 21),
                                            },
                                            Variable {
                                                identifier: "python",
                                                position: (21, 32),
                                            },
                                        ],
                                    },
                                ],
                            },
                        ),
                        KeyValue(
                            AttributePath {
                                attributes: [
                                    Raw {
                                        content: "cmakeFlags",
                                        position: (23, 3),
                                    },
                                ],
                            },
                            BinaryOperation {
                                operator: Concatenation,
                                operands: [
                                    List {
                                        elements: [
                                            String {
                                                parts: [
                                                    Raw {
                                                        content: "-DHEPMC3_ENABLE_PYTHON=",
                                                        position: (24, 6),
                                                    },
                                                    Expression {
                                                        expression: IfThenElse {
                                                            predicate: Variable {
                                                                identifier: "withPython",
                                                                position: (24, 34),
                                                            },
                                                            then: String {
                                                                parts: [
                                                                    Raw {
                                                                        content: "ON",
                                                                        position: (24, 51),
                                                                    },
                                                                ],
                                                            },
                                                            else_: String {
                                                                parts: [
                                                                    Raw {
                                                                        content: "OFF",
                                                                        position: (24, 61),
                                                                    },
                                                                ],
                                                            },
                                                        },
                                                    },
                                                ],
                                            },
                                        ],
                                    },
                                    FunctionApplication {
                                        function: PropertyAccess {
                                            expression: Variable {
                                                identifier: "lib",
                                                position: (25, 8),
                                            },
                                            attribute_path: AttributePath {
                                                attributes: [
                                                    Raw {
                                                        content: "optionals",
                                                        position: (25, 12),
                                                    },
                                                ],
                                            },
                                            default: None,
                                        },
                                        arguments: [
                                            Variable {
                                                identifier: "withPython",
                                                position: (25, 22),
                                            },
                                            List {
                                                elements: [
                                                    String {
                                                        parts: [
                                                            Raw {
                                                                content: "-DHEPMC3_PYTHON_VERSIONS=",
                                                                position: (26, 6),
                                                            },
                                                            Expression {
                                                                expression: IfThenElse {
                                                                    predicate: PropertyAccess {
                                                                        expression: Variable {
                                                                            identifier: "python",
                                                                            position: (26, 36),
                                                                        },
                                                                        attribute_path: AttributePath {
                                                                            attributes: [
                                                                                Raw {
                                                                                    content: "isPy3k",
                                                                                    position: (26, 43),
                                                                                },
                                                                            ],
                                                                        },
                                                                        default: None,
                                                                    },
                                                                    then: String {
                                                                        parts: [
                                                                            Raw {
                                                                                content: "3.X",
                                                                                position: (26, 56),
                                                                            },
                                                                        ],
                                                                    },
                                                                    else_: String {
                                                                        parts: [
                                                                            Raw {
                                                                                content: "2.X",
                                                                                position: (26, 67),
                                                                            },
                                                                        ],
                                                                    },
                                                                },
                                                            },
                                                        ],
                                                    },
                                                    String {
                                                        parts: [
                                                            Raw {
                                                                content: "-DHEPMC3_Python_SITEARCH",
                                                                position: (27, 6),
                                                            },
                                                            Expression {
                                                                expression: Variable {
                                                                    identifier: "pythonVersion",
                                                                    position: (27, 32),
                                                                },
                                                            },
                                                            Raw {
                                                                content: "=",
                                                                position: (27, 46),
                                                            },
                                                            Expression {
                                                                expression: FunctionApplication {
                                                                    function: Variable {
                                                                        identifier: "placeholder",
                                                                        position: (27, 49),
                                                                    },
                                                                    arguments: [
                                                                        String {
                                                                            parts: [
                                                                                Raw {
                                                                                    content: "out",
                                                                                    position: (27, 62),
                                                                                },
                                                                            ],
                                                                        },
                                                                    ],
                                                                },
                                                            },
                                                            Raw {
                                                                content: "/",
                                                                position: (27, 67),
                                                            },
                                                            Expression {
                                                                expression: PropertyAccess {
                                                                    expression: Variable {
                                                                        identifier: "python",
                                                                        position: (27, 70),
                                                                    },
                                                                    attribute_path: AttributePath {
                                                                        attributes: [
                                                                            Raw {
                                                                                content: "sitePackages",
                                                                                position: (27, 77),
                                                                            },
                                                                        ],
                                                                    },
                                                                    default: None,
                                                                },
                                                            },
                                                        ],
                                                    },
                                                ],
                                            },
                                        ],
                                    },
                                ],
                            },
                        ),
                        KeyValue(
                            AttributePath {
                                attributes: [
                                    Raw {
                                        content: "postInstall",
                                        position: (30, 3),
                                    },
                                ],
                            },
                            String {
                                parts: [
                                    Raw {
                                        content: "substituteInPlace \"$out\"/bin/HepMC3-config \\\n  --replace 'greadlink' ",
                                        position: (31, 1),
                                    },
                                    Raw {
                                        content: "'",
                                        position: (32, 29),
                                    },
                                    Expression {
                                        expression: Variable {
                                            identifier: "coreutils",
                                            position: (32, 32),
                                        },
                                    },
                                    Raw {
                                        content: "/bin/readlink' \\\n  --replace 'readlink' ",
                                        position: (32, 42),
                                    },
                                    Raw {
                                        content: "'",
                                        position: (33, 28),
                                    },
                                    Expression {
                                        expression: Variable {
                                            identifier: "coreutils",
                                            position: (33, 31),
                                        },
                                    },
                                    Raw {
                                        content: "/bin/readlink'\n",
                                        position: (33, 41),
                                    },
                                ],
                            },
                        ),
                        KeyValue(
                            AttributePath {
                                attributes: [
                                    Raw {
                                        content: "doInstallCheck",
                                        position: (36, 3),
                                    },
                                ],
                            },
                            Variable {
                                identifier: "withPython",
                                position: (36, 20),
                            },
                        ),
                        KeyValue(
                            AttributePath {
                                attributes: [
                                    Raw {
                                        content: "installCheckPhase",
                                        position: (38, 3),
                                    },
                                ],
                            },
                            FunctionApplication {
                                function: PropertyAccess {
                                    expression: Variable {
                                        identifier: "lib",
                                        position: (38, 23),
                                    },
                                    attribute_path: AttributePath {
                                        attributes: [
                                            Raw {
                                                content: "optionalString",
                                                position: (38, 27),
                                            },
                                        ],
                                    },
                                    default: None,
                                },
                                arguments: [
                                    Variable {
                                        identifier: "withPython",
                                        position: (38, 42),
                                    },
                                    String {
                                        parts: [
                                            Raw {
                                                content: "PYTHONPATH=",
                                                position: (39, 1),
                                            },
                                            Expression {
                                                expression: FunctionApplication {
                                                    function: Variable {
                                                        identifier: "placeholder",
                                                        position: (39, 18),
                                                    },
                                                    arguments: [
                                                        String {
                                                            parts: [
                                                                Raw {
                                                                    content: "out",
                                                                    position: (39, 31),
                                                                },
                                                            ],
                                                        },
                                                    ],
                                                },
                                            },
                                            Raw {
                                                content: "/",
                                                position: (39, 36),
                                            },
                                            Expression {
                                                expression: PropertyAccess {
                                                    expression: Variable {
                                                        identifier: "python",
                                                        position: (39, 39),
                                                    },
                                                    attribute_path: AttributePath {
                                                        attributes: [
                                                            Raw {
                                                                content: "sitePackages",
                                                                position: (39, 46),
                                                            },
                                                        ],
                                                    },
                                                    default: None,
                                                },
                                            },
                                            Raw {
                                                content: " python -c 'import pyHepMC3'\n",
                                                position: (39, 59),
                                            },
                                        ],
                                    },
                                ],
                            },
                        ),
                        KeyValue(
                            AttributePath {
                                attributes: [
                                    Raw {
                                        content: "meta",
                                        position: (42, 3),
                                    },
                                ],
                            },
                            With {
                                expression: Variable {
                                    identifier: "lib",
                                    position: (42, 15),
                                },
                                target: Map {
                                    bindings: [
                                        KeyValue(
                                            AttributePath {
                                                attributes: [
                                                    Raw {
                                                        content: "description",
                                                        position: (43, 5),
                                                    },
                                                ],
                                            },
                                            String {
                                                parts: [
                                                    Raw {
                                                        content: "The HepMC package is an object oriented, C++ event record for High Energy Physics Monte Carlo generators and simulation",
                                                        position: (43, 20),
                                                    },
                                                ],
                                            },
                                        ),
                                        KeyValue(
                                            AttributePath {
                                                attributes: [
                                                    Raw {
                                                        content: "license",
                                                        position: (44, 5),
                                                    },
                                                ],
                                            },
                                            PropertyAccess {
                                                expression: Variable {
                                                    identifier: "licenses",
                                                    position: (44, 15),
                                                },
                                                attribute_path: AttributePath {
                                                    attributes: [
                                                        Raw {
                                                            content: "gpl3",
                                                            position: (44, 24),
                                                        },
                                                    ],
                                                },
                                                default: None,
                                            },
                                        ),
                                        KeyValue(
                                            AttributePath {
                                                attributes: [
                                                    Raw {
                                                        content: "homepage",
                                                        position: (45, 5),
                                                    },
                                                ],
                                            },
                                            String {
                                                parts: [
                                                    Raw {
                                                        content: "http://hepmc.web.cern.ch/hepmc/",
                                                        position: (45, 17),
                                                    },
                                                ],
                                            },
                                        ),
                                        KeyValue(
                                            AttributePath {
                                                attributes: [
                                                    Raw {
                                                        content: "platforms",
                                                        position: (46, 5),
                                                    },
                                                ],
                                            },
                                            PropertyAccess {
                                                expression: Variable {
                                                    identifier: "platforms",
                                                    position: (46, 17),
                                                },
                                                attribute_path: AttributePath {
                                                    attributes: [
                                                        Raw {
                                                            content: "unix",
                                                            position: (46, 27),
                                                        },
                                                    ],
                                                },
                                                default: None,
                                            },
                                        ),
                                        KeyValue(
                                            AttributePath {
                                                attributes: [
                                                    Raw {
                                                        content: "maintainers",
                                                        position: (47, 5),
                                                    },
                                                ],
                                            },
                                            With {
                                                expression: Variable {
                                                    identifier: "maintainers",
                                                    position: (47, 24),
                                                },
                                                target: List {
                                                    elements: [
                                                        Variable {
                                                            identifier: "veprbl",
                                                            position: (47, 39),
                                                        },
                                                    ],
                                                },
                                            },
                                        ),
                                    ],
                                    recursive: false,
                                },
                            },
                        ),
                    ],
                    recursive: true,
                },
            ],
        },
    },
}