From 72c23a3469732cd0f0d649a85083ce75cc6f5a81 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Wed, 30 Jun 2021 17:54:45 +0200 Subject: [PATCH 01/18] petsc: refactor using mpi and p4est --- .../libraries/science/math/petsc/default.nix | 59 +++++++++++++++---- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix index f06a028fe64f..e64df8eb51bd 100644 --- a/pkgs/development/libraries/science/math/petsc/default.nix +++ b/pkgs/development/libraries/science/math/petsc/default.nix @@ -1,5 +1,23 @@ -{ lib, stdenv , darwin , fetchurl , blas , gfortran , lapack , python }: +{ lib +, stdenv +, fetchurl +, darwin +, gfortran +, python +, blas +, lapack +, mpi # generic mpi dependency +, openmpi # to compare against mpi +, openssh # required for openmpi tests +, petsc-withp4est ? true +, p4est +, zlib # propagated by p4est but required by petsc +}: +let + mpiSupport = !withp4est || p4est.mpiSupport; + withp4est = petsc-withp4est; +in stdenv.mkDerivation rec { pname = "petsc"; version = "3.14.2"; @@ -9,7 +27,12 @@ stdenv.mkDerivation rec { sha256 = "04vy3qyakikslc58qyv8c9qrwlivix3w6znc993i37cvfg99dch9"; }; - nativeBuildInputs = [ blas gfortran gfortran.cc.lib lapack python ]; + nativeBuildInputs = [ python gfortran gfortran.cc.lib ]; + buildInputs = [ blas lapack ] + ++ lib.optional mpiSupport mpi + ++ lib.optional (mpiSupport && mpi == openmpi) openssh + ++ lib.optional withp4est p4est + ; # Upstream does some hot she-py-bang stuff, this change streamlines that # process. The original script in upstream is both a shell script and a @@ -30,23 +53,35 @@ stdenv.mkDerivation rec { patchShebangs . configureFlagsArray=( $configureFlagsArray - "--CC=$CC" - "--with-cxx=$CXX" - "--with-fc=$FC" - "--with-mpi=0" + ${if !mpiSupport then '' + "--CC=$CC" + "--with-cxx=$CXX" + "--with-fc=$FC" + "--with-mpi=0" + '' else '' + "--CC=mpicc" + "--with-cxx=mpicxx" + "--with-fc=mpif90" + "--with-mpi=1" + ''} + ${if withp4est then '' + "--with-p4est=1" + "--with-zlib-include=${zlib.dev}/include" + "--with-zlib-lib=-L${zlib}/lib -lz" + '' else ""} "--with-blas-lib=[${blas}/lib/libblas.so,${gfortran.cc.lib}/lib/libgfortran.a]" "--with-lapack-lib=[${lapack}/lib/liblapack.so,${gfortran.cc.lib}/lib/libgfortran.a]" ) ''; + inherit mpiSupport withp4est; + enableParallelBuilding = true; + doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + meta = with lib; { - description = '' - Library of linear algebra algorithms for solving partial differential - equations - ''; + description = "Linear algebra algorithms for solving partial differential equations"; homepage = "https://www.mcs.anl.gov/petsc/index.html"; license = licenses.bsd2; - maintainers = with maintainers; [ wucke13 ]; - platforms = platforms.all; + maintainers = with maintainers; [ wucke13 cburstedde ]; }; } From 8834c5399c218701c36193f2ca11f3ae0298c162 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Thu, 1 Jul 2021 22:16:53 +0200 Subject: [PATCH 02/18] petsc: address couple suggestions --- .../libraries/science/math/petsc/default.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix index e64df8eb51bd..2e10df1c9670 100644 --- a/pkgs/development/libraries/science/math/petsc/default.nix +++ b/pkgs/development/libraries/science/math/petsc/default.nix @@ -7,17 +7,12 @@ , blas , lapack , mpi # generic mpi dependency -, openmpi # to compare against mpi , openssh # required for openmpi tests , petsc-withp4est ? true , p4est , zlib # propagated by p4est but required by petsc }: -let - mpiSupport = !withp4est || p4est.mpiSupport; - withp4est = petsc-withp4est; -in stdenv.mkDerivation rec { pname = "petsc"; version = "3.14.2"; @@ -27,10 +22,13 @@ stdenv.mkDerivation rec { sha256 = "04vy3qyakikslc58qyv8c9qrwlivix3w6znc993i37cvfg99dch9"; }; + mpiSupport = !withp4est || p4est.mpiSupport; + withp4est = petsc-withp4est; + nativeBuildInputs = [ python gfortran gfortran.cc.lib ]; buildInputs = [ blas lapack ] ++ lib.optional mpiSupport mpi - ++ lib.optional (mpiSupport && mpi == openmpi) openssh + ++ lib.optional (mpiSupport && mpi.pname == "openmpi") openssh ++ lib.optional withp4est p4est ; @@ -74,12 +72,11 @@ stdenv.mkDerivation rec { ) ''; - inherit mpiSupport withp4est; enableParallelBuilding = true; doCheck = stdenv.hostPlatform == stdenv.buildPlatform; meta = with lib; { - description = "Linear algebra algorithms for solving partial differential equations"; + description = "Portable Extensible Toolkit for Scientific computation"; homepage = "https://www.mcs.anl.gov/petsc/index.html"; license = licenses.bsd2; maintainers = with maintainers; [ wucke13 cburstedde ]; From dbf58984625ca1e2e35c40cb89cd4ee41d0fdc8a Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Thu, 1 Jul 2021 22:27:03 +0200 Subject: [PATCH 03/18] petsc: simplify blas, lapack dependencies --- pkgs/development/libraries/science/math/petsc/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix index 2e10df1c9670..426a4a8f9159 100644 --- a/pkgs/development/libraries/science/math/petsc/default.nix +++ b/pkgs/development/libraries/science/math/petsc/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { mpiSupport = !withp4est || p4est.mpiSupport; withp4est = petsc-withp4est; - nativeBuildInputs = [ python gfortran gfortran.cc.lib ]; + nativeBuildInputs = [ python gfortran ]; buildInputs = [ blas lapack ] ++ lib.optional mpiSupport mpi ++ lib.optional (mpiSupport && mpi.pname == "openmpi") openssh @@ -67,8 +67,8 @@ stdenv.mkDerivation rec { "--with-zlib-include=${zlib.dev}/include" "--with-zlib-lib=-L${zlib}/lib -lz" '' else ""} - "--with-blas-lib=[${blas}/lib/libblas.so,${gfortran.cc.lib}/lib/libgfortran.a]" - "--with-lapack-lib=[${lapack}/lib/liblapack.so,${gfortran.cc.lib}/lib/libgfortran.a]" + "--with-blas=1" + "--with-lapack=1" ) ''; From ce30d367c1427ac39d583daf814f0a23eaf4afd4 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Thu, 1 Jul 2021 22:37:52 +0200 Subject: [PATCH 04/18] petsc: assert requirement for p4est.mpiSupport --- pkgs/development/libraries/science/math/petsc/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix index 426a4a8f9159..900ea76e2840 100644 --- a/pkgs/development/libraries/science/math/petsc/default.nix +++ b/pkgs/development/libraries/science/math/petsc/default.nix @@ -13,6 +13,9 @@ , zlib # propagated by p4est but required by petsc }: +# This version of PETSc does not support a non-MPI p4est build +assert petsc-withp4est -> p4est.mpiSupport; + stdenv.mkDerivation rec { pname = "petsc"; version = "3.14.2"; From bcf9629def740946f74e56d0cf0fd1dfd6772d9a Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Thu, 1 Jul 2021 22:50:54 +0200 Subject: [PATCH 05/18] petsc: remove unnecessary configure options --- pkgs/development/libraries/science/math/petsc/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix index 900ea76e2840..921ac859b1bd 100644 --- a/pkgs/development/libraries/science/math/petsc/default.nix +++ b/pkgs/development/libraries/science/math/petsc/default.nix @@ -55,9 +55,6 @@ stdenv.mkDerivation rec { configureFlagsArray=( $configureFlagsArray ${if !mpiSupport then '' - "--CC=$CC" - "--with-cxx=$CXX" - "--with-fc=$FC" "--with-mpi=0" '' else '' "--CC=mpicc" From 870b2847a42822384b55e13ed6317d9714e20407 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Thu, 1 Jul 2021 22:31:19 +0200 Subject: [PATCH 06/18] getdp: align with latest petsc dependency --- pkgs/applications/science/math/getdp/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/science/math/getdp/default.nix b/pkgs/applications/science/math/getdp/default.nix index 39d9c866caef..5ea3550d08a4 100644 --- a/pkgs/applications/science/math/getdp/default.nix +++ b/pkgs/applications/science/math/getdp/default.nix @@ -1,15 +1,19 @@ { lib, stdenv, fetchurl, cmake, gfortran, blas, lapack, mpi, petsc, python3 }: stdenv.mkDerivation rec { - name = "getdp-${version}"; + pname = "getdp"; version = "3.3.0"; src = fetchurl { url = "http://getdp.info/src/getdp-${version}-source.tgz"; sha256 = "1pfviy2bw8z5y6c15czvlvyjjg9pvpgrj9fr54xfi2gmvs7zkgpf"; }; - nativeBuildInputs = [ cmake gfortran ]; - buildInputs = [ blas lapack mpi petsc python3 ]; + inherit (petsc) mpiSupport; + nativeBuildInputs = [ cmake python3 ]; + buildInputs = [ gfortran blas lapack petsc ] + ++ lib.optional mpiSupport mpi + ; + cmakeFlags = lib.optional mpiSupport "-DENABLE_MPI=1"; meta = with lib; { description = "A General Environment for the Treatment of Discrete Problems"; From 87da2a041474a275c1ed6838916a700cd045df05 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Mon, 5 Jul 2021 15:39:02 +0200 Subject: [PATCH 07/18] petsc: do not build with p4est on aarch64 --- pkgs/development/libraries/science/math/petsc/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix index 921ac859b1bd..87689ddb827c 100644 --- a/pkgs/development/libraries/science/math/petsc/default.nix +++ b/pkgs/development/libraries/science/math/petsc/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { }; mpiSupport = !withp4est || p4est.mpiSupport; - withp4est = petsc-withp4est; + withp4est = !stdenv.isAarch64 && petsc-withp4est; nativeBuildInputs = [ python gfortran ]; buildInputs = [ blas lapack ] From c99a5b9a60ae5c5204a3f41f5d65b642093d1b82 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Mon, 5 Jul 2021 16:58:59 +0200 Subject: [PATCH 08/18] petsc: do not build with p4est on darwin --- pkgs/development/libraries/science/math/petsc/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix index 87689ddb827c..8cea4026d9eb 100644 --- a/pkgs/development/libraries/science/math/petsc/default.nix +++ b/pkgs/development/libraries/science/math/petsc/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { }; mpiSupport = !withp4est || p4est.mpiSupport; - withp4est = !stdenv.isAarch64 && petsc-withp4est; + withp4est = !(stdenv.isAarch64 || stdenv.isDarwin) && petsc-withp4est; nativeBuildInputs = [ python gfortran ]; buildInputs = [ blas lapack ] From 27b512299f1a9e5e1fb5801d195f9cb98e75dc73 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Tue, 6 Jul 2021 07:13:59 +0200 Subject: [PATCH 09/18] petsc: restrict patchSheBang; use configureScript The configure script can be called with python via configureScript. This leaves only ./lib/petsc/bin to be patched. --- pkgs/development/libraries/science/math/petsc/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix index 8cea4026d9eb..e72b2912f4d6 100644 --- a/pkgs/development/libraries/science/math/petsc/default.nix +++ b/pkgs/development/libraries/science/math/petsc/default.nix @@ -51,7 +51,7 @@ stdenv.mkDerivation rec { preConfigure = '' export FC="${gfortran}/bin/gfortran" F77="${gfortran}/bin/gfortran" - patchShebangs . + patchShebangs ./lib/petsc/bin configureFlagsArray=( $configureFlagsArray ${if !mpiSupport then '' @@ -71,6 +71,7 @@ stdenv.mkDerivation rec { "--with-lapack=1" ) ''; + configureScript = "python ./configure"; enableParallelBuilding = true; doCheck = stdenv.hostPlatform == stdenv.buildPlatform; From 80697bfb8e32b9169ee6db4079dff88da733c0f9 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Tue, 6 Jul 2021 07:20:21 +0200 Subject: [PATCH 10/18] petsc: build with p4est for all platforms Recent master updates make p4est build on aarch64 and darwin. Undo their deactivation in the petsc build. --- pkgs/development/libraries/science/math/petsc/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix index e72b2912f4d6..3fed81fa34a4 100644 --- a/pkgs/development/libraries/science/math/petsc/default.nix +++ b/pkgs/development/libraries/science/math/petsc/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { }; mpiSupport = !withp4est || p4est.mpiSupport; - withp4est = !(stdenv.isAarch64 || stdenv.isDarwin) && petsc-withp4est; + withp4est = petsc-withp4est; nativeBuildInputs = [ python gfortran ]; buildInputs = [ blas lapack ] From cf4b4bdbeafdae01ba309b0fc3cbba7aa3df1593 Mon Sep 17 00:00:00 2001 From: Carsten Burstedde Date: Tue, 6 Jul 2021 23:10:19 +0200 Subject: [PATCH 11/18] petsc: specify python3 and remove unneeded patch --- .../libraries/science/math/petsc/default.nix | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/science/math/petsc/default.nix b/pkgs/development/libraries/science/math/petsc/default.nix index 3fed81fa34a4..ee495deedc1e 100644 --- a/pkgs/development/libraries/science/math/petsc/default.nix +++ b/pkgs/development/libraries/science/math/petsc/default.nix @@ -3,7 +3,7 @@ , fetchurl , darwin , gfortran -, python +, python3 , blas , lapack , mpi # generic mpi dependency @@ -28,23 +28,14 @@ stdenv.mkDerivation rec { mpiSupport = !withp4est || p4est.mpiSupport; withp4est = petsc-withp4est; - nativeBuildInputs = [ python gfortran ]; + nativeBuildInputs = [ python3 gfortran ]; buildInputs = [ blas lapack ] ++ lib.optional mpiSupport mpi ++ lib.optional (mpiSupport && mpi.pname == "openmpi") openssh ++ lib.optional withp4est p4est ; - # Upstream does some hot she-py-bang stuff, this change streamlines that - # process. The original script in upstream is both a shell script and a - # python script, where the shellscript just finds a suitable python - # interpreter to execute the python script. See - # https://github.com/NixOS/nixpkgs/pull/89299#discussion_r450203444 - # for more details. - prePatch = '' - substituteInPlace configure \ - --replace /bin/sh /usr/bin/python - '' + lib.optionalString stdenv.isDarwin '' + prePatch = lib.optionalString stdenv.isDarwin '' substituteInPlace config/install.py \ --replace /usr/bin/install_name_tool ${darwin.cctools}/bin/install_name_tool ''; @@ -71,6 +62,7 @@ stdenv.mkDerivation rec { "--with-lapack=1" ) ''; + configureScript = "python ./configure"; enableParallelBuilding = true; From 64f17e13328add755ac7149d65cbe2b774515cae Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 10 Jul 2021 17:41:22 +0200 Subject: [PATCH 12/18] python3Packages.pre-commit-hooks: 3.4.0 -> 4.0.1 --- .../pre-commit-hooks/default.nix | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/pre-commit-hooks/default.nix b/pkgs/development/python-modules/pre-commit-hooks/default.nix index f664d9c6d25e..212fdf6a721a 100644 --- a/pkgs/development/python-modules/pre-commit-hooks/default.nix +++ b/pkgs/development/python-modules/pre-commit-hooks/default.nix @@ -1,9 +1,8 @@ -{ buildPythonPackage +{ lib +, buildPythonPackage , fetchFromGitHub -, fetchPypi , git -, isPy27 -, lib +, pythonOlder , pytestCheckHook , ruamel_yaml , toml @@ -11,19 +10,25 @@ buildPythonPackage rec { pname = "pre-commit-hooks"; - version = "3.4.0"; - disabled = isPy27; + version = "4.0.1"; + disabled = pythonOlder "3.6"; - # fetchPypi does not provide tests src = fetchFromGitHub { owner = "pre-commit"; repo = pname; rev = "v${version}"; - sha256 = "1aqkmprdc2lhds9c59pkkf2js65j63197flanaggk7cm8k0kz7zs"; + sha256 = "sha256-Rg2I79r0Pp3AUgT6mD+kEdm+5CEGgdmFn6G3xcU6fnk="; }; - propagatedBuildInputs = [ toml ruamel_yaml ]; - checkInputs = [ git pytestCheckHook ]; + propagatedBuildInputs = [ + ruamel_yaml + toml + ]; + + checkInputs = [ + git + pytestCheckHook + ]; # the tests require a functional git installation which requires a valid HOME # directory. @@ -34,6 +39,8 @@ buildPythonPackage rec { git config --global user.email "nix-builder@nixos.org" ''; + pythonImportsCheck = [ "pre_commit_hooks" ]; + meta = with lib; { description = "Some out-of-the-box hooks for pre-commit"; homepage = "https://github.com/pre-commit/pre-commit-hooks"; From 46f213b36d22481bf50070d25442f2d009d649b7 Mon Sep 17 00:00:00 2001 From: Mica Semrick Date: Sat, 10 Jul 2021 23:46:32 -0700 Subject: [PATCH 13/18] darktable: add some optional packages --- pkgs/applications/graphics/darktable/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix index cc15b96b4b6e..540a74e6524f 100644 --- a/pkgs/applications/graphics/darktable/default.nix +++ b/pkgs/applications/graphics/darktable/default.nix @@ -3,7 +3,7 @@ , ilmbase, gtk3, intltool, lcms2, lensfun, libX11, libexif, libgphoto2, libjpeg , libpng, librsvg, libtiff, openexr, osm-gps-map, pkg-config, sqlite, libxslt , openjpeg, lua, pugixml, colord, colord-gtk, libwebp, libsecret, gnome -, ocl-icd, pcre, gtk-mac-integration, isocodes, llvmPackages +, ocl-icd, pcre, gtk-mac-integration, isocodes, llvmPackages, gmic, libavif, icu }: stdenv.mkDerivation rec { @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { cairo curl exiv2 glib gtk3 ilmbase lcms2 lensfun libexif libgphoto2 libjpeg libpng librsvg libtiff openexr sqlite libxslt libsoup graphicsmagick json-glib openjpeg lua pugixml - libwebp libsecret gnome.adwaita-icon-theme osm-gps-map pcre isocodes + libwebp libsecret gnome.adwaita-icon-theme osm-gps-map pcre isocodes gmic libavif icu ] ++ lib.optionals stdenv.isLinux [ colord colord-gtk libX11 ocl-icd ] ++ lib.optional stdenv.isDarwin gtk-mac-integration From 99bc203025a0ff1265eedc6ff3d6c7aa1f320c09 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 12 Jul 2021 07:23:45 +0200 Subject: [PATCH 14/18] Partially revert "lib/modules: Drop mkStrict and mkFixStrictness" mkFixStrictness was never properly deprecated and should only be removed after warning for some time. This partially reverts commit 8fb9984690c878fcd768e967190957441de05d11. --- lib/default.nix | 4 ++-- lib/modules.nix | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index ccfee2ebe303..ccae0bbc3ab4 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -115,8 +115,8 @@ let mergeModules' mergeOptionDecls evalOptionValue mergeDefinitions pushDownProperties dischargeProperties filterOverrides sortProperties fixupOptionType mkIf mkAssert mkMerge mkOverride - mkOptionDefault mkDefault mkForce mkVMOverride - mkOrder mkBefore mkAfter mkAliasDefinitions + mkOptionDefault mkDefault mkForce mkVMOverride mkStrict + mkFixStrictness mkOrder mkBefore mkAfter mkAliasDefinitions mkAliasAndWrapDefinitions fixMergeModules mkRemovedOptionModule mkRenamedOptionModule mkMergedOptionModule mkChangedOptionModule mkAliasOptionModule doRename; diff --git a/lib/modules.nix b/lib/modules.nix index 58c6cda58e49..99b9a8a31eac 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -713,6 +713,10 @@ rec { mkForce = mkOverride 50; mkVMOverride = mkOverride 10; # used by ‘nixos-rebuild build-vm’ + mkStrict = builtins.trace "`mkStrict' is obsolete; use `mkOverride 0' instead." (mkOverride 0); + + mkFixStrictness = id; # obsolete, no-op + mkOrder = priority: content: { _type = "order"; inherit priority content; From cad20d8983a547c19e914ec5a2a6093b0c8e5a16 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 12 Jul 2021 07:31:20 +0200 Subject: [PATCH 15/18] lib.mkFixStrictness: Deprecate --- lib/default.nix | 2 +- lib/modules.nix | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index ccae0bbc3ab4..8e29ef5c4201 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -115,7 +115,7 @@ let mergeModules' mergeOptionDecls evalOptionValue mergeDefinitions pushDownProperties dischargeProperties filterOverrides sortProperties fixupOptionType mkIf mkAssert mkMerge mkOverride - mkOptionDefault mkDefault mkForce mkVMOverride mkStrict + mkOptionDefault mkDefault mkForce mkVMOverride mkFixStrictness mkOrder mkBefore mkAfter mkAliasDefinitions mkAliasAndWrapDefinitions fixMergeModules mkRemovedOptionModule mkRenamedOptionModule mkMergedOptionModule mkChangedOptionModule diff --git a/lib/modules.nix b/lib/modules.nix index 99b9a8a31eac..ab2bc4f7f8e2 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -713,9 +713,7 @@ rec { mkForce = mkOverride 50; mkVMOverride = mkOverride 10; # used by ‘nixos-rebuild build-vm’ - mkStrict = builtins.trace "`mkStrict' is obsolete; use `mkOverride 0' instead." (mkOverride 0); - - mkFixStrictness = id; # obsolete, no-op + mkFixStrictness = lib.warn "lib.mkFixStrictness has no effect and will be removed. It returns its argument unmodified, so you can just remove any calls." id; mkOrder = priority: content: { _type = "order"; From bdf42f22df5400659c55b5238d67ec65a80bf442 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Mon, 12 Jul 2021 00:23:00 -0600 Subject: [PATCH 16/18] mako: 1.5 -> 1.6 --- pkgs/applications/misc/mako/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/mako/default.nix b/pkgs/applications/misc/mako/default.nix index f28292cb2f16..8f984db7df52 100644 --- a/pkgs/applications/misc/mako/default.nix +++ b/pkgs/applications/misc/mako/default.nix @@ -5,13 +5,13 @@ stdenv.mkDerivation rec { pname = "mako"; - version = "1.5"; + version = "1.6"; src = fetchFromGitHub { owner = "emersion"; repo = pname; rev = "v${version}"; - sha256 = "0f92krcgybl4113g2gawf7lcbh1fss7bq4cx81h1zyn7yvxlwx2b"; + sha256 = "sha256-RcPwZ5NeO9vxwPWfgj5x3wVdCYGKumnYT3ngHEAWfW0="; }; nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-protocols wrapGAppsHook ]; From a164e1d0a17549cc4c238cfe9c32a0bac97b24e1 Mon Sep 17 00:00:00 2001 From: Ulrik Strid Date: Mon, 12 Jul 2021 11:29:43 +0200 Subject: [PATCH 17/18] ocamlPackages.json-data-encoding: init at 0.8, ocamlPackages.data-encoding: init at 0.2.0 (#129444) --- .../ocaml-modules/data-encoding/default.nix | 46 +++++++++++++++++++ .../ocaml-modules/json-data-encoding/bson.nix | 20 ++++++++ .../json-data-encoding/default.nix | 31 +++++++++++++ pkgs/top-level/ocaml-packages.nix | 6 +++ 4 files changed, 103 insertions(+) create mode 100644 pkgs/development/ocaml-modules/data-encoding/default.nix create mode 100644 pkgs/development/ocaml-modules/json-data-encoding/bson.nix create mode 100644 pkgs/development/ocaml-modules/json-data-encoding/default.nix diff --git a/pkgs/development/ocaml-modules/data-encoding/default.nix b/pkgs/development/ocaml-modules/data-encoding/default.nix new file mode 100644 index 000000000000..2e4e0518a522 --- /dev/null +++ b/pkgs/development/ocaml-modules/data-encoding/default.nix @@ -0,0 +1,46 @@ +{ lib +, fetchFromGitLab +, buildDunePackage +, ezjsonm +, zarith +, hex +, json-data-encoding +, json-data-encoding-bson +, alcotest +, crowbar +}: + +buildDunePackage { + pname = "data-encoding"; + version = "0.2.0"; + + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = "data-encoding"; + rev = "0.2"; + sha256 = "0d9c2ix2imqk4r0jfhnwak9laarlbsq9kmswvbnjzdm2g0hwin1d"; + }; + useDune2 = true; + + propagatedBuildInputs = [ + ezjsonm + zarith + hex + json-data-encoding + json-data-encoding-bson + ]; + + checkInputs = [ + alcotest + crowbar + ]; + + doCheck = true; + + meta = { + homepage = "https://gitlab.com/nomadic-labs/data-encoding"; + description = "Library of JSON and binary encoding combinators"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/json-data-encoding/bson.nix b/pkgs/development/ocaml-modules/json-data-encoding/bson.nix new file mode 100644 index 000000000000..5048a8fd06a7 --- /dev/null +++ b/pkgs/development/ocaml-modules/json-data-encoding/bson.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage, json-data-encoding, ocplib-endian, crowbar }: + +buildDunePackage { + pname = "json-data-encoding-bson"; + + inherit (json-data-encoding) version src useDune2 doCheck; + + propagatedBuildInputs = [ + json-data-encoding + ocplib-endian + ]; + + checkInputs = [ + crowbar + ]; + + meta = json-data-encoding.meta // { + description = "Type-safe encoding to and decoding from JSON (bson support)"; + }; +} diff --git a/pkgs/development/ocaml-modules/json-data-encoding/default.nix b/pkgs/development/ocaml-modules/json-data-encoding/default.nix new file mode 100644 index 000000000000..6dfea612b10a --- /dev/null +++ b/pkgs/development/ocaml-modules/json-data-encoding/default.nix @@ -0,0 +1,31 @@ +{ lib, fetchFromGitLab, buildDunePackage, uri, crowbar }: + +buildDunePackage rec { + pname = "json-data-encoding"; + version = "0.8"; + + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = "json-data-encoding"; + rev = "v${version}"; + sha256 = "1c6m2qvi9bm6qjxc38p6cia1f66r0rb9xf6b8svlj3jjymvqw889"; + }; + useDune2 = true; + + propagatedBuildInputs = [ + uri + ]; + + checkInputs = [ + crowbar + ]; + + doCheck = true; + + meta = { + homepage = "https://gitlab.com/nomadic-labs/json-data-encoding"; + description = "Type-safe encoding to and decoding from JSON"; + license = lib.licenses.lgpl3; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 977d70e7ef15..31ef92e42048 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -242,6 +242,8 @@ let dap = callPackage ../development/ocaml-modules/dap { }; + data-encoding = callPackage ../development/ocaml-modules/data-encoding { }; + decompress = callPackage ../development/ocaml-modules/decompress { }; diet = callPackage ../development/ocaml-modules/diet { }; @@ -548,6 +550,10 @@ let jsonm = callPackage ../development/ocaml-modules/jsonm { }; + json-data-encoding = callPackage ../development/ocaml-modules/json-data-encoding { }; + + json-data-encoding-bson = callPackage ../development/ocaml-modules/json-data-encoding/bson.nix { }; + junit = callPackage ../development/ocaml-modules/junit { }; junit_ounit = callPackage ../development/ocaml-modules/junit/ounit.nix { }; junit_alcotest = callPackage ../development/ocaml-modules/junit/alcotest.nix { }; From 009668465ed07712a51d0b00e33e2d9e00d203ad Mon Sep 17 00:00:00 2001 From: Sirio Balmelli Date: Mon, 12 Jul 2021 11:18:25 +0200 Subject: [PATCH 18/18] gcc-arm-embedded: add numVersion attribute for convenience There are builds which rely on having the numeric version of gcc (eg "10.2.1") declared in an environment variable. Running 'arm-none-eabi-gcc --version' returns: "arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)" However, the attribute arm-none-eabi-gcc.version is "10-2020-q4-major", from which there is no way to derive "10.2.1". Contrast this with the attribute gcc.version which (at this time) gives "10.3.0". By adding a numVersion attribute, consumers of this package can correctly determine what GCC version is being executed. Signed-off-by: Sirio Balmelli --- pkgs/development/compilers/gcc-arm-embedded/10/default.nix | 1 + pkgs/development/compilers/gcc-arm-embedded/6/default.nix | 1 + pkgs/development/compilers/gcc-arm-embedded/7/default.nix | 1 + pkgs/development/compilers/gcc-arm-embedded/8/default.nix | 1 + pkgs/development/compilers/gcc-arm-embedded/9/default.nix | 1 + 5 files changed, 5 insertions(+) diff --git a/pkgs/development/compilers/gcc-arm-embedded/10/default.nix b/pkgs/development/compilers/gcc-arm-embedded/10/default.nix index 943ddd100a21..88dd4d37f7b9 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/10/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/10/default.nix @@ -7,6 +7,7 @@ stdenv.mkDerivation rec { pname = "gcc-arm-embedded"; version = "10-2020-q4-major"; + numVersion = "10.2.1"; subdir = "10-2020q4"; suffix = { diff --git a/pkgs/development/compilers/gcc-arm-embedded/6/default.nix b/pkgs/development/compilers/gcc-arm-embedded/6/default.nix index 266863d95b2e..6dd6ab027f1a 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/6/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/6/default.nix @@ -7,6 +7,7 @@ stdenv.mkDerivation rec { pname = "gcc-arm-embedded"; version = "6-2017-q2-update"; + numVersion = "6.3.1"; subdir = "6-2017q2"; suffix = { diff --git a/pkgs/development/compilers/gcc-arm-embedded/7/default.nix b/pkgs/development/compilers/gcc-arm-embedded/7/default.nix index 4f2135446f61..d2ff1c875508 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/7/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/7/default.nix @@ -7,6 +7,7 @@ stdenv.mkDerivation rec { pname = "gcc-arm-embedded"; version = "7-2018-q2-update"; + numVersion = "7.3.1"; subdir = "7-2018q2"; suffix = { diff --git a/pkgs/development/compilers/gcc-arm-embedded/8/default.nix b/pkgs/development/compilers/gcc-arm-embedded/8/default.nix index 2d85113527c0..4fbc58f15a8d 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/8/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/8/default.nix @@ -7,6 +7,7 @@ stdenv.mkDerivation rec { pname = "gcc-arm-embedded"; version = "8-2019-q3-update"; + numVersion = "8.3.1"; subdir = "8-2019q3/RC1.1"; suffix = { diff --git a/pkgs/development/compilers/gcc-arm-embedded/9/default.nix b/pkgs/development/compilers/gcc-arm-embedded/9/default.nix index 944d7c7b1593..073dc10dd44c 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/9/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/9/default.nix @@ -7,6 +7,7 @@ stdenv.mkDerivation rec { pname = "gcc-arm-embedded"; version = "9-2020-q2-update"; + numVersion = "9.3.1"; subdir = "9-2020q2"; suffix = {