{"library":"patchelf-wrapper","title":"patchelf-wrapper","description":"patchelf-wrapper is a Python module designed to assist in the installation of the `patchelf` utility for PyPI-hosted Python projects that depend on it. It ensures the `patchelf` binary is available within a project's build environment. The current version, 1.2.0, packages patchelf 0.11. The project's author notes that for end-users, installing `patchelf` via a system package manager is generally recommended over this wrapper.","language":"python","status":"maintenance","last_verified":"Thu Apr 16","install":{"commands":["pip install patchelf-wrapper"],"cli":null},"imports":["from patchelf_wrapper.patchelf import find_patchelf_cmd"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import subprocess\nfrom patchelf_wrapper.patchelf import find_patchelf_cmd\n\ntry:\n    patchelf_path = find_patchelf_cmd()\n    print(f\"Found patchelf at: {patchelf_path}\")\n\n    # Example: Print the version of the installed patchelf\n    result = subprocess.run([patchelf_path, '--version'], capture_output=True, text=True, check=True)\n    print(\"patchelf version:\\n\", result.stdout.strip())\n\n    # Example: Print RPATH of an ELF binary (replace 'your_binary' with an actual path)\n    # It's important to use a real ELF file for this, or it will error.\n    # try:\n    #     some_elf_binary = \"/bin/ls\" # Replace with a test ELF binary path\n    #     rpath_result = subprocess.run([patchelf_path, '--print-rpath', some_elf_binary], capture_output=True, text=True, check=True)\n    #     print(f\"RPATH of {some_elf_binary}: {rpath_result.stdout.strip()}\")\n    # except FileNotFoundError:\n    #     print(f\"Warning: Could not find '{some_elf_binary}' to demonstrate RPATH printing.\")\n    # except subprocess.CalledProcessError as e:\n    #     print(f\"Error running patchelf on {some_elf_binary}: {e.stderr.strip()}\")\n\nexcept RuntimeError as e:\n    print(f\"Error: {e}\")\nexcept FileNotFoundError:\n    print(\"Error: patchelf binary not found. Ensure patchelf-wrapper is correctly installed.\")","lang":"python","description":"This quickstart demonstrates how to locate the `patchelf` binary installed by `patchelf-wrapper` and then execute it via `subprocess` to perform common operations like printing its version or an ELF binary's RPATH.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}