summary refs log tree commit diff
path: root/pkgs/applications/version-management/redmine
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2018-10-10 21:04:08 -0400
committerAaron Andersen <aaron@fosslib.net>2018-10-10 21:04:08 -0400
commit1cb5b509f1a78ed7a38a327fb122abdf971c1222 (patch)
treea0203c8b2f719cac4241796739c736978f758555 /pkgs/applications/version-management/redmine
parente7334bc6e943b15089dd54f4365d8434fc3cc0c8 (diff)
downloadnixpkgs-1cb5b509f1a78ed7a38a327fb122abdf971c1222.tar
nixpkgs-1cb5b509f1a78ed7a38a327fb122abdf971c1222.tar.gz
nixpkgs-1cb5b509f1a78ed7a38a327fb122abdf971c1222.tar.bz2
nixpkgs-1cb5b509f1a78ed7a38a327fb122abdf971c1222.tar.lz
nixpkgs-1cb5b509f1a78ed7a38a327fb122abdf971c1222.tar.xz
nixpkgs-1cb5b509f1a78ed7a38a327fb122abdf971c1222.tar.zst
nixpkgs-1cb5b509f1a78ed7a38a327fb122abdf971c1222.zip
redmine: refactor, cleanup, bug fix, and add functionality
- added package option to specify which version of redmine
- added themes option back in to allow specifying redmine themes
- added plugins option back in to allow specifying redmine plugins
- added database.socket option to allow mysql unix socket authentication
- added port option to allow specifying the port rails runs on

- cleaned up Gemfile so it is much less hacky
- switched to ruby version 2.4 by default as suggested by documentation http://www.redmine.org/projects/redmine/wiki/redmineinstall#Installing-Redmine
- fixed an annoyance (bug) in the service causing recursive symlinks
- fixed ownership bug on log files generated by redmine
- updates reflecting renames in nixos options

- added a nixos test
Diffstat (limited to 'pkgs/applications/version-management/redmine')
-rw-r--r--pkgs/applications/version-management/redmine/Gemfile64
-rw-r--r--pkgs/applications/version-management/redmine/Gemfile.lock48
-rw-r--r--pkgs/applications/version-management/redmine/default.nix9
-rw-r--r--pkgs/applications/version-management/redmine/gemset.nix151
4 files changed, 212 insertions, 60 deletions
diff --git a/pkgs/applications/version-management/redmine/Gemfile b/pkgs/applications/version-management/redmine/Gemfile
index 744d6bfdd74..a5c509f81a9 100644
--- a/pkgs/applications/version-management/redmine/Gemfile
+++ b/pkgs/applications/version-management/redmine/Gemfile
@@ -54,60 +54,26 @@ platforms :mri, :mingw, :x64_mingw do
   end
 end
 
-# Include database gems for the adapters found in the database
-# configuration file
-require 'erb'
-require 'yaml'
-
-# NixOS - manually added to ensure mysql and postgres will always be include
+# Include database gems for the database adapters NixOS supports
 gem "mysql2", "~> 0.4.6", :platforms => [:mri, :mingw, :x64_mingw]
 gem "pg", "~> 0.18.1", :platforms => [:mri, :mingw, :x64_mingw]
 
-database_file = File.join(File.dirname(__FILE__), "config/database.yml")
-if File.exist?(database_file)
-  database_config = YAML::load(ERB.new(IO.read(database_file)).result)
-  adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
-  if adapters.any?
-    adapters.each do |adapter|
-      case adapter
-      when 'mysql2'
-        gem "mysql2", "~> 0.4.6", :platforms => [:mri, :mingw, :x64_mingw]
-      when /postgresql/
-        gem "pg", "~> 0.18.1", :platforms => [:mri, :mingw, :x64_mingw]
-      when /sqlite3/
-        gem "sqlite3", (RUBY_VERSION < "2.0" && RUBY_PLATFORM =~ /mingw/ ? "1.3.12" : "~>1.3.12"),
-                       :platforms => [:mri, :mingw, :x64_mingw]
-      when /sqlserver/
-        gem "tiny_tds", (RUBY_VERSION >= "2.0" ? "~> 1.0.5" : "~> 0.7.0"), :platforms => [:mri, :mingw, :x64_mingw]
-        gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw, :x64_mingw]
-      else
-        warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
-      end
-    end
-  else
-    warn("No adapter found in config/database.yml, please configure it first")
-  end
-else
-  warn("Please configure your config/database.yml first")
+group :development do
+  gem "rdoc", "~> 4.3"
+  gem "yard"
 end
 
