New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: add gnome3.gnome-builder #33270
Conversation
let | ||
version = "3.27.2"; | ||
name = "gnome-builder-${version}"; | ||
pythonPath = with python3Packages; python3Packages.makePythonPath [ libpeas pygobject3 ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libpeas
is not marked as a Python module, so it won't be added to the pythonPath
. Packages that provide bindings should be added to python-packages.nix
and use toPythonModule
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, still in the state where I just got it to (finally) got it to startup. I'll work on that next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libpeas
doesn't seem to actually provide any .py
files. It is just a shared lib that supports loading python addons.
nativeBuildInputs = [ gettext meson ninja pkgconfig python3 wrapGAppsHook ]; | ||
buildInputs = [ devhelp gspell gtk3 gtksourceview json_glib jsonrpc_glib libdazzle libgit2-glib libpeas libxml2 llvmPackages.clang llvmPackages.llvm pcre sysprof template_glib vala vte webkitgtk ]; | ||
|
||
propagatedUserEnvPkgs = [ gnome_themes_standard ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if there is any way around it but try to avoid using propagatgedUserEnvPkgs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding the theme as simple buildInput
did solve it. Apparently there are some hooks that fixup things..
|
||
meta = { | ||
homepage = http://sysprof.com/; | ||
homepage = https://git.gnome.org/browse/sysprof/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
, ...}: | ||
|
||
stdenv.mkDerivation rec { | ||
version = "3.27.2"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Versions with odd minor version number are unstable. https://developer.gnome.org/programming-guidelines/stable/versioning.html.en#stable-unstable-versions Unless the stable version is broken, it is preferred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am aware of that. Since the 3.26 release there has been larger restructuring in build system of gnome-builder
. I didn't want to invest time in tinkering with an older version when the (expected) release is end of February/start of march. That would also line up with NixOS 18.03.
I intend to bump the version to the next stable version as soon as those are available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay.
|
||
pythonPath = with python3Packages; makePythonPath [ pygobject3 ]; | ||
preFixup = '' | ||
glib-compile-schemas $out/share/glib-2.0/schemas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you move this to postInstall
, glib setup hook will take care of setting GSETTINGS_SCHEMAS_PATH
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, changed that.
, vte | ||
, webkitgtk | ||
, wrapGAppsHook | ||
, ...}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is ellipsis here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover from some tinkering. Will be removed with next push.
, ninja | ||
, pcre | ||
, pkgconfig | ||
, pkgs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover from some tinkering. Will be removed with next push.
buildInputs = [ glib gtk3 ]; | ||
nativeBuildInputs = [ ninja meson pkgconfig vala ]; | ||
|
||
enableParallelBuilding = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Derivations using meson are built in parallel by default: #32271
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, removed.
|
||
outputs = [ "out" "dev" ]; | ||
|
||
src = fetchFromGitHub { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mirror://gnome/sources/libdazzle…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
buildInputs = [ meson ninja pkgconfig glib ]; | ||
nativeBuildInputs = [ gettext glib gobjectIntrospection flex bison vala ]; | ||
src = fetchgit { | ||
url = https://gitlab.gnome.org/GNOME/template-glib.git; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mirror://gnome/sources/template-glib…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
url = "http://www.sysprof.com/sysprof-1.2.0.tar.gz"; | ||
sha256 = "1wb4d844rsy8qjg3z5m6rnfm72da4xwzrrkkb1q5r10sq1pkrw5s"; | ||
src = fetchgit { | ||
url = "git://git.gnome.org/sysprof"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mirror://gnome/sources/sysprof…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
The typelib path is supposed to be addressed by 1dba3c0 but it only works when typelibdir is an absolute path. This is how I fixed it in polari: https://gitlab.gnome.org/GNOME/polari/merge_requests/15 |
Thank you for the feedback so far. Most of the comments should be addresses. Still have to invest more time into the typelib issue. |
There are also some dependencies missing:
|
9dde381
to
c6dc0a0
Compare
Some path patches: Expand--- a/pkgs/desktops/gnome-3/devtools/gnome-builder/default.nix
+++ b/pkgs/desktops/gnome-3/devtools/gnome-builder/default.nix
@@ -1,15 +1,23 @@
{stdenv
+, autoconf
, clang
+, clang-tools
+, cmake
, ctags
+, substituteAll
, defaultIconTheme
, devhelp
, fetchurl
, gettext
+, gjs
+, glib
, gnome_themes_standard
+, gnumake
, gspell
, gtk3
, gtksourceview
, hicolor_icon_theme
+, indent
, json_glib
, jsonrpc_glib
, libdazzle
@@ -19,15 +26,18 @@
, llvmPackages
, meson
, ninja
+, packagekit
, pcre
, pkgconfig
, python3
, python3Packages
, sysprof
, template_glib
+, unzip
, vala
, vte
, webkitgtk
+, which
, wrapGAppsHook
, ...}:
@@ -52,7 +62,14 @@
mesonFlags = "-D with_flatpak=false";
- patches = [ ./patch_libide.patch ];
+ patches = [
+ ./patch_libide.patch
+ (substituteAll {
+ src = ./fix-paths.patch;
+ glibDev = glib.dev;
+ inherit autoconf clang clang-tools cmake gjs gnumake indent meson packagekit pkgconfig unzip which;
+ })
+ ];
postPatch = ''
patchShebangs build-aux/meson/post_install.py
--- /dev/null
+++ b/pkgs/desktops/gnome-3/devtools/gnome-builder/fix-paths.patch
@@ -0,0 +1,230 @@
+--- a/doc/help/examples/format_on_save.py
++++ b/doc/help/examples/format_on_save.py
+@@ -40,7 +40,7 @@
+ Gio.SubprocessFlags.STDOUT_PIPE)
+
+ # Setup our cmdline arguments
+- launcher.push_argv('indent')
++ launcher.push_argv('@indent@/bin/indent')
+
+ # If your target program is installed on the host (and not bundled
+ # or found in the build environment runtime) you might need to set
+--- a/src/libide/projects/ide-project.c
++++ b/src/libide/projects/ide-project.c
+@@ -732,7 +732,7 @@
+
+ launcher = ide_subprocess_launcher_new (0);
+ ide_subprocess_launcher_set_run_on_host (launcher, TRUE);
+- ide_subprocess_launcher_push_argv (launcher, "gio");
++ ide_subprocess_launcher_push_argv (launcher, "@glibDev@/bin/gio");
+ ide_subprocess_launcher_push_argv (launcher, "trash");
+ ide_subprocess_launcher_push_argv (launcher, uri);
+
+--- a/src/libide/runtimes/ide-runtime.c
++++ b/src/libide/runtimes/ide-runtime.c
+@@ -106,7 +106,7 @@
+ g_autoptr(IdeSubprocess) subprocess = NULL;
+
+ ide_subprocess_launcher_set_run_on_host (launcher, TRUE);
+- ide_subprocess_launcher_push_argv (launcher, "which");
++ ide_subprocess_launcher_push_argv (launcher, "@which@/bin/which");
+ ide_subprocess_launcher_push_argv (launcher, program);
+
+ if (NULL != (subprocess = ide_subprocess_launcher_spawn (launcher, cancellable, NULL)))
+--- a/src/libide/transfers/ide-pkcon-transfer.c
++++ b/src/libide/transfers/ide-pkcon-transfer.c
+@@ -140,7 +140,7 @@
+
+ launcher = ide_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE);
+ ide_subprocess_launcher_set_run_on_host (launcher, TRUE);
+- ide_subprocess_launcher_push_argv (launcher, "pkcon");
++ ide_subprocess_launcher_push_argv (launcher, "@packagekit@/bin/pkcon");
+ ide_subprocess_launcher_push_argv (launcher, "install");
+ ide_subprocess_launcher_push_argv (launcher, "-y");
+ ide_subprocess_launcher_push_argv (launcher, "-p");
+--- a/src/plugins/autotools/ide-autotools-autogen-stage.c
++++ b/src/plugins/autotools/ide-autotools-autogen-stage.c
+@@ -94,7 +94,7 @@
+ }
+ else
+ {
+- ide_subprocess_launcher_push_argv (launcher, "autoreconf");
++ ide_subprocess_launcher_push_argv (launcher, "@autoconf@/bin/autoreconf");
+ ide_subprocess_launcher_push_argv (launcher, "-fiv");
+ }
+
+--- a/src/plugins/autotools/ide-autotools-make-stage.c
++++ b/src/plugins/autotools/ide-autotools-make-stage.c
+@@ -96,7 +96,7 @@
+ if (ide_runtime_contains_program_in_path (runtime, "gmake", cancellable))
+ self->make = "gmake";
+ else
+- self->make = "make";
++ self->make = "@gnumake@/bin/make";
+ }
+
+ if (NULL == (launcher = ide_build_pipeline_create_launcher (pipeline, error)))
+--- a/src/plugins/autotools/ide-makecache.c
++++ b/src/plugins/autotools/ide-makecache.c
+@@ -1042,7 +1042,7 @@
+ {
+ DZL_COUNTER_INC (instances);
+
+- self->make_name = "make";
++ self->make_name = "@gnumake@/bin/make";
+
+ self->file_targets_cache = dzl_task_cache_new ((GHashFunc)g_file_hash,
+ (GEqualFunc)g_file_equal,
+--- a/src/plugins/beautifier/gb-beautifier-process.c
++++ b/src/plugins/beautifier/gb-beautifier-process.c
+@@ -222,7 +222,7 @@
+ return NULL;
+
+ args = g_ptr_array_new ();
+- g_ptr_array_add (args, "clang-format");
++ g_ptr_array_add (args, "@clang-tools@/bin/clang-format");
+ g_ptr_array_add (args, "-style=file");
+ g_ptr_array_add (args, tmp_src_path);
+ g_ptr_array_add (args, NULL);
+--- a/src/plugins/clang/ide-clang-service.c
++++ b/src/plugins/clang/ide-clang-service.c
+@@ -213,7 +213,7 @@
+
+ subprocess = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE,
+ &error,
+- "clang",
++ "@clang@/bin/clang",
+ "-print-file-name=include",
+ NULL);
+
+--- a/src/plugins/cmake/gbp-cmake-pipeline-addin.c
++++ b/src/plugins/cmake/gbp-cmake-pipeline-addin.c
+@@ -131,7 +131,7 @@
+
+ prefix_option = g_strdup_printf ("-DCMAKE_INSTALL_PREFIX=%s", prefix);
+
+- ide_subprocess_launcher_push_argv (configure_launcher, "cmake");
++ ide_subprocess_launcher_push_argv (configure_launcher, "@cmake@/bin/cmake");
+ ide_subprocess_launcher_push_argv (configure_launcher, "-G");
+ ide_subprocess_launcher_push_argv (configure_launcher, "Ninja");
+ ide_subprocess_launcher_push_argv (configure_launcher, ".");
+--- a/src/plugins/flatpak/gbp-flatpak-sources.c
++++ b/src/plugins/flatpak/gbp-flatpak-sources.c
+@@ -281,7 +281,7 @@
+ va_list ap;
+
+ va_start (ap, error);
+- res = archive_spawn (dir, NULL, error, "unzip", ap);
++ res = archive_spawn (dir, NULL, error, "@unzip@/bin/unzip", ap);
+ va_end (ap);
+
+ return res;
+--- a/src/plugins/gjs-symbols/gjs_symbols.py
++++ b/src/plugins/gjs-symbols/gjs_symbols.py
+@@ -251,7 +251,7 @@
+ runtime = context.get_configuration_manager().get_current().get_runtime()
+ launcher = runtime.create_launcher()
+ launcher.set_flags(Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDERR_SILENCE)
+- launcher.push_args(('gjs', '-c', script))
++ launcher.push_args(('@gjs@/bin/gjs', '-c', script))
+ if unsaved_file is not None:
+ launcher.push_argv(unsaved_file.get_content().get_data().decode('utf-8'))
+ else:
+--- a/src/plugins/jhbuild/jhbuild_plugin.py
++++ b/src/plugins/jhbuild/jhbuild_plugin.py
+@@ -98,7 +98,7 @@
+ try:
+ launcher = Ide.SubprocessLauncher.new(Gio.SubprocessFlags.STDOUT_SILENCE |
+ Gio.SubprocessFlags.STDERR_SILENCE)
+- launcher.push_argv('which')
++ launcher.push_argv('@which@/bin/which')
+ launcher.push_argv(jhbuild_bin)
+
+ launcher.set_run_on_host(True)
+--- a/src/plugins/meson/gbp-meson-build-target-provider.c
++++ b/src/plugins/meson/gbp-meson-build-target-provider.c
+@@ -282,7 +282,7 @@
+ pipeline = ide_build_manager_get_pipeline (build_manager);
+ cancellable = g_task_get_cancellable (task);
+
+- ide_subprocess_launcher_push_argv (launcher, "meson");
++ ide_subprocess_launcher_push_argv (launcher, "@meson@/bin/meson");
+ ide_subprocess_launcher_push_argv (launcher, "introspect");
+ ide_subprocess_launcher_push_argv (launcher, "--installed");
+ ide_subprocess_launcher_push_argv (launcher, ide_build_pipeline_get_builddir (pipeline));
+@@ -359,7 +359,7 @@
+ IDE_EXIT;
+ }
+
+- ide_subprocess_launcher_push_argv (launcher, "meson");
++ ide_subprocess_launcher_push_argv (launcher, "@meson@/bin/meson");
+ ide_subprocess_launcher_push_argv (launcher, "introspect");
+ ide_subprocess_launcher_push_argv (launcher, "--targets");
+
+--- a/src/plugins/meson/gbp-meson-pipeline-addin.c
++++ b/src/plugins/meson/gbp-meson-pipeline-addin.c
+@@ -113,7 +113,7 @@
+ parallel = ide_configuration_get_parallelism (config);
+
+ if (NULL == (meson = ide_configuration_getenv (config, "MESON")))
+- meson = "meson";
++ meson = "@meson@/bin/meson";
+
+ /* Setup our meson configure stage. */
+
+--- a/src/plugins/meson/gbp-meson-test-provider.c
++++ b/src/plugins/meson/gbp-meson-test-provider.c
+@@ -202,7 +202,7 @@
+ builddir = ide_build_pipeline_get_builddir (pipeline);
+ ide_subprocess_launcher_set_cwd (launcher, builddir);
+
+- ide_subprocess_launcher_push_argv (launcher, "meson");
++ ide_subprocess_launcher_push_argv (launcher, "@meson@/bin/meson");
+ ide_subprocess_launcher_push_argv (launcher, "introspect");
+ ide_subprocess_launcher_push_argv (launcher, "--tests");
+
+--- a/src/plugins/phpize/phpize_plugin.py
++++ b/src/plugins/phpize/phpize_plugin.py
+@@ -114,7 +114,7 @@
+ launcher.set_flags(Gio.SubprocessFlags.STDIN_PIPE |
+ Gio.SubprocessFlags.STDOUT_PIPE |
+ Gio.SubprocessFlags.STDERR_PIPE)
+- launcher.push_argv('make')
++ launcher.push_argv('@gnumake@/bin/make')
+ launcher.push_argv('-f')
+ launcher.push_argv('-')
+ launcher.push_argv('print-CFLAGS')
+@@ -224,11 +224,11 @@
+
+ # Build the project using make.
+ build_launcher = pipeline.create_launcher()
+- build_launcher.push_argv('make')
++ build_launcher.push_argv('@gnumake@/bin/make')
+ if config.props.parallelism > 0:
+ build_launcher.push_argv('-j{}'.format(config.props.parallelism))
+ clean_launcher = pipeline.create_launcher()
+- clean_launcher.push_argv('make')
++ clean_launcher.push_argv('@gnumake@/bin/make')
+ clean_launcher.push_argv('clean')
+ build_stage = Ide.BuildStageLauncher.new(context, build_launcher)
+ build_stage.set_clean_launcher(clean_launcher)
+@@ -237,7 +237,7 @@
+
+ # Use "make install" to install the project.
+ install_launcher = pipeline.create_launcher()
+- install_launcher.push_argv('make')
++ install_launcher.push_argv('@gnumake@/bin/make')
+ install_launcher.push_argv('install')
+ install_stage = Ide.BuildStageLauncher.new(context, install_launcher)
+ self.track(pipeline.connect(Ide.BuildPhase.INSTALL, 0, install_stage))
+--- a/src/plugins/vala-pack/ide-vala-index.vala
++++ b/src/plugins/vala-pack/ide-vala-index.vala
+@@ -547,7 +547,7 @@
+ var pkgname = "libvala-%s".printf (Config.VALA_VERSION);
+ string outstr = null;
+ var subprocess = new GLib.Subprocess (GLib.SubprocessFlags.STDOUT_PIPE,
+- "pkg-config",
++ "@pkgconfig@/bin/pkg-config",
+ "--variable=vapidir",
+ pkgname,
+ null); |
@jtojnar thanks, I've added those as a separate commit for now. Gonna give it a test spin now. |
Apparently, it applies to 3.27.3. |
Yeah, I didn't pick that version just yet since that involves bumping other gnome dependencies and just makes this change bigger. The difference in patch is probably trivial. So far I only see this chunk that doesn't apply: --- src/plugins/meson/gbp-meson-pipeline-addin.c
+++ src/plugins/meson/gbp-meson-pipeline-addin.c
@@ -113,7 +113,7 @@
parallel = ide_configuration_get_parallelism (config);
if (NULL == (meson = ide_configuration_getenv (config, "MESON")))
- meson = "meson";
+ meson = "/nix/store/jc8aybbzvvsgkmzqg4m6zypz8r1xb581-meson-0.44.0/bin/meson";
/* Setup our meson configure stage. */ |
Updating to 3.27.3 means updating glib to >=2.55 (also glibmm,…) which means we will trigger a rather large rebuild.. I am currently doing that locally to see what else might need fixes then. |
With an upgraded glib and 3.27.3 we are getting this startup log. I will port your patch to 3.27.2 since upgrading glib to an unstable version seems even less reasonable then downgrading this to the old release.
|
I think it keeping 3.27.2 is the most reasonable solution. i do not really want another glib derivation. The errors are mostly from invalid typelib path. |
We will probably want to submit the patch to GNOME before 3.28 code freeze on March 5. Do you think you will have time to work on it before then? |
Feel free to do that. I am very tight on available time eight now.
…On Feb 24, 2018 11:48 PM, "Jan Tojnar" ***@***.***> wrote:
We will probably want to submit the patch to GNOME before 3.28 code freeze
<https://wiki.gnome.org/Schedule> on March 5. Do you think you will have
time to work on it before then?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#33270 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAm_dGS3smBjZbgSJC3nhtuknJ_RU_nYks5tYJGlgaJpZM4RQCZv>
.
|
|
b46149e
to
a4422c1
Compare
I rebased the PR and updated the packages. #37381 fixed the typelib error, the Python one remains:
|
Has this been abandoned? |
Not fully but my main motivation is gone... If you want to move on from
where I stopped please go ahead.
…On Wed, 16 May 2018, 12:53 Adrian Vovk, ***@***.***> wrote:
Has this been abandoned?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#33270 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAm_dEIL2satBufau9LyDdGcbRAxuwfEks5tzAUMgaJpZM4RQCZv>
.
|
Sysprof requires a NixOS module, so I pushed it to master and rebased this PR. @AdrianVovk If you want to finish this, try asking about the python issue on |
f84c2bf
to
f4b5794
Compare
Thanks for your work on this @jtojnar++. I know those are probably just because other things might need them but it seems like in the long run we might end up with most of the dependencies of Do you have an idea what the major missing parts are? Should we try to make a ToDo-List with things that are missing? |
Not sure what else is missing, but there has been some progress in #44217. |
Motivation for this change
I was tempted to build a GTK application using gnome-builder. This is my current WIP on getting it to run on NixOS.
Current remaining issues:
meta
attribute to the new packagesTypeError: must be an interface
NotImplementedError: <GType void (4)>
typelib
seems to have constructed an invalid path to a shared library during build:WARNING: Failed to load shared library '/nix/store/x30dzq82zv0w4nxg42bd7q60zlmi6jk0-gnome-builder-3.27.2/lib/libide-1.0.so' referenced by the typelib: /nix/store/x30dzq82zv0w4nxg42bd7q60zlmi6jk0-gnome-builder-3.27.2/lib/libide-1.0.so: cannot open shared object file: No such file or directory
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)