2021-01-15 22:18:51 +00:00
{ lib , stdenv , fetchurl , bundlerEnv , ruby , makeWrapper }:
2020-04-24 23:36:52 +00:00
let
2022-03-05 16:20:37 +00:00
version = " 4 . 2 . 4 " ;
2020-04-24 23:36:52 +00:00
rubyEnv = bundlerEnv {
name = " r e d m i n e - e n v - ${ version } " ;
inherit ruby ;
gemdir = ./. ;
groups = [ " d e v e l o p m e n t " " l d a p " " m a r k d o w n " " m i n i m a g i c k " " o p e n i d " " t e s t " ] ;
} ;
in
stdenv . mkDerivation rec {
pname = " r e d m i n e " ;
inherit version ;
src = fetchurl {
2022-03-05 16:20:37 +00:00
# https://www.redmine.org/news/134
# > "These releases are not available yet on the releases page from a technical reason, we are sorry for this and we expected to have them uploaded next week. I'll post here an update after we have them uploaded."
url = " h t t p s : / / w w w . r e d m i n e . o r g / a t t a c h m e n t s / d o w n l o a d / 2 8 8 6 2 / ${ pname } - ${ version } . t a r . g z " ;
sha256 = " 7 f 5 0 f d 4 a 6 c f 1 c 1 e 4 8 0 9 1 a 8 7 6 9 6 b 8 1 3 b a 2 6 4 e 1 1 f 0 4 d e c 6 7 f b 0 0 6 8 5 8 a 1 b 4 9 a 5 c 7 d " ;
2020-04-24 23:36:52 +00:00
} ;
2020-12-29 15:07:52 +00:00
nativeBuildInputs = [ makeWrapper ] ;
2020-04-24 23:36:52 +00:00
buildInputs = [ rubyEnv rubyEnv . wrappedRuby rubyEnv . bundler ] ;
2020-08-20 17:08:02 +00:00
# taken from https://www.redmine.org/issues/33784
# can be dropped when the upstream bug is closed and the fix is present in the upstream release
patches = [ ./0001-python3.patch ] ;
2020-04-24 23:36:52 +00:00
buildPhase = ''
mv config config . dist
mv public/themes public/themes.dist
'' ;
installPhase = ''
2020-12-29 15:07:52 +00:00
mkdir - p $ out/bin $ out/share
2020-04-24 23:36:52 +00:00
cp - r . $ out/share/redmine
for i in config files log plugins public/plugin_assets public/themes tmp ; do
rm - rf $ out/share/redmine / $ i
ln - fs /run/redmine / $ i $ out/share/redmine / $ i
done
2020-12-29 15:07:52 +00:00
makeWrapper $ { rubyEnv . wrappedRuby } /bin/ruby $ out/bin/rdm-mailhandler.rb - - add-flags $ out/share/redmine/extra/mail_handler/rdm-mailhandler.rb
2020-04-24 23:36:52 +00:00
'' ;
2021-01-15 22:18:51 +00:00
meta = with lib ; {
2020-04-24 23:36:52 +00:00
homepage = " h t t p s : / / w w w . r e d m i n e . o r g / " ;
platforms = platforms . linux ;
maintainers = [ maintainers . aanderse ] ;
license = licenses . gpl2 ;
} ;
}