From 94dfe0d693532b6470720399454129b378bfab7a Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 6 Apr 2025 16:39:19 +0200 Subject: [PATCH] ignition: init at 1.1.3 --- pkgs/by-name/ig/ignition/fix-gjs.patch | 26 ++++++++++ pkgs/by-name/ig/ignition/package.nix | 66 ++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 pkgs/by-name/ig/ignition/fix-gjs.patch create mode 100644 pkgs/by-name/ig/ignition/package.nix diff --git a/pkgs/by-name/ig/ignition/fix-gjs.patch b/pkgs/by-name/ig/ignition/fix-gjs.patch new file mode 100644 index 000000000000..312042bb5b1c --- /dev/null +++ b/pkgs/by-name/ig/ignition/fix-gjs.patch @@ -0,0 +1,26 @@ +diff --git a/src/io.github.flattool.Ignition.in b/src/io.github.flattool.Ignition.in +index 5c71c3c..0b2ec00 100644 +--- a/src/io.github.flattool.Ignition.in ++++ b/src/io.github.flattool.Ignition.in +@@ -1,7 +1,8 @@ +-#!@GJS@ -m ++#!/usr/bin/env gjs -m + + import { exit, programArgs, programInvocationName } from "system"; + ++imports.package._findEffectiveEntryPointName = () => 'io.github.flattool.Ignition'; + imports.package.init({ + name: "@PACKAGE_NAME@", + version: "@PACKAGE_VERSION@", +diff --git a/src/meson.build b/src/meson.build +index 488fa06..751f8ed 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -23,7 +23,6 @@ data_res = gnome.compile_resources('io.github.flattool.Ignition.data', + ) + + bin_conf = configuration_data() +-bin_conf.set('GJS', find_program('gjs').full_path()) + bin_conf.set('PACKAGE_VERSION', meson.project_version()) + bin_conf.set('PACKAGE_NAME', meson.project_name()) + bin_conf.set('prefix', get_option('prefix')) diff --git a/pkgs/by-name/ig/ignition/package.nix b/pkgs/by-name/ig/ignition/package.nix new file mode 100644 index 000000000000..3d934752cce4 --- /dev/null +++ b/pkgs/by-name/ig/ignition/package.nix @@ -0,0 +1,66 @@ +{ + lib, + stdenv, + fetchFromGitHub, + + appstream, + blueprint-compiler, + desktop-file-utils, + gettext, + meson, + ninja, + pkg-config, + wrapGAppsHook4, + + gjs, + gtk4, + libadwaita, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "ignition"; + version = "1.1.3"; + + src = fetchFromGitHub { + owner = "flattool"; + repo = "ignition"; + tag = finalAttrs.version; + hash = "sha256-XVBlwonMHb78XF6mpPYLJ68E5Tb+dFVFqNSsVCCS0xc="; + }; + + patches = [ + # Don't use find_program for detecting gjs. (we don't want to use the build-platform's gjs binary) + # We instead rely on the fact that fixupPhase uses patchShebangs on the script. + # Also, we manually set the effective entrypoint to make gjs properly find our binary. + ./fix-gjs.patch + ]; + + strictDeps = true; + + nativeBuildInputs = [ + appstream + blueprint-compiler + desktop-file-utils + gettext + gtk4 + meson + ninja + pkg-config + wrapGAppsHook4 + ]; + + buildInputs = [ + gjs + gtk4 + libadwaita + ]; + + meta = { + description = "Manage startup apps and scripts"; + homepage = "https://github.com/flattool/ignition"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ tomasajt ]; + mainProgram = "io.github.flattool.Ignition"; + platforms = lib.platforms.linux; + }; +})