From b932511029b78e94265166968f784939963d861a Mon Sep 17 00:00:00 2001 From: Florian Peter Date: Mon, 7 Oct 2019 10:48:22 +0800 Subject: [PATCH 1/4] scylladb: fix build access to /etc/os-release Co-authored-by: Justin Humm --- .../scylladb/configure-etc-osrelease.patch | 28 +++++++++++++++++++ pkgs/servers/scylladb/default.nix | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 pkgs/servers/scylladb/configure-etc-osrelease.patch diff --git a/pkgs/servers/scylladb/configure-etc-osrelease.patch b/pkgs/servers/scylladb/configure-etc-osrelease.patch new file mode 100644 index 000000000000..5fd6c7caf085 --- /dev/null +++ b/pkgs/servers/scylladb/configure-etc-osrelease.patch @@ -0,0 +1,28 @@ +diff --git a/configure.py b/configure.py +index 25ca951ac..454140420 100755 +--- a/configure.py ++++ b/configure.py +@@ -36,13 +36,16 @@ tempfile.tempdir = "./build/tmp" + + configure_args = str.join(' ', [shlex.quote(x) for x in sys.argv[1:]]) + +-for line in open('/etc/os-release'): +- key, _, value = line.partition('=') +- value = value.strip().strip('"') +- if key == 'ID': +- os_ids = [value] +- if key == 'ID_LIKE': +- os_ids += value.split(' ') ++try: ++ for line in open('/etc/os-release'): ++ key, _, value = line.partition('=') ++ value = value.strip().strip('"') ++ if key == 'ID': ++ os_ids = [value] ++ if key == 'ID_LIKE': ++ os_ids += value.split(' ') ++except FileNotFoundError: ++ os_ids = ["linux"] + + + # distribution "internationalization", converting package names. diff --git a/pkgs/servers/scylladb/default.nix b/pkgs/servers/scylladb/default.nix index f48ace22f8fb..b3e3e9759151 100644 --- a/pkgs/servers/scylladb/default.nix +++ b/pkgs/servers/scylladb/default.nix @@ -41,7 +41,7 @@ gcc8Stdenv.mkDerivation { fetchSubmodules = true; }; - patches = [ ./seastar-configure-script-paths.patch ]; + patches = [ ./seastar-configure-script-paths.patch ./configure-etc-osrelease.patch ]; nativeBuildInputs = [ pkgconfig From 7a4f48035b92d7adb2822e476b8b0396bf629c2e Mon Sep 17 00:00:00 2001 From: Florian Peter Date: Mon, 7 Oct 2019 11:34:01 +0800 Subject: [PATCH 2/4] scylladb: patch shebangs in further input file --- pkgs/servers/scylladb/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/scylladb/default.nix b/pkgs/servers/scylladb/default.nix index b3e3e9759151..cadc07944bb9 100644 --- a/pkgs/servers/scylladb/default.nix +++ b/pkgs/servers/scylladb/default.nix @@ -77,6 +77,7 @@ gcc8Stdenv.mkDerivation { postPatch = '' patchShebangs ./configure.py + patchShebangs seastar/json/json2code.py ''; configurePhase = '' From bbaaefd366ee8e64405aa43e32852da7822db56d Mon Sep 17 00:00:00 2001 From: Florian Peter Date: Mon, 7 Oct 2019 13:21:11 +0800 Subject: [PATCH 3/4] scylladb: fix spacing in default.nix --- pkgs/servers/scylladb/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/servers/scylladb/default.nix b/pkgs/servers/scylladb/default.nix index cadc07944bb9..144dc3923b8a 100644 --- a/pkgs/servers/scylladb/default.nix +++ b/pkgs/servers/scylladb/default.nix @@ -83,10 +83,12 @@ gcc8Stdenv.mkDerivation { configurePhase = '' ./configure.py --mode=release ''; + installPhase = '' mkdir $out cp -r * $out/ ''; + meta = with stdenv.lib; { description = "NoSQL data store using the seastar framework, compatible with Apache Cassandra"; homepage = "https://scylladb.com"; From de513680c50faf05bf1ee585fb5c9128dcf4e67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 9 Oct 2019 14:39:37 +0200 Subject: [PATCH 4/4] scylladb: remove the "broken" mark, add "big-parallel" The build is really CPU-intensive, and requires around 2 * --cores GiB RAM. --- pkgs/servers/scylladb/default.nix | 2 +- pkgs/top-level/all-packages.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/scylladb/default.nix b/pkgs/servers/scylladb/default.nix index ec8cd2a05a82..6f8f925602a6 100644 --- a/pkgs/servers/scylladb/default.nix +++ b/pkgs/servers/scylladb/default.nix @@ -95,6 +95,6 @@ gcc8Stdenv.mkDerivation { license = licenses.agpl3; platforms = stdenv.lib.platforms.linux; maintainers = [ stdenv.lib.maintainers.farlion ]; - broken = true; + requiredSystemFeatures = [ "big-parallel" ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7b9fb0c2fd29..b251dc342e93 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24494,8 +24494,8 @@ in sct = callPackage ../tools/X11/sct {}; scylladb = callPackage ../servers/scylladb { - thrift = thrift-0_10; - }; + thrift = thrift-0_10; + }; seafile-shared = callPackage ../misc/seafile-shared { };