diff options
author | Aaron Andersen <aaron@fosslib.net> | 2020-01-25 11:11:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-25 11:11:13 -0500 |
commit | 0e0b8f2feb813cbd6ae1d670201b616579c24067 (patch) | |
tree | dfd6d6a205fed8062a715499b4fbdfa361a3a282 | |
parent | b305cd8d6f9da11e3325f0c1cc4278c0a4a1ced9 (diff) | |
parent | 1093736abb435796d5ce0d804f6ec49ba8dff7b1 (diff) | |
download | nixpkgs-0e0b8f2feb813cbd6ae1d670201b616579c24067.tar nixpkgs-0e0b8f2feb813cbd6ae1d670201b616579c24067.tar.gz nixpkgs-0e0b8f2feb813cbd6ae1d670201b616579c24067.tar.bz2 nixpkgs-0e0b8f2feb813cbd6ae1d670201b616579c24067.tar.lz nixpkgs-0e0b8f2feb813cbd6ae1d670201b616579c24067.tar.xz nixpkgs-0e0b8f2feb813cbd6ae1d670201b616579c24067.tar.zst nixpkgs-0e0b8f2feb813cbd6ae1d670201b616579c24067.zip |
Merge pull request #77983 from aanderse/solr
solr: 8.4.0 -> 8.4.1
-rw-r--r-- | nixos/modules/services/search/solr.nix | 12 | ||||
-rw-r--r-- | nixos/tests/solr.nix | 101 | ||||
-rw-r--r-- | pkgs/servers/search/solr/8.x.nix | 35 | ||||
-rw-r--r-- | pkgs/servers/search/solr/default.nix | 14 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 6 |
5 files changed, 56 insertions, 112 deletions
diff --git a/nixos/modules/services/search/solr.nix b/nixos/modules/services/search/solr.nix index b2176225493..a8615a20a1c 100644 --- a/nixos/modules/services/search/solr.nix +++ b/nixos/modules/services/search/solr.nix @@ -13,19 +13,11 @@ in services.solr = { enable = mkEnableOption "Solr"; - # default to the 8.x series not forcing major version upgrade of those on the 7.x series package = mkOption { type = types.package; - default = if versionAtLeast config.system.stateVersion "19.09" - then pkgs.solr_8 - else pkgs.solr_7 - ; + default = pkgs.solr; defaultText = "pkgs.solr"; - description = '' - Which Solr package to use. This defaults to version 7.x if - <literal>system.stateVersion < 19.09</literal> and version 8.x - otherwise. - ''; + description = "Which Solr package to use."; }; port = mkOption { diff --git a/nixos/tests/solr.nix b/nixos/tests/solr.nix index 2108e851bc5..23e1a960fb3 100644 --- a/nixos/tests/solr.nix +++ b/nixos/tests/solr.nix @@ -1,65 +1,48 @@ -{ system ? builtins.currentSystem, - config ? {}, - pkgs ? import ../.. { inherit system config; } -}: +import ./make-test.nix ({ pkgs, ... }: -with import ../lib/testing.nix { inherit system pkgs; }; -with pkgs.lib; - -let - solrTest = package: makeTest { - machine = - { config, pkgs, ... }: - { - # Ensure the virtual machine has enough memory for Solr to avoid the following error: - # - # OpenJDK 64-Bit Server VM warning: - # INFO: os::commit_memory(0x00000000e8000000, 402653184, 0) - # failed; error='Cannot allocate memory' (errno=12) - # - # There is insufficient memory for the Java Runtime Environment to continue. - # Native memory allocation (mmap) failed to map 402653184 bytes for committing reserved memory. - virtualisation.memorySize = 2000; +{ + name = "solr"; + meta.maintainers = [ pkgs.stdenv.lib.maintainers.aanderse ]; - services.solr.enable = true; - services.solr.package = package; - }; + machine = + { config, pkgs, ... }: + { + # Ensure the virtual machine has enough memory for Solr to avoid the following error: + # + # OpenJDK 64-Bit Server VM warning: + # INFO: os::commit_memory(0x00000000e8000000, 402653184, 0) + # failed; error='Cannot allocate memory' (errno=12) + # + # There is insufficient memory for the Java Runtime Environment to continue. + # Native memory allocation (mmap) failed to map 402653184 bytes for committing reserved memory. + virtualisation.memorySize = 2000; - testScript = '' - startAll; + services.solr.enable = true; + }; - $machine->waitForUnit('solr.service'); - $machine->waitForOpenPort('8983'); - $machine->succeed('curl --fail http://localhost:8983/solr/'); + testScript = '' + startAll; - # adapted from pkgs.solr/examples/films/README.txt - $machine->succeed('sudo -u solr solr create -c films'); - $machine->succeed(q(curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{ - "add-field" : { - "name":"name", - "type":"text_general", - "multiValued":false, - "stored":true - }, - "add-field" : { - "name":"initial_release_date", - "type":"pdate", - "stored":true - } - }')) =~ /"status":0/ or die; - $machine->succeed('sudo -u solr post -c films ${pkgs.solr}/example/films/films.json'); - $machine->succeed('curl http://localhost:8983/solr/films/query?q=name:batman') =~ /"name":"Batman Begins"/ or die; - ''; - }; -in -{ - solr_7 = solrTest pkgs.solr_7 // { - name = "solr_7"; - meta.maintainers = [ lib.maintainers.aanderse ]; - }; + $machine->waitForUnit('solr.service'); + $machine->waitForOpenPort('8983'); + $machine->succeed('curl --fail http://localhost:8983/solr/'); - solr_8 = solrTest pkgs.solr_8 // { - name = "solr_8"; - meta.maintainers = [ lib.maintainers.aanderse ]; - }; -} + # adapted from pkgs.solr/examples/films/README.txt + $machine->succeed('sudo -u solr solr create -c films'); + $machine->succeed(q(curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{ + "add-field" : { + "name":"name", + "type":"text_general", + "multiValued":false, + "stored":true + }, + "add-field" : { + "name":"initial_release_date", + "type":"pdate", + "stored":true + } + }')) =~ /"status":0/ or die; + $machine->succeed('sudo -u solr post -c films ${pkgs.solr}/example/films/films.json'); + $machine->succeed('curl http://localhost:8983/solr/films/query?q=name:batman') =~ /"name":"Batman Begins"/ or die; + ''; +}) diff --git a/pkgs/servers/search/solr/8.x.nix b/pkgs/servers/search/solr/8.x.nix deleted file mode 100644 index db70aadf8d5..00000000000 --- a/pkgs/servers/search/solr/8.x.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ stdenv, fetchurl, jre, makeWrapper }: - -stdenv.mkDerivation rec { - pname = "solr"; - version = "8.4.0"; - - src = fetchurl { - url = "mirror://apache/lucene/${pname}/${version}/${pname}-${version}.tgz"; - sha256 = "19l11w867y4bms9bmp9pj4ilkay7zb5015vlywdci2mswlafvrv6"; - }; - - nativeBuildInputs = [ makeWrapper ]; - - installPhase = '' - mkdir -p $out $out/bin - - cp -r bin/solr bin/post $out/bin/ - cp -r contrib $out/ - cp -r dist $out/ - cp -r example $out/ - cp -r server $out/ - - wrapProgram $out/bin/solr --set JAVA_HOME "${jre}" - wrapProgram $out/bin/post --set JAVA_HOME "${jre}" - ''; - - meta = with stdenv.lib; { - homepage = "https://lucene.apache.org/solr/"; - description = "Open source enterprise search platform from the Apache Lucene project"; - license = licenses.asl20; - platforms = platforms.all; - maintainers = with maintainers; [ domenkozar aanderse ]; - }; - -} diff --git a/pkgs/servers/search/solr/default.nix b/pkgs/servers/search/solr/default.nix index c94b11c91dd..701d3880cbd 100644 --- a/pkgs/servers/search/solr/default.nix +++ b/pkgs/servers/search/solr/default.nix @@ -1,12 +1,12 @@ -{ stdenv, fetchurl, jre, makeWrapper }: +{ stdenv, fetchurl, jre, makeWrapper, nixosTests }: stdenv.mkDerivation rec { pname = "solr"; - version = "7.7.2"; + version = "8.4.1"; src = fetchurl { - url = "mirror://apache/lucene/solr/${version}/solr-${version}.tgz"; - sha256 = "1pr02d4sw5arig1brjb6j7ir644n8s737qsx6ll46di5iw1y93pb"; + url = "mirror://apache/lucene/${pname}/${version}/${pname}-${version}.tgz"; + sha256 = "00a35a6ppd4ngp80dxak3bqrp8vmx0wixr4x2h2p9qxj4khf2fgc"; }; nativeBuildInputs = [ makeWrapper ]; @@ -24,12 +24,16 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/post --set JAVA_HOME "${jre}" ''; + passthru.tests = { + inherit (nixosTests) solr; + }; + meta = with stdenv.lib; { homepage = "https://lucene.apache.org/solr/"; description = "Open source enterprise search platform from the Apache Lucene project"; license = licenses.asl20; platforms = platforms.all; - maintainers = [ maintainers.domenkozar maintainers.aanderse ]; + maintainers = with maintainers; [ domenkozar aanderse ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8517f4be3a3..01275b02866 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6490,9 +6490,9 @@ in inherit (darwin.apple_sdk.frameworks) Security; }; - solr = solr_8; - solr_7 = callPackage ../servers/search/solr { }; - solr_8 = callPackage ../servers/search/solr/8.x.nix { }; + solr = callPackage ../servers/search/solr { }; + solr_7 = solr; + solr_8 = solr; solvespace = callPackage ../applications/graphics/solvespace { }; |