Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Forked from RonnyPfannschmidt/build.nix
Last active June 11, 2016 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cleverca22/312977930eacfc5367bdb05f8ddeacf6 to your computer and use it in GitHub Desktop.
Save cleverca22/312977930eacfc5367bdb05f8ddeacf6 to your computer and use it in GitHub Desktop.
enpass test build setup using nixpkgs from git
with import <nixpkgs> {};
callPackage ./enpass { qt = qt56; }
{
version = "5.2.1.1";
path = "pool/main/e/enpass/enpass_5.2.1.1_amd64.deb";
sha256 = "772cb5656c55605f1c7ac58203ab0cf07894c57c19f1709dac36455287cbd953";
}
{stdenv, fetchurl, dpkg, patchelf, openssl, xorg
, glib, mesa, libpulseaudio, zlib, dbus
, qt, makeWrapper
, ...}:
let
data = import ./data.nix;
uselibs = with xorg; [
qt.qtbase
qt.qtmultimedia
qt.qtxmlpatterns
qt.qtwebsockets
openssl.out
mesa
libpulseaudio
zlib
dbus
libX11
libXext
libXScrnSaver
glib.out
];
libPath = stdenv.lib.makeLibraryPath ([
stdenv.cc
stdenv.cc.cc.lib
] ++ uselibs);
in stdenv.mkDerivation rec {
version = data.version;
name = "enpass-${version}";
src = fetchurl {
url = "http://repo.sinew.in/${data.path}";
sha256 = data.sha256;
};
buildInputs = [makeWrapper dpkg patchelf qt.makeQtWrapper ];
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
unpackPhase = "dpkg -X $src .";
installPhase=''
mkdir $out
cp -r opt/Enpass/* $out
rm $out/lib -r
rm -r $out/plugins/platforms/
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
$out/bin/Enpass
wrapQtProgram $out/bin/Enpass --set LD_LIBRARY_PATH "${libPath}:$out/plugins/sqldrivers/"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment