Skip to content

Commit

Permalink
Bump nixpkgs.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Feb 3, 2025
1 parent 9f555d3 commit 31287df
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 6 deletions.
8 changes: 6 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
let
config = {
packageOverrides = pkgs: rec {
# Very ugly hack to use an older version of elfutils, as the
# newest apparently does not work with static linking.
elfutils191 = pkgs.callPackage ./nix/elfutils191.nix {};

haskellPackages = pkgs.haskellPackages.override {
overrides = haskellPackagesNew: haskellPackagesOld: rec {
futhark-data =
Expand Down Expand Up @@ -59,7 +63,7 @@ let
pkgs.haskell.lib.overrideCabal
(pkgs.haskell.lib.addBuildTools
(haskellPackagesOld.callCabal2nix "futhark" (cleanSource ./.) { })
[ pkgs.python39Packages.sphinx ])
[ pkgs.python312Packages.sphinx ])
( _drv: {
isLibrary = false;
isExecutable = true;
Expand Down Expand Up @@ -87,7 +91,7 @@ let
"--extra-lib-dirs=${(pkgs.xz.override { enableStatic = true; }).out}/lib"
"--extra-lib-dirs=${(pkgs.zstd.override { enableStatic = true; }).out}/lib"
"--extra-lib-dirs=${(pkgs.bzip2.override { enableStatic = true; }).out}/lib"
"--extra-lib-dirs=${(pkgs.elfutils.overrideAttrs (old: { dontDisableStatic= true; })).out}/lib"
"--extra-lib-dirs=${(elfutils191.overrideAttrs (old: { dontDisableStatic= true; })).out}/lib"
];

preBuild = ''
Expand Down
93 changes: 93 additions & 0 deletions nix/elfutils191.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{ lib, stdenv, fetchurl, fetchpatch, pkg-config, musl-fts
, musl-obstack, m4, zlib, zstd, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs
, argp-standalone
, enableDebuginfod ? lib.meta.availableOn stdenv.hostPlatform libarchive, sqlite, curl, libmicrohttpd, libarchive
, gitUpdater, autoreconfHook
}:

# TODO: Look at the hardcoded paths to kernel, modules etc.
stdenv.mkDerivation rec {
pname = "elfutils";
version = "0.191";

src = fetchurl {
url = "https://sourceware.org/elfutils/ftp/${version}/${pname}-${version}.tar.bz2";
hash = "sha256-33bbcTZtHXCDZfx6bGDKSDmPFDZ+sriVTvyIlxR62HE=";
};

postPatch = ''
patchShebangs tests/*.sh
'' + lib.optionalString stdenv.hostPlatform.isRiscV ''
# disable failing test:
#
# > dwfl_thread_getframes: No DWARF information found
sed -i s/run-backtrace-dwarf.sh//g tests/Makefile.in
'';

outputs = [ "bin" "dev" "out" "man" ];

# We need bzip2 in NativeInputs because otherwise we can't unpack the src,
# as the host-bzip2 will be in the path.
nativeBuildInputs = [ m4 bison flex gettext bzip2 ]
++ lib.optional enableDebuginfod pkg-config
++ lib.optional (stdenv.targetPlatform.useLLVM or false) autoreconfHook;
buildInputs = [ zlib zstd bzip2 xz ]
++ lib.optionals stdenv.hostPlatform.isMusl [
argp-standalone
musl-fts
musl-obstack
] ++ lib.optionals enableDebuginfod [
sqlite
curl
libmicrohttpd
libarchive
];

propagatedNativeBuildInputs = [ setupDebugInfoDirs ];

configureFlags = [
"--program-prefix=eu-" # prevent collisions with binutils
"--enable-deterministic-archives"
(lib.enableFeature enableDebuginfod "libdebuginfod")
(lib.enableFeature enableDebuginfod "debuginfod")

# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
# Versioned symbols are nice to have, but we can do without.
(lib.enableFeature (!stdenv.hostPlatform.isMicroBlaze) "symbol-versioning")
] ++ lib.optional (stdenv.targetPlatform.useLLVM or false) "--disable-demangler"
++ lib.optionals stdenv.cc.isClang [
"CFLAGS=-Wno-unused-private-field"
"CXXFLAGS=-Wno-unused-private-field"
];

enableParallelBuilding = true;


doCheck =
# Backtrace unwinding tests rely on glibc-internal symbol names.
# Musl provides slightly different forms and fails.
# Let's disable tests there until musl support is fully upstreamed.
!stdenv.hostPlatform.isMusl
# Test suite tries using `uname` to determine whether certain tests
# can be executed, so we need to match build and host platform exactly.
&& (stdenv.hostPlatform == stdenv.buildPlatform);
doInstallCheck = !stdenv.hostPlatform.isMusl
&& (stdenv.hostPlatform == stdenv.buildPlatform);

passthru.updateScript = gitUpdater {
url = "https://sourceware.org/git/elfutils.git";
rev-prefix = "elfutils-";
};

meta = with lib; {
homepage = "https://sourceware.org/elfutils/";
description = "Set of utilities to handle ELF objects";
platforms = platforms.linux;
# https://lists.fedorahosted.org/pipermail/elfutils-devel/2014-November/004223.html
badPlatforms = [ lib.systems.inspect.platformPatterns.isStatic ];
# licenses are GPL2 or LGPL3+ for libraries, GPL3+ for bins,
# but since this package isn't split that way, all three are listed.
license = with licenses; [ gpl2Only lgpl3Plus gpl3Plus ];
maintainers = with maintainers; [ r-burns ];
};
}
6 changes: 3 additions & 3 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0f1874526206d8a2d6f0a3925618cc45ac83049f",
"sha256": "0fab3015jdy6dsrjcsa8ipsl4pr7cizg8bs3ff2dawxfgrgizyqp",
"rev": "cf0e7c1ab2634e89fc2c4ec479609b8250dc0ace",
"sha256": "14g5j556bkckplprzb907d06mkxzxs45dzkglacz1jrx955xx86w",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/0f1874526206d8a2d6f0a3925618cc45ac83049f.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/cf0e7c1ab2634e89fc2c4ec479609b8250dc0ace.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {};
python = pkgs.python311Packages;
python = pkgs.python312Packages;
haskell = pkgs.haskell.packages.ghc96;
in
pkgs.stdenv.mkDerivation {
Expand Down

0 comments on commit 31287df

Please sign in to comment.