gnu: lyx: Don't install to custom directory.

* gnu/packages/tex.scm (lyx)[arguments]: Adjust configure-flags to not
add the version to the binary's suffix. Remove custom
'patch-desktop-file, 'setenv-check and 'install-symlink phases.
This commit is contained in:
Efraim Flashner 2020-06-11 09:26:38 +03:00
parent 03a7b67b31
commit dadf97952d
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -6136,10 +6136,9 @@ (define-public lyx
"-DLYX_EXTERNAL_BOOST=1" "-DLYX_EXTERNAL_BOOST=1"
"-DLYX_INSTALL=1" "-DLYX_INSTALL=1"
"-DLYX_RELEASE=1" "-DLYX_RELEASE=1"
"-DLYX_PROGRAM_SUFFIX=OFF"
,(string-append "-DLYX_INSTALL_PREFIX=" ,(string-append "-DLYX_INSTALL_PREFIX="
(assoc-ref %outputs "out") (assoc-ref %outputs "out")))
;; Exact name and level is necessary.
"/lyx" ,(version-major+minor version)))
#:modules ((guix build cmake-build-system) #:modules ((guix build cmake-build-system)
(guix build qt-utils) (guix build qt-utils)
(guix build utils)) (guix build utils))
@ -6159,44 +6158,16 @@ (define-public lyx
(assoc-ref inputs "python") (assoc-ref inputs "python")
"/bin/python3 "))) "/bin/python3 ")))
#t)) #t))
(add-after 'patch-python 'patch-desktop-file
(lambda* (#:key outputs #:allow-other-keys)
(substitute* "lib/lyx.desktop.in"
(("Exec=")
(string-append "Exec="
(assoc-ref outputs "out")
"/")))
#t))
(add-after 'unpack 'add-missing-test-file (add-after 'unpack 'add-missing-test-file
(lambda _ (lambda _
;; Create missing file that would cause tests to fail. ;; Create missing file that would cause tests to fail.
(with-output-to-file "src/tests/check_layout.cmake" (with-output-to-file "src/tests/check_layout.cmake"
(const #t)) (const #t))
#t)) #t))
(add-before 'check 'setenv-check
(lambda _
(setenv (string-append "LYX_DIR_"
(string-join
(string-split
,(version-major+minor version) #\-)) "x")
(string-append (getcwd) "/../lyx-" ,version "/lib"))
#t))
(add-after 'install 'wrap-qt (add-after 'install 'wrap-qt
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(wrap-qt-program (assoc-ref outputs "out") (wrap-qt-program (assoc-ref outputs "out") "lyx")
(string-append "../lyx" #t)))))
,(version-major+minor version)
"/bin/lyx"
,(version-major+minor version)))
#t))
(add-after 'install 'install-symlinks
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(mkdir-p (string-append out "/bin"))
(symlink (string-append "../lyx" ,(version-major+minor version)
"/bin/lyx" ,(version-major+minor version))
(string-append out "/bin/lyx" ,(version-major+minor version)))
#t))))))
(inputs (inputs
`(("boost" ,boost) `(("boost" ,boost)
("hunspell" ,hunspell) ; Note: Could also use aspell instead. ("hunspell" ,hunspell) ; Note: Could also use aspell instead.