From f461ed3cfd3b914392d9677f1e837b1b29f7d52d Mon Sep 17 00:00:00 2001 From: sempiternal-aurora <78790545+sempiternal-aurora@users.noreply.github.com> Date: Mon, 13 Apr 2026 21:43:56 +1000 Subject: [PATCH 1/5] polyml{56,57}: drop old unused version --- pkgs/development/compilers/polyml/5.6.nix | 55 --------------- .../polyml/5.7-new-libffi-FFI_SYSV.patch | 34 ---------- pkgs/development/compilers/polyml/5.7.nix | 68 ------------------- pkgs/top-level/aliases.nix | 2 + pkgs/top-level/all-packages.nix | 2 - 5 files changed, 2 insertions(+), 159 deletions(-) delete mode 100644 pkgs/development/compilers/polyml/5.6.nix delete mode 100644 pkgs/development/compilers/polyml/5.7-new-libffi-FFI_SYSV.patch delete mode 100644 pkgs/development/compilers/polyml/5.7.nix diff --git a/pkgs/development/compilers/polyml/5.6.nix b/pkgs/development/compilers/polyml/5.6.nix deleted file mode 100644 index 5b1d9f799738..000000000000 --- a/pkgs/development/compilers/polyml/5.6.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - lib, - stdenv, - fetchurl, - autoreconfHook, - fetchpatch, -}: - -let - version = "5.6"; -in - -stdenv.mkDerivation { - pname = "polyml"; - inherit version; - - postPatch = '' - substituteInPlace configure.ac \ - --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA - AH_TEMPLATE([_Static_assert]) - AC_DEFINE([_Static_assert], [static_assert]) - " - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure.ac --replace-fail stdc++ c++ - ''; - - patches = [ - # glibc 2.34 compat - (fetchpatch { - url = "https://src.fedoraproject.org/rpms/polyml/raw/4d8868ca5a1ce3268f212599a321f8011c950496/f/polyml-pthread-stack-min.patch"; - sha256 = "1h5ihg2sxld9ymrl3f2mpnbn2242ka1fsa0h4gl9h90kndvg6kby"; - }) - ]; - - nativeBuildInputs = [ autoreconfHook ]; - - src = fetchurl { - url = "mirror://sourceforge/polyml/polyml.${version}.tar.gz"; - sha256 = "05d6l2a5m9jf32a8kahwg2p2ph4x9rjf1nsl83331q3gwn5bkmr0"; - }; - - meta = { - description = "Standard ML compiler and interpreter"; - longDescription = '' - Poly/ML is a full implementation of Standard ML. - ''; - homepage = "https://www.polyml.org/"; - license = lib.licenses.lgpl21; - platforms = with lib.platforms; linux; - maintainers = [ - # Add your name here! - ]; - }; -} diff --git a/pkgs/development/compilers/polyml/5.7-new-libffi-FFI_SYSV.patch b/pkgs/development/compilers/polyml/5.7-new-libffi-FFI_SYSV.patch deleted file mode 100644 index c5c9846300f1..000000000000 --- a/pkgs/development/compilers/polyml/5.7-new-libffi-FFI_SYSV.patch +++ /dev/null @@ -1,34 +0,0 @@ -For 5.7 the copyright header is different. - -From ad32de7f181acaffaba78d5c3d9e5aa6b84a741c Mon Sep 17 00:00:00 2001 -From: David Matthews -Date: Sun, 7 Apr 2019 13:41:33 +0100 -Subject: [PATCH] Remove FFI_SYSV from abi table for X86/64 Unix. It appears - that this has been removed in upstream versions of libffi and causes problems - when building using the system libffi. - ---- - libpolyml/polyffi.cpp | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/libpolyml/polyffi.cpp b/libpolyml/polyffi.cpp -index 5424dd84..3dc9cc7c 100644 ---- a/libpolyml/polyffi.cpp -+++ b/libpolyml/polyffi.cpp -@@ -1,7 +1,7 @@ - /* - Title: New Foreign Function Interface - -- Copyright (c) 2015 David C.J. Matthews -+ Copyright (c) 2015, 2019 David C.J. Matthews - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public -@@ -109,7 +109,6 @@ static struct _abiTable { const char *abiName; ffi_abi abiCode; } abiTable[] = - #elif defined(X86_WIN64) - {"win64", FFI_WIN64}, - #elif defined(X86_ANY) -- {"sysv", FFI_SYSV}, - {"unix64", FFI_UNIX64}, - #endif - { "default", FFI_DEFAULT_ABI} diff --git a/pkgs/development/compilers/polyml/5.7.nix b/pkgs/development/compilers/polyml/5.7.nix deleted file mode 100644 index a9cf21157fea..000000000000 --- a/pkgs/development/compilers/polyml/5.7.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - autoreconfHook, - gmp, - libffi, - fetchpatch, -}: - -stdenv.mkDerivation rec { - pname = "polyml"; - version = "5.7.1"; - - postPatch = '' - substituteInPlace configure.ac \ - --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA - AH_TEMPLATE([_Static_assert]) - AC_DEFINE([_Static_assert], [static_assert]) - " - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure.ac --replace-fail stdc++ c++ - ''; - - patches = [ - ./5.7-new-libffi-FFI_SYSV.patch - - # glibc 2.34 compat - (fetchpatch { - url = "https://src.fedoraproject.org/rpms/polyml/raw/4d8868ca5a1ce3268f212599a321f8011c950496/f/polyml-pthread-stack-min.patch"; - sha256 = "1h5ihg2sxld9ymrl3f2mpnbn2242ka1fsa0h4gl9h90kndvg6kby"; - }) - ]; - - buildInputs = [ - libffi - gmp - ]; - - nativeBuildInputs = [ autoreconfHook ]; - - configureFlags = [ - "--enable-shared" - "--with-system-libffi" - "--with-gmp" - ]; - - src = fetchFromGitHub { - owner = "polyml"; - repo = "polyml"; - rev = "v${version}"; - sha256 = "0j0wv3ijfrjkfngy7dswm4k1dchk3jak9chl5735dl8yrl8mq755"; - }; - - meta = { - description = "Standard ML compiler and interpreter"; - longDescription = '' - Poly/ML is a full implementation of Standard ML. - ''; - homepage = "https://www.polyml.org/"; - license = lib.licenses.lgpl21; - platforms = with lib.platforms; (linux ++ darwin); - # never built on aarch64-darwin since first introduction in nixpkgs - # The last successful Darwin Hydra build was in 2024 - broken = stdenv.hostPlatform.isDarwin; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index bc8ede1d87e7..84efe3037126 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1754,6 +1754,8 @@ mapAliases { podofo_1_0 = throw "'podofo_1_0' has been deprecated in favour of 'podofo'"; # Added 2026-05-08 polipo = throw "'polipo' has been removed as it is unmaintained upstream"; # Added 2025-05-18 polonium = throw "'polonium' has been removed, as Plasma 5 has reached end of life."; # Added 2026-05-01 + polyml56 = throw "'polyml56' has been deprecated in favor of polyml"; # Added 2026-06-01 + polyml57 = throw "'polyml57' has been deprecated in favor of polyml"; # Added 2026-06-01 polypane = throw "'polypane' has been removed due to lack of maintenance in nixpkgs"; # Added 2025-06-25 poppler_utils = throw "'poppler_utils' has been renamed to/replaced by 'poppler-utils'"; # Converted to throw 2025-10-27 popura = throw "'popura' is abandoned upstream and in nixpkgs and has been removed"; # Added 2026-01-15 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1bfd37c297af..9e35e34846e9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4850,8 +4850,6 @@ with pkgs; php85Packages = recurseIntoAttrs php85.packages; polyml = callPackage ../development/compilers/polyml { }; - polyml56 = callPackage ../development/compilers/polyml/5.6.nix { }; - polyml57 = callPackage ../development/compilers/polyml/5.7.nix { }; # Python interpreters. All standard library modules are included except for tkinter, which is # available as `pythonPackages.tkinter` and can be used as any other Python package. From f418e625da4d5cdda3e1c72eab2964968ff88f54 Mon Sep 17 00:00:00 2001 From: sempiternal-aurora <78790545+sempiternal-aurora@users.noreply.github.com> Date: Mon, 13 Apr 2026 21:44:59 +1000 Subject: [PATCH 2/5] polyml: migrate to by-name --- .../polyml/default.nix => by-name/po/polyml/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{development/compilers/polyml/default.nix => by-name/po/polyml/package.nix} (100%) diff --git a/pkgs/development/compilers/polyml/default.nix b/pkgs/by-name/po/polyml/package.nix similarity index 100% rename from pkgs/development/compilers/polyml/default.nix rename to pkgs/by-name/po/polyml/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9e35e34846e9..84580978cf86 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4849,8 +4849,6 @@ with pkgs; php85Extensions = recurseIntoAttrs php85.extensions; php85Packages = recurseIntoAttrs php85.packages; - polyml = callPackage ../development/compilers/polyml { }; - # Python interpreters. All standard library modules are included except for tkinter, which is # available as `pythonPackages.tkinter` and can be used as any other Python package. # When switching these sets, please update docs at ../../doc/languages-frameworks/python.md From 6e36170c0f4d6875795bc52d3d5e7e30c9711646 Mon Sep 17 00:00:00 2001 From: sempiternal-aurora <78790545+sempiternal-aurora@users.noreply.github.com> Date: Mon, 13 Apr 2026 22:21:30 +1000 Subject: [PATCH 3/5] polyml: cleanup and mark cross broken Compilation requires running one of the make build targets, so cross compilation isn't possible Also remove old design patterns in favour of newer ones. --- pkgs/by-name/po/polyml/package.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/po/polyml/package.nix b/pkgs/by-name/po/polyml/package.nix index be8ff324271f..2e0b750e8c1a 100644 --- a/pkgs/by-name/po/polyml/package.nix +++ b/pkgs/by-name/po/polyml/package.nix @@ -7,14 +7,17 @@ libffi, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "polyml"; version = "5.9.2"; + __structuredAttrs = true; + strictDeps = true; + src = fetchFromGitHub { owner = "polyml"; repo = "polyml"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-dHP5XNoLcFIqASfZVWu3MtY3B3H66skEl8ohlwTGyyM="; }; @@ -44,12 +47,6 @@ stdenv.mkDerivation rec { doCheck = true; - checkPhase = '' - runHook preCheck - make check - runHook postCheck - ''; - meta = { description = "Standard ML compiler and interpreter"; longDescription = '' @@ -58,8 +55,11 @@ stdenv.mkDerivation rec { homepage = "https://www.polyml.org/"; license = lib.licenses.lgpl21; platforms = with lib.platforms; (linux ++ darwin); + # Broken as make target `polyimport.o` requires running code + # compiled by the cross-compiler + broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform); maintainers = with lib.maintainers; [ kovirobi ]; }; -} +}) From d9bf2ea7eaef208ce218755d80d014c5d38a858b Mon Sep 17 00:00:00 2001 From: sempiternal-aurora <78790545+sempiternal-aurora@users.noreply.github.com> Date: Sun, 19 Apr 2026 23:44:31 +1000 Subject: [PATCH 4/5] polyml: replace kovirobi with sempiternal-aurora as maintainer --- pkgs/by-name/po/polyml/package.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/by-name/po/polyml/package.nix b/pkgs/by-name/po/polyml/package.nix index 2e0b750e8c1a..d8f6aff45d7f 100644 --- a/pkgs/by-name/po/polyml/package.nix +++ b/pkgs/by-name/po/polyml/package.nix @@ -58,8 +58,6 @@ stdenv.mkDerivation (finalAttrs: { # Broken as make target `polyimport.o` requires running code # compiled by the cross-compiler broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform); - maintainers = with lib.maintainers; [ - kovirobi - ]; + maintainers = with lib.maintainers; [ sempiternal-aurora ]; }; }) From 3a717e7522076b62cc6a9f49551cd82acb79e8bc Mon Sep 17 00:00:00 2001 From: sempiternal-aurora <78790545+sempiternal-aurora@users.noreply.github.com> Date: Sun, 19 Apr 2026 23:44:38 +1000 Subject: [PATCH 5/5] polyml: Fix polyc linking script polyc linking script hardcodes the linker to be the value of `$CXX` at compile time. This is bad for environments without `g++` in path. Fix this by patching the correct path into the script. Co-Authored-By: Ricardo Correia Co-Authored-By: Ivan Trubach --- pkgs/by-name/po/polyml/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/po/polyml/package.nix b/pkgs/by-name/po/polyml/package.nix index d8f6aff45d7f..18674635298b 100644 --- a/pkgs/by-name/po/polyml/package.nix +++ b/pkgs/by-name/po/polyml/package.nix @@ -1,6 +1,7 @@ { lib, stdenv, + pkgsHostTarget, fetchFromGitHub, autoreconfHook, gmp, @@ -35,6 +36,7 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libffi gmp + pkgsHostTarget.stdenv.cc ]; nativeBuildInputs = [ autoreconfHook ]; @@ -45,6 +47,11 @@ stdenv.mkDerivation (finalAttrs: { "--with-gmp" ]; + preInstall = '' + substituteInPlace polyc \ + --replace-fail "LINK=\"$CXX\"" "LINK=\"${lib.getExe' pkgsHostTarget.stdenv.cc "c++"}\"" + ''; + doCheck = true; meta = {