From e5d8381542a8d084371d26013fab199f52474be7 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 15 Jan 2020 22:33:16 +0000 Subject: sommelier: don't build demos Now we don't need to build half of Chromium OS just to use sommelier! It was in the runtime closure too. Made generating the squashfs's extremely slow. --- ...ommon-mk-don-t-leak-source-absolute-paths.patch | 4 +- ...002-common-mk-.gn-don-t-hardcode-env-path.patch | 4 +- ...libbrillo-Use-a-unique_ptr-for-EVP_MD_CTX.patch | 4 +- .../0004-libbrillo-Update-for-OpenSSL-1.1.patch | 4 +- ...lo-fix-build-with-relative-platform2_root.patch | 4 +- ...ibbrillo-don-t-leak-source-absolute-paths.patch | 4 +- ...libbrillo-fix-build-with-no-__has_feature.patch | 4 +- ...ommelier-don-t-leak-source-absolute-paths.patch | 4 +- ...9-sommelier-use-stable-xdg-shell-protocol.patch | 4 +- ...10-sommelier-make-building-demos-optional.patch | 100 +++++++++++++++++++++ .../linux/chromium-os/sommelier/default.nix | 9 +- 11 files changed, 124 insertions(+), 21 deletions(-) create mode 100644 pkgs/os-specific/linux/chromium-os/sommelier/0010-sommelier-make-building-demos-optional.patch (limited to 'pkgs/os-specific/linux/chromium-os') diff --git a/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch b/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch index c4e314d7988..769770db57e 100644 --- a/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch +++ b/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch @@ -1,7 +1,7 @@ From 05622922a69bda21677a7f59b19214e3a00855c4 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 24 Nov 2019 16:56:11 +0000 -Subject: [PATCH 1/9] common-mk: don't leak source-absolute paths +Subject: [PATCH 01/10] common-mk: don't leak source-absolute paths Source-absolute paths like //vm_tools/whatever were being leaked to subprocesses, which of course didn't know how to understand them. @@ -135,5 +135,5 @@ index 70e32cafc..f6dce2760 100644 } } -- -2.23.0 +2.24.1 diff --git a/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch b/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch index d82b3d7dff8..731b9ca1965 100644 --- a/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch +++ b/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch @@ -1,7 +1,7 @@ From d3ea2a8f9f64e2aff9667f03a93540e2e72c0f30 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 24 Nov 2019 17:20:46 +0000 -Subject: [PATCH 2/9] common-mk: .gn: don't hardcode env path +Subject: [PATCH 02/10] common-mk: .gn: don't hardcode env path This is needlessly non-portable. --- @@ -19,5 +19,5 @@ index e7dba8c91..e29fcd61e 100644 -script_executable = "/usr/bin/env" +script_executable = "env" -- -2.23.0 +2.24.1 diff --git a/pkgs/os-specific/linux/chromium-os/libbrillo/0003-libbrillo-Use-a-unique_ptr-for-EVP_MD_CTX.patch b/pkgs/os-specific/linux/chromium-os/libbrillo/0003-libbrillo-Use-a-unique_ptr-for-EVP_MD_CTX.patch index ceb9b8746d2..98257d98254 100644 --- a/pkgs/os-specific/linux/chromium-os/libbrillo/0003-libbrillo-Use-a-unique_ptr-for-EVP_MD_CTX.patch +++ b/pkgs/os-specific/linux/chromium-os/libbrillo/0003-libbrillo-Use-a-unique_ptr-for-EVP_MD_CTX.patch @@ -1,7 +1,7 @@ From d79343f36918fd99861426f658fdfb53237661f0 Mon Sep 17 00:00:00 2001 From: Daniel Kurtz Date: Thu, 17 Oct 2019 20:45:53 +1100 -Subject: [PATCH 3/9] libbrillo: Use a unique_ptr for EVP_MD_CTX +Subject: [PATCH 03/10] libbrillo: Use a unique_ptr for EVP_MD_CTX In OpenSSL 1.1, the EVP_MD_CTX struct will become opaque, and therefore it will not be possible to allocate on the stack. @@ -82,5 +82,5 @@ index 958b7ebb7..eaf90c96a 100644 return rv == 1; } -- -2.23.0 +2.24.1 diff --git a/pkgs/os-specific/linux/chromium-os/libbrillo/0004-libbrillo-Update-for-OpenSSL-1.1.patch b/pkgs/os-specific/linux/chromium-os/libbrillo/0004-libbrillo-Update-for-OpenSSL-1.1.patch index 6bdb61c4997..555daf7478c 100644 --- a/pkgs/os-specific/linux/chromium-os/libbrillo/0004-libbrillo-Update-for-OpenSSL-1.1.patch +++ b/pkgs/os-specific/linux/chromium-os/libbrillo/0004-libbrillo-Update-for-OpenSSL-1.1.patch @@ -1,7 +1,7 @@ From ad7338d648cfeffbd595e9a7681f746ce834d59e Mon Sep 17 00:00:00 2001 From: Daniel Kurtz Date: Mon, 3 Jun 2019 16:46:17 -0600 -Subject: [PATCH 4/9] libbrillo: Update for OpenSSL 1.1 +Subject: [PATCH 04/10] libbrillo: Update for OpenSSL 1.1 OpenSSL 1.1 has made significant non-backwards compatible changes to its API as outlined in: @@ -214,5 +214,5 @@ index eaf90c96a..3f96d12ee 100644 return false; -- -2.23.0 +2.24.1 diff --git a/pkgs/os-specific/linux/chromium-os/libbrillo/0005-libbrillo-fix-build-with-relative-platform2_root.patch b/pkgs/os-specific/linux/chromium-os/libbrillo/0005-libbrillo-fix-build-with-relative-platform2_root.patch index 64f09279bae..a4f24ae02a4 100644 --- a/pkgs/os-specific/linux/chromium-os/libbrillo/0005-libbrillo-fix-build-with-relative-platform2_root.patch +++ b/pkgs/os-specific/linux/chromium-os/libbrillo/0005-libbrillo-fix-build-with-relative-platform2_root.patch @@ -1,7 +1,7 @@ From ee36a284641d9ac2b412bba3738729fd5b969f42 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 1 Dec 2019 22:11:39 +0000 -Subject: [PATCH 5/9] libbrillo: fix build with relative platform2_root +Subject: [PATCH 05/10] libbrillo: fix build with relative platform2_root --- libbrillo/BUILD.gn | 3 ++- @@ -22,5 +22,5 @@ index 6739def9c..75b6da6f2 100644 "policy/device_policy.cc", "policy/device_policy_impl.cc", -- -2.23.0 +2.24.1 diff --git a/pkgs/os-specific/linux/chromium-os/libbrillo/0006-libbrillo-don-t-leak-source-absolute-paths.patch b/pkgs/os-specific/linux/chromium-os/libbrillo/0006-libbrillo-don-t-leak-source-absolute-paths.patch index 59c31ec4af9..964f8b1f8c3 100644 --- a/pkgs/os-specific/linux/chromium-os/libbrillo/0006-libbrillo-don-t-leak-source-absolute-paths.patch +++ b/pkgs/os-specific/linux/chromium-os/libbrillo/0006-libbrillo-don-t-leak-source-absolute-paths.patch @@ -1,7 +1,7 @@ From 5c95aae10ef7968ab2d9cbdf1456798dc8f94890 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 1 Dec 2019 14:55:21 +0000 -Subject: [PATCH 6/9] libbrillo: don't leak source-absolute paths +Subject: [PATCH 06/10] libbrillo: don't leak source-absolute paths --- libbrillo/BUILD.gn | 7 +++---- @@ -26,5 +26,5 @@ index 75b6da6f2..a3a25865b 100644 "(", "AS_NEEDED", -- -2.23.0 +2.24.1 diff --git a/pkgs/os-specific/linux/chromium-os/libbrillo/0007-libbrillo-fix-build-with-no-__has_feature.patch b/pkgs/os-specific/linux/chromium-os/libbrillo/0007-libbrillo-fix-build-with-no-__has_feature.patch index 1ac8e0bb4d7..bdd8ed296e7 100644 --- a/pkgs/os-specific/linux/chromium-os/libbrillo/0007-libbrillo-fix-build-with-no-__has_feature.patch +++ b/pkgs/os-specific/linux/chromium-os/libbrillo/0007-libbrillo-fix-build-with-no-__has_feature.patch @@ -1,7 +1,7 @@ From 268494087143b570af36bf7c4fe891108ea839db Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 1 Dec 2019 14:57:01 +0000 -Subject: [PATCH 7/9] libbrillo: fix build with no __has_feature +Subject: [PATCH 07/10] libbrillo: fix build with no __has_feature --- libbrillo/brillo/asan.h | 8 ++++++-- @@ -32,5 +32,5 @@ index d29932a82..0d707467f 100644 #endif -- -2.23.0 +2.24.1 diff --git a/pkgs/os-specific/linux/chromium-os/sommelier/0008-sommelier-don-t-leak-source-absolute-paths.patch b/pkgs/os-specific/linux/chromium-os/sommelier/0008-sommelier-don-t-leak-source-absolute-paths.patch index aafd443e3e0..2628abd370c 100644 --- a/pkgs/os-specific/linux/chromium-os/sommelier/0008-sommelier-don-t-leak-source-absolute-paths.patch +++ b/pkgs/os-specific/linux/chromium-os/sommelier/0008-sommelier-don-t-leak-source-absolute-paths.patch @@ -1,7 +1,7 @@ From 1f414ce4e36d424e4c4c9124f60e784d364af282 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 1 Dec 2019 17:04:04 +0000 -Subject: [PATCH 8/9] sommelier: don't leak source-absolute paths +Subject: [PATCH 08/10] sommelier: don't leak source-absolute paths --- vm_tools/sommelier/wayland_protocol.gni | 2 +- @@ -21,5 +21,5 @@ index 4f18a0c10..b1bd5d659 100644 } } -- -2.23.0 +2.24.1 diff --git a/pkgs/os-specific/linux/chromium-os/sommelier/0009-sommelier-use-stable-xdg-shell-protocol.patch b/pkgs/os-specific/linux/chromium-os/sommelier/0009-sommelier-use-stable-xdg-shell-protocol.patch index 3c1b49adcea..fe23d6d96dc 100644 --- a/pkgs/os-specific/linux/chromium-os/sommelier/0009-sommelier-use-stable-xdg-shell-protocol.patch +++ b/pkgs/os-specific/linux/chromium-os/sommelier/0009-sommelier-use-stable-xdg-shell-protocol.patch @@ -1,7 +1,7 @@ From ab753b1f376a9a348a0d3a6cc106d097bb4160c3 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Tue, 3 Dec 2019 18:06:14 +0000 -Subject: [PATCH 9/9] sommelier: use stable xdg-shell protocol +Subject: [PATCH 09/10] sommelier: use stable xdg-shell protocol From https://github.com/wayland-project/weston/commit/d8d9f5e6e16c8f6a3c06763d5f56c27dc9a6e52e: @@ -1744,5 +1744,5 @@ index b851b5c8d..7e6daf773 100644 struct sl_global* sl_gtk_shell_global_create(struct sl_context* ctx); -- -2.23.0 +2.24.1 diff --git a/pkgs/os-specific/linux/chromium-os/sommelier/0010-sommelier-make-building-demos-optional.patch b/pkgs/os-specific/linux/chromium-os/sommelier/0010-sommelier-make-building-demos-optional.patch new file mode 100644 index 00000000000..9cdb66a94ae --- /dev/null +++ b/pkgs/os-specific/linux/chromium-os/sommelier/0010-sommelier-make-building-demos-optional.patch @@ -0,0 +1,100 @@ +From a10869a6f73c3939b254b99125975568d29c6eed Mon Sep 17 00:00:00 2001 +From: Alyssa Ross +Date: Wed, 15 Jan 2020 21:36:43 +0000 +Subject: [PATCH 10/10] sommelier: make building demos optional +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +pkg-config was checked at GN evaluation time for libbrillo and +libchrome, meaning that there was no way to build sommelier without +them, even though they were only required for the demos, not for +sommelier itself. + +Making the demo optional saves having to libbrillo and libchrome for +the common case of building just sommelier, which themselves have lots +of unusual dependencies. + +Thanks-to: Tomasz Ĺšniatowski +--- + vm_tools/sommelier/BUILD.gn | 54 ++++++++++++++++++++++--------------- + 1 file changed, 32 insertions(+), 22 deletions(-) + +diff --git a/vm_tools/sommelier/BUILD.gn b/vm_tools/sommelier/BUILD.gn +index 498a0ccab..9b6cb00fe 100644 +--- a/vm_tools/sommelier/BUILD.gn ++++ b/vm_tools/sommelier/BUILD.gn +@@ -4,12 +4,20 @@ + + import("wayland_protocol.gni") + ++declare_args() { ++ use_demos = true ++} ++ + group("all") { + deps = [ + ":sommelier", +- ":wayland_demo", +- ":x11_demo", + ] ++ if (use_demos) { ++ deps += [ ++ ":wayland_demo", ++ ":x11_demo", ++ ] ++ } + } + + if (!defined(peer_cmd_prefix)) { +@@ -123,25 +131,27 @@ executable("sommelier") { + ] + } + +-executable("wayland_demo") { +- pkg_deps = [ +- "libbrillo-${libbase_ver}", +- "libchrome-${libbase_ver}", +- "wayland-client", +- ] +- libs = [ "wayland-client" ] +- sources = [ +- "demos/wayland_demo.cc", +- ] +-} ++if (use_demos) { ++ executable("wayland_demo") { ++ pkg_deps = [ ++ "libbrillo-${libbase_ver}", ++ "libchrome-${libbase_ver}", ++ "wayland-client", ++ ] ++ libs = [ "wayland-client" ] ++ sources = [ ++ "demos/wayland_demo.cc", ++ ] ++ } + +-executable("x11_demo") { +- pkg_deps = [ +- "libbrillo-${libbase_ver}", +- "libchrome-${libbase_ver}", +- ] +- libs = [ "X11" ] +- sources = [ +- "demos/x11_demo.cc", +- ] ++ executable("x11_demo") { ++ pkg_deps = [ ++ "libbrillo-${libbase_ver}", ++ "libchrome-${libbase_ver}", ++ ] ++ libs = [ "X11" ] ++ sources = [ ++ "demos/x11_demo.cc", ++ ] ++ } + } +-- +2.24.1 + diff --git a/pkgs/os-specific/linux/chromium-os/sommelier/default.nix b/pkgs/os-specific/linux/chromium-os/sommelier/default.nix index 599c8dc7d3e..2a1790bfa6d 100644 --- a/pkgs/os-specific/linux/chromium-os/sommelier/default.nix +++ b/pkgs/os-specific/linux/chromium-os/sommelier/default.nix @@ -9,13 +9,16 @@ common-mk { platform2Patches = [ ./0008-sommelier-don-t-leak-source-absolute-paths.patch ./0009-sommelier-use-stable-xdg-shell-protocol.patch + ./0010-sommelier-make-building-demos-optional.patch ]; buildInputs = [ - mesa grpc openssl libdrm protobuf wayland libxkbcommon vm_protos libbrillo - libchrome linuxHeaders c-ares zlib + mesa grpc openssl libdrm protobuf wayland libxkbcommon vm_protos + linuxHeaders c-ares zlib ] ++ (with xlibs; [ pixman libxcb libX11 ]); + gnArgs.use_demos = false; + NIX_CFLAGS_COMPILE = [ "-Wno-error=sign-compare" "-Wno-error=stringop-truncation" @@ -25,7 +28,7 @@ common-mk { installPhase = '' mkdir -p $out/bin - install sommelier wayland_demo x11_demo $out/bin + install sommelier $out/bin ''; meta = with lib; { -- cgit 1.4.1