Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/strings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,26 @@ rec {
in lenContent >= lenSuffix &&
substring (lenContent - lenSuffix) lenContent content == suffix;

/* Determine whether a string contains the given infix

Type: hasInfix :: string -> string -> bool

Example:
hasInfix "bc" "abcd"
=> true
hasInfix "ab" "abcd"
=> true
hasInfix "cd" "abcd"
=> true
hasInfix "foo" "abcd"
=> false
*/
hasInfix = infix: content:
let
drop = x: substring 1 (stringLength x) x;
in hasPrefix infix content
|| content != "" && hasInfix infix (drop content);

/* Convert a string to a list of characters (i.e. singleton strings).
This allows you to, e.g., map a function over each character. However,
note that this will likely be horribly inefficient; Nix is not a
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/altcoins/mist.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

let
version = "0.11.1";
name = "mist";
pname = "mist";

throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";

Expand All @@ -26,7 +26,7 @@ let
};

mist = stdenv.lib.appendToName "unwrapped" (stdenv.mkDerivation {
inherit name version meta;
inherit pname version meta;

src = {
i686-linux = fetchurl {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/cadence/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

stdenv.mkDerivation rec {
version = "0.9.0";
name = "cadence";
pname = "cadence";

src = fetchurl {
url = "https://github.com/falkTX/Cadence/archive/v${version}.tar.gz";
Expand Down
5 changes: 3 additions & 2 deletions pkgs/applications/audio/vcv-rack/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
, libzip, rtaudio, rtmidi, speex }:

let
glfw-git = glfw.overrideAttrs (oldAttrs: {
name = "glfw-git-20180529";
glfw-git = glfw.overrideAttrs (oldAttrs: rec {
name = "glfw-git-${version}";
version = "unstable-2018-05-29";
src = fetchFromGitHub {
owner = "glfw";
repo = "glfw";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/graphics/vimiv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}:

python3Packages.buildPythonApplication rec {
name = "vimiv";
pname = "vimiv";
version = "0.7.3";

src = fetchFromGitHub {
Expand Down
1 change: 1 addition & 0 deletions pkgs/applications/misc/k2pdfopt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ stdenv.mkDerivation rec {
let
mupdf_modded = mupdf.overrideAttrs (attrs: {
name = "mupdf-1.10a";
version = "1.10a";
src = fetchurl {
url = "https://mupdf.com/downloads/archive/mupdf-1.10a-source.tar.gz";
sha256 = "0dm8wcs8i29aibzkqkrn8kcnk4q0kd1v66pg48h5c3qqp4v1zk5a";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/misc/omegat.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

stdenv.mkDerivation rec {
version = "4.1.5.2";
name = "omegat";
pname = "omegat";

src = fetchurl { # their zip has repeated files or something, so no fetchzip
url = mirror://sourceforge/project/omegat/OmegaT%20-%20Latest/OmegaT%204.1.5%20update%202/OmegaT_4.1.5_02_Beta_Without_JRE.zip;
Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/misc/oneko/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ stdenv, fetchurl, xorg, xlibsWrapper }:

stdenv.mkDerivation rec {
version = "1.2.sakura.5";
vname = "1.2.5";
name = "oneko-${vname}";
version_name = "1.2.sakura.5";
version = "1.2.5";
name = "oneko-${version}";
src = fetchurl {
url = "http://www.daidouji.com/oneko/distfiles/oneko-${version}.tar.gz";
url = "http://www.daidouji.com/oneko/distfiles/oneko-${version_name}.tar.gz";
sha256 = "2c2e05f1241e9b76f54475b5577cd4fb6670de058218d04a741a04ebd4a2b22f";
};
buildInputs = [ xorg.imake xorg.gccmakedep xlibsWrapper ];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/browsers/brave/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ let rpath = lib.makeLibraryPath [


in stdenv.mkDerivation rec {
name = "brave";
pname = "brave";
version = "0.25.2";

src = fetchurl {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/enhanced-ctorrent/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ stdenv, fetchurl, fetchpatch }:

stdenv.mkDerivation rec {
version = "dnh3.3.2";
name = "enhanced-ctorrent";
version = "3.3.2";
pname = "enhanced-ctorrent-dhn";

src = fetchurl {
url = "http://www.rahul.net/dholmes/ctorrent/ctorrent-dnh3.3.2.tar.gz";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/flent/http-getter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
, curl, pkgconfig }:

stdenv.mkDerivation rec {
name = "http-getter";
version = "20180606";
pname = "http-getter";
version = "unstable-2018-06-06";

src = fetchFromGitHub {
owner = "tohojo";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ let

in
stdenv.mkDerivation rec {
name = "salut-a-toi-${version}";
pname = "salut-a-toi";
version = "0.6.1";
pname = "sat-${version}";

src = fetchurl {
url = "ftp://ftp.goffi.org/sat/${pname}.tar.bz2";
url = "ftp://ftp.goffi.org/sat/sat-${version}.tar.bz2";
sha256 = "0kn9403n8fpzl0hsb9kkzicsmzq2fjl627l31yykbqzc4nsr780d";
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/remote/remmina/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
with stdenv.lib;

stdenv.mkDerivation rec {
name = "remmina-${version}";
pname = "remmina";
version = "1.2.32";

src = fetchFromGitLab {
Expand Down
6 changes: 2 additions & 4 deletions pkgs/applications/office/bookworm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@

stdenv.mkDerivation rec {
pname = "bookworm";
version = "4f7b118281667d22f1b3205edf0b775341fa49cb";

name = "${pname}-2018-10-21";
version = "unstable-2018-10-21";

src = fetchFromGitHub {
owner = "babluboy";
repo = pname;
rev = version;
rev = "4f7b118281667d22f1b3205edf0b775341fa49cb";
sha256 = "0bcyim87zk4b4xmgfs158lnds3y8jg7ppzw54kjpc9rh66fpn3b9";
};

Expand Down
1 change: 1 addition & 0 deletions pkgs/applications/science/misc/sasview/xhtml2pdf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
let
#xhtml2pdf specifically requires version "1.0b10" of html5lib
html5 = html5lib.overrideAttrs( oldAttrs: rec{
name = "${oldAttrs.pname}-${version}";
version = "1.0b10";
src = oldAttrs.src.override {
inherit version;
Expand Down
9 changes: 6 additions & 3 deletions pkgs/applications/virtualization/docker/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ rec {
} :
let
docker-runc = runc.overrideAttrs (oldAttrs: rec {
name = "docker-runc";
name = "docker-runc-${version}";
inherit version;
src = fetchFromGitHub {
owner = "docker";
repo = "runc";
Expand All @@ -28,7 +29,8 @@ rec {
});

docker-containerd = (containerd.override { inherit go; }).overrideAttrs (oldAttrs: rec {
name = "docker-containerd";
name = "docker-containerd-${version}";
inherit version;
src = fetchFromGitHub {
owner = "docker";
repo = "containerd";
Expand All @@ -42,7 +44,8 @@ rec {
});

docker-tini = tini.overrideAttrs (oldAttrs: rec {
name = "docker-init";
name = "docker-init-${version}";
inherit version;
src = fetchFromGitHub {
owner = "krallin";
repo = "tini";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/fetchegg/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if md5 != "" then
throw "fetchegg does not support md5 anymore, please use sha256"
else
stdenvNoCC.mkDerivation {
name = "chicken-${name}-export";
name = "chicken-${name}-export-${version}";
builder = ./builder.sh;
nativeBuildInputs = [ chicken ];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/beam-modules/hex-registry-snapshot.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{stdenv, writeText, fetchFromGitHub }:

stdenv.mkDerivation rec {
name = "hex-registry";
pname = "hex-registry";
rev = "11d7a24e9f53f52490ce255a6248e71128e73aa1";
version = "20180712.${rev}";
version = "unstable-2018-07-12";

src = fetchFromGitHub {
inherit rev;
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/beam-modules/hex/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ let
};

pkg = self: stdenv.mkDerivation rec {
name = "hex";
version = "v0.17.1";
pname = "hex";
version = "0.17.1";

src = fetchFromGitHub {
owner = "hexpm";
repo = "hex";
rev = "${version}";
rev = "v${version}";
sha256 = "1s4asar1mcavzj3w37jcz243ka0z5jm0r42yws3h4aagawxxg02z";
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/graalvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ in rec {

mx = stdenv.mkDerivation rec {
version = "5.192.0";
name = "mx";
pname = "mx";
src = fetchFromGitHub {
owner = "graalvm";
repo = "mx";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/elf-header/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let
in

stdenvNoCC.mkDerivation {
name = "elf-header";
pname = "elf-header";
inherit (libc) version;

src = null;
Expand Down
5 changes: 2 additions & 3 deletions pkgs/development/libraries/gsignond/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
let
unwrapped = stdenv.mkDerivation rec {
pname = "gsignond";
version = "39022c86ddb5062a10fb0503ad9d81a8e532d527";
version = "unstable-2018-10-04";

name = "${pname}-2018-10-04";

outputs = [ "out" "dev" "devdoc" ];

src = fetchFromGitLab {
owner = "accounts-sso";
repo = pname;
rev = version;
rev = "39022c86ddb5062a10fb0503ad9d81a8e532d527";
sha256 = "1gw8vbj3j6wxqy759z97arm8lnqhmraw9s2frv3ar6crnfhlidff";
};

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/igraph/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
flex, yacc, zlib, libxml2 }:

stdenv.mkDerivation rec {
name = "igraph";
pname = "igraph";
version = "0.7.1";

src = fetchFromGitHub {
owner = "igraph";
repo = name;
repo = pname;
rev = version;
sha256 = "1wsy0r511gk069il6iqjs27q8cjvqz20gf0a7inybx1bw84845z8";
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, cmake, openssl }:

stdenv.mkDerivation rec {
name = "libsignal-protocol-c";
pname = "libsignal-protocol-c";
version = "2.3.2";

src = fetchFromGitHub {
Expand Down
6 changes: 2 additions & 4 deletions pkgs/development/libraries/libsignon-glib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

stdenv.mkDerivation rec {
pname = "libsignon-glib";
version = "3639a2e90447e4640a03a44972560afe8f61aa48";

name = "${pname}-2018-10-24";
version = "unstable-2018-10-24";

outputs = [ "out" "dev" "devdoc" "py" ];

src = fetchgit {
url = "https://gitlab.com/accounts-sso/${pname}";
rev = version;
rev = "3639a2e90447e4640a03a44972560afe8f61aa48";
fetchSubmodules = true;
sha256 = "1cq19zbsx4c57dc5gp3shp8lzcr1hw2ynylpn1nkvfyyrx80m60w";
};
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/libxl/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
name = "libxl";
pname = "libxl";
version = "3.8.1";

src = fetchurl {
url = "http://www.libxl.com/download/${name}-lin-${version}.tar.gz";
url = "http://www.libxl.com/download/${pname}-lin-${version}.tar.gz";
sha256 = "1zdbahhyhr70s8hygwp43j9z4zmglyrr782hkcm1078yvkr2f2fm";
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/yojimbo/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, premake5, doxygen, libsodium, mbedtls }:

stdenv.mkDerivation rec {
name = "yojimbo";
pname = "yojimbo";
version = "1.1";

src = fetchFromGitHub {
Expand Down
3 changes: 1 addition & 2 deletions pkgs/development/python-modules/metaphone/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{ stdenv, buildPythonPackage, isPy3k, fetchPypi, nose }:

buildPythonPackage rec {
pname = "Metaphone";
pname = "metaphone";
version = "0.6";
name = "metaphone-${version}";

src = fetchPypi {
inherit pname version;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/python-modules/py3exiv2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buildPythonPackage rec {
patches = [
(substituteAll {
src = ./setup.patch;
version = "3${stdenv.lib.versions.minor python.version}";
version_ = "3${stdenv.lib.versions.minor python.version}";
})
];

Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/python-modules/py3exiv2/setup.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
@@ -39,7 +39,7 @@
if '3' in l[2:]:
return l.replace('libboost', 'boost')

-libboost = get_libboost_name()
+libboost = 'boost_python@version@'
+libboost = 'boost_python@version_@'

setup(
name='py3exiv2',
2 changes: 1 addition & 1 deletion pkgs/development/python-modules/pyinputevent/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}:

buildPythonPackage rec {
name = "pyinputevent";
pname = "pyinputevent";
version = "2016-10-18";

src = fetchFromGitHub {
Expand Down
Loading