Loading nixos/tests/all-tests.nix +2 −2 Original line number Diff line number Diff line Loading @@ -849,8 +849,8 @@ in { qemu-vm-volatile-root = runTest ./qemu-vm-volatile-root.nix; qemu-vm-external-disk-image = runTest ./qemu-vm-external-disk-image.nix; qemu-vm-store = runTest ./qemu-vm-store.nix; qgis = handleTest ./qgis.nix { qgisPackage = pkgs.qgis; }; qgis-ltr = handleTest ./qgis.nix { qgisPackage = pkgs.qgis-ltr; }; qgis = handleTest ./qgis.nix { package = pkgs.qgis; }; qgis-ltr = handleTest ./qgis.nix { package = pkgs.qgis-ltr; }; qownnotes = handleTest ./qownnotes.nix {}; qtile = handleTestOn ["x86_64-linux" "aarch64-linux"] ./qtile/default.nix {}; quake3 = handleTest ./quake3.nix {}; Loading nixos/tests/qgis.nix +59 −3 Original line number Diff line number Diff line import ./make-test-python.nix ({ pkgs, lib, qgisPackage, ... }: import ./make-test-python.nix ({ pkgs, lib, package, ... }: let qgisPackage = package.override { withServer = true; }; testScript = pkgs.writeTextFile { name = "qgis-test.py"; text = (builtins.readFile ../../pkgs/applications/gis/qgis/test.py); Loading @@ -12,19 +13,74 @@ import ./make-test-python.nix ({ pkgs, lib, qgisPackage, ... }: }; nodes = { machine = { pkgs, ... }: { machine = { config, pkgs, ... }: let qgisServerUser = config.services.nginx.user; qgisServerSocket = "/run/qgis_mapserv.socket"; in { virtualisation.diskSize = 2 * 1024; imports = [ ./common/x11.nix ]; environment.systemPackages = [ qgisPackage ]; environment.systemPackages = [ qgisPackage ]; systemd.sockets.qgis-server = { listenStreams = [ qgisServerSocket ]; socketConfig = { Accept = false; SocketUser = qgisServerUser; SocketMode = 0600; }; wantedBy = ["sockets.target" "qgis-server.service"]; before = [ "qgis-server.service" ]; }; systemd.services.qgis-server = { description = "QGIS server"; serviceConfig = { User = qgisServerUser; StandardOutput = "null"; StandardError = "journal"; StandardInput = "socket"; Environment = [ "QT_QPA_PLATFORM_PLUGIN_PATH=${pkgs.libsForQt5.qt5.qtbase}/${pkgs.libsForQt5.qt5.qtbase.qtPluginPrefix}/platforms" "QGIS_SERVER_LOG_LEVEL=0" "QGIS_SERVER_LOG_STDERR=1" ]; ExecStart = "${qgisPackage}/lib/cgi-bin/qgis_mapserv.fcgi"; }; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; }; services.nginx = { enable = true; virtualHosts."qgis" = { locations."~".extraConfig = '' gzip off; include ${pkgs.nginx}/conf/fastcgi_params; include ${pkgs.nginx}/conf/fastcgi.conf; fastcgi_pass unix:${qgisServerSocket}; ''; }; }; }; }; testScript = '' start_all() # test desktop machine.succeed("${qgisPackage}/bin/qgis --version | grep 'QGIS ${qgisPackage.version}'") machine.succeed("${qgisPackage}/bin/qgis --code ${testScript}") # test server machine.succeed("${qgisPackage}/bin/qgis_mapserver --version | grep 'QGIS ${qgisPackage.version}'") machine.succeed("curl --head http://localhost | grep 'Server:.*${qgisPackage.version}'") machine.succeed("curl http://localhost/index.json | grep 'Landing page as JSON'") ''; }) pkgs/applications/gis/qgis/default.nix +2 −0 Original line number Diff line number Diff line Loading @@ -8,11 +8,13 @@ # unwrapped package parameters , withGrass ? false , withServer ? false , withWebKit ? false }: let qgis-unwrapped = libsForQt5.callPackage ./unwrapped.nix { withGrass = withGrass; withServer = withServer; withWebKit = withWebKit; }; in symlinkJoin rec { Loading pkgs/applications/gis/qgis/ltr.nix +2 −0 Original line number Diff line number Diff line Loading @@ -8,11 +8,13 @@ # unwrapped package parameters , withGrass ? false , withServer ? false , withWebKit ? false }: let qgis-ltr-unwrapped = libsForQt5.callPackage ./unwrapped-ltr.nix { withGrass = withGrass; withServer = withServer; withWebKit = withWebKit; }; in symlinkJoin rec { Loading pkgs/applications/gis/qgis/unwrapped-ltr.nix +5 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ , wrapQtAppsHook , withGrass , withServer , withWebKit , bison Loading Loading @@ -155,7 +156,10 @@ in mkDerivation rec { "-DWITH_PDAL=True" "-DENABLE_TESTS=False" ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" ++ lib.optional withGrass (let ++ lib.optional withServer [ "-DWITH_SERVER=True" "-DQGIS_CGIBIN_SUBDIR=${placeholder "out"}/lib/cgi-bin" ] ++ lib.optional withGrass (let gmajor = lib.versions.major grass.version; gminor = lib.versions.minor grass.version; in "-DGRASS_PREFIX${gmajor}=${grass}/grass${gmajor}${gminor}" Loading Loading
nixos/tests/all-tests.nix +2 −2 Original line number Diff line number Diff line Loading @@ -849,8 +849,8 @@ in { qemu-vm-volatile-root = runTest ./qemu-vm-volatile-root.nix; qemu-vm-external-disk-image = runTest ./qemu-vm-external-disk-image.nix; qemu-vm-store = runTest ./qemu-vm-store.nix; qgis = handleTest ./qgis.nix { qgisPackage = pkgs.qgis; }; qgis-ltr = handleTest ./qgis.nix { qgisPackage = pkgs.qgis-ltr; }; qgis = handleTest ./qgis.nix { package = pkgs.qgis; }; qgis-ltr = handleTest ./qgis.nix { package = pkgs.qgis-ltr; }; qownnotes = handleTest ./qownnotes.nix {}; qtile = handleTestOn ["x86_64-linux" "aarch64-linux"] ./qtile/default.nix {}; quake3 = handleTest ./quake3.nix {}; Loading
nixos/tests/qgis.nix +59 −3 Original line number Diff line number Diff line import ./make-test-python.nix ({ pkgs, lib, qgisPackage, ... }: import ./make-test-python.nix ({ pkgs, lib, package, ... }: let qgisPackage = package.override { withServer = true; }; testScript = pkgs.writeTextFile { name = "qgis-test.py"; text = (builtins.readFile ../../pkgs/applications/gis/qgis/test.py); Loading @@ -12,19 +13,74 @@ import ./make-test-python.nix ({ pkgs, lib, qgisPackage, ... }: }; nodes = { machine = { pkgs, ... }: { machine = { config, pkgs, ... }: let qgisServerUser = config.services.nginx.user; qgisServerSocket = "/run/qgis_mapserv.socket"; in { virtualisation.diskSize = 2 * 1024; imports = [ ./common/x11.nix ]; environment.systemPackages = [ qgisPackage ]; environment.systemPackages = [ qgisPackage ]; systemd.sockets.qgis-server = { listenStreams = [ qgisServerSocket ]; socketConfig = { Accept = false; SocketUser = qgisServerUser; SocketMode = 0600; }; wantedBy = ["sockets.target" "qgis-server.service"]; before = [ "qgis-server.service" ]; }; systemd.services.qgis-server = { description = "QGIS server"; serviceConfig = { User = qgisServerUser; StandardOutput = "null"; StandardError = "journal"; StandardInput = "socket"; Environment = [ "QT_QPA_PLATFORM_PLUGIN_PATH=${pkgs.libsForQt5.qt5.qtbase}/${pkgs.libsForQt5.qt5.qtbase.qtPluginPrefix}/platforms" "QGIS_SERVER_LOG_LEVEL=0" "QGIS_SERVER_LOG_STDERR=1" ]; ExecStart = "${qgisPackage}/lib/cgi-bin/qgis_mapserv.fcgi"; }; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; }; services.nginx = { enable = true; virtualHosts."qgis" = { locations."~".extraConfig = '' gzip off; include ${pkgs.nginx}/conf/fastcgi_params; include ${pkgs.nginx}/conf/fastcgi.conf; fastcgi_pass unix:${qgisServerSocket}; ''; }; }; }; }; testScript = '' start_all() # test desktop machine.succeed("${qgisPackage}/bin/qgis --version | grep 'QGIS ${qgisPackage.version}'") machine.succeed("${qgisPackage}/bin/qgis --code ${testScript}") # test server machine.succeed("${qgisPackage}/bin/qgis_mapserver --version | grep 'QGIS ${qgisPackage.version}'") machine.succeed("curl --head http://localhost | grep 'Server:.*${qgisPackage.version}'") machine.succeed("curl http://localhost/index.json | grep 'Landing page as JSON'") ''; })
pkgs/applications/gis/qgis/default.nix +2 −0 Original line number Diff line number Diff line Loading @@ -8,11 +8,13 @@ # unwrapped package parameters , withGrass ? false , withServer ? false , withWebKit ? false }: let qgis-unwrapped = libsForQt5.callPackage ./unwrapped.nix { withGrass = withGrass; withServer = withServer; withWebKit = withWebKit; }; in symlinkJoin rec { Loading
pkgs/applications/gis/qgis/ltr.nix +2 −0 Original line number Diff line number Diff line Loading @@ -8,11 +8,13 @@ # unwrapped package parameters , withGrass ? false , withServer ? false , withWebKit ? false }: let qgis-ltr-unwrapped = libsForQt5.callPackage ./unwrapped-ltr.nix { withGrass = withGrass; withServer = withServer; withWebKit = withWebKit; }; in symlinkJoin rec { Loading
pkgs/applications/gis/qgis/unwrapped-ltr.nix +5 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ , wrapQtAppsHook , withGrass , withServer , withWebKit , bison Loading Loading @@ -155,7 +156,10 @@ in mkDerivation rec { "-DWITH_PDAL=True" "-DENABLE_TESTS=False" ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" ++ lib.optional withGrass (let ++ lib.optional withServer [ "-DWITH_SERVER=True" "-DQGIS_CGIBIN_SUBDIR=${placeholder "out"}/lib/cgi-bin" ] ++ lib.optional withGrass (let gmajor = lib.versions.major grass.version; gminor = lib.versions.minor grass.version; in "-DGRASS_PREFIX${gmajor}=${grass}/grass${gmajor}${gminor}" Loading