summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2021-07-27 11:55:49 +0200
committerSandro Jäckel <sandro.jaeckel@gmail.com>2021-07-27 12:24:16 +0200
commitb1b7d127d0d6c2d57e3e39f759356fd3d51b2262 (patch)
treeea2213a617efa18b8b09dfe83992ddad433b59ab /pkgs/applications
parent516627915f58acc54ebf7559848faf7c7697251e (diff)
downloadnixpkgs-b1b7d127d0d6c2d57e3e39f759356fd3d51b2262.tar
nixpkgs-b1b7d127d0d6c2d57e3e39f759356fd3d51b2262.tar.gz
nixpkgs-b1b7d127d0d6c2d57e3e39f759356fd3d51b2262.tar.bz2
nixpkgs-b1b7d127d0d6c2d57e3e39f759356fd3d51b2262.tar.lz
nixpkgs-b1b7d127d0d6c2d57e3e39f759356fd3d51b2262.tar.xz
nixpkgs-b1b7d127d0d6c2d57e3e39f759356fd3d51b2262.tar.zst
nixpkgs-b1b7d127d0d6c2d57e3e39f759356fd3d51b2262.zip
tiny8086: remove builder.sh
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/virtualization/8086tiny/builder.sh30
-rw-r--r--pkgs/applications/virtualization/8086tiny/default.nix43
-rw-r--r--pkgs/applications/virtualization/tiny8086/default.nix68
3 files changed, 68 insertions, 73 deletions
diff --git a/pkgs/applications/virtualization/8086tiny/builder.sh b/pkgs/applications/virtualization/8086tiny/builder.sh
deleted file mode 100644
index 210f11e1328..00000000000
--- a/pkgs/applications/virtualization/8086tiny/builder.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-
-source $stdenv/setup
-
-unpackPhase
-cd $sourceRoot
-
-make 8086tiny
-
-if [ $bios ]; then
-    cd bios_source
-    nasm -f bin bios.asm -o bios
-    cd ..
-fi
-
-mkdir -p $out/bin $out/share/$name $out/share/doc/$name/images
-
-install -m 755 8086tiny $out/bin
-install -m 644 fd.img $out/share/$name/8086tiny-floppy.img
-install -m 644 bios_source/bios.asm  $out/share/$name/8086tiny-bios-src.asm
-install -m 644 docs/8086tiny.css  $out/share/doc/$name
-install -m 644 docs/doc.html  $out/share/doc/$name
-for i in docs/images/*.gif
-do
-    install -m 644 $i $out/share/doc/$name/images
-done
-if [ $bios ]; then
-    install -m 644 bios_source/bios $out/share/$name/8086tiny-bios
-else
-    install -m 644 bios $out/share/$name/8086tiny-bios
-fi
diff --git a/pkgs/applications/virtualization/8086tiny/default.nix b/pkgs/applications/virtualization/8086tiny/default.nix
deleted file mode 100644
index c58d488f583..00000000000
--- a/pkgs/applications/virtualization/8086tiny/default.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ lib, stdenv, fetchFromGitHub
-, localBios ? true, nasm ? null
-, sdlSupport ? true, SDL ? null }:
-
-assert sdlSupport -> (SDL != null);
-
-stdenv.mkDerivation rec {
-
-  pname = "8086tiny";
-  version = "1.25";
-
-  src = fetchFromGitHub {
-    owner = "adriancable";
-    repo = pname;
-    rev = "c79ca2a34d96931d55ef724c815b289d0767ae3a";
-    sha256 = "00aydg8f28sgy8l3rd2a7jvp56lx3b63hhak43p7g7vjdikv495w";
-  };
-
-  buildInputs = with lib;
-  optionals localBios [ nasm ]
-  ++  optionals sdlSupport [ SDL ];
-
-  bios = localBios;
-
-  builder = ./builder.sh;
-
-  meta = with lib; {
-    description = "An open-source small 8086 emulator";
-    longDescription = ''
-      8086tiny is a tiny, open-source (MIT), portable (little-endian hosts)
-      Intel PC emulator, powerful enough to run DOS, Windows 3.0, Excel, MS
-      Flight Simulator, AutoCAD, Lotus 1-2-3, and similar applications. 8086tiny
-      emulates a "late 80's era" PC XT-type machine.
-
-      8086tiny is based on an IOCCC 2013 winning entry. In fact that is the
-      "unobfuscated" version :)
-    '';
-    homepage = "https://github.com/adriancable/8086tiny";
-    license = licenses.mit;
-    maintainers = [ maintainers.AndersonTorres ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/applications/virtualization/tiny8086/default.nix b/pkgs/applications/virtualization/tiny8086/default.nix
new file mode 100644
index 00000000000..60d69432cde
--- /dev/null
+++ b/pkgs/applications/virtualization/tiny8086/default.nix
@@ -0,0 +1,68 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, localBios ? true
+, nasm
+, sdlSupport ? true
+, SDL
+}:
+
+stdenv.mkDerivation rec {
+  pname = "8086tiny";
+  version = "1.25";
+
+  src = fetchFromGitHub {
+    owner = "adriancable";
+    repo = pname;
+    rev = "c79ca2a34d96931d55ef724c815b289d0767ae3a";
+    sha256 = "00aydg8f28sgy8l3rd2a7jvp56lx3b63hhak43p7g7vjdikv495w";
+  };
+
+  buildInputs = lib.optional localBios nasm
+    ++ lib.optional sdlSupport SDL;
+
+  makeFlags = [ "8086tiny" ];
+
+  postBuild = lib.optionalString localBios ''
+    (
+      cd bios_source
+      nasm -f bin bios.asm -o bios
+    )
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/8086tiny $out/share/doc/8086tiny/images
+
+    install -m 755 8086tiny $out/bin
+    install -m 644 fd.img $out/share/8086tiny/8086tiny-floppy.img
+    install -m 644 bios_source/bios.asm $out/share/8086tiny/8086tiny-bios-src.asm
+    install -m 644 docs/8086tiny.css $out/share/doc/8086tiny
+    install -m 644 docs/doc.html $out/share/doc/$name
+
+    for i in docs/images/\*.gif; do
+      install -m 644 $i $out/share/doc/8086tiny/images
+    done
+
+    ${if localBios then
+      "install -m 644 bios_source/bios $out/share/8086tiny/8086tiny-bios"
+    else
+      "install -m 644 bios $out/share/8086tiny/8086tiny-bios"}
+  '';
+
+  meta = with lib; {
+    description = "An open-source small 8086 emulator";
+    longDescription = ''
+      8086tiny is a tiny, open-source (MIT), portable (little-endian hosts)
+      Intel PC emulator, powerful enough to run DOS, Windows 3.0, Excel, MS
+      Flight Simulator, AutoCAD, Lotus 1-2-3, and similar applications. 8086tiny
+      emulates a "late 80's era" PC XT-type machine.
+
+      8086tiny is based on an IOCCC 2013 winning entry. In fact that is the
+      "unobfuscated" version :)
+    '';
+    homepage = "https://github.com/adriancable/8086tiny";
+    license = licenses.mit;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}