vifm: 0.13 -> 0.14 (#380559)
[NixPkgs.git] / pkgs / by-name / ru / rubiks / package.nix
blob7d158c95aead7e998e6d2d132e8e2f81add0f4ae
2   lib,
3   stdenv,
4   fetchurl,
5   fetchpatch,
6   coreutils,
7   dos2unix,
8 }:
10 stdenv.mkDerivation rec {
11   pname = "rubiks";
12   version = "20070912";
14   src = fetchurl {
15     url = "mirror://sageupstream/rubiks/rubiks-${version}.tar.bz2";
16     sha256 = "0zdmkb0j1kyspdpsszzb2k3279xij79jkx0dxd9f3ix1yyyg3yfq";
17   };
19   preConfigure = ''
20     export INSTALL="${coreutils}/bin/install"
21   '';
23   # everything is done in `make install`
24   dontBuild = true;
26   installFlags = [
27     "PREFIX=$(out)"
28   ];
30   nativeBuildInputs = [ dos2unix ];
32   prePatch = ''
33     find ./dietz/ -type f -exec dos2unix {} \;
34   '';
36   patches = [
37     # Fix makefiles which use all the variables in all the wrong ways and
38     # hardcode values for some variables.
39     (fetchpatch {
40       url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/dietz-cu2-Makefile.patch";
41       sha256 = "bRU7MJ/6BgCp2PUqZOragJhm38Q3E8ShStXQIYwIjvw=";
42     })
43     (fetchpatch {
44       url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/dietz-mcube-Makefile.patch";
45       sha256 = "f53z4DogXKax1vUNkraOTt3TQ4bvT7CdQK/hOaaBS38=";
46     })
47     (fetchpatch {
48       url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/dietz-solver-Makefile.patch";
49       sha256 = "7gMC8y9elyIy2KvXYcp7YjPBNqn9PVhUle+/GrYAAdE=";
50     })
51     (fetchpatch {
52       url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/reid-Makefile.patch";
53       sha256 = "rp3SYtx02vVBtSlg1vJpdIoXNcdBNKDLCLqLAKwOYeQ=";
54     })
55     (fetchpatch {
56       url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-1-rubiks-includes.patch";
57       sha256 = "QYJ1KQ73HTEGY/beMVbcU215g/B8rHDjYD1YM2WZ7sk=";
58     })
59     (fetchpatch {
60       url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-2-rubiks-ansi-c.patch";
61       sha256 = "Rnu7uphE9URxnbg2K8mkymnB61magweH+WxVWR9JC4s=";
62     })
63     (fetchpatch {
64       url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-3-rubiks-prototypes.patch";
65       sha256 = "Wi038g+y7No1TNMiITtAdipjRi0+g6h0Sspslm5rZGU=";
66     })
67     (fetchpatch {
68       url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-4-rubiks-longtype.patch";
69       sha256 = "6pNuxFM69CZ/TQGZfHXLlCN5g5lf3RiYYZKzMvLJwkw=";
70     })
71     (fetchpatch {
72       url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-5-rubiks-signed.patch";
73       sha256 = "CCGXBMYvSjTm4YKQZAQMi6pWGjyHDYYQzdMZDSW2vFE=";
74     })
75     (fetchpatch {
76       url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-6-rubiks-attributes.patch";
77       sha256 = "RhlzMb33iaLfeBoF7Y0LIgEzOB/EC+AoWMSkRPCICaU=";
78     })
79   ];
81   meta = with lib; {
82     homepage = "https://wiki.sagemath.org/spkg/rubiks";
83     description = "Several programs for working with Rubik's cubes";
84     # The individual websites are no longer available
85     longDescription = ''
86       There are several programs for working with Rubik's cubes, by three
87       different people. Look inside the directories under /src to see
88       specific info and licensing. In summary the three contributers are:
91       Michael Reid (GPL) http://www.math.ucf.edu/~reid/Rubik/optimal_solver.html
92           optimal - uses many pre-computed tables to find an optimal
93                     solution to the 3x3x3 Rubik's cube
96       Dik T. Winter (MIT License)
97           cube    - uses Kociemba's algorithm to iteratively find a short
98                     solution to the 3x3x3 Rubik's cube
99           size222 - solves a 2x2x2 Rubik's cube
102       Eric Dietz (GPL) http://www.wrongway.org/?rubiksource
103           cu2   - A fast, non-optimal 2x2x2 solver
104           cubex - A fast, non-optimal 3x3x3 solver
105           mcube - A fast, non-optimal 4x4x4 solver
106     '';
107     license = with licenses; [
108       gpl2 # Michael Reid's and Eric Dietz software
109       mit # Dik T. Winter's software
110     ];
111     maintainers = teams.sage.members;
112     platforms = platforms.unix;
113   };