drawterm: migrate to by-name; add darwin platform (#397996)

authored by Aleksana and committed by GitHub 15839077 c86a9367

+103 -96
+102
pkgs/by-name/dr/drawterm/package.nix
···
··· 1 + { 2 + stdenv, 3 + lib, 4 + fetchFrom9Front, 5 + unstableGitUpdater, 6 + installShellFiles, 7 + makeWrapper, 8 + apple-sdk_13, 9 + xorg, 10 + pkg-config, 11 + wayland-scanner, 12 + pipewire, 13 + wayland, 14 + wayland-protocols, 15 + libxkbcommon, 16 + wlr-protocols, 17 + pulseaudio, 18 + nixosTests, 19 + withWayland ? false, 20 + }: 21 + let 22 + withXorg = !(withWayland || stdenv.hostPlatform.isDarwin); 23 + in 24 + stdenv.mkDerivation { 25 + pname = "drawterm"; 26 + version = "0-unstable-2025-03-18"; 27 + 28 + src = fetchFrom9Front { 29 + owner = "plan9front"; 30 + repo = "drawterm"; 31 + rev = "0b43ac046ca81d78e9eca535ab1e92971d30405a"; 32 + hash = "sha256-L0a81zwzIKwnRK/Mu/kW1oHoJCroa+VDNGj7CI90WMQ="; 33 + }; 34 + 35 + enableParallelBuilding = true; 36 + strictDeps = true; 37 + nativeBuildInputs = 38 + [ 39 + installShellFiles 40 + makeWrapper 41 + ] 42 + ++ lib.optionals withWayland [ 43 + pkg-config 44 + wayland-scanner 45 + ]; 46 + 47 + buildInputs = 48 + lib.optionals withWayland [ 49 + pipewire 50 + wayland 51 + wayland-protocols 52 + libxkbcommon 53 + wlr-protocols 54 + ] 55 + ++ lib.optionals withXorg [ 56 + xorg.libX11 57 + xorg.libXt 58 + ] 59 + ++ lib.optional stdenv.hostPlatform.isDarwin apple-sdk_13; 60 + 61 + makeFlags = 62 + lib.optional withWayland "CONF=linux" 63 + ++ lib.optional (!(withWayland || stdenv.hostPlatform.isDarwin)) "CONF=unix" 64 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ 65 + "CONF=osx-cocoa" 66 + "CC=clang" 67 + ]; 68 + 69 + installPhase = 70 + '' 71 + installManPage drawterm.1 72 + '' 73 + + lib.optionalString withWayland '' 74 + install -Dm755 -t $out/bin/ drawterm 75 + '' 76 + + lib.optionalString (!(withWayland || stdenv.hostPlatform.isDarwin)) '' 77 + # wrapping the oss output with pulse seems to be the easiest 78 + mv drawterm drawterm.bin 79 + install -Dm755 -t $out/bin/ drawterm.bin 80 + makeWrapper ${pulseaudio}/bin/padsp $out/bin/drawterm --add-flags $out/bin/drawterm.bin 81 + '' 82 + + lib.optionalString stdenv.hostPlatform.isDarwin '' 83 + mkdir -p $out/{Applications,bin} 84 + mv gui-cocoa/drawterm.app $out/Applications/ 85 + mv drawterm $out/Applications/drawterm.app/ 86 + ln -s $out/Applications/drawterm.app/drawterm $out/bin/ 87 + ''; 88 + 89 + passthru = { 90 + updateScript = unstableGitUpdater { shallowClone = false; }; 91 + tests = nixosTests.drawterm; 92 + }; 93 + 94 + meta = { 95 + description = "Connect to Plan 9 CPU servers from other operating systems"; 96 + homepage = "https://drawterm.9front.org/"; 97 + license = lib.licenses.mit; 98 + maintainers = with lib.maintainers; [ moody ]; 99 + platforms = with lib.platforms; linux ++ darwin; 100 + mainProgram = "drawterm"; 101 + }; 102 + }
-94
pkgs/tools/admin/drawterm/default.nix
··· 1 - { 2 - stdenv, 3 - lib, 4 - fetchFrom9Front, 5 - unstableGitUpdater, 6 - installShellFiles, 7 - makeWrapper, 8 - xorg, 9 - pkg-config, 10 - wayland-scanner, 11 - pipewire, 12 - wayland, 13 - wayland-protocols, 14 - libxkbcommon, 15 - wlr-protocols, 16 - pulseaudio, 17 - config, 18 - nixosTests, 19 - }: 20 - 21 - stdenv.mkDerivation { 22 - pname = "drawterm"; 23 - version = "0-unstable-2025-03-18"; 24 - 25 - src = fetchFrom9Front { 26 - owner = "plan9front"; 27 - repo = "drawterm"; 28 - rev = "0b43ac046ca81d78e9eca535ab1e92971d30405a"; 29 - hash = "sha256-L0a81zwzIKwnRK/Mu/kW1oHoJCroa+VDNGj7CI90WMQ="; 30 - }; 31 - 32 - enableParallelBuilding = true; 33 - strictDeps = true; 34 - nativeBuildInputs = 35 - [ installShellFiles ] 36 - ++ { 37 - linux = [ 38 - pkg-config 39 - wayland-scanner 40 - ]; 41 - unix = [ makeWrapper ]; 42 - } 43 - ."${config}" or (throw "unsupported CONF"); 44 - 45 - buildInputs = 46 - { 47 - linux = [ 48 - pipewire 49 - wayland 50 - wayland-protocols 51 - libxkbcommon 52 - wlr-protocols 53 - ]; 54 - unix = [ 55 - xorg.libX11 56 - xorg.libXt 57 - ]; 58 - } 59 - ."${config}" or (throw "unsupported CONF"); 60 - 61 - # TODO: macos 62 - makeFlags = [ "CONF=${config}" ]; 63 - 64 - installPhase = 65 - { 66 - linux = '' 67 - install -Dm755 -t $out/bin/ drawterm 68 - ''; 69 - unix = '' 70 - # wrapping the oss output with pulse seems to be the easiest 71 - mv drawterm drawterm.bin 72 - install -Dm755 -t $out/bin/ drawterm.bin 73 - makeWrapper ${pulseaudio}/bin/padsp $out/bin/drawterm --add-flags $out/bin/drawterm.bin 74 - ''; 75 - } 76 - ."${config}" or (throw "unsupported CONF") 77 - + '' 78 - installManPage drawterm.1 79 - ''; 80 - 81 - passthru = { 82 - updateScript = unstableGitUpdater { shallowClone = false; }; 83 - tests = nixosTests.drawterm; 84 - }; 85 - 86 - meta = with lib; { 87 - description = "Connect to Plan 9 CPU servers from other operating systems"; 88 - homepage = "https://drawterm.9front.org/"; 89 - license = licenses.mit; 90 - maintainers = with maintainers; [ moody ]; 91 - platforms = platforms.linux; 92 - mainProgram = "drawterm"; 93 - }; 94 - }
···
+1 -2
pkgs/top-level/all-packages.nix
··· 14037 buildServerGui = false; 14038 }; 14039 14040 - drawterm = callPackage ../tools/admin/drawterm { config = "unix"; }; 14041 - drawterm-wayland = callPackage ../tools/admin/drawterm { config = "linux"; }; 14042 14043 droopy = python3Packages.callPackage ../applications/networking/droopy { }; 14044
··· 14037 buildServerGui = false; 14038 }; 14039 14040 + drawterm-wayland = callPackage ../by-name/dr/drawterm/package.nix { withWayland = true; }; 14041 14042 droopy = python3Packages.callPackage ../applications/networking/droopy { }; 14043