From 6ae9723cfb130a7132dc34507d7db31af99d714e Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Mon, 30 Jul 2018 17:34:30 -0700 Subject: [PATCH] gnome-builder: enable docs, fix typos. I also tried turning on the tests, but they don't work and I don't understand why not. --- ...ibide-s-install_dir-an-absolute-path.patch | 29 ++++++++ ...gers-to-specify-the-Python-libprefix.patch | 70 +++++++++++++++++++ ...tree-1-dependency-to-flatpak-plugin.patch} | 12 ++++ .../editors/gnome-builder/default.nix | 53 ++++++++++---- .../gnome-builder/python-libprefix.patch | 41 ----------- 5 files changed, 152 insertions(+), 53 deletions(-) create mode 100644 pkgs/applications/editors/gnome-builder/0001-Make-libide-s-install_dir-an-absolute-path.patch create mode 100644 pkgs/applications/editors/gnome-builder/0002-Allow-packagers-to-specify-the-Python-libprefix.patch rename pkgs/applications/editors/gnome-builder/{flatpak-deps.patch => 0003-Add-missing-ostree-1-dependency-to-flatpak-plugin.patch} (56%) delete mode 100644 pkgs/applications/editors/gnome-builder/python-libprefix.patch diff --git a/pkgs/applications/editors/gnome-builder/0001-Make-libide-s-install_dir-an-absolute-path.patch b/pkgs/applications/editors/gnome-builder/0001-Make-libide-s-install_dir-an-absolute-path.patch new file mode 100644 index 00000000000..96192416c5a --- /dev/null +++ b/pkgs/applications/editors/gnome-builder/0001-Make-libide-s-install_dir-an-absolute-path.patch @@ -0,0 +1,29 @@ +From 6d2edb1635465dc226bc7e05fd33c9ee456e2430 Mon Sep 17 00:00:00 2001 +From: Jamey Sharp +Date: Mon, 30 Jul 2018 13:26:28 -0700 +Subject: [PATCH 1/3] Make libide's install_dir an absolute path. + +As far as I know, this change should be a no-op on all systems where +Builder works today. However, it is necessary for getting the correct +shared-library path into generated .gir and typelib files when building +on Nix, so I'm hoping this is an acceptable change for upstream. +--- + src/libide/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libide/meson.build b/src/libide/meson.build +index e0643eda4..e27e0e43a 100644 +--- a/src/libide/meson.build ++++ b/src/libide/meson.build +@@ -229,7 +229,7 @@ libide = shared_library('ide-' + libide_api_version, + dependencies: libide_deps, + c_args: libide_args, + install: true, +- install_dir: pkglibdir, ++ install_dir: pkglibdir_abs, + install_rpath: pkglibdir_abs, + ) + +-- +2.16.4 + diff --git a/pkgs/applications/editors/gnome-builder/0002-Allow-packagers-to-specify-the-Python-libprefix.patch b/pkgs/applications/editors/gnome-builder/0002-Allow-packagers-to-specify-the-Python-libprefix.patch new file mode 100644 index 00000000000..f0414de873f --- /dev/null +++ b/pkgs/applications/editors/gnome-builder/0002-Allow-packagers-to-specify-the-Python-libprefix.patch @@ -0,0 +1,70 @@ +From 4c5d544772920c774e99388ca4e8457f0c0a4ba4 Mon Sep 17 00:00:00 2001 +From: Jamey Sharp +Date: Mon, 30 Jul 2018 13:30:15 -0700 +Subject: [PATCH 2/3] Allow packagers to specify the Python libprefix. + +When packaging for Nix, the directory that pygobject finds its overrides +in is not writable. It'll usually look something like this, and can only +contain files built by the pygobject package itself: + +/nix/store/58qam3zgdcvvsz4g081pp98kg9i5v7rb-python3.6-pygobject-3.26.1/lib/python3.6/site-packages/gi/overrides + +This makes Builder's pygobject_override_dir heuristic fail, because +Builder's libdir is not a prefix of pygobject's libdir. + +Fortunately, what Builder actually needs is for its overrides to be on +the Python import path when it runs, and that's easier to arrange. We +just need to be sure that Ide.py gets installed to + +/python/site-packages/gi/overrides + +So this patch allows packagers to optionally specify the +"python" portion of the path, and just constructs the rest of +the path using Builder's libdir. + +The existing auto-detection code is still used unless the +-Dpython_libprefix option is explicitly specified to override it. +--- + meson_options.txt | 2 ++ + src/libide/meson.build | 5 +++++ + 2 files changed, 7 insertions(+) + +diff --git a/meson_options.txt b/meson_options.txt +index 1ee96f23e..ca94bcd62 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -19,6 +19,8 @@ option('with_docs', type: 'boolean', value: false) + + option('ctags_path', type: 'string', value: '') + ++option('python_libprefix', type: 'string') ++ + # Plugins + # Ideally we want many of these to be defined in the plugin dir: + # https://github.com/mesonbuild/meson/issues/707 +diff --git a/src/libide/meson.build b/src/libide/meson.build +index e27e0e43a..b245c855a 100644 +--- a/src/libide/meson.build ++++ b/src/libide/meson.build +@@ -164,6 +164,10 @@ if get_option('with_editorconfig') + endif + + # We want to find the subdirectory to install our override into: ++python_libprefix = get_option('python_libprefix') ++if python_libprefix != '' ++ pygobject_override_dir = join_paths(get_option('libdir'), python_libprefix, 'site-packages', 'gi', 'overrides') ++else + python3 = find_program('python3') + + get_overridedir = ''' +@@ -193,6 +197,7 @@ if ret.returncode() != 0 + else + pygobject_override_dir = join_paths(get_option('libdir'), ret.stdout().strip()) + endif ++endif + + install_data('Ide.py', install_dir: pygobject_override_dir) + +-- +2.16.4 + diff --git a/pkgs/applications/editors/gnome-builder/flatpak-deps.patch b/pkgs/applications/editors/gnome-builder/0003-Add-missing-ostree-1-dependency-to-flatpak-plugin.patch similarity index 56% rename from pkgs/applications/editors/gnome-builder/flatpak-deps.patch rename to pkgs/applications/editors/gnome-builder/0003-Add-missing-ostree-1-dependency-to-flatpak-plugin.patch index c773fda378e..05f3e674345 100644 --- a/pkgs/applications/editors/gnome-builder/flatpak-deps.patch +++ b/pkgs/applications/editors/gnome-builder/0003-Add-missing-ostree-1-dependency-to-flatpak-plugin.patch @@ -1,3 +1,12 @@ +From 8d4d251bb613feb2c4aad3d9aef77d9691c0a882 Mon Sep 17 00:00:00 2001 +From: Jamey Sharp +Date: Mon, 30 Jul 2018 15:22:30 -0700 +Subject: [PATCH 3/3] Add missing ostree-1 dependency to flatpak plugin + +--- + src/plugins/flatpak/meson.build | 1 + + 1 file changed, 1 insertion(+) + diff --git a/src/plugins/flatpak/meson.build b/src/plugins/flatpak/meson.build index 657f7939b..28982bb74 100644 --- a/src/plugins/flatpak/meson.build @@ -10,3 +19,6 @@ index 657f7939b..28982bb74 100644 dependency('libsoup-2.4', version: '>= 2.52.0'), libgit_dep, ] +-- +2.16.4 + diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix index 07e1925173a..d8bd4565f44 100644 --- a/pkgs/applications/editors/gnome-builder/default.nix +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -1,7 +1,30 @@ -{ stdenv, fetchurl, gnome3, gobjectIntrospection, meson, ninja, pkgconfig -, appstream-glib, desktop-file-utils, python3, python3Packages, wrapGAppsHook -, flatpak, gspell, gtk3, gtksourceview3, json-glib, jsonrpc-glib, libdazzle -, libxml2, ostree, pcre , sysprof, template-glib, vala, webkitgtk +{ stdenv +, desktop-file-utils +, docbook_xsl +, fetchurl +, flatpak +, gnome3 +, gobjectIntrospection +, gspell +, gtk-doc +, gtk3 +, gtksourceview3 +, hicolor-icon-theme +, json-glib +, jsonrpc-glib +, libdazzle +, libxml2 +, meson +, ninja +, ostree +, pcre +, pkgconfig +, python3 +, sysprof +, template-glib +, vala +, webkitgtk +, wrapGAppsHook }: let version = "3.28.4"; @@ -15,15 +38,17 @@ in stdenv.mkDerivation { }; nativeBuildInputs = [ - python3Packages.wrapPython - wrapGAppsHook + #appstream-glib # tests fail if these tools are available + desktop-file-utils + docbook_xsl gobjectIntrospection + gtk-doc + hicolor-icon-theme meson ninja pkgconfig - - appstream-glib - desktop-file-utils + python3.pkgs.wrapPython + wrapGAppsHook ]; buildInputs = [ @@ -53,16 +78,18 @@ in stdenv.mkDerivation { ''; patches = [ - ./python-libprefix.patch - ./flatpak-deps.patch + ./0001-Make-libide-s-install_dir-an-absolute-path.patch + ./0002-Allow-packagers-to-specify-the-Python-libprefix.patch + ./0003-Add-missing-ostree-1-dependency-to-flatpak-plugin.patch ]; mesonFlags = [ "-Dpython_libprefix=${python3.libPrefix}" "-Dwith_clang=false" + "-Dwith_docs=true" ]; - pythonPath = with python3Packages; requiredPythonModules [ pygobject3 ]; + pythonPath = with python3.pkgs; requiredPythonModules [ pygobject3 ]; preFixup = '' buildPythonPath "$out $pythonPath" @@ -76,6 +103,8 @@ in stdenv.mkDerivation { done ''; + #doCheck = true; + passthru.updateScript = gnome3.updateScript { packageName = pname; }; meta = with stdenv.lib; { diff --git a/pkgs/applications/editors/gnome-builder/python-libprefix.patch b/pkgs/applications/editors/gnome-builder/python-libprefix.patch deleted file mode 100644 index 744960c08c7..00000000000 --- a/pkgs/applications/editors/gnome-builder/python-libprefix.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- gnome-builder-3.28.4/meson_options.txt.orig 2018-07-29 15:36:03.605081188 -0700 -+++ gnome-builder-3.28.4/meson_options.txt 2018-07-29 15:36:19.877608836 -0700 -@@ -15,6 +15,8 @@ - option('with_help', type: 'boolean') - option('with_docs', type: 'boolean', value: false) - -+option('python_libprefix', type: 'string') -+ - # Plugins - # Ideally we want many of these to be defined in the plugin dir: - # https://github.com/mesonbuild/meson/issues/707 ---- gnome-builder-3.28.4/src/libide/meson.build.orig 2018-07-29 15:36:03.605081188 -0700 -+++ gnome-builder-3.28.4/src/libide/meson.build 2018-07-29 15:36:43.237365710 -0700 -@@ -161,6 +161,10 @@ - endif - - # We want to find the subdirectory to install our override into: -+python_libprefix = get_option('python_libprefix') -+if python_libprefix != '' -+ pygobject_override_dir = join_paths(get_option('libdir'), python_libprefix, 'site_packages', 'gi', 'overrides') -+else - python3 = find_program('python3') - - get_overridedir = ''' -@@ -190,6 +194,7 @@ - else - pygobject_override_dir = join_paths(get_option('libdir'), ret.stdout().strip()) - endif -+endif - - install_data('Ide.py', install_dir: pygobject_override_dir) - -@@ -222,7 +227,7 @@ - dependencies: libide_deps, - c_args: libide_args, - install: true, -- install_dir: pkglibdir, -+ install_dir: pkglibdir_abs, - install_rpath: pkglibdir_abs, - ) -