about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorSilvan Mosberger <silvan.mosberger@tweag.io>2023-08-31 22:45:21 +0200
committerSilvan Mosberger <silvan.mosberger@tweag.io>2023-09-05 16:11:04 +0200
commit77d50b03e4388f22e1f36a2621a9287a12a138be (patch)
tree3f450ccaaf30eba3eb00cd369801b0d526757714 /pkgs/by-name
parent87f7f1641ce421870d72a5fabaa934fe5de44c2d (diff)
hello: Move to pkgs/by-name
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/he/hello/package.nix45
-rw-r--r--pkgs/by-name/he/hello/test.nix8
2 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/by-name/he/hello/package.nix b/pkgs/by-name/he/hello/package.nix
new file mode 100644
index 0000000000000..e9b9e4f4b96e7
--- /dev/null
+++ b/pkgs/by-name/he/hello/package.nix
@@ -0,0 +1,45 @@
+{ callPackage
+, lib
+, stdenv
+, fetchurl
+, nixos
+, testers
+, hello
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "hello";
+  version = "2.12.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/hello/hello-${finalAttrs.version}.tar.gz";
+    sha256 = "sha256-jZkUKv2SV28wsM18tCqNxoCZmLxdYH2Idh9RLibH2yA=";
+  };
+
+  doCheck = true;
+
+  passthru.tests = {
+    version = testers.testVersion { package = hello; };
+
+    invariant-under-noXlibs =
+      testers.testEqualDerivation
+        "hello must not be rebuilt when environment.noXlibs is set."
+        hello
+        (nixos { environment.noXlibs = true; }).pkgs.hello;
+  };
+
+  passthru.tests.run = callPackage ./test.nix { hello = finalAttrs.finalPackage; };
+
+  meta = with lib; {
+    description = "A program that produces a familiar, friendly greeting";
+    longDescription = ''
+      GNU Hello is a program that prints "Hello, world!" when you run it.
+      It is fully customizable.
+    '';
+    homepage = "https://www.gnu.org/software/hello/manual/";
+    changelog = "https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${finalAttrs.version}";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.eelco ];
+    platforms = platforms.all;
+  };
+})
diff --git a/pkgs/by-name/he/hello/test.nix b/pkgs/by-name/he/hello/test.nix
new file mode 100644
index 0000000000000..7acded2a16f2d
--- /dev/null
+++ b/pkgs/by-name/he/hello/test.nix
@@ -0,0 +1,8 @@
+{ runCommand, hello }:
+
+runCommand "hello-test-run" {
+  nativeBuildInputs = [ hello ];
+} ''
+  diff -U3 --color=auto <(hello) <(echo 'Hello, world!')
+  touch $out
+''