2024-04-21 15:54:59 +00:00
|
|
|
{ lib, stdenv, fetchurl, bundlerEnv, ruby, makeWrapper, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "5.1.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
rubyEnv = bundlerEnv {
|
|
|
|
name = "redmine-env-${version}";
|
|
|
|
|
|
|
|
inherit ruby;
|
|
|
|
gemdir = ./.;
|
2023-05-24 13:37:59 +00:00
|
|
|
groups = [ "development" "ldap" "markdown" "common_mark" "minimagick" "test" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "redmine";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2024-09-19 14:19:46 +00:00
|
|
|
url = "https://www.redmine.org/releases/redmine-${version}.tar.gz";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-iiIyD9nJQOZZjzrV+3o5MxlchgaO7plLpvzcIsXOy1k=";
|
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
|
|
|
'';
|
|
|
|
|
2022-09-11 15:47:08 +00:00
|
|
|
passthru.tests.redmine = nixosTests.redmine;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.redmine.org/";
|
2024-07-27 06:49:29 +00:00
|
|
|
changelog = "https://www.redmine.org/projects/redmine/wiki/changelog";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ aanderse felixsinger megheaiulian ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
};
|
|
|
|
}
|