Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syslinux: fix submodule clone #316878

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions pkgs/os-specific/linux/syslinux/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchgit
, fetchurl
, libuuid
Expand All @@ -10,17 +11,27 @@
, python3
}:

let
gnu-efi-src = fetchFromGitHub {
owner = "ncroxon";
repo = "gnu-efi";
# see 363d61c4f112b972649b19d67e96b9321f738f00 in syslinux
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# see 363d61c4f112b972649b19d67e96b9321f738f00 in syslinux
# see 363d61c4f112b972649b19d67e96b9321f738f00 in syslinux
# https://repo.or.cz/syslinux.git/commitdiff/363d61c4f112b972649b19d67e96b9321f738f00

rev = "d34132e62f666904158c7ec2f1eef5a9d5281c36";
hash = "sha256-SYr8Lkp6qsNIGQ7I9JXI9HKsh1gcOJbwvOd1lMqLB1c=";
};
in

stdenv.mkDerivation {
pname = "syslinux";
version = "unstable-2019-02-07";

# This is syslinux-6.04-pre3^1; syslinux-6.04-pre3 fails to run.
# Same issue here https://www.syslinux.org/archives/2019-February/026330.html
src = fetchgit {
url = "https://repo.or.cz/syslinux";
url = "https://repo.or.cz/syslinux.git";
rev = "b40487005223a78c3bb4c300ef6c436b3f6ec1f7";
sha256 = "sha256-GqvRTr9mA2yRD0G0CF11x1X0jCgqV4Mh+tvE0/0yjqk=";
fetchSubmodules = true;
fetchSubmodules = false;
hash = "sha256-XNC+X7UYxdMQQAg4MLACQLxRNnI5/ZCOiCJrEkKgPeM=";
};

patches = let
Expand Down Expand Up @@ -68,12 +79,16 @@ stdenv.mkDerivation {
];

postPatch = ''
substituteInPlace Makefile --replace /bin/pwd $(type -P pwd)
substituteInPlace utils/ppmtolss16 --replace /usr/bin/perl $(type -P perl)
substituteInPlace Makefile --replace-fail /bin/pwd $(type -P pwd)
substituteInPlace utils/ppmtolss16 --replace-fail /usr/bin/perl $(type -P perl)

# fix tests
substituteInPlace tests/unittest/include/unittest/unittest.h \
--replace /usr/include/ ""
--replace-fail /usr/include/ ""

# needs to be manually put in place because submodule hash contains an extra g in the beginning gd34132e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the g is the problem here: the error message in the current behavior has fatal: Fetched in submodule path 'gnu-efi', but it did not contain d34132e62f666904158c7ec2f1eef5a9d5281c36. Direct fetching of that commit failed., so it seems to get the git hash just fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then my best next guess is, that sourceforge is weird. I didn't want to click through many pages to find the old release.

cp -r ${gnu-efi-src}/* ./gnu-efi
chmod -R +w ./gnu-efi

# Hack to get `gcc -m32' to work without having 32-bit Glibc headers.
mkdir gnu-efi/inc/ia32/gnu
Expand Down Expand Up @@ -126,7 +141,7 @@ stdenv.mkDerivation {
'';

meta = with lib; {
homepage = "http://www.syslinux.org/";
homepage = "https://www.syslinux.org/";
description = "A lightweight bootloader";
license = licenses.gpl2Plus;
maintainers = [ maintainers.samueldr ];
Expand Down