Skip to content
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

workbench: init at 43.3 #208866

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions pkgs/development/tools/workbench/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{ stdenv
, lib
, fetchFromGitHub
, meson
, ninja
, pkg-config
, desktop-file-utils
, vte-gtk4
, gtksourceview5
, gjs
, libadwaita
, vala
, blueprint-compiler
, fetchpatch
}:

stdenv.mkDerivation rec {
pname = "workbench";
version = "43.3";

src = fetchFromGitHub {
owner = "sonnyp";
repo = "Workbench";
rev = "v${version}";
hash = "sha256-T/aOOvb3DRu/T0+uFMf3sx46U5LT544NQ45TmEBnkAo=";
fetchSubmodules = true;
};

patches = [
# Do not copy files with source permissions into home directory while
# running Workbench, see https://github.com/sonnyp/Workbench/pull/188
(fetchpatch {
url = "https://github.com/sonnyp/Workbench/commit/c553f932c952057674c3333e4af84044153b76d7.patch";
hash = "sha256-pFj2LvqJE7uGhCYs6GL2a7tj4n2BBoKcPzD1K1JZ3Rs=";
name = "do-not-copy-source-perms.patch";
})
];

postPatch = ''
substituteInPlace src/meson.build --replace "/app/bin/blueprint-compiler" "blueprint-compiler"
substituteInPlace troll/gjspack/bin/gjspack \
--replace "#!/usr/bin/env -S gjs -m" "#!${gjs}/bin/gjs -m"
'';

preFixup = ''
# https://github.com/NixOS/nixpkgs/issues/31168#issuecomment-341793501
sed -e '2iimports.package._findEffectiveEntryPointName = () => "re.sonny.Workbench"' \
-i $out/bin/re.sonny.Workbench
gappsWrapperArgs+=(--prefix PATH : $out/bin)
'';

dontPatchShebangs = true;

nativeBuildInputs = [
blueprint-compiler
desktop-file-utils
meson
ninja
pkg-config
vala
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At minimum, you will want wrapGAppsHook4. And probably whatever libraries are is in GNOME platform to make it more useful.


buildInputs = [
gjs
gtksourceview5
libadwaita
vte-gtk4
];

doCheck = true;

meta = with lib; {
description = "Learn and prototype with GNOME technologies";
homepage = "https://github.com/sonnyp/Workbench";
license = licenses.gpl3Only;
maintainers = with maintainers; [ onny ];
platforms = platforms.unix;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,8 @@ with pkgs;
name = "find-xml-catalogs-hook";
} ../build-support/setup-hooks/find-xml-catalogs.sh;

workbench = callPackage ../development/tools/workbench { };

wrapGAppsHook = callPackage ../build-support/setup-hooks/wrap-gapps-hook {
makeWrapper = makeBinaryWrapper;
};
Expand Down
Loading