formatter: init at 0.3.0

authored by

Quentin Vaucher and committed by
worldofpeace
b99357ea 4434c123

+125
+70
pkgs/applications/misc/formatter/default.nix
··· 1 + { stdenv 2 + , fetchFromGitHub 3 + , meson 4 + , ninja 5 + , pkgconfig 6 + , pantheon 7 + , python3 8 + , substituteAll 9 + , glib 10 + , gtk3 11 + , dosfstools 12 + , e2fsprogs 13 + , exfat 14 + , hfsprogs 15 + , ntfs3g 16 + , libgee 17 + , wrapGAppsHook 18 + }: 19 + 20 + stdenv.mkDerivation rec { 21 + pname = "formatter"; 22 + version = "0.3.0"; 23 + 24 + src = fetchFromGitHub { 25 + owner = "Djaler"; 26 + repo = "Formatter"; 27 + rev = version; 28 + sha256 = "145742dk16736zxj30rzn61h4k0xpggfsbqkxllxd302mgbmxlzq"; 29 + }; 30 + 31 + patches = [ 32 + (substituteAll { 33 + src = ./fix-paths.patch; 34 + ext4 = "${e2fsprogs}/bin/mkfs.ext4"; 35 + exfat = "${exfat}/bin/mkfs.exfat"; 36 + fat = "${dosfstools}/bin/mkfs.fat"; 37 + ntfs = "${ntfs3g}/bin/mkfs.ntfs"; 38 + hfsplus = "${hfsprogs}/bin/mkfs.hfsplus"; 39 + }) 40 + ]; 41 + 42 + nativeBuildInputs = [ 43 + meson 44 + ninja 45 + pantheon.vala 46 + pkgconfig 47 + python3 48 + wrapGAppsHook 49 + ]; 50 + 51 + buildInputs = [ 52 + glib 53 + gtk3 54 + libgee 55 + pantheon.granite 56 + ]; 57 + 58 + postPatch = '' 59 + chmod +x meson/post_install.py 60 + patchShebangs meson/post_install.py 61 + ''; 62 + 63 + meta = with stdenv.lib; { 64 + description = "A simple formatter designed for elementary OS"; 65 + homepage = "https://github.com/Djaler/Formatter"; 66 + maintainers = with maintainers; [ kjuvi ] ++ pantheon.maintainers; 67 + platforms = platforms.linux; 68 + license = licenses.lgpl2Plus; 69 + }; 70 + }
+53
pkgs/applications/misc/formatter/fix-paths.patch
··· 1 + diff --git a/src/Objects/DeviceFormatter.vala b/src/Objects/DeviceFormatter.vala 2 + index cf6a3b8..0de10a9 100644 3 + --- a/src/Objects/DeviceFormatter.vala 4 + +++ b/src/Objects/DeviceFormatter.vala 5 + @@ -62,42 +62,42 @@ namespace Formatter { 6 + string drive_identifier = drive.get_identifier ("unix-device"); 7 + switch (filesystem) { 8 + case Formatter.Filesystems.EXT4: 9 + - spawn_args = {"pkexec", "mkfs.ext4", drive_identifier, "-F"}; 10 + + spawn_args = {"pkexec", "@ext4@", drive_identifier, "-F"}; 11 + if (label != "") { 12 + spawn_args += "-L"; 13 + spawn_args += label; 14 + } 15 + break; 16 + case Formatter.Filesystems.EXFAT: 17 + - spawn_args = {"pkexec", "mkfs.exfat", drive_identifier}; 18 + + spawn_args = {"pkexec", "@exfat@", drive_identifier}; 19 + if (label != "") { 20 + spawn_args += "-n"; 21 + spawn_args += label; 22 + } 23 + break; 24 + case Formatter.Filesystems.FAT16: 25 + - spawn_args = {"pkexec", "mkfs.fat", "-F16", "-I", drive_identifier}; 26 + + spawn_args = {"pkexec", "@fat@", "-F16", "-I", drive_identifier}; 27 + if (label != "") { 28 + spawn_args += "-n"; 29 + spawn_args += label; 30 + } 31 + break; 32 + case Formatter.Filesystems.FAT32: 33 + - spawn_args = {"pkexec", "mkfs.fat", "-F32", "-I", drive_identifier}; 34 + + spawn_args = {"pkexec", "@fat@", "-F32", "-I", drive_identifier}; 35 + if (label != "") { 36 + spawn_args += "-n"; 37 + spawn_args += label; 38 + } 39 + break; 40 + case Formatter.Filesystems.NTFS: 41 + - spawn_args = {"pkexec", "mkfs.ntfs", drive_identifier, "-f", "-F"}; 42 + + spawn_args = {"pkexec", "@ntfs@", drive_identifier, "-f", "-F"}; 43 + if (label != "") { 44 + spawn_args += "-L"; 45 + spawn_args += label; 46 + } 47 + break; 48 + case Formatter.Filesystems.HFS_PLUS: 49 + - spawn_args = {"pkexec", "mkfs.hfsplus", drive_identifier}; 50 + + spawn_args = {"pkexec", "@hfsplus@", drive_identifier}; 51 + if (label != "") { 52 + spawn_args += "-v"; 53 + spawn_args += label;
+2
pkgs/top-level/all-packages.nix
··· 18504 18504 18505 18505 fomp = callPackage ../applications/audio/fomp { }; 18506 18506 18507 + formatter = callPackage ../applications/misc/formatter { }; 18508 + 18507 18509 fractal = callPackage ../applications/networking/instant-messengers/fractal { }; 18508 18510 18509 18511 freecad = qt5.callPackage ../applications/graphics/freecad { mpi = openmpi; };