-# NixOS - manually removed because I couldn't figure out how to get "bundle exec rails server webrick -e production" to ignore these groups
-#group :development do
-#  gem "rdoc", "~> 4.3"
-#  gem "yard"
-#end
-
-#group :test do
-#  gem "minitest"
-#  gem "rails-dom-testing"
-#  gem "mocha"
-#  gem "simplecov", "~> 0.9.1", :require => false
-#  # TODO: remove this after upgrading to Rails 5
-#  gem "test_after_commit", "~> 0.4.2"
-#  # For running UI tests
-#  gem "capybara"
-#  gem "selenium-webdriver", "~> 2.53.4"
-#end
+group :test do
+  gem "minitest"
+  gem "rails-dom-testing"
+  gem "mocha"
+  gem "simplecov", "~> 0.9.1", :require => false
+  # TODO: remove this after upgrading to Rails 5
+  gem "test_after_commit", "~> 0.4.2"
+  # For running UI tests
+  gem "capybara"
+  gem "selenium-webdriver", "~> 2.53.4"
+end
 
 local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
 if File.exists?(local_gemfile)
diff --git a/pkgs/applications/version-management/redmine/Gemfile.lock b/pkgs/applications/version-management/redmine/Gemfile.lock
index 589537c2af7..54eed51cd86 100644
--- a/pkgs/applications/version-management/redmine/Gemfile.lock
+++ b/pkgs/applications/version-management/redmine/Gemfile.lock
@@ -41,12 +41,23 @@ GEM
       public_suffix (>= 2.0.2, < 4.0)
     arel (6.0.4)
     builder (3.2.3)
+    capybara (3.9.0)
+      addressable
+      mini_mime (>= 0.1.3)
+      nokogiri (~> 1.8)
+      rack (>= 1.6.0)
+      rack-test (>= 0.6.3)
+      xpath (~> 3.1)
+    childprocess (0.9.0)
+      ffi (~> 1.0, >= 1.0.11)
     coderay (1.1.2)
     concurrent-ruby (1.0.5)
     crass (1.0.4)
     css_parser (1.6.0)
       addressable
+    docile (1.1.5)
     erubis (2.7.0)
+    ffi (1.9.25)
     globalid (0.4.1)
       activesupport (>= 4.2.0)
     htmlentities (4.3.4)
@@ -59,15 +70,20 @@ GEM
       nokogiri (>= 1.5.9)
     mail (2.6.6)
       mime-types (>= 1.16, < 4)
+    metaclass (0.0.4)
     mime-types (3.2.2)
       mime-types-data (~> 3.2015)
     mime-types-data (3.2018.0812)
     mimemagic (0.3.2)
+    mini_mime (1.0.1)
     mini_portile2 (2.3.0)
     minitest (5.11.3)
+    mocha (1.7.0)
+      metaclass (~> 0.0.1)
+    multi_json (1.13.1)
     mysql2 (0.4.10)
     net-ldap (0.12.1)
-    nokogiri (1.8.4)
+    nokogiri (1.8.5)
       mini_portile2 (~> 2.3.0)
     pg (0.18.4)
     protected_attributes (1.1.4)
@@ -104,10 +120,11 @@ GEM
       rake (>= 0.8.7)
       thor (>= 0.18.1, < 2.0)
     rake (12.3.1)
-    rbpdf (1.19.5)
+    rbpdf (1.19.6)
       htmlentities
       rbpdf-font (~> 1.19.0)
     rbpdf-font (1.19.1)
+    rdoc (4.3.0)
     redcarpet (3.4.0)
     request_store (1.0.5)
     rmagick (2.16.0)
@@ -118,6 +135,16 @@ GEM
       railties (>= 3.0, < 5.1)
       roadie (~> 3.1)
     ruby-openid (2.3.0)
+    rubyzip (1.2.2)
+    selenium-webdriver (2.53.4)
+      childprocess (~> 0.5)
+      rubyzip (~> 1.0)
+      websocket (~> 1.0)
+    simplecov (0.9.2)
+      docile (~> 1.1.0)
+      multi_json (~> 1.0)
+      simplecov-html (~> 0.9.0)
+    simplecov-html (0.9.0)
     sprockets (3.7.2)
       concurrent-ruby (~> 1.0)
       rack (> 1, < 3)
@@ -125,22 +152,31 @@ GEM
       actionpack (>= 4.0)
       activesupport (>= 4.0)
       sprockets (>= 3.0.0)
