···11+The clean command line compiler clm uses timestamps of dcl, icl, abc and o files
22+to decide what must be rebuild. However as for chroot builds, all of the
33+library files will have equal timestamps, this leads to clm trying to rebuild
44+the library modules distributed with the Clean installation every time a user
55+compiles any file, which fails ue to the absence of write permission on the Nix
66+store.
77+88+This patch changes the freshness check to use less than instead of less than or
99+equal to in order to avoid this.
1010+1111+--- b/src/clm/clm.c
1212++++ a/src/clm/clm.c
1313+@@ -250,7 +250,7 @@
1414+ || (t1.dwHighDateTime==t2.dwHighDateTime && (unsigned)(t1.dwLowDateTime)<=(unsigned)(t2.dwLowDateTime)))
1515+ #else
1616+ typedef unsigned long FileTime;
1717+-# define FILE_TIME_LE(t1,t2) (t1<=t2)
1818++# define FILE_TIME_LE(t1,t2) (t1<t2)
1919+ #endif
2020+2121+ typedef struct project_node {
···11+--- a/src/RuntimeSystem/scon.c
22++++ b/src/RuntimeSystem/scon.c
33+@@ -858,6 +858,8 @@
44+ int execution_aborted;
55+ int return_code;
66+77++extern void abc_main (void);
88++
99+ int main (int argc,char **argv)
1010+ {
1111+ int arg_n;
1212+1313+--- a/src/clm/cachingcompiler.h
1414++++ b/src/clm/cachingcompiler.h
1515+@@ -1,6 +1,7 @@
1616+ Clean (:: *Thread :== Int)
1717+ int start_caching_compiler (CleanCharArray compiler_path);
1818+ Clean (start_caching_compiler :: {#Char} Thread -> (Int, Thread))
1919++int start_caching_compiler_with_args (CleanCharArray coc_path, char** cocl_argv, int cocl_argv_size);
2020+ int call_caching_compiler (CleanCharArray args);
2121+ Clean (call_caching_compiler :: {#Char} Thread -> (Int, Thread))
2222+ int stop_caching_compiler (void);
+80
pkgs/by-name/cl/clean/package.nix
···11+{
22+ binutils,
33+ fetchurl,
44+ gcc,
55+ lib,
66+ runCommand,
77+ stdenv,
88+}:
99+1010+stdenv.mkDerivation (finalAttrs: {
1111+ pname = "clean";
1212+ version = "3.1";
1313+1414+ src =
1515+ if stdenv.hostPlatform.system == "i686-linux" then
1616+ (fetchurl {
1717+ url = "https://ftp.cs.ru.nl/Clean/Clean31/linux/clean3.1_32_boot.tar.gz";
1818+ sha256 = "Ls0IKf+o7yhRLhtSV61jzmnYukfh5x5fogHaP5ke/Ck=";
1919+ })
2020+ else if stdenv.hostPlatform.system == "x86_64-linux" then
2121+ (fetchurl {
2222+ url = "https://ftp.cs.ru.nl/Clean/Clean31/linux/clean3.1_64_boot.tar.gz";
2323+ sha256 = "Gg5CVZjrwDBtV7Vuw21Xj6Rn+qN1Mf6B3ls6r/16oBc=";
2424+ })
2525+ else
2626+ throw "Architecture not supported";
2727+2828+ hardeningDisable = [ "pic" ];
2929+3030+ patches = [
3131+ ./chroot-build-support-do-not-rebuild-equal-timestamps.patch
3232+ ./declare-functions-explicitly-for-gcc14.patch
3333+ ];
3434+3535+ postPatch = ''
3636+ substituteInPlace Makefile \
3737+ --replace-fail 'INSTALL_DIR = $(CURRENTDIR)' "INSTALL_DIR = $out"
3838+ substituteInPlace src/clm/clm.c \
3939+ --replace-fail /usr/bin/as ${binutils}/bin/as \
4040+ --replace-fail /usr/bin/gcc ${gcc}/bin/gcc
4141+ '';
4242+4343+ buildFlags = [ "-C src/" ];
4444+4545+ # do not strip libraries and executables since all symbols since they are
4646+ # required as is for compilation. Especially the labels of unused section need
4747+ # to be kept.
4848+ dontStrip = true;
4949+5050+ passthru.tests.compile-hello-world = runCommand "compile-hello-world" { } ''
5151+ cat >HelloWorld.icl <<EOF
5252+ module HelloWorld
5353+ Start = "Hello, world!"
5454+ EOF
5555+ ${finalAttrs.finalPackage}/bin/clm HelloWorld -o hello-world
5656+ touch $out
5757+ '';
5858+5959+ meta = {
6060+ description = "General purpose, state-of-the-art, pure and lazy functional programming language";
6161+ longDescription = ''
6262+ Clean is a general purpose, state-of-the-art, pure and lazy functional
6363+ programming language designed for making real-world applications. Some
6464+ of its most notable language features are uniqueness typing, dynamic typing,
6565+ and generic functions.
6666+ '';
6767+6868+ homepage = "http://wiki.clean.cs.ru.nl/Clean";
6969+ license = lib.licenses.bsd2;
7070+ maintainers = with lib.maintainers; [
7171+ bmrips
7272+ erin
7373+ ];
7474+ platforms = [
7575+ "i686-linux"
7676+ "x86_64-linux"
7777+ ];
7878+ mainProgram = "clean";
7979+ };
8080+})
-1
pkgs/top-level/aliases.nix
···439439 citra = throw "citra has been removed from nixpkgs, as it has been taken down upstream"; # added 2024-03-04
440440 citra-nightly = throw "citra-nightly has been removed from nixpkgs, as it has been taken down upstream"; # added 2024-03-04
441441 citra-canary = throw "citra-canary has been removed from nixpkgs, as it has been taken down upstream"; # added 2024-03-04
442442- clean = throw "'clean' has been removed from nixpkgs, as it is unmaintained and broken"; # Added 2025-05-18
443442 cloog = throw "cloog has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-09-13
444443 cloog_0_18_0 = throw "cloog_0_18_0 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-09-13
445444 cloogppl = throw "cloogppl has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-09-13