summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2021-03-20 15:16:25 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2021-03-23 15:24:43 -0300
commitf7d1fb542fee29f90a85a2683da5835848de67d3 (patch)
tree2bfbe684b45b97e9999332f4ddb2dc18486069a2
parent9e04298eff874511fc78341255c587db905cd2c0 (diff)
downloadnixpkgs-f7d1fb542fee29f90a85a2683da5835848de67d3.tar
nixpkgs-f7d1fb542fee29f90a85a2683da5835848de67d3.tar.gz
nixpkgs-f7d1fb542fee29f90a85a2683da5835848de67d3.tar.bz2
nixpkgs-f7d1fb542fee29f90a85a2683da5835848de67d3.tar.lz
nixpkgs-f7d1fb542fee29f90a85a2683da5835848de67d3.tar.xz
nixpkgs-f7d1fb542fee29f90a85a2683da5835848de67d3.tar.zst
nixpkgs-f7d1fb542fee29f90a85a2683da5835848de67d3.zip
mksh: fix license
According to official documentation (http://www.mirbsd.org/TaC-mksh.txt), mksh
licensing changes according to build-time configuration.
-rw-r--r--pkgs/shells/mksh/default.nix34
1 files changed, 25 insertions, 9 deletions
diff --git a/pkgs/shells/mksh/default.nix b/pkgs/shells/mksh/default.nix
index c10537959d7..360380e19b3 100644
--- a/pkgs/shells/mksh/default.nix
+++ b/pkgs/shells/mksh/default.nix
@@ -1,4 +1,8 @@
-{ lib, stdenv, fetchurl }:
+{ lib
+, stdenv
+, fetchurl
+, installShellFiles
+}:
 
 stdenv.mkDerivation rec {
   pname = "mksh";
@@ -6,20 +10,30 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     urls = [
-      "https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R${version}.tgz"
-      "http://pub.allbsd.org/MirOS/dist/mir/mksh/mksh-R${version}.tgz"
+      "https://www.mirbsd.org/MirOS/dist/mir/mksh/${pname}-R${version}.tgz"
+      "http://pub.allbsd.org/MirOS/dist/mir/mksh/${pname}-R${version}.tgz"
     ];
-    sha256 = "01n5ggw33bw4jv4d3148wlw9n4aj7vdn3ffnc66c9w9pldjidbkp";
+    hash = "sha256-d64WZaM38cSMYda5Yds+UhGbOOWIhNHIloSvMfh7xQY=";
   };
 
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
   dontConfigure = true;
 
-  buildPhase = "sh ./Build.sh -r";
+  buildPhase = ''
+    runHook preBuild
+    sh ./Build.sh -r
+    runHook postBuild
+  '';
 
   installPhase = ''
-    install -D -m 755 mksh $out/bin/mksh
-    install -D -m 644 mksh.1 $out/share/man/man1/mksh.1
-    install -D -m 644 dot.mkshrc $out/share/mksh/mkshrc
+    runHook preInstall
+    install -D mksh $out/bin/mksh
+    install -D dot.mkshrc $out/share/mksh/mkshrc
+    installManPage mksh.1
+    runHook postInstall
   '';
 
   meta = with lib; {
@@ -32,7 +46,7 @@ stdenv.mkDerivation rec {
       systems.
     '';
     homepage = "https://www.mirbsd.org/mksh.htm";
-    license = licenses.bsd3;
+    license = with licenses; [ miros isc unicode-dfs-2016 ];
     maintainers = with maintainers; [ AndersonTorres joachifm ];
     platforms = platforms.unix;
   };
@@ -41,3 +55,5 @@ stdenv.mkDerivation rec {
     shellPath = "/bin/mksh";
   };
 }
+# TODO [ AndersonTorres ]: lksh
+# TODO [ AndersonTorres ]: a more accurate licensing info