Unverified Commit aa10fea3 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

Merge pull request #222817 from SuperSandro2000/python-sitePackages

treewide: replace `lib/${python.libPrefix}/site-packages` with its sh…
parents b9af749f 9cf8b8ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# Python {#setup-hook-python}

Adds the `lib/${python.libPrefix}/site-packages` subdirectory of each build input to the `PYTHONPATH` environment variable.
Adds the `python.sitePackages` subdirectory (i.e. `lib/pythonX.Y/site-packages`) of each build input to the `PYTHONPATH` environment variable.
+5 −5
Original line number Diff line number Diff line
@@ -80,21 +80,21 @@ buildPythonApplication rec {
  installPhase = ''
    runHook preInstall

    mkdir -p "$out/lib/${python.libPrefix}/site-packages"
    mkdir -p "$out/${python.sitePackages}"

    export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
    export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"

    ${python}/bin/${python.executable} setup.py install \
      --install-lib=$out/lib/${python.libPrefix}/site-packages \
      --install-lib=$out/${python.sitePackages} \
      --prefix="$out"

    eapth="$out/lib/${python.libPrefix}"/site-packages/easy-install.pth
    eapth="$out/${python.sitePackages}/easy-install.pth"
    if [ -e "$eapth" ]; then
        # move colliding easy_install.pth to specifically named one
        mv "$eapth" $(dirname "$eapth")/${pname}-${version}.pth
    fi

    rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
    rm -f "$out/${python.sitePackages}"/site.py*

    runHook postInstall
  '';
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ python3.pkgs.buildPythonApplication {
    [Desktop Entry]
    Type=Application
    Exec=$out/bin/loxodo
    Icon=$out/lib/${python3.libPrefix}/site-packages/resources/loxodo-icon.png
    Icon=$out/${python3.sitePackages}/resources/loxodo-icon.png
    Name=Loxodo
    GenericName=Password Vault
    Categories=Application;Other;
+2 −2
Original line number Diff line number Diff line
@@ -70,11 +70,11 @@ python3Packages.buildPythonApplication {
  ];

  postInstall = ''
    substituteInPlace $out/lib/${python3Packages.python.libPrefix}/site-packages/mkchromecast/video.py \
    substituteInPlace $out/${python3Packages.python.sitePackages}/mkchromecast/video.py \
      --replace '/usr/share/mkchromecast/nodejs/' '${placeholder "out"}/share/mkchromecast/nodejs/'
  '' + lib.optionalString stdenv.isDarwin ''
    install -Dm 755 -t $out/bin bin/audiodevice
    substituteInPlace $out/lib/${python3Packages.python.libPrefix}/site-packages/mkchromecast/audio_devices.py \
    substituteInPlace $out/${python3Packages.python.sitePackages}/mkchromecast/audio_devices.py \
      --replace './bin/audiodevice' '${placeholder "out"}/bin/audiodevice'
  '';

+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ let
        install -Dm444 -t $out/share/applications deluge/ui/data/share/applications/deluge.desktop
      '' else ''
        rm -r $out/bin/deluge-gtk
        rm -r $out/lib/${python3Packages.python.libPrefix}/site-packages/deluge/ui/gtk3
        rm -r $out/${python3Packages.python.sitePackages}/deluge/ui/gtk3
        rm -r $out/share/{icons,man/man1/deluge-gtk*,pixmaps}
      '');

Loading