nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at netboot-syslinux-multiplatform 117 lines 2.6 kB view raw
1{ lib 2, stdenv 3, fetchurl 4, undmg 5, dpkg 6, autoPatchelfHook 7, wrapGAppsHook 8, makeWrapper 9, alsa-lib 10, at-spi2-atk 11, gdk-pixbuf 12, glibc 13, nss 14, udev 15, xorg 16, gnome 17, mesa 18, gtk3 19, libusb1 20, libsecret 21, libappindicator 22, xdotool 23}: 24let 25 pname = "keeweb"; 26 version = "1.18.7"; 27 28 srcs = { 29 x86_64-linux = fetchurl { 30 url = "https://github.com/keeweb/keeweb/releases/download/v${version}/KeeWeb-${version}.linux.x64.deb"; 31 hash = "sha256-/U+vn5TLIU9/J6cRFjuAdyGzlwC04mp4L2X2ETp+ZSE="; 32 }; 33 x86_64-darwin = fetchurl { 34 url = "https://github.com/keeweb/keeweb/releases/download/v${version}/KeeWeb-${version}.mac.x64.dmg"; 35 hash = "sha256-+ZFGrrw0tZ7F6lb/3iBIyGD+tp1puVhkPv10hfp6ATU="; 36 }; 37 aarch64-darwin = fetchurl { 38 url = "https://github.com/keeweb/keeweb/releases/download/v${version}/KeeWeb-${version}.mac.arm64.dmg"; 39 hash = "sha256-bkhwsWYLkec16vMOfXUce7jfrmI9W2xHiZvU1asebK4="; 40 }; 41 }; 42 src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); 43 44 libraries = [ 45 alsa-lib 46 at-spi2-atk 47 gdk-pixbuf 48 nss 49 udev 50 xorg.libX11 51 xorg.libXcomposite 52 xorg.libXext 53 xorg.libXrandr 54 xorg.libXScrnSaver 55 xorg.libXtst 56 xorg.libxshmfence 57 gnome.gnome-keyring 58 mesa 59 gtk3 60 libusb1 61 libsecret 62 libappindicator 63 xdotool 64 ]; 65 66 meta = with lib; { 67 description = "Free cross-platform password manager compatible with KeePass"; 68 homepage = "https://keeweb.info/"; 69 changelog = "https://github.com/keeweb/keeweb/blob/v${version}/release-notes.md"; 70 sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 71 license = licenses.mit; 72 maintainers = with maintainers; [ sikmir ]; 73 platforms = builtins.attrNames srcs; 74 }; 75in 76if stdenv.isDarwin 77then stdenv.mkDerivation { 78 inherit pname version src meta; 79 80 nativeBuildInputs = [ undmg ]; 81 82 sourceRoot = "."; 83 84 installPhase = '' 85 mkdir -p $out/Applications 86 cp -r *.app $out/Applications 87 ''; 88} 89else stdenv.mkDerivation { 90 inherit pname version src meta; 91 92 nativeBuildInputs = [ 93 autoPatchelfHook 94 wrapGAppsHook 95 makeWrapper 96 ]; 97 98 buildInputs = libraries; 99 100 unpackPhase = '' 101 ${dpkg}/bin/dpkg-deb --fsys-tarfile $src | tar --extract 102 ''; 103 104 installPhase = '' 105 runHook preInstall 106 107 mkdir -p $out/bin 108 cp -r usr/share $out/share 109 110 makeWrapper $out/share/keeweb-desktop/keeweb $out/bin/keeweb \ 111 --argv0 "keeweb" \ 112 --add-flags "$out/share/keeweb-desktop/resources/app.asar" \ 113 --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libraries}" 114 115 runHook postInstall 116 ''; 117}