2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, fetchurl, ruby, bundler, libiconv, libxslt, libxml2, pkgconfig, libffi, imagemagickBig, postgresql }:
|
2014-10-07 09:52:45 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
gemspec = map (gem: fetchurl { url=gem.url; sha256=gem.hash; }) (import ./Gemfile.nix);
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
version = "2.5.2";
|
|
|
|
name = "redmine-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://www.redmine.org/releases/${name}.tar.gz";
|
2014-10-07 09:52:45 +01:00
|
|
|
sha256 = "0x0zwxyj4dwbk7l64s3lgny10mjf0ba8jwrbafsm4d72sncmacv0";
|
|
|
|
};
|
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-03-01 22:47:29 +00:00
|
|
|
|
2014-10-07 09:52:45 +01:00
|
|
|
# taken from redmine (2.5.1-2~bpo70+3) in debian wheezy-backports
|
|
|
|
# needed to separate run-time and build-time directories
|
|
|
|
patches = [
|
|
|
|
./2002_FHS_through_env_vars.patch
|
|
|
|
./2004_FHS_plugins_assets.patch
|
|
|
|
./2003_externalize_session_config.patch
|
|
|
|
];
|
2016-03-01 22:47:29 +00:00
|
|
|
|
2014-10-07 09:52:45 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/redmine/plugin.rb --replace "File.join(Rails.root, 'plugins')" "ENV['RAILS_PLUGINS']"
|
|
|
|
substituteInPlace lib/redmine/plugin.rb --replace "File.join(Rails.root, 'plugins', id.to_s, 'db', 'migrate')" "File.join(ENV['RAILS_PLUGINS'], id.to_s, 'db', 'migrate')"
|
|
|
|
substituteInPlace config/routes.rb --replace '"plugins/*", Rails.root' 'ENV["RAILS_PLUGINS"] + "/*"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
2014-11-26 23:16:50 +00:00
|
|
|
ruby bundler libiconv
|
2014-12-12 00:20:53 +00:00
|
|
|
libxslt libxml2 pkgconfig libffi
|
2014-10-07 09:52:45 +01:00
|
|
|
imagemagickBig postgresql
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/redmine/
|
|
|
|
cp -R . $out/share/redmine/
|
|
|
|
cd $out/share/redmine
|
|
|
|
ln -s ${./Gemfile.lock} Gemfile.lock
|
|
|
|
export HOME=$(pwd)
|
|
|
|
|
|
|
|
cat > config/database.yml <<EOF
|
|
|
|
production:
|
|
|
|
adapter: postgresql
|
|
|
|
EOF
|
|
|
|
|
|
|
|
mkdir -p vendor/cache
|
|
|
|
${stdenv.lib.concatStrings (map (gem: "ln -s ${gem} vendor/cache/${gem.name};") gemspec)}
|
|
|
|
|
2016-08-30 00:57:21 +01:00
|
|
|
bundle config build.nokogiri --use-system-libraries --with-iconv-dir="${libiconv}" --with-xslt-dir="${libxslt.dev}" --with-xml2-dir="${libxml2.dev}"
|
2014-10-07 09:52:45 +01:00
|
|
|
|
|
|
|
bundle install --verbose --local --deployment
|
|
|
|
|
|
|
|
# make sure we always load pg package
|
|
|
|
echo "gem \"pg\"" >> Gemfile
|
|
|
|
|
|
|
|
# make rails server happy
|
|
|
|
mkdir -p tmp/pids
|
|
|
|
|
|
|
|
# cleanup
|
|
|
|
rm config/database.yml
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://www.redmine.org/;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.garbas ];
|
|
|
|
license = licenses.gpl2;
|
2016-09-28 13:47:08 +01:00
|
|
|
# Marked as broken due to needing an update for security issues.
|
|
|
|
# See: https://github.com/NixOS/nixpkgs/issues/18856
|
|
|
|
broken = true;
|
2014-10-07 09:52:45 +01:00
|
|
|
};
|
|
|
|
}
|