rubiks: fix clang build

Adds newer patches upstreamed from Fedora into Sage; CRLF endings in the
`dietz` solver require `dos2unix` to apply the patches properly.
Frankly, I have no idea how this previously compiled on gcc.
This commit is contained in:
George Huebner 2024-03-14 23:14:42 -04:00
parent 909b7ce7bb
commit 4d7959506e
No known key found for this signature in database
1 changed files with 39 additions and 8 deletions

View File

@ -2,6 +2,7 @@
, fetchurl
, fetchpatch
, coreutils
, dos2unix
}:
stdenv.mkDerivation rec {
@ -24,24 +25,54 @@ stdenv.mkDerivation rec {
"PREFIX=$(out)"
];
nativeBuildInputs = [ dos2unix ];
prePatch = ''
find ./dietz/ -type f -exec dos2unix {} \;
'';
patches = [
# Fix makefiles which use all the variables in all the wrong ways and
# hardcode values for some variables.
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/rubiks/patches/dietz-cu2-Makefile.patch";
sha256 = "1ry3w1mk9q4jqd91zlaa1bdiiplld4hpfjaldbhlmzlgrrc99qmq";
url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/dietz-cu2-Makefile.patch";
sha256 = "bRU7MJ/6BgCp2PUqZOragJhm38Q3E8ShStXQIYwIjvw=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/rubiks/patches/dietz-mcube-Makefile.patch";
sha256 = "0zsbh6k3kqdg82fv0kzghr1x7pafisv943gmssqscp107bhg77bz";
url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/dietz-mcube-Makefile.patch";
sha256 = "f53z4DogXKax1vUNkraOTt3TQ4bvT7CdQK/hOaaBS38=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/rubiks/patches/dietz-solver-Makefile.patch";
sha256 = "0vhw70ylnmydgjhwx8jjlb2slccj4pfqn6vzirkyz1wp8apsmfhp";
url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/dietz-solver-Makefile.patch";
sha256 = "7gMC8y9elyIy2KvXYcp7YjPBNqn9PVhUle+/GrYAAdE=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/rubiks/patches/reid-Makefile.patch";
sha256 = "1r311sn012xs135s0d21qwsig2kld7rdcq19nm0zbnklviid57df";
url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/reid-Makefile.patch";
sha256 = "rp3SYtx02vVBtSlg1vJpdIoXNcdBNKDLCLqLAKwOYeQ=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-1-rubiks-includes.patch";
sha256 = "QYJ1KQ73HTEGY/beMVbcU215g/B8rHDjYD1YM2WZ7sk=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-2-rubiks-ansi-c.patch";
sha256 = "Rnu7uphE9URxnbg2K8mkymnB61magweH+WxVWR9JC4s=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-3-rubiks-prototypes.patch";
sha256 = "Wi038g+y7No1TNMiITtAdipjRi0+g6h0Sspslm5rZGU=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-4-rubiks-longtype.patch";
sha256 = "6pNuxFM69CZ/TQGZfHXLlCN5g5lf3RiYYZKzMvLJwkw=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-5-rubiks-signed.patch";
sha256 = "CCGXBMYvSjTm4YKQZAQMi6pWGjyHDYYQzdMZDSW2vFE=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/2a9a4267f93588cf33119cbacc032ed9acc433e5/build/pkgs/rubiks/patches/fedora-6-rubiks-attributes.patch";
sha256 = "RhlzMb33iaLfeBoF7Y0LIgEzOB/EC+AoWMSkRPCICaU=";
})
];