about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/woeusb
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/tools/misc/woeusb
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/woeusb')
-rw-r--r--nixpkgs/pkgs/tools/misc/woeusb/default.nix58
1 files changed, 58 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/misc/woeusb/default.nix b/nixpkgs/pkgs/tools/misc/woeusb/default.nix
new file mode 100644
index 000000000000..f73aa4547993
--- /dev/null
+++ b/nixpkgs/pkgs/tools/misc/woeusb/default.nix
@@ -0,0 +1,58 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, makeWrapper
+, coreutils, dosfstools, findutils, gawk, gnugrep, grub2_light, ncurses, ntfs3g, parted, p7zip, utillinux, wget
+, wxGTK30 }:
+
+stdenv.mkDerivation rec {
+  version = "3.2.10";
+  name = "woeusb-${version}";
+
+  src = fetchFromGitHub {
+    owner = "slacka";
+    repo = "WoeUSB";
+    rev = "v${version}";
+    sha256 = "0jzgwh9xv92yns5yi5zpl49zbp3csh6m6iclgq070awpjpsqlqi0";
+  };
+
+  nativeBuildInputs = [ autoreconfHook makeWrapper ];
+  buildInputs = [ wxGTK30 ];
+
+  postPatch = ''
+    # Emulate version smudge filter (see .gitattributes, .gitconfig).
+    for file in configure.ac debian/changelog src/woeusb src/woeusb.1 src/woeusbgui.1; do
+      substituteInPlace "$file" \
+        --replace '@@WOEUSB_VERSION@@' '${version}'
+    done
+
+    substituteInPlace src/MainPanel.cpp \
+      --replace "'woeusb " "'$out/bin/woeusb "
+  '';
+
+  postInstall = ''
+    # don't write data into /
+    substituteInPlace "$out/bin/woeusb" \
+      --replace /media/ /run/woeusb/
+
+    # woeusbgui launches woeusb with pkexec, which sets
+    # PATH=/usr/sbin:/usr/bin:/sbin:/bin:/root/bin.  Perhaps pkexec
+    # should be patched with a less useless default PATH, but for now
+    # we add everything we need manually.
+    wrapProgram "$out/bin/woeusb" \
+      --set PATH '${stdenv.lib.makeBinPath [ coreutils dosfstools findutils gawk gnugrep grub2_light ncurses ntfs3g parted utillinux wget p7zip ]}'
+  '';
+
+  doInstallCheck = true;
+
+  postInstallCheck = ''
+    # woeusb --version checks for missing runtime dependencies.
+    out_version="$("$out/bin/woeusb" --version)"
+    [ "$out_version" = '${version}' ]
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Create bootable USB disks from Windows ISO images";
+    homepage = https://github.com/slacka/WoeUSB;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ bjornfor gnidorah ];
+    platforms = platforms.linux;
+  };
+}