gnu: 389-ds-base: Use gexp.

* gnu/packages/openldap.scm (389-ds-base)[arguments]: Use gexp; remove one
obsolete substitution.
This commit is contained in:
Ricardo Wurmus 2022-12-14 21:50:55 +01:00
parent 597685054b
commit b5bb44b260
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -260,24 +260,25 @@ (define-public 389-ds-base
"1sdvfbjfg0091f47562gw3gdc2vgvvhyhdi21lrpwnw9lqc8xdxk"))))
(build-system gnu-build-system)
(arguments
`(#:modules ((srfi srfi-1)
(list
#:modules '((srfi srfi-1)
(guix build gnu-build-system)
((guix build python-build-system)
#:select (add-installed-pythonpath python-version))
(guix build utils))
#:imported-modules ((guix build python-build-system)
#:imported-modules `((guix build python-build-system)
,@%gnu-build-system-modules)
#:configure-flags
(list (string-append "--with-db="
(assoc-ref %build-inputs "bdb"))
#~(list (string-append "--with-db="
#$(this-package-input "bdb"))
(string-append "--with-netsnmp="
(assoc-ref %build-inputs "net-snmp"))
#$(this-package-input "net-snmp"))
(string-append "--with-selinux="
(assoc-ref %build-inputs "libselinux"))
#$(this-package-input "libselinux"))
"--localstatedir=/var"
"--with-instconfigdir=/etc/dirsrv")
#:phases
(modify-phases %standard-phases
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-references
(lambda _
(substitute* "ldap/servers/plugins/sync/sync_persist.c"
@ -291,11 +292,10 @@ (define-public 389-ds-base
(("'/usr/bin/openssl'")
(string-append "'" (which "openssl") "'")))))
(add-after 'unpack 'overwrite-default-locations
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(lambda _
(substitute* "src/lib389/lib389/paths.py"
(("/usr/share/dirsrv/inf/defaults.inf")
(string-append out "/share/dirsrv/inf/defaults.inf")))
(string-append #$output "/share/dirsrv/inf/defaults.inf")))
;; This directory can only be specified relative to sysconfdir. This
;; is used to determine where to look for installed directory
;; servers, so in the absence of a search path it needs to be global.
@ -306,24 +306,22 @@ (define-public 389-ds-base
;; when installing new directory server instances.
(substitute* "src/lib389/lib389/instance/setup.py"
(("etc_dirsrv_path = .*")
"etc_dirsrv_path = '/etc/dirsrv/'\n")))))
"etc_dirsrv_path = '/etc/dirsrv/'\n"))))
(add-after 'unpack 'fix-install-location-of-python-tools
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(pythondir (string-append
out "/lib/python"
(python-version (assoc-ref inputs "python"))
(let ((pythondir (string-append
#$output "/lib/python"
(python-version #$(this-package-input "python"))
"/site-packages/")))
;; Install directory must be on PYTHONPATH.
(add-installed-pythonpath inputs outputs)
;; Install directory must exist.
(mkdir-p pythondir)
(substitute* "src/lib389/setup.py"
(("/usr") out))
(setenv "INSTALL_PREFIX" #$output)
(substitute* "Makefile.am"
(("setup.py install --skip-build" m)
(string-append
m " --prefix=" out
m " --prefix=" #$output
" --root=/ --single-version-externally-managed"))))))
(add-after 'build 'build-python-tools
(lambda* (#:key make-flags #:allow-other-keys)
@ -339,10 +337,9 @@ (define-public 389-ds-base
(apply invoke "make" "lib389-install" make-flags)))
(add-after 'install-python-tools 'wrap-python-tools
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(pythonpath (getenv "GUIX_PYTHONPATH")))
(let ((pythonpath (getenv "GUIX_PYTHONPATH")))
(for-each (lambda (file)
(wrap-program (string-append out file)
(wrap-program (string-append #$output file)
`("GUIX_PYTHONPATH" ":" prefix (,pythonpath))))
'("/sbin/dsconf"
"/sbin/dscreate"