You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.2 KiB

  1. (define-module (gn packages gitea)
  2. #:use-module ((guix licenses) #:prefix license:)
  3. #:use-module (guix packages)
  4. #:use-module (guix download)
  5. #:use-module (guix build-system go)
  6. #:use-module (gnu packages node)
  7. #:use-module (gnu packages version-control))
  8. (define-public gitea
  9. (package
  10. (name "gitea")
  11. (version "1.12.3")
  12. (source (origin
  13. (method url-fetch)
  14. (uri (string-append "https://github.com/go-gitea/gitea/releases"
  15. "/download/v" version
  16. "/gitea-src-" version ".tar.gz"))
  17. (sha256
  18. (base32
  19. "05z1pp2lnbr82pw97wy0j0qk2vv1qv9c46df13d03xdfsc3gsm50"))))
  20. (build-system go-build-system)
  21. (arguments
  22. `(#:install-source? #f
  23. #:phases
  24. (modify-phases %standard-phases
  25. (add-before 'build 'prepare-build
  26. (lambda _
  27. (chdir "src")
  28. (setenv "TAGS" "bindata sqlite sqlite_unlock_notify")
  29. #t))
  30. (replace 'build
  31. (lambda _
  32. (invoke "make" "build")))
  33. (replace 'check
  34. (lambda* (#:key tests? #:allow-other-keys)
  35. (if tests?
  36. (begin
  37. (invoke "make" "test")
  38. ;; Gitea requires git with lfs support to run tests.
  39. ;(invoke "make" "test-sqlite")
  40. (invoke "make" "test-sqlite-migration"))
  41. #t)))
  42. (replace 'install
  43. (lambda _
  44. (invoke "make" "install")))
  45. (add-after 'install 'wrap-program
  46. (lambda* (#:key outputs inputs #:allow-other-keys)
  47. (let* ((out (assoc-ref outputs "out"))
  48. (bin (string-append out "/bin/gitea"))
  49. (git (assoc-ref inputs "git")))
  50. (wrap-program bin
  51. `("PATH" ":" prefix (,(string-append git "/bin")))))
  52. #t)))))
  53. (native-inputs
  54. `(("node" ,node)))
  55. (inputs
  56. `(("git" ,git)))
  57. (home-page "https://gitea.io/")
  58. (synopsis "Self-hosted git service")
  59. ;; TODO: Rewrite description
  60. (description "Gitea is a painless self-hosted Git service. It is similar
  61. to GitHub, Bitbucket, and GitLab.")
  62. (license license:expat)))