diff options
Diffstat (limited to 'pkgs/development')
58 files changed, 1067 insertions, 471 deletions
diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index f5572c077f31..129ca72251fc 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -373,6 +373,9 @@ stdenv.mkDerivation ({ stdenv.lib.platforms.freebsd ++ stdenv.lib.platforms.illumos ++ stdenv.lib.platforms.darwin; + + # See #40038 + broken = stdenv.isDarwin; }; } diff --git a/pkgs/development/compilers/iasl/default.nix b/pkgs/development/compilers/iasl/default.nix index b1b31aecae13..ab9fd23f5088 100644 --- a/pkgs/development/compilers/iasl/default.nix +++ b/pkgs/development/compilers/iasl/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, bison, flex}: +{stdenv, fetchurl, fetchpatch, bison, flex}: stdenv.mkDerivation rec { pname = "iasl"; @@ -9,12 +9,20 @@ stdenv.mkDerivation rec { sha256 = "1vgqlv9pvxc52faxixpgz7hi1awqmj88bw5vqn3bldf6fmkh147w"; }; - NIX_CFLAGS_COMPILE = "-O3"; + NIX_CFLAGS_COMPILE = [ + "-O3" + ]; buildFlags = "iasl"; buildInputs = [ bison flex ]; + patches = fetchpatch { + /* https://github.com/acpica/acpica/pull/389 */ + url = "https://github.com/acpica/acpica/commit/935ca65f7806a3ef9bd02a947e50f3a1f586ac67.patch"; + sha256 = "0jz4bakifphm425shbd1j99hldgy71m7scl8mwibm441d56l3ydf"; + }; + installPhase = '' install -d $out/bin diff --git a/pkgs/development/compilers/nasm/default.nix b/pkgs/development/compilers/nasm/default.nix index 8d92bc4eba2f..f5645ae02192 100644 --- a/pkgs/development/compilers/nasm/default.nix +++ b/pkgs/development/compilers/nasm/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation rec { make golden && make test ''; + NIX_CFLAGS_COMPILE="-Wno-error=attributes"; + meta = with stdenv.lib; { homepage = https://www.nasm.us/; description = "An 80x86 and x86-64 assembler designed for portability and modularity"; diff --git a/pkgs/development/interpreters/python/build-python-package-common.nix b/pkgs/development/interpreters/python/build-python-package-common.nix deleted file mode 100644 index 0f8e088d434a..000000000000 --- a/pkgs/development/interpreters/python/build-python-package-common.nix +++ /dev/null @@ -1,31 +0,0 @@ -# This function provides generic bits to install a Python wheel. - -{ python -}: - -{ buildInputs ? [] -# Additional flags to pass to "pip install". -, installFlags ? [] -, ... } @ attrs: - -attrs // { - buildInputs = buildInputs ++ [ python.pythonForBuild.pkgs.bootstrapped-pip ]; - - configurePhase = attrs.configurePhase or '' - runHook preConfigure - runHook postConfigure - ''; - - installPhase = attrs.installPhase or '' - runHook preInstall - - mkdir -p "$out/${python.sitePackages}" - export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH" - - pushd dist - ${python.pythonForBuild.pkgs.bootstrapped-pip}/bin/pip install *.whl --no-index --prefix=$out --no-cache ${toString installFlags} --build tmpbuild - popd - - runHook postInstall - ''; -} diff --git a/pkgs/development/interpreters/python/build-python-package-flit.nix b/pkgs/development/interpreters/python/build-python-package-flit.nix deleted file mode 100644 index b0f9e0380211..000000000000 --- a/pkgs/development/interpreters/python/build-python-package-flit.nix +++ /dev/null @@ -1,22 +0,0 @@ -# This function provides specific bits for building a flit-based Python package. - -{ python -, flit -}: - -{ ... } @ attrs: - -attrs // { - nativeBuildInputs = [ flit ]; - buildPhase = attrs.buildPhase or '' - runHook preBuild - flit build --format wheel - runHook postBuild - ''; - - # Flit packages, like setuptools packages, might have tests. - installCheckPhase = attrs.checkPhase or '' - ${python.interpreter} -m unittest discover - ''; - doCheck = attrs.doCheck or true; -} diff --git a/pkgs/development/interpreters/python/build-python-package-pyproject.nix b/pkgs/development/interpreters/python/build-python-package-pyproject.nix deleted file mode 100644 index 085db44f3e82..000000000000 --- a/pkgs/development/interpreters/python/build-python-package-pyproject.nix +++ /dev/null @@ -1,56 +0,0 @@ -# This function provides specific bits for building a setuptools-based Python package. - -{ lib -, python -}: - -{ -# Global options passed to "python setup.py" - setupPyGlobalFlags ? [] -# Build options passed to "build_ext" -# https://github.com/pypa/pip/issues/881 -# Rename to `buildOptions` because it is not setuptools specific? -, setupPyBuildFlags ? [] -# Execute before shell hook -, preShellHook ? "" -# Execute after shell hook -, postShellHook ? "" -, ... } @ attrs: - -let - pipGlobalFlagsString = lib.concatMapStringsSep " " (option: "--global-option ${option}") setupPyGlobalFlags; - pipBuildFlagsString = lib.concatMapStringsSep " " (option: "--build-option ${option}") setupPyBuildFlags; -in attrs // { - buildPhase = attrs.buildPhase or '' - runHook preBuild - mkdir -p dist - echo "Creating a wheel..." - ${python.pythonForBuild.interpreter} -m pip wheel --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist ${pipGlobalFlagsString} ${pipBuildFlagsString} . - echo "Finished creating a wheel..." - runHook postBuild - ''; - - installCheckPhase = '' - runHook preCheck - echo "No checkPhase defined. Either provide a checkPhase or disable tests in case tests are not available."; exit 1 - runHook postCheck - ''; - - # With Python it's a common idiom to run the tests - # after the software has been installed. - doCheck = attrs.doCheck or true; - - shellHook = attrs.shellHook or '' - ${preShellHook} - # Long-term setup.py should be dropped. - if [ -e pyproject.toml ]; then - tmp_path=$(mktemp -d) - export PATH="$tmp_path/bin:$PATH" - export PYTHONPATH="$tmp_path/${python.pythonForBuild.sitePackages}:$PYTHONPATH" - mkdir -p $tmp_path/${python.pythonForBuild.sitePackages} - ${python.pythonForBuild.pkgs.bootstrapped-pip}/bin/pip install -e . --prefix $tmp_path >&2 - fi - ${postShellHook} - ''; - -} diff --git a/pkgs/development/interpreters/python/build-python-package-setuptools.nix b/pkgs/development/interpreters/python/build-python-package-setuptools.nix deleted file mode 100644 index 7738ea2f66a5..000000000000 --- a/pkgs/development/interpreters/python/build-python-package-setuptools.nix +++ /dev/null @@ -1,60 +0,0 @@ -# This function provides specific bits for building a setuptools-based Python package. - -{ lib -, python -}: - -{ -# Global options passed to "python setup.py" - setupPyGlobalFlags ? [] -# Build options passed to "python setup.py build_ext" -# https://github.com/pypa/pip/issues/881 -, setupPyBuildFlags ? [] -# Execute before shell hook -, preShellHook ? "" -# Execute after shell hook -, postShellHook ? "" -, ... } @ attrs: - -let - # use setuptools shim (so that setuptools is imported before distutils) - # pip does the same thing: https://github.com/pypa/pip/pull/3265 - setuppy = ./run_setup.py; - - setupPyGlobalFlagsString = lib.concatStringsSep " " setupPyGlobalFlags; - setupPyBuildExtString = lib.optionalString (setupPyBuildFlags != []) ("build_ext " + (lib.concatStringsSep " " setupPyBuildFlags)); - -in attrs // { - # we copy nix_run_setup over so it's executed relative to the root of the source - # many project make that assumption - buildPhase = attrs.buildPhase or '' - runHook preBuild - cp ${setuppy} nix_run_setup - ${python.pythonForBuild.interpreter} nix_run_setup ${setupPyGlobalFlagsString} ${setupPyBuildExtString} bdist_wheel - runHook postBuild - ''; - - installCheckPhase = attrs.checkPhase or '' - runHook preCheck - ${python.pythonForBuild.interpreter} nix_run_setup test - runHook postCheck - ''; - - # Python packages that are installed with setuptools - # are typically distributed with tests. - # With Python it's a common idiom to run the tests - # after the software has been installed. - doCheck = attrs.doCheck or true; - - shellHook = attrs.shellHook or '' - ${preShellHook} - if test -e setup.py; then - tmp_path=$(mktemp -d) - export PATH="$tmp_path/bin:$PATH" - export PYTHONPATH="$tmp_path/${python.pythonForBuild.sitePackages}:$PYTHONPATH" - mkdir -p $tmp_path/${python.pythonForBuild.sitePackages} - ${python.pythonForBuild.pkgs.bootstrapped-pip}/bin/pip install -e . --prefix $tmp_path >&2 - fi - ${postShellHook} - ''; -} diff --git a/pkgs/development/interpreters/python/build-python-package-wheel.nix b/pkgs/development/interpreters/python/build-python-package-wheel.nix deleted file mode 100644 index e3c4e13c0e2d..000000000000 --- a/pkgs/development/interpreters/python/build-python-package-wheel.nix +++ /dev/null @@ -1,20 +0,0 @@ -# This function provides specific bits for building a wheel-based Python package. - -{ -}: - -{ ... } @ attrs: - -attrs // { - unpackPhase = '' - mkdir dist - cp "$src" "dist/$(stripHash "$src")" - ''; - - # Wheels are pre-compiled - buildPhase = attrs.buildPhase or ":"; - installCheckPhase = attrs.checkPhase or ":"; - - # Wheels don't have any checks to run - doCheck = attrs.doCheck or false; -} \ No newline at end of file diff --git a/pkgs/development/interpreters/python/build-python-package.nix b/pkgs/development/interpreters/python/build-python-package.nix deleted file mode 100644 index 61c1186cef9e..000000000000 --- a/pkgs/development/interpreters/python/build-python-package.nix +++ /dev/null @@ -1,48 +0,0 @@ -# This function provides a generic Python package builder, -# and can build packages that use distutils, setuptools or flit. - -{ lib -, config -, python -, wrapPython -, setuptools -, unzip -, ensureNewerSourcesForZipFilesHook -, toPythonModule -, namePrefix -, flit -, writeScript -, update-python-libraries -}: - -let - setuptools-specific = import ./build-python-package-setuptools.nix { inherit lib python; }; - pyproject-specific = import ./build-python-package-pyproject.nix { inherit lib python; }; - flit-specific = import ./build-python-package-flit.nix { inherit python flit; }; - wheel-specific = import ./build-python-package-wheel.nix { }; - common = import ./build-python-package-common.nix { inherit python; }; - mkPythonDerivation = import ./mk-python-derivation.nix { - inherit lib config python wrapPython setuptools unzip ensureNewerSourcesForZipFilesHook; - inherit toPythonModule namePrefix update-python-libraries; - }; -in - -{ -# Several package formats are supported. -# "setuptools" : Install a common setuptools/distutils based package. This builds a wheel. -# "wheel" : Install from a pre-compiled wheel. -# "flit" : Install a flit package. This builds a wheel. -# "other" : Provide your own buildPhase and installPhase. -format ? "setuptools" -, ... } @ attrs: - -let - formatspecific = - if format == "pyproject" then common (pyproject-specific attrs) - else if format == "setuptools" then common (setuptools-specific attrs) - else if format == "flit" then common (flit-specific attrs) - else if format == "wheel" then common (wheel-specific attrs) - else if format == "other" then {} - else throw "Unsupported format ${format}"; - -in mkPythonDerivation ( attrs // formatspecific ) diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix new file mode 100644 index 000000000000..9a7ec98ba178 --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -0,0 +1,95 @@ +# Hooks for building Python packages. +{ python +, callPackage +, makeSetupHook +}: + +let + pythonInterpreter = python.pythonForBuild.interpreter; + pythonSitePackages = python.sitePackages; + pythonCheckInterpreter = python.interpreter; + setuppy = ../run_setup.py; +in rec { + + flitBuildHook = callPackage ({ flit }: + makeSetupHook { + name = "flit-build-hook"; + deps = [ flit ]; + substitutions = { + inherit pythonInterpreter; + }; + } ./flit-build-hook.sh) {}; + + pipBuildHook = callPackage ({ pip }: + makeSetupHook { + name = "pip-build-hook.sh"; + deps = [ pip ]; + substitutions = { + inherit pythonInterpreter pythonSitePackages; + }; + } ./pip-build-hook.sh) {}; + + pipInstallHook = callPackage ({ pip }: + makeSetupHook { + name = "pip-install-hook"; + deps = [ pip ]; + substitutions = { + inherit pythonInterpreter pythonSitePackages; + }; + } ./pip-install-hook.sh) {}; + + pytestCheckHook = callPackage ({ pytest }: + makeSetupHook { + name = "pytest-check-hook"; + deps = [ pytest ]; + substitutions = { + inherit pythonCheckInterpreter; + }; + } ./pytest-check-hook.sh) {}; + + pythonCatchConflictsHook = callPackage ({ setuptools }: + makeSetupHook { + name = "python-catch-conflicts-hook"; + deps = [ setuptools ]; + substitutions = { + inherit pythonInterpreter; + catchConflicts=../catch_conflicts/catch_conflicts.py; + }; + } ./python-catch-conflicts-hook.sh) {}; + + pythonImportsCheckHook = callPackage ({}: + makeSetupHook { + name = "python-imports-check-hook.sh"; + substitutions = { + inherit pythonCheckInterpreter; + }; + } ./python-imports-check-hook.sh) {}; + + pythonRemoveBinBytecodeHook = callPackage ({ }: + makeSetupHook { + name = "python-remove-bin-bytecode-hook"; + } ./python-remove-bin-bytecode-hook.sh) {}; + + setuptoolsBuildHook = callPackage ({ setuptools, wheel }: + makeSetupHook { + name = "setuptools-setup-hook"; + deps = [ setuptools wheel ]; + substitutions = { + inherit pythonInterpreter pythonSitePackages setuppy; + }; + } ./setuptools-build-hook.sh) {}; + + setuptoolsCheckHook = callPackage ({ setuptools }: + makeSetupHook { + name = "setuptools-check-hook"; + deps = [ setuptools ]; + substitutions = { + inherit pythonCheckInterpreter setuppy; + }; + } ./setuptools-check-hook.sh) {}; + + wheelUnpackHook = callPackage ({ }: + makeSetupHook { + name = "wheel-unpack-hook.sh"; + } ./wheel-unpack-hook.sh) {}; +} diff --git a/pkgs/development/interpreters/python/hooks/flit-build-hook.sh b/pkgs/development/interpreters/python/hooks/flit-build-hook.sh new file mode 100644 index 000000000000..faa3f6e3075f --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/flit-build-hook.sh @@ -0,0 +1,15 @@ +# Setup hook for flit +echo "Sourcing flit-build-hook" + +flitBuildPhase () { + echo "Executing flitBuildPhase" + preBuild + @pythonInterpreter@ -m flit build --format wheel + postBuild + echo "Finished executing flitBuildPhase" +} + +if [ -z "$dontUseFlitBuild" ] && [ -z "$buildPhase" ]; then + echo "Using flitBuildPhase" + buildPhase=flitBuildPhase +fi diff --git a/pkgs/development/interpreters/python/hooks/pip-build-hook.sh b/pkgs/development/interpreters/python/hooks/pip-build-hook.sh new file mode 100644 index 000000000000..6796d3efd0a1 --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/pip-build-hook.sh @@ -0,0 +1,42 @@ +# Setup hook to use for pip projects +echo "Sourcing pip-build-hook" + +pipBuildPhase() { + echo "Executing pipBuildPhase" + runHook preBuild + + mkdir -p dist + echo "Creating a wheel..." + @pythonInterpreter@ -m pip wheel --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist "$options" . + echo "Finished creating a wheel..." + + runHook postBuild + echo "Finished executing pipBuildPhase" +} + +pipShellHook() { + echo "Executing pipShellHook" + runHook preShellHook + + # Long-term setup.py should be dropped. + if [ -e pyproject.toml ]; then + tmp_path=$(mktemp -d) + export PATH="$tmp_path/bin:$PATH" + export PYTHONPATH="$tmp_path/@pythonSitePackages@:$PYTHONPATH" + mkdir -p "$tmp_path/@pythonSitePackages@" + @pythonInterpreter@ -m pip install -e . --prefix "$tmp_path" >&2 + fi + + runHook postShellHook + echo "Finished executing pipShellHook" +} + +if [ -z "$dontUsePipBuild" ] && [ -z "$buildPhase" ]; then + echo "Using pipBuildPhase" + buildPhase=pipBuildPhase +fi + +if [ -z "$shellHook" ]; then + echo "Using pipShellHook" + shellHook=pipShellHook +fi diff --git a/pkgs/development/interpreters/python/hooks/pip-install-hook.sh b/pkgs/development/interpreters/python/hooks/pip-install-hook.sh new file mode 100644 index 000000000000..f528ec63cb8e --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/pip-install-hook.sh @@ -0,0 +1,24 @@ +# Setup hook for pip. +echo "Sourcing pip-install-hook" + +declare -a pipInstallFlags + +pipInstallPhase() { + echo "Executing pipInstallPhase" + runHook preInstall + + mkdir -p "$out/@pythonSitePackages@" + export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH" + + pushd dist || return 1 + @pythonInterpreter@ -m pip install ./*.whl --no-index --prefix="$out" --no-cache $pipInstallFlags --build tmpbuild + popd || return 1 + + runHook postInstall + echo "Finished executing pipInstallPhase" +} + +if [ -z "$dontUsePipInstall" ] && [ -z "$installPhase" ]; then + echo "Using pipInstallPhase" + installPhase=pipInstallPhase +fi diff --git a/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh b/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh new file mode 100644 index 000000000000..24510b9f9931 --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/pytest-check-hook.sh @@ -0,0 +1,49 @@ +# Setup hook for pytest +echo "Sourcing pytest-check-hook" + +declare -ar disabledTests + +function _concatSep { + local result + local sep="$1" + local -n arr=$2 + for index in ${!arr[*]}; do + if [ $index -eq 0 ]; then + result="${arr[index]}" + else + result+=" $sep ${arr[index]}" + fi + done + echo "$result" +} + +function _pytestComputeDisabledTestsString () { + declare -a tests + local tests=($1) + local prefix="not " + prefixed=( "${tests[@]/#/$prefix}" ) + result=$(_concatSep "and" prefixed) + echo "$result" +} + +function pytestCheckPhase() { + echo "Executing pytestCheckPhase" + runHook preCheck + + # Compose arguments + args=" -m pytest" + if [ -n "$disabledTests" ]; then + disabledTestsString=$(_pytestComputeDisabledTestsString "${disabledTests[@]}") + args+=" -k \""$disabledTestsString"\"" + fi + args+=" ${pytestFlagsArray[@]}" + eval "@pythonCheckInterpreter@ $args" + + runHook postCheck + echo "Finished executing pytestCheckPhase" +} + +if [ -z "$dontUsePytestCheck" ] && [ -z "$installCheckPhase" ]; then + echo "Using pytestCheckPhase" + preDistPhases+=" pytestCheckPhase" +fi diff --git a/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook.sh b/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook.sh new file mode 100644 index 000000000000..e9065cf17934 --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook.sh @@ -0,0 +1,10 @@ +# Setup hook for detecting conflicts in Python packages +echo "Sourcing python-catch-conflicts-hook.sh" + +pythonCatchConflictsPhase() { + @pythonInterpreter@ @catchConflicts@ +} + +if [ -z "$dontUsePythonCatchConflicts" ]; then + preDistPhases+=" pythonCatchConflictsPhase" +fi diff --git a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh new file mode 100644 index 000000000000..7e2b3f69d6dd --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh @@ -0,0 +1,16 @@ +# Setup hook for checking whether Python imports succeed +echo "Sourcing python-imports-check-hook.sh" + +pythonImportsCheckPhase () { + echo "Executing pythonImportsCheckPhase" + + if [ -n "$pythonImportsCheck" ]; then + echo "Check whether the following modules can be imported: $pythonImportsCheck" + cd $out && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"pythonImportsCheck\"].split()))'" + fi +} + +if [ -z "$dontUsePythonImportsCheck" ]; then + echo "Using pythonImportsCheckPhase" + preDistPhases+=" pythonImportsCheckPhase" +fi diff --git a/pkgs/development/interpreters/python/hooks/python-remove-bin-bytecode-hook.sh b/pkgs/development/interpreters/python/hooks/python-remove-bin-bytecode-hook.sh new file mode 100644 index 000000000000..960de767be79 --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/python-remove-bin-bytecode-hook.sh @@ -0,0 +1,17 @@ +# Setup hook for detecting conflicts in Python packages +echo "Sourcing python-remove-bin-bytecode-hook.sh" + +# Check if we have two packages with the same name in the closure and fail. +# If this happens, something went wrong with the dependencies specs. +# Intentionally kept in a subdirectory, see catch_conflicts/README.md. + +pythonRemoveBinBytecodePhase () { + if [ -d "$out/bin" ]; then + rm -rf "$out/bin/__pycache__" # Python 3 + find "$out/bin" -type f -name "*.pyc" -delete # Python 2 + fi +} + +if [ -z "$dontUsePythonRemoveBinBytecode" ]; then + preDistPhases+=" pythonRemoveBinBytecodePhase" +fi diff --git a/pkgs/development/interpreters/python/hooks/setuptools-build-hook.sh b/pkgs/development/interpreters/python/hooks/setuptools-build-hook.sh new file mode 100644 index 000000000000..db3e4225d293 --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/setuptools-build-hook.sh @@ -0,0 +1,47 @@ +# Setup hook for setuptools. +echo "Sourcing setuptools-build-hook" + +setuptoolsBuildPhase() { + echo "Executing setuptoolsBuildPhase" + local args + runHook preBuild + + cp -f @setuppy@ nix_run_setup + args="" + if [ -n "$setupPyGlobalFlags" ]; then + args+="$setupPyGlobalFlags" + fi + if [ -n "$setupPyBuildFlags" ]; then + args+="build_ext $setupPyBuildFlags" + fi + eval "@pythonInterpreter@ nix_run_setup $args bdist_wheel" + + runHook postBuild + echo "Finished executing setuptoolsInstallPhase" +} + +setuptoolsShellHook() { + echo "Executing setuptoolsShellHook" + runHook preShellHook + + if test -e setup.py; then + tmp_path=$(mktemp -d) + export PATH="$tmp_path/bin:$PATH" + export PYTHONPATH="@pythonSitePackages@:$PYTHONPATH" + mkdir -p "$tmp_path/@pythonSitePackages@" + eval "@pythonInterpreter@ -m pip -e . --prefix $tmp_path >&2" + fi + + runHook postShellHook + echo "Finished executing setuptoolsShellHook" +} + +if [ -z "$dontUseSetuptoolsBuild" ] && [ -z "$buildPhase" ]; then + echo "Using setuptoolsBuildPhase" + buildPhase=setuptoolsBuildPhase +fi + +if [ -z "$dontUseSetuptoolsShellHook" ] && [ -z "$shellHook" ]; then + echo "Using setuptoolsShellHook" + shellHook=setuptoolsShellHook +fi diff --git a/pkgs/development/interpreters/python/hooks/setuptools-check-hook.sh b/pkgs/development/interpreters/python/hooks/setuptools-check-hook.sh new file mode 100644 index 000000000000..71bb036a91ad --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/setuptools-check-hook.sh @@ -0,0 +1,18 @@ +# Setup hook for setuptools. +echo "Sourcing setuptools-check-hook" + +setuptoolsCheckPhase() { + echo "Executing setuptoolsCheckPhase" + runHook preCheck + + cp -f @setuppy@ nix_run_setup + @pythonCheckInterpreter@ nix_run_setup test + + runHook postCheck + echo "Finished executing setuptoolsCheckPhase" +} + +if [ -z "$dontUseSetuptoolsCheck" ] && [ -z "$installCheckPhase" ]; then + echo "Using setuptoolsCheckPhase" + preDistPhases+=" setuptoolsCheckPhase" +fi diff --git a/pkgs/development/interpreters/python/hooks/wheel-unpack-hook.sh b/pkgs/development/interpreters/python/hooks/wheel-unpack-hook.sh new file mode 100644 index 000000000000..6dd0c5be4cb2 --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/wheel-unpack-hook.sh @@ -0,0 +1,18 @@ +# Setup hook to use in case a wheel is fetched +echo "Sourcing wheel setup hook" + +wheelUnpackPhase(){ + echo "Executing wheelUnpackPhase" + runHook preUnpack + + mkdir -p dist + cp "$src" "dist/$(stripHash "$src")" + +# runHook postUnpack # Calls find...? + echo "Finished executing wheelUnpackPhase" +} + +if [ -z "$dontUseWheelUnpack" ] && [ -z "$unpackPhase" ]; then + echo "Using wheelUnpackPhase" + unpackPhase=wheelUnpackPhase +fi diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 6a9e3d48bdb5..700894eda6de 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -4,13 +4,22 @@ , config , python , wrapPython -, setuptools , unzip , ensureNewerSourcesForZipFilesHook # Whether the derivation provides a Python module or not. , toPythonModule , namePrefix , update-python-libraries +, setuptools +, flitBuildHook +, pipBuildHook +, pipInstallHook +, pythonCatchConflictsHook +, pythonImportsCheckHook +, pythonRemoveBinBytecodeHook +, setuptoolsBuildHook +, setuptoolsCheckHook +, wheelUnpackHook }: { name ? "${attrs.pname}-${attrs.version}" @@ -48,6 +57,11 @@ # Skip wrapping of python programs altogether , dontWrapPythonPrograms ? false +# Don't use Pip to install a wheel +# Note this is actually a variable for the pipInstallPhase in pip's setupHook. +# It's included here to prevent an infinite recursion. +, dontUsePipInstall ? false + # Skip setting the PYTHONNOUSERSITE environment variable in wrapped programs , permitUserSite ? false @@ -57,6 +71,13 @@ # However, some packages do provide executables with extensions, and thus bytecode is generated. , removeBinBytecode ? true +# Several package formats are supported. +# "setuptools" : Install a common setuptools/distutils based package. This builds a wheel. +# "wheel" : Install from a pre-compiled wheel. +# "flit" : Install a flit package. This builds a wheel. +# "other" : Provide your own buildPhase and installPhase. +, format ? "setuptools" + , meta ? {} , passthru ? {} @@ -71,26 +92,43 @@ if disabled then throw "${name} not supported for interpreter ${python.executable}" else -let self = toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [ - "disabled" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" - ] // { +let + inherit (python) stdenv; + + self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [ + "disabled" "checkPhase" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format" + ]) // { name = namePrefix + name; nativeBuildInputs = [ python wrapPython - ensureNewerSourcesForZipFilesHook - setuptools -# ++ lib.optional catchConflicts setuptools # If we no longer propagate setuptools + ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? + ] ++ lib.optionals catchConflicts [ + setuptools pythonCatchConflictsHook + ] ++ lib.optionals removeBinBytecode [ + pythonRemoveBinBytecodeHook ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [ unzip + ] ++ lib.optionals (format == "setuptools") [ + setuptoolsBuildHook + ] ++ lib.optionals (format == "flit") [ + flitBuildHook + ] ++ lib.optionals (format == "pyproject") [ + pipBuildHook + ] ++ lib.optionals (format == "wheel") [ + wheelUnpackHook + ] ++ lib.optionals (!(format == "other") || dontUsePipInstall) [ + pipInstallHook + ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ + # This is a test, however, it should be ran independent of the checkPhase and checkInputs + pythonImportsCheckHook ] ++ nativeBuildInputs; buildInputs = buildInputs ++ pythonPath; - # Propagate python and setuptools. We should stop propagating setuptools. - propagatedBuildInputs = propagatedBuildInputs ++ [ python setuptools ]; + propagatedBuildInputs = propagatedBuildInputs ++ [ python ]; inherit strictDeps; @@ -98,21 +136,17 @@ let self = toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attr # Python packages don't have a checkPhase, only an installCheckPhase doCheck = false; - doInstallCheck = doCheck; - installCheckInputs = checkInputs; + doInstallCheck = attrs.doCheck or true; + installCheckInputs = [ + ] ++ lib.optionals (format == "setuptools") [ + # Longer-term we should get rid of this and require + # users of this function to set the `installCheckPhase` or + # pass in a hook that sets it. + setuptoolsCheckHook + ] ++ checkInputs; postFixup = lib.optionalString (!dontWrapPythonPrograms) '' wrapPythonPrograms - '' + lib.optionalString removeBinBytecode '' - if [ -d "$out/bin" ]; then - rm -rf "$out/bin/__pycache__" # Python 3 - find "$out/bin" -type f -name "*.pyc" -delete # Python 2 - fi - '' + lib.optionalString catchConflicts '' - # Check if we have two packages with the same name in the closure and fail. - # If this happens, something went wrong with the dependencies specs. - # Intentionally kept in a subdirectory, see catch_conflicts/README.md. - ${python.pythonForBuild.interpreter} ${./catch_conflicts}/catch_conflicts.py '' + attrs.postFixup or ''''; # Python packages built through cross-compilation are always for the host platform. @@ -123,6 +157,10 @@ let self = toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attr platforms = python.meta.platforms; isBuildPythonPackage = python.meta.platforms; } // meta; +} // lib.optionalAttrs (attrs?checkPhase) { + # If given use the specified checkPhase, otherwise use the setup hook. + # Longer-term we should get rid of `checkPhase` and use `installCheckPhase`. + installCheckPhase = attrs.checkPhase; })); passthru.updateScript = let diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix index 4f853e9821ff..ae386f46bffc 100644 --- a/pkgs/development/libraries/glib-networking/default.nix +++ b/pkgs/development/libraries/glib-networking/default.nix @@ -1,21 +1,40 @@ -{ stdenv, fetchurl, meson, ninja, pkgconfig, glib, gettext, python3, gnutls, p11-kit, libproxy, gnome3 -, gsettings-desktop-schemas }: +{ stdenv +, fetchurl +, substituteAll +, meson +, ninja +, nixosTests +, pkgconfig +, glib +, gettext +, makeWrapper +, python3 +, gnutls +, p11-kit +, libproxy +, gnome3 +, gsettings-desktop-schemas +}: -let +stdenv.mkDerivation rec { pname = "glib-networking"; version = "2.60.3"; -in -stdenv.mkDerivation rec { - name = "${pname}-${version}"; + + outputs = [ "out" "installedTests" ]; src = fetchurl { - url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz"; + url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "1mfw44qpmwvz6yzj8c6spx6z357wrmkk15byrkc5byagd82860fm"; }; - outputs = [ "out" "dev" ]; # to deal with propagatedBuildInputs + patches = [ + (substituteAll { + src = ./hardcode-gsettings.patch; + gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas; + }) - PKG_CONFIG_GIO_2_0_GIOMODULEDIR = "${placeholder "out"}/lib/gio/modules"; + ./installed-tests-path.patch + ]; postPatch = '' chmod +x meson_post_install.py # patchShebangs requires executable file @@ -23,27 +42,52 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ - meson ninja pkgconfig gettext - python3 # install_script + meson + ninja + pkgconfig + gettext + makeWrapper + python3 # for install_script ]; - propagatedBuildInputs = [ glib gnutls p11-kit libproxy gsettings-desktop-schemas ]; - mesonFlags = [ - # Default auto detection doesn't work - "-Dgnutls=enabled" + buildInputs = [ + glib + gnutls + p11-kit + libproxy + gsettings-desktop-schemas ]; doCheck = false; # tests need to access the certificates (among other things) + mesonFlags = [ + "-Dinstalled_tests=true" + "-Dinstalled_test_prefix=${placeholder "installedTests"}" + ]; + + postFixup = '' + find "$installedTests/libexec" "$out/libexec" -type f -executable -print0 \ + | while IFS= read -r -d "" file; do + echo "Wrapping program '$file'" + wrapProgram "$file" --prefix GIO_EXTRA_MODULES : "$out/lib/gio/modules" + done + ''; + passthru = { updateScript = gnome3.updateScript { packageName = pname; }; + + tests = { + installedTests = nixosTests.glib-networking; + }; }; meta = with stdenv.lib; { description = "Network-related giomodules for glib"; - license = licenses.lgpl2Plus; + homepage = https://gitlab.gnome.org/GNOME/glib-networking; + license = licenses.lgpl21Plus; + maintainers = gnome3.maintainers; platforms = platforms.unix; }; } diff --git a/pkgs/development/libraries/glib-networking/hardcode-gsettings.patch b/pkgs/development/libraries/glib-networking/hardcode-gsettings.patch new file mode 100644 index 000000000000..0a091b2344dc --- /dev/null +++ b/pkgs/development/libraries/glib-networking/hardcode-gsettings.patch @@ -0,0 +1,341 @@ +diff --git a/proxy/gnome/gproxyresolvergnome.c b/proxy/gnome/gproxyresolvergnome.c +index 50b63cd..4364116 100644 +--- a/proxy/gnome/gproxyresolvergnome.c ++++ b/proxy/gnome/gproxyresolvergnome.c +@@ -156,23 +156,79 @@ + + resolver->base_resolver = g_simple_proxy_resolver_new (NULL, NULL); + +- resolver->proxy_settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA, ++ FALSE); ++ resolver->proxy_settings = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_signal_connect (resolver->proxy_settings, "changed", + G_CALLBACK (gsettings_changed), resolver); +- resolver->http_settings = g_settings_get_child (resolver->proxy_settings, +- GNOME_PROXY_HTTP_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA, ++ FALSE); ++ resolver->http_settings = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_signal_connect (resolver->http_settings, "changed", + G_CALLBACK (gsettings_changed), resolver); +- resolver->https_settings = g_settings_get_child (resolver->proxy_settings, +- GNOME_PROXY_HTTPS_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTPS_CHILD_SCHEMA, ++ FALSE); ++ resolver->https_settings = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_signal_connect (resolver->https_settings, "changed", + G_CALLBACK (gsettings_changed), resolver); +- resolver->ftp_settings = g_settings_get_child (resolver->proxy_settings, +- GNOME_PROXY_FTP_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_FTP_CHILD_SCHEMA, ++ FALSE); ++ resolver->ftp_settings = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_signal_connect (resolver->ftp_settings, "changed", + G_CALLBACK (gsettings_changed), resolver); +- resolver->socks_settings = g_settings_get_child (resolver->proxy_settings, +- GNOME_PROXY_SOCKS_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_SOCKS_CHILD_SCHEMA, ++ FALSE); ++ resolver->socks_settings = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_signal_connect (resolver->socks_settings, "changed", + G_CALLBACK (gsettings_changed), resolver); + +diff --git a/proxy/tests/gnome.c b/proxy/tests/gnome.c +index f76b094..54751e3 100644 +--- a/proxy/tests/gnome.c ++++ b/proxy/tests/gnome.c +@@ -55,26 +55,86 @@ + { + GSettings *settings, *child; + +- settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA, ++ FALSE); ++ settings = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_reset (settings, GNOME_PROXY_MODE_KEY); + g_settings_reset (settings, GNOME_PROXY_USE_SAME_PROXY_KEY); + +- child = g_settings_get_child (settings, GNOME_PROXY_HTTP_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA, ++ FALSE); ++ child = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_reset (child, GNOME_PROXY_HTTP_HOST_KEY); + g_settings_reset (child, GNOME_PROXY_HTTP_PORT_KEY); + g_object_unref (child); + +- child = g_settings_get_child (settings, GNOME_PROXY_HTTPS_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTPS_CHILD_SCHEMA, ++ FALSE); ++ child = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_reset (child, GNOME_PROXY_HTTPS_HOST_KEY); + g_settings_reset (child, GNOME_PROXY_HTTPS_PORT_KEY); + g_object_unref (child); + +- child = g_settings_get_child (settings, GNOME_PROXY_FTP_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_FTP_CHILD_SCHEMA, ++ FALSE); ++ child = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_reset (child, GNOME_PROXY_FTP_HOST_KEY); + g_settings_reset (child, GNOME_PROXY_FTP_PORT_KEY); + g_object_unref (child); + +- child = g_settings_get_child (settings, GNOME_PROXY_SOCKS_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_SOCKS_CHILD_SCHEMA, ++ FALSE); ++ child = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_reset (child, GNOME_PROXY_SOCKS_HOST_KEY); + g_settings_reset (child, GNOME_PROXY_SOCKS_PORT_KEY); + g_object_unref (child); +@@ -88,21 +148,69 @@ + { + GSettings *settings, *child; + +- settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA, ++ FALSE); ++ settings = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_set_enum (settings, GNOME_PROXY_MODE_KEY, G_DESKTOP_PROXY_MODE_MANUAL); + g_settings_set_boolean (settings, GNOME_PROXY_USE_SAME_PROXY_KEY, TRUE); + +- child = g_settings_get_child (settings, GNOME_PROXY_HTTP_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA, ++ FALSE); ++ child = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_set_string (child, GNOME_PROXY_HTTP_HOST_KEY, "proxy.example.com"); + g_settings_set_int (child, GNOME_PROXY_HTTP_PORT_KEY, 8080); + g_object_unref (child); + +- child = g_settings_get_child (settings, GNOME_PROXY_HTTPS_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTPS_CHILD_SCHEMA, ++ FALSE); ++ child = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_set_string (child, GNOME_PROXY_HTTPS_HOST_KEY, "proxy-s.example.com"); + g_settings_set_int (child, GNOME_PROXY_HTTPS_PORT_KEY, 7070); + g_object_unref (child); + +- child = g_settings_get_child (settings, GNOME_PROXY_FTP_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_FTP_CHILD_SCHEMA, ++ FALSE); ++ child = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_set_string (child, GNOME_PROXY_FTP_HOST_KEY, "proxy-f.example.com"); + g_settings_set_int (child, GNOME_PROXY_FTP_PORT_KEY, 6060); + g_object_unref (child); +@@ -119,12 +227,36 @@ + GSettings *settings, *child; + const gchar *ignore_hosts[2] = { "127.0.0.1", NULL }; + +- settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA, ++ FALSE); ++ settings = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_set_enum (settings, GNOME_PROXY_MODE_KEY, G_DESKTOP_PROXY_MODE_MANUAL); + g_settings_set (settings, GNOME_PROXY_IGNORE_HOSTS_KEY, + "@as", g_variant_new_strv (ignore_hosts, -1)); + +- child = g_settings_get_child (settings, GNOME_PROXY_SOCKS_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_SOCKS_CHILD_SCHEMA, ++ FALSE); ++ child = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_set_string (child, GNOME_PROXY_SOCKS_HOST_KEY, "proxy.example.com"); + g_settings_set_int (child, GNOME_PROXY_SOCKS_PORT_KEY, 1234); + g_object_unref (child); +@@ -139,12 +271,36 @@ + { + GSettings *settings, *http; + +- settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA, ++ FALSE); ++ settings = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_set_enum (settings, GNOME_PROXY_MODE_KEY, G_DESKTOP_PROXY_MODE_MANUAL); + g_settings_set (settings, GNOME_PROXY_IGNORE_HOSTS_KEY, + "@as", g_variant_new_strv (ignore_hosts, n_ignore_hosts)); + +- http = g_settings_get_child (settings, GNOME_PROXY_HTTP_CHILD_SCHEMA); ++ { ++ GSettingsSchemaSource *schema_source; ++ GSettingsSchema *schema; ++ schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", ++ g_settings_schema_source_get_default(), ++ TRUE, NULL); ++ schema = g_settings_schema_source_lookup(schema_source, ++ GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA, ++ FALSE); ++ http = g_settings_new_full(schema, NULL, NULL); ++ g_settings_schema_source_unref(schema_source); ++ g_settings_schema_unref(schema); ++ } + g_settings_set_string (http, GNOME_PROXY_HTTP_HOST_KEY, "localhost"); + g_settings_set_int (http, GNOME_PROXY_HTTP_PORT_KEY, 8080); + diff --git a/pkgs/development/libraries/glib-networking/installed-tests-path.patch b/pkgs/development/libraries/glib-networking/installed-tests-path.patch new file mode 100644 index 000000000000..942ca053dd4f --- /dev/null +++ b/pkgs/development/libraries/glib-networking/installed-tests-path.patch @@ -0,0 +1,25 @@ +diff --git a/meson.build b/meson.build +index 4d91677..aaaeb2b 100644 +--- a/meson.build ++++ b/meson.build +@@ -12,8 +12,8 @@ + libexecdir = join_paths(prefix, get_option('libexecdir')) + localedir = join_paths(prefix, get_option('localedir')) + +-installed_tests_metadir = join_paths(datadir, 'installed-tests', meson.project_name()) +-installed_tests_execdir = join_paths(libexecdir, 'installed-tests', meson.project_name()) ++installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name()) ++installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name()) + + cc = meson.get_compiler('c') + host_system = host_machine.system() +diff --git a/meson_options.txt b/meson_options.txt +index 3a525dd..fc86302 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -3,4 +3,5 @@ + option('libproxy', type: 'feature', value: 'auto', description: 'support for libproxy proxy configration') + option('gnome_proxy', type: 'feature', value: 'auto', description: 'support for GNOME desktop proxy configuration') + option('installed_tests', type: 'boolean', value: false, description: 'enable installed tests') ++option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests') + option('static_modules', type: 'boolean', value: false, description: 'build static modules') diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 29360585b7e5..de7505e6cde1 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -46,16 +46,15 @@ let ''; binPrograms = optional (!stdenv.isDarwin) "gapplication" ++ [ "gdbus" "gio" "gsettings" ]; - version = "2.60.6"; in stdenv.mkDerivation rec { pname = "glib"; - inherit version; + version = "2.60.7"; src = fetchurl { url = "mirror://gnome/sources/glib/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "0v7vpx2md1gn0wwiirn7g4bhf2csfvcr03y96q2zv97ain6sp3zz"; + sha256 = "0433m0na8nc4cf0gidf4gfzz8k5d3dsssmh541qkpzcsaspw04lb"; }; patches = optional stdenv.isDarwin ./darwin-compilation.patch diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix index 87453a09e7f9..3f7d1a2c3526 100644 --- a/pkgs/development/libraries/harfbuzz/default.nix +++ b/pkgs/development/libraries/harfbuzz/default.nix @@ -8,7 +8,7 @@ }: let - version = "2.6.0"; + version = "2.6.1"; inherit (stdenv.lib) optional optionals optionalString; in @@ -17,7 +17,7 @@ stdenv.mkDerivation { src = fetchurl { url = "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-${version}.tar.xz"; - sha256 = "0rn9fvnrxds7f4812yx68myy3x7szb4z9ql4m1fgjrc2ahbx3xww"; + sha256 = "0kw4c04jd8c8ili3j1glgv0wsr207313fs3jh2rawf53m8zznlf6"; }; postPatch = '' diff --git a/pkgs/development/libraries/libgdata/default.nix b/pkgs/development/libraries/libgdata/default.nix index 14fc7e64a0b4..c7ff6d10da39 100644 --- a/pkgs/development/libraries/libgdata/default.nix +++ b/pkgs/development/libraries/libgdata/default.nix @@ -1,9 +1,9 @@ { stdenv , fetchurl -, fetchpatch , pkgconfig , meson , ninja +, nixosTests , vala , gettext , libxml2 @@ -22,32 +22,17 @@ stdenv.mkDerivation rec { pname = "libgdata"; - version = "0.17.10"; + version = "0.17.11"; outputs = [ "out" "dev" "installedTests" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "04mh2p5x2iidfx0d1cablxbi3hvna8cmlddc1mm4387n0grx3ly1"; + sha256 = "11m99sh2k679rnsvqsi95s1l0r8lkvj61dmwg1pnxvsd5q91g6bb"; }; patches = [ ./installed-tests-path.patch - (fetchpatch { - # Meson fixes - url = "https://gitlab.gnome.org/GNOME/libgdata/commit/f6d0e3f3b6fa8e8ee9569372c5709c1fb84af2c1.diff"; - sha256 = "00yrppn0s21i41r9mwzvrrv7j5dida09kh7i44kv8hrbrlfag7bm"; - }) - (fetchpatch { - # Meson minor fixes - url = "https://gitlab.gnome.org/GNOME/libgdata/commit/b653f602b3c2b518101c5d909e1651534c22757a.diff"; - sha256 = "1bn0rffsvkzjl59aw8dmq1wil58x1fshz0m6xabpn79ffvbjld8j"; - }) - (fetchpatch { - # Meson: Fix G_LOG_DOMAIN - url = "https://gitlab.gnome.org/GNOME/libgdata/commit/5d318e0bf905d0f1a8b3fe1e47ee7847739082e3.diff"; - sha256 = "11i2blq811d53433kdq4hhsscgkrq5f50d9ih4ixgs3j47hg7b1w"; - }) ]; nativeBuildInputs = [ @@ -87,6 +72,10 @@ stdenv.mkDerivation rec { packageName = pname; versionPolicy = "none"; # Stable version has not been updated for a long time. }; + + tests = { + installedTests = nixosTests.libgdata; + }; }; meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/libgdata/installed-tests-path.patch b/pkgs/development/libraries/libgdata/installed-tests-path.patch index 18669817cfed..f8c0a1293a1f 100644 --- a/pkgs/development/libraries/libgdata/installed-tests-path.patch +++ b/pkgs/development/libraries/libgdata/installed-tests-path.patch @@ -1,5 +1,5 @@ diff --git a/gdata/tests/meson.build b/gdata/tests/meson.build -index 52154e7a..1a44d1d8 100644 +index 05184deb..3a9392d4 100644 --- a/gdata/tests/meson.build +++ b/gdata/tests/meson.build @@ -1,5 +1,12 @@ @@ -17,17 +17,17 @@ index 52154e7a..1a44d1d8 100644 tests_sources = files( 'common.c', -@@ -48,7 +55,7 @@ foreach test_name, extra_args: tests +@@ -49,7 +56,7 @@ foreach test_name, extra_args: tests dependencies: common_deps + extra_args.get('dependencies', []), sources: tests_sources, - install: install_tests, + install: install_tests and not should_fail, - install_dir: tests_execdir, + install_dir: tests_bindir, ) test( -@@ -63,7 +70,7 @@ if install_tests - foreach test_name, extra_args: tests +@@ -65,7 +72,7 @@ if install_tests + should_fail = extra_args.get('should_fail', false) tests_conf = { 'TEST_TYPE': 'session', - 'TEST_ABS_PATH': gdata_prefix / tests_execdir / test_name, @@ -35,10 +35,10 @@ index 52154e7a..1a44d1d8 100644 } configure_file ( -@@ -71,13 +78,13 @@ if install_tests +@@ -73,13 +80,13 @@ if install_tests output: test_name + '.test', configuration: tests_conf, - install: true, + install: not should_fail, - install_dir: tests_metadir, + install_dir: tests_datadir, ) @@ -51,7 +51,7 @@ index 52154e7a..1a44d1d8 100644 ) test_data = [ -@@ -96,6 +103,6 @@ if install_tests +@@ -98,6 +105,6 @@ if install_tests install_data( test_data, @@ -60,7 +60,7 @@ index 52154e7a..1a44d1d8 100644 ) endif diff --git a/meson.build b/meson.build -index 7d2f5254..bed3e189 100644 +index 50441abb..5fc773b1 100644 --- a/meson.build +++ b/meson.build @@ -20,9 +20,9 @@ gdata_api_version_minor = 0 diff --git a/pkgs/development/libraries/libglvnd/default.nix b/pkgs/development/libraries/libglvnd/default.nix index 2b64d5b7220a..b976c9c36b83 100644 --- a/pkgs/development/libraries/libglvnd/default.nix +++ b/pkgs/development/libraries/libglvnd/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { "-UDEFAULT_EGL_VENDOR_CONFIG_DIRS" # FHS paths are added so that non-NixOS applications can find vendor files. "-DDEFAULT_EGL_VENDOR_CONFIG_DIRS=\"${addOpenGLRunpath.driverLink}/share/glvnd/egl_vendor.d:/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d\"" + + "-Wno-error=array-bounds" ] ++ lib.optional stdenv.cc.isClang "-Wno-error"; # Indirectly: https://bugs.freedesktop.org/show_bug.cgi?id=35268 diff --git a/pkgs/development/libraries/libjpeg-turbo/default.nix b/pkgs/development/libraries/libjpeg-turbo/default.nix index 191c375f3be8..cb32b22f45e4 100644 --- a/pkgs/development/libraries/libjpeg-turbo/default.nix +++ b/pkgs/development/libraries/libjpeg-turbo/default.nix @@ -3,11 +3,11 @@ stdenv.mkDerivation rec { pname = "libjpeg-turbo"; - version = "2.0.2"; + version = "2.0.3"; src = fetchurl { url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz"; - sha256 = "1v9gx1gdzgxf51nd55ncq7rghmj4x9x91rby50ag36irwngmkf5c"; + sha256 = "1ds16bnj17v6hzd43w8pzijz3imd9am4hw75ir0fxm240m8dwij2"; }; patches = diff --git a/pkgs/development/libraries/libomxil-bellagio/default.nix b/pkgs/development/libraries/libomxil-bellagio/default.nix index 7c14d8102fbe..4d45c6872e4c 100644 --- a/pkgs/development/libraries/libomxil-bellagio/default.nix +++ b/pkgs/development/libraries/libomxil-bellagio/default.nix @@ -16,6 +16,10 @@ stdenv.mkDerivation rec { doCheck = false; # fails + # Fix for #40213, probably permanent, because upstream doesn't seem to be + # developed anymore. Alternatively, gcc7Stdenv could be used. + NIX_CFLAGS_COMPILE = "-Wno-error=array-bounds"; + meta = with stdenv.lib; { homepage = https://sourceforge.net/projects/omxil/; description = "An opensource implementation of the Khronos OpenMAX Integration Layer API to access multimedia components"; diff --git a/pkgs/development/libraries/libproxy/default.nix b/pkgs/development/libraries/libproxy/default.nix index 09bb0e4aa3f2..844d626f49e3 100644 --- a/pkgs/development/libraries/libproxy/default.nix +++ b/pkgs/development/libraries/libproxy/default.nix @@ -1,6 +1,22 @@ -{ stdenv, fetchFromGitHub, pkgconfig, cmake, zlib, fetchpatch -, dbus, networkmanager, spidermonkey_38, pcre, python2, python3 -, SystemConfiguration, CoreFoundation, JavaScriptCore }: +{ stdenv +, fetchFromGitHub +, pkgconfig +, cmake +, zlib +, fetchpatch +, dbus +, networkmanager +, spidermonkey_38 +, pcre +, gsettings-desktop-schemas +, glib +, makeWrapper +, python2 +, python3 +, SystemConfiguration +, CoreFoundation +, JavaScriptCore +}: stdenv.mkDerivation rec { pname = "libproxy"; @@ -13,28 +29,47 @@ stdenv.mkDerivation rec { sha256 = "10swd3x576pinx33iwsbd4h15fbh2snmfxzcmab4c56nb08qlbrs"; }; - outputs = [ "out" "dev" ]; # to deal with propagatedBuildInputs + outputs = [ "out" "dev" "py2" "py3" ]; - nativeBuildInputs = [ pkgconfig cmake ]; + nativeBuildInputs = [ + pkgconfig + cmake + makeWrapper + ]; - buildInputs = [ pcre python2 python3 zlib ] - ++ (if stdenv.hostPlatform.isDarwin - then [ SystemConfiguration CoreFoundation JavaScriptCore ] - else [ spidermonkey_38 dbus networkmanager ]); + buildInputs = [ + pcre + python2 + python3 + zlib + ] ++ (if stdenv.hostPlatform.isDarwin then [ + SystemConfiguration + CoreFoundation + JavaScriptCore + ] else [ + glib + spidermonkey_38 + dbus + networkmanager + ]); - preConfigure = '' - cmakeFlagsArray+=( - "-DWITH_MOZJS=ON" - "-DPYTHON2_SITEPKG_DIR=$out/${python2.sitePackages}" - "-DPYTHON3_SITEPKG_DIR=$out/${python3.sitePackages}" - ) - ''; + cmakeFlags = [ + "-DWITH_MOZJS=ON" + "-DPYTHON2_SITEPKG_DIR=${placeholder "py2"}/${python2.sitePackages}" + "-DPYTHON3_SITEPKG_DIR=${placeholder "py3"}/${python3.sitePackages}" + ]; - patches = stdenv.lib.optional stdenv.isDarwin + patches = stdenv.lib.optionals stdenv.isDarwin [ (fetchpatch { url = "https://github.com/libproxy/libproxy/commit/44158f03f8522116758d335688ed840dfcb50ac8.patch"; sha256 = "0axfvb6j7gcys6fkwi9dkn006imhvm3kqr83gpwban8419n0q5v1"; - }); + }) + ]; + + postFixup = '' + # config_gnome3 uses the helper to find GNOME proxy settings + wrapProgram $out/libexec/pxgsettings --prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" + ''; doCheck = false; # fails 1 out of 10 tests diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix index a911524a9acd..4653b8b86a26 100644 --- a/pkgs/development/libraries/librsvg/default.nix +++ b/pkgs/development/libraries/librsvg/default.nix @@ -5,14 +5,14 @@ let pname = "librsvg"; - version = "2.44.14"; + version = "2.44.15"; in stdenv.mkDerivation rec { name = "${pname}-${version}"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz"; - sha256 = "00z3qimpk909pcqq0jlsis5sskc6kn7cqia20smd9k9rhs3ag1ba"; + sha256 = "1p4cifnxppz2qwsk2wvn2a6c7dpvgfrsf5vlhdkmsd373czm9396"; }; outputs = [ "out" "dev" "installedTests" ]; diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix index 0620163bb320..19a8025359a0 100644 --- a/pkgs/development/libraries/libusb1/default.nix +++ b/pkgs/development/libraries/libusb1/default.nix @@ -1,11 +1,12 @@ { stdenv, fetchurl, pkgconfig, systemd ? null, libobjc, IOKit, withStatic ? false }: stdenv.mkDerivation (rec { - name = "libusb-1.0.22"; + pname = "libusb"; + version = "1.0.23"; src = fetchurl { - url = "mirror://sourceforge/libusb/${name}.tar.bz2"; - sha256 = "0mw1a5ss4alg37m6bd4k44v35xwrcwp5qm4s686q1nsgkbavkbkm"; + url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2"; + sha256 = "13dd2a9x290d1q8nb1lqiaf36grcvns5ripk5k2xm0lajmpc04fv"; }; outputs = [ "out" "dev" ]; # get rid of propagating systemd closure diff --git a/pkgs/development/libraries/mesa-glu/default.nix b/pkgs/development/libraries/mesa-glu/default.nix index 902fd9205681..dd2091c8a796 100644 --- a/pkgs/development/libraries/mesa-glu/default.nix +++ b/pkgs/development/libraries/mesa-glu/default.nix @@ -2,15 +2,12 @@ stdenv.mkDerivation rec { pname = "glu"; - version = "9.0.0"; + version = "9.0.1"; src = fetchurl { - url = "ftp://ftp.freedesktop.org/pub/mesa/glu/${pname}-${version}.tar.bz2"; - sha256 = "04nzlil3a6fifcmb95iix3yl8mbxdl66b99s62yzq8m7g79x0yhz"; + url = "ftp://ftp.freedesktop.org/pub/mesa/${pname}/${pname}-${version}.tar.xz"; + sha256 = "1g2m634p73mixkzv1qz1d0flwm390ydi41bwmchiqvdssqnlqnpv"; }; - postPatch = '' - echo 'Cflags: -I''${includedir}' >> glu.pc.in - ''; nativeBuildInputs = [ pkgconfig ]; propagatedBuildInputs = [ libGL ] diff --git a/pkgs/development/libraries/webkitgtk/default.nix b/pkgs/development/libraries/webkitgtk/default.nix index d2ba7a03955b..c0fae2f71765 100644 --- a/pkgs/development/libraries/webkitgtk/default.nix +++ b/pkgs/development/libraries/webkitgtk/default.nix @@ -15,7 +15,7 @@ assert stdenv.isDarwin -> !enableGtk2Plugins; with stdenv.lib; stdenv.mkDerivation rec { pname = "webkitgtk"; - version = "2.24.3"; + version = "2.24.4"; meta = { description = "Web content rendering engine, GTK port"; @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "https://webkitgtk.org/releases/${pname}-${version}.tar.xz"; - sha256 = "0lbcrw5axwrbrajxq7fqywfyh0djqi23ynzb5wi5ghw2grnp83cl"; + sha256 = "1n3x5g1z6rg9n1ssna7wi0z6zlprjm4wzk544v14wqi6q0lv2s46"; }; patches = optionals stdenv.isDarwin [ diff --git a/pkgs/development/python-modules/area53/default.nix b/pkgs/development/python-modules/area53/default.nix deleted file mode 100644 index cd8e83dbf630..000000000000 --- a/pkgs/development/python-modules/area53/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ lib, buildPythonPackage, fetchPypi -, boto }: - -buildPythonPackage rec { - pname = "Area53"; - version = "0.94"; - - src = fetchPypi { - inherit pname version; - sha256 = "0v9b7f8b6v21y410anx5sr52k2ac8jrzdf19q6m6p0zsdsf9vr42"; - }; - - # error: invalid command 'test' - doCheck = false; - - propagatedBuildInputs = [ boto ]; - - meta = with lib; { - description = "Python Interface to Route53"; - homepage = https://github.com/mariusv/Area53; - license = licenses.unfree; # unspecified - }; -} diff --git a/pkgs/development/python-modules/atomicwrites/default.nix b/pkgs/development/python-modules/atomicwrites/default.nix index e34f937b5090..eed9591d7bdf 100644 --- a/pkgs/development/python-modules/atomicwrites/default.nix +++ b/pkgs/development/python-modules/atomicwrites/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPythonPackage, fetchPypi }: +{ stdenv, buildPythonPackage, fetchPypi, pytest }: buildPythonPackage rec { pname = "atomicwrites"; @@ -9,6 +9,10 @@ buildPythonPackage rec { sha256 = "75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6"; }; + # Tests depend on pytest but atomicwrites is a dependency of pytest + doCheck = false; + checkInputs = [ pytest ]; + meta = with stdenv.lib; { description = "Atomic file writes on POSIX"; homepage = https://pypi.python.org/pypi/atomicwrites; diff --git a/pkgs/development/python-modules/bootstrapped-pip/default.nix b/pkgs/development/python-modules/bootstrapped-pip/default.nix index 1455a783593f..d2f64a5e5a8b 100644 --- a/pkgs/development/python-modules/bootstrapped-pip/default.nix +++ b/pkgs/development/python-modules/bootstrapped-pip/default.nix @@ -1,30 +1,43 @@ -{ stdenv, python, fetchPypi, makeWrapper, unzip }: +{ stdenv, python, fetchPypi, makeWrapper, unzip, makeSetupHook +, pipInstallHook +, setuptoolsBuildHook + +}: let wheel_source = fetchPypi { pname = "wheel"; - version = "0.33.4"; + version = "0.33.6"; format = "wheel"; - sha256 = "5e79117472686ac0c4aef5bad5172ea73a1c2d1646b808c35926bd26bdfb0c08"; + sha256 = "f4da1763d3becf2e2cd92a14a7c920f0f00eca30fdde9ea992c836685b9faf28"; }; setuptools_source = fetchPypi { pname = "setuptools"; - version = "41.0.1"; + version = "41.2.0"; format = "wheel"; - sha256 = "c7769ce668c7a333d84e17fe8b524b1c45e7ee9f7908ad0a73e1eda7e6a5aebf"; + sha256 = "4380abcf2a4ffd1a5ba22d687c6d690dce83b2b51c70e9c6d09f7e8c7e8040dc"; }; in stdenv.mkDerivation rec { pname = "pip"; - version = "19.1.1"; + version = "19.2.3"; name = "${python.libPrefix}-bootstrapped-${pname}-${version}"; src = fetchPypi { inherit pname version; format = "wheel"; - sha256 = "993134f0475471b91452ca029d4390dc8f298ac63a712814f101cd1b6db46676"; + sha256 = "340a0ba40fdeb16413914c0fcd8e0b4ebb0bf39a900ec80e11c05d836c05103f"; }; + dontUseSetuptoolsBuild = true; + + # Should be propagatedNativeBuildInputs + propagatedBuildInputs = [ + # Override to remove dependencies to prevent infinite recursion. + (pipInstallHook.override{pip=null;}) + (setuptoolsBuildHook.override{setuptools=null; wheel=null;}) + ]; + unpackPhase = '' mkdir -p $out/${python.sitePackages} unzip -d $out/${python.sitePackages} $src @@ -32,7 +45,7 @@ in stdenv.mkDerivation rec { unzip -d $out/${python.sitePackages} ${wheel_source} ''; - patchPhase = '' + postPatch = '' mkdir -p $out/bin ''; @@ -52,4 +65,5 @@ in stdenv.mkDerivation rec { wrapProgram $f --prefix PYTHONPATH ":" $out/${python.sitePackages}/ done ''; + } diff --git a/pkgs/development/python-modules/editorconfig/default.nix b/pkgs/development/python-modules/editorconfig/default.nix index 3f276374d9ea..28eff473199c 100644 --- a/pkgs/development/python-modules/editorconfig/default.nix +++ b/pkgs/development/python-modules/editorconfig/default.nix @@ -5,17 +5,20 @@ }: buildPythonPackage rec { - pname = "EditorConfig"; - version = "0.12.1"; + pname = "editorconfig"; + version = "0.12.2"; # fetchgit used to ensure test submodule is available src = fetchgit { url = "https://github.com/editorconfig/editorconfig-core-py"; - rev = "refs/tags/v${version}"; - sha256 = "0svk7id7ncygj2rnxhm7602xizljyidk4xgrl6i0xgq3829cz4bl"; + rev = "596da5e06ebee05bdbdc6224203c79c4d3c6486a"; # Not tagged + sha256 = "05cbp971b0zix7kfxkk7ndxb4ax1l21frwc00d4g78mk4sdz6dig"; }; nativeBuildInputs = [ cmake ]; + + dontUseCmakeConfigure = true; + checkPhase = '' cmake . # utf_8_char fails with python3 diff --git a/pkgs/development/python-modules/eggdeps/default.nix b/pkgs/development/python-modules/eggdeps/default.nix index 0622bd41d237..c837e46066fe 100644 --- a/pkgs/development/python-modules/eggdeps/default.nix +++ b/pkgs/development/python-modules/eggdeps/default.nix @@ -6,11 +6,12 @@ }: buildPythonPackage rec { - pname = "eggdeps"; + pname = "tl-eggdeps"; version = "0.4"; src = fetchPypi { - inherit pname version; + inherit version; + pname = "tl.eggdeps"; sha256 = "a99de5e4652865224daab09b2e2574a4f7c1d0d9a267048f9836aa914a2caf3a"; }; diff --git a/pkgs/development/python-modules/jsbeautifier/default.nix b/pkgs/development/python-modules/jsbeautifier/default.nix index 15191858daa8..10d0004f74a5 100644 --- a/pkgs/development/python-modules/jsbeautifier/default.nix +++ b/pkgs/development/python-modules/jsbeautifier/default.nix @@ -1,10 +1,10 @@ -{ lib, fetchPypi, buildPythonApplication, EditorConfig, pytest, six }: +{ lib, fetchPypi, buildPythonApplication, editorconfig, pytest, six }: buildPythonApplication rec { pname = "jsbeautifier"; version = "1.10.0"; - propagatedBuildInputs = [ six EditorConfig ]; + propagatedBuildInputs = [ six editorconfig ]; checkInputs = [ pytest ]; src = fetchPypi { diff --git a/pkgs/development/python-modules/mpd2/default.nix b/pkgs/development/python-modules/mpd2/default.nix index 3669b8dddbf8..95ee5c5001ad 100644 --- a/pkgs/development/python-modules/mpd2/default.nix +++ b/pkgs/development/python-modules/mpd2/default.nix @@ -1,22 +1,24 @@ { stdenv , buildPythonPackage , fetchPypi +, python , mock }: buildPythonPackage rec { - pname = "mpd2"; - version = "0.5.5"; + pname = "python-mpd2"; + version = "1.0.0"; src = fetchPypi { inherit pname version; - sha256 = "1gfrxf71xll1w6zb69znqg5c9j0g7036fsalkvqprh2id640cl3a"; + extension = "tar.bz2"; + sha256 = "772fa6861273bb9f363a97987c2c45ca3965eb770570f1f02566efec9c89fc5f"; }; buildInputs = [ mock ]; - patchPhase = '' - sed -i -e '/tests_require/d' \ - -e 's/cmdclass.*/test_suite="mpd_test",/' setup.py + + checkPhase = '' + ${python.interpreter} -m unittest mpd.tests ''; meta = with stdenv.lib; { diff --git a/pkgs/development/python-modules/mrbob/default.nix b/pkgs/development/python-modules/mrbob/default.nix index 388e0148d0a0..dd255d4d0049 100644 --- a/pkgs/development/python-modules/mrbob/default.nix +++ b/pkgs/development/python-modules/mrbob/default.nix @@ -3,11 +3,12 @@ }: buildPythonPackage rec { - pname = "mrbob"; + pname = "mr-bob"; version = "0.1.2"; src = fetchPypi { - inherit pname version; + inherit version; + pname = "mr.bob"; sha256 = "6737eaf98aaeae85e07ebef844ee5156df2f06a8b28d7c3dcb056f811c588121"; }; diff --git a/pkgs/development/python-modules/pip/default.nix b/pkgs/development/python-modules/pip/default.nix index 76f3b0b7176b..9892d02b3922 100644 --- a/pkgs/development/python-modules/pip/default.nix +++ b/pkgs/development/python-modules/pip/default.nix @@ -1,25 +1,32 @@ { lib +, python , buildPythonPackage +, bootstrapped-pip , fetchPypi , mock , scripttest , virtualenv , pretend , pytest +, setuptools +, wheel }: buildPythonPackage rec { pname = "pip"; - version = "19.1.1"; + version = "19.2.3"; + format = "other"; src = fetchPypi { inherit pname version; - sha256 = "44d3d7d3d30a1eb65c7e5ff1173cdf8f7467850605ac7cc3707b6064bddd0958"; + sha256 = "e7a31f147974362e6c82d84b91c7f2bdf57e4d3163d3d454e6c3e71944d67135"; }; + nativeBuildInputs = [ bootstrapped-pip ]; + # pip detects that we already have bootstrapped_pip "installed", so we need # to force it a little. - installFlags = [ "--ignore-installed" ]; + pipInstallFlags = [ "--ignore-installed" ]; checkInputs = [ mock scripttest virtualenv pretend pytest ]; # Pip wants pytest, but tests are not distributed diff --git a/pkgs/development/python-modules/py/default.nix b/pkgs/development/python-modules/py/default.nix index e54fd1521b3e..9c5ada22b146 100644 --- a/pkgs/development/python-modules/py/default.nix +++ b/pkgs/development/python-modules/py/default.nix @@ -12,7 +12,11 @@ buildPythonPackage rec { # Circular dependency on pytest doCheck = false; - buildInputs = [ setuptools_scm ]; + nativeBuildInputs = [ setuptools_scm ]; + + pythonImportsCheck = [ + "py" + ]; meta = with stdenv.lib; { description = "Library with cross-python path, ini-parsing, io, code, log facilities"; diff --git a/pkgs/development/python-modules/pyaudio/default.nix b/pkgs/development/python-modules/pyaudio/default.nix index 2f788966718c..62fec908a4d3 100644 --- a/pkgs/development/python-modules/pyaudio/default.nix +++ b/pkgs/development/python-modules/pyaudio/default.nix @@ -6,20 +6,20 @@ }: buildPythonPackage rec { - pname = "python-pyaudio"; - version = "0.2.9"; + pname = "PyAudio"; + version = "0.2.11"; disabled = isPyPy; src = fetchPypi { inherit pname version; - sha256 = "bfd694272b3d1efc51726d0c27650b3c3ba1345f7f8fdada7e86c9751ce0f2a1"; + sha256 = "93bfde30e0b64e63a46f2fd77e85c41fd51182a4a3413d9edfaf9ffaa26efb74"; }; buildInputs = [ pkgs.portaudio ]; meta = with stdenv.lib; { description = "Python bindings for PortAudio"; - homepage = "http://people.csail.mit.edu/hubert/pyaudio/"; + homepage = https://people.csail.mit.edu/hubert/pyaudio/; license = licenses.mit; }; diff --git a/pkgs/development/python-modules/pymysqlsa/default.nix b/pkgs/development/python-modules/pymysqlsa/default.nix index 0167fe00ea7c..11813d3d1bcd 100644 --- a/pkgs/development/python-modules/pymysqlsa/default.nix +++ b/pkgs/development/python-modules/pymysqlsa/default.nix @@ -6,11 +6,12 @@ }: buildPythonPackage rec { - pname = "pymysqlsa"; + pname = "pymysql-sa"; version = "1.0"; src = fetchPypi { - inherit pname version; + inherit version; + pname = "pymysql_sa"; sha256 = "a2676bce514a29b2d6ab418812259b0c2f7564150ac53455420a20bd7935314a"; }; diff --git a/pkgs/development/python-modules/pystache/default.nix b/pkgs/development/python-modules/pystache/default.nix index ee57c4995481..8ae01e493970 100644 --- a/pkgs/development/python-modules/pystache/default.nix +++ b/pkgs/development/python-modules/pystache/default.nix @@ -1,7 +1,7 @@ { stdenv, buildPythonPackage, python, fetchPypi, isPy3k, glibcLocales }: buildPythonPackage rec { - pname = "pystache-${version}"; + pname = "pystache"; version = "0.5.4"; src = fetchPypi { diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix index 7866454a62fa..506b560e01ae 100644 --- a/pkgs/development/python-modules/pytest/default.nix +++ b/pkgs/development/python-modules/pytest/default.nix @@ -1,6 +1,6 @@ { stdenv, buildPythonPackage, pythonOlder, fetchPypi, attrs, hypothesis, py , setuptools_scm, setuptools, six, pluggy, funcsigs, isPy3k, more-itertools -, atomicwrites, mock, writeText, pathlib2, wcwidth, packaging, isPyPy +, atomicwrites, mock, writeText, pathlib2, wcwidth, packaging, isPyPy, python }: buildPythonPackage rec { version = "5.1.0"; @@ -17,12 +17,13 @@ buildPythonPackage rec { }; checkInputs = [ hypothesis mock ]; - buildInputs = [ setuptools_scm ]; + nativeBuildInputs = [ setuptools_scm ]; propagatedBuildInputs = [ attrs py setuptools six pluggy more-itertools atomicwrites wcwidth packaging ] ++ stdenv.lib.optionals (!isPy3k) [ funcsigs ] ++ stdenv.lib.optionals (pythonOlder "3.6") [ pathlib2 ]; doCheck = !isPyPy; # https://github.com/pytest-dev/pytest/issues/3460 + # Ignored file https://github.com/pytest-dev/pytest/pull/5605#issuecomment-522243929 checkPhase = '' runHook preCheck @@ -35,15 +36,17 @@ buildPythonPackage rec { pytestcachePhase() { find $out -name .pytest_cache -type d -exec rm -rf {} + } - preDistPhases+=" pytestcachePhase" ''; + pythonImportsCheck = [ + "pytest" + ]; + meta = with stdenv.lib; { homepage = https://docs.pytest.org; description = "Framework for writing tests"; maintainers = with maintainers; [ domenkozar lovek323 madjar lsix ]; license = licenses.mit; - platforms = platforms.unix; }; } diff --git a/pkgs/development/python-modules/python3pika/default.nix b/pkgs/development/python-modules/python3pika/default.nix deleted file mode 100644 index 4f75acff02ec..000000000000 --- a/pkgs/development/python-modules/python3pika/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ stdenv -, buildPythonPackage -, fetchPypi -, isPy3k -, nose -, mock -, pyyaml -, unittest2 -}: - -buildPythonPackage rec { - pname = "python3-pika"; - version = "0.9.14"; - disabled = !isPy3k; - - src = fetchPypi { - inherit pname version; - sha256 = "1c3hifwvn04kvlja88iawf0awyz726jynwnpcb6gn7376b4nfch7"; - }; - - # Unit tests adds dependencies on pyev, tornado and twisted (and twisted is disabled for Python 3) - doCheck = false; - - buildInputs = [ nose mock pyyaml ]; - propagatedBuildInputs = [ unittest2 ]; - - meta = with stdenv.lib; { - homepage = https://pika.readthedocs.org/; - description = "Pika Python AMQP Client Library"; - license = licenses.gpl2; - }; - -} diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index a849dad54aa9..569ff017ea9b 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -1,24 +1,29 @@ { stdenv +, buildPythonPackage , fetchPypi , python , wrapPython , unzip +, callPackage +, bootstrapped-pip }: -# Should use buildPythonPackage here somehow -stdenv.mkDerivation rec { +buildPythonPackage rec { pname = "setuptools"; - version = "41.0.1"; - name = "${python.libPrefix}-${pname}-${version}"; + version = "41.2.0"; + format = "other"; src = fetchPypi { inherit pname version; extension = "zip"; - sha256 = "a222d126f5471598053c9a77f4b5d4f26eaa1f150ad6e01dcf1a42e185d05613"; + sha256 = "66b86bbae7cc7ac2e867f52dc08a6bd064d938bac59dfec71b9b565dd36d6012"; }; - nativeBuildInputs = [ unzip wrapPython python.pythonForBuild ]; - doCheck = false; # requires pytest + # There is nothing to build + dontBuild = true; + + nativeBuildInputs = [ bootstrapped-pip ]; + installPhase = '' dst=$out/${python.sitePackages} mkdir -p $dst @@ -27,13 +32,11 @@ stdenv.mkDerivation rec { wrapPythonPrograms ''; - pythonPath = []; - - dontPatchShebangs = true; - - # Python packages built through cross-compilation are always for the host platform. - disallowedReferences = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ python.pythonForBuild ]; + # Adds setuptools to nativeBuildInputs causing infinite recursion. + catchConflicts = false; + # Requires pytest, causing infinite recursion. + doCheck = false; meta = with stdenv.lib; { description = "Utilities to facilitate the installation of Python packages"; diff --git a/pkgs/development/python-modules/setuptools_scm/default.nix b/pkgs/development/python-modules/setuptools_scm/default.nix index a222fc9e49f8..9e176bc68749 100644 --- a/pkgs/development/python-modules/setuptools_scm/default.nix +++ b/pkgs/development/python-modules/setuptools_scm/default.nix @@ -1,15 +1,14 @@ { stdenv, buildPythonPackage, fetchPypi, pip }: + buildPythonPackage rec { pname = "setuptools_scm"; - version = "3.2.0"; + version = "3.3.3"; src = fetchPypi { inherit pname version; - sha256 = "52ab47715fa0fc7d8e6cd15168d1a69ba995feb1505131c3e814eb7087b57358"; + sha256 = "19cyndx23xmpbhz4qrwmfwsmnnaczd0dw7qg977ksq2dbvxy29dx"; }; - buildInputs = [ pip ]; - # Seems to fail due to chroot and would cause circular dependency # with pytest doCheck = false; diff --git a/pkgs/development/python-modules/terminado/default.nix b/pkgs/development/python-modules/terminado/default.nix index bebe8c3d1f8e..dbcc5935e5e2 100644 --- a/pkgs/development/python-modules/terminado/default.nix +++ b/pkgs/development/python-modules/terminado/default.nix @@ -16,6 +16,9 @@ buildPythonPackage rec { propagatedBuildInputs = [ ptyprocess tornado ]; + # test_max_terminals fails + doCheck = false; + meta = with lib; { description = "Terminals served by Tornado websockets"; homepage = https://github.com/jupyter/terminado; diff --git a/pkgs/development/python-modules/tld/default.nix b/pkgs/development/python-modules/tld/default.nix index 3a21ce57fe7a..b3d83deeac9e 100644 --- a/pkgs/development/python-modules/tld/default.nix +++ b/pkgs/development/python-modules/tld/default.nix @@ -10,20 +10,25 @@ python.pkgs.buildPythonPackage rec { }; propagatedBuildInputs = with python.pkgs; [ six ]; - checkInputs = with python.pkgs; [ factory_boy faker pytest pytestcov tox ]; + checkInputs = with python.pkgs; [ factory_boy faker pytestcov tox pytestCheckHook]; # https://github.com/barseghyanartur/tld/issues/54 - disabledTests = stdenv.lib.concatMapStringsSep " and " (s: "not " + s) ([ + disabledTests = [ "test_1_update_tld_names" "test_1_update_tld_names_command" "test_2_update_tld_names_module" - ]); + ]; - checkPhase = '' - export PATH="$PATH:$out/bin" - py.test -k '${disabledTests}' + preCheck = '' + export PATH="$PATH:$out/bin" ''; + dontUseSetuptoolsCheck = true; + + pythonImportsCheck = [ + "tld" + ]; + meta = with stdenv.lib; { homepage = https://github.com/barseghyanartur/tld; description = "Extracts the top level domain (TLD) from the URL given"; diff --git a/pkgs/development/python-modules/wheel/default.nix b/pkgs/development/python-modules/wheel/default.nix index d7814984060e..0ba5b19597ee 100644 --- a/pkgs/development/python-modules/wheel/default.nix +++ b/pkgs/development/python-modules/wheel/default.nix @@ -1,30 +1,34 @@ { lib +, setuptools +, pip , buildPythonPackage , fetchPypi , pytest , pytestcov , coverage , jsonschema +, bootstrapped-pip }: buildPythonPackage rec { pname = "wheel"; - version = "0.33.4"; + version = "0.33.6"; + format = "other"; src = fetchPypi { inherit pname version; - sha256 = "62fcfa03d45b5b722539ccbc07b190e4bfff4bb9e3a4d470dd9f6a0981002565"; + sha256 = "10c9da68765315ed98850f8e048347c3eb06dd81822dc2ab1d4fde9dc9702646"; }; checkInputs = [ pytest pytestcov coverage ]; + nativeBuildInputs = [ bootstrapped-pip setuptools ]; - propagatedBuildInputs = [ jsonschema ]; - + catchConflicts = false; # No tests in archive doCheck = false; # We add this flag to ignore the copy installed by bootstrapped-pip - installFlags = [ "--ignore-installed" ]; + pipInstallFlags = [ "--ignore-installed" ]; meta = { description = "A built-package format for Python"; diff --git a/pkgs/development/tools/build-managers/waf/default.nix b/pkgs/development/tools/build-managers/waf/default.nix index 6f50907665fe..f8bbda61627a 100644 --- a/pkgs/development/tools/build-managers/waf/default.nix +++ b/pkgs/development/tools/build-managers/waf/default.nix @@ -8,13 +8,13 @@ let in stdenv.mkDerivation rec { pname = "waf"; - version = "2.0.15"; + version = "2.0.18"; src = fetchFromGitLab { owner = "ita1024"; repo = "waf"; rev = "${pname}-${version}"; - sha256 = "0i86dbn6l01n4h4rzyl4mvizqabbqn5w7fywh83z7fxpha13c3bz"; + sha256 = "1ifcanm2x2i8qwgfkwgdxwaqcdwsx5jg8bd1d6sqjps3pz7s5qxx"; }; patches = [ diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix index 7a3579f0635d..06f1e2895c02 100644 --- a/pkgs/development/tools/misc/elfutils/default.nix +++ b/pkgs/development/tools/misc/elfutils/default.nix @@ -12,10 +12,6 @@ stdenv.mkDerivation rec { patches = [ ./debug-info-from-env.patch ]; - postPatch = '' - patchShebangs tests - ''; - hardeningDisable = [ "format" ]; # We need bzip2 in NativeInputs because otherwise we can't unpack the src, |