From c76b79b7d2f74d07932bce178e6fb2ca070903a4 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 24 Nov 2024 21:03:12 +0100 Subject: [PATCH] libstdcxx5: remove I observed this package to be a big red herring when people are searching for the package they need if libstdc++ is missing: I observed this to happen if you're either very new to packaging and don't know where it's supposed to come from or if you package some binary program (or virtual environment) and this library is missing. The package is a subset of GCC 3.3 from 2005 and only needed for very old proprietary software that cannot be recompiled where it's only questionable if this is even appropriate to have in nixpkgs. There's in fact one such package, unreal tournament 2004. As much as I don't think that libstdcxx5 has a place in here, this also applies to it. If people want to consume this, it should belong into an external flake. Until this happens, I'm sorry for https://www.youtube.com/watch?v=mXapt4GHt-s --- .../development/libraries/gcc/libstdc++/5.nix | 119 ------------------ .../libraries/gcc/libstdc++/no-sys-dirs.patch | 53 -------- .../gcc/libstdc++/struct-ucontext.patch | 61 --------- pkgs/games/ut2004/default.nix | 9 -- pkgs/games/ut2004/demo.nix | 40 ------ pkgs/games/ut2004/wrapper.nix | 46 ------- pkgs/top-level/aliases.nix | 3 + pkgs/top-level/all-packages.nix | 6 - pkgs/top-level/packages-config.nix | 1 - 9 files changed, 3 insertions(+), 335 deletions(-) delete mode 100644 pkgs/development/libraries/gcc/libstdc++/5.nix delete mode 100644 pkgs/development/libraries/gcc/libstdc++/no-sys-dirs.patch delete mode 100644 pkgs/development/libraries/gcc/libstdc++/struct-ucontext.patch delete mode 100644 pkgs/games/ut2004/default.nix delete mode 100644 pkgs/games/ut2004/demo.nix delete mode 100644 pkgs/games/ut2004/wrapper.nix diff --git a/pkgs/development/libraries/gcc/libstdc++/5.nix b/pkgs/development/libraries/gcc/libstdc++/5.nix deleted file mode 100644 index 455c84e5dc18..000000000000 --- a/pkgs/development/libraries/gcc/libstdc++/5.nix +++ /dev/null @@ -1,119 +0,0 @@ -{ lib, stdenv, fetchurl, fetchpatch, flex, bison, file }: - -stdenv.mkDerivation rec { - pname = "libstdc++5"; - version = "3.3.6"; - - src = [ - (fetchurl { - url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2"; - sha256 = "1dpyrpsgakilz2rnh5f8gvrzq5pwzvndacc0df6m04bpqn5fx6sg"; - }) - (fetchurl { - url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2"; - sha256 = "14lxl81f7adpc9jxfiwzdxsdzs5zv4piv8xh7f9w910hfzrgvsby"; - }) - ]; - - patches = [ - ./no-sys-dirs.patch - (fetchpatch { - name = "siginfo.patch"; - url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/e36ee8ed9bb5942db14cf6249a2ead14974a2bfa/trunk/siginfo.patch"; - sha256 = "15zldbm33yba293dgrgsbv3j332hkc3iqpyc8fa7zl42mh9qk22j"; - extraPrefix = ""; - }) - (fetchpatch { - name = "gcc-3.4.3-no_multilib_amd64.patch"; - url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/e36ee8ed9bb5942db14cf6249a2ead14974a2bfa/trunk/gcc-3.4.3-no_multilib_amd64.patch"; - sha256 = "11m5lc51b0addhc4yq4rz0dwpv6k73rrj73wya3lqdk8rly6cjpm"; - extraPrefix = ""; - }) - # Required because of glibc 2.26 - ./struct-ucontext.patch - ]; - - postPatch = '' - # fix build issue with recent gcc - sed -i "s#O_CREAT#O_CREAT, 0666#" gcc/collect2.c - - # No fixincludes - sed -i -e 's@\./fixinc\.sh@-c true@' gcc/Makefile.in - ''; - - preConfigure = '' - mkdir ../build - cd ../build - configureScript=../$sourceRoot/configure - ''; - - preBuild = '' - # libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad - # Thing. - export CPP="gcc -E" - - # Use *real* header files, otherwise a limits.h is generated - # that does not include Glibc's limits.h (notably missing - # SSIZE_MAX, which breaks the build). - export NIX_FIXINC_DUMMY="$(cat $NIX_CC/nix-support/orig-libc-dev)/include" - - # The path to the Glibc binaries such as `crti.o'. - glibc_libdir="$(cat $NIX_CC/nix-support/orig-libc)/lib" - - # Figure out what extra flags to pass to the gcc compilers - # being generated to make sure that they use our glibc. - EXTRA_FLAGS="-I$NIX_FIXINC_DUMMY $(cat $NIX_CC/nix-support/libc-crt1-cflags) $(cat $NIX_CC/nix-support/libc-cflags) -O2" - - extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $(cat $NIX_BINTOOLS/nix-support/libc-ldflags || true) $(cat $NIX_BINTOOLS/nix-support/libc-ldflags-before || true)" - for i in $extraLDFlags; do - EXTRA_FLAGS="$EXTRA_FLAGS -Wl,$i" - done - - # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find - # the startfiles. - # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx - # for the startfiles. - makeFlagsArray=( \ - "''${makeFlagsArray[@]}" \ - NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ - SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ - CFLAGS_FOR_BUILD="$EXTRA_FLAGS" \ - CFLAGS_FOR_TARGET="$EXTRA_FLAGS" \ - CXXFLAGS_FOR_BUILD="$EXTRA_FLAGS" \ - CXXFLAGS_FOR_TARGET="$EXTRA_FLAGS" \ - FLAGS_FOR_TARGET="$EXTRA_FLAGS" \ - LDFLAGS_FOR_BUILD="$EXTRA_FLAGS" \ - LDFLAGS_FOR_TARGET="$EXTRA_FLAGS" \ - BOOT_CFLAGS="$EXTRA_FLAGS" \ - BOOT_LDFLAGS="$EXTRA_FLAGS" - ) - ''; - - hardeningDisable = [ "format" ]; - - nativeBuildInputs = [ flex bison file ]; - - configureFlags = [ "--disable-multilib" "--enable-__cxa-atexit" "--enable-threads=posix" "--enable-languages=c++" "--enable-clocale=gnu" ]; - - buildFLags = [ "all-target-libstdc++-v3" ]; - - installFlags = [ "install-target-libstdc++-v3" ]; - - postInstall = '' - # Remove includefiles and libs provided by gcc - shopt -s extglob - rm -rf $out/{bin,include,share,man,info} - rm -f $out/lib/*.a - rm -rf $out/lib/!(libstdc++*) - ''; - - meta = with lib; { - homepage = "https://gcc.gnu.org/"; - license = licenses.lgpl3Plus; - description = "GNU Compiler Collection, version ${version} -- C++ standard library"; - platforms = platforms.linux; - maintainers = with maintainers; [ abbradar ]; - # never built on aarch64-linux since first introduction in nixpkgs - broken = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64; - }; -} diff --git a/pkgs/development/libraries/gcc/libstdc++/no-sys-dirs.patch b/pkgs/development/libraries/gcc/libstdc++/no-sys-dirs.patch deleted file mode 100644 index 8c91d75f2a53..000000000000 --- a/pkgs/development/libraries/gcc/libstdc++/no-sys-dirs.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff -ru3 gcc-3.3.6-old/gcc/cppdefault.c gcc-3.3.6/gcc/cppdefault.c ---- gcc-3.3.6-old/gcc/cppdefault.c 2003-11-07 02:13:31.000000000 +0300 -+++ gcc-3.3.6/gcc/cppdefault.c 2016-09-02 16:00:03.492484016 +0300 -@@ -26,6 +26,10 @@ - #include "system.h" - #include "cppdefault.h" - -+#undef LOCAL_INCLUDE_DIR -+#undef SYSTEM_INCLUDE_DIR -+#undef STANDARD_INCLUDE_DIR -+ - const struct default_include cpp_include_defaults[] - #ifdef INCLUDE_DEFAULTS - = INCLUDE_DEFAULTS; -diff -ru3 gcc-3.3.6-old/gcc/gcc.c gcc-3.3.6/gcc/gcc.c ---- gcc-3.3.6-old/gcc/gcc.c 2004-04-01 20:55:17.000000000 +0400 -+++ gcc-3.3.6/gcc/gcc.c 2016-09-02 16:01:24.843520114 +0300 -@@ -6130,10 +6130,6 @@ - NULL, PREFIX_PRIORITY_LAST, 0, NULL, 1); - } - -- add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_1, -- "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1); -- add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_2, -- "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1); - #if 0 /* Can cause surprises, and one can use -B./ instead. */ - add_prefix (&startfile_prefixes, "./", NULL, - PREFIX_PRIORITY_LAST, 1, NULL, 0); -diff -ru3 gcc-3.3.6-old/gcc/Makefile.in gcc-3.3.6/gcc/Makefile.in ---- gcc-3.3.6-old/gcc/Makefile.in 2004-04-01 20:55:23.000000000 +0400 -+++ gcc-3.3.6/gcc/Makefile.in 2016-09-02 16:00:03.493484017 +0300 -@@ -260,7 +260,11 @@ - PARTITION_H = $(srcdir)/../include/partition.h - - # Default native SYSTEM_HEADER_DIR, to be overridden by targets. --NATIVE_SYSTEM_HEADER_DIR = /usr/include -+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent -+# `fixinc' from fixing header files in /usr/include. However, -+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set -+# it to some dummy directory. -+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY) - # Default cross SYSTEM_HEADER_DIR, to be overridden by targets. - CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ - -@@ -2201,7 +2205,7 @@ - -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ - -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_alias)\" \ - -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \ -- -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \ -+ -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \ - -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \ - -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \ - @TARGET_SYSTEM_ROOT_DEFINE@ diff --git a/pkgs/development/libraries/gcc/libstdc++/struct-ucontext.patch b/pkgs/development/libraries/gcc/libstdc++/struct-ucontext.patch deleted file mode 100644 index 5462e0e33ecd..000000000000 --- a/pkgs/development/libraries/gcc/libstdc++/struct-ucontext.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h -index 3a2940c..67f9899 100644 ---- a/gcc/config/alpha/linux.h -+++ b/gcc/config/alpha/linux.h -@@ -89,7 +89,7 @@ Boston, MA 02111-1307, USA. */ - { \ - struct rt_sigframe { \ - struct siginfo info; \ -- struct ucontext uc; \ -+ ucontext_t uc; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = &rt_->uc.uc_mcontext; \ - } \ -diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h -index e86ab3d..30797a7 100644 ---- a/gcc/config/i386/linux.h -+++ b/gcc/config/i386/linux.h -@@ -260,7 +260,7 @@ Boston, MA 02111-1307, USA. */ - siginfo_t *pinfo; \ - void *puc; \ - siginfo_t info; \ -- struct ucontext uc; \ -+ ucontext_t uc; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \ - } \ -diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h -index fbfaa58..200c8dc 100644 ---- a/gcc/config/i386/linux64.h -+++ b/gcc/config/i386/linux64.h -@@ -112,7 +112,7 @@ Boston, MA 02111-1307, USA. */ - if (*(unsigned char *)(pc_+0) == 0x48 \ - && *(unsigned long *)(pc_+1) == 0x050f0000000fc0c7) \ - { \ -- struct ucontext *uc_ = (CONTEXT)->cfa; \ -+ ucontext_t *uc_ = (CONTEXT)->cfa; \ - sc_ = (struct sigcontext *) &uc_->uc_mcontext; \ - } \ - else \ -@@ -182,7 +182,7 @@ Boston, MA 02111-1307, USA. */ - struct siginfo *pinfo; \ - void *puc; \ - struct siginfo info; \ -- struct ucontext uc; \ -+ ucontext_t uc; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \ - } \ -diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h -index ba70ec1..0fff8b1 100644 ---- a/gcc/config/rs6000/linux.h -+++ b/gcc/config/rs6000/linux.h -@@ -101,7 +101,7 @@ Boston, MA 02111-1307, USA. */ - - struct kernel_old_ucontext { - unsigned long uc_flags; -- struct ucontext *uc_link; -+ ucontext_t *uc_link; - stack_t uc_stack; - struct sigcontext_struct uc_mcontext; - sigset_t uc_sigmask; diff --git a/pkgs/games/ut2004/default.nix b/pkgs/games/ut2004/default.nix deleted file mode 100644 index 3f306ac6eb54..000000000000 --- a/pkgs/games/ut2004/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ callPackage }: - -{ - ut2004-demo = callPackage ./demo.nix { }; - - ut2004 = gamePacks: callPackage ./wrapper.nix { - inherit gamePacks; - }; -} diff --git a/pkgs/games/ut2004/demo.nix b/pkgs/games/ut2004/demo.nix deleted file mode 100644 index caa6651e457f..000000000000 --- a/pkgs/games/ut2004/demo.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ lib, stdenv, fetchurl }: - -let - arch = - if stdenv.hostPlatform.system == "x86_64-linux" then "amd64" - else if stdenv.hostPlatform.system == "i686-linux" then "x86" - else throw "Unsupported architecture"; - -in stdenv.mkDerivation rec { - pname = "ut2004-demo"; - version = "3334"; - - src = fetchurl { - url = "http://ftp.snt.utwente.nl/pub/games/UT2004/demo/UT2004-LNX-Demo${version}.run.gz"; - sha256 = "0d5f84qz8l1rg16yzx2k4ikr46n9iwj68na1bqi87wrww7ck6jh7"; - }; - - buildCommand = '' - cat $src | gunzip > setup.run - chmod +x setup.run - ./setup.run --noexec --target . - mkdir $out - tar -xaf ut2004demo.tar.bz2 -C $out - tar -xaf linux-${arch}.tar.bz2 -C $out - - rm $out/System/libSDL-1.2.so.0 - rm $out/System/openal.so - ''; - - dontStrip = true; - dontPatchELF = true; - - meta = with lib; { - description = "First-person shooter video game developed by Epic Games and Digital Extreme -- demo version"; - homepage = "http://www.unrealtournament2004.com"; - license = licenses.unfree; - maintainers = with maintainers; [ abbradar ]; - platforms = [ "x86_64-linux" "i686-linux" ]; - }; -} diff --git a/pkgs/games/ut2004/wrapper.nix b/pkgs/games/ut2004/wrapper.nix deleted file mode 100644 index cc5b0e400bc1..000000000000 --- a/pkgs/games/ut2004/wrapper.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ stdenv, lib, runCommand, buildEnv, makeWrapper, makeDesktopItem, gamePacks, libstdcxx5, SDL, openal }: - -let - game = buildEnv { - name = "ut2004-game"; - paths = gamePacks; - ignoreCollisions = true; - pathsToLink = [ "/" "/System" ]; - postBuild = '' - ln -s ${lib.getLib SDL}/lib/libSDL-1.2.so.0 $out/System - ln -s ${lib.getLib openal}/lib/libopenal.so $out/System/openal.so - for i in $out/System/*-bin; do - path="$(readlink -f "$i")" - rm "$i" - cp "$path" "$i" - chmod +w "$i" - patchelf \ - --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \ - --set-rpath "$out/System:${lib.makeLibraryPath [ libstdcxx5 ]}" \ - "$i" - done - ''; - }; - - desktop = makeDesktopItem { - name = "ut2004"; - desktopName = "Unreal Tournament 2004"; - comment = "A first-person shooter video game developed by Epic Games and Digital Extreme"; - genericName = "First-person shooter"; - categories = [ "Game" ]; - exec = "ut2004"; - }; - -in runCommand "ut2004" { - nativeBuildInputs = [ makeWrapper ]; -} '' - mkdir -p $out/bin - for i in ${game}/System/*-bin; do - name="$(basename "$i")" - makeWrapper $i $out/bin/''${name%-bin} \ - --chdir "${game}/System" - done - - mkdir -p $out/share/applications - ln -s ${desktop}/share/applications/* $out/share/applications -'' diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 4efab55ea533..328581b7d4b0 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -643,6 +643,7 @@ mapAliases { librewolf-wayland = librewolf; # Added 2022-11-15 libseat = throw "'libseat' has been renamed to/replaced by 'seatd'"; # Converted to throw 2024-10-17 libsForQt515 = libsForQt5; # Added 2022-11-24 + libstdcxx5 = throw "libstdcxx5 is severly outdated and has been removed"; # Added 2024-11-24 libtensorflow-bin = libtensorflow; # Added 2022-09-25 libtorrentRasterbar = throw "'libtorrentRasterbar' has been renamed to/replaced by 'libtorrent-rasterbar'"; # Converted to throw 2024-10-17 libtorrentRasterbar-1_2_x = throw "'libtorrentRasterbar-1_2_x' has been renamed to/replaced by 'libtorrent-rasterbar-1_2_x'"; # Converted to throw 2024-10-17 @@ -1283,6 +1284,8 @@ mapAliases { urxvt_tabbedex = throw "'urxvt_tabbedex' has been renamed to/replaced by 'rxvt-unicode-plugins.tabbedex'"; # Converted to throw 2024-10-17 urxvt_theme_switch = throw "'urxvt_theme_switch' has been renamed to/replaced by 'rxvt-unicode-plugins.theme-switch'"; # Converted to throw 2024-10-17 urxvt_vtwheel = throw "'urxvt_vtwheel' has been renamed to/replaced by 'rxvt-unicode-plugins.vtwheel'"; # Converted to throw 2024-10-17 + ut2004Packages = throw "UT2004 requires libstdc++5 which is not supported by nixpkgs anymore"; # Added 2024-11-24 + ut2004demo = ut2004Packages; # Added 2024-11-24 util-linuxCurses = util-linux; # Added 2022-04-12 utillinux = util-linux; # Added 2020-11-24, keep until node2nix is phased out, see https://github.com/NixOS/nixpkgs/issues/229475 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7543000e7961..fd59a97798b7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8184,8 +8184,6 @@ with pkgs; then targetPackages.stdenv.cc.cc else gcc.cc; - libstdcxx5 = callPackage ../development/libraries/gcc/libstdc++/5.nix { }; - libsigrok = callPackage ../development/tools/libsigrok { python = python3; }; @@ -17338,10 +17336,6 @@ with pkgs; ue4demos = recurseIntoAttrs (callPackage ../games/ue4demos { }); - ut2004Packages = dontRecurseIntoAttrs (callPackage ../games/ut2004 { }); - - ut2004demo = res.ut2004Packages.ut2004 [ res.ut2004Packages.ut2004-demo ]; - # To ensure vdrift's code is built on hydra vdrift-bin = vdrift.bin; diff --git a/pkgs/top-level/packages-config.nix b/pkgs/top-level/packages-config.nix index 51c2b44fc584..769cfb73d28f 100644 --- a/pkgs/top-level/packages-config.nix +++ b/pkgs/top-level/packages-config.nix @@ -21,7 +21,6 @@ rPackages roundcubePlugins sourceHanPackages - ut2004Packages zabbix50 zabbix60 zeroadPackages