+    test_after_commit (0.4.2)
+      activerecord (>= 3.2)
     thor (0.20.0)
     thread_safe (0.3.6)
     tzinfo (1.2.5)
       thread_safe (~> 0.1)
+    websocket (1.2.8)
+    xpath (3.1.0)
+      nokogiri (~> 1.8)
+    yard (0.9.16)
 
 PLATFORMS
   ruby
 
 DEPENDENCIES
   actionpack-xml_parser
+  capybara
   coderay (~> 1.1.1)
   i18n (~> 0.7.0)
   jquery-rails (~> 3.1.4)
   mail (~> 2.6.4)
   mime-types (~> 3.0)
   mimemagic
+  minitest
+  mocha
   mysql2 (~> 0.4.6)
   net-ldap (~> 0.12.0)
   nokogiri (~> 1.8.1)
@@ -148,15 +184,21 @@ DEPENDENCIES
   protected_attributes
   rack-openid
   rails (= 4.2.8)
+  rails-dom-testing
   rails-html-sanitizer (>= 1.0.3)
   rbpdf (~> 1.19.3)
+  rdoc (~> 4.3)
   redcarpet (~> 3.4.0)
   request_store (= 1.0.5)
   rmagick (>= 2.14.0)
   roadie (~> 3.2.1)
   roadie-rails (~> 1.1.1)
   ruby-openid (~> 2.3.0)
+  selenium-webdriver (~> 2.53.4)
+  simplecov (~> 0.9.1)
+  test_after_commit (~> 0.4.2)
   tzinfo-data
+  yard
 
 BUNDLED WITH
-   1.16.1
+   1.16.3
diff --git a/pkgs/applications/version-management/redmine/default.nix b/pkgs/applications/version-management/redmine/default.nix
index 3c3fd4da33d..d07e0f3e454 100644
--- a/pkgs/applications/version-management/redmine/default.nix
+++ b/pkgs/applications/version-management/redmine/default.nix
@@ -7,6 +7,7 @@ let
 
     inherit ruby;
     gemdir = ./.;
+    groups = [ "ldap" "openid" ];
   };
 in
   stdenv.mkDerivation rec {
@@ -21,15 +22,15 @@ in
 
     buildPhase = ''
       mv config config.dist
+      mv public/themes public/themes.dist
     '';
 
     installPhase = ''
       mkdir -p $out/share
       cp -r . $out/share/redmine
-
-      for i in config files log plugins tmp; do
+      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/
+        ln -fs /run/redmine/$i $out/share/redmine/$i
       done
     '';
 
@@ -39,4 +40,4 @@ in
       maintainers = [ maintainers.garbas ];
       license = licenses.gpl2;
     };
-  }
+  }
\ No newline at end of file
diff --git a/pkgs/applications/version-management/redmine/gemset.nix b/pkgs/applications/version-management/redmine/gemset.nix
index 7423fcdb9fb..fe56298056b 100644
--- a/pkgs/applications/version-management/redmine/gemset.nix
+++ b/pkgs/applications/version-management/redmine/gemset.nix
@@ -96,6 +96,24 @@
     };
     version = "3.2.3";
   };
+  capybara = {
+    dependencies = ["addressable" "mini_mime" "nokogiri" "rack" "rack-test" "xpath"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1sz6ick0pn7886jh9fd4571wyplshnpb95pr22ds4hd51zcrnfi4";
+      type = "gem";
+    };
+    version = "3.9.0";
+  };
+  childprocess = {
+    dependencies = ["ffi"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0a61922kmvcxyj5l70fycapr87gz1dzzlkfpq85rfqk5vdh3d28p";
+      type = "gem";
+    };
+    version = "0.9.0";
+  };
   coderay = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -129,6 +147,14 @@
     };
     version = "1.6.0";
   };
+  docile = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0m8j31whq7bm5ljgmsrlfkiqvacrw6iz9wq10r3gwrv5785y8gjx";
+      type = "gem";
+    };
+    version = "1.1.5";
+  };
   erubis = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -137,6 +163,14 @@
     };
     version = "2.7.0";
   };
+  ffi = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0jpm2dis1j7zvvy3lg7axz9jml316zrn7s0j59vyq3qr127z0m7q";
+      type = "gem";
+    };
+    version = "1.9.25";
+  };
   globalid = {
     dependencies = ["activesupport"];
     source = {
@@ -189,6 +223,14 @@
     };
     version = "2.6.6";
   };
+  metaclass = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0hp99y2b1nh0nr8pc398n3f8lakgci6pkrg4bf2b2211j1f6hsc5";
+      type = "gem";
+    };
+    version = "0.0.4";
+  };
   mime-types = {
     dependencies = ["mime-types-data"];
     source = {
@@ -214,6 +256,14 @@
     };
     version = "0.3.2";
   };
+  mini_mime = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1q4pshq387lzv9m39jv32vwb8wrq3wc4jwgl4jk209r4l33v09d3";
+      type = "gem";
+    };
+    version = "1.0.1";
+  };
   mini_portile2 = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -230,6 +280,23 @@
     };
     version = "5.11.3";
   };
+  mocha = {
+    dependencies = ["metaclass"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "13whjmrm4n48rwx7h7a2jwa5grar3m0fxspbm2pm4lyp7hi119c1";
+      type = "gem";
+    };
+    version = "1.7.0";
+  };
+  multi_json = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1rl0qy4inf1mp8mybfk56dfga0mvx97zwpmq5xmiwl5r770171nv";
+      type = "gem";
+    };
+    version = "1.13.1";
+  };
   mysql2 = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -250,10 +317,10 @@
     dependencies = ["mini_portile2"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1h9nml9h3m0mpvmh8jfnqvblnz5n5y3mmhgfc38avfmfzdrq9bgc";
+      sha256 = "0byyxrazkfm29ypcx5q4syrv126nvjnf7z6bqi01sqkv4llsi4qz";
       type = "gem";
     };
-    version = "1.8.4";
+    version = "1.8.5";
   };
   pg = {
     source = {
@@ -363,10 +430,10 @@
     dependencies = ["htmlentities" "rbpdf-font"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "021fda3gcz9pyydxnn40vs1nrkycwslb9ip4q0yg3hlip41k1b49";
+      sha256 = "159vg56bzy09f6zrh9h3rxm2r0vkvsfn9qczqmv1vi5xkd918s0d";
       type = "gem";
     };
-    version = "1.19.5";
+    version = "1.19.6";
   };
   rbpdf-font = {
     source = {
@@ -376,6 +443,14 @@
     };
     version = "1.19.1";
   };
+  rdoc = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "13ba2mhqqcsp3k97x3iz9x29xk26rv4561lfzzzibcy41vvj1n4c";
+      type = "gem";
+    };
+    version = "4.3.0";
+  };
   redcarpet = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -426,6 +501,40 @@
     };
     version = "2.3.0";
   };
+  rubyzip = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1n1lb2sdwh9h27y244hxzg1lrxxg2m53pk1vq7p33bna003qkyrj";
+      type = "gem";
+    };
+    version = "1.2.2";
+  };
+  selenium-webdriver = {
+    dependencies = ["childprocess" "rubyzip" "websocket"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15qyf7b9fa2nxhhwp551b9fjj82kb3wmy65559yrrcwpdadqvcs4";
+      type = "gem";
+    };
+    version = "2.53.4";
+  };
+  simplecov = {
+    dependencies = ["docile" "multi_json" "simplecov-html"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1a3wy9zlmfwl3f47cibnxyxrgfz16y6fmy0dj1vyidzyys4mvy12";
+      type = "gem";
+    };
+    version = "0.9.2";
+  };
+  simplecov-html = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0jv9pmpaxihrcsgcf6mgl3qg7rhf9scl5l2k67d768w9cz63xgvc";
+      type = "gem";
+    };
+    version = "0.9.0";
+  };
   sprockets = {
     dependencies = ["concurrent-ruby" "rack"];
     source = {
@@ -444,6 +553,15 @@
     };
     version = "3.2.1";
   };
+  test_after_commit = {
+    dependencies = ["activerecord"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1fzg8qan6f0n0ynr594bld2k0rwwxj99yzhiga2f3pkj9ina1abb";
+      type = "gem";
+    };
+    version = "0.4.2";
+  };
   thor = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -469,4 +587,29 @@
     };
     version = "1.2.5";
   };
+  websocket = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0f11rcn4qgffb1rq4kjfwi7di79w8840x9l74pkyif5arp0mb08x";
+      type = "gem";
+    };
+    version = "1.2.8";
+  };
+  xpath = {
+    dependencies = ["nokogiri"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1y61ijvv04bwga802s8py5xd7fcxci6478wgr9wkd35p45x20jzi";
+      type = "gem";
+    };
+    version = "3.1.0";
+  };
+  yard = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0lmmr1839qgbb3zxfa7jf5mzy17yjl1yirwlgzdhws4452gqhn67";
+      type = "gem";
+    };
+    version = "0.9.16";
+  };
 }
\ No newline at end of file