From 002dc76285b974b064f340ffbc25fdb602726463 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Fri, 22 Mar 2024 14:37:16 +0100 Subject: [PATCH 1/3] limine: init at 7.1.0 This only inits the package, but not a module to use it as bootloader for NixOS. This will come as a follow-up. However, this package alone is also useful for itself, as one can create bootable images with the artifacts exported by it, similar to `grub-mkrescue` or `grub-mkstandalone`. Look at the Limine README for further instructions. --- pkgs/by-name/li/limine/package.nix | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 pkgs/by-name/li/limine/package.nix diff --git a/pkgs/by-name/li/limine/package.nix b/pkgs/by-name/li/limine/package.nix new file mode 100644 index 000000000000..f231ee51c459 --- /dev/null +++ b/pkgs/by-name/li/limine/package.nix @@ -0,0 +1,59 @@ +# Builds limine with all available features. + +{ + # Helpers + stdenv +, fetchurl +, lib +, # Dependencies + llvmPackages +, mtools +, nasm +}: + +let + version = "7.3.0"; +in +# The output of the derivation is a tool to create bootable images using Limine +# as bootloader for various platforms and corresponding binary and helper files. +stdenv.mkDerivation { + inherit version; + pname = "limine"; + # We don't use the Git source but the release tarball, as the source has a + # `./bootstrap` script performing network access to download resources. + # Packaging that in Nix is very cumbersome. + src = fetchurl { + url = "https://github.com/limine-bootloader/limine/releases/download/v${version}/limine-${version}.tar.gz"; + sha256 = "sha256-iPi6u3iZOJfVRERrJVgH6q16aANnSGgBL5AtNuANrao="; + }; + + nativeBuildInputs = [ + llvmPackages.bintools + # gcc is used for the host tool, while clang is used for the bootloader. + llvmPackages.clang + llvmPackages.lld + mtools + nasm + ]; + + configureFlags = [ + "--enable-all" + ]; + + installFlags = [ "destdir=$out" "manprefix=/share" ]; + + outputs = [ "out" "doc" "dev" "man" ]; + + meta = with lib; { + homepage = "https://limine-bootloader.org/"; + description = "Limine Bootloader"; + # Caution. Some submodules have different licenses. + license = licenses.bsd2; + # The platforms on that the Liminine binary and helper tools can run, not + # necessarily the platforms for that bootable images can be created. + platforms = platforms.unix; + maintainers = [ + maintainers.phip1611 + ]; + }; +} From 54ed3c6d9db0f684f96b65abfe77043f7dcde12c Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Mon, 25 Mar 2024 12:36:16 +0100 Subject: [PATCH 2/3] maintainers: add _48cf --- maintainers/maintainer-list.nix | 6 ++++++ pkgs/by-name/li/limine/package.nix | 1 + 2 files changed, 7 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 6903a1e2581f..3f9683d8543a 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -203,6 +203,12 @@ fingerprint = "D292 365E 3C46 A5AA 75EE B30B 78DB 7EDE 3540 794B"; }]; }; + _48cf = { + name = "czapek"; + email = "czapek1337@gmail.com"; + github = "48cf"; + githubId = 32851089; + }; _6543 = { email = "6543@obermui.de"; github = "6543"; diff --git a/pkgs/by-name/li/limine/package.nix b/pkgs/by-name/li/limine/package.nix index f231ee51c459..cb50927a3dd1 100644 --- a/pkgs/by-name/li/limine/package.nix +++ b/pkgs/by-name/li/limine/package.nix @@ -53,6 +53,7 @@ stdenv.mkDerivation { # necessarily the platforms for that bootable images can be created. platforms = platforms.unix; maintainers = [ + maintainers._48cf maintainers.phip1611 ]; }; From 9dcf51fae3ea374f046af31c435c12964161df61 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Fri, 5 Apr 2024 17:03:39 +0200 Subject: [PATCH 3/3] limine: add all licenses of used submodules --- pkgs/by-name/li/limine/package.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/li/limine/package.nix b/pkgs/by-name/li/limine/package.nix index cb50927a3dd1..cb1beb378a7b 100644 --- a/pkgs/by-name/li/limine/package.nix +++ b/pkgs/by-name/li/limine/package.nix @@ -48,7 +48,13 @@ stdenv.mkDerivation { homepage = "https://limine-bootloader.org/"; description = "Limine Bootloader"; # Caution. Some submodules have different licenses. - license = licenses.bsd2; + license = [ + licenses.bsd2 # limine, flanterm + licenses.bsd0 # freestanding-toolchain, freestanding-headers + licenses.asl20 # cc-runtime + licenses.mit # limine-efi, stb + licenses.zlib # tinf + ]; # The platforms on that the Liminine binary and helper tools can run, not # necessarily the platforms for that bootable images can be created. platforms = platforms.unix;