nixpkgs/pkgs/by-name/ta/tangram/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

92 lines
1.9 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, appstream-glib
, desktop-file-utils
, gdk-pixbuf
, gettext
, gjs
, glib
, glib-networking
, gobject-introspection
, gsettings-desktop-schemas
, gtk4
, libadwaita
, gst_all_1
, hicolor-icon-theme
, meson
, ninja
, pkg-config
, python3
, webkitgtk_6_0
, blueprint-compiler
, wrapGAppsHook4
}:
stdenv.mkDerivation rec {
pname = "tangram";
version = "3.1";
src = fetchFromGitHub {
owner = "sonnyp";
repo = "Tangram";
rev = "v${version}";
hash = "sha256-vN9zRc8Ac9SI0lIcuf01A2WLqLGtV3DUiNzCSmc2ri4=";
fetchSubmodules = true;
};
nativeBuildInputs = [
appstream-glib
desktop-file-utils
gettext
gobject-introspection
hicolor-icon-theme
meson
ninja
pkg-config
python3
blueprint-compiler
wrapGAppsHook4
];
buildInputs = [
gdk-pixbuf
gjs
glib
glib-networking
gsettings-desktop-schemas
gtk4
libadwaita
webkitgtk_6_0
] ++ (with gst_all_1; [
gstreamer
gst-libav
gst-plugins-base
(gst-plugins-good.override { gtkSupport = true; })
gst-plugins-bad
]);
dontPatchShebangs = true;
postPatch = ''
substituteInPlace src/meson.build --replace "/app/bin/blueprint-compiler" "blueprint-compiler"
substituteInPlace src/bin.js troll/gjspack/bin/gjspack \
--replace "#!/usr/bin/env -S gjs -m" "#!${gjs}/bin/gjs -m"
'';
# https://github.com/NixOS/nixpkgs/issues/31168#issuecomment-341793501
preFixup = ''
sed -e '2iimports.package._findEffectiveEntryPointName = () => "re.sonny.Tangram"' \
-i $out/bin/re.sonny.Tangram
'';
meta = with lib; {
description = "Run web apps on your desktop";
mainProgram = "re.sonny.Tangram";
homepage = "https://github.com/sonnyp/Tangram";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = with maintainers; [ austinbutler chuangzhu ];
};
}