libelf: use the normal version on FreeBSD

libelf-freebsd predates our current efforts at FreeBSD in Nixpkgs, and
I'm not sure how it could ever have been a libelf replacement, as it
just copies a bunch of C files into $out.  Let's just replace it with
the normal version (after we've fixed its build.)

We might end up wanting to use freebsd.libelf — I'm not sure, but
currently it doesn't even build so it's out of consideration for now.
This commit is contained in:
Alyssa Ross 2023-01-14 19:22:20 +00:00
parent 6b692bc868
commit a2ed6cff34
3 changed files with 9 additions and 46 deletions

View File

@ -1,38 +0,0 @@
{ lib, fetchsvn, stdenv, gnum4, tet }:
stdenv.mkDerivation (rec {
version = "3258";
pname = "libelf-freebsd";
src = fetchsvn {
url = "svn://svn.code.sf.net/p/elftoolchain/code/trunk";
rev = (lib.strings.toInt version);
name = "elftoolchain-${version}";
sha256 = "1rcmddjanlsik0b055x8k914r9rxs8yjsvslia2nh1bhzf1lxmqz";
};
buildInputs = [ gnum4 tet ];
buildPhase = ''
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:$PATH # use BSD install(1) instead of coreutils and make(1) instead of GNU Make
cp -vr ${tet} test/tet/tet3.8
chmod -R a+w test/tet/tet3.8
make libelf
'';
installPhase = ''
cp -vr libelf $out
cp -vr common/. $out/
'';
meta = {
description = "Essential compilation tools and libraries for building and analyzing ELF based program images";
homepage = "https://sourceforge.net/p/elftoolchain/wiki/Home/";
license = lib.licenses.bsd2;
platforms = lib.platforms.freebsd;
maintainers = [ ];
};
})

View File

@ -1,5 +1,5 @@
{ lib, stdenv
, fetchurl, autoreconfHook, gettext, netbsd
, fetchurl, autoreconfHook, gettext, freebsd, netbsd
}:
# Note: this package is used for bootstrapping fetchurl, and thus
@ -42,11 +42,14 @@ stdenv.mkDerivation rec {
strictDeps = true;
nativeBuildInputs =
(if stdenv.hostPlatform.isNetBSD then [ netbsd.gencat ] else [ gettext ])
(if stdenv.hostPlatform.isFreeBSD then [ freebsd.gencat ]
else if stdenv.hostPlatform.isNetBSD then [ netbsd.gencat ]
else [ gettext ])
# Need to regenerate configure script with newer version in order to pass
# "mr_cv_target_elf=yes", but `autoreconfHook` brings in `makeWrapper`
# which doesn't work with the bootstrapTools bash, so can only do this
# for cross builds when `stdenv.shell` is a newer bash.
# "mr_cv_target_elf=yes" and determine integer sizes correctly when
# cross-compiling, but `autoreconfHook` brings in `makeWrapper` which
# doesn't work with the bootstrapTools bash, so can only do this for
# cross builds when `stdenv.shell` is a newer bash.
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) autoreconfHook;
meta = {

View File

@ -20804,9 +20804,7 @@ with pkgs;
libedit = callPackage ../development/libraries/libedit { };
libelf = if stdenv.isFreeBSD
then callPackage ../development/libraries/libelf-freebsd { }
else callPackage ../development/libraries/libelf { };
libelf = callPackage ../development/libraries/libelf { };
libelfin = callPackage ../development/libraries/libelfin { };