From e216a63c7d732035a4127b7ed8061318ff9fb1df Mon Sep 17 00:00:00 2001 From: Linus Arver Date: Sat, 25 Apr 2015 16:17:40 -0700 Subject: [PATCH] Add package: pcg-c Also, add myself as maintainer. --- lib/maintainers.nix | 1 + pkgs/development/libraries/pcg-c/default.nix | 38 +++++++++++++++++++ .../libraries/pcg-c/prefix-variable.patch | 15 ++++++++ pkgs/top-level/all-packages.nix | 2 + 4 files changed, 56 insertions(+) create mode 100644 pkgs/development/libraries/pcg-c/default.nix create mode 100644 pkgs/development/libraries/pcg-c/prefix-variable.patch diff --git a/lib/maintainers.nix b/lib/maintainers.nix index c944414ce6c2..f0e87507ceb6 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -118,6 +118,7 @@ lethalman = "Luca Bruno "; lhvwb = "Nathaniel Baxter "; linquize = "Linquize "; + linus = "Linus Arver "; lovek323 = "Jason O'Conal "; ludo = "Ludovic Courtès "; madjar = "Georges Dubus "; diff --git a/pkgs/development/libraries/pcg-c/default.nix b/pkgs/development/libraries/pcg-c/default.nix new file mode 100644 index 000000000000..4b8cedd90c73 --- /dev/null +++ b/pkgs/development/libraries/pcg-c/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchzip }: + +with stdenv.lib; + +stdenv.mkDerivation rec { + version = "0.94"; + name = "pcg-c-${version}"; + + src = fetchzip { + url = "http://www.pcg-random.org/downloads/${name}.zip"; + sha256 = "0smm811xbvs03a5nc2668zd0178wnyri2h023pqffy767bpy1vlv"; + }; + + enableParallelBuilding = true; + + patches = [ + ./prefix-variable.patch + ]; + + preInstall = '' + sed -i s,/usr/local,$out, Makefile + mkdir -p $out/lib $out/include + ''; + + meta = { + description = "A family of better random number generators"; + homepage = "http://www.pcg-random.org/"; + license = stdenv.lib.licenses.asl20; + longDescription = '' + PCG is a family of simple fast space-efficient statistically good + algorithms for random number generation. Unlike many general-purpose RNGs, + they are also hard to predict. + ''; + platforms = platforms.unix; + maintainers = [ maintainers.linus ]; + repositories.git = git://github.com/imneme/pcg-c.git; + }; +} diff --git a/pkgs/development/libraries/pcg-c/prefix-variable.patch b/pkgs/development/libraries/pcg-c/prefix-variable.patch new file mode 100644 index 000000000000..bfdcdfa7b17e --- /dev/null +++ b/pkgs/development/libraries/pcg-c/prefix-variable.patch @@ -0,0 +1,15 @@ +diff --git a/Makefile b/Makefile +index dddea44..fdb9401 100644 +--- a/Makefile ++++ b/Makefile +@@ -30,8 +30,8 @@ all: + PREFIX = /usr/local + + install: all +- install src/libpcg_random.a $PREFIX/lib +- install -m 0644 include/pcg_variants.h $PREFIX/include ++ install src/libpcg_random.a ${PREFIX}/lib ++ install -m 0644 include/pcg_variants.h ${PREFIX}/include + + test: all + cd test-low; $(MAKE) test diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3731cd40d598..ddb2349bdfb8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7259,6 +7259,8 @@ let pangoxsl = callPackage ../development/libraries/pangoxsl { }; + pcg_c = callPackage ../development/libraries/pcg-c { }; + pcl = callPackage ../development/libraries/pcl { vtk = vtkWithQt4; };