From b681ad32540c5bcb93d3cb98dfd25f22f2eb5503 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 25 Jun 2021 18:08:56 +0200 Subject: [PATCH 1/5] buildFHSUserEnv: Allow having custom /opt in the FHS environment buildFHSUserEnv is meant primarily for running 3rd-party software which is difficult to patch for NixOS. Such software is often built to run from /opt. Currently, running such a software from FHS environment is difficult for two reasons: 1. If the 3rd-party software is put into the Nix store via a simple derivation (with e.g. installPhase = "dpkg-deb -x $src $out"), the content of /opt directory of that derivation does not appear in the FHSEnv even if the derivation is specified in targetPkgs. This is why we change env.nix. 2. If using buildFHSUserEnvChroot and the host system has the /opt directory, it always gets bind-mounted to the FHSEnv even if some targetPkgs contain /opt (NB buildFHSUserEnvBubblewrap does not have this problem). If that directory is not accessible for non-root users (which is what docker's containerd does with /opt :-(), the user running the FHSEnv cannot use it. With the change in chrootenv.c, /opt is not bind-mounted to the container, but instead created as user-modifiable symlink to /host/opt (see the init attribute in build-fhs-userenv/default.nix). If needed, the user can remove this symlink and create an empty /opt directory which is under his/her control. --- pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix | 2 +- pkgs/build-support/build-fhs-userenv/chrootenv/chrootenv.c | 2 +- pkgs/build-support/build-fhs-userenv/env.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix b/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix index b9c719a4c78b..0051961d9f17 100644 --- a/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix +++ b/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix @@ -156,7 +156,7 @@ let done cd .. - for i in var etc; do + for i in var etc opt; do if [ -d "${staticUsrProfileTarget}/$i" ]; then cp -rsHf "${staticUsrProfileTarget}/$i" "$i" fi diff --git a/pkgs/build-support/build-fhs-userenv/chrootenv/chrootenv.c b/pkgs/build-support/build-fhs-userenv/chrootenv/chrootenv.c index 27e70e3fe5c4..d8d87cd7dacf 100644 --- a/pkgs/build-support/build-fhs-userenv/chrootenv/chrootenv.c +++ b/pkgs/build-support/build-fhs-userenv/chrootenv/chrootenv.c @@ -18,7 +18,7 @@ if (expr) \ fail(#expr, errno); -const gchar *bind_blacklist[] = {"bin", "etc", "host", "real-host", "usr", "lib", "lib64", "lib32", "sbin", NULL}; +const gchar *bind_blacklist[] = {"bin", "etc", "host", "real-host", "usr", "lib", "lib64", "lib32", "sbin", "opt", NULL}; int pivot_root(const char *new_root, const char *put_old) { return syscall(SYS_pivot_root, new_root, put_old); diff --git a/pkgs/build-support/build-fhs-userenv/env.nix b/pkgs/build-support/build-fhs-userenv/env.nix index 226904f311b6..f24af87037f7 100644 --- a/pkgs/build-support/build-fhs-userenv/env.nix +++ b/pkgs/build-support/build-fhs-userenv/env.nix @@ -180,7 +180,7 @@ let done cd .. - for i in var etc; do + for i in var etc opt; do if [ -d "${staticUsrProfileTarget}/$i" ]; then cp -rsHf "${staticUsrProfileTarget}/$i" "$i" fi From df371addaf8ebfbec1be049940d1bfad465d244f Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 5 Nov 2021 20:04:44 -0400 Subject: [PATCH 2/5] python3Packages.schema-salad: fix for rdflib 6 https://github.com/common-workflow-language/schema_salad/commit/3aa5aa153a00d8042e495c494ea1fd86cf572bfb --- pkgs/development/python-modules/schema-salad/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/python-modules/schema-salad/default.nix b/pkgs/development/python-modules/schema-salad/default.nix index a1771466cea0..c3445c1d3ad9 100644 --- a/pkgs/development/python-modules/schema-salad/default.nix +++ b/pkgs/development/python-modules/schema-salad/default.nix @@ -6,7 +6,6 @@ , lockfile , mistune , rdflib -, rdflib-jsonld , ruamel-yaml , pytestCheckHook , pythonOlder @@ -29,7 +28,6 @@ buildPythonPackage rec { lockfile mistune rdflib - rdflib-jsonld ruamel-yaml ]; From 7e0d7e407525b0b0d8c903842582f469d53808ad Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 5 Nov 2021 20:08:08 -0400 Subject: [PATCH 3/5] python3Packages.rdflib-jsonld: remove as deprecated --- .../python-modules/rdflib-jsonld/default.nix | 23 ------------------- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 -- 3 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 pkgs/development/python-modules/rdflib-jsonld/default.nix diff --git a/pkgs/development/python-modules/rdflib-jsonld/default.nix b/pkgs/development/python-modules/rdflib-jsonld/default.nix deleted file mode 100644 index 3872ef5d2fe5..000000000000 --- a/pkgs/development/python-modules/rdflib-jsonld/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ buildPythonPackage, fetchPypi, lib, rdflib, nose }: - -buildPythonPackage rec { - pname = "rdflib-jsonld"; - version = "0.6.2"; - - src = fetchPypi { - inherit pname version; - sha256 = "107cd3019d41354c31687e64af5e3fd3c3e3fa5052ce635f5ce595fd31853a63"; - }; - - nativeBuildInputs = [ nose ]; - propagatedBuildInputs = [ rdflib ]; - - meta = with lib; { - homepage = "https://github.com/RDFLib/rdflib-jsonld"; - license = licenses.bsdOriginal; - description = "rdflib extension adding JSON-LD parser and serializer"; - maintainers = [ maintainers.koslambrou ]; - # incomptiable with rdflib 6.0.0, half of the test suite fails with import and atrribute errors - broken = true; - }; -} diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 54885b48abf5..17ffdada3d7f 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -81,6 +81,7 @@ mapAliases ({ pytest_xdist = pytest-xdist; # added 2021-01-04 python_simple_hipchat = python-simple-hipchat; # added 2021-07-21 qasm2image = throw "qasm2image is no longer maintained (since November 2018), and is not compatible with the latest pythonPackages.qiskit versions."; # added 2020-12-09 + rdflib-jsonld = throw "rdflib-jsonld is not compatible with rdflib 6"; # added 2021-11-05 requests_toolbelt = requests-toolbelt; # added 2017-09-26 rotate-backups = throw "rotate-backups was removed in favor of the top-level rotate-backups"; # added 2021-07-01 ruamel_base = ruamel-base; # added 2021-11-01 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3d8e7441d4fe..bbd5bf4ed0b3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8030,8 +8030,6 @@ in { rdflib = callPackage ../development/python-modules/rdflib { }; - rdflib-jsonld = callPackage ../development/python-modules/rdflib-jsonld { }; - rdkit = callPackage ../development/python-modules/rdkit { }; re-assert = callPackage ../development/python-modules/re-assert { }; From 76c1bb81060673f9c2e6991a95f85aa0840758e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 17 Nov 2021 13:26:02 +0100 Subject: [PATCH 4/5] hyperscan: fix build --- pkgs/development/libraries/hyperscan/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/hyperscan/default.nix b/pkgs/development/libraries/hyperscan/default.nix index 4093578156a6..10a53ff1d98f 100644 --- a/pkgs/development/libraries/hyperscan/default.nix +++ b/pkgs/development/libraries/hyperscan/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitHub, cmake, ragel, python3 -, coreutils, gnused, util-linux +, coreutils, gnused, util-linux, fetchpatch , boost , withStatic ? false # build only shared libs by default, build static+shared if true }: @@ -37,6 +37,14 @@ stdenv.mkDerivation rec { ++ lib.optional (withStatic) "-DBUILD_STATIC_AND_SHARED=ON" ++ lib.optional (!withStatic) "-DBUILD_SHARED_LIBS=ON"; + patches = [ + (fetchpatch { + # part of https://github.com/intel/hyperscan/pull/336 + url = "https://github.com/intel/hyperscan/commit/e2c4010b1fc1272cab816ba543940b3586e68a0c.patch"; + sha256 = "sha256-doVNwROL6MTcgOW8jBwGTnxe0zvxjawiob/g6AvXLak="; + }) + ]; + postPatch = '' sed -i '/examples/d' CMakeLists.txt substituteInPlace libhs.pc.in \ From e068dbd97702ec6d0b3da6c45b273fbb9c336889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Tue, 2 Nov 2021 00:26:12 +0000 Subject: [PATCH 5/5] libyaml-cpp: Fix wrong paths in pkg-config .pc file. Same as in #71669. --- pkgs/development/libraries/libyaml-cpp/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/libyaml-cpp/default.nix b/pkgs/development/libraries/libyaml-cpp/default.nix index 0c3eb363a6bc..28156e3e205f 100644 --- a/pkgs/development/libraries/libyaml-cpp/default.nix +++ b/pkgs/development/libraries/libyaml-cpp/default.nix @@ -18,6 +18,12 @@ stdenv.mkDerivation rec { url = "https://github.com/jbeder/yaml-cpp/commit/4f48727b365962e31451cd91027bd797bc7d2ee7.patch"; sha256 = "sha256-jarZAh7NgwL3xXzxijDiAQmC/EC2WYfNMkYHEIQBPhM="; }) + # TODO: Remove with the next release, when https://github.com/jbeder/yaml-cpp/pull/1058 is available + (fetchpatch { + name = "libyaml-cpp-Fix-pc-paths-for-absolute-GNUInstallDirs.patchj"; + url = "https://github.com/jbeder/yaml-cpp/commit/328d2d85e833be7cb5a0ab246cc3f5d7e16fc67a.patch"; + sha256 = "12g5h7lxzd5v16ykay03zww5g28j3k69k228yr3v8fnmyv2spkfl"; + }) ]; nativeBuildInputs = [ cmake ];