unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Apply patch to read-only file
@ 2021-09-16  7:49 phodina via
  2021-09-25 12:08 ` Guillaume Le Vaillant
  0 siblings, 1 reply; 6+ messages in thread
From: phodina via @ 2021-09-16  7:49 UTC (permalink / raw)
  To: help-guix

Hi,

I'm attempting to package realmd program. However, there seems to be an issue as it does not support GuixSD. Therefore I created a patch.

When I specify the patch the hunk fails as the configure.ac file is read-only.
I tried to use snippets but they seem to be applied after the patch therefore don't work.

Is there a way how to patch a read-only files? I got the idea from this thread [1]. Below is the package definition and patch.

[1] https://lists.gnu.org/archive/html/help-guix/2020-01/msg00063.html

realmd.scm
-------------------------------------------------------------------------------------
(define-module (realmd)
#:use-module (guix packages)
#:use-module (gnu packages)
#:use-module (gnu packages image)
#:use-module (gnu packages glib)
#:use-module (gnu packages autotools)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages polkit)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module ((guix licenses) #:prefix license:))

(define-public realmd
(package
(name "realmd")
(version "0.17.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/freedesktop/realmd")
(commit version)))
(file-name (git-file-name name version))
(modules '((guix build utils)))
(snippet
'(begin
(delete-file "configure.ac")
;(make-file-writable "configure.ac")
#t))
(patches '("realmd-guixsd-support.patch"))
(sha256
(base32
"1c6q2a86kk2f1akzc36nh52hfwsmmc0mbp6ayyjxj4zsyk9zx5bf"))))
(build-system gnu-build-system)
(native-inputs `(("pkg-config" ,pkg-config)
("autoconf" ,autoconf)
("intltool" ,intltool)
("automake" ,automake)))
(inputs `(("glib" ,glib)
("polkit" ,polkit)))
(synopsis "DBus service for configuring kerberos and other online identities")
(description "Dbus system service that manages discovery and enrollment
in realms/domains like Active Directory or IPA.")
(home-page "https://www.freedesktop.org/software/realmd/")
(license license:lgpl2.1)))
------------------------------------------------------------------------------
realmd-guixsd-support.patch ([PATCH] Add GuixSD support)
-------------------------------------------------------------------------------

diff --git a/configure.ac b/configure.ac
index 4dac5a9..9e818d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,7 @@ if test -z $DISTRO; then
AC_CHECK_FILE(/etc/redhat-release, [DISTRO="redhat"])
AC_CHECK_FILE(/etc/debian_version, [DISTRO="debian"])
AC_CHECK_FILE(/etc/SuSE-release, [DISTRO="suse"])
+ AC_CHECK_FILE(/gnu/store, [DISTRO="guixsd"])

# Not customized for these yet
dnl AC_CHECK_FILE(/etc/gentoo-release, [DISTRO="gentoo"])
@@ -103,51 +104,6 @@ PKG_CHECK_MODULES(POLKIT, polkit-gobject-1)
AC_SUBST(POLKIT_CFLAGS)
AC_SUBST(POLKIT_LIBS)

-# --------------------------------------------------------------------
-# systemd
-
-AC_MSG_CHECKING([systemd unit directory])
-AC_ARG_WITH(systemd-unit-dir,
- AS_HELP_STRING([--with-systemd-unit-dir],
- [Directory to install systemd service file]))
-
-if test "$with_systemd_unit_dir" = "" -o "$with_systemd_unit_dir" = "yes"; then
- with_systemd_unit_dir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
- if test "$with_systemd_unit_dir" = ""; then
- AC_MSG_ERROR(["Couldn't find systemd system unit directory"])
- fi
-
-elif test "$with_systemd_unit_dir" = "no"; then
- with_systemd_unit_dir=""
-
-fi
-
-SYSTEMD_UNIT_DIR="$with_systemd_unit_dir"
-AC_SUBST(SYSTEMD_UNIT_DIR)
-AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemd_unit_dir"])
-
-dbus_systemd_service=""
-if test -n "$with_systemd_unit_dir"; then
- dbus_systemd_service="SystemdService=realmd.service"
-fi
-AC_SUBST(dbus_systemd_service)
-
-AC_MSG_RESULT($with_systemd_unit_dir)
-
-AC_ARG_WITH(systemd-journal,
- AS_HELP_STRING([--with-systemd-journal],
- [Use systemd's journal for logging]))
-
-if test "$with_systemd_journal" != "no"; then
- AC_DEFINE_UNQUOTED(WITH_JOURNAL, 1, [Use systemd's journal])
- PKG_CHECK_MODULES(SYSTEMD_JOURNAL, [libsystemd],,
- [PKG_CHECK_MODULES(SYSTEMD_JOURNAL, [libsystemd-journal])])
- with_systemd_journal="yes"
-fi
-
-AC_SUBST(SYSTEMD_JOURNAL_CFLAGS)
-AC_SUBST(SYSTEMD_JOURNAL_LIBS)
-
# -------------------------------------------------------------------
# resolv

diff --git a/service/realmd-guixsd.conf b/service/realmd-guixsd.conf
new file mode 100644
index 0000000..ac4b436
--- /dev/null
+++ b/service/realmd-guixsd.conf
@@ -0,0 +1,42 @@
+# Default values for realmd
+[service]
+debug = no
+automatic-install = yes
+
+[paths]
+net = /usr/bin/net
+winbindd = /usr/sbin/winbindd
+smb.conf = /etc/smb.conf
+sssd.conf = /etc/sssd/sssd.conf
+adcli = /usr/sbin/adcli
+ipa-client-install = /usr/sbin/ipa-client-install
+pam_winbind.conf = /etc/security/pam_winbind.conf
+krb5.conf = /etc/krb5.conf
+
+[active-directory]
+default-client = sssd
+os-name =
+os-version =
+
+[providers]
+sssd = yes
+samba = yes
+example = no
+
+[samba-packages]
+
+[winbind-packages]
+
+[sssd-packages]
+
+[adcli-packages]
+
+[commands]
+
+[users]
+default-shell = /bin/bash
+default-home = /home/%U@%D
+
+[example.com]
+example-administrator = Administrator
+example-password = bureaucracy
--
2.32.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* Re: Apply patch to read-only file
@ 2021-09-28  4:47 Sarah Morgensen
  0 siblings, 0 replies; 6+ messages in thread
From: Sarah Morgensen @ 2021-09-28  4:47 UTC (permalink / raw)
  To: phodina; +Cc: help-guix

Hello Petr,

phodina <phodina@protonmail.com> writes:

> Hi Guillaume,
>
> Sure, here's the formatted file. My appology for the issue with the mail client.
>
> --8<---------------cut here---------------start------------->8---
>
> (define-module (realmd)
>   #:use-module (guix packages)
>   #:use-module (gnu packages)
>   #:use-module (gnu packages image)
>   #:use-module (gnu packages glib)
>   #:use-module (gnu packages autotools)
>   #:use-module (gnu packages pkg-config)
>   #:use-module (gnu packages polkit)
>   #:use-module (guix git-download)
>   #:use-module (guix build-system gnu)
>   #:use-module ((guix licenses) #:prefix license:))
>
> (define-public realmd
> (package
>   (name "realmd")
>   (version "0.17.0")
>   (source (origin
>             (method git-fetch)
>             (uri (git-reference
>              (url "https://github.com/freedesktop/realmd")
>              (commit version)))
>             (file-name (git-file-name name version))
>             (modules '((guix build utils)))
>              (snippet
>               '(begin
>                (delete-file "configure.ac")
>                ;(make-file-writable "configure.ac")
>                 #t))
>             (patches '("endgame/packages/patches/realmd-guixsd-support.patch"))
>             (sha256
>              (base32
>               "1c6q2a86kk2f1akzc36nh52hfwsmmc0mbp6ayyjxj4zsyk9zx5bf"))))
>   (build-system gnu-build-system)
>   (arguments
>     `(#:phases
>       (modify-phases %standard-phases
> 		     (add-after 'unpack 'make-git-checkout-writable
> 				(lambda* (#:key inputs #:allow-other-keys)
> 				       (make-file-writable "configure.ac"))
> 		     (add-after 'unpack 'apply-patches
> 					 (for-each
> 					   (lambda (file)
> 					     (invoke "patch" "--force" "-p1" "-input" "endgame/packages/patches/realmd-guixsd-support.patch"))))
> 		     ))))
>
> 		     ; gnuzilla.scm
> 						     ; jami.scm
>   (native-inputs `(("pkg-config" ,pkg-config)
>                    ("autoconf" ,autoconf)
>                    ("intltool" ,intltool)
>                    ("automake" ,automake)))
>   (inputs `(("glib" ,glib)
>             ("polkit" ,polkit)))
>   (synopsis "DBus service for configuring kerberos and other online identities")
>   (description "Dbus system service that manages discovery and enrollment
> in realms/domains like Active Directory or IPA.")
>   (home-page "https://www.freedesktop.org/software/realmd/")
>   (license license:lgpl2.1)))

Is the issue maybe from deleting "configure.ac" in the snippet, then
trying to modify its permissions in 'make-git-checkout-writable'?

--
Sarah


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-02 19:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-16  7:49 Apply patch to read-only file phodina via
2021-09-25 12:08 ` Guillaume Le Vaillant
2021-09-27 22:57   ` phodina
2021-09-29  8:42     ` Guillaume Le Vaillant
2021-10-02 19:49       ` phodina
  -- strict thread matches above, loose matches on Subject: below --
2021-09-28  4:47 Sarah Morgensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).