diff --git a/COPYING b/COPYING index 0408a7e40b7a..a632d6f58b12 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright (c) 2003-2016 Eelco Dolstra and the Nixpkgs/NixOS contributors +Copyright (c) 2003-2017 Eelco Dolstra and the Nixpkgs/NixOS contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 5fa30e863745..0306d6802bf9 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -201,6 +201,7 @@ ianwookim = "Ian-Woo Kim "; igsha = "Igor Sharonov "; ikervagyok = "Balázs Lengyel "; + ivan-tkatchev = "Ivan Tkatchev "; j-keck = "Jürgen Keck "; jagajaga = "Arseniy Seroka "; javaguirre = "Javier Aguirre "; @@ -241,6 +242,7 @@ lassulus = "Lassulus "; layus = "Guillaume Maudoux "; ldesgoui = "Lucas Desgouilles "; + league = "Christopher League "; lebastr = "Alexander Lebedev "; leenaars = "Michiel Leenaars "; leonardoce = "Leonardo Cecchi "; @@ -315,6 +317,7 @@ mudri = "James Wood "; muflax = "Stefan Dorn "; myrl = "Myrl Hex "; + namore = "Roman Naumann "; nand0p = "Fernando Jose Pando "; Nate-Devv = "Nathan Moore "; nathan-gs = "Nathan Bijnens "; diff --git a/nixos/lib/make-system-tarball.sh b/nixos/lib/make-system-tarball.sh index efb83d914287..73a009d8488a 100644 --- a/nixos/lib/make-system-tarball.sh +++ b/nixos/lib/make-system-tarball.sh @@ -54,7 +54,7 @@ mkdir -p $out/tarball rm env-vars -tar --sort=name --mtime='1970-01-01' -cvJf $out/tarball/$fileName.tar.xz * $extraArgs +tar --sort=name --mtime='@1' --owner=0 --group=0 --numeric-owner -cvJf $out/tarball/$fileName.tar.xz * $extraArgs mkdir -p $out/nix-support echo $system > $out/nix-support/system diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index eb6f8e706896..6ab4b24a3491 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -281,6 +281,7 @@ riak-cs = 263; infinoted = 264; keystone = 265; + glance = 266; # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399! @@ -532,6 +533,7 @@ riak-cs = 263; infinoted = 264; keystone = 265; + glance = 266; # When adding a gid, make sure it doesn't match an existing # uid. Users and groups with the same name should have equal diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index cd12fe4f9b36..be09fb80e0ac 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -71,6 +71,7 @@ ./programs/environment.nix ./programs/fish.nix ./programs/freetds.nix + ./programs/gphoto2.nix ./programs/info.nix ./programs/java.nix ./programs/kbdlight.nix @@ -392,6 +393,7 @@ ./services/networking/minidlna.nix ./services/networking/miniupnpd.nix ./services/networking/mosquitto.nix + ./services/networking/miredo.nix ./services/networking/mstpd.nix ./services/networking/murmur.nix ./services/networking/namecoind.nix @@ -632,4 +634,5 @@ ./virtualisation/xen-dom0.nix ./virtualisation/xe-guest-utilities.nix ./virtualisation/openstack/keystone.nix + ./virtualisation/openstack/glance.nix ] diff --git a/nixos/modules/programs/gphoto2.nix b/nixos/modules/programs/gphoto2.nix new file mode 100644 index 000000000000..47822562aee1 --- /dev/null +++ b/nixos/modules/programs/gphoto2.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + meta.maintainers = [ maintainers.league ]; + + ###### interface + options = { + programs.gphoto2 = { + enable = mkOption { + default = false; + example = true; + type = types.bool; + description = '' + Whether to configure system to use gphoto2. + To grant digital camera access to a user, the user must + be part of the camera group: + users.extraUsers.alice.extraGroups = ["camera"]; + ''; + }; + }; + }; + + ###### implementation + config = mkIf config.programs.gphoto2.enable { + services.udev.packages = [ pkgs.libgphoto2 ]; + environment.systemPackages = [ pkgs.gphoto2 ]; + users.extraGroups.camera = {}; + }; +} diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index a89ce2c743d4..8102e0e1f642 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -150,6 +150,9 @@ with lib; # tarsnap (mkRemovedOptionModule [ "services" "tarsnap" "cachedir" ] "Use services.tarsnap.archives..cachedir") + # alsa + (mkRenamedOptionModule [ "sound" "enableMediaKeys" ] [ "sound" "mediaKeys" "enable" ]) + # Options that are obsolete and have no replacement. (mkRemovedOptionModule [ "boot" "initrd" "luks" "enable" ] "") (mkRemovedOptionModule [ "programs" "bash" "enable" ] "") diff --git a/nixos/modules/services/audio/alsa.nix b/nixos/modules/services/audio/alsa.nix index c63f4dc8d7f1..53786dbc6270 100644 --- a/nixos/modules/services/audio/alsa.nix +++ b/nixos/modules/services/audio/alsa.nix @@ -33,16 +33,6 @@ in ''; }; - enableMediaKeys = mkOption { - type = types.bool; - default = false; - description = '' - Whether to enable volume and capture control with keyboard media keys. - - Enabling this will turn on . - ''; - }; - extraConfig = mkOption { type = types.lines; default = ""; @@ -54,6 +44,31 @@ in ''; }; + mediaKeys = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable volume and capture control with keyboard media keys. + + Enabling this will turn on . + ''; + }; + + volumeStep = mkOption { + type = types.string; + default = "1"; + example = "1%"; + description = '' + The value by which to increment/decrement volume on media keys. + + See amixer(1) for allowed values. + ''; + }; + + }; + }; }; @@ -90,17 +105,17 @@ in }; }; - services.actkbd = mkIf config.sound.enableMediaKeys { + services.actkbd = mkIf config.sound.mediaKeys.enable { enable = true; bindings = [ # "Mute" media key { keys = [ 113 ]; events = [ "key" ]; command = "${alsaUtils}/bin/amixer -q set Master toggle"; } # "Lower Volume" media key - { keys = [ 114 ]; events = [ "key" "rep" ]; command = "${alsaUtils}/bin/amixer -q set Master 1- unmute"; } + { keys = [ 114 ]; events = [ "key" "rep" ]; command = "${alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}- unmute"; } # "Raise Volume" media key - { keys = [ 115 ]; events = [ "key" "rep" ]; command = "${alsaUtils}/bin/amixer -q set Master 1+ unmute"; } + { keys = [ 115 ]; events = [ "key" "rep" ]; command = "${alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}+ unmute"; } # "Mic Mute" media key { keys = [ 190 ]; events = [ "key" ]; command = "${alsaUtils}/bin/amixer -q set Capture toggle"; } diff --git a/nixos/modules/services/audio/mpd.nix b/nixos/modules/services/audio/mpd.nix index 5ec2e2c26232..a89215d73828 100644 --- a/nixos/modules/services/audio/mpd.nix +++ b/nixos/modules/services/audio/mpd.nix @@ -83,11 +83,11 @@ in { listenAddress = mkOption { type = types.str; - default = "any"; + default = "127.0.0.1"; + example = "any"; description = '' - This setting sets the address for the daemon to listen on. Careful attention - should be paid if this is assigned to anything other then the default, any. - This setting can deny access to control of the daemon. + The address for the daemon to listen on. + Use any to listen on all addresses. ''; }; diff --git a/nixos/modules/services/networking/dnscrypt-proxy.nix b/nixos/modules/services/networking/dnscrypt-proxy.nix index 82bf178f4cb7..462039803f80 100644 --- a/nixos/modules/services/networking/dnscrypt-proxy.nix +++ b/nixos/modules/services/networking/dnscrypt-proxy.nix @@ -263,6 +263,8 @@ in systemd.services.dnscrypt-proxy = { description = "dnscrypt-proxy daemon"; + before = [ "nss-lookup.target" ]; + after = [ "network.target" ] ++ optional apparmorEnabled "apparmor.service" ++ optional useUpstreamResolverList "init-dnscrypt-proxy-statedir.service"; diff --git a/nixos/modules/services/networking/miredo.nix b/nixos/modules/services/networking/miredo.nix new file mode 100644 index 000000000000..e4422e7f5b02 --- /dev/null +++ b/nixos/modules/services/networking/miredo.nix @@ -0,0 +1,93 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.miredo; + pidFile = "/run/miredo.pid"; + miredoConf = pkgs.writeText "miredo.conf" '' + InterfaceName ${cfg.interfaceName} + ServerAddress ${cfg.serverAddress} + ${optionalString (cfg.bindAddress != null) "BindAddress ${cfg.bindAddress}"} + ${optionalString (cfg.bindPort != null) "BindPort ${cfg.bindPort}"} + ''; +in +{ + + ###### interface + + options = { + + services.miredo = { + + enable = mkEnableOption "Whether miredo should be run on startup."; + + package = mkOption { + type = types.package; + default = pkgs.miredo; + defaultText = "pkgs.miredo"; + description = '' + The package to use for the miredo daemon's binary. + ''; + }; + + serverAddress = mkOption { + default = "teredo.remlab.net"; + type = types.str; + description = '' + The hostname or primary IPv4 address of the Teredo server. + This setting is required if Miredo runs as a Teredo client. + "teredo.remlab.net" is an experimental service for testing only. + Please use another server for production and/or large scale deployments. + ''; + }; + + interfaceName = mkOption { + default = "teredo"; + type = types.str; + description = '' + Name of the network tunneling interface. + ''; + }; + + bindAddress = mkOption { + default = null; + type = types.nullOr types.str; + description = '' + Depending on the local firewall/NAT rules, you might need to force + Miredo to use a fixed UDP port and or IPv4 address. + ''; + }; + + bindPort = mkOption { + default = null; + type = types.nullOr types.str; + description = '' + Depending on the local firewall/NAT rules, you might need to force + Miredo to use a fixed UDP port and or IPv4 address. + ''; + }; + }; + }; + + + ###### implementation + + config = mkIf cfg.enable { + + systemd.services.miredo = { + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + description = "Teredo IPv6 Tunneling Daemon"; + serviceConfig = { + Restart = "always"; + RestartSec = "5s"; + ExecStartPre = "${cfg.package}/bin/miredo-checkconf -f ${miredoConf}"; + ExecStart = "${cfg.package}/bin/miredo -c ${miredoConf} -p ${pidFile} -f"; + ExecReload = "/bin/kill -HUP $MAINPID"; + }; + }; + + }; + +} diff --git a/nixos/modules/services/torrent/flexget.nix b/nixos/modules/services/torrent/flexget.nix index 1252aa1c549c..4b9038e3e251 100644 --- a/nixos/modules/services/torrent/flexget.nix +++ b/nixos/modules/services/torrent/flexget.nix @@ -4,7 +4,7 @@ with lib; let cfg = config.services.flexget; - pkg = pkgs.python27Packages.flexget; + pkg = pkgs.flexget; ymlFile = pkgs.writeText "flexget.yml" '' ${cfg.config} @@ -54,12 +54,12 @@ in { config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.python27Packages.flexget ]; + environment.systemPackages = [ pkg ]; systemd.services = { flexget = { description = "FlexGet Daemon"; - path = [ pkgs.pythonPackages.flexget ]; + path = [ pkg ]; serviceConfig = { User = cfg.user; Environment = "TZ=${config.time.timeZone}"; diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index 5d1af09e7aa7..17e84b1d9a16 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -123,6 +123,7 @@ in { services.packagekit.enable = mkDefault true; hardware.bluetooth.enable = mkDefault true; services.xserver.libinput.enable = mkDefault true; # for controlling touchpad settings via gnome control center + services.udev.packages = [ pkgs.gnome3.gnome_settings_daemon ]; fonts.fonts = [ pkgs.dejavu_fonts pkgs.cantarell_fonts ]; diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix index 92249573a4b7..4b30a38f832f 100644 --- a/nixos/modules/virtualisation/docker.nix +++ b/nixos/modules/virtualisation/docker.nix @@ -130,4 +130,8 @@ in } ]); + imports = [ + (mkRemovedOptionModule ["virtualisation" "docker" "socketActivation"] "This option was removed in favor of starting docker at boot") + ]; + } diff --git a/nixos/modules/virtualisation/openstack/common.nix b/nixos/modules/virtualisation/openstack/common.nix index 3fce54a2fa59..2feb0a873951 100644 --- a/nixos/modules/virtualisation/openstack/common.nix +++ b/nixos/modules/virtualisation/openstack/common.nix @@ -51,4 +51,34 @@ rec { }; };}); }; + + databaseOption = name: { + host = mkOption { + type = types.str; + default = "localhost"; + description = '' + Host of the database. + ''; + }; + + name = mkOption { + type = types.str; + default = name; + description = '' + Name of the existing database. + ''; + }; + + user = mkOption { + type = types.str; + default = name; + description = '' + The database user. The user must exist and has access to + the specified database. + ''; + }; + password = mkSecretOption { + name = name + "MysqlPassword"; + description = "The database user's password";}; + }; } diff --git a/nixos/modules/virtualisation/openstack/glance.nix b/nixos/modules/virtualisation/openstack/glance.nix new file mode 100644 index 000000000000..4d85718e369c --- /dev/null +++ b/nixos/modules/virtualisation/openstack/glance.nix @@ -0,0 +1,245 @@ +{ config, lib, pkgs, ... }: + +with lib; with import ./common.nix {inherit lib;}; + +let + cfg = config.virtualisation.openstack.glance; + commonConf = '' + [database] + connection = "mysql://${cfg.database.user}:${cfg.database.password.pattern}@${cfg.database.host}/${cfg.database.name}" + notification_driver = noop + + [keystone_authtoken] + auth_url = ${cfg.authUrl} + auth_plugin = password + project_name = service + project_domain_id = default + user_domain_id = default + username = ${cfg.serviceUsername} + password = ${cfg.servicePassword.pattern} + + [glance_store] + default_store = file + filesystem_store_datadir = /var/lib/glance/images/ + ''; + glanceApiConfTpl = pkgs.writeText "glance-api.conf" '' + ${commonConf} + + [paste_deploy] + flavor = keystone + config_file = ${cfg.package}/etc/glance-api-paste.ini + ''; + glanceRegistryConfTpl = pkgs.writeText "glance-registry.conf" '' + ${commonConf} + + [paste_deploy] + config_file = ${cfg.package}/etc/glance-registry-paste.ini + ''; + glanceApiConf = "/var/lib/glance/glance-api.conf"; + glanceRegistryConf = "/var/lib/glance/glance-registry.conf"; + +in { + options.virtualisation.openstack.glance = { + package = mkOption { + type = types.package; + default = pkgs.glance; + example = literalExample "pkgs.glance"; + description = '' + Glance package to use. + ''; + }; + + enable = mkOption { + default = false; + type = types.bool; + description = '' + This option enables Glance as a single-machine + installation. That is, all of Glance's components are + enabled on this machine. This is useful for evaluating and + experimenting with Glance. Note we are currently not + providing any configurations for a multi-node setup. + ''; + }; + + authUrl = mkOption { + type = types.str; + default = http://localhost:5000; + description = '' + Complete public Identity (Keystone) API endpoint. Note this is + unversionned. + ''; + }; + + serviceUsername = mkOption { + type = types.str; + default = "glance"; + description = '' + The Glance service username. This user is created if bootstrap + is enable, otherwise it has to be manually created before + starting this service. + ''; + }; + + servicePassword = mkSecretOption { + name = "glanceAdminPassword"; + description = '' + The Glance service user's password. + ''; + }; + + database = databaseOption "glance"; + + bootstrap = { + enable = mkOption { + default = false; + type = types.bool; + description = '' + Bootstrap the Glance service by creating the service tenant, + an admin account and a public endpoint. This option provides + a ready-to-use glance service. This is only done at the + first Glance execution by the systemd post start section. + The keystone admin account is used to create required + Keystone resource for the Glance service. + + This option is a helper for setting up + development or testing environments. + ''; + }; + + endpointPublic = mkOption { + type = types.str; + default = "http://localhost:9292"; + description = '' + The public image endpoint. The link + create endpoint provides more informations + about that. + ''; + }; + + keystoneAdminUsername = mkOption { + type = types.str; + default = "admin"; + description = '' + The keystone admin user name used to create the Glance account. + ''; + }; + + keystoneAdminPassword = mkSecretOption { + name = "keystoneAdminPassword"; + description = '' + The keystone admin user's password. + ''; + }; + + keystoneAdminTenant = mkOption { + type = types.str; + default = "admin"; + description = '' + The keystone admin tenant used to create the Glance account. + ''; + }; + keystoneAuthUrl = mkOption { + type = types.str; + default = "http://localhost:5000/v2.0"; + description = '' + The keystone auth url used to create the Glance account. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + users.extraUsers = [{ + name = "glance"; + group = "glance"; + uid = config.ids.gids.glance; + + }]; + users.extraGroups = [{ + name = "glance"; + gid = config.ids.gids.glance; + }]; + + systemd.services.glance-registry = { + description = "OpenStack Glance Registry Daemon"; + after = [ "network.target"]; + path = [ pkgs.curl pkgs.pythonPackages.keystoneclient pkgs.gawk ]; + wantedBy = [ "multi-user.target" ]; + preStart = '' + mkdir -m 775 -p /var/lib/glance/{images,scrubber,image_cache} + chown glance:glance /var/lib/glance/{images,scrubber,image_cache} + + # Secret file managment + cp ${glanceRegistryConfTpl} ${glanceRegistryConf}; + chown glance:glance ${glanceRegistryConf}; + chmod 640 ${glanceRegistryConf} + ${replaceSecret cfg.database.password glanceRegistryConf} + ${replaceSecret cfg.servicePassword glanceRegistryConf} + + cp ${glanceApiConfTpl} ${glanceApiConf}; + chown glance:glance ${glanceApiConf}; + chmod 640 ${glanceApiConf} + ${replaceSecret cfg.database.password glanceApiConf} + ${replaceSecret cfg.servicePassword glanceApiConf} + + # Initialise the database + ${cfg.package}/bin/glance-manage --config-file=${glanceApiConf} --config-file=${glanceRegistryConf} db_sync + ''; + postStart = '' + set -eu + export OS_AUTH_URL=${cfg.bootstrap.keystoneAuthUrl} + export OS_USERNAME=${cfg.bootstrap.keystoneAdminUsername} + export OS_PASSWORD=${getSecret cfg.bootstrap.keystoneAdminPassword} + export OS_TENANT_NAME=${cfg.bootstrap.keystoneAdminTenant} + + # Wait until the keystone is available for use + count=0 + while ! keystone user-get ${cfg.bootstrap.keystoneAdminUsername} > /dev/null + do + if [ $count -eq 30 ] + then + echo "Tried 30 times, giving up..." + exit 1 + fi + + echo "Keystone not yet started. Waiting for 1 second..." + count=$((count++)) + sleep 1 + done + + # If the service glance doesn't exist, we consider glance is + # not initialized + if ! keystone service-get glance + then + keystone service-create --type image --name glance + ID=$(keystone service-get glance | awk '/ id / { print $4 }') + keystone endpoint-create --region RegionOne --service $ID --internalurl http://localhost:9292 --adminurl http://localhost:9292 --publicurl ${cfg.bootstrap.endpointPublic} + + keystone user-create --name ${cfg.serviceUsername} --tenant service --pass ${getSecret cfg.servicePassword} + keystone user-role-add --tenant service --user ${cfg.serviceUsername} --role admin + fi + ''; + serviceConfig = { + PermissionsStartOnly = true; # preStart must be run as root + TimeoutStartSec = "600"; # 10min for initial db migrations + User = "glance"; + Group = "glance"; + ExecStart = "${cfg.package}/bin/glance-registry --config-file=${glanceRegistryConf}"; + }; + }; + systemd.services.glance-api = { + description = "OpenStack Glance API Daemon"; + after = [ "glance-registry.service" "network.target"]; + requires = [ "glance-registry.service" "network.target"]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + PermissionsStartOnly = true; # preStart must be run as root + User = "glance"; + Group = "glance"; + ExecStart = "${cfg.package}/bin/glance-api --config-file=${glanceApiConf}"; + }; + }; + }; + +} diff --git a/nixos/release.nix b/nixos/release.nix index 366eecf773e2..dfa9b67654fb 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -242,6 +242,7 @@ in rec { tests.firewall = callTest tests/firewall.nix {}; tests.fleet = hydraJob (import tests/fleet.nix { system = "x86_64-linux"; }); #tests.gitlab = callTest tests/gitlab.nix {}; + tests.glance = callTest tests/glance.nix {}; tests.gocd-agent = callTest tests/gocd-agent.nix {}; tests.gocd-server = callTest tests/gocd-server.nix {}; tests.gnome3 = callTest tests/gnome3.nix {}; diff --git a/nixos/tests/glance.nix b/nixos/tests/glance.nix new file mode 100644 index 000000000000..992b77227a4b --- /dev/null +++ b/nixos/tests/glance.nix @@ -0,0 +1,77 @@ +{ system ? builtins.currentSystem }: + +with import ../lib/testing.nix { inherit system; }; +with pkgs.lib; + +let + glanceMysqlPassword = "glanceMysqlPassword"; + glanceAdminPassword = "glanceAdminPassword"; + + createDb = pkgs.writeText "db-provisionning.sql" '' + create database keystone; + GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone'; + GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone'; + + create database glance; + GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '${glanceMysqlPassword}'; + GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '${glanceMysqlPassword}'; + ''; + + image = + (import ../lib/eval-config.nix { + inherit system; + modules = [ ../../nixos/modules/virtualisation/nova-image.nix ]; + }).config.system.build.novaImage; + + # The admin keystone account + adminOpenstackCmd = "OS_TENANT_NAME=admin OS_USERNAME=admin OS_PASSWORD=keystone OS_AUTH_URL=http://localhost:5000/v3 OS_IDENTITY_API_VERSION=3 openstack"; + +in makeTest { + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ lewo ]; + }; + machine = + { config, pkgs, ... }: + { + services.mysql.enable = true; + services.mysql.package = pkgs.mysql; + services.mysql.initialScript = createDb; + + virtualisation = { + openstack.keystone = { + enable = true; + database.password = { value = "keystone"; storage = "fromNixStore"; }; + adminToken = { value = "adminToken"; storage = "fromNixStore"; }; + bootstrap.enable = true; + bootstrap.adminPassword = { value = "keystone"; storage = "fromNixStore"; }; + }; + + openstack.glance = { + enable = true; + database.password = { value = glanceMysqlPassword; storage = "fromNixStore"; }; + servicePassword = { value = glanceAdminPassword; storage = "fromNixStore"; }; + + bootstrap = { + enable = true; + keystoneAdminPassword = { value = "keystone"; storage = "fromNixStore"; }; + }; + }; + + memorySize = 2096; + diskSize = 4 * 1024; + }; + + environment.systemPackages = with pkgs.pythonPackages; with pkgs; [ + openstackclient + ]; + }; + + testScript = + '' + $machine->waitForUnit("glance-api.service"); + + # Since Glance api can take time to start, we retry until success + $machine->waitUntilSucceeds("${adminOpenstackCmd} image create nixos --file ${image}/nixos.img --disk-format qcow2 --container-format bare --public"); + $machine->succeed("${adminOpenstackCmd} image list") =~ /nixos/ or die; + ''; +} diff --git a/pkgs/applications/editors/kakoune/default.nix b/pkgs/applications/editors/kakoune/default.nix index 73ee7ed64cd5..14b13c394f31 100644 --- a/pkgs/applications/editors/kakoune/default.nix +++ b/pkgs/applications/editors/kakoune/default.nix @@ -4,17 +4,18 @@ with stdenv.lib; stdenv.mkDerivation rec { name = "kakoune-nightly-${version}"; - version = "2016-12-10"; + version = "2016-12-30"; src = fetchFromGitHub { repo = "kakoune"; owner = "mawww"; - rev = "e44129577a010ebb4dc609b806104d3175659074"; - sha256 = "1jkpbk6wa9x5nlv002y1whv6ddhqawxzbp3jcbzcb51cg8bz0b1l"; + rev = "76c58aa022a896dc170c207ff821992ee354d934"; + sha256 = "0hgpcp6444cyg4bm0a9ypywjwfh19qpqpfr5w0wcd2y3clnsvsdz"; }; buildInputs = [ ncurses boost asciidoc docbook_xsl libxslt ]; buildPhase = '' sed -ie 's#--no-xmllint#--no-xmllint --xsltproc-opts="--nonet"#g' src/Makefile + substituteInPlace src/Makefile --replace "boost_regex-mt" "boost_regex" export PREFIX=$out (cd src && make ) ''; @@ -28,6 +29,6 @@ stdenv.mkDerivation rec { description = "A vim inspired text editor"; license = licenses.publicDomain; maintainers = with maintainers; [ vrthra ]; - platforms = platforms.linux; + platforms = platforms.unix; }; } diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix index 738476b98e2e..0b45f9502fad 100644 --- a/pkgs/applications/editors/nano/default.nix +++ b/pkgs/applications/editors/nano/default.nix @@ -12,10 +12,10 @@ with stdenv.lib; stdenv.mkDerivation rec { name = "nano-${version}"; - version = "2.7.2"; + version = "2.7.3"; src = fetchurl { url = "mirror://gnu/nano/${name}.tar.xz"; - sha256 = "1hlhwgvzdgkc7k74fbbn49hn6vmvzqr7h8gclgl7r1c6qrrny0bp"; + sha256 = "1z0bfyc5cvv83l3bjmlcwl49mpxrp65k5ffsfpnayfyjc18fy9nr"; }; nativeBuildInputs = [ texinfo ] ++ optional enableNls gettext; buildInputs = [ ncurses ]; diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 44e07cc22c0b..7d2828115f77 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -60,6 +60,7 @@ stdenv.mkDerivation { wrapProgram $out/bin/grass70 \ --set PYTHONPATH $PYTHONPATH \ --set GRASS_PYTHON ${python2Packages.python}/bin/${python2Packages.python.executable} + --suffix LD_LIBRARY_PATH ':' '${gdal}/lib' ln -s $out/grass-*/lib $out/lib ''; diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix index a9ad0210baa1..ea5113246ba9 100644 --- a/pkgs/applications/graphics/darktable/default.nix +++ b/pkgs/applications/graphics/darktable/default.nix @@ -11,12 +11,12 @@ assert stdenv ? glibc; stdenv.mkDerivation rec { - version = "2.0.7"; + version = "2.2.0"; name = "darktable-${version}"; src = fetchurl { url = "https://github.com/darktable-org/darktable/releases/download/release-${version}/darktable-${version}.tar.xz"; - sha256 = "1aqxiaw89xdx0s0h3gb9nvdzw4690y3kp7h794sihf2581bn28m9"; + sha256 = "3eca193831faae58200bb1cb6ef29e658bce43a81706b54420953a7c33d79377"; }; buildInputs = @@ -34,6 +34,16 @@ stdenv.mkDerivation rec { "-DBUILD_USERMANUAL=False" ]; + # darktable changed its rpath handling in commit + # 83c70b876af6484506901e6b381304ae0d073d3c and as a result the + # binaries can't find libdarktable.so, so change LD_LIBRARY_PATH in + # the wrappers: + preFixup = '' + gappsWrapperArgs+=( + --prefix LD_LIBRARY_PATH ":" "$out/lib/darktable" + ) + ''; + meta = with stdenv.lib; { description = "Virtual lighttable and darkroom for photographers"; homepage = https://www.darktable.org; diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix index b98d327d3b8a..5c05d1e17873 100644 --- a/pkgs/applications/misc/calibre/default.nix +++ b/pkgs/applications/misc/calibre/default.nix @@ -5,12 +5,12 @@ }: stdenv.mkDerivation rec { - version = "2.73.0"; + version = "2.76.0"; name = "calibre-${version}"; src = fetchurl { url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz"; - sha256 = "17qs7dakzd25wbshsny2x82ppdqa6kwwfbp2vp1i8qmfc1nq61gc"; + sha256 = "1xfm586n6gm44mkyn25mbiyhj6w9ji9yl6fvmnr4zk1q6qcga3v8"; }; patches = [ @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { apsw beautifulsoup cssselect cssutils dateutil lxml mechanize netifaces pillow python pyqt5 sip # the following are distributed with calibre, but we use upstream instead - chardet cherrypy html5lib odfpy routes + chardet cherrypy html5lib_0_9999999 odfpy routes ]); installPhase = '' diff --git a/pkgs/applications/misc/font-manager/default.nix b/pkgs/applications/misc/font-manager/default.nix index 5f8d00ce996a..6d67d3a340f5 100644 --- a/pkgs/applications/misc/font-manager/default.nix +++ b/pkgs/applications/misc/font-manager/default.nix @@ -35,6 +35,7 @@ stdenv.mkDerivation rec { gnome3.gucharmap gnome3.libgee gnome3.file-roller + gnome3.defaultIconTheme ]; enableParallelBuilding = true; diff --git a/pkgs/applications/misc/rofi/default.nix b/pkgs/applications/misc/rofi/default.nix index d6ff999b23d4..c7da77a3a030 100644 --- a/pkgs/applications/misc/rofi/default.nix +++ b/pkgs/applications/misc/rofi/default.nix @@ -1,14 +1,14 @@ -{ stdenv, fetchurl, autoreconfHook, pkgconfig, libxkbcommon, pango +{ stdenv, fetchurl, autoreconfHook, pkgconfig, libxkbcommon, pango, which, git , cairo, glib, libxcb, xcbutil, xcbutilwm, xcbutilxrm, libstartup_notification }: stdenv.mkDerivation rec { - version = "1.2.0"; + version = "1.3.0"; name = "rofi-${version}"; src = fetchurl { url = "https://github.com/DaveDavenport/rofi/releases/download/${version}/${name}.tar.xz"; - sha256 = "0xxx0xpxhrhlhi2axq9867zqrhwqavc1qrr833k1xr0pvm5m0aqc"; + sha256 = "1a65ai93ygras5bi7wc0s5i3zqslzqlnw3klq3sdnp2p0d6hjjqn"; }; preConfigure = '' @@ -17,8 +17,8 @@ stdenv.mkDerivation rec { sed -i 's/~root/~nobody/g' test/helper-expand.c ''; - buildInputs = [ autoreconfHook pkgconfig libxkbcommon pango cairo - libstartup_notification libxcb xcbutil xcbutilwm xcbutilxrm + buildInputs = [ autoreconfHook pkgconfig libxkbcommon pango cairo git + libstartup_notification libxcb xcbutil xcbutilwm xcbutilxrm which ]; doCheck = true; diff --git a/pkgs/applications/networking/dropbox/default.nix b/pkgs/applications/networking/dropbox/default.nix index 20d50bd0f7a7..e78230a74b4d 100644 --- a/pkgs/applications/networking/dropbox/default.nix +++ b/pkgs/applications/networking/dropbox/default.nix @@ -23,11 +23,11 @@ let # NOTE: When updating, please also update in current stable, # as older versions stop working - version = "16.4.29"; + version = "16.4.30"; sha256 = { - "x86_64-linux" = "0zng19qisbr3c9d312ar43p1b44xidabj4x2l3g3q85i300vj661"; - "i686-linux" = "0hc5fs0akc437valbxwlymk7ncjkdnhc51pja5bbiy48gqmd42bb"; + "x86_64-linux" = "0inwc12d14i6gyfllxbhizb434a7vy0l5nvc07kz0bca7c4665wb"; + "i686-linux" = "0pdn8558ll317k3jrrjir90pn6abwbm99y9wzdq39wxj4dmrlh6w"; }."${stdenv.system}" or (throw "system ${stdenv.system} not supported"); arch = diff --git a/pkgs/applications/networking/dyndns/cfdyndns/default.nix b/pkgs/applications/networking/dyndns/cfdyndns/default.nix index d3be9c28df35..a79404e77c85 100644 --- a/pkgs/applications/networking/dyndns/cfdyndns/default.nix +++ b/pkgs/applications/networking/dyndns/cfdyndns/default.nix @@ -27,5 +27,6 @@ buildRustPackage rec { license = stdenv.lib.licenses.mit; maintainers = with maintainers; [ colemickens ]; platforms = with platforms; linux; + broken = true; }; } diff --git a/pkgs/applications/networking/flexget/default.nix b/pkgs/applications/networking/flexget/default.nix new file mode 100644 index 000000000000..f7dd96183070 --- /dev/null +++ b/pkgs/applications/networking/flexget/default.nix @@ -0,0 +1,39 @@ +{ lib +, pythonPackages +, fetchurl +, transmission +, deluge +, config +}: + +with pythonPackages; + +buildPythonPackage rec { + version = "1.2.337"; + name = "FlexGet-${version}"; + disabled = isPy3k; + + src = fetchurl { + url = "mirror://pypi/F/FlexGet/${name}.tar.gz"; + sha256 = "0f7aaf0bf37860f0c5adfb0ba59ca228aa3f5c582131445623a4c3bc82d45346"; + }; + + doCheck = false; + + buildInputs = [ nose ]; + propagatedBuildInputs = [ + paver feedparser sqlalchemy pyyaml rpyc + beautifulsoup_4_1_3 html5lib_0_9999999 pyrss2gen pynzb progressbar jinja2 flask + cherrypy requests dateutil_2_1 jsonschema python_tvrage tmdb3 + guessit pathpy apscheduler ] + # enable deluge and transmission plugin support, if they're installed + ++ lib.optional (config.deluge or false) deluge + ++ lib.optional (transmission != null) transmissionrpc; + + meta = { + homepage = http://flexget.com/; + description = "Multipurpose automation tool for content like torrents"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ domenkozar ]; + }; +} \ No newline at end of file diff --git a/pkgs/applications/networking/mailreaders/astroid/default.nix b/pkgs/applications/networking/mailreaders/astroid/default.nix new file mode 100644 index 000000000000..31cad15296cf --- /dev/null +++ b/pkgs/applications/networking/mailreaders/astroid/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchFromGitHub, scons, pkgconfig, gnome3, gmime, webkitgtk24x + , libsass, notmuch, boost, makeWrapper }: + +stdenv.mkDerivation rec { + name = "astroid-${version}"; + version = "0.6"; + + src = fetchFromGitHub { + owner = "astroidmail"; + repo = "astroid"; + rev = "v${version}"; + sha256 = "0zashjmqv8ips9q8ckyhgm9hfyf01wpgs6g21cwl05q5iklc5x7r"; + }; + + patches = [ ./propagate-environment.patch ]; + + buildInputs = [ scons pkgconfig gnome3.gtkmm gmime webkitgtk24x libsass + gnome3.libpeas notmuch boost gnome3.gsettings_desktop_schemas + makeWrapper ]; + + buildPhase = "scons --prefix=$out build"; + installPhase = "scons --prefix=$out install"; + + preFixup = '' + wrapProgram "$out/bin/astroid" \ + --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" + ''; + + meta = { + homepage = "https://astroidmail.github.io/"; + description = "GTK+ frontend to the notmuch mail system"; + maintainers = [ stdenv.lib.maintainers.bdimcheff ]; + license = stdenv.lib.licenses.gpl3Plus; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/applications/networking/mailreaders/astroid/propagate-environment.patch b/pkgs/applications/networking/mailreaders/astroid/propagate-environment.patch new file mode 100644 index 000000000000..db536ea721f2 --- /dev/null +++ b/pkgs/applications/networking/mailreaders/astroid/propagate-environment.patch @@ -0,0 +1,13 @@ +diff --git a/SConstruct b/SConstruct +index a80bca3..ed2cd6d 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -5,7 +5,7 @@ from subprocess import * + def getGitDesc(): + return Popen('git describe --abbrev=8 --tags --always', stdout=PIPE, shell=True).stdout.read ().strip () + +-env = Environment () ++env = Environment(ENV = os.environ) + + AddOption ("--release", action="store", dest="release", default="git", help="Make a release (default: git describe output)") + AddOption ("--enable-debug", action="store", dest="debug", default=None, help="Enable the -g flag for debugging (default: true when release is git)") diff --git a/pkgs/applications/networking/mailreaders/neomutt/default.nix b/pkgs/applications/networking/mailreaders/neomutt/default.nix index 2033dfc8e913..57f633d2c990 100644 --- a/pkgs/applications/networking/mailreaders/neomutt/default.nix +++ b/pkgs/applications/networking/mailreaders/neomutt/default.nix @@ -1,20 +1,20 @@ { stdenv, fetchFromGitHub, which, autoconf, automake, ncurses, perl -, cyrus_sasl, gdbm, gpgme, kerberos, libidn, notmuch, openssl }: +, cyrus_sasl, gdbm, gpgme, kerberos, libidn, notmuch, openssl, lmdb }: stdenv.mkDerivation rec { - version = "20161104"; + version = "20161126"; name = "neomutt-${version}"; src = fetchFromGitHub { owner = "neomutt"; repo = "neomutt"; rev = "neomutt-${version}"; - sha256 = "070p18khvxsrcn30jhyrnagka5mgza9mi5vmrrr6xl8mpgkyrlaw"; + sha256 = "10ycfya11pvwv0rdyyak56r6f8ia8yf0h8qyi904bbpvm8lqvqfd"; }; buildInputs = [ autoconf automake cyrus_sasl gdbm gpgme kerberos libidn ncurses - notmuch which openssl perl ]; + notmuch which openssl perl lmdb ]; configureFlags = [ "--enable-debug" @@ -36,6 +36,7 @@ stdenv.mkDerivation rec { "--with-curses" "--with-regex" "--with-idn" + "--with-lmdb" # Look in $PATH at runtime, instead of hardcoding /usr/bin/sendmail "ac_cv_path_SENDMAIL=sendmail" diff --git a/pkgs/applications/office/ppl-address-book/Gemfile b/pkgs/applications/office/ppl-address-book/Gemfile new file mode 100644 index 000000000000..0039c4366963 --- /dev/null +++ b/pkgs/applications/office/ppl-address-book/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'ppl' diff --git a/pkgs/applications/office/ppl-address-book/Gemfile.lock b/pkgs/applications/office/ppl-address-book/Gemfile.lock new file mode 100644 index 000000000000..5054bb8b9c8b --- /dev/null +++ b/pkgs/applications/office/ppl-address-book/Gemfile.lock @@ -0,0 +1,34 @@ +GEM + remote: https://rubygems.org/ + specs: + colored (1.2) + greencard (0.0.5) + i18n (0.7.0) + inifile (2.0.2) + mail (2.5.3) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.25.1) + morphine (0.1.1) + polyglot (0.3.5) + ppl (2.4.0) + colored (= 1.2) + greencard (= 0.0.5) + inifile (= 2.0.2) + mail (= 2.5.3) + morphine (= 0.1.1) + rugged (= 0.17.0.b6) + rugged (0.17.0.b6) + treetop (1.4.15) + polyglot + polyglot (>= 0.3.1) + +PLATFORMS + ruby + +DEPENDENCIES + ppl + +BUNDLED WITH + 1.12.5 diff --git a/pkgs/applications/office/ppl-address-book/default.nix b/pkgs/applications/office/ppl-address-book/default.nix new file mode 100644 index 000000000000..1c48fc50842d --- /dev/null +++ b/pkgs/applications/office/ppl-address-book/default.nix @@ -0,0 +1,38 @@ +{ stdenv, lib, bundlerEnv, ruby, makeWrapper, which }: + +let + pname = "ppl-address-book"; + + version = (import ./gemset.nix).ppl.version; + + env = bundlerEnv rec { + name = "${pname}-env-${version}"; + inherit ruby; + gemfile = ./Gemfile; + lockfile = ./Gemfile.lock; + gemset = ./gemset.nix; + + gemConfig.rugged = attrs: { buildInputs = [ which ]; }; + }; + +in stdenv.mkDerivation { + name = "${pname}-${version}"; + + phases = [ "installPhase" ]; + + buildInputs = [ env makeWrapper ]; + + installPhase = '' + mkdir -p $out/bin + makeWrapper ${env}/bin/ppl $out/bin/ppl + ''; + + meta = with lib; { + description = "Address book software for command-line users"; + homepage = http://ppladdressbook.org/; + license = with licenses; mit; + maintainers = with maintainers; [ chris-martin ]; + platforms = platforms.unix; + }; + +} diff --git a/pkgs/applications/office/ppl-address-book/gemset.nix b/pkgs/applications/office/ppl-address-book/gemset.nix new file mode 100644 index 000000000000..e8229f6153fd --- /dev/null +++ b/pkgs/applications/office/ppl-address-book/gemset.nix @@ -0,0 +1,90 @@ +{ + colored = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0b0x5jmsyi0z69bm6sij1k89z7h0laag3cb4mdn7zkl9qmxb90lx"; + type = "gem"; + }; + version = "1.2"; + }; + greencard = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "11pxrl1w8c7m7rmnnmdaplrv53qgylyvkv8bzsfyjna7k16hynvq"; + type = "gem"; + }; + version = "0.0.5"; + }; + i18n = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1i5z1ykl8zhszsxcs8mzl8d0dxgs3ylz8qlzrw74jb0gplkx6758"; + type = "gem"; + }; + version = "0.7.0"; + }; + inifile = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "03rpacxnrnisjhd2zhc7629ica958bkdbakicl5kipw1wbprck25"; + type = "gem"; + }; + version = "2.0.2"; + }; + mail = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1afr3acz7vsvr4gp6wnrkw1iwbjhf14mh8g8mlm40r86wcwzr39k"; + type = "gem"; + }; + version = "2.5.3"; + }; + mime-types = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0mhzsanmnzdshaba7gmsjwnv168r1yj8y0flzw88frw1cickrvw8"; + type = "gem"; + }; + version = "1.25.1"; + }; + morphine = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "05aw93cijd1gq39ikw2dw3i2c79bjq05kvxrs81mqxqdlini5wwa"; + type = "gem"; + }; + version = "0.1.1"; + }; + polyglot = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1bqnxwyip623d8pr29rg6m8r0hdg08fpr2yb74f46rn1wgsnxmjr"; + type = "gem"; + }; + version = "0.3.5"; + }; + ppl = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0vpp4s12ggbk5kpl9z1i7vi9vvghgxrc8my35yk8knckg5waxg47"; + type = "gem"; + }; + version = "2.4.0"; + }; + rugged = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "025rj3rkj5yxf4pjj1s8x4yzshlyni3hgrjwhggg54nvw6b688qi"; + type = "gem"; + }; + version = "0.17.0.b6"; + }; + treetop = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1zqj5y0mvfvyz11nhsb4d5ch0i0rfcyj64qx19mw4qhg3hh8z9pz"; + type = "gem"; + }; + version = "1.4.15"; + }; +} \ No newline at end of file diff --git a/pkgs/applications/science/logic/lean/default.nix b/pkgs/applications/science/logic/lean/default.nix index d1f4bc0a4145..af338338550f 100644 --- a/pkgs/applications/science/logic/lean/default.nix +++ b/pkgs/applications/science/logic/lean/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { name = "lean-${version}"; - version = "2016-12-08"; + version = "2016-12-30"; src = fetchFromGitHub { owner = "leanprover"; repo = "lean"; - rev = "7b63d6566faaf1dc0f2c8e873c61f51dce9ab618"; - sha256 = "0xxr7dnh7pmdbpxhl3cq9clwamxjk54zcxplsrz6xirk0qy7ga4l"; + rev = "fd4fffea27c442b12a45f664a8680ebb47482ca3"; + sha256 = "1izbjxbr1nvv5kv2b7qklqjx2b1qmwrxhmvk0f2lrl9pxz9h0bmd"; }; buildInputs = [ gmp mpfr cmake gperftools ]; diff --git a/pkgs/applications/science/misc/fityk/default.nix b/pkgs/applications/science/misc/fityk/default.nix index 7d9f8542eed3..1c1cac203f8b 100644 --- a/pkgs/applications/science/misc/fityk/default.nix +++ b/pkgs/applications/science/misc/fityk/default.nix @@ -3,7 +3,7 @@ let name = "fityk"; - version = "1.3.0"; + version = "1.3.1"; in stdenv.mkDerivation { name = "${name}-${version}"; @@ -12,7 +12,7 @@ stdenv.mkDerivation { owner = "wojdyr"; repo = "fityk"; rev = "v${version}"; - sha256 = "07xzhy47q5ddg1qn51qds4wp6r5g2cx8bla0hm0a9ipr2hg92lm9"; + sha256 = "0kmrjjjwrh6xgw590awcd52b86kksmv6rfgih75zvpiavr1ygwsi"; }; buildInputs = [ autoreconfHook wxGTK30 boost lua zlib bzip2 xylib readline diff --git a/pkgs/applications/science/physics/sherpa/default.nix b/pkgs/applications/science/physics/sherpa/default.nix new file mode 100644 index 000000000000..d863964ad90a --- /dev/null +++ b/pkgs/applications/science/physics/sherpa/default.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchurl, gfortran, sqlite }: + +stdenv.mkDerivation rec { + name = "sherpa-${version}"; + version = "2.2.1"; + + src = fetchurl { + url = "http://www.hepforge.org/archive/sherpa/SHERPA-MC-${version}.tar.gz"; + sha256 = "13vkz6w8kqyv8sgy3mxnlps5ykml5rnlj50vjj0pp9rgbl5y8ali"; + }; + + buildInputs = [ gfortran sqlite ]; + + enableParallelBuilding = true; + + meta = { + description = "Simulation of High-Energy Reactions of PArticles in lepton-lepton, lepton-photon, photon-photon, lepton-hadron and hadron-hadron collisions"; + license = stdenv.lib.licenses.gpl2; + homepage = https://sherpa.hepforge.org; + platforms = stdenv.lib.platforms.unix; + maintainers = with stdenv.lib.maintainers; [ veprbl ]; + }; +} diff --git a/pkgs/applications/version-management/cvsps/01_ignoretrunk.dpatch b/pkgs/applications/version-management/cvsps/01_ignoretrunk.dpatch deleted file mode 100644 index 39185ae2bfa6..000000000000 --- a/pkgs/applications/version-management/cvsps/01_ignoretrunk.dpatch +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 01_ignoretrunk.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Ignore TRUNK branch name patch - -@DPATCH@ - -diff -urN cvsps-2.1.orig/cvsps.c cvsps-2.1/cvsps.c ---- cvsps-2.1.orig/cvsps.c 2005-05-25 22:39:40.000000000 -0500 -+++ cvsps-2.1/cvsps.c 2005-06-19 23:07:20.000000000 -0500 -@@ -2104,6 +2109,11 @@ - - if (!get_branch_ext(rev, eot, &leaf)) - { -+ if (strcmp(tag, "TRUNK") == 0) -+ { -+ debug(DEBUG_STATUS, "ignoring the TRUNK branch/tag"); -+ return; -+ } - debug(DEBUG_APPERROR, "malformed revision"); - exit(1); - } diff --git a/pkgs/applications/version-management/cvsps/02_dynamicbufferalloc.dpatch b/pkgs/applications/version-management/cvsps/02_dynamicbufferalloc.dpatch deleted file mode 100644 index 70ffb02a21aa..000000000000 --- a/pkgs/applications/version-management/cvsps/02_dynamicbufferalloc.dpatch +++ /dev/null @@ -1,125 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 02_dynamicbufferalloc.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Dynamic buffer allocation - -@DPATCH@ - -diff -urN cvsps-2.1-orig/cache.c cvsps-2.1/cache.c ---- cvsps-2.1-orig/cache.c 2005-05-25 22:39:40.000000000 -0500 -+++ cvsps-2.1/cache.c 2005-07-26 15:21:29.716569500 -0500 -@@ -108,10 +108,19 @@ - int tag_flags = 0; - char branchbuff[LOG_STR_MAX] = ""; - int branch_add = 0; -- char logbuff[LOG_STR_MAX] = ""; -+ int logbufflen = LOG_STR_MAX + 1; -+ char * logbuff = malloc(logbufflen); - time_t cache_date = -1; - int read_version; - -+ if (logbuff == NULL) -+ { -+ debug(DEBUG_SYSERROR, "could not malloc %d bytes for logbuff in read_cache", logbufflen); -+ exit(1); -+ } -+ -+ logbuff[0] = 0; -+ - if (!(fp = cache_open("r"))) - goto out; - -@@ -299,8 +308,19 @@ - else - { - /* Make sure we have enough in the buffer */ -- if (strlen(logbuff)+strlen(buff)= LOG_STR_MAX) -+ { -+ logbufflen += (len >= LOG_STR_MAX ? (len+1) : LOG_STR_MAX); -+ char * newlogbuff = realloc(logbuff, logbufflen); -+ if (newlogbuff == NULL) -+ { -+ debug(DEBUG_SYSERROR, "could not realloc %d bytes for logbuff in read_cache", logbufflen); -+ exit(1); -+ } -+ logbuff = newlogbuff; -+ } -+ strcat(logbuff, buff); - } - break; - case CACHE_NEED_PS_MEMBERS: -@@ -332,6 +352,7 @@ - out_close: - fclose(fp); - out: -+ free(logbuff); - return cache_date; - } - -diff -urN cvsps-2.1-orig/cvsps.c cvsps-2.1/cvsps.c ---- cvsps-2.1-orig/cvsps.c 2005-05-25 22:39:40.000000000 -0500 -+++ cvsps-2.1/cvsps.c 2005-07-26 15:22:02.558230700 -0500 -@@ -265,7 +265,8 @@ - PatchSetMember * psm = NULL; - char datebuff[20]; - char authbuff[AUTH_STR_MAX]; -- char logbuff[LOG_STR_MAX + 1]; -+ int logbufflen = LOG_STR_MAX + 1; -+ char * logbuff = malloc(logbufflen); - int loglen = 0; - int have_log = 0; - char cmd[BUFSIZ]; -@@ -273,6 +274,12 @@ - char use_rep_buff[PATH_MAX]; - char * ltype; - -+ if (logbuff == NULL) -+ { -+ debug(DEBUG_SYSERROR, "could not malloc %d bytes for logbuff in load_from_cvs", logbufflen); -+ exit(1); -+ } -+ - if (!no_rlog && !test_log_file && cvs_check_cap(CAP_HAVE_RLOG)) - { - ltype = "rlog"; -@@ -480,24 +487,22 @@ - */ - if (have_log || !is_revision_metadata(buff)) - { -- /* if the log buffer is full, that's it. -- * -- * Also, read lines (fgets) always have \n in them -- * which we count on. So if truncation happens, -- * be careful to put a \n on. -- * -- * Buffer has LOG_STR_MAX + 1 for room for \0 if -- * necessary -- */ -- if (loglen < LOG_STR_MAX) -+ /* If the log buffer is full, try to reallocate more. */ -+ if (loglen < logbufflen) - { - int len = strlen(buff); - -- if (len >= LOG_STR_MAX - loglen) -+ if (len >= logbufflen - loglen) - { -- debug(DEBUG_APPMSG1, "WARNING: maximum log length exceeded, truncating log"); -- len = LOG_STR_MAX - loglen; -- buff[len - 1] = '\n'; -+ debug(DEBUG_STATUS, "reallocating logbufflen to %d bytes for file %s", logbufflen, file->filename); -+ logbufflen += (len >= LOG_STR_MAX ? (len+1) : LOG_STR_MAX); -+ char * newlogbuff = realloc(logbuff, logbufflen); -+ if (newlogbuff == NULL) -+ { -+ debug(DEBUG_SYSERROR, "could not realloc %d bytes for logbuff in load_from_cvs", logbufflen); -+ exit(1); -+ } -+ logbuff = newlogbuff; - } - - debug(DEBUG_STATUS, "appending %s to log", buff); diff --git a/pkgs/applications/version-management/cvsps/03_diffoptstypo.dpatch b/pkgs/applications/version-management/cvsps/03_diffoptstypo.dpatch deleted file mode 100644 index eb3818ed97e9..000000000000 --- a/pkgs/applications/version-management/cvsps/03_diffoptstypo.dpatch +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 03_diffoptstypo.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Diff opts typo fix - -@DPATCH@ - ---- cvsps-2.1-orig/cvsps.1 2005-05-26 05:39:40.000000000 +0200 -+++ cvsps-2.1/cvsps.1 2005-07-28 15:17:48.885112048 +0200 -@@ -83,7 +83,7 @@ - disable the use of rlog internally. Note: rlog is - required for stable PatchSet numbering. Use with care. - .TP --.B \-\-diffs\-opts