From 126f2057521ff0dd32ed8f641300b25cb28f00a3 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 28 Jul 2018 20:48:43 -0700 Subject: [PATCH 01/11] gnome-builder: init at 3.28.4 --- .../editors/gnome-builder/default.nix | 83 +++++++++++++++++++ .../gnome-builder/python-libprefix.patch | 41 +++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 126 insertions(+) create mode 100644 pkgs/applications/editors/gnome-builder/default.nix create mode 100644 pkgs/applications/editors/gnome-builder/python-libprefix.patch diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix new file mode 100644 index 00000000000..a8de170d153 --- /dev/null +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -0,0 +1,83 @@ +{ stdenv, fetchurl, gnome3, gobjectIntrospection, meson, ninja, pkgconfig +, appstream-glib, desktop-file-utils, python3, python3Packages, wrapGAppsHook +, gspell, gtk3, gtksourceview3, json-glib, jsonrpc-glib, libdazzle, libxml2, pcre +, sysprof, template-glib, vala, webkitgtk +}: +let + version = "3.28.4"; + pname = "gnome-builder"; +in stdenv.mkDerivation { + name = "${pname}-${version}"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${pname}-${version}.tar.xz"; + sha256 = "0ibb74jlyrl5f6rj1b74196zfg2qaf870lxgi76qzpkgwq0iya05"; + }; + + buildInputs = [ + python3Packages.wrapPython + wrapGAppsHook + gobjectIntrospection + meson + ninja + pkgconfig + + appstream-glib + desktop-file-utils + + gnome3.devhelp + gnome3.libgit2-glib + gnome3.libpeas + gnome3.vte + gspell + gtk3 + gtksourceview3 + json-glib + jsonrpc-glib + libdazzle + libxml2 + pcre + sysprof + template-glib + vala + webkitgtk + ]; + + prePatch = '' + sed -i 's@/usr/bin/env python3@${python3}/bin/python3@g' build-aux/meson/post_install.py + ''; + + patches = [ + ./python-libprefix.patch + ]; + + mesonFlags = [ + "-Dpython_libprefix=${python3.libPrefix}" + "-Dwith_clang=false" + "-Dwith_flatpak=false" + ]; + + pythonPath = with python3Packages; requiredPythonModules [ pygobject3 ]; + + preFixup = '' + buildPythonPath "$out $pythonPath" + gappsWrapperArgs+=( + --prefix PATH : "$program_PATH" + --prefix PYTHONPATH : "$program_PYTHONPATH" + ) + + # Ensure that all plugins get their interpreter paths fixed up. + find $out/lib -name \*.py -type f -print0 | while read -d "" f; do + chmod a+x "$f" + done + ''; + + passthru.updateScript = gnome3.updateScript { packageName = pname; }; + + meta = with stdenv.lib; { + description = "An IDE for writing GNOME-based software"; + homepage = https://wiki.gnome.org/Apps/Builder; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/editors/gnome-builder/python-libprefix.patch b/pkgs/applications/editors/gnome-builder/python-libprefix.patch new file mode 100644 index 00000000000..744960c08c7 --- /dev/null +++ b/pkgs/applications/editors/gnome-builder/python-libprefix.patch @@ -0,0 +1,41 @@ +--- 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, + ) + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 42d38772772..714acf247d6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2717,6 +2717,8 @@ with pkgs; inherit (gnome2) gnome_python gnome_python_desktop; }; + gnome-builder = callPackage ../applications/editors/gnome-builder { }; + gnokii = callPackage ../tools/misc/gnokii { }; gnuapl = callPackage ../development/interpreters/gnu-apl { }; From 7bd3ca49bcd56fe8f8ac6e4fbbb81769d5ad835f Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Mon, 30 Jul 2018 15:04:31 -0700 Subject: [PATCH 02/11] gnome-builder: address review from @jtojnar/#44217 --- .../editors/gnome-builder/default.nix | 19 ++++++++++++------- .../editors/gnome-builder/flatpak-deps.patch | 12 ++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 pkgs/applications/editors/gnome-builder/flatpak-deps.patch diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix index a8de170d153..07e1925173a 100644 --- a/pkgs/applications/editors/gnome-builder/default.nix +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, gnome3, gobjectIntrospection, meson, ninja, pkgconfig , appstream-glib, desktop-file-utils, python3, python3Packages, wrapGAppsHook -, gspell, gtk3, gtksourceview3, json-glib, jsonrpc-glib, libdazzle, libxml2, pcre -, sysprof, template-glib, vala, webkitgtk +, flatpak, gspell, gtk3, gtksourceview3, json-glib, jsonrpc-glib, libdazzle +, libxml2, ostree, pcre , sysprof, template-glib, vala, webkitgtk }: let version = "3.28.4"; @@ -14,7 +14,7 @@ in stdenv.mkDerivation { sha256 = "0ibb74jlyrl5f6rj1b74196zfg2qaf870lxgi76qzpkgwq0iya05"; }; - buildInputs = [ + nativeBuildInputs = [ python3Packages.wrapPython wrapGAppsHook gobjectIntrospection @@ -24,7 +24,10 @@ in stdenv.mkDerivation { appstream-glib desktop-file-utils + ]; + buildInputs = [ + flatpak gnome3.devhelp gnome3.libgit2-glib gnome3.libpeas @@ -36,7 +39,9 @@ in stdenv.mkDerivation { jsonrpc-glib libdazzle libxml2 + ostree pcre + python3 sysprof template-glib vala @@ -44,17 +49,17 @@ in stdenv.mkDerivation { ]; prePatch = '' - sed -i 's@/usr/bin/env python3@${python3}/bin/python3@g' build-aux/meson/post_install.py + patchShebangs build-aux/meson/post_install.py ''; patches = [ ./python-libprefix.patch + ./flatpak-deps.patch ]; mesonFlags = [ "-Dpython_libprefix=${python3.libPrefix}" "-Dwith_clang=false" - "-Dwith_flatpak=false" ]; pythonPath = with python3Packages; requiredPythonModules [ pygobject3 ]; @@ -62,7 +67,6 @@ in stdenv.mkDerivation { preFixup = '' buildPythonPath "$out $pythonPath" gappsWrapperArgs+=( - --prefix PATH : "$program_PATH" --prefix PYTHONPATH : "$program_PYTHONPATH" ) @@ -77,7 +81,8 @@ in stdenv.mkDerivation { meta = with stdenv.lib; { description = "An IDE for writing GNOME-based software"; homepage = https://wiki.gnome.org/Apps/Builder; - license = licenses.gpl3; + license = licenses.gpl3Plus; + maintainers = gnome3.maintainers; platforms = platforms.linux; }; } diff --git a/pkgs/applications/editors/gnome-builder/flatpak-deps.patch b/pkgs/applications/editors/gnome-builder/flatpak-deps.patch new file mode 100644 index 00000000000..c773fda378e --- /dev/null +++ b/pkgs/applications/editors/gnome-builder/flatpak-deps.patch @@ -0,0 +1,12 @@ +diff --git a/src/plugins/flatpak/meson.build b/src/plugins/flatpak/meson.build +index 657f7939b..28982bb74 100644 +--- a/src/plugins/flatpak/meson.build ++++ b/src/plugins/flatpak/meson.build +@@ -52,6 +52,7 @@ flatpak_sources = [ + + gnome_builder_plugins_deps += [ + dependency('flatpak', version: '>= 0.8.0'), ++ dependency('ostree-1'), + dependency('libsoup-2.4', version: '>= 2.52.0'), + libgit_dep, + ] From 6ae9723cfb130a7132dc34507d7db31af99d714e Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Mon, 30 Jul 2018 17:34:30 -0700 Subject: [PATCH 03/11] 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, - ) - From e32a5dafafb9bbd176264325f1afc034e97e519d Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Mon, 30 Jul 2018 21:43:12 -0700 Subject: [PATCH 04/11] gnome-builder: include developer docs in $out --- pkgs/applications/editors/gnome-builder/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix index d8bd4565f44..0a7bc42bd4b 100644 --- a/pkgs/applications/editors/gnome-builder/default.nix +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -73,6 +73,8 @@ in stdenv.mkDerivation { webkitgtk ]; + outputDevdoc = "out"; + prePatch = '' patchShebangs build-aux/meson/post_install.py ''; From 3a64f5790e9ac26cc665ea096c3a1d9bc16e8958 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Mon, 30 Jul 2018 23:05:11 -0700 Subject: [PATCH 05/11] gnome-builder: ensure gtkdoc can find docbook DTDs --- pkgs/applications/editors/gnome-builder/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix index 0a7bc42bd4b..3ed47c14e74 100644 --- a/pkgs/applications/editors/gnome-builder/default.nix +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -1,8 +1,10 @@ { stdenv , desktop-file-utils , docbook_xsl +, docbook_xml_dtd_43 , fetchurl , flatpak +, glibcLocales , gnome3 , gobjectIntrospection , gspell @@ -41,6 +43,8 @@ in stdenv.mkDerivation { #appstream-glib # tests fail if these tools are available desktop-file-utils docbook_xsl + docbook_xml_dtd_43 + glibcLocales # for Meson's gtkdochelper gobjectIntrospection gtk-doc hicolor-icon-theme @@ -91,6 +95,10 @@ in stdenv.mkDerivation { "-Dwith_docs=true" ]; + preInstall = '' + export LC_ALL="en_US.utf-8" + ''; + pythonPath = with python3.pkgs; requiredPythonModules [ pygobject3 ]; preFixup = '' From 63445d01209cf8fe05736e865fb34ad7cddf2cf3 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Tue, 31 Jul 2018 17:03:08 -0700 Subject: [PATCH 06/11] gnome-builder: use fetchpatch for upstream patches These patches were merged to master so we can fetch them from the GNOME GitLab instance now. --- .../editors/gnome-builder/default.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix index 3ed47c14e74..4adcc3b3dfe 100644 --- a/pkgs/applications/editors/gnome-builder/default.nix +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -2,6 +2,7 @@ , desktop-file-utils , docbook_xsl , docbook_xml_dtd_43 +, fetchpatch , fetchurl , flatpak , glibcLocales @@ -84,9 +85,21 @@ in stdenv.mkDerivation { ''; patches = [ - ./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 + (fetchpatch { + name = "absolute-shared-library-path.patch"; + url = "https://gitlab.gnome.org/GNOME/gnome-builder/commit/1011cabc519fd7322e2d695c79bfce3e18ff6200.patch"; + sha256 = "1g12zziidzrphp527aa8sklfaln4qpjprkz73f0c9w5ph6k252fw"; + }) + (fetchpatch { + name = "python-libprefix.patch"; + url = "https://gitlab.gnome.org/GNOME/gnome-builder/commit/43494ce83a347f369ed4cfb8dd71d3b93452736b.patch"; + sha256 = "0kgi3n3g13n1j4xa61ln9xiahcfdc43bxi5mw4yva2d5px445msf"; + }) + (fetchpatch { + name = "ostree-dependency.patch"; + url = "https://gitlab.gnome.org/GNOME/gnome-builder/commit/8b11773b65c95f464a0de16b91318c1ca73deeae.patch"; + sha256 = "18r4hd90id0w6r0lzqpw83bcj45nm9jhr46a0ffi1mcayb18mgbk"; + }) ]; mesonFlags = [ From e0180052a7403e385b4307386bbed1bcbaf3afec Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Tue, 31 Jul 2018 17:04:03 -0700 Subject: [PATCH 07/11] gnome-builder: split devdoc to a separate output --- pkgs/applications/editors/gnome-builder/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix index 4adcc3b3dfe..2203fb0d699 100644 --- a/pkgs/applications/editors/gnome-builder/default.nix +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -78,7 +78,7 @@ in stdenv.mkDerivation { webkitgtk ]; - outputDevdoc = "out"; + outputs = [ "out" "devdoc" ]; prePatch = '' patchShebangs build-aux/meson/post_install.py From 4ab66373f0727353b05f81f12a189a82c9ebf3a5 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Tue, 31 Jul 2018 21:50:52 -0700 Subject: [PATCH 08/11] gnome-builder: remove no-longer-used patches Whoops! --- ...ibide-s-install_dir-an-absolute-path.patch | 29 -------- ...gers-to-specify-the-Python-libprefix.patch | 70 ------------------- ...stree-1-dependency-to-flatpak-plugin.patch | 24 ------- 3 files changed, 123 deletions(-) delete mode 100644 pkgs/applications/editors/gnome-builder/0001-Make-libide-s-install_dir-an-absolute-path.patch delete mode 100644 pkgs/applications/editors/gnome-builder/0002-Allow-packagers-to-specify-the-Python-libprefix.patch delete mode 100644 pkgs/applications/editors/gnome-builder/0003-Add-missing-ostree-1-dependency-to-flatpak-plugin.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 deleted file mode 100644 index 96192416c5a..00000000000 --- a/pkgs/applications/editors/gnome-builder/0001-Make-libide-s-install_dir-an-absolute-path.patch +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100644 index f0414de873f..00000000000 --- a/pkgs/applications/editors/gnome-builder/0002-Allow-packagers-to-specify-the-Python-libprefix.patch +++ /dev/null @@ -1,70 +0,0 @@ -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/0003-Add-missing-ostree-1-dependency-to-flatpak-plugin.patch b/pkgs/applications/editors/gnome-builder/0003-Add-missing-ostree-1-dependency-to-flatpak-plugin.patch deleted file mode 100644 index 05f3e674345..00000000000 --- a/pkgs/applications/editors/gnome-builder/0003-Add-missing-ostree-1-dependency-to-flatpak-plugin.patch +++ /dev/null @@ -1,24 +0,0 @@ -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 -+++ b/src/plugins/flatpak/meson.build -@@ -52,6 +52,7 @@ flatpak_sources = [ - - gnome_builder_plugins_deps += [ - dependency('flatpak', version: '>= 0.8.0'), -+ dependency('ostree-1'), - dependency('libsoup-2.4', version: '>= 2.52.0'), - libgit_dep, - ] --- -2.16.4 - From 499ca65930019842bbc5241ef01174760fb1cd05 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Tue, 31 Jul 2018 21:51:11 -0700 Subject: [PATCH 09/11] gnome-builder: document why tests and clang are disabled --- pkgs/applications/editors/gnome-builder/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix index 2203fb0d699..c0031312d83 100644 --- a/pkgs/applications/editors/gnome-builder/default.nix +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -104,10 +104,17 @@ in stdenv.mkDerivation { mesonFlags = [ "-Dpython_libprefix=${python3.libPrefix}" - "-Dwith_clang=false" "-Dwith_docs=true" + + # Making the build system correctly detect clang header and library paths + # is difficult. Somebody should look into fixing this. + "-Dwith_clang=false" ]; + # Some tests fail due to being unable to find the Vte typelib, and I don't + # understand why. Somebody should look into fixing this. + doCheck = false; + preInstall = '' export LC_ALL="en_US.utf-8" ''; @@ -126,8 +133,6 @@ in stdenv.mkDerivation { done ''; - #doCheck = true; - passthru.updateScript = gnome3.updateScript { packageName = pname; }; meta = with stdenv.lib; { From e6bcb54539a13cfb7a0558f5f68e833e30290295 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Tue, 31 Jul 2018 22:46:47 -0700 Subject: [PATCH 10/11] gnome-builder: add a long description Including a comment about the need for additional runtime dependencies. --- pkgs/applications/editors/gnome-builder/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix index c0031312d83..1008b83a1f4 100644 --- a/pkgs/applications/editors/gnome-builder/default.nix +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -137,6 +137,16 @@ in stdenv.mkDerivation { meta = with stdenv.lib; { description = "An IDE for writing GNOME-based software"; + longDescription = '' + Global search, auto-completion, source code map, documentation + reference, and other features expected in an IDE, but with a focus + on streamlining GNOME-based development projects. + + This package does not pull in the dependencies needed for every + plugin. If you find that a plugin you wish to use doesn't work, we + currently recommend running gnome-builder inside a nix-shell with + appropriate dependencies loaded. + ''; homepage = https://wiki.gnome.org/Apps/Builder; license = licenses.gpl3Plus; maintainers = gnome3.maintainers; From f2434d12085543255c52fdb4e9ecdc9ed1be511a Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Wed, 1 Aug 2018 13:12:54 -0700 Subject: [PATCH 11/11] gnome-builder: fix whitespace --- pkgs/applications/editors/gnome-builder/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix index 1008b83a1f4..db2d07db31e 100644 --- a/pkgs/applications/editors/gnome-builder/default.nix +++ b/pkgs/applications/editors/gnome-builder/default.nix @@ -151,5 +151,5 @@ in stdenv.mkDerivation { license = licenses.gpl3Plus; maintainers = gnome3.maintainers; platforms = platforms.linux; - }; + }